@goondocks/myco 0.19.4 → 0.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-run-OGWPNU43.js → agent-run-WK5NKBYA.js} +9 -5
- package/dist/{agent-run-OGWPNU43.js.map → agent-run-WK5NKBYA.js.map} +1 -1
- package/dist/{agent-tasks-XWMDAEPG.js → agent-tasks-2E73GG3A.js} +9 -5
- package/dist/{agent-tasks-XWMDAEPG.js.map → agent-tasks-2E73GG3A.js.map} +1 -1
- package/dist/{chunk-QLCD77AN.js → chunk-6RFZWV4R.js} +18 -1
- package/dist/chunk-6RFZWV4R.js.map +1 -0
- package/dist/{chunk-PLYWR5D7.js → chunk-FKBPXCH3.js} +2 -2
- package/dist/{chunk-5B2ORGTF.js → chunk-NCBLB2C6.js} +3 -3
- package/dist/{chunk-3C4LT4BW.js → chunk-NKQZ73LL.js} +3 -2
- package/dist/chunk-NKQZ73LL.js.map +1 -0
- package/dist/{chunk-RTNLDAIC.js → chunk-P5VNHGVZ.js} +3 -3
- package/dist/chunk-P5VNHGVZ.js.map +1 -0
- package/dist/{chunk-W3P6MHLQ.js → chunk-QH5HS54N.js} +2 -2
- package/dist/{chunk-NTWJR6KH.js → chunk-ST2D3SGM.js} +2 -2
- package/dist/{chunk-WYOE4IAX.js → chunk-TMNFCUAD.js} +81 -8
- package/dist/chunk-TMNFCUAD.js.map +1 -0
- package/dist/{chunk-YDCGI3CS.js → chunk-VLGBWOBY.js} +3 -3
- package/dist/{chunk-Y3IJFUVX.js → chunk-W3JUH5S3.js} +2 -2
- package/dist/{cli-XDG624PV.js → cli-LCTXK7N6.js} +41 -37
- package/dist/{cli-XDG624PV.js.map → cli-LCTXK7N6.js.map} +1 -1
- package/dist/{client-EEPUQVMX.js → client-S47ENM76.js} +3 -3
- package/dist/{config-2KQ45OC5.js → config-IO5WALOD.js} +2 -2
- package/dist/{doctor-L4LWMJYH.js → doctor-EE6GAC54.js} +11 -7
- package/dist/{doctor-L4LWMJYH.js.map → doctor-EE6GAC54.js.map} +1 -1
- package/dist/{executor-4TJOZN32.js → executor-NXNSUEMQ.js} +102 -63
- package/dist/executor-NXNSUEMQ.js.map +1 -0
- package/dist/{init-U2SG2IOC.js → init-IPL3XV6F.js} +9 -9
- package/dist/{installer-BWJED3ED.js → installer-WMTB4NCX.js} +8 -2
- package/dist/{loader-JG5OBPB6.js → loader-V774GZU4.js} +2 -2
- package/dist/{main-EVS3FXDJ.js → main-RPJSS7PT.js} +284 -117
- package/dist/main-RPJSS7PT.js.map +1 -0
- package/dist/{open-TEQZXO4A.js → open-OYBKVBYX.js} +9 -5
- package/dist/{open-TEQZXO4A.js.map → open-OYBKVBYX.js.map} +1 -1
- package/dist/{post-compact-POSTGJEV.js → post-compact-E2OVMNGQ.js} +4 -4
- package/dist/{post-tool-use-VE6YPEY2.js → post-tool-use-FGQE26GJ.js} +3 -3
- package/dist/{post-tool-use-failure-LUFD62SB.js → post-tool-use-failure-3CITJYQK.js} +4 -4
- package/dist/{pre-compact-7QGJYRJF.js → pre-compact-GYMHCXII.js} +4 -4
- package/dist/{remove-4UZXDSVY.js → remove-72ER3TG5.js} +6 -6
- package/dist/{restart-HLXD4ZGX.js → restart-EQHEJCGT.js} +10 -6
- package/dist/{restart-HLXD4ZGX.js.map → restart-EQHEJCGT.js.map} +1 -1
- package/dist/{search-MWXY3GTI.js → search-JOBYIW43.js} +9 -5
- package/dist/{search-MWXY3GTI.js.map → search-JOBYIW43.js.map} +1 -1
- package/dist/{server-TQY7CYOS.js → server-PZCWYWZL.js} +3 -3
- package/dist/{session-P2POKO22.js → session-APO4A2C7.js} +9 -5
- package/dist/{session-P2POKO22.js.map → session-APO4A2C7.js.map} +1 -1
- package/dist/{session-end-DZNJHGQB.js → session-end-4V4VHAOQ.js} +3 -3
- package/dist/{session-start-JNNJTP3C.js → session-start-K6ESRZU7.js} +4 -4
- package/dist/{setup-llm-UQO2INBY.js → setup-llm-QUWOSB7A.js} +6 -6
- package/dist/src/agent/definitions/tasks/full-intelligence.yaml +37 -8
- package/dist/src/agent/prompts/agent.md +2 -2
- package/dist/src/cli.js +1 -1
- package/dist/src/daemon/main.js +1 -1
- package/dist/src/hooks/post-tool-use.js +1 -1
- package/dist/src/hooks/session-end.js +1 -1
- package/dist/src/hooks/session-start.js +1 -1
- package/dist/src/hooks/stop.js +1 -1
- package/dist/src/hooks/user-prompt-submit.js +1 -1
- package/dist/src/mcp/server.js +1 -1
- package/dist/{stats-DJYTDCUE.js → stats-TYOZAOP2.js} +7 -7
- package/dist/{stop-VBA4RMQM.js → stop-2COOWEYG.js} +3 -3
- package/dist/{stop-failure-54Z2HSU4.js → stop-failure-UQ33GZLE.js} +4 -4
- package/dist/{subagent-start-XL773ZID.js → subagent-start-YENEY6VF.js} +4 -4
- package/dist/{subagent-stop-HJVSYNII.js → subagent-stop-W2757YDB.js} +4 -4
- package/dist/{task-completed-GLNYNBYP.js → task-completed-KU6GWMWV.js} +4 -4
- package/dist/{team-M6TC4TFC.js → team-SNLC6FZM.js} +3 -3
- package/dist/{turns-3ZQAF6HF.js → turns-YFNI5CQC.js} +6 -4
- package/dist/ui/assets/index-816yFmz_.js +842 -0
- package/dist/ui/assets/index-Dj6vQpFd.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/{update-JZV2K4YG.js → update-5VYNQZJ4.js} +6 -6
- package/dist/update-5VYNQZJ4.js.map +1 -0
- package/dist/{user-prompt-submit-6KMTMHKW.js → user-prompt-submit-KATLHAKA.js} +3 -3
- package/dist/{verify-CJHF23QH.js → verify-BGJVB3K2.js} +2 -2
- package/dist/{version-KS3UADP5.js → version-MKNN5GYM.js} +2 -2
- package/package.json +1 -1
- package/skills/rules/SKILL.md +6 -0
- package/dist/chunk-3C4LT4BW.js.map +0 -1
- package/dist/chunk-QLCD77AN.js.map +0 -1
- package/dist/chunk-RTNLDAIC.js.map +0 -1
- package/dist/chunk-WYOE4IAX.js.map +0 -1
- package/dist/executor-4TJOZN32.js.map +0 -1
- package/dist/main-EVS3FXDJ.js.map +0 -1
- package/dist/ui/assets/index-CRmkSi63.css +0 -1
- package/dist/ui/assets/index-CwPuGRsJ.js +0 -842
- package/dist/update-JZV2K4YG.js.map +0 -1
- /package/dist/{chunk-PLYWR5D7.js.map → chunk-FKBPXCH3.js.map} +0 -0
- /package/dist/{chunk-5B2ORGTF.js.map → chunk-NCBLB2C6.js.map} +0 -0
- /package/dist/{chunk-W3P6MHLQ.js.map → chunk-QH5HS54N.js.map} +0 -0
- /package/dist/{chunk-NTWJR6KH.js.map → chunk-ST2D3SGM.js.map} +0 -0
- /package/dist/{chunk-YDCGI3CS.js.map → chunk-VLGBWOBY.js.map} +0 -0
- /package/dist/{chunk-Y3IJFUVX.js.map → chunk-W3JUH5S3.js.map} +0 -0
- /package/dist/{client-EEPUQVMX.js.map → client-S47ENM76.js.map} +0 -0
- /package/dist/{config-2KQ45OC5.js.map → config-IO5WALOD.js.map} +0 -0
- /package/dist/{init-U2SG2IOC.js.map → init-IPL3XV6F.js.map} +0 -0
- /package/dist/{installer-BWJED3ED.js.map → installer-WMTB4NCX.js.map} +0 -0
- /package/dist/{loader-JG5OBPB6.js.map → loader-V774GZU4.js.map} +0 -0
- /package/dist/{post-compact-POSTGJEV.js.map → post-compact-E2OVMNGQ.js.map} +0 -0
- /package/dist/{post-tool-use-VE6YPEY2.js.map → post-tool-use-FGQE26GJ.js.map} +0 -0
- /package/dist/{post-tool-use-failure-LUFD62SB.js.map → post-tool-use-failure-3CITJYQK.js.map} +0 -0
- /package/dist/{pre-compact-7QGJYRJF.js.map → pre-compact-GYMHCXII.js.map} +0 -0
- /package/dist/{remove-4UZXDSVY.js.map → remove-72ER3TG5.js.map} +0 -0
- /package/dist/{server-TQY7CYOS.js.map → server-PZCWYWZL.js.map} +0 -0
- /package/dist/{session-end-DZNJHGQB.js.map → session-end-4V4VHAOQ.js.map} +0 -0
- /package/dist/{session-start-JNNJTP3C.js.map → session-start-K6ESRZU7.js.map} +0 -0
- /package/dist/{setup-llm-UQO2INBY.js.map → setup-llm-QUWOSB7A.js.map} +0 -0
- /package/dist/{stats-DJYTDCUE.js.map → stats-TYOZAOP2.js.map} +0 -0
- /package/dist/{stop-VBA4RMQM.js.map → stop-2COOWEYG.js.map} +0 -0
- /package/dist/{stop-failure-54Z2HSU4.js.map → stop-failure-UQ33GZLE.js.map} +0 -0
- /package/dist/{subagent-start-XL773ZID.js.map → subagent-start-YENEY6VF.js.map} +0 -0
- /package/dist/{subagent-stop-HJVSYNII.js.map → subagent-stop-W2757YDB.js.map} +0 -0
- /package/dist/{task-completed-GLNYNBYP.js.map → task-completed-KU6GWMWV.js.map} +0 -0
- /package/dist/{team-M6TC4TFC.js.map → team-SNLC6FZM.js.map} +0 -0
- /package/dist/{turns-3ZQAF6HF.js.map → turns-YFNI5CQC.js.map} +0 -0
- /package/dist/{user-prompt-submit-6KMTMHKW.js.map → user-prompt-submit-KATLHAKA.js.map} +0 -0
- /package/dist/{verify-CJHF23QH.js.map → verify-BGJVB3K2.js.map} +0 -0
- /package/dist/{version-KS3UADP5.js.map → version-MKNN5GYM.js.map} +0 -0
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
var $C=e=>{throw TypeError(e)};var Hy=(e,t,n)=>t.has(e)||$C("Cannot "+n);var te=(e,t,n)=>(Hy(e,t,"read from private field"),n?n.call(e):t.get(e)),et=(e,t,n)=>t.has(e)?$C("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pe=(e,t,n,r)=>(Hy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),mt=(e,t,n)=>(Hy(e,t,"access private method"),n);var hv=(e,t,n,r)=>({set _(a){Pe(e,t,a,n)},get _(){return te(e,t,r)}});function z4(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function Nd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gy={exports:{}},Ef={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and 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 KC;function I4(){if(KC)return Ef;KC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var o in a)o!=="key"&&(i[o]=a[o])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return Ef.Fragment=t,Ef.jsx=n,Ef.jsxs=n,Ef}var YC;function F4(){return YC||(YC=1,Gy.exports=I4()),Gy.exports}var d=F4(),$y={exports:{}},ft={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and 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 XC;function U4(){if(XC)return ft;XC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function y(q){return q===null||typeof q!="object"?null:(q=m&&q[m]||q["@@iterator"],typeof q=="function"?q:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function S(q,X,P){this.props=q,this.context=X,this.refs=w,this.updater=P||x}S.prototype.isReactComponent={},S.prototype.setState=function(q,X){if(typeof q!="object"&&typeof q!="function"&&q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,q,X,"setState")},S.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function N(){}N.prototype=S.prototype;function E(q,X,P){this.props=q,this.context=X,this.refs=w,this.updater=P||x}var T=E.prototype=new N;T.constructor=E,b(T,S.prototype),T.isPureReactComponent=!0;var R=Array.isArray;function A(){}var D={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function L(q,X,P){var Z=P.ref;return{$$typeof:e,type:q,key:X,ref:Z!==void 0?Z:null,props:P}}function M(q,X){return L(q.type,X,q.props)}function z(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function B(q){var X={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(P){return X[P]})}var H=/\/+/g;function G(q,X){return typeof q=="object"&&q!==null&&q.key!=null?B(""+q.key):X.toString(36)}function U(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(A,A):(q.status="pending",q.then(function(X){q.status==="pending"&&(q.status="fulfilled",q.value=X)},function(X){q.status==="pending"&&(q.status="rejected",q.reason=X)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function I(q,X,P,Z,ae){var ie=typeof q;(ie==="undefined"||ie==="boolean")&&(q=null);var le=!1;if(q===null)le=!0;else switch(ie){case"bigint":case"string":case"number":le=!0;break;case"object":switch(q.$$typeof){case e:case t:le=!0;break;case h:return le=q._init,I(le(q._payload),X,P,Z,ae)}}if(le)return ae=ae(q),le=Z===""?"."+G(q,0):Z,R(ae)?(P="",le!=null&&(P=le.replace(H,"$&/")+"/"),I(ae,X,P,"",function(W){return W})):ae!=null&&(z(ae)&&(ae=M(ae,P+(ae.key==null||q&&q.key===ae.key?"":(""+ae.key).replace(H,"$&/")+"/")+le)),X.push(ae)),1;le=0;var ye=Z===""?".":Z+":";if(R(q))for(var ne=0;ne<q.length;ne++)Z=q[ne],ie=ye+G(Z,ne),le+=I(Z,X,P,ie,ae);else if(ne=y(q),typeof ne=="function")for(q=ne.call(q),ne=0;!(Z=q.next()).done;)Z=Z.value,ie=ye+G(Z,ne++),le+=I(Z,X,P,ie,ae);else if(ie==="object"){if(typeof q.then=="function")return I(U(q),X,P,Z,ae);throw X=String(q),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return le}function V(q,X,P){if(q==null)return q;var Z=[],ae=0;return I(q,Z,"","",function(ie){return X.call(P,ie,ae++)}),Z}function K(q){if(q._status===-1){var X=q._result;X=X(),X.then(function(P){(q._status===0||q._status===-1)&&(q._status=1,q._result=P)},function(P){(q._status===0||q._status===-1)&&(q._status=2,q._result=P)}),q._status===-1&&(q._status=0,q._result=X)}if(q._status===1)return q._result.default;throw q._result}var Q=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},F={map:V,forEach:function(q,X,P){V(q,function(){X.apply(this,arguments)},P)},count:function(q){var X=0;return V(q,function(){X++}),X},toArray:function(q){return V(q,function(X){return X})||[]},only:function(q){if(!z(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return ft.Activity=p,ft.Children=F,ft.Component=S,ft.Fragment=n,ft.Profiler=a,ft.PureComponent=E,ft.StrictMode=r,ft.Suspense=f,ft.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,ft.__COMPILER_RUNTIME={__proto__:null,c:function(q){return D.H.useMemoCache(q)}},ft.cache=function(q){return function(){return q.apply(null,arguments)}},ft.cacheSignal=function(){return null},ft.cloneElement=function(q,X,P){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var Z=b({},q.props),ae=q.key;if(X!=null)for(ie in X.key!==void 0&&(ae=""+X.key),X)!_.call(X,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&X.ref===void 0||(Z[ie]=X[ie]);var ie=arguments.length-2;if(ie===1)Z.children=P;else if(1<ie){for(var le=Array(ie),ye=0;ye<ie;ye++)le[ye]=arguments[ye+2];Z.children=le}return L(q.type,ae,Z)},ft.createContext=function(q){return q={$$typeof:l,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:i,_context:q},q},ft.createElement=function(q,X,P){var Z,ae={},ie=null;if(X!=null)for(Z in X.key!==void 0&&(ie=""+X.key),X)_.call(X,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ae[Z]=X[Z]);var le=arguments.length-2;if(le===1)ae.children=P;else if(1<le){for(var ye=Array(le),ne=0;ne<le;ne++)ye[ne]=arguments[ne+2];ae.children=ye}if(q&&q.defaultProps)for(Z in le=q.defaultProps,le)ae[Z]===void 0&&(ae[Z]=le[Z]);return L(q,ie,ae)},ft.createRef=function(){return{current:null}},ft.forwardRef=function(q){return{$$typeof:o,render:q}},ft.isValidElement=z,ft.lazy=function(q){return{$$typeof:h,_payload:{_status:-1,_result:q},_init:K}},ft.memo=function(q,X){return{$$typeof:c,type:q,compare:X===void 0?null:X}},ft.startTransition=function(q){var X=D.T,P={};D.T=P;try{var Z=q(),ae=D.S;ae!==null&&ae(P,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(A,Q)}catch(ie){Q(ie)}finally{X!==null&&P.types!==null&&(X.types=P.types),D.T=X}},ft.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},ft.use=function(q){return D.H.use(q)},ft.useActionState=function(q,X,P){return D.H.useActionState(q,X,P)},ft.useCallback=function(q,X){return D.H.useCallback(q,X)},ft.useContext=function(q){return D.H.useContext(q)},ft.useDebugValue=function(){},ft.useDeferredValue=function(q,X){return D.H.useDeferredValue(q,X)},ft.useEffect=function(q,X){return D.H.useEffect(q,X)},ft.useEffectEvent=function(q){return D.H.useEffectEvent(q)},ft.useId=function(){return D.H.useId()},ft.useImperativeHandle=function(q,X,P){return D.H.useImperativeHandle(q,X,P)},ft.useInsertionEffect=function(q,X){return D.H.useInsertionEffect(q,X)},ft.useLayoutEffect=function(q,X){return D.H.useLayoutEffect(q,X)},ft.useMemo=function(q,X){return D.H.useMemo(q,X)},ft.useOptimistic=function(q,X){return D.H.useOptimistic(q,X)},ft.useReducer=function(q,X,P){return D.H.useReducer(q,X,P)},ft.useRef=function(q){return D.H.useRef(q)},ft.useState=function(q){return D.H.useState(q)},ft.useSyncExternalStore=function(q,X,P){return D.H.useSyncExternalStore(q,X,P)},ft.useTransition=function(){return D.H.useTransition()},ft.version="19.2.4",ft}var QC;function E1(){return QC||(QC=1,$y.exports=U4()),$y.exports}var j=E1();const Xi=Nd(j),mR=z4({__proto__:null,default:Xi},[j]);var Ky={exports:{}},Cf={},Yy={exports:{}},Xy={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and 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
|
+
*/var WC;function q4(){return WC||(WC=1,(function(e){function t(I,V){var K=I.length;I.push(V);e:for(;0<K;){var Q=K-1>>>1,F=I[Q];if(0<a(F,V))I[Q]=V,I[K]=F,K=Q;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var V=I[0],K=I.pop();if(K!==V){I[0]=K;e:for(var Q=0,F=I.length,q=F>>>1;Q<q;){var X=2*(Q+1)-1,P=I[X],Z=X+1,ae=I[Z];if(0>a(P,K))Z<F&&0>a(ae,P)?(I[Q]=ae,I[Z]=K,Q=Z):(I[Q]=P,I[X]=K,Q=X);else if(Z<F&&0>a(ae,K))I[Q]=ae,I[Z]=K,Q=Z;else break e}}return V}function a(I,V){var K=I.sortIndex-V.sortIndex;return K!==0?K:I.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var f=[],c=[],h=1,p=null,m=3,y=!1,x=!1,b=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(I){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=I)r(c),V.sortIndex=V.expirationTime,t(f,V);else break;V=n(c)}}function R(I){if(b=!1,T(I),!x)if(n(f)!==null)x=!0,A||(A=!0,B());else{var V=n(c);V!==null&&U(R,V.startTime-I)}}var A=!1,D=-1,_=5,L=-1;function M(){return w?!0:!(e.unstable_now()-L<_)}function z(){if(w=!1,A){var I=e.unstable_now();L=I;var V=!0;try{e:{x=!1,b&&(b=!1,N(D),D=-1),y=!0;var K=m;try{t:{for(T(I),p=n(f);p!==null&&!(p.expirationTime>I&&M());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,m=p.priorityLevel;var F=Q(p.expirationTime<=I);if(I=e.unstable_now(),typeof F=="function"){p.callback=F,T(I),V=!0;break t}p===n(f)&&r(f),T(I)}else r(f);p=n(f)}if(p!==null)V=!0;else{var q=n(c);q!==null&&U(R,q.startTime-I),V=!1}}break e}finally{p=null,m=K,y=!1}V=void 0}}finally{V?B():A=!1}}}var B;if(typeof E=="function")B=function(){E(z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,G=H.port2;H.port1.onmessage=z,B=function(){G.postMessage(null)}}else B=function(){S(z,0)};function U(I,V){D=S(function(){I(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(I){switch(m){case 1:case 2:case 3:var V=3;break;default:V=m}var K=m;m=V;try{return I()}finally{m=K}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(I,V){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var K=m;m=I;try{return V()}finally{m=K}},e.unstable_scheduleCallback=function(I,V,K){var Q=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?Q+K:Q):K=Q,I){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=K+F,I={id:h++,callback:V,priorityLevel:I,startTime:K,expirationTime:F,sortIndex:-1},K>Q?(I.sortIndex=K,t(c,I),n(f)===null&&I===n(c)&&(b?(N(D),D=-1):b=!0,U(R,K-Q))):(I.sortIndex=F,t(f,I),x||y||(x=!0,A||(A=!0,B()))),I},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(I){var V=m;return function(){var K=m;m=V;try{return I.apply(this,arguments)}finally{m=K}}}})(Xy)),Xy}var ZC;function V4(){return ZC||(ZC=1,Yy.exports=q4()),Yy.exports}var Qy={exports:{}},mr={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and 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 JC;function H4(){if(JC)return mr;JC=1;var e=E1();function t(f){var c="https://react.dev/errors/"+f;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+f+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(f,c,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:f,containerInfo:c,implementation:h}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(f,c){if(f==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return mr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,mr.createPortal=function(f,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return i(f,c,null,h)},mr.flushSync=function(f){var c=l.T,h=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=c,r.p=h,r.d.f()}},mr.preconnect=function(f,c){typeof f=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,r.d.C(f,c))},mr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},mr.preinit=function(f,c){if(typeof f=="string"&&c&&typeof c.as=="string"){var h=c.as,p=o(h,c.crossOrigin),m=typeof c.integrity=="string"?c.integrity:void 0,y=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;h==="style"?r.d.S(f,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:y}):h==="script"&&r.d.X(f,{crossOrigin:p,integrity:m,fetchPriority:y,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},mr.preinitModule=function(f,c){if(typeof f=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var h=o(c.as,c.crossOrigin);r.d.M(f,{crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&r.d.M(f)},mr.preload=function(f,c){if(typeof f=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var h=c.as,p=o(h,c.crossOrigin);r.d.L(f,h,{crossOrigin:p,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},mr.preloadModule=function(f,c){if(typeof f=="string")if(c){var h=o(c.as,c.crossOrigin);r.d.m(f,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else r.d.m(f)},mr.requestFormReset=function(f){r.d.r(f)},mr.unstable_batchedUpdates=function(f,c){return f(c)},mr.useFormState=function(f,c,h){return l.H.useFormState(f,c,h)},mr.useFormStatus=function(){return l.H.useHostTransitionStatus()},mr.version="19.2.4",mr}var eN;function gR(){if(eN)return Qy.exports;eN=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qy.exports=H4(),Qy.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var tN;function G4(){if(tN)return Cf;tN=1;var e=V4(),t=E1(),n=gR();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)u+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+s+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function i(s){var u=s,v=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(v=u.return),s=u.return;while(s)}return u.tag===3?v:null}function l(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function o(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function f(s){if(i(s)!==s)throw Error(r(188))}function c(s){var u=s.alternate;if(!u){if(u=i(s),u===null)throw Error(r(188));return u!==s?null:s}for(var v=s,g=u;;){var C=v.return;if(C===null)break;var k=C.alternate;if(k===null){if(g=C.return,g!==null){v=g;continue}break}if(C.child===k.child){for(k=C.child;k;){if(k===v)return f(C),s;if(k===g)return f(C),u;k=k.sibling}throw Error(r(188))}if(v.return!==g.return)v=C,g=k;else{for(var O=!1,$=C.child;$;){if($===v){O=!0,v=C,g=k;break}if($===g){O=!0,g=C,v=k;break}$=$.sibling}if(!O){for($=k.child;$;){if($===v){O=!0,v=k,g=C;break}if($===g){O=!0,g=k,v=C;break}$=$.sibling}if(!O)throw Error(r(189))}}if(v.alternate!==g)throw Error(r(190))}if(v.tag!==3)throw Error(r(188));return v.stateNode.current===v?s:u}function h(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=h(s),u!==null)return u;s=s.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),E=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function B(s){return s===null||typeof s!="object"?null:(s=z&&s[z]||s["@@iterator"],typeof s=="function"?s:null)}var H=Symbol.for("react.client.reference");function G(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===H?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case b:return"Fragment";case S:return"Profiler";case w:return"StrictMode";case R:return"Suspense";case A:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case E:return s.displayName||"Context";case N:return(s._context.displayName||"Context")+".Consumer";case T:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return u=s.displayName||null,u!==null?u:G(s.type)||"Memo";case _:u=s._payload,s=s._init;try{return G(s(u))}catch{}}return null}var U=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},Q=[],F=-1;function q(s){return{current:s}}function X(s){0>F||(s.current=Q[F],Q[F]=null,F--)}function P(s,u){F++,Q[F]=s.current,s.current=u}var Z=q(null),ae=q(null),ie=q(null),le=q(null);function ye(s,u){switch(P(ie,u),P(ae,s),P(Z,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?pC(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=pC(u),s=mC(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}X(Z),P(Z,s)}function ne(){X(Z),X(ae),X(ie)}function W(s){s.memoizedState!==null&&P(le,s);var u=Z.current,v=mC(u,s.type);u!==v&&(P(ae,s),P(Z,v))}function J(s){ae.current===s&&(X(Z),X(ae)),le.current===s&&(X(le),xf._currentValue=K)}var se,ge;function Te(s){if(se===void 0)try{throw Error()}catch(v){var u=v.stack.trim().match(/\n( *(at )?)/);se=u&&u[1]||"",ge=-1<v.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<v.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+se+s+ge}var Be=!1;function ot(s,u){if(!s||Be)return"";Be=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(u){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(me){var ve=me}Reflect.construct(s,[],Ee)}else{try{Ee.call()}catch(me){ve=me}s.call(Ee.prototype)}}else{try{throw Error()}catch(me){ve=me}(Ee=s())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(me){if(me&&ve&&typeof me.stack=="string")return[me.stack,ve.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),O=k[0],$=k[1];if(O&&$){var ee=O.split(`
|
|
44
|
+
`),fe=$.split(`
|
|
45
|
+
`);for(C=g=0;g<ee.length&&!ee[g].includes("DetermineComponentFrameRoot");)g++;for(;C<fe.length&&!fe[C].includes("DetermineComponentFrameRoot");)C++;if(g===ee.length||C===fe.length)for(g=ee.length-1,C=fe.length-1;1<=g&&0<=C&&ee[g]!==fe[C];)C--;for(;1<=g&&0<=C;g--,C--)if(ee[g]!==fe[C]){if(g!==1||C!==1)do if(g--,C--,0>C||ee[g]!==fe[C]){var we=`
|
|
46
|
+
`+ee[g].replace(" at new "," at ");return s.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",s.displayName)),we}while(1<=g&&0<=C);break}}}finally{Be=!1,Error.prepareStackTrace=v}return(v=s?s.displayName||s.name:"")?Te(v):""}function Je(s,u){switch(s.tag){case 26:case 27:case 5:return Te(s.type);case 16:return Te("Lazy");case 13:return s.child!==u&&u!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return ot(s.type,!1);case 11:return ot(s.type.render,!1);case 1:return ot(s.type,!0);case 31:return Te("Activity");default:return""}}function We(s){try{var u="",v=null;do u+=Je(s,v),v=s,s=s.return;while(s);return u}catch(g){return`
|
|
47
|
+
Error generating stack: `+g.message+`
|
|
48
|
+
`+g.stack}}var Ve=Object.prototype.hasOwnProperty,De=e.unstable_scheduleCallback,Ye=e.unstable_cancelCallback,Qe=e.unstable_shouldYield,st=e.unstable_requestPaint,ze=e.unstable_now,dt=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,_e=e.unstable_IdlePriority,Oe=e.log,xe=e.unstable_setDisableYieldValue,Y=null,ue=null;function pe(s){if(typeof Oe=="function"&&xe(s),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(Y,s)}catch{}}var de=Math.clz32?Math.clz32:Ne,be=Math.log,Le=Math.LN2;function Ne(s){return s>>>=0,s===0?32:31-(be(s)/Le|0)|0}var Ke=256,Ue=262144,Ze=4194304;function ut(s){var u=s&42;if(u!==0)return u;switch(s&-s){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ct(s,u,v){var g=s.pendingLanes;if(g===0)return 0;var C=0,k=s.suspendedLanes,O=s.pingedLanes;s=s.warmLanes;var $=g&134217727;return $!==0?(g=$&~k,g!==0?C=ut(g):(O&=$,O!==0?C=ut(O):v||(v=$&~s,v!==0&&(C=ut(v))))):($=g&~k,$!==0?C=ut($):O!==0?C=ut(O):v||(v=g&~s,v!==0&&(C=ut(v)))),C===0?0:u!==0&&u!==C&&(u&k)===0&&(k=C&-C,v=u&-u,k>=v||k===32&&(v&4194048)!==0)?u:C}function He(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function bt(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32: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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vt(){var s=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),s}function hn(s){for(var u=[],v=0;31>v;v++)u.push(s);return u}function Vt(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ar(s,u,v,g,C,k){var O=s.pendingLanes;s.pendingLanes=v,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=v,s.entangledLanes&=v,s.errorRecoveryDisabledLanes&=v,s.shellSuspendCounter=0;var $=s.entanglements,ee=s.expirationTimes,fe=s.hiddenUpdates;for(v=O&~v;0<v;){var we=31-de(v),Ee=1<<we;$[we]=0,ee[we]=-1;var ve=fe[we];if(ve!==null)for(fe[we]=null,we=0;we<ve.length;we++){var me=ve[we];me!==null&&(me.lane&=-536870913)}v&=~Ee}g!==0&&vn(s,g,0),k!==0&&C===0&&s.tag!==0&&(s.suspendedLanes|=k&~(O&~u))}function vn(s,u,v){s.pendingLanes|=u,s.suspendedLanes&=~u;var g=31-de(u);s.entangledLanes|=u,s.entanglements[g]=s.entanglements[g]|1073741824|v&261930}function Cn(s,u){var v=s.entangledLanes|=u;for(s=s.entanglements;v;){var g=31-de(v),C=1<<g;C&u|s[g]&u&&(s[g]|=u),v&=~C}}function yn(s,u){var v=u&-u;return v=(v&42)!==0?1:Nn(v),(v&(s.suspendedLanes|u))!==0?0:v}function Nn(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ha(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function pn(){var s=V.p;return s!==0?s:(s=window.event,s===void 0?32:IC(s.type))}function va(s,u){var v=V.p;try{return V.p=s,u()}finally{V.p=v}}var Kn=Math.random().toString(36).slice(2),un="__reactFiber$"+Kn,In="__reactProps$"+Kn,Or="__reactContainer$"+Kn,Yn="__reactEvents$"+Kn,Xn="__reactListeners$"+Kn,vr="__reactHandles$"+Kn,ps="__reactResources$"+Kn,Qn="__reactMarker$"+Kn;function Bo(s){delete s[un],delete s[In],delete s[Yn],delete s[Xn],delete s[vr]}function ms(s){var u=s[un];if(u)return u;for(var v=s.parentNode;v;){if(u=v[Or]||v[un]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(s=EC(s);s!==null;){if(v=s[un])return v;s=EC(s)}return u}s=v,v=s.parentNode}return null}function gs(s){if(s=s[un]||s[Or]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Ll(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function ys(s){var u=s[ps];return u||(u=s[ps]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function Rn(s){s[Qn]=!0}var Jd=new Set,eh={};function Zr(s,u){Ja(s,u),Ja(s+"Capture",u)}function Ja(s,u){for(eh[s]=u,s=0;s<u.length;s++)Jd.add(u[s])}var zo=RegExp("^[: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]*$"),_c={},Oc={};function Pm(s){return Ve.call(Oc,s)?!0:Ve.call(_c,s)?!1:zo.test(s)?Oc[s]=!0:(_c[s]=!0,!1)}function pr(s,u,v){if(Pm(u))if(v===null)s.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+v)}}function xs(s,u,v){if(v===null)s.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+v)}}function pa(s,u,v,g){if(g===null)s.removeAttribute(v);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(v);return}s.setAttributeNS(u,v,""+g)}}function Wn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Lr(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Bm(s,u,v){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var C=g.get,k=g.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return C.call(this)},set:function(O){v=""+O,k.call(this,O)}}),Object.defineProperty(s,u,{enumerable:g.enumerable}),{getValue:function(){return v},setValue:function(O){v=""+O},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function th(s){if(!s._valueTracker){var u=Lr(s)?"checked":"value";s._valueTracker=Bm(s,u,""+s[u])}}function nh(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var v=u.getValue(),g="";return s&&(g=Lr(s)?s.checked?"true":"false":s.value),s=g,s!==v?(u.setValue(s),!0):!1}function rh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var M3=/[\n"\\]/g;function ma(s){return s.replace(M3,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function zm(s,u,v,g,C,k,O,$){s.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.type=O:s.removeAttribute("type"),u!=null?O==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+Wn(u)):s.value!==""+Wn(u)&&(s.value=""+Wn(u)):O!=="submit"&&O!=="reset"||s.removeAttribute("value"),u!=null?Im(s,O,Wn(u)):v!=null?Im(s,O,Wn(v)):g!=null&&s.removeAttribute("value"),C==null&&k!=null&&(s.defaultChecked=!!k),C!=null&&(s.checked=C&&typeof C!="function"&&typeof C!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?s.name=""+Wn($):s.removeAttribute("name")}function uS(s,u,v,g,C,k,O,$){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),u!=null||v!=null){if(!(k!=="submit"&&k!=="reset"||u!=null)){th(s);return}v=v!=null?""+Wn(v):"",u=u!=null?""+Wn(u):v,$||u===s.value||(s.value=u),s.defaultValue=u}g=g??C,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=$?s.checked:!!g,s.defaultChecked=!!g,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(s.name=O),th(s)}function Im(s,u,v){u==="number"&&rh(s.ownerDocument)===s||s.defaultValue===""+v||(s.defaultValue=""+v)}function Io(s,u,v,g){if(s=s.options,u){u={};for(var C=0;C<v.length;C++)u["$"+v[C]]=!0;for(v=0;v<s.length;v++)C=u.hasOwnProperty("$"+s[v].value),s[v].selected!==C&&(s[v].selected=C),C&&g&&(s[v].defaultSelected=!0)}else{for(v=""+Wn(v),u=null,C=0;C<s.length;C++){if(s[C].value===v){s[C].selected=!0,g&&(s[C].defaultSelected=!0);return}u!==null||s[C].disabled||(u=s[C])}u!==null&&(u.selected=!0)}}function cS(s,u,v){if(u!=null&&(u=""+Wn(u),u!==s.value&&(s.value=u),v==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=v!=null?""+Wn(v):""}function fS(s,u,v,g){if(u==null){if(g!=null){if(v!=null)throw Error(r(92));if(U(g)){if(1<g.length)throw Error(r(93));g=g[0]}v=g}v==null&&(v=""),u=v}v=Wn(u),s.defaultValue=v,g=s.textContent,g===v&&g!==""&&g!==null&&(s.value=g),th(s)}function Fo(s,u){if(u){var v=s.firstChild;if(v&&v===s.lastChild&&v.nodeType===3){v.nodeValue=u;return}}s.textContent=u}var _3=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dS(s,u,v){var g=u.indexOf("--")===0;v==null||typeof v=="boolean"||v===""?g?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":g?s.setProperty(u,v):typeof v!="number"||v===0||_3.has(u)?u==="float"?s.cssFloat=v:s[u]=(""+v).trim():s[u]=v+"px"}function hS(s,u,v){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,v!=null){for(var g in v)!v.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var C in u)g=u[C],u.hasOwnProperty(C)&&v[C]!==g&&dS(s,C,g)}else for(var k in u)u.hasOwnProperty(k)&&dS(s,k,u[k])}function Fm(s){if(s.indexOf("-")===-1)return!1;switch(s){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 O3=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),L3=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ah(s){return L3.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function ji(){}var Um=null;function qm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Uo=null,qo=null;function vS(s){var u=gs(s);if(u&&(s=u.stateNode)){var v=s[In]||null;e:switch(s=u.stateNode,u.type){case"input":if(zm(s,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name),u=v.name,v.type==="radio"&&u!=null){for(v=s;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll('input[name="'+ma(""+u)+'"][type="radio"]'),u=0;u<v.length;u++){var g=v[u];if(g!==s&&g.form===s.form){var C=g[In]||null;if(!C)throw Error(r(90));zm(g,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(u=0;u<v.length;u++)g=v[u],g.form===s.form&&nh(g)}break e;case"textarea":cS(s,v.value,v.defaultValue);break e;case"select":u=v.value,u!=null&&Io(s,!!v.multiple,u,!1)}}}var Vm=!1;function pS(s,u,v){if(Vm)return s(u,v);Vm=!0;try{var g=s(u);return g}finally{if(Vm=!1,(Uo!==null||qo!==null)&&(Gh(),Uo&&(u=Uo,s=qo,qo=Uo=null,vS(u),s)))for(u=0;u<s.length;u++)vS(s[u])}}function Lc(s,u){var v=s.stateNode;if(v===null)return null;var g=v[In]||null;if(g===null)return null;v=g[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(v&&typeof v!="function")throw Error(r(231,u,typeof v));return v}var Ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hm=!1;if(Ai)try{var Pc={};Object.defineProperty(Pc,"passive",{get:function(){Hm=!0}}),window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{Hm=!1}var bs=null,Gm=null,ih=null;function mS(){if(ih)return ih;var s,u=Gm,v=u.length,g,C="value"in bs?bs.value:bs.textContent,k=C.length;for(s=0;s<v&&u[s]===C[s];s++);var O=v-s;for(g=1;g<=O&&u[v-g]===C[k-g];g++);return ih=C.slice(s,1<g?1-g:void 0)}function sh(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function lh(){return!0}function gS(){return!1}function Pr(s){function u(v,g,C,k,O){this._reactName=v,this._targetInst=C,this.type=g,this.nativeEvent=k,this.target=O,this.currentTarget=null;for(var $ in s)s.hasOwnProperty($)&&(v=s[$],this[$]=v?v(k):k[$]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?lh:gS,this.isPropagationStopped=gS,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=lh)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=lh)},persist:function(){},isPersistent:lh}),u}var Pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oh=Pr(Pl),Bc=p({},Pl,{view:0,detail:0}),P3=Pr(Bc),$m,Km,zc,uh=p({},Bc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xm,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==zc&&(zc&&s.type==="mousemove"?($m=s.screenX-zc.screenX,Km=s.screenY-zc.screenY):Km=$m=0,zc=s),$m)},movementY:function(s){return"movementY"in s?s.movementY:Km}}),yS=Pr(uh),B3=p({},uh,{dataTransfer:0}),z3=Pr(B3),I3=p({},Bc,{relatedTarget:0}),Ym=Pr(I3),F3=p({},Pl,{animationName:0,elapsedTime:0,pseudoElement:0}),U3=Pr(F3),q3=p({},Pl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),V3=Pr(q3),H3=p({},Pl,{data:0}),xS=Pr(H3),G3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$3={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"},K3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y3(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=K3[s])?!!u[s]:!1}function Xm(){return Y3}var X3=p({},Bc,{key:function(s){if(s.key){var u=G3[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=sh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?$3[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xm,charCode:function(s){return s.type==="keypress"?sh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?sh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),Q3=Pr(X3),W3=p({},uh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bS=Pr(W3),Z3=p({},Bc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xm}),J3=Pr(Z3),e5=p({},Pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),t5=Pr(e5),n5=p({},uh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),r5=Pr(n5),a5=p({},Pl,{newState:0,oldState:0}),i5=Pr(a5),s5=[9,13,27,32],Qm=Ai&&"CompositionEvent"in window,Ic=null;Ai&&"documentMode"in document&&(Ic=document.documentMode);var l5=Ai&&"TextEvent"in window&&!Ic,wS=Ai&&(!Qm||Ic&&8<Ic&&11>=Ic),SS=" ",ES=!1;function CS(s,u){switch(s){case"keyup":return s5.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function NS(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Vo=!1;function o5(s,u){switch(s){case"compositionend":return NS(u);case"keypress":return u.which!==32?null:(ES=!0,SS);case"textInput":return s=u.data,s===SS&&ES?null:s;default:return null}}function u5(s,u){if(Vo)return s==="compositionend"||!Qm&&CS(s,u)?(s=mS(),ih=Gm=bs=null,Vo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return wS&&u.locale!=="ko"?null:u.data;default:return null}}var c5={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 kS(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!c5[s.type]:u==="textarea"}function TS(s,u,v,g){Uo?qo?qo.push(g):qo=[g]:Uo=g,u=Zh(u,"onChange"),0<u.length&&(v=new oh("onChange","change",null,v,g),s.push({event:v,listeners:u}))}var Fc=null,Uc=null;function f5(s){uC(s,0)}function ch(s){var u=Ll(s);if(nh(u))return s}function jS(s,u){if(s==="change")return u}var AS=!1;if(Ai){var Wm;if(Ai){var Zm="oninput"in document;if(!Zm){var RS=document.createElement("div");RS.setAttribute("oninput","return;"),Zm=typeof RS.oninput=="function"}Wm=Zm}else Wm=!1;AS=Wm&&(!document.documentMode||9<document.documentMode)}function DS(){Fc&&(Fc.detachEvent("onpropertychange",MS),Uc=Fc=null)}function MS(s){if(s.propertyName==="value"&&ch(Uc)){var u=[];TS(u,Uc,s,qm(s)),pS(f5,u)}}function d5(s,u,v){s==="focusin"?(DS(),Fc=u,Uc=v,Fc.attachEvent("onpropertychange",MS)):s==="focusout"&&DS()}function h5(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return ch(Uc)}function v5(s,u){if(s==="click")return ch(u)}function p5(s,u){if(s==="input"||s==="change")return ch(u)}function m5(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Jr=typeof Object.is=="function"?Object.is:m5;function qc(s,u){if(Jr(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var v=Object.keys(s),g=Object.keys(u);if(v.length!==g.length)return!1;for(g=0;g<v.length;g++){var C=v[g];if(!Ve.call(u,C)||!Jr(s[C],u[C]))return!1}return!0}function _S(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function OS(s,u){var v=_S(s);s=0;for(var g;v;){if(v.nodeType===3){if(g=s+v.textContent.length,s<=u&&g>=u)return{node:v,offset:u-s};s=g}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=_S(v)}}function LS(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?LS(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function PS(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=rh(s.document);u instanceof s.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)s=u.contentWindow;else break;u=rh(s.document)}return u}function Jm(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var g5=Ai&&"documentMode"in document&&11>=document.documentMode,Ho=null,eg=null,Vc=null,tg=!1;function BS(s,u,v){var g=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;tg||Ho==null||Ho!==rh(g)||(g=Ho,"selectionStart"in g&&Jm(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Vc&&qc(Vc,g)||(Vc=g,g=Zh(eg,"onSelect"),0<g.length&&(u=new oh("onSelect","select",null,u,v),s.push({event:u,listeners:g}),u.target=Ho)))}function Bl(s,u){var v={};return v[s.toLowerCase()]=u.toLowerCase(),v["Webkit"+s]="webkit"+u,v["Moz"+s]="moz"+u,v}var Go={animationend:Bl("Animation","AnimationEnd"),animationiteration:Bl("Animation","AnimationIteration"),animationstart:Bl("Animation","AnimationStart"),transitionrun:Bl("Transition","TransitionRun"),transitionstart:Bl("Transition","TransitionStart"),transitioncancel:Bl("Transition","TransitionCancel"),transitionend:Bl("Transition","TransitionEnd")},ng={},zS={};Ai&&(zS=document.createElement("div").style,"AnimationEvent"in window||(delete Go.animationend.animation,delete Go.animationiteration.animation,delete Go.animationstart.animation),"TransitionEvent"in window||delete Go.transitionend.transition);function zl(s){if(ng[s])return ng[s];if(!Go[s])return s;var u=Go[s],v;for(v in u)if(u.hasOwnProperty(v)&&v in zS)return ng[s]=u[v];return s}var IS=zl("animationend"),FS=zl("animationiteration"),US=zl("animationstart"),y5=zl("transitionrun"),x5=zl("transitionstart"),b5=zl("transitioncancel"),qS=zl("transitionend"),VS=new Map,rg="abort auxClick beforeToggle 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(" ");rg.push("scrollEnd");function Pa(s,u){VS.set(s,u),Zr(u,[s])}var fh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ga=[],$o=0,ag=0;function dh(){for(var s=$o,u=ag=$o=0;u<s;){var v=ga[u];ga[u++]=null;var g=ga[u];ga[u++]=null;var C=ga[u];ga[u++]=null;var k=ga[u];if(ga[u++]=null,g!==null&&C!==null){var O=g.pending;O===null?C.next=C:(C.next=O.next,O.next=C),g.pending=C}k!==0&&HS(v,C,k)}}function hh(s,u,v,g){ga[$o++]=s,ga[$o++]=u,ga[$o++]=v,ga[$o++]=g,ag|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function ig(s,u,v,g){return hh(s,u,v,g),vh(s)}function Il(s,u){return hh(s,null,null,u),vh(s)}function HS(s,u,v){s.lanes|=v;var g=s.alternate;g!==null&&(g.lanes|=v);for(var C=!1,k=s.return;k!==null;)k.childLanes|=v,g=k.alternate,g!==null&&(g.childLanes|=v),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(C=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,C&&u!==null&&(C=31-de(v),s=k.hiddenUpdates,g=s[C],g===null?s[C]=[u]:g.push(u),u.lane=v|536870912),k):null}function vh(s){if(50<df)throw df=0,vy=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Ko={};function w5(s,u,v,g){this.tag=s,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ea(s,u,v,g){return new w5(s,u,v,g)}function sg(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ri(s,u){var v=s.alternate;return v===null?(v=ea(s.tag,u,s.key,s.mode),v.elementType=s.elementType,v.type=s.type,v.stateNode=s.stateNode,v.alternate=s,s.alternate=v):(v.pendingProps=u,v.type=s.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=s.flags&65011712,v.childLanes=s.childLanes,v.lanes=s.lanes,v.child=s.child,v.memoizedProps=s.memoizedProps,v.memoizedState=s.memoizedState,v.updateQueue=s.updateQueue,u=s.dependencies,v.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},v.sibling=s.sibling,v.index=s.index,v.ref=s.ref,v.refCleanup=s.refCleanup,v}function GS(s,u){s.flags&=65011714;var v=s.alternate;return v===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=v.childLanes,s.lanes=v.lanes,s.child=v.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=v.memoizedProps,s.memoizedState=v.memoizedState,s.updateQueue=v.updateQueue,s.type=v.type,u=v.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function ph(s,u,v,g,C,k){var O=0;if(g=s,typeof s=="function")sg(s)&&(O=1);else if(typeof s=="string")O=k4(s,v,Z.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case L:return s=ea(31,v,u,C),s.elementType=L,s.lanes=k,s;case b:return Fl(v.children,C,k,u);case w:O=8,C|=24;break;case S:return s=ea(12,v,u,C|2),s.elementType=S,s.lanes=k,s;case R:return s=ea(13,v,u,C),s.elementType=R,s.lanes=k,s;case A:return s=ea(19,v,u,C),s.elementType=A,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case E:O=10;break e;case N:O=9;break e;case T:O=11;break e;case D:O=14;break e;case _:O=16,g=null;break e}O=29,v=Error(r(130,s===null?"null":typeof s,"")),g=null}return u=ea(O,v,u,C),u.elementType=s,u.type=g,u.lanes=k,u}function Fl(s,u,v,g){return s=ea(7,s,g,u),s.lanes=v,s}function lg(s,u,v){return s=ea(6,s,null,u),s.lanes=v,s}function $S(s){var u=ea(18,null,null,0);return u.stateNode=s,u}function og(s,u,v){return u=ea(4,s.children!==null?s.children:[],s.key,u),u.lanes=v,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var KS=new WeakMap;function ya(s,u){if(typeof s=="object"&&s!==null){var v=KS.get(s);return v!==void 0?v:(u={value:s,source:u,stack:We(u)},KS.set(s,u),u)}return{value:s,source:u,stack:We(u)}}var Yo=[],Xo=0,mh=null,Hc=0,xa=[],ba=0,ws=null,ei=1,ti="";function Di(s,u){Yo[Xo++]=Hc,Yo[Xo++]=mh,mh=s,Hc=u}function YS(s,u,v){xa[ba++]=ei,xa[ba++]=ti,xa[ba++]=ws,ws=s;var g=ei;s=ti;var C=32-de(g)-1;g&=~(1<<C),v+=1;var k=32-de(u)+C;if(30<k){var O=C-C%5;k=(g&(1<<O)-1).toString(32),g>>=O,C-=O,ei=1<<32-de(u)+C|v<<C|g,ti=k+s}else ei=1<<k|v<<C|g,ti=s}function ug(s){s.return!==null&&(Di(s,1),YS(s,1,0))}function cg(s){for(;s===mh;)mh=Yo[--Xo],Yo[Xo]=null,Hc=Yo[--Xo],Yo[Xo]=null;for(;s===ws;)ws=xa[--ba],xa[ba]=null,ti=xa[--ba],xa[ba]=null,ei=xa[--ba],xa[ba]=null}function XS(s,u){xa[ba++]=ei,xa[ba++]=ti,xa[ba++]=ws,ei=u.id,ti=u.overflow,ws=s}var ir=null,an=null,jt=!1,Ss=null,wa=!1,fg=Error(r(519));function Es(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gc(ya(u,s)),fg}function QS(s){var u=s.stateNode,v=s.type,g=s.memoizedProps;switch(u[un]=s,u[In]=g,v){case"dialog":Ct("cancel",u),Ct("close",u);break;case"iframe":case"object":case"embed":Ct("load",u);break;case"video":case"audio":for(v=0;v<vf.length;v++)Ct(vf[v],u);break;case"source":Ct("error",u);break;case"img":case"image":case"link":Ct("error",u),Ct("load",u);break;case"details":Ct("toggle",u);break;case"input":Ct("invalid",u),uS(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Ct("invalid",u);break;case"textarea":Ct("invalid",u),fS(u,g.value,g.defaultValue,g.children)}v=g.children,typeof v!="string"&&typeof v!="number"&&typeof v!="bigint"||u.textContent===""+v||g.suppressHydrationWarning===!0||hC(u.textContent,v)?(g.popover!=null&&(Ct("beforetoggle",u),Ct("toggle",u)),g.onScroll!=null&&Ct("scroll",u),g.onScrollEnd!=null&&Ct("scrollend",u),g.onClick!=null&&(u.onclick=ji),u=!0):u=!1,u||Es(s,!0)}function WS(s){for(ir=s.return;ir;)switch(ir.tag){case 5:case 31:case 13:wa=!1;return;case 27:case 3:wa=!0;return;default:ir=ir.return}}function Qo(s){if(s!==ir)return!1;if(!jt)return WS(s),jt=!0,!1;var u=s.tag,v;if((v=u!==3&&u!==27)&&((v=u===5)&&(v=s.type,v=!(v!=="form"&&v!=="button")||Ay(s.type,s.memoizedProps)),v=!v),v&&an&&Es(s),WS(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));an=SC(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));an=SC(s)}else u===27?(u=an,Bs(s.type)?(s=Oy,Oy=null,an=s):an=u):an=ir?Ea(s.stateNode.nextSibling):null;return!0}function Ul(){an=ir=null,jt=!1}function dg(){var s=Ss;return s!==null&&(Fr===null?Fr=s:Fr.push.apply(Fr,s),Ss=null),s}function Gc(s){Ss===null?Ss=[s]:Ss.push(s)}var hg=q(null),ql=null,Mi=null;function Cs(s,u,v){P(hg,u._currentValue),u._currentValue=v}function _i(s){s._currentValue=hg.current,X(hg)}function vg(s,u,v){for(;s!==null;){var g=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),s===v)break;s=s.return}}function pg(s,u,v,g){var C=s.child;for(C!==null&&(C.return=s);C!==null;){var k=C.dependencies;if(k!==null){var O=C.child;k=k.firstContext;e:for(;k!==null;){var $=k;k=C;for(var ee=0;ee<u.length;ee++)if($.context===u[ee]){k.lanes|=v,$=k.alternate,$!==null&&($.lanes|=v),vg(k.return,v,s),g||(O=null);break e}k=$.next}}else if(C.tag===18){if(O=C.return,O===null)throw Error(r(341));O.lanes|=v,k=O.alternate,k!==null&&(k.lanes|=v),vg(O,v,s),O=null}else O=C.child;if(O!==null)O.return=C;else for(O=C;O!==null;){if(O===s){O=null;break}if(C=O.sibling,C!==null){C.return=O.return,O=C;break}O=O.return}C=O}}function Wo(s,u,v,g){s=null;for(var C=u,k=!1;C!==null;){if(!k){if((C.flags&524288)!==0)k=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var O=C.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var $=C.type;Jr(C.pendingProps.value,O.value)||(s!==null?s.push($):s=[$])}}else if(C===le.current){if(O=C.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(s!==null?s.push(xf):s=[xf])}C=C.return}s!==null&&pg(u,s,v,g),u.flags|=262144}function gh(s){for(s=s.firstContext;s!==null;){if(!Jr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Vl(s){ql=s,Mi=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function sr(s){return ZS(ql,s)}function yh(s,u){return ql===null&&Vl(s),ZS(s,u)}function ZS(s,u){var v=u._currentValue;if(u={context:u,memoizedValue:v,next:null},Mi===null){if(s===null)throw Error(r(308));Mi=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else Mi=Mi.next=u;return v}var S5=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(v,g){s.push(g)}};this.abort=function(){u.aborted=!0,s.forEach(function(v){return v()})}},E5=e.unstable_scheduleCallback,C5=e.unstable_NormalPriority,Dn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mg(){return{controller:new S5,data:new Map,refCount:0}}function $c(s){s.refCount--,s.refCount===0&&E5(C5,function(){s.controller.abort()})}var Kc=null,gg=0,Zo=0,Jo=null;function N5(s,u){if(Kc===null){var v=Kc=[];gg=0,Zo=by(),Jo={status:"pending",value:void 0,then:function(g){v.push(g)}}}return gg++,u.then(JS,JS),u}function JS(){if(--gg===0&&Kc!==null){Jo!==null&&(Jo.status="fulfilled");var s=Kc;Kc=null,Zo=0,Jo=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function k5(s,u){var v=[],g={status:"pending",value:null,reason:null,then:function(C){v.push(C)}};return s.then(function(){g.status="fulfilled",g.value=u;for(var C=0;C<v.length;C++)(0,v[C])(u)},function(C){for(g.status="rejected",g.reason=C,C=0;C<v.length;C++)(0,v[C])(void 0)}),g}var e2=I.S;I.S=function(s,u){BE=ze(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&N5(s,u),e2!==null&&e2(s,u)};var Hl=q(null);function yg(){var s=Hl.current;return s!==null?s:Xt.pooledCache}function xh(s,u){u===null?P(Hl,Hl.current):P(Hl,u.pool)}function t2(){var s=yg();return s===null?null:{parent:Dn._currentValue,pool:s}}var eu=Error(r(460)),xg=Error(r(474)),bh=Error(r(542)),wh={then:function(){}};function n2(s){return s=s.status,s==="fulfilled"||s==="rejected"}function r2(s,u,v){switch(v=s[v],v===void 0?s.push(u):v!==u&&(u.then(ji,ji),u=v),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,i2(s),s;default:if(typeof u.status=="string")u.then(ji,ji);else{if(s=Xt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(g){if(u.status==="pending"){var C=u;C.status="fulfilled",C.value=g}},function(g){if(u.status==="pending"){var C=u;C.status="rejected",C.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,i2(s),s}throw $l=u,eu}}function Gl(s){try{var u=s._init;return u(s._payload)}catch(v){throw v!==null&&typeof v=="object"&&typeof v.then=="function"?($l=v,eu):v}}var $l=null;function a2(){if($l===null)throw Error(r(459));var s=$l;return $l=null,s}function i2(s){if(s===eu||s===bh)throw Error(r(483))}var tu=null,Yc=0;function Sh(s){var u=Yc;return Yc+=1,tu===null&&(tu=[]),r2(tu,s,u)}function Xc(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function Eh(s,u){throw u.$$typeof===m?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function s2(s){function u(oe,re){if(s){var ce=oe.deletions;ce===null?(oe.deletions=[re],oe.flags|=16):ce.push(re)}}function v(oe,re){if(!s)return null;for(;re!==null;)u(oe,re),re=re.sibling;return null}function g(oe){for(var re=new Map;oe!==null;)oe.key!==null?re.set(oe.key,oe):re.set(oe.index,oe),oe=oe.sibling;return re}function C(oe,re){return oe=Ri(oe,re),oe.index=0,oe.sibling=null,oe}function k(oe,re,ce){return oe.index=ce,s?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<re?(oe.flags|=67108866,re):ce):(oe.flags|=67108866,re)):(oe.flags|=1048576,re)}function O(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function $(oe,re,ce,Se){return re===null||re.tag!==6?(re=lg(ce,oe.mode,Se),re.return=oe,re):(re=C(re,ce),re.return=oe,re)}function ee(oe,re,ce,Se){var nt=ce.type;return nt===b?we(oe,re,ce.props.children,Se,ce.key):re!==null&&(re.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===_&&Gl(nt)===re.type)?(re=C(re,ce.props),Xc(re,ce),re.return=oe,re):(re=ph(ce.type,ce.key,ce.props,null,oe.mode,Se),Xc(re,ce),re.return=oe,re)}function fe(oe,re,ce,Se){return re===null||re.tag!==4||re.stateNode.containerInfo!==ce.containerInfo||re.stateNode.implementation!==ce.implementation?(re=og(ce,oe.mode,Se),re.return=oe,re):(re=C(re,ce.children||[]),re.return=oe,re)}function we(oe,re,ce,Se,nt){return re===null||re.tag!==7?(re=Fl(ce,oe.mode,Se,nt),re.return=oe,re):(re=C(re,ce),re.return=oe,re)}function Ee(oe,re,ce){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=lg(""+re,oe.mode,ce),re.return=oe,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case y:return ce=ph(re.type,re.key,re.props,null,oe.mode,ce),Xc(ce,re),ce.return=oe,ce;case x:return re=og(re,oe.mode,ce),re.return=oe,re;case _:return re=Gl(re),Ee(oe,re,ce)}if(U(re)||B(re))return re=Fl(re,oe.mode,ce,null),re.return=oe,re;if(typeof re.then=="function")return Ee(oe,Sh(re),ce);if(re.$$typeof===E)return Ee(oe,yh(oe,re),ce);Eh(oe,re)}return null}function ve(oe,re,ce,Se){var nt=re!==null?re.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return nt!==null?null:$(oe,re,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:return ce.key===nt?ee(oe,re,ce,Se):null;case x:return ce.key===nt?fe(oe,re,ce,Se):null;case _:return ce=Gl(ce),ve(oe,re,ce,Se)}if(U(ce)||B(ce))return nt!==null?null:we(oe,re,ce,Se,null);if(typeof ce.then=="function")return ve(oe,re,Sh(ce),Se);if(ce.$$typeof===E)return ve(oe,re,yh(oe,ce),Se);Eh(oe,ce)}return null}function me(oe,re,ce,Se,nt){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return oe=oe.get(ce)||null,$(re,oe,""+Se,nt);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case y:return oe=oe.get(Se.key===null?ce:Se.key)||null,ee(re,oe,Se,nt);case x:return oe=oe.get(Se.key===null?ce:Se.key)||null,fe(re,oe,Se,nt);case _:return Se=Gl(Se),me(oe,re,ce,Se,nt)}if(U(Se)||B(Se))return oe=oe.get(ce)||null,we(re,oe,Se,nt,null);if(typeof Se.then=="function")return me(oe,re,ce,Sh(Se),nt);if(Se.$$typeof===E)return me(oe,re,ce,yh(re,Se),nt);Eh(re,Se)}return null}function Ge(oe,re,ce,Se){for(var nt=null,_t=null,Xe=re,pt=re=0,Tt=null;Xe!==null&&pt<ce.length;pt++){Xe.index>pt?(Tt=Xe,Xe=null):Tt=Xe.sibling;var Ot=ve(oe,Xe,ce[pt],Se);if(Ot===null){Xe===null&&(Xe=Tt);break}s&&Xe&&Ot.alternate===null&&u(oe,Xe),re=k(Ot,re,pt),_t===null?nt=Ot:_t.sibling=Ot,_t=Ot,Xe=Tt}if(pt===ce.length)return v(oe,Xe),jt&&Di(oe,pt),nt;if(Xe===null){for(;pt<ce.length;pt++)Xe=Ee(oe,ce[pt],Se),Xe!==null&&(re=k(Xe,re,pt),_t===null?nt=Xe:_t.sibling=Xe,_t=Xe);return jt&&Di(oe,pt),nt}for(Xe=g(Xe);pt<ce.length;pt++)Tt=me(Xe,oe,pt,ce[pt],Se),Tt!==null&&(s&&Tt.alternate!==null&&Xe.delete(Tt.key===null?pt:Tt.key),re=k(Tt,re,pt),_t===null?nt=Tt:_t.sibling=Tt,_t=Tt);return s&&Xe.forEach(function(qs){return u(oe,qs)}),jt&&Di(oe,pt),nt}function it(oe,re,ce,Se){if(ce==null)throw Error(r(151));for(var nt=null,_t=null,Xe=re,pt=re=0,Tt=null,Ot=ce.next();Xe!==null&&!Ot.done;pt++,Ot=ce.next()){Xe.index>pt?(Tt=Xe,Xe=null):Tt=Xe.sibling;var qs=ve(oe,Xe,Ot.value,Se);if(qs===null){Xe===null&&(Xe=Tt);break}s&&Xe&&qs.alternate===null&&u(oe,Xe),re=k(qs,re,pt),_t===null?nt=qs:_t.sibling=qs,_t=qs,Xe=Tt}if(Ot.done)return v(oe,Xe),jt&&Di(oe,pt),nt;if(Xe===null){for(;!Ot.done;pt++,Ot=ce.next())Ot=Ee(oe,Ot.value,Se),Ot!==null&&(re=k(Ot,re,pt),_t===null?nt=Ot:_t.sibling=Ot,_t=Ot);return jt&&Di(oe,pt),nt}for(Xe=g(Xe);!Ot.done;pt++,Ot=ce.next())Ot=me(Xe,oe,pt,Ot.value,Se),Ot!==null&&(s&&Ot.alternate!==null&&Xe.delete(Ot.key===null?pt:Ot.key),re=k(Ot,re,pt),_t===null?nt=Ot:_t.sibling=Ot,_t=Ot);return s&&Xe.forEach(function(B4){return u(oe,B4)}),jt&&Di(oe,pt),nt}function $t(oe,re,ce,Se){if(typeof ce=="object"&&ce!==null&&ce.type===b&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:e:{for(var nt=ce.key;re!==null;){if(re.key===nt){if(nt=ce.type,nt===b){if(re.tag===7){v(oe,re.sibling),Se=C(re,ce.props.children),Se.return=oe,oe=Se;break e}}else if(re.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===_&&Gl(nt)===re.type){v(oe,re.sibling),Se=C(re,ce.props),Xc(Se,ce),Se.return=oe,oe=Se;break e}v(oe,re);break}else u(oe,re);re=re.sibling}ce.type===b?(Se=Fl(ce.props.children,oe.mode,Se,ce.key),Se.return=oe,oe=Se):(Se=ph(ce.type,ce.key,ce.props,null,oe.mode,Se),Xc(Se,ce),Se.return=oe,oe=Se)}return O(oe);case x:e:{for(nt=ce.key;re!==null;){if(re.key===nt)if(re.tag===4&&re.stateNode.containerInfo===ce.containerInfo&&re.stateNode.implementation===ce.implementation){v(oe,re.sibling),Se=C(re,ce.children||[]),Se.return=oe,oe=Se;break e}else{v(oe,re);break}else u(oe,re);re=re.sibling}Se=og(ce,oe.mode,Se),Se.return=oe,oe=Se}return O(oe);case _:return ce=Gl(ce),$t(oe,re,ce,Se)}if(U(ce))return Ge(oe,re,ce,Se);if(B(ce)){if(nt=B(ce),typeof nt!="function")throw Error(r(150));return ce=nt.call(ce),it(oe,re,ce,Se)}if(typeof ce.then=="function")return $t(oe,re,Sh(ce),Se);if(ce.$$typeof===E)return $t(oe,re,yh(oe,ce),Se);Eh(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,re!==null&&re.tag===6?(v(oe,re.sibling),Se=C(re,ce),Se.return=oe,oe=Se):(v(oe,re),Se=lg(ce,oe.mode,Se),Se.return=oe,oe=Se),O(oe)):v(oe,re)}return function(oe,re,ce,Se){try{Yc=0;var nt=$t(oe,re,ce,Se);return tu=null,nt}catch(Xe){if(Xe===eu||Xe===bh)throw Xe;var _t=ea(29,Xe,null,oe.mode);return _t.lanes=Se,_t.return=oe,_t}finally{}}}var Kl=s2(!0),l2=s2(!1),Ns=!1;function bg(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wg(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ks(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ts(s,u,v){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Pt&2)!==0){var C=g.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),g.pending=u,u=vh(s),HS(s,null,v),u}return hh(s,g,u,v),vh(s)}function Qc(s,u,v){if(u=u.updateQueue,u!==null&&(u=u.shared,(v&4194048)!==0)){var g=u.lanes;g&=s.pendingLanes,v|=g,u.lanes=v,Cn(s,v)}}function Sg(s,u){var v=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,v===g)){var C=null,k=null;if(v=v.firstBaseUpdate,v!==null){do{var O={lane:v.lane,tag:v.tag,payload:v.payload,callback:null,next:null};k===null?C=k=O:k=k.next=O,v=v.next}while(v!==null);k===null?C=k=u:k=k.next=u}else C=k=u;v={baseState:g.baseState,firstBaseUpdate:C,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},s.updateQueue=v;return}s=v.lastBaseUpdate,s===null?v.firstBaseUpdate=u:s.next=u,v.lastBaseUpdate=u}var Eg=!1;function Wc(){if(Eg){var s=Jo;if(s!==null)throw s}}function Zc(s,u,v,g){Eg=!1;var C=s.updateQueue;Ns=!1;var k=C.firstBaseUpdate,O=C.lastBaseUpdate,$=C.shared.pending;if($!==null){C.shared.pending=null;var ee=$,fe=ee.next;ee.next=null,O===null?k=fe:O.next=fe,O=ee;var we=s.alternate;we!==null&&(we=we.updateQueue,$=we.lastBaseUpdate,$!==O&&($===null?we.firstBaseUpdate=fe:$.next=fe,we.lastBaseUpdate=ee))}if(k!==null){var Ee=C.baseState;O=0,we=fe=ee=null,$=k;do{var ve=$.lane&-536870913,me=ve!==$.lane;if(me?(kt&ve)===ve:(g&ve)===ve){ve!==0&&ve===Zo&&(Eg=!0),we!==null&&(we=we.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ge=s,it=$;ve=u;var $t=v;switch(it.tag){case 1:if(Ge=it.payload,typeof Ge=="function"){Ee=Ge.call($t,Ee,ve);break e}Ee=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=it.payload,ve=typeof Ge=="function"?Ge.call($t,Ee,ve):Ge,ve==null)break e;Ee=p({},Ee,ve);break e;case 2:Ns=!0}}ve=$.callback,ve!==null&&(s.flags|=64,me&&(s.flags|=8192),me=C.callbacks,me===null?C.callbacks=[ve]:me.push(ve))}else me={lane:ve,tag:$.tag,payload:$.payload,callback:$.callback,next:null},we===null?(fe=we=me,ee=Ee):we=we.next=me,O|=ve;if($=$.next,$===null){if($=C.shared.pending,$===null)break;me=$,$=me.next,me.next=null,C.lastBaseUpdate=me,C.shared.pending=null}}while(!0);we===null&&(ee=Ee),C.baseState=ee,C.firstBaseUpdate=fe,C.lastBaseUpdate=we,k===null&&(C.shared.lanes=0),Ms|=O,s.lanes=O,s.memoizedState=Ee}}function o2(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function u2(s,u){var v=s.callbacks;if(v!==null)for(s.callbacks=null,s=0;s<v.length;s++)o2(v[s],u)}var nu=q(null),Ch=q(0);function c2(s,u){s=qi,P(Ch,s),P(nu,u),qi=s|u.baseLanes}function Cg(){P(Ch,qi),P(nu,nu.current)}function Ng(){qi=Ch.current,X(nu),X(Ch)}var ta=q(null),Sa=null;function js(s){var u=s.alternate;P(kn,kn.current&1),P(ta,s),Sa===null&&(u===null||nu.current!==null||u.memoizedState!==null)&&(Sa=s)}function kg(s){P(kn,kn.current),P(ta,s),Sa===null&&(Sa=s)}function f2(s){s.tag===22?(P(kn,kn.current),P(ta,s),Sa===null&&(Sa=s)):As()}function As(){P(kn,kn.current),P(ta,ta.current)}function na(s){X(ta),Sa===s&&(Sa=null),X(kn)}var kn=q(0);function Nh(s){for(var u=s;u!==null;){if(u.tag===13){var v=u.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||My(v)||_y(v)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Oi=0,ht=null,Ht=null,Mn=null,kh=!1,ru=!1,Yl=!1,Th=0,Jc=0,au=null,T5=0;function xn(){throw Error(r(321))}function Tg(s,u){if(u===null)return!1;for(var v=0;v<u.length&&v<s.length;v++)if(!Jr(s[v],u[v]))return!1;return!0}function jg(s,u,v,g,C,k){return Oi=k,ht=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,I.H=s===null||s.memoizedState===null?Y2:Vg,Yl=!1,k=v(g,C),Yl=!1,ru&&(k=h2(u,v,g,C)),d2(s),k}function d2(s){I.H=nf;var u=Ht!==null&&Ht.next!==null;if(Oi=0,Mn=Ht=ht=null,kh=!1,Jc=0,au=null,u)throw Error(r(300));s===null||_n||(s=s.dependencies,s!==null&&gh(s)&&(_n=!0))}function h2(s,u,v,g){ht=s;var C=0;do{if(ru&&(au=null),Jc=0,ru=!1,25<=C)throw Error(r(301));if(C+=1,Mn=Ht=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}I.H=X2,k=u(v,g)}while(ru);return k}function j5(){var s=I.H,u=s.useState()[0];return u=typeof u.then=="function"?ef(u):u,s=s.useState()[0],(Ht!==null?Ht.memoizedState:null)!==s&&(ht.flags|=1024),u}function Ag(){var s=Th!==0;return Th=0,s}function Rg(s,u,v){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~v}function Dg(s){if(kh){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}kh=!1}Oi=0,Mn=Ht=ht=null,ru=!1,Jc=Th=0,au=null}function Nr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?ht.memoizedState=Mn=s:Mn=Mn.next=s,Mn}function Tn(){if(Ht===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=Ht.next;var u=Mn===null?ht.memoizedState:Mn.next;if(u!==null)Mn=u,Ht=s;else{if(s===null)throw ht.alternate===null?Error(r(467)):Error(r(310));Ht=s,s={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},Mn===null?ht.memoizedState=Mn=s:Mn=Mn.next=s}return Mn}function jh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ef(s){var u=Jc;return Jc+=1,au===null&&(au=[]),s=r2(au,s,u),u=ht,(Mn===null?u.memoizedState:Mn.next)===null&&(u=u.alternate,I.H=u===null||u.memoizedState===null?Y2:Vg),s}function Ah(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return ef(s);if(s.$$typeof===E)return sr(s)}throw Error(r(438,String(s)))}function Mg(s){var u=null,v=ht.updateQueue;if(v!==null&&(u=v.memoCache),u==null){var g=ht.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(C){return C.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),v===null&&(v=jh(),ht.updateQueue=v),v.memoCache=u,v=u.data[u.index],v===void 0)for(v=u.data[u.index]=Array(s),g=0;g<s;g++)v[g]=M;return u.index++,v}function Li(s,u){return typeof u=="function"?u(s):u}function Rh(s){var u=Tn();return _g(u,Ht,s)}function _g(s,u,v){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=v;var C=s.baseQueue,k=g.pending;if(k!==null){if(C!==null){var O=C.next;C.next=k.next,k.next=O}u.baseQueue=C=k,g.pending=null}if(k=s.baseState,C===null)s.memoizedState=k;else{u=C.next;var $=O=null,ee=null,fe=u,we=!1;do{var Ee=fe.lane&-536870913;if(Ee!==fe.lane?(kt&Ee)===Ee:(Oi&Ee)===Ee){var ve=fe.revertLane;if(ve===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ee===Zo&&(we=!0);else if((Oi&ve)===ve){fe=fe.next,ve===Zo&&(we=!0);continue}else Ee={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},ee===null?($=ee=Ee,O=k):ee=ee.next=Ee,ht.lanes|=ve,Ms|=ve;Ee=fe.action,Yl&&v(k,Ee),k=fe.hasEagerState?fe.eagerState:v(k,Ee)}else ve={lane:Ee,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},ee===null?($=ee=ve,O=k):ee=ee.next=ve,ht.lanes|=Ee,Ms|=Ee;fe=fe.next}while(fe!==null&&fe!==u);if(ee===null?O=k:ee.next=$,!Jr(k,s.memoizedState)&&(_n=!0,we&&(v=Jo,v!==null)))throw v;s.memoizedState=k,s.baseState=O,s.baseQueue=ee,g.lastRenderedState=k}return C===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Og(s){var u=Tn(),v=u.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=s;var g=v.dispatch,C=v.pending,k=u.memoizedState;if(C!==null){v.pending=null;var O=C=C.next;do k=s(k,O.action),O=O.next;while(O!==C);Jr(k,u.memoizedState)||(_n=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),v.lastRenderedState=k}return[k,g]}function v2(s,u,v){var g=ht,C=Tn(),k=jt;if(k){if(v===void 0)throw Error(r(407));v=v()}else v=u();var O=!Jr((Ht||C).memoizedState,v);if(O&&(C.memoizedState=v,_n=!0),C=C.queue,Bg(g2.bind(null,g,C,s),[s]),C.getSnapshot!==u||O||Mn!==null&&Mn.memoizedState.tag&1){if(g.flags|=2048,iu(9,{destroy:void 0},m2.bind(null,g,C,v,u),null),Xt===null)throw Error(r(349));k||(Oi&127)!==0||p2(g,u,v)}return v}function p2(s,u,v){s.flags|=16384,s={getSnapshot:u,value:v},u=ht.updateQueue,u===null?(u=jh(),ht.updateQueue=u,u.stores=[s]):(v=u.stores,v===null?u.stores=[s]:v.push(s))}function m2(s,u,v,g){u.value=v,u.getSnapshot=g,y2(u)&&x2(s)}function g2(s,u,v){return v(function(){y2(u)&&x2(s)})}function y2(s){var u=s.getSnapshot;s=s.value;try{var v=u();return!Jr(s,v)}catch{return!0}}function x2(s){var u=Il(s,2);u!==null&&Ur(u,s,2)}function Lg(s){var u=Nr();if(typeof s=="function"){var v=s;if(s=v(),Yl){pe(!0);try{v()}finally{pe(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Li,lastRenderedState:s},u}function b2(s,u,v,g){return s.baseState=v,_g(s,Ht,typeof g=="function"?g:Li)}function A5(s,u,v,g,C){if(_h(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:C,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){k.listeners.push(O)}};I.T!==null?v(!0):k.isTransition=!1,g(k),v=u.pending,v===null?(k.next=u.pending=k,w2(u,k)):(k.next=v.next,u.pending=v.next=k)}}function w2(s,u){var v=u.action,g=u.payload,C=s.state;if(u.isTransition){var k=I.T,O={};I.T=O;try{var $=v(C,g),ee=I.S;ee!==null&&ee(O,$),S2(s,u,$)}catch(fe){Pg(s,u,fe)}finally{k!==null&&O.types!==null&&(k.types=O.types),I.T=k}}else try{k=v(C,g),S2(s,u,k)}catch(fe){Pg(s,u,fe)}}function S2(s,u,v){v!==null&&typeof v=="object"&&typeof v.then=="function"?v.then(function(g){E2(s,u,g)},function(g){return Pg(s,u,g)}):E2(s,u,v)}function E2(s,u,v){u.status="fulfilled",u.value=v,C2(u),s.state=v,u=s.pending,u!==null&&(v=u.next,v===u?s.pending=null:(v=v.next,u.next=v,w2(s,v)))}function Pg(s,u,v){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=v,C2(u),u=u.next;while(u!==g)}s.action=null}function C2(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function N2(s,u){return u}function k2(s,u){if(jt){var v=Xt.formState;if(v!==null){e:{var g=ht;if(jt){if(an){t:{for(var C=an,k=wa;C.nodeType!==8;){if(!k){C=null;break t}if(C=Ea(C.nextSibling),C===null){C=null;break t}}k=C.data,C=k==="F!"||k==="F"?C:null}if(C){an=Ea(C.nextSibling),g=C.data==="F!";break e}}Es(g)}g=!1}g&&(u=v[0])}}return v=Nr(),v.memoizedState=v.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:N2,lastRenderedState:u},v.queue=g,v=G2.bind(null,ht,g),g.dispatch=v,g=Lg(!1),k=qg.bind(null,ht,!1,g.queue),g=Nr(),C={state:u,dispatch:null,action:s,pending:null},g.queue=C,v=A5.bind(null,ht,C,k,v),C.dispatch=v,g.memoizedState=s,[u,v,!1]}function T2(s){var u=Tn();return j2(u,Ht,s)}function j2(s,u,v){if(u=_g(s,u,N2)[0],s=Rh(Li)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=ef(u)}catch(O){throw O===eu?bh:O}else g=u;u=Tn();var C=u.queue,k=C.dispatch;return v!==u.memoizedState&&(ht.flags|=2048,iu(9,{destroy:void 0},R5.bind(null,C,v),null)),[g,k,s]}function R5(s,u){s.action=u}function A2(s){var u=Tn(),v=Ht;if(v!==null)return j2(u,v,s);Tn(),u=u.memoizedState,v=Tn();var g=v.queue.dispatch;return v.memoizedState=s,[u,g,!1]}function iu(s,u,v,g){return s={tag:s,create:v,deps:g,inst:u,next:null},u=ht.updateQueue,u===null&&(u=jh(),ht.updateQueue=u),v=u.lastEffect,v===null?u.lastEffect=s.next=s:(g=v.next,v.next=s,s.next=g,u.lastEffect=s),s}function R2(){return Tn().memoizedState}function Dh(s,u,v,g){var C=Nr();ht.flags|=s,C.memoizedState=iu(1|u,{destroy:void 0},v,g===void 0?null:g)}function Mh(s,u,v,g){var C=Tn();g=g===void 0?null:g;var k=C.memoizedState.inst;Ht!==null&&g!==null&&Tg(g,Ht.memoizedState.deps)?C.memoizedState=iu(u,k,v,g):(ht.flags|=s,C.memoizedState=iu(1|u,k,v,g))}function D2(s,u){Dh(8390656,8,s,u)}function Bg(s,u){Mh(2048,8,s,u)}function D5(s){ht.flags|=4;var u=ht.updateQueue;if(u===null)u=jh(),ht.updateQueue=u,u.events=[s];else{var v=u.events;v===null?u.events=[s]:v.push(s)}}function M2(s){var u=Tn().memoizedState;return D5({ref:u,nextImpl:s}),function(){if((Pt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function _2(s,u){return Mh(4,2,s,u)}function O2(s,u){return Mh(4,4,s,u)}function L2(s,u){if(typeof u=="function"){s=s();var v=u(s);return function(){typeof v=="function"?v():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function P2(s,u,v){v=v!=null?v.concat([s]):null,Mh(4,4,L2.bind(null,u,s),v)}function zg(){}function B2(s,u){var v=Tn();u=u===void 0?null:u;var g=v.memoizedState;return u!==null&&Tg(u,g[1])?g[0]:(v.memoizedState=[s,u],s)}function z2(s,u){var v=Tn();u=u===void 0?null:u;var g=v.memoizedState;if(u!==null&&Tg(u,g[1]))return g[0];if(g=s(),Yl){pe(!0);try{s()}finally{pe(!1)}}return v.memoizedState=[g,u],g}function Ig(s,u,v){return v===void 0||(Oi&1073741824)!==0&&(kt&261930)===0?s.memoizedState=u:(s.memoizedState=v,s=IE(),ht.lanes|=s,Ms|=s,v)}function I2(s,u,v,g){return Jr(v,u)?v:nu.current!==null?(s=Ig(s,v,g),Jr(s,u)||(_n=!0),s):(Oi&42)===0||(Oi&1073741824)!==0&&(kt&261930)===0?(_n=!0,s.memoizedState=v):(s=IE(),ht.lanes|=s,Ms|=s,u)}function F2(s,u,v,g,C){var k=V.p;V.p=k!==0&&8>k?k:8;var O=I.T,$={};I.T=$,qg(s,!1,u,v);try{var ee=C(),fe=I.S;if(fe!==null&&fe($,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var we=k5(ee,g);tf(s,u,we,ia(s))}else tf(s,u,g,ia(s))}catch(Ee){tf(s,u,{then:function(){},status:"rejected",reason:Ee},ia())}finally{V.p=k,O!==null&&$.types!==null&&(O.types=$.types),I.T=O}}function M5(){}function Fg(s,u,v,g){if(s.tag!==5)throw Error(r(476));var C=U2(s).queue;F2(s,C,u,K,v===null?M5:function(){return q2(s),v(g)})}function U2(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Li,lastRenderedState:K},next:null};var v={};return u.next={memoizedState:v,baseState:v,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Li,lastRenderedState:v},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function q2(s){var u=U2(s);u.next===null&&(u=s.alternate.memoizedState),tf(s,u.next.queue,{},ia())}function Ug(){return sr(xf)}function V2(){return Tn().memoizedState}function H2(){return Tn().memoizedState}function _5(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var v=ia();s=ks(v);var g=Ts(u,s,v);g!==null&&(Ur(g,u,v),Qc(g,u,v)),u={cache:mg()},s.payload=u;return}u=u.return}}function O5(s,u,v){var g=ia();v={lane:g,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},_h(s)?$2(u,v):(v=ig(s,u,v,g),v!==null&&(Ur(v,s,g),K2(v,u,g)))}function G2(s,u,v){var g=ia();tf(s,u,v,g)}function tf(s,u,v,g){var C={lane:g,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null};if(_h(s))$2(u,C);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var O=u.lastRenderedState,$=k(O,v);if(C.hasEagerState=!0,C.eagerState=$,Jr($,O))return hh(s,u,C,0),Xt===null&&dh(),!1}catch{}finally{}if(v=ig(s,u,C,g),v!==null)return Ur(v,s,g),K2(v,u,g),!0}return!1}function qg(s,u,v,g){if(g={lane:2,revertLane:by(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},_h(s)){if(u)throw Error(r(479))}else u=ig(s,v,g,2),u!==null&&Ur(u,s,2)}function _h(s){var u=s.alternate;return s===ht||u!==null&&u===ht}function $2(s,u){ru=kh=!0;var v=s.pending;v===null?u.next=u:(u.next=v.next,v.next=u),s.pending=u}function K2(s,u,v){if((v&4194048)!==0){var g=u.lanes;g&=s.pendingLanes,v|=g,u.lanes=v,Cn(s,v)}}var nf={readContext:sr,use:Ah,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};nf.useEffectEvent=xn;var Y2={readContext:sr,use:Ah,useCallback:function(s,u){return Nr().memoizedState=[s,u===void 0?null:u],s},useContext:sr,useEffect:D2,useImperativeHandle:function(s,u,v){v=v!=null?v.concat([s]):null,Dh(4194308,4,L2.bind(null,u,s),v)},useLayoutEffect:function(s,u){return Dh(4194308,4,s,u)},useInsertionEffect:function(s,u){Dh(4,2,s,u)},useMemo:function(s,u){var v=Nr();u=u===void 0?null:u;var g=s();if(Yl){pe(!0);try{s()}finally{pe(!1)}}return v.memoizedState=[g,u],g},useReducer:function(s,u,v){var g=Nr();if(v!==void 0){var C=v(u);if(Yl){pe(!0);try{v(u)}finally{pe(!1)}}}else C=u;return g.memoizedState=g.baseState=C,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:C},g.queue=s,s=s.dispatch=O5.bind(null,ht,s),[g.memoizedState,s]},useRef:function(s){var u=Nr();return s={current:s},u.memoizedState=s},useState:function(s){s=Lg(s);var u=s.queue,v=G2.bind(null,ht,u);return u.dispatch=v,[s.memoizedState,v]},useDebugValue:zg,useDeferredValue:function(s,u){var v=Nr();return Ig(v,s,u)},useTransition:function(){var s=Lg(!1);return s=F2.bind(null,ht,s.queue,!0,!1),Nr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,v){var g=ht,C=Nr();if(jt){if(v===void 0)throw Error(r(407));v=v()}else{if(v=u(),Xt===null)throw Error(r(349));(kt&127)!==0||p2(g,u,v)}C.memoizedState=v;var k={value:v,getSnapshot:u};return C.queue=k,D2(g2.bind(null,g,k,s),[s]),g.flags|=2048,iu(9,{destroy:void 0},m2.bind(null,g,k,v,u),null),v},useId:function(){var s=Nr(),u=Xt.identifierPrefix;if(jt){var v=ti,g=ei;v=(g&~(1<<32-de(g)-1)).toString(32)+v,u="_"+u+"R_"+v,v=Th++,0<v&&(u+="H"+v.toString(32)),u+="_"}else v=T5++,u="_"+u+"r_"+v.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:Ug,useFormState:k2,useActionState:k2,useOptimistic:function(s){var u=Nr();u.memoizedState=u.baseState=s;var v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=v,u=qg.bind(null,ht,!0,v),v.dispatch=u,[s,u]},useMemoCache:Mg,useCacheRefresh:function(){return Nr().memoizedState=_5.bind(null,ht)},useEffectEvent:function(s){var u=Nr(),v={impl:s};return u.memoizedState=v,function(){if((Pt&2)!==0)throw Error(r(440));return v.impl.apply(void 0,arguments)}}},Vg={readContext:sr,use:Ah,useCallback:B2,useContext:sr,useEffect:Bg,useImperativeHandle:P2,useInsertionEffect:_2,useLayoutEffect:O2,useMemo:z2,useReducer:Rh,useRef:R2,useState:function(){return Rh(Li)},useDebugValue:zg,useDeferredValue:function(s,u){var v=Tn();return I2(v,Ht.memoizedState,s,u)},useTransition:function(){var s=Rh(Li)[0],u=Tn().memoizedState;return[typeof s=="boolean"?s:ef(s),u]},useSyncExternalStore:v2,useId:V2,useHostTransitionStatus:Ug,useFormState:T2,useActionState:T2,useOptimistic:function(s,u){var v=Tn();return b2(v,Ht,s,u)},useMemoCache:Mg,useCacheRefresh:H2};Vg.useEffectEvent=M2;var X2={readContext:sr,use:Ah,useCallback:B2,useContext:sr,useEffect:Bg,useImperativeHandle:P2,useInsertionEffect:_2,useLayoutEffect:O2,useMemo:z2,useReducer:Og,useRef:R2,useState:function(){return Og(Li)},useDebugValue:zg,useDeferredValue:function(s,u){var v=Tn();return Ht===null?Ig(v,s,u):I2(v,Ht.memoizedState,s,u)},useTransition:function(){var s=Og(Li)[0],u=Tn().memoizedState;return[typeof s=="boolean"?s:ef(s),u]},useSyncExternalStore:v2,useId:V2,useHostTransitionStatus:Ug,useFormState:A2,useActionState:A2,useOptimistic:function(s,u){var v=Tn();return Ht!==null?b2(v,Ht,s,u):(v.baseState=s,[s,v.queue.dispatch])},useMemoCache:Mg,useCacheRefresh:H2};X2.useEffectEvent=M2;function Hg(s,u,v,g){u=s.memoizedState,v=v(g,u),v=v==null?u:p({},u,v),s.memoizedState=v,s.lanes===0&&(s.updateQueue.baseState=v)}var Gg={enqueueSetState:function(s,u,v){s=s._reactInternals;var g=ia(),C=ks(g);C.payload=u,v!=null&&(C.callback=v),u=Ts(s,C,g),u!==null&&(Ur(u,s,g),Qc(u,s,g))},enqueueReplaceState:function(s,u,v){s=s._reactInternals;var g=ia(),C=ks(g);C.tag=1,C.payload=u,v!=null&&(C.callback=v),u=Ts(s,C,g),u!==null&&(Ur(u,s,g),Qc(u,s,g))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var v=ia(),g=ks(v);g.tag=2,u!=null&&(g.callback=u),u=Ts(s,g,v),u!==null&&(Ur(u,s,v),Qc(u,s,v))}};function Q2(s,u,v,g,C,k,O){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,k,O):u.prototype&&u.prototype.isPureReactComponent?!qc(v,g)||!qc(C,k):!0}function W2(s,u,v,g){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(v,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(v,g),u.state!==s&&Gg.enqueueReplaceState(u,u.state,null)}function Xl(s,u){var v=u;if("ref"in u){v={};for(var g in u)g!=="ref"&&(v[g]=u[g])}if(s=s.defaultProps){v===u&&(v=p({},v));for(var C in s)v[C]===void 0&&(v[C]=s[C])}return v}function Z2(s){fh(s)}function J2(s){console.error(s)}function eE(s){fh(s)}function Oh(s,u){try{var v=s.onUncaughtError;v(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function tE(s,u,v){try{var g=s.onCaughtError;g(v.value,{componentStack:v.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function $g(s,u,v){return v=ks(v),v.tag=3,v.payload={element:null},v.callback=function(){Oh(s,u)},v}function nE(s){return s=ks(s),s.tag=3,s}function rE(s,u,v,g){var C=v.type.getDerivedStateFromError;if(typeof C=="function"){var k=g.value;s.payload=function(){return C(k)},s.callback=function(){tE(u,v,g)}}var O=v.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(s.callback=function(){tE(u,v,g),typeof C!="function"&&(_s===null?_s=new Set([this]):_s.add(this));var $=g.stack;this.componentDidCatch(g.value,{componentStack:$!==null?$:""})})}function L5(s,u,v,g,C){if(v.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=v.alternate,u!==null&&Wo(u,v,C,!0),v=ta.current,v!==null){switch(v.tag){case 31:case 13:return Sa===null?$h():v.alternate===null&&bn===0&&(bn=3),v.flags&=-257,v.flags|=65536,v.lanes=C,g===wh?v.flags|=16384:(u=v.updateQueue,u===null?v.updateQueue=new Set([g]):u.add(g),gy(s,g,C)),!1;case 22:return v.flags|=65536,g===wh?v.flags|=16384:(u=v.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},v.updateQueue=u):(v=u.retryQueue,v===null?u.retryQueue=new Set([g]):v.add(g)),gy(s,g,C)),!1}throw Error(r(435,v.tag))}return gy(s,g,C),$h(),!1}if(jt)return u=ta.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=C,g!==fg&&(s=Error(r(422),{cause:g}),Gc(ya(s,v)))):(g!==fg&&(u=Error(r(423),{cause:g}),Gc(ya(u,v))),s=s.current.alternate,s.flags|=65536,C&=-C,s.lanes|=C,g=ya(g,v),C=$g(s.stateNode,g,C),Sg(s,C),bn!==4&&(bn=2)),!1;var k=Error(r(520),{cause:g});if(k=ya(k,v),ff===null?ff=[k]:ff.push(k),bn!==4&&(bn=2),u===null)return!0;g=ya(g,v),v=u;do{switch(v.tag){case 3:return v.flags|=65536,s=C&-C,v.lanes|=s,s=$g(v.stateNode,g,s),Sg(v,s),!1;case 1:if(u=v.type,k=v.stateNode,(v.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(_s===null||!_s.has(k))))return v.flags|=65536,C&=-C,v.lanes|=C,C=nE(C),rE(C,s,v,g),Sg(v,C),!1}v=v.return}while(v!==null);return!1}var Kg=Error(r(461)),_n=!1;function lr(s,u,v,g){u.child=s===null?l2(u,null,v,g):Kl(u,s.child,v,g)}function aE(s,u,v,g,C){v=v.render;var k=u.ref;if("ref"in g){var O={};for(var $ in g)$!=="ref"&&(O[$]=g[$])}else O=g;return Vl(u),g=jg(s,u,v,O,k,C),$=Ag(),s!==null&&!_n?(Rg(s,u,C),Pi(s,u,C)):(jt&&$&&ug(u),u.flags|=1,lr(s,u,g,C),u.child)}function iE(s,u,v,g,C){if(s===null){var k=v.type;return typeof k=="function"&&!sg(k)&&k.defaultProps===void 0&&v.compare===null?(u.tag=15,u.type=k,sE(s,u,k,g,C)):(s=ph(v.type,null,g,u,u.mode,C),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!ty(s,C)){var O=k.memoizedProps;if(v=v.compare,v=v!==null?v:qc,v(O,g)&&s.ref===u.ref)return Pi(s,u,C)}return u.flags|=1,s=Ri(k,g),s.ref=u.ref,s.return=u,u.child=s}function sE(s,u,v,g,C){if(s!==null){var k=s.memoizedProps;if(qc(k,g)&&s.ref===u.ref)if(_n=!1,u.pendingProps=g=k,ty(s,C))(s.flags&131072)!==0&&(_n=!0);else return u.lanes=s.lanes,Pi(s,u,C)}return Yg(s,u,v,g,C)}function lE(s,u,v,g){var C=g.children,k=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(k=k!==null?k.baseLanes|v:v,s!==null){for(g=u.child=s.child,C=0;g!==null;)C=C|g.lanes|g.childLanes,g=g.sibling;g=C&~k}else g=0,u.child=null;return oE(s,u,k,v,g)}if((v&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&xh(u,k!==null?k.cachePool:null),k!==null?c2(u,k):Cg(),f2(u);else return g=u.lanes=536870912,oE(s,u,k!==null?k.baseLanes|v:v,v,g)}else k!==null?(xh(u,k.cachePool),c2(u,k),As(),u.memoizedState=null):(s!==null&&xh(u,null),Cg(),As());return lr(s,u,C,v),u.child}function rf(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function oE(s,u,v,g,C){var k=yg();return k=k===null?null:{parent:Dn._currentValue,pool:k},u.memoizedState={baseLanes:v,cachePool:k},s!==null&&xh(u,null),Cg(),f2(u),s!==null&&Wo(s,u,g,!0),u.childLanes=C,null}function Lh(s,u){return u=Bh({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function uE(s,u,v){return Kl(u,s.child,null,v),s=Lh(u,u.pendingProps),s.flags|=2,na(u),u.memoizedState=null,s}function P5(s,u,v){var g=u.pendingProps,C=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(jt){if(g.mode==="hidden")return s=Lh(u,g),u.lanes=536870912,rf(null,s);if(kg(u),(s=an)?(s=wC(s,wa),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ws!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},v=$S(s),v.return=u,u.child=v,ir=u,an=null)):s=null,s===null)throw Es(u);return u.lanes=536870912,null}return Lh(u,g)}var k=s.memoizedState;if(k!==null){var O=k.dehydrated;if(kg(u),C)if(u.flags&256)u.flags&=-257,u=uE(s,u,v);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(_n||Wo(s,u,v,!1),C=(v&s.childLanes)!==0,_n||C){if(g=Xt,g!==null&&(O=yn(g,v),O!==0&&O!==k.retryLane))throw k.retryLane=O,Il(s,O),Ur(g,s,O),Kg;$h(),u=uE(s,u,v)}else s=k.treeContext,an=Ea(O.nextSibling),ir=u,jt=!0,Ss=null,wa=!1,s!==null&&XS(u,s),u=Lh(u,g),u.flags|=4096;return u}return s=Ri(s.child,{mode:g.mode,children:g.children}),s.ref=u.ref,u.child=s,s.return=u,s}function Ph(s,u){var v=u.ref;if(v===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof v!="function"&&typeof v!="object")throw Error(r(284));(s===null||s.ref!==v)&&(u.flags|=4194816)}}function Yg(s,u,v,g,C){return Vl(u),v=jg(s,u,v,g,void 0,C),g=Ag(),s!==null&&!_n?(Rg(s,u,C),Pi(s,u,C)):(jt&&g&&ug(u),u.flags|=1,lr(s,u,v,C),u.child)}function cE(s,u,v,g,C,k){return Vl(u),u.updateQueue=null,v=h2(u,g,v,C),d2(s),g=Ag(),s!==null&&!_n?(Rg(s,u,k),Pi(s,u,k)):(jt&&g&&ug(u),u.flags|=1,lr(s,u,v,k),u.child)}function fE(s,u,v,g,C){if(Vl(u),u.stateNode===null){var k=Ko,O=v.contextType;typeof O=="object"&&O!==null&&(k=sr(O)),k=new v(g,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Gg,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=g,k.state=u.memoizedState,k.refs={},bg(u),O=v.contextType,k.context=typeof O=="object"&&O!==null?sr(O):Ko,k.state=u.memoizedState,O=v.getDerivedStateFromProps,typeof O=="function"&&(Hg(u,v,O,g),k.state=u.memoizedState),typeof v.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(O=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),O!==k.state&&Gg.enqueueReplaceState(k,k.state,null),Zc(u,g,k,C),Wc(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(s===null){k=u.stateNode;var $=u.memoizedProps,ee=Xl(v,$);k.props=ee;var fe=k.context,we=v.contextType;O=Ko,typeof we=="object"&&we!==null&&(O=sr(we));var Ee=v.getDerivedStateFromProps;we=typeof Ee=="function"||typeof k.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,we||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||($||fe!==O)&&W2(u,k,g,O),Ns=!1;var ve=u.memoizedState;k.state=ve,Zc(u,g,k,C),Wc(),fe=u.memoizedState,$||ve!==fe||Ns?(typeof Ee=="function"&&(Hg(u,v,Ee,g),fe=u.memoizedState),(ee=Ns||Q2(u,v,ee,g,ve,fe,O))?(we||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(u.flags|=4194308)):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=fe),k.props=g,k.state=fe,k.context=O,g=ee):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{k=u.stateNode,wg(s,u),O=u.memoizedProps,we=Xl(v,O),k.props=we,Ee=u.pendingProps,ve=k.context,fe=v.contextType,ee=Ko,typeof fe=="object"&&fe!==null&&(ee=sr(fe)),$=v.getDerivedStateFromProps,(fe=typeof $=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(O!==Ee||ve!==ee)&&W2(u,k,g,ee),Ns=!1,ve=u.memoizedState,k.state=ve,Zc(u,g,k,C),Wc();var me=u.memoizedState;O!==Ee||ve!==me||Ns||s!==null&&s.dependencies!==null&&gh(s.dependencies)?(typeof $=="function"&&(Hg(u,v,$,g),me=u.memoizedState),(we=Ns||Q2(u,v,we,g,ve,me,ee)||s!==null&&s.dependencies!==null&&gh(s.dependencies))?(fe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,me,ee),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,me,ee)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=me),k.props=g,k.state=me,k.context=ee,g=we):(typeof k.componentDidUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||O===s.memoizedProps&&ve===s.memoizedState||(u.flags|=1024),g=!1)}return k=g,Ph(s,u),g=(u.flags&128)!==0,k||g?(k=u.stateNode,v=g&&typeof v.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&g?(u.child=Kl(u,s.child,null,C),u.child=Kl(u,null,v,C)):lr(s,u,v,C),u.memoizedState=k.state,s=u.child):s=Pi(s,u,C),s}function dE(s,u,v,g){return Ul(),u.flags|=256,lr(s,u,v,g),u.child}var Xg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qg(s){return{baseLanes:s,cachePool:t2()}}function Wg(s,u,v){return s=s!==null?s.childLanes&~v:0,u&&(s|=aa),s}function hE(s,u,v){var g=u.pendingProps,C=!1,k=(u.flags&128)!==0,O;if((O=k)||(O=s!==null&&s.memoizedState===null?!1:(kn.current&2)!==0),O&&(C=!0,u.flags&=-129),O=(u.flags&32)!==0,u.flags&=-33,s===null){if(jt){if(C?js(u):As(),(s=an)?(s=wC(s,wa),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:ws!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},v=$S(s),v.return=u,u.child=v,ir=u,an=null)):s=null,s===null)throw Es(u);return _y(s)?u.lanes=32:u.lanes=536870912,null}var $=g.children;return g=g.fallback,C?(As(),C=u.mode,$=Bh({mode:"hidden",children:$},C),g=Fl(g,C,v,null),$.return=u,g.return=u,$.sibling=g,u.child=$,g=u.child,g.memoizedState=Qg(v),g.childLanes=Wg(s,O,v),u.memoizedState=Xg,rf(null,g)):(js(u),Zg(u,$))}var ee=s.memoizedState;if(ee!==null&&($=ee.dehydrated,$!==null)){if(k)u.flags&256?(js(u),u.flags&=-257,u=Jg(s,u,v)):u.memoizedState!==null?(As(),u.child=s.child,u.flags|=128,u=null):(As(),$=g.fallback,C=u.mode,g=Bh({mode:"visible",children:g.children},C),$=Fl($,C,v,null),$.flags|=2,g.return=u,$.return=u,g.sibling=$,u.child=g,Kl(u,s.child,null,v),g=u.child,g.memoizedState=Qg(v),g.childLanes=Wg(s,O,v),u.memoizedState=Xg,u=rf(null,g));else if(js(u),_y($)){if(O=$.nextSibling&&$.nextSibling.dataset,O)var fe=O.dgst;O=fe,g=Error(r(419)),g.stack="",g.digest=O,Gc({value:g,source:null,stack:null}),u=Jg(s,u,v)}else if(_n||Wo(s,u,v,!1),O=(v&s.childLanes)!==0,_n||O){if(O=Xt,O!==null&&(g=yn(O,v),g!==0&&g!==ee.retryLane))throw ee.retryLane=g,Il(s,g),Ur(O,s,g),Kg;My($)||$h(),u=Jg(s,u,v)}else My($)?(u.flags|=192,u.child=s.child,u=null):(s=ee.treeContext,an=Ea($.nextSibling),ir=u,jt=!0,Ss=null,wa=!1,s!==null&&XS(u,s),u=Zg(u,g.children),u.flags|=4096);return u}return C?(As(),$=g.fallback,C=u.mode,ee=s.child,fe=ee.sibling,g=Ri(ee,{mode:"hidden",children:g.children}),g.subtreeFlags=ee.subtreeFlags&65011712,fe!==null?$=Ri(fe,$):($=Fl($,C,v,null),$.flags|=2),$.return=u,g.return=u,g.sibling=$,u.child=g,rf(null,g),g=u.child,$=s.child.memoizedState,$===null?$=Qg(v):(C=$.cachePool,C!==null?(ee=Dn._currentValue,C=C.parent!==ee?{parent:ee,pool:ee}:C):C=t2(),$={baseLanes:$.baseLanes|v,cachePool:C}),g.memoizedState=$,g.childLanes=Wg(s,O,v),u.memoizedState=Xg,rf(s.child,g)):(js(u),v=s.child,s=v.sibling,v=Ri(v,{mode:"visible",children:g.children}),v.return=u,v.sibling=null,s!==null&&(O=u.deletions,O===null?(u.deletions=[s],u.flags|=16):O.push(s)),u.child=v,u.memoizedState=null,v)}function Zg(s,u){return u=Bh({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function Bh(s,u){return s=ea(22,s,null,u),s.lanes=0,s}function Jg(s,u,v){return Kl(u,s.child,null,v),s=Zg(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function vE(s,u,v){s.lanes|=u;var g=s.alternate;g!==null&&(g.lanes|=u),vg(s.return,u,v)}function ey(s,u,v,g,C,k){var O=s.memoizedState;O===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:v,tailMode:C,treeForkCount:k}:(O.isBackwards=u,O.rendering=null,O.renderingStartTime=0,O.last=g,O.tail=v,O.tailMode=C,O.treeForkCount=k)}function pE(s,u,v){var g=u.pendingProps,C=g.revealOrder,k=g.tail;g=g.children;var O=kn.current,$=(O&2)!==0;if($?(O=O&1|2,u.flags|=128):O&=1,P(kn,O),lr(s,u,g,v),g=jt?Hc:0,!$&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&vE(s,v,u);else if(s.tag===19)vE(s,v,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(C){case"forwards":for(v=u.child,C=null;v!==null;)s=v.alternate,s!==null&&Nh(s)===null&&(C=v),v=v.sibling;v=C,v===null?(C=u.child,u.child=null):(C=v.sibling,v.sibling=null),ey(u,!1,C,v,k,g);break;case"backwards":case"unstable_legacy-backwards":for(v=null,C=u.child,u.child=null;C!==null;){if(s=C.alternate,s!==null&&Nh(s)===null){u.child=C;break}s=C.sibling,C.sibling=v,v=C,C=s}ey(u,!0,v,null,k,g);break;case"together":ey(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function Pi(s,u,v){if(s!==null&&(u.dependencies=s.dependencies),Ms|=u.lanes,(v&u.childLanes)===0)if(s!==null){if(Wo(s,u,v,!1),(v&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,v=Ri(s,s.pendingProps),u.child=v,v.return=u;s.sibling!==null;)s=s.sibling,v=v.sibling=Ri(s,s.pendingProps),v.return=u;v.sibling=null}return u.child}function ty(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&gh(s)))}function B5(s,u,v){switch(u.tag){case 3:ye(u,u.stateNode.containerInfo),Cs(u,Dn,s.memoizedState.cache),Ul();break;case 27:case 5:W(u);break;case 4:ye(u,u.stateNode.containerInfo);break;case 10:Cs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,kg(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(js(u),u.flags|=128,null):(v&u.child.childLanes)!==0?hE(s,u,v):(js(u),s=Pi(s,u,v),s!==null?s.sibling:null);js(u);break;case 19:var C=(s.flags&128)!==0;if(g=(v&u.childLanes)!==0,g||(Wo(s,u,v,!1),g=(v&u.childLanes)!==0),C){if(g)return pE(s,u,v);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),P(kn,kn.current),g)break;return null;case 22:return u.lanes=0,lE(s,u,v,u.pendingProps);case 24:Cs(u,Dn,s.memoizedState.cache)}return Pi(s,u,v)}function mE(s,u,v){if(s!==null)if(s.memoizedProps!==u.pendingProps)_n=!0;else{if(!ty(s,v)&&(u.flags&128)===0)return _n=!1,B5(s,u,v);_n=(s.flags&131072)!==0}else _n=!1,jt&&(u.flags&1048576)!==0&&YS(u,Hc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(s=Gl(u.elementType),u.type=s,typeof s=="function")sg(s)?(g=Xl(s,g),u.tag=1,u=fE(null,u,s,g,v)):(u.tag=0,u=Yg(null,u,s,g,v));else{if(s!=null){var C=s.$$typeof;if(C===T){u.tag=11,u=aE(null,u,s,g,v);break e}else if(C===D){u.tag=14,u=iE(null,u,s,g,v);break e}}throw u=G(s)||s,Error(r(306,u,""))}}return u;case 0:return Yg(s,u,u.type,u.pendingProps,v);case 1:return g=u.type,C=Xl(g,u.pendingProps),fE(s,u,g,C,v);case 3:e:{if(ye(u,u.stateNode.containerInfo),s===null)throw Error(r(387));g=u.pendingProps;var k=u.memoizedState;C=k.element,wg(s,u),Zc(u,g,null,v);var O=u.memoizedState;if(g=O.cache,Cs(u,Dn,g),g!==k.cache&&pg(u,[Dn],v,!0),Wc(),g=O.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:O.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=dE(s,u,g,v);break e}else if(g!==C){C=ya(Error(r(424)),u),Gc(C),u=dE(s,u,g,v);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(an=Ea(s.firstChild),ir=u,jt=!0,Ss=null,wa=!0,v=l2(u,null,g,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling}else{if(Ul(),g===C){u=Pi(s,u,v);break e}lr(s,u,g,v)}u=u.child}return u;case 26:return Ph(s,u),s===null?(v=TC(u.type,null,u.pendingProps,null))?u.memoizedState=v:jt||(v=u.type,s=u.pendingProps,g=Jh(ie.current).createElement(v),g[un]=u,g[In]=s,or(g,v,s),Rn(g),u.stateNode=g):u.memoizedState=TC(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return W(u),s===null&&jt&&(g=u.stateNode=CC(u.type,u.pendingProps,ie.current),ir=u,wa=!0,C=an,Bs(u.type)?(Oy=C,an=Ea(g.firstChild)):an=C),lr(s,u,u.pendingProps.children,v),Ph(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&jt&&((C=g=an)&&(g=h4(g,u.type,u.pendingProps,wa),g!==null?(u.stateNode=g,ir=u,an=Ea(g.firstChild),wa=!1,C=!0):C=!1),C||Es(u)),W(u),C=u.type,k=u.pendingProps,O=s!==null?s.memoizedProps:null,g=k.children,Ay(C,k)?g=null:O!==null&&Ay(C,O)&&(u.flags|=32),u.memoizedState!==null&&(C=jg(s,u,j5,null,null,v),xf._currentValue=C),Ph(s,u),lr(s,u,g,v),u.child;case 6:return s===null&&jt&&((s=v=an)&&(v=v4(v,u.pendingProps,wa),v!==null?(u.stateNode=v,ir=u,an=null,s=!0):s=!1),s||Es(u)),null;case 13:return hE(s,u,v);case 4:return ye(u,u.stateNode.containerInfo),g=u.pendingProps,s===null?u.child=Kl(u,null,g,v):lr(s,u,g,v),u.child;case 11:return aE(s,u,u.type,u.pendingProps,v);case 7:return lr(s,u,u.pendingProps,v),u.child;case 8:return lr(s,u,u.pendingProps.children,v),u.child;case 12:return lr(s,u,u.pendingProps.children,v),u.child;case 10:return g=u.pendingProps,Cs(u,u.type,g.value),lr(s,u,g.children,v),u.child;case 9:return C=u.type._context,g=u.pendingProps.children,Vl(u),C=sr(C),g=g(C),u.flags|=1,lr(s,u,g,v),u.child;case 14:return iE(s,u,u.type,u.pendingProps,v);case 15:return sE(s,u,u.type,u.pendingProps,v);case 19:return pE(s,u,v);case 31:return P5(s,u,v);case 22:return lE(s,u,v,u.pendingProps);case 24:return Vl(u),g=sr(Dn),s===null?(C=yg(),C===null&&(C=Xt,k=mg(),C.pooledCache=k,k.refCount++,k!==null&&(C.pooledCacheLanes|=v),C=k),u.memoizedState={parent:g,cache:C},bg(u),Cs(u,Dn,C)):((s.lanes&v)!==0&&(wg(s,u),Zc(u,null,null,v),Wc()),C=s.memoizedState,k=u.memoizedState,C.parent!==g?(C={parent:g,cache:g},u.memoizedState=C,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=C),Cs(u,Dn,g)):(g=k.cache,Cs(u,Dn,g),g!==C.cache&&pg(u,[Dn],v,!0))),lr(s,u,u.pendingProps.children,v),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Bi(s){s.flags|=4}function ny(s,u,v,g,C){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(C&335544128)===C)if(s.stateNode.complete)s.flags|=8192;else if(VE())s.flags|=8192;else throw $l=wh,xg}else s.flags&=-16777217}function gE(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!MC(u))if(VE())s.flags|=8192;else throw $l=wh,xg}function zh(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?vt():536870912,s.lanes|=u,uu|=u)}function af(s,u){if(!jt)switch(s.tailMode){case"hidden":u=s.tail;for(var v=null;u!==null;)u.alternate!==null&&(v=u),u=u.sibling;v===null?s.tail=null:v.sibling=null;break;case"collapsed":v=s.tail;for(var g=null;v!==null;)v.alternate!==null&&(g=v),v=v.sibling;g===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function sn(s){var u=s.alternate!==null&&s.alternate.child===s.child,v=0,g=0;if(u)for(var C=s.child;C!==null;)v|=C.lanes|C.childLanes,g|=C.subtreeFlags&65011712,g|=C.flags&65011712,C.return=s,C=C.sibling;else for(C=s.child;C!==null;)v|=C.lanes|C.childLanes,g|=C.subtreeFlags,g|=C.flags,C.return=s,C=C.sibling;return s.subtreeFlags|=g,s.childLanes=v,u}function z5(s,u,v){var g=u.pendingProps;switch(cg(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(u),null;case 1:return sn(u),null;case 3:return v=u.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),_i(Dn),ne(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(s===null||s.child===null)&&(Qo(u)?Bi(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,dg())),sn(u),null;case 26:var C=u.type,k=u.memoizedState;return s===null?(Bi(u),k!==null?(sn(u),gE(u,k)):(sn(u),ny(u,C,null,g,v))):k?k!==s.memoizedState?(Bi(u),sn(u),gE(u,k)):(sn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==g&&Bi(u),sn(u),ny(u,C,s,g,v)),null;case 27:if(J(u),v=ie.current,C=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&Bi(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return sn(u),null}s=Z.current,Qo(u)?QS(u):(s=CC(C,g,v),u.stateNode=s,Bi(u))}return sn(u),null;case 5:if(J(u),C=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&Bi(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return sn(u),null}if(k=Z.current,Qo(u))QS(u);else{var O=Jh(ie.current);switch(k){case 1:k=O.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:k=O.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":k=O.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":k=O.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":k=O.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?O.createElement("select",{is:g.is}):O.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?O.createElement(C,{is:g.is}):O.createElement(C)}}k[un]=u,k[In]=g;e:for(O=u.child;O!==null;){if(O.tag===5||O.tag===6)k.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===u)break e;for(;O.sibling===null;){if(O.return===null||O.return===u)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}u.stateNode=k;e:switch(or(k,C,g),C){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Bi(u)}}return sn(u),ny(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,v),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==g&&Bi(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(s=ie.current,Qo(u)){if(s=u.stateNode,v=u.memoizedProps,g=null,C=ir,C!==null)switch(C.tag){case 27:case 5:g=C.memoizedProps}s[un]=u,s=!!(s.nodeValue===v||g!==null&&g.suppressHydrationWarning===!0||hC(s.nodeValue,v)),s||Es(u,!0)}else s=Jh(s).createTextNode(g),s[un]=u,u.stateNode=s}return sn(u),null;case 31:if(v=u.memoizedState,s===null||s.memoizedState!==null){if(g=Qo(u),v!==null){if(s===null){if(!g)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[un]=u}else Ul(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;sn(u),s=!1}else v=dg(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=v),s=!0;if(!s)return u.flags&256?(na(u),u):(na(u),null);if((u.flags&128)!==0)throw Error(r(558))}return sn(u),null;case 13:if(g=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(C=Qo(u),g!==null&&g.dehydrated!==null){if(s===null){if(!C)throw Error(r(318));if(C=u.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(r(317));C[un]=u}else Ul(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;sn(u),C=!1}else C=dg(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=C),C=!0;if(!C)return u.flags&256?(na(u),u):(na(u),null)}return na(u),(u.flags&128)!==0?(u.lanes=v,u):(v=g!==null,s=s!==null&&s.memoizedState!==null,v&&(g=u.child,C=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(C=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==C&&(g.flags|=2048)),v!==s&&v&&(u.child.flags|=8192),zh(u,u.updateQueue),sn(u),null);case 4:return ne(),s===null&&Cy(u.stateNode.containerInfo),sn(u),null;case 10:return _i(u.type),sn(u),null;case 19:if(X(kn),g=u.memoizedState,g===null)return sn(u),null;if(C=(u.flags&128)!==0,k=g.rendering,k===null)if(C)af(g,!1);else{if(bn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=Nh(s),k!==null){for(u.flags|=128,af(g,!1),s=k.updateQueue,u.updateQueue=s,zh(u,s),u.subtreeFlags=0,s=v,v=u.child;v!==null;)GS(v,s),v=v.sibling;return P(kn,kn.current&1|2),jt&&Di(u,g.treeForkCount),u.child}s=s.sibling}g.tail!==null&&ze()>Vh&&(u.flags|=128,C=!0,af(g,!1),u.lanes=4194304)}else{if(!C)if(s=Nh(k),s!==null){if(u.flags|=128,C=!0,s=s.updateQueue,u.updateQueue=s,zh(u,s),af(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!jt)return sn(u),null}else 2*ze()-g.renderingStartTime>Vh&&v!==536870912&&(u.flags|=128,C=!0,af(g,!1),u.lanes=4194304);g.isBackwards?(k.sibling=u.child,u.child=k):(s=g.last,s!==null?s.sibling=k:u.child=k,g.last=k)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=ze(),s.sibling=null,v=kn.current,P(kn,C?v&1|2:v&1),jt&&Di(u,g.treeForkCount),s):(sn(u),null);case 22:case 23:return na(u),Ng(),g=u.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(v&536870912)!==0&&(u.flags&128)===0&&(sn(u),u.subtreeFlags&6&&(u.flags|=8192)):sn(u),v=u.updateQueue,v!==null&&zh(u,v.retryQueue),v=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==v&&(u.flags|=2048),s!==null&&X(Hl),null;case 24:return v=null,s!==null&&(v=s.memoizedState.cache),u.memoizedState.cache!==v&&(u.flags|=2048),_i(Dn),sn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function I5(s,u){switch(cg(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return _i(Dn),ne(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return J(u),null;case 31:if(u.memoizedState!==null){if(na(u),u.alternate===null)throw Error(r(340));Ul()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(na(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Ul()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return X(kn),null;case 4:return ne(),null;case 10:return _i(u.type),null;case 22:case 23:return na(u),Ng(),s!==null&&X(Hl),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return _i(Dn),null;case 25:return null;default:return null}}function yE(s,u){switch(cg(u),u.tag){case 3:_i(Dn),ne();break;case 26:case 27:case 5:J(u);break;case 4:ne();break;case 31:u.memoizedState!==null&&na(u);break;case 13:na(u);break;case 19:X(kn);break;case 10:_i(u.type);break;case 22:case 23:na(u),Ng(),s!==null&&X(Hl);break;case 24:_i(Dn)}}function sf(s,u){try{var v=u.updateQueue,g=v!==null?v.lastEffect:null;if(g!==null){var C=g.next;v=C;do{if((v.tag&s)===s){g=void 0;var k=v.create,O=v.inst;g=k(),O.destroy=g}v=v.next}while(v!==C)}}catch($){Ut(u,u.return,$)}}function Rs(s,u,v){try{var g=u.updateQueue,C=g!==null?g.lastEffect:null;if(C!==null){var k=C.next;g=k;do{if((g.tag&s)===s){var O=g.inst,$=O.destroy;if($!==void 0){O.destroy=void 0,C=u;var ee=v,fe=$;try{fe()}catch(we){Ut(C,ee,we)}}}g=g.next}while(g!==k)}}catch(we){Ut(u,u.return,we)}}function xE(s){var u=s.updateQueue;if(u!==null){var v=s.stateNode;try{u2(u,v)}catch(g){Ut(s,s.return,g)}}}function bE(s,u,v){v.props=Xl(s.type,s.memoizedProps),v.state=s.memoizedState;try{v.componentWillUnmount()}catch(g){Ut(s,u,g)}}function lf(s,u){try{var v=s.ref;if(v!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof v=="function"?s.refCleanup=v(g):v.current=g}}catch(C){Ut(s,u,C)}}function ni(s,u){var v=s.ref,g=s.refCleanup;if(v!==null)if(typeof g=="function")try{g()}catch(C){Ut(s,u,C)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof v=="function")try{v(null)}catch(C){Ut(s,u,C)}else v.current=null}function wE(s){var u=s.type,v=s.memoizedProps,g=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":v.autoFocus&&g.focus();break e;case"img":v.src?g.src=v.src:v.srcSet&&(g.srcset=v.srcSet)}}catch(C){Ut(s,s.return,C)}}function ry(s,u,v){try{var g=s.stateNode;l4(g,s.type,v,u),g[In]=u}catch(C){Ut(s,s.return,C)}}function SE(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Bs(s.type)||s.tag===4}function ay(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||SE(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Bs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function iy(s,u,v){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?(v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v).insertBefore(s,u):(u=v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v,u.appendChild(s),v=v._reactRootContainer,v!=null||u.onclick!==null||(u.onclick=ji));else if(g!==4&&(g===27&&Bs(s.type)&&(v=s.stateNode,u=null),s=s.child,s!==null))for(iy(s,u,v),s=s.sibling;s!==null;)iy(s,u,v),s=s.sibling}function Ih(s,u,v){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?v.insertBefore(s,u):v.appendChild(s);else if(g!==4&&(g===27&&Bs(s.type)&&(v=s.stateNode),s=s.child,s!==null))for(Ih(s,u,v),s=s.sibling;s!==null;)Ih(s,u,v),s=s.sibling}function EE(s){var u=s.stateNode,v=s.memoizedProps;try{for(var g=s.type,C=u.attributes;C.length;)u.removeAttributeNode(C[0]);or(u,g,v),u[un]=s,u[In]=v}catch(k){Ut(s,s.return,k)}}var zi=!1,On=!1,sy=!1,CE=typeof WeakSet=="function"?WeakSet:Set,Zn=null;function F5(s,u){if(s=s.containerInfo,Ty=sv,s=PS(s),Jm(s)){if("selectionStart"in s)var v={start:s.selectionStart,end:s.selectionEnd};else e:{v=(v=s.ownerDocument)&&v.defaultView||window;var g=v.getSelection&&v.getSelection();if(g&&g.rangeCount!==0){v=g.anchorNode;var C=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{v.nodeType,k.nodeType}catch{v=null;break e}var O=0,$=-1,ee=-1,fe=0,we=0,Ee=s,ve=null;t:for(;;){for(var me;Ee!==v||C!==0&&Ee.nodeType!==3||($=O+C),Ee!==k||g!==0&&Ee.nodeType!==3||(ee=O+g),Ee.nodeType===3&&(O+=Ee.nodeValue.length),(me=Ee.firstChild)!==null;)ve=Ee,Ee=me;for(;;){if(Ee===s)break t;if(ve===v&&++fe===C&&($=O),ve===k&&++we===g&&(ee=O),(me=Ee.nextSibling)!==null)break;Ee=ve,ve=Ee.parentNode}Ee=me}v=$===-1||ee===-1?null:{start:$,end:ee}}else v=null}v=v||{start:0,end:0}}else v=null;for(jy={focusedElem:s,selectionRange:v},sv=!1,Zn=u;Zn!==null;)if(u=Zn,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Zn=s;else for(;Zn!==null;){switch(u=Zn,k=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(v=0;v<s.length;v++)C=s[v],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,v=u,C=k.memoizedProps,k=k.memoizedState,g=v.stateNode;try{var Ge=Xl(v.type,C);s=g.getSnapshotBeforeUpdate(Ge,k),g.__reactInternalSnapshotBeforeUpdate=s}catch(it){Ut(v,v.return,it)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,v=s.nodeType,v===9)Dy(s);else if(v===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Dy(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=u.sibling,s!==null){s.return=u.return,Zn=s;break}Zn=u.return}}function NE(s,u,v){var g=v.flags;switch(v.tag){case 0:case 11:case 15:Fi(s,v),g&4&&sf(5,v);break;case 1:if(Fi(s,v),g&4)if(s=v.stateNode,u===null)try{s.componentDidMount()}catch(O){Ut(v,v.return,O)}else{var C=Xl(v.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(C,u,s.__reactInternalSnapshotBeforeUpdate)}catch(O){Ut(v,v.return,O)}}g&64&&xE(v),g&512&&lf(v,v.return);break;case 3:if(Fi(s,v),g&64&&(s=v.updateQueue,s!==null)){if(u=null,v.child!==null)switch(v.child.tag){case 27:case 5:u=v.child.stateNode;break;case 1:u=v.child.stateNode}try{u2(s,u)}catch(O){Ut(v,v.return,O)}}break;case 27:u===null&&g&4&&EE(v);case 26:case 5:Fi(s,v),u===null&&g&4&&wE(v),g&512&&lf(v,v.return);break;case 12:Fi(s,v);break;case 31:Fi(s,v),g&4&&jE(s,v);break;case 13:Fi(s,v),g&4&&AE(s,v),g&64&&(s=v.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(v=X5.bind(null,v),p4(s,v))));break;case 22:if(g=v.memoizedState!==null||zi,!g){u=u!==null&&u.memoizedState!==null||On,C=zi;var k=On;zi=g,(On=u)&&!k?Ui(s,v,(v.subtreeFlags&8772)!==0):Fi(s,v),zi=C,On=k}break;case 30:break;default:Fi(s,v)}}function kE(s){var u=s.alternate;u!==null&&(s.alternate=null,kE(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Bo(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var cn=null,Br=!1;function Ii(s,u,v){for(v=v.child;v!==null;)TE(s,u,v),v=v.sibling}function TE(s,u,v){if(ue&&typeof ue.onCommitFiberUnmount=="function")try{ue.onCommitFiberUnmount(Y,v)}catch{}switch(v.tag){case 26:On||ni(v,u),Ii(s,u,v),v.memoizedState?v.memoizedState.count--:v.stateNode&&(v=v.stateNode,v.parentNode.removeChild(v));break;case 27:On||ni(v,u);var g=cn,C=Br;Bs(v.type)&&(cn=v.stateNode,Br=!1),Ii(s,u,v),mf(v.stateNode),cn=g,Br=C;break;case 5:On||ni(v,u);case 6:if(g=cn,C=Br,cn=null,Ii(s,u,v),cn=g,Br=C,cn!==null)if(Br)try{(cn.nodeType===9?cn.body:cn.nodeName==="HTML"?cn.ownerDocument.body:cn).removeChild(v.stateNode)}catch(k){Ut(v,u,k)}else try{cn.removeChild(v.stateNode)}catch(k){Ut(v,u,k)}break;case 18:cn!==null&&(Br?(s=cn,xC(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,v.stateNode),gu(s)):xC(cn,v.stateNode));break;case 4:g=cn,C=Br,cn=v.stateNode.containerInfo,Br=!0,Ii(s,u,v),cn=g,Br=C;break;case 0:case 11:case 14:case 15:Rs(2,v,u),On||Rs(4,v,u),Ii(s,u,v);break;case 1:On||(ni(v,u),g=v.stateNode,typeof g.componentWillUnmount=="function"&&bE(v,u,g)),Ii(s,u,v);break;case 21:Ii(s,u,v);break;case 22:On=(g=On)||v.memoizedState!==null,Ii(s,u,v),On=g;break;default:Ii(s,u,v)}}function jE(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{gu(s)}catch(v){Ut(u,u.return,v)}}}function AE(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{gu(s)}catch(v){Ut(u,u.return,v)}}function U5(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new CE),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new CE),u;default:throw Error(r(435,s.tag))}}function Fh(s,u){var v=U5(s);u.forEach(function(g){if(!v.has(g)){v.add(g);var C=Q5.bind(null,s,g);g.then(C,C)}})}function zr(s,u){var v=u.deletions;if(v!==null)for(var g=0;g<v.length;g++){var C=v[g],k=s,O=u,$=O;e:for(;$!==null;){switch($.tag){case 27:if(Bs($.type)){cn=$.stateNode,Br=!1;break e}break;case 5:cn=$.stateNode,Br=!1;break e;case 3:case 4:cn=$.stateNode.containerInfo,Br=!0;break e}$=$.return}if(cn===null)throw Error(r(160));TE(k,O,C),cn=null,Br=!1,k=C.alternate,k!==null&&(k.return=null),C.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)RE(u,s),u=u.sibling}var Ba=null;function RE(s,u){var v=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:zr(u,s),Ir(s),g&4&&(Rs(3,s,s.return),sf(3,s),Rs(5,s,s.return));break;case 1:zr(u,s),Ir(s),g&512&&(On||v===null||ni(v,v.return)),g&64&&zi&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(v=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=v===null?g:v.concat(g))));break;case 26:var C=Ba;if(zr(u,s),Ir(s),g&512&&(On||v===null||ni(v,v.return)),g&4){var k=v!==null?v.memoizedState:null;if(g=s.memoizedState,v===null)if(g===null)if(s.stateNode===null){e:{g=s.type,v=s.memoizedProps,C=C.ownerDocument||C;t:switch(g){case"title":k=C.getElementsByTagName("title")[0],(!k||k[Qn]||k[un]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=C.createElement(g),C.head.insertBefore(k,C.querySelector("head > title"))),or(k,g,v),k[un]=s,Rn(k),g=k;break e;case"link":var O=RC("link","href",C).get(g+(v.href||""));if(O){for(var $=0;$<O.length;$++)if(k=O[$],k.getAttribute("href")===(v.href==null||v.href===""?null:v.href)&&k.getAttribute("rel")===(v.rel==null?null:v.rel)&&k.getAttribute("title")===(v.title==null?null:v.title)&&k.getAttribute("crossorigin")===(v.crossOrigin==null?null:v.crossOrigin)){O.splice($,1);break t}}k=C.createElement(g),or(k,g,v),C.head.appendChild(k);break;case"meta":if(O=RC("meta","content",C).get(g+(v.content||""))){for($=0;$<O.length;$++)if(k=O[$],k.getAttribute("content")===(v.content==null?null:""+v.content)&&k.getAttribute("name")===(v.name==null?null:v.name)&&k.getAttribute("property")===(v.property==null?null:v.property)&&k.getAttribute("http-equiv")===(v.httpEquiv==null?null:v.httpEquiv)&&k.getAttribute("charset")===(v.charSet==null?null:v.charSet)){O.splice($,1);break t}}k=C.createElement(g),or(k,g,v),C.head.appendChild(k);break;default:throw Error(r(468,g))}k[un]=s,Rn(k),g=k}s.stateNode=g}else DC(C,s.type,s.stateNode);else s.stateNode=AC(C,g,s.memoizedProps);else k!==g?(k===null?v.stateNode!==null&&(v=v.stateNode,v.parentNode.removeChild(v)):k.count--,g===null?DC(C,s.type,s.stateNode):AC(C,g,s.memoizedProps)):g===null&&s.stateNode!==null&&ry(s,s.memoizedProps,v.memoizedProps)}break;case 27:zr(u,s),Ir(s),g&512&&(On||v===null||ni(v,v.return)),v!==null&&g&4&&ry(s,s.memoizedProps,v.memoizedProps);break;case 5:if(zr(u,s),Ir(s),g&512&&(On||v===null||ni(v,v.return)),s.flags&32){C=s.stateNode;try{Fo(C,"")}catch(Ge){Ut(s,s.return,Ge)}}g&4&&s.stateNode!=null&&(C=s.memoizedProps,ry(s,C,v!==null?v.memoizedProps:C)),g&1024&&(sy=!0);break;case 6:if(zr(u,s),Ir(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,v=s.stateNode;try{v.nodeValue=g}catch(Ge){Ut(s,s.return,Ge)}}break;case 3:if(nv=null,C=Ba,Ba=ev(u.containerInfo),zr(u,s),Ba=C,Ir(s),g&4&&v!==null&&v.memoizedState.isDehydrated)try{gu(u.containerInfo)}catch(Ge){Ut(s,s.return,Ge)}sy&&(sy=!1,DE(s));break;case 4:g=Ba,Ba=ev(s.stateNode.containerInfo),zr(u,s),Ir(s),Ba=g;break;case 12:zr(u,s),Ir(s);break;case 31:zr(u,s),Ir(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Fh(s,g)));break;case 13:zr(u,s),Ir(s),s.child.flags&8192&&s.memoizedState!==null!=(v!==null&&v.memoizedState!==null)&&(qh=ze()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Fh(s,g)));break;case 22:C=s.memoizedState!==null;var ee=v!==null&&v.memoizedState!==null,fe=zi,we=On;if(zi=fe||C,On=we||ee,zr(u,s),On=we,zi=fe,Ir(s),g&8192)e:for(u=s.stateNode,u._visibility=C?u._visibility&-2:u._visibility|1,C&&(v===null||ee||zi||On||Ql(s)),v=null,u=s;;){if(u.tag===5||u.tag===26){if(v===null){ee=v=u;try{if(k=ee.stateNode,C)O=k.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{$=ee.stateNode;var Ee=ee.memoizedProps.style,ve=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;$.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Ge){Ut(ee,ee.return,Ge)}}}else if(u.tag===6){if(v===null){ee=u;try{ee.stateNode.nodeValue=C?"":ee.memoizedProps}catch(Ge){Ut(ee,ee.return,Ge)}}}else if(u.tag===18){if(v===null){ee=u;try{var me=ee.stateNode;C?bC(me,!0):bC(ee.stateNode,!1)}catch(Ge){Ut(ee,ee.return,Ge)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;v===u&&(v=null),u=u.return}v===u&&(v=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=s.updateQueue,g!==null&&(v=g.retryQueue,v!==null&&(g.retryQueue=null,Fh(s,v))));break;case 19:zr(u,s),Ir(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Fh(s,g)));break;case 30:break;case 21:break;default:zr(u,s),Ir(s)}}function Ir(s){var u=s.flags;if(u&2){try{for(var v,g=s.return;g!==null;){if(SE(g)){v=g;break}g=g.return}if(v==null)throw Error(r(160));switch(v.tag){case 27:var C=v.stateNode,k=ay(s);Ih(s,k,C);break;case 5:var O=v.stateNode;v.flags&32&&(Fo(O,""),v.flags&=-33);var $=ay(s);Ih(s,$,O);break;case 3:case 4:var ee=v.stateNode.containerInfo,fe=ay(s);iy(s,fe,ee);break;default:throw Error(r(161))}}catch(we){Ut(s,s.return,we)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function DE(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;DE(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Fi(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)NE(s,u.alternate,u),u=u.sibling}function Ql(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:Rs(4,u,u.return),Ql(u);break;case 1:ni(u,u.return);var v=u.stateNode;typeof v.componentWillUnmount=="function"&&bE(u,u.return,v),Ql(u);break;case 27:mf(u.stateNode);case 26:case 5:ni(u,u.return),Ql(u);break;case 22:u.memoizedState===null&&Ql(u);break;case 30:Ql(u);break;default:Ql(u)}s=s.sibling}}function Ui(s,u,v){for(v=v&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,C=s,k=u,O=k.flags;switch(k.tag){case 0:case 11:case 15:Ui(C,k,v),sf(4,k);break;case 1:if(Ui(C,k,v),g=k,C=g.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(fe){Ut(g,g.return,fe)}if(g=k,C=g.updateQueue,C!==null){var $=g.stateNode;try{var ee=C.shared.hiddenCallbacks;if(ee!==null)for(C.shared.hiddenCallbacks=null,C=0;C<ee.length;C++)o2(ee[C],$)}catch(fe){Ut(g,g.return,fe)}}v&&O&64&&xE(k),lf(k,k.return);break;case 27:EE(k);case 26:case 5:Ui(C,k,v),v&&g===null&&O&4&&wE(k),lf(k,k.return);break;case 12:Ui(C,k,v);break;case 31:Ui(C,k,v),v&&O&4&&jE(C,k);break;case 13:Ui(C,k,v),v&&O&4&&AE(C,k);break;case 22:k.memoizedState===null&&Ui(C,k,v),lf(k,k.return);break;case 30:break;default:Ui(C,k,v)}u=u.sibling}}function ly(s,u){var v=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==v&&(s!=null&&s.refCount++,v!=null&&$c(v))}function oy(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&$c(s))}function za(s,u,v,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)ME(s,u,v,g),u=u.sibling}function ME(s,u,v,g){var C=u.flags;switch(u.tag){case 0:case 11:case 15:za(s,u,v,g),C&2048&&sf(9,u);break;case 1:za(s,u,v,g);break;case 3:za(s,u,v,g),C&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&$c(s)));break;case 12:if(C&2048){za(s,u,v,g),s=u.stateNode;try{var k=u.memoizedProps,O=k.id,$=k.onPostCommit;typeof $=="function"&&$(O,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(ee){Ut(u,u.return,ee)}}else za(s,u,v,g);break;case 31:za(s,u,v,g);break;case 13:za(s,u,v,g);break;case 23:break;case 22:k=u.stateNode,O=u.alternate,u.memoizedState!==null?k._visibility&2?za(s,u,v,g):of(s,u):k._visibility&2?za(s,u,v,g):(k._visibility|=2,su(s,u,v,g,(u.subtreeFlags&10256)!==0||!1)),C&2048&&ly(O,u);break;case 24:za(s,u,v,g),C&2048&&oy(u.alternate,u);break;default:za(s,u,v,g)}}function su(s,u,v,g,C){for(C=C&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,O=u,$=v,ee=g,fe=O.flags;switch(O.tag){case 0:case 11:case 15:su(k,O,$,ee,C),sf(8,O);break;case 23:break;case 22:var we=O.stateNode;O.memoizedState!==null?we._visibility&2?su(k,O,$,ee,C):of(k,O):(we._visibility|=2,su(k,O,$,ee,C)),C&&fe&2048&&ly(O.alternate,O);break;case 24:su(k,O,$,ee,C),C&&fe&2048&&oy(O.alternate,O);break;default:su(k,O,$,ee,C)}u=u.sibling}}function of(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var v=s,g=u,C=g.flags;switch(g.tag){case 22:of(v,g),C&2048&&ly(g.alternate,g);break;case 24:of(v,g),C&2048&&oy(g.alternate,g);break;default:of(v,g)}u=u.sibling}}var uf=8192;function lu(s,u,v){if(s.subtreeFlags&uf)for(s=s.child;s!==null;)_E(s,u,v),s=s.sibling}function _E(s,u,v){switch(s.tag){case 26:lu(s,u,v),s.flags&uf&&s.memoizedState!==null&&T4(v,Ba,s.memoizedState,s.memoizedProps);break;case 5:lu(s,u,v);break;case 3:case 4:var g=Ba;Ba=ev(s.stateNode.containerInfo),lu(s,u,v),Ba=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=uf,uf=16777216,lu(s,u,v),uf=g):lu(s,u,v));break;default:lu(s,u,v)}}function OE(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function cf(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var v=0;v<u.length;v++){var g=u[v];Zn=g,PE(g,s)}OE(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)LE(s),s=s.sibling}function LE(s){switch(s.tag){case 0:case 11:case 15:cf(s),s.flags&2048&&Rs(9,s,s.return);break;case 3:cf(s);break;case 12:cf(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,Uh(s)):cf(s);break;default:cf(s)}}function Uh(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var v=0;v<u.length;v++){var g=u[v];Zn=g,PE(g,s)}OE(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Rs(8,u,u.return),Uh(u);break;case 22:v=u.stateNode,v._visibility&2&&(v._visibility&=-3,Uh(u));break;default:Uh(u)}s=s.sibling}}function PE(s,u){for(;Zn!==null;){var v=Zn;switch(v.tag){case 0:case 11:case 15:Rs(8,v,u);break;case 23:case 22:if(v.memoizedState!==null&&v.memoizedState.cachePool!==null){var g=v.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:$c(v.memoizedState.cache)}if(g=v.child,g!==null)g.return=v,Zn=g;else e:for(v=s;Zn!==null;){g=Zn;var C=g.sibling,k=g.return;if(kE(g),g===v){Zn=null;break e}if(C!==null){C.return=k,Zn=C;break e}Zn=k}}}var q5={getCacheForType:function(s){var u=sr(Dn),v=u.data.get(s);return v===void 0&&(v=s(),u.data.set(s,v)),v},cacheSignal:function(){return sr(Dn).controller.signal}},V5=typeof WeakMap=="function"?WeakMap:Map,Pt=0,Xt=null,Et=null,kt=0,Ft=0,ra=null,Ds=!1,ou=!1,uy=!1,qi=0,bn=0,Ms=0,Wl=0,cy=0,aa=0,uu=0,ff=null,Fr=null,fy=!1,qh=0,BE=0,Vh=1/0,Hh=null,_s=null,Fn=0,Os=null,cu=null,Vi=0,dy=0,hy=null,zE=null,df=0,vy=null;function ia(){return(Pt&2)!==0&&kt!==0?kt&-kt:I.T!==null?by():pn()}function IE(){if(aa===0)if((kt&536870912)===0||jt){var s=Ue;Ue<<=1,(Ue&3932160)===0&&(Ue=262144),aa=s}else aa=536870912;return s=ta.current,s!==null&&(s.flags|=32),aa}function Ur(s,u,v){(s===Xt&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)&&(fu(s,0),Ls(s,kt,aa,!1)),Vt(s,v),((Pt&2)===0||s!==Xt)&&(s===Xt&&((Pt&2)===0&&(Wl|=v),bn===4&&Ls(s,kt,aa,!1)),ri(s))}function FE(s,u,v){if((Pt&6)!==0)throw Error(r(327));var g=!v&&(u&127)===0&&(u&s.expiredLanes)===0||He(s,u),C=g?$5(s,u):my(s,u,!0),k=g;do{if(C===0){ou&&!g&&Ls(s,u,0,!1);break}else{if(v=s.current.alternate,k&&!H5(v)){C=my(s,u,!1),k=!1;continue}if(C===2){if(k=u,s.errorRecoveryDisabledLanes&k)var O=0;else O=s.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){u=O;e:{var $=s;C=ff;var ee=$.current.memoizedState.isDehydrated;if(ee&&(fu($,O).flags|=256),O=my($,O,!1),O!==2){if(uy&&!ee){$.errorRecoveryDisabledLanes|=k,Wl|=k,C=4;break e}k=Fr,Fr=C,k!==null&&(Fr===null?Fr=k:Fr.push.apply(Fr,k))}C=O}if(k=!1,C!==2)continue}}if(C===1){fu(s,0),Ls(s,u,0,!0);break}e:{switch(g=s,k=C,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Ls(g,u,aa,!Ds);break e;case 2:Fr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(C=qh+300-ze(),10<C)){if(Ls(g,u,aa,!Ds),ct(g,0,!0)!==0)break e;Vi=u,g.timeoutHandle=gC(UE.bind(null,g,v,Fr,Hh,fy,u,aa,Wl,uu,Ds,k,"Throttled",-0,0),C);break e}UE(g,v,Fr,Hh,fy,u,aa,Wl,uu,Ds,k,null,-0,0)}}break}while(!0);ri(s)}function UE(s,u,v,g,C,k,O,$,ee,fe,we,Ee,ve,me){if(s.timeoutHandle=-1,Ee=u.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ji},_E(u,k,Ee);var Ge=(k&62914560)===k?qh-ze():(k&4194048)===k?BE-ze():0;if(Ge=j4(Ee,Ge),Ge!==null){Vi=k,s.cancelPendingCommit=Ge(XE.bind(null,s,u,k,v,g,C,O,$,ee,we,Ee,null,ve,me)),Ls(s,k,O,!fe);return}}XE(s,u,k,v,g,C,O,$,ee)}function H5(s){for(var u=s;;){var v=u.tag;if((v===0||v===11||v===15)&&u.flags&16384&&(v=u.updateQueue,v!==null&&(v=v.stores,v!==null)))for(var g=0;g<v.length;g++){var C=v[g],k=C.getSnapshot;C=C.value;try{if(!Jr(k(),C))return!1}catch{return!1}}if(v=u.child,u.subtreeFlags&16384&&v!==null)v.return=u,u=v;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Ls(s,u,v,g){u&=~cy,u&=~Wl,s.suspendedLanes|=u,s.pingedLanes&=~u,g&&(s.warmLanes|=u),g=s.expirationTimes;for(var C=u;0<C;){var k=31-de(C),O=1<<k;g[k]=-1,C&=~O}v!==0&&vn(s,v,u)}function Gh(){return(Pt&6)===0?(hf(0),!1):!0}function py(){if(Et!==null){if(Ft===0)var s=Et.return;else s=Et,Mi=ql=null,Dg(s),tu=null,Yc=0,s=Et;for(;s!==null;)yE(s.alternate,s),s=s.return;Et=null}}function fu(s,u){var v=s.timeoutHandle;v!==-1&&(s.timeoutHandle=-1,c4(v)),v=s.cancelPendingCommit,v!==null&&(s.cancelPendingCommit=null,v()),Vi=0,py(),Xt=s,Et=v=Ri(s.current,null),kt=u,Ft=0,ra=null,Ds=!1,ou=He(s,u),uy=!1,uu=aa=cy=Wl=Ms=bn=0,Fr=ff=null,fy=!1,(u&8)!==0&&(u|=u&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=u;0<g;){var C=31-de(g),k=1<<C;u|=s[C],g&=~k}return qi=u,dh(),v}function qE(s,u){ht=null,I.H=nf,u===eu||u===bh?(u=a2(),Ft=3):u===xg?(u=a2(),Ft=4):Ft=u===Kg?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,ra=u,Et===null&&(bn=1,Oh(s,ya(u,s.current)))}function VE(){var s=ta.current;return s===null?!0:(kt&4194048)===kt?Sa===null:(kt&62914560)===kt||(kt&536870912)!==0?s===Sa:!1}function HE(){var s=I.H;return I.H=nf,s===null?nf:s}function GE(){var s=I.A;return I.A=q5,s}function $h(){bn=4,Ds||(kt&4194048)!==kt&&ta.current!==null||(ou=!0),(Ms&134217727)===0&&(Wl&134217727)===0||Xt===null||Ls(Xt,kt,aa,!1)}function my(s,u,v){var g=Pt;Pt|=2;var C=HE(),k=GE();(Xt!==s||kt!==u)&&(Hh=null,fu(s,u)),u=!1;var O=bn;e:do try{if(Ft!==0&&Et!==null){var $=Et,ee=ra;switch(Ft){case 8:py(),O=6;break e;case 3:case 2:case 9:case 6:ta.current===null&&(u=!0);var fe=Ft;if(Ft=0,ra=null,du(s,$,ee,fe),v&&ou){O=0;break e}break;default:fe=Ft,Ft=0,ra=null,du(s,$,ee,fe)}}G5(),O=bn;break}catch(we){qE(s,we)}while(!0);return u&&s.shellSuspendCounter++,Mi=ql=null,Pt=g,I.H=C,I.A=k,Et===null&&(Xt=null,kt=0,dh()),O}function G5(){for(;Et!==null;)$E(Et)}function $5(s,u){var v=Pt;Pt|=2;var g=HE(),C=GE();Xt!==s||kt!==u?(Hh=null,Vh=ze()+500,fu(s,u)):ou=He(s,u);e:do try{if(Ft!==0&&Et!==null){u=Et;var k=ra;t:switch(Ft){case 1:Ft=0,ra=null,du(s,u,k,1);break;case 2:case 9:if(n2(k)){Ft=0,ra=null,KE(u);break}u=function(){Ft!==2&&Ft!==9||Xt!==s||(Ft=7),ri(s)},k.then(u,u);break e;case 3:Ft=7;break e;case 4:Ft=5;break e;case 7:n2(k)?(Ft=0,ra=null,KE(u)):(Ft=0,ra=null,du(s,u,k,7));break;case 5:var O=null;switch(Et.tag){case 26:O=Et.memoizedState;case 5:case 27:var $=Et;if(O?MC(O):$.stateNode.complete){Ft=0,ra=null;var ee=$.sibling;if(ee!==null)Et=ee;else{var fe=$.return;fe!==null?(Et=fe,Kh(fe)):Et=null}break t}}Ft=0,ra=null,du(s,u,k,5);break;case 6:Ft=0,ra=null,du(s,u,k,6);break;case 8:py(),bn=6;break e;default:throw Error(r(462))}}K5();break}catch(we){qE(s,we)}while(!0);return Mi=ql=null,I.H=g,I.A=C,Pt=v,Et!==null?0:(Xt=null,kt=0,dh(),bn)}function K5(){for(;Et!==null&&!Qe();)$E(Et)}function $E(s){var u=mE(s.alternate,s,qi);s.memoizedProps=s.pendingProps,u===null?Kh(s):Et=u}function KE(s){var u=s,v=u.alternate;switch(u.tag){case 15:case 0:u=cE(v,u,u.pendingProps,u.type,void 0,kt);break;case 11:u=cE(v,u,u.pendingProps,u.type.render,u.ref,kt);break;case 5:Dg(u);default:yE(v,u),u=Et=GS(u,qi),u=mE(v,u,qi)}s.memoizedProps=s.pendingProps,u===null?Kh(s):Et=u}function du(s,u,v,g){Mi=ql=null,Dg(u),tu=null,Yc=0;var C=u.return;try{if(L5(s,C,u,v,kt)){bn=1,Oh(s,ya(v,s.current)),Et=null;return}}catch(k){if(C!==null)throw Et=C,k;bn=1,Oh(s,ya(v,s.current)),Et=null;return}u.flags&32768?(jt||g===1?s=!0:ou||(kt&536870912)!==0?s=!1:(Ds=s=!0,(g===2||g===9||g===3||g===6)&&(g=ta.current,g!==null&&g.tag===13&&(g.flags|=16384))),YE(u,s)):Kh(u)}function Kh(s){var u=s;do{if((u.flags&32768)!==0){YE(u,Ds);return}s=u.return;var v=z5(u.alternate,u,qi);if(v!==null){Et=v;return}if(u=u.sibling,u!==null){Et=u;return}Et=u=s}while(u!==null);bn===0&&(bn=5)}function YE(s,u){do{var v=I5(s.alternate,s);if(v!==null){v.flags&=32767,Et=v;return}if(v=s.return,v!==null&&(v.flags|=32768,v.subtreeFlags=0,v.deletions=null),!u&&(s=s.sibling,s!==null)){Et=s;return}Et=s=v}while(s!==null);bn=6,Et=null}function XE(s,u,v,g,C,k,O,$,ee){s.cancelPendingCommit=null;do Yh();while(Fn!==0);if((Pt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=ag,ar(s,v,k,O,$,ee),s===Xt&&(Et=Xt=null,kt=0),cu=u,Os=s,Vi=v,dy=k,hy=C,zE=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,W5(Me,function(){return eC(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=I.T,I.T=null,C=V.p,V.p=2,O=Pt,Pt|=4;try{F5(s,u,v)}finally{Pt=O,V.p=C,I.T=g}}Fn=1,QE(),WE(),ZE()}}function QE(){if(Fn===1){Fn=0;var s=Os,u=cu,v=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||v){v=I.T,I.T=null;var g=V.p;V.p=2;var C=Pt;Pt|=4;try{RE(u,s);var k=jy,O=PS(s.containerInfo),$=k.focusedElem,ee=k.selectionRange;if(O!==$&&$&&$.ownerDocument&&LS($.ownerDocument.documentElement,$)){if(ee!==null&&Jm($)){var fe=ee.start,we=ee.end;if(we===void 0&&(we=fe),"selectionStart"in $)$.selectionStart=fe,$.selectionEnd=Math.min(we,$.value.length);else{var Ee=$.ownerDocument||document,ve=Ee&&Ee.defaultView||window;if(ve.getSelection){var me=ve.getSelection(),Ge=$.textContent.length,it=Math.min(ee.start,Ge),$t=ee.end===void 0?it:Math.min(ee.end,Ge);!me.extend&&it>$t&&(O=$t,$t=it,it=O);var oe=OS($,it),re=OS($,$t);if(oe&&re&&(me.rangeCount!==1||me.anchorNode!==oe.node||me.anchorOffset!==oe.offset||me.focusNode!==re.node||me.focusOffset!==re.offset)){var ce=Ee.createRange();ce.setStart(oe.node,oe.offset),me.removeAllRanges(),it>$t?(me.addRange(ce),me.extend(re.node,re.offset)):(ce.setEnd(re.node,re.offset),me.addRange(ce))}}}}for(Ee=[],me=$;me=me.parentNode;)me.nodeType===1&&Ee.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<Ee.length;$++){var Se=Ee[$];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}sv=!!Ty,jy=Ty=null}finally{Pt=C,V.p=g,I.T=v}}s.current=u,Fn=2}}function WE(){if(Fn===2){Fn=0;var s=Os,u=cu,v=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||v){v=I.T,I.T=null;var g=V.p;V.p=2;var C=Pt;Pt|=4;try{NE(s,u.alternate,u)}finally{Pt=C,V.p=g,I.T=v}}Fn=3}}function ZE(){if(Fn===4||Fn===3){Fn=0,st();var s=Os,u=cu,v=Vi,g=zE;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Fn=5:(Fn=0,cu=Os=null,JE(s,s.pendingLanes));var C=s.pendingLanes;if(C===0&&(_s=null),ha(v),u=u.stateNode,ue&&typeof ue.onCommitFiberRoot=="function")try{ue.onCommitFiberRoot(Y,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=I.T,C=V.p,V.p=2,I.T=null;try{for(var k=s.onRecoverableError,O=0;O<g.length;O++){var $=g[O];k($.value,{componentStack:$.stack})}}finally{I.T=u,V.p=C}}(Vi&3)!==0&&Yh(),ri(s),C=s.pendingLanes,(v&261930)!==0&&(C&42)!==0?s===vy?df++:(df=0,vy=s):df=0,hf(0)}}function JE(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,$c(u)))}function Yh(){return QE(),WE(),ZE(),eC()}function eC(){if(Fn!==5)return!1;var s=Os,u=dy;dy=0;var v=ha(Vi),g=I.T,C=V.p;try{V.p=32>v?32:v,I.T=null,v=hy,hy=null;var k=Os,O=Vi;if(Fn=0,cu=Os=null,Vi=0,(Pt&6)!==0)throw Error(r(331));var $=Pt;if(Pt|=4,LE(k.current),ME(k,k.current,O,v),Pt=$,hf(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(Y,k)}catch{}return!0}finally{V.p=C,I.T=g,JE(s,u)}}function tC(s,u,v){u=ya(v,u),u=$g(s.stateNode,u,2),s=Ts(s,u,2),s!==null&&(Vt(s,2),ri(s))}function Ut(s,u,v){if(s.tag===3)tC(s,s,v);else for(;u!==null;){if(u.tag===3){tC(u,s,v);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(_s===null||!_s.has(g))){s=ya(v,s),v=nE(2),g=Ts(u,v,2),g!==null&&(rE(v,g,u,s),Vt(g,2),ri(g));break}}u=u.return}}function gy(s,u,v){var g=s.pingCache;if(g===null){g=s.pingCache=new V5;var C=new Set;g.set(u,C)}else C=g.get(u),C===void 0&&(C=new Set,g.set(u,C));C.has(v)||(uy=!0,C.add(v),s=Y5.bind(null,s,u,v),u.then(s,s))}function Y5(s,u,v){var g=s.pingCache;g!==null&&g.delete(u),s.pingedLanes|=s.suspendedLanes&v,s.warmLanes&=~v,Xt===s&&(kt&v)===v&&(bn===4||bn===3&&(kt&62914560)===kt&&300>ze()-qh?(Pt&2)===0&&fu(s,0):cy|=v,uu===kt&&(uu=0)),ri(s)}function nC(s,u){u===0&&(u=vt()),s=Il(s,u),s!==null&&(Vt(s,u),ri(s))}function X5(s){var u=s.memoizedState,v=0;u!==null&&(v=u.retryLane),nC(s,v)}function Q5(s,u){var v=0;switch(s.tag){case 31:case 13:var g=s.stateNode,C=s.memoizedState;C!==null&&(v=C.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),nC(s,v)}function W5(s,u){return De(s,u)}var Xh=null,hu=null,yy=!1,Qh=!1,xy=!1,Ps=0;function ri(s){s!==hu&&s.next===null&&(hu===null?Xh=hu=s:hu=hu.next=s),Qh=!0,yy||(yy=!0,J5())}function hf(s,u){if(!xy&&Qh){xy=!0;do for(var v=!1,g=Xh;g!==null;){if(s!==0){var C=g.pendingLanes;if(C===0)var k=0;else{var O=g.suspendedLanes,$=g.pingedLanes;k=(1<<31-de(42|s)+1)-1,k&=C&~(O&~$),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(v=!0,sC(g,k))}else k=kt,k=ct(g,g===Xt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||He(g,k)||(v=!0,sC(g,k));g=g.next}while(v);xy=!1}}function Z5(){rC()}function rC(){Qh=yy=!1;var s=0;Ps!==0&&u4()&&(s=Ps);for(var u=ze(),v=null,g=Xh;g!==null;){var C=g.next,k=aC(g,u);k===0?(g.next=null,v===null?Xh=C:v.next=C,C===null&&(hu=v)):(v=g,(s!==0||(k&3)!==0)&&(Qh=!0)),g=C}Fn!==0&&Fn!==5||hf(s),Ps!==0&&(Ps=0)}function aC(s,u){for(var v=s.suspendedLanes,g=s.pingedLanes,C=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var O=31-de(k),$=1<<O,ee=C[O];ee===-1?(($&v)===0||($&g)!==0)&&(C[O]=bt($,u)):ee<=u&&(s.expiredLanes|=$),k&=~$}if(u=Xt,v=kt,v=ct(s,s===u?v:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,v===0||s===u&&(Ft===2||Ft===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ye(g),s.callbackNode=null,s.callbackPriority=0;if((v&3)===0||He(s,v)){if(u=v&-v,u===s.callbackPriority)return u;switch(g!==null&&Ye(g),ha(v)){case 2:case 8:v=Ce;break;case 32:v=Me;break;case 268435456:v=_e;break;default:v=Me}return g=iC.bind(null,s),v=De(v,g),s.callbackPriority=u,s.callbackNode=v,u}return g!==null&&g!==null&&Ye(g),s.callbackPriority=2,s.callbackNode=null,2}function iC(s,u){if(Fn!==0&&Fn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var v=s.callbackNode;if(Yh()&&s.callbackNode!==v)return null;var g=kt;return g=ct(s,s===Xt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(FE(s,g,u),aC(s,ze()),s.callbackNode!=null&&s.callbackNode===v?iC.bind(null,s):null)}function sC(s,u){if(Yh())return null;FE(s,u,!0)}function J5(){f4(function(){(Pt&6)!==0?De(he,Z5):rC()})}function by(){if(Ps===0){var s=Zo;s===0&&(s=Ke,Ke<<=1,(Ke&261888)===0&&(Ke=256)),Ps=s}return Ps}function lC(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:ah(""+s)}function oC(s,u){var v=u.ownerDocument.createElement("input");return v.name=u.name,v.value=u.value,s.id&&v.setAttribute("form",s.id),u.parentNode.insertBefore(v,u),s=new FormData(s),v.parentNode.removeChild(v),s}function e4(s,u,v,g,C){if(u==="submit"&&v&&v.stateNode===C){var k=lC((C[In]||null).action),O=g.submitter;O&&(u=(u=O[In]||null)?lC(u.formAction):O.getAttribute("formAction"),u!==null&&(k=u,O=null));var $=new oh("action","action",null,g,C);s.push({event:$,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ps!==0){var ee=O?oC(C,O):new FormData(C);Fg(v,{pending:!0,data:ee,method:C.method,action:k},null,ee)}}else typeof k=="function"&&($.preventDefault(),ee=O?oC(C,O):new FormData(C),Fg(v,{pending:!0,data:ee,method:C.method,action:k},k,ee))},currentTarget:C}]})}}for(var wy=0;wy<rg.length;wy++){var Sy=rg[wy],t4=Sy.toLowerCase(),n4=Sy[0].toUpperCase()+Sy.slice(1);Pa(t4,"on"+n4)}Pa(IS,"onAnimationEnd"),Pa(FS,"onAnimationIteration"),Pa(US,"onAnimationStart"),Pa("dblclick","onDoubleClick"),Pa("focusin","onFocus"),Pa("focusout","onBlur"),Pa(y5,"onTransitionRun"),Pa(x5,"onTransitionStart"),Pa(b5,"onTransitionCancel"),Pa(qS,"onTransitionEnd"),Ja("onMouseEnter",["mouseout","mouseover"]),Ja("onMouseLeave",["mouseout","mouseover"]),Ja("onPointerEnter",["pointerout","pointerover"]),Ja("onPointerLeave",["pointerout","pointerover"]),Zr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vf="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(" "),r4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vf));function uC(s,u){u=(u&4)!==0;for(var v=0;v<s.length;v++){var g=s[v],C=g.event;g=g.listeners;e:{var k=void 0;if(u)for(var O=g.length-1;0<=O;O--){var $=g[O],ee=$.instance,fe=$.currentTarget;if($=$.listener,ee!==k&&C.isPropagationStopped())break e;k=$,C.currentTarget=fe;try{k(C)}catch(we){fh(we)}C.currentTarget=null,k=ee}else for(O=0;O<g.length;O++){if($=g[O],ee=$.instance,fe=$.currentTarget,$=$.listener,ee!==k&&C.isPropagationStopped())break e;k=$,C.currentTarget=fe;try{k(C)}catch(we){fh(we)}C.currentTarget=null,k=ee}}}}function Ct(s,u){var v=u[Yn];v===void 0&&(v=u[Yn]=new Set);var g=s+"__bubble";v.has(g)||(cC(u,s,2,!1),v.add(g))}function Ey(s,u,v){var g=0;u&&(g|=4),cC(v,s,g,u)}var Wh="_reactListening"+Math.random().toString(36).slice(2);function Cy(s){if(!s[Wh]){s[Wh]=!0,Jd.forEach(function(v){v!=="selectionchange"&&(r4.has(v)||Ey(v,!1,s),Ey(v,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Wh]||(u[Wh]=!0,Ey("selectionchange",!1,u))}}function cC(s,u,v,g){switch(IC(u)){case 2:var C=D4;break;case 8:C=M4;break;default:C=Iy}v=C.bind(null,u,v,s),C=void 0,!Hm||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(C=!0),g?C!==void 0?s.addEventListener(u,v,{capture:!0,passive:C}):s.addEventListener(u,v,!0):C!==void 0?s.addEventListener(u,v,{passive:C}):s.addEventListener(u,v,!1)}function Ny(s,u,v,g,C){var k=g;if((u&1)===0&&(u&2)===0&&g!==null)e:for(;;){if(g===null)return;var O=g.tag;if(O===3||O===4){var $=g.stateNode.containerInfo;if($===C)break;if(O===4)for(O=g.return;O!==null;){var ee=O.tag;if((ee===3||ee===4)&&O.stateNode.containerInfo===C)return;O=O.return}for(;$!==null;){if(O=ms($),O===null)return;if(ee=O.tag,ee===5||ee===6||ee===26||ee===27){g=k=O;continue e}$=$.parentNode}}g=g.return}pS(function(){var fe=k,we=qm(v),Ee=[];e:{var ve=VS.get(s);if(ve!==void 0){var me=oh,Ge=s;switch(s){case"keypress":if(sh(v)===0)break e;case"keydown":case"keyup":me=Q3;break;case"focusin":Ge="focus",me=Ym;break;case"focusout":Ge="blur",me=Ym;break;case"beforeblur":case"afterblur":me=Ym;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=yS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=z3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=J3;break;case IS:case FS:case US:me=U3;break;case qS:me=t5;break;case"scroll":case"scrollend":me=P3;break;case"wheel":me=r5;break;case"copy":case"cut":case"paste":me=V3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=bS;break;case"toggle":case"beforetoggle":me=i5}var it=(u&4)!==0,$t=!it&&(s==="scroll"||s==="scrollend"),oe=it?ve!==null?ve+"Capture":null:ve;it=[];for(var re=fe,ce;re!==null;){var Se=re;if(ce=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ce===null||oe===null||(Se=Lc(re,oe),Se!=null&&it.push(pf(re,Se,ce))),$t)break;re=re.return}0<it.length&&(ve=new me(ve,Ge,null,v,we),Ee.push({event:ve,listeners:it}))}}if((u&7)===0){e:{if(ve=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",ve&&v!==Um&&(Ge=v.relatedTarget||v.fromElement)&&(ms(Ge)||Ge[Or]))break e;if((me||ve)&&(ve=we.window===we?we:(ve=we.ownerDocument)?ve.defaultView||ve.parentWindow:window,me?(Ge=v.relatedTarget||v.toElement,me=fe,Ge=Ge?ms(Ge):null,Ge!==null&&($t=i(Ge),it=Ge.tag,Ge!==$t||it!==5&&it!==27&&it!==6)&&(Ge=null)):(me=null,Ge=fe),me!==Ge)){if(it=yS,Se="onMouseLeave",oe="onMouseEnter",re="mouse",(s==="pointerout"||s==="pointerover")&&(it=bS,Se="onPointerLeave",oe="onPointerEnter",re="pointer"),$t=me==null?ve:Ll(me),ce=Ge==null?ve:Ll(Ge),ve=new it(Se,re+"leave",me,v,we),ve.target=$t,ve.relatedTarget=ce,Se=null,ms(we)===fe&&(it=new it(oe,re+"enter",Ge,v,we),it.target=ce,it.relatedTarget=$t,Se=it),$t=Se,me&&Ge)t:{for(it=a4,oe=me,re=Ge,ce=0,Se=oe;Se;Se=it(Se))ce++;Se=0;for(var nt=re;nt;nt=it(nt))Se++;for(;0<ce-Se;)oe=it(oe),ce--;for(;0<Se-ce;)re=it(re),Se--;for(;ce--;){if(oe===re||re!==null&&oe===re.alternate){it=oe;break t}oe=it(oe),re=it(re)}it=null}else it=null;me!==null&&fC(Ee,ve,me,it,!1),Ge!==null&&$t!==null&&fC(Ee,$t,Ge,it,!0)}}e:{if(ve=fe?Ll(fe):window,me=ve.nodeName&&ve.nodeName.toLowerCase(),me==="select"||me==="input"&&ve.type==="file")var _t=jS;else if(kS(ve))if(AS)_t=p5;else{_t=h5;var Xe=d5}else me=ve.nodeName,!me||me.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?fe&&Fm(fe.elementType)&&(_t=jS):_t=v5;if(_t&&(_t=_t(s,fe))){TS(Ee,_t,v,we);break e}Xe&&Xe(s,ve,fe),s==="focusout"&&fe&&ve.type==="number"&&fe.memoizedProps.value!=null&&Im(ve,"number",ve.value)}switch(Xe=fe?Ll(fe):window,s){case"focusin":(kS(Xe)||Xe.contentEditable==="true")&&(Ho=Xe,eg=fe,Vc=null);break;case"focusout":Vc=eg=Ho=null;break;case"mousedown":tg=!0;break;case"contextmenu":case"mouseup":case"dragend":tg=!1,BS(Ee,v,we);break;case"selectionchange":if(g5)break;case"keydown":case"keyup":BS(Ee,v,we)}var pt;if(Qm)e:{switch(s){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else Vo?CS(s,v)&&(Tt="onCompositionEnd"):s==="keydown"&&v.keyCode===229&&(Tt="onCompositionStart");Tt&&(wS&&v.locale!=="ko"&&(Vo||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&Vo&&(pt=mS()):(bs=we,Gm="value"in bs?bs.value:bs.textContent,Vo=!0)),Xe=Zh(fe,Tt),0<Xe.length&&(Tt=new xS(Tt,s,null,v,we),Ee.push({event:Tt,listeners:Xe}),pt?Tt.data=pt:(pt=NS(v),pt!==null&&(Tt.data=pt)))),(pt=l5?o5(s,v):u5(s,v))&&(Tt=Zh(fe,"onBeforeInput"),0<Tt.length&&(Xe=new xS("onBeforeInput","beforeinput",null,v,we),Ee.push({event:Xe,listeners:Tt}),Xe.data=pt)),e4(Ee,s,fe,v,we)}uC(Ee,u)})}function pf(s,u,v){return{instance:s,listener:u,currentTarget:v}}function Zh(s,u){for(var v=u+"Capture",g=[];s!==null;){var C=s,k=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||k===null||(C=Lc(s,v),C!=null&&g.unshift(pf(s,C,k)),C=Lc(s,u),C!=null&&g.push(pf(s,C,k))),s.tag===3)return g;s=s.return}return[]}function a4(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function fC(s,u,v,g,C){for(var k=u._reactName,O=[];v!==null&&v!==g;){var $=v,ee=$.alternate,fe=$.stateNode;if($=$.tag,ee!==null&&ee===g)break;$!==5&&$!==26&&$!==27||fe===null||(ee=fe,C?(fe=Lc(v,k),fe!=null&&O.unshift(pf(v,fe,ee))):C||(fe=Lc(v,k),fe!=null&&O.push(pf(v,fe,ee)))),v=v.return}O.length!==0&&s.push({event:u,listeners:O})}var i4=/\r\n?/g,s4=/\u0000|\uFFFD/g;function dC(s){return(typeof s=="string"?s:""+s).replace(i4,`
|
|
49
|
+
`).replace(s4,"")}function hC(s,u){return u=dC(u),dC(s)===u}function Gt(s,u,v,g,C,k){switch(v){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||Fo(s,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&Fo(s,""+g);break;case"className":xs(s,"class",g);break;case"tabIndex":xs(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":xs(s,v,g);break;case"style":hS(s,g,k);break;case"data":if(u!=="object"){xs(s,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||v!=="href")){s.removeAttribute(v);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(v);break}g=ah(""+g),s.setAttribute(v,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(v,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(v==="formAction"?(u!=="input"&&Gt(s,u,"name",C.name,C,null),Gt(s,u,"formEncType",C.formEncType,C,null),Gt(s,u,"formMethod",C.formMethod,C,null),Gt(s,u,"formTarget",C.formTarget,C,null)):(Gt(s,u,"encType",C.encType,C,null),Gt(s,u,"method",C.method,C,null),Gt(s,u,"target",C.target,C,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(v);break}g=ah(""+g),s.setAttribute(v,g);break;case"onClick":g!=null&&(s.onclick=ji);break;case"onScroll":g!=null&&Ct("scroll",s);break;case"onScrollEnd":g!=null&&Ct("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(v=g.__html,v!=null){if(C.children!=null)throw Error(r(60));s.innerHTML=v}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}v=ah(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,""+g):s.removeAttribute(v);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,""):s.removeAttribute(v);break;case"capture":case"download":g===!0?s.setAttribute(v,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(v,g):s.removeAttribute(v);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(v,g):s.removeAttribute(v);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(v):s.setAttribute(v,g);break;case"popover":Ct("beforetoggle",s),Ct("toggle",s),pr(s,"popover",g);break;case"xlinkActuate":pa(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":pa(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":pa(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":pa(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":pa(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":pa(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":pa(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":pa(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":pa(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":pr(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<v.length)||v[0]!=="o"&&v[0]!=="O"||v[1]!=="n"&&v[1]!=="N")&&(v=O3.get(v)||v,pr(s,v,g))}}function ky(s,u,v,g,C,k){switch(v){case"style":hS(s,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(v=g.__html,v!=null){if(C.children!=null)throw Error(r(60));s.innerHTML=v}}break;case"children":typeof g=="string"?Fo(s,g):(typeof g=="number"||typeof g=="bigint")&&Fo(s,""+g);break;case"onScroll":g!=null&&Ct("scroll",s);break;case"onScrollEnd":g!=null&&Ct("scrollend",s);break;case"onClick":g!=null&&(s.onclick=ji);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!eh.hasOwnProperty(v))e:{if(v[0]==="o"&&v[1]==="n"&&(C=v.endsWith("Capture"),u=v.slice(2,C?v.length-7:void 0),k=s[In]||null,k=k!=null?k[v]:null,typeof k=="function"&&s.removeEventListener(u,k,C),typeof g=="function")){typeof k!="function"&&k!==null&&(v in s?s[v]=null:s.hasAttribute(v)&&s.removeAttribute(v)),s.addEventListener(u,g,C);break e}v in s?s[v]=g:g===!0?s.setAttribute(v,""):pr(s,v,g)}}}function or(s,u,v){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ct("error",s),Ct("load",s);var g=!1,C=!1,k;for(k in v)if(v.hasOwnProperty(k)){var O=v[k];if(O!=null)switch(k){case"src":g=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Gt(s,u,k,O,v,null)}}C&&Gt(s,u,"srcSet",v.srcSet,v,null),g&&Gt(s,u,"src",v.src,v,null);return;case"input":Ct("invalid",s);var $=k=O=C=null,ee=null,fe=null;for(g in v)if(v.hasOwnProperty(g)){var we=v[g];if(we!=null)switch(g){case"name":C=we;break;case"type":O=we;break;case"checked":ee=we;break;case"defaultChecked":fe=we;break;case"value":k=we;break;case"defaultValue":$=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,u));break;default:Gt(s,u,g,we,v,null)}}uS(s,k,$,ee,fe,O,C,!1);return;case"select":Ct("invalid",s),g=O=k=null;for(C in v)if(v.hasOwnProperty(C)&&($=v[C],$!=null))switch(C){case"value":k=$;break;case"defaultValue":O=$;break;case"multiple":g=$;default:Gt(s,u,C,$,v,null)}u=k,v=O,s.multiple=!!g,u!=null?Io(s,!!g,u,!1):v!=null&&Io(s,!!g,v,!0);return;case"textarea":Ct("invalid",s),k=C=g=null;for(O in v)if(v.hasOwnProperty(O)&&($=v[O],$!=null))switch(O){case"value":g=$;break;case"defaultValue":C=$;break;case"children":k=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:Gt(s,u,O,$,v,null)}fS(s,g,C,k);return;case"option":for(ee in v)if(v.hasOwnProperty(ee)&&(g=v[ee],g!=null))switch(ee){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Gt(s,u,ee,g,v,null)}return;case"dialog":Ct("beforetoggle",s),Ct("toggle",s),Ct("cancel",s),Ct("close",s);break;case"iframe":case"object":Ct("load",s);break;case"video":case"audio":for(g=0;g<vf.length;g++)Ct(vf[g],s);break;case"image":Ct("error",s),Ct("load",s);break;case"details":Ct("toggle",s);break;case"embed":case"source":case"link":Ct("error",s),Ct("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in v)if(v.hasOwnProperty(fe)&&(g=v[fe],g!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Gt(s,u,fe,g,v,null)}return;default:if(Fm(u)){for(we in v)v.hasOwnProperty(we)&&(g=v[we],g!==void 0&&ky(s,u,we,g,v,void 0));return}}for($ in v)v.hasOwnProperty($)&&(g=v[$],g!=null&&Gt(s,u,$,g,v,null))}function l4(s,u,v,g){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,k=null,O=null,$=null,ee=null,fe=null,we=null;for(me in v){var Ee=v[me];if(v.hasOwnProperty(me)&&Ee!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":ee=Ee;default:g.hasOwnProperty(me)||Gt(s,u,me,null,g,Ee)}}for(var ve in g){var me=g[ve];if(Ee=v[ve],g.hasOwnProperty(ve)&&(me!=null||Ee!=null))switch(ve){case"type":k=me;break;case"name":C=me;break;case"checked":fe=me;break;case"defaultChecked":we=me;break;case"value":O=me;break;case"defaultValue":$=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:me!==Ee&&Gt(s,u,ve,me,g,Ee)}}zm(s,O,$,ee,fe,we,k,C);return;case"select":me=O=$=ve=null;for(k in v)if(ee=v[k],v.hasOwnProperty(k)&&ee!=null)switch(k){case"value":break;case"multiple":me=ee;default:g.hasOwnProperty(k)||Gt(s,u,k,null,g,ee)}for(C in g)if(k=g[C],ee=v[C],g.hasOwnProperty(C)&&(k!=null||ee!=null))switch(C){case"value":ve=k;break;case"defaultValue":$=k;break;case"multiple":O=k;default:k!==ee&&Gt(s,u,C,k,g,ee)}u=$,v=O,g=me,ve!=null?Io(s,!!v,ve,!1):!!g!=!!v&&(u!=null?Io(s,!!v,u,!0):Io(s,!!v,v?[]:"",!1));return;case"textarea":me=ve=null;for($ in v)if(C=v[$],v.hasOwnProperty($)&&C!=null&&!g.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Gt(s,u,$,null,g,C)}for(O in g)if(C=g[O],k=v[O],g.hasOwnProperty(O)&&(C!=null||k!=null))switch(O){case"value":ve=C;break;case"defaultValue":me=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(91));break;default:C!==k&&Gt(s,u,O,C,g,k)}cS(s,ve,me);return;case"option":for(var Ge in v)if(ve=v[Ge],v.hasOwnProperty(Ge)&&ve!=null&&!g.hasOwnProperty(Ge))switch(Ge){case"selected":s.selected=!1;break;default:Gt(s,u,Ge,null,g,ve)}for(ee in g)if(ve=g[ee],me=v[ee],g.hasOwnProperty(ee)&&ve!==me&&(ve!=null||me!=null))switch(ee){case"selected":s.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Gt(s,u,ee,ve,g,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var it in v)ve=v[it],v.hasOwnProperty(it)&&ve!=null&&!g.hasOwnProperty(it)&&Gt(s,u,it,null,g,ve);for(fe in g)if(ve=g[fe],me=v[fe],g.hasOwnProperty(fe)&&ve!==me&&(ve!=null||me!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,u));break;default:Gt(s,u,fe,ve,g,me)}return;default:if(Fm(u)){for(var $t in v)ve=v[$t],v.hasOwnProperty($t)&&ve!==void 0&&!g.hasOwnProperty($t)&&ky(s,u,$t,void 0,g,ve);for(we in g)ve=g[we],me=v[we],!g.hasOwnProperty(we)||ve===me||ve===void 0&&me===void 0||ky(s,u,we,ve,g,me);return}}for(var oe in v)ve=v[oe],v.hasOwnProperty(oe)&&ve!=null&&!g.hasOwnProperty(oe)&&Gt(s,u,oe,null,g,ve);for(Ee in g)ve=g[Ee],me=v[Ee],!g.hasOwnProperty(Ee)||ve===me||ve==null&&me==null||Gt(s,u,Ee,ve,g,me)}function vC(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o4(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,v=performance.getEntriesByType("resource"),g=0;g<v.length;g++){var C=v[g],k=C.transferSize,O=C.initiatorType,$=C.duration;if(k&&$&&vC(O)){for(O=0,$=C.responseEnd,g+=1;g<v.length;g++){var ee=v[g],fe=ee.startTime;if(fe>$)break;var we=ee.transferSize,Ee=ee.initiatorType;we&&vC(Ee)&&(ee=ee.responseEnd,O+=we*(ee<$?1:($-fe)/(ee-fe)))}if(--g,u+=8*(k+O)/(C.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Ty=null,jy=null;function Jh(s){return s.nodeType===9?s:s.ownerDocument}function pC(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mC(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function Ay(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Ry=null;function u4(){var s=window.event;return s&&s.type==="popstate"?s===Ry?!1:(Ry=s,!0):(Ry=null,!1)}var gC=typeof setTimeout=="function"?setTimeout:void 0,c4=typeof clearTimeout=="function"?clearTimeout:void 0,yC=typeof Promise=="function"?Promise:void 0,f4=typeof queueMicrotask=="function"?queueMicrotask:typeof yC<"u"?function(s){return yC.resolve(null).then(s).catch(d4)}:gC;function d4(s){setTimeout(function(){throw s})}function Bs(s){return s==="head"}function xC(s,u){var v=u,g=0;do{var C=v.nextSibling;if(s.removeChild(v),C&&C.nodeType===8)if(v=C.data,v==="/$"||v==="/&"){if(g===0){s.removeChild(C),gu(u);return}g--}else if(v==="$"||v==="$?"||v==="$~"||v==="$!"||v==="&")g++;else if(v==="html")mf(s.ownerDocument.documentElement);else if(v==="head"){v=s.ownerDocument.head,mf(v);for(var k=v.firstChild;k;){var O=k.nextSibling,$=k.nodeName;k[Qn]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&k.rel.toLowerCase()==="stylesheet"||v.removeChild(k),k=O}}else v==="body"&&mf(s.ownerDocument.body);v=C}while(v);gu(u)}function bC(s,u){var v=s;s=0;do{var g=v.nextSibling;if(v.nodeType===1?u?(v._stashedDisplay=v.style.display,v.style.display="none"):(v.style.display=v._stashedDisplay||"",v.getAttribute("style")===""&&v.removeAttribute("style")):v.nodeType===3&&(u?(v._stashedText=v.nodeValue,v.nodeValue=""):v.nodeValue=v._stashedText||""),g&&g.nodeType===8)if(v=g.data,v==="/$"){if(s===0)break;s--}else v!=="$"&&v!=="$?"&&v!=="$~"&&v!=="$!"||s++;v=g}while(v)}function Dy(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var v=u;switch(u=u.nextSibling,v.nodeName){case"HTML":case"HEAD":case"BODY":Dy(v),Bo(v);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(v.rel.toLowerCase()==="stylesheet")continue}s.removeChild(v)}}function h4(s,u,v,g){for(;s.nodeType===1;){var C=v;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Qn])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==C.rel||s.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||s.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||s.getAttribute("title")!==(C.title==null?null:C.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(C.src==null?null:C.src)||s.getAttribute("type")!==(C.type==null?null:C.type)||s.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=C.name==null?null:""+C.name;if(C.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=Ea(s.nextSibling),s===null)break}return null}function v4(s,u,v){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!v||(s=Ea(s.nextSibling),s===null))return null;return s}function wC(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Ea(s.nextSibling),s===null))return null;return s}function My(s){return s.data==="$?"||s.data==="$~"}function _y(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function p4(s,u){var v=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||v.readyState!=="loading")u();else{var g=function(){u(),v.removeEventListener("DOMContentLoaded",g)};v.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function Ea(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var Oy=null;function SC(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var v=s.data;if(v==="/$"||v==="/&"){if(u===0)return Ea(s.nextSibling);u--}else v!=="$"&&v!=="$!"&&v!=="$?"&&v!=="$~"&&v!=="&"||u++}s=s.nextSibling}return null}function EC(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var v=s.data;if(v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"){if(u===0)return s;u--}else v!=="/$"&&v!=="/&"||u++}s=s.previousSibling}return null}function CC(s,u,v){switch(u=Jh(v),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function mf(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Bo(s)}var Ca=new Map,NC=new Set;function ev(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Hi=V.d;V.d={f:m4,r:g4,D:y4,C:x4,L:b4,m:w4,X:E4,S:S4,M:C4};function m4(){var s=Hi.f(),u=Gh();return s||u}function g4(s){var u=gs(s);u!==null&&u.tag===5&&u.type==="form"?q2(u):Hi.r(s)}var vu=typeof document>"u"?null:document;function kC(s,u,v){var g=vu;if(g&&typeof u=="string"&&u){var C=ma(u);C='link[rel="'+s+'"][href="'+C+'"]',typeof v=="string"&&(C+='[crossorigin="'+v+'"]'),NC.has(C)||(NC.add(C),s={rel:s,crossOrigin:v,href:u},g.querySelector(C)===null&&(u=g.createElement("link"),or(u,"link",s),Rn(u),g.head.appendChild(u)))}}function y4(s){Hi.D(s),kC("dns-prefetch",s,null)}function x4(s,u){Hi.C(s,u),kC("preconnect",s,u)}function b4(s,u,v){Hi.L(s,u,v);var g=vu;if(g&&s&&u){var C='link[rel="preload"][as="'+ma(u)+'"]';u==="image"&&v&&v.imageSrcSet?(C+='[imagesrcset="'+ma(v.imageSrcSet)+'"]',typeof v.imageSizes=="string"&&(C+='[imagesizes="'+ma(v.imageSizes)+'"]')):C+='[href="'+ma(s)+'"]';var k=C;switch(u){case"style":k=pu(s);break;case"script":k=mu(s)}Ca.has(k)||(s=p({rel:"preload",href:u==="image"&&v&&v.imageSrcSet?void 0:s,as:u},v),Ca.set(k,s),g.querySelector(C)!==null||u==="style"&&g.querySelector(gf(k))||u==="script"&&g.querySelector(yf(k))||(u=g.createElement("link"),or(u,"link",s),Rn(u),g.head.appendChild(u)))}}function w4(s,u){Hi.m(s,u);var v=vu;if(v&&s){var g=u&&typeof u.as=="string"?u.as:"script",C='link[rel="modulepreload"][as="'+ma(g)+'"][href="'+ma(s)+'"]',k=C;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=mu(s)}if(!Ca.has(k)&&(s=p({rel:"modulepreload",href:s},u),Ca.set(k,s),v.querySelector(C)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(v.querySelector(yf(k)))return}g=v.createElement("link"),or(g,"link",s),Rn(g),v.head.appendChild(g)}}}function S4(s,u,v){Hi.S(s,u,v);var g=vu;if(g&&s){var C=ys(g).hoistableStyles,k=pu(s);u=u||"default";var O=C.get(k);if(!O){var $={loading:0,preload:null};if(O=g.querySelector(gf(k)))$.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":u},v),(v=Ca.get(k))&&Ly(s,v);var ee=O=g.createElement("link");Rn(ee),or(ee,"link",s),ee._p=new Promise(function(fe,we){ee.onload=fe,ee.onerror=we}),ee.addEventListener("load",function(){$.loading|=1}),ee.addEventListener("error",function(){$.loading|=2}),$.loading|=4,tv(O,u,g)}O={type:"stylesheet",instance:O,count:1,state:$},C.set(k,O)}}}function E4(s,u){Hi.X(s,u);var v=vu;if(v&&s){var g=ys(v).hoistableScripts,C=mu(s),k=g.get(C);k||(k=v.querySelector(yf(C)),k||(s=p({src:s,async:!0},u),(u=Ca.get(C))&&Py(s,u),k=v.createElement("script"),Rn(k),or(k,"link",s),v.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(C,k))}}function C4(s,u){Hi.M(s,u);var v=vu;if(v&&s){var g=ys(v).hoistableScripts,C=mu(s),k=g.get(C);k||(k=v.querySelector(yf(C)),k||(s=p({src:s,async:!0,type:"module"},u),(u=Ca.get(C))&&Py(s,u),k=v.createElement("script"),Rn(k),or(k,"link",s),v.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(C,k))}}function TC(s,u,v,g){var C=(C=ie.current)?ev(C):null;if(!C)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof v.precedence=="string"&&typeof v.href=="string"?(u=pu(v.href),v=ys(C).hoistableStyles,g=v.get(u),g||(g={type:"style",instance:null,count:0,state:null},v.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(v.rel==="stylesheet"&&typeof v.href=="string"&&typeof v.precedence=="string"){s=pu(v.href);var k=ys(C).hoistableStyles,O=k.get(s);if(O||(C=C.ownerDocument||C,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,O),(k=C.querySelector(gf(s)))&&!k._p&&(O.instance=k,O.state.loading=5),Ca.has(s)||(v={rel:"preload",as:"style",href:v.href,crossOrigin:v.crossOrigin,integrity:v.integrity,media:v.media,hrefLang:v.hrefLang,referrerPolicy:v.referrerPolicy},Ca.set(s,v),k||N4(C,s,v,O.state))),u&&g===null)throw Error(r(528,""));return O}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=v.async,v=v.src,typeof v=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=mu(v),v=ys(C).hoistableScripts,g=v.get(u),g||(g={type:"script",instance:null,count:0,state:null},v.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function pu(s){return'href="'+ma(s)+'"'}function gf(s){return'link[rel="stylesheet"]['+s+"]"}function jC(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function N4(s,u,v,g){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=s.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),or(u,"link",v),Rn(u),s.head.appendChild(u))}function mu(s){return'[src="'+ma(s)+'"]'}function yf(s){return"script[async]"+s}function AC(s,u,v){if(u.count++,u.instance===null)switch(u.type){case"style":var g=s.querySelector('style[data-href~="'+ma(v.href)+'"]');if(g)return u.instance=g,Rn(g),g;var C=p({},v,{"data-href":v.href,"data-precedence":v.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),Rn(g),or(g,"style",C),tv(g,v.precedence,s),u.instance=g;case"stylesheet":C=pu(v.href);var k=s.querySelector(gf(C));if(k)return u.state.loading|=4,u.instance=k,Rn(k),k;g=jC(v),(C=Ca.get(C))&&Ly(g,C),k=(s.ownerDocument||s).createElement("link"),Rn(k);var O=k;return O._p=new Promise(function($,ee){O.onload=$,O.onerror=ee}),or(k,"link",g),u.state.loading|=4,tv(k,v.precedence,s),u.instance=k;case"script":return k=mu(v.src),(C=s.querySelector(yf(k)))?(u.instance=C,Rn(C),C):(g=v,(C=Ca.get(k))&&(g=p({},v),Py(g,C)),s=s.ownerDocument||s,C=s.createElement("script"),Rn(C),or(C,"link",g),s.head.appendChild(C),u.instance=C);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,tv(g,v.precedence,s));return u.instance}function tv(s,u,v){for(var g=v.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=g.length?g[g.length-1]:null,k=C,O=0;O<g.length;O++){var $=g[O];if($.dataset.precedence===u)k=$;else if(k!==C)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=v.nodeType===9?v.head:v,u.insertBefore(s,u.firstChild))}function Ly(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function Py(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var nv=null;function RC(s,u,v){if(nv===null){var g=new Map,C=nv=new Map;C.set(v,g)}else C=nv,g=C.get(v),g||(g=new Map,C.set(v,g));if(g.has(s))return g;for(g.set(s,null),v=v.getElementsByTagName(s),C=0;C<v.length;C++){var k=v[C];if(!(k[Qn]||k[un]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var O=k.getAttribute(u)||"";O=s+O;var $=g.get(O);$?$.push(k):g.set(O,[k])}}return g}function DC(s,u,v){s=s.ownerDocument||s,s.head.insertBefore(v,u==="title"?s.querySelector("head > title"):null)}function k4(s,u,v){if(v===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function MC(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function T4(s,u,v,g){if(v.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(v.state.loading&4)===0){if(v.instance===null){var C=pu(g.href),k=u.querySelector(gf(C));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=rv.bind(s),u.then(s,s)),v.state.loading|=4,v.instance=k,Rn(k);return}k=u.ownerDocument||u,g=jC(g),(C=Ca.get(C))&&Ly(g,C),k=k.createElement("link"),Rn(k);var O=k;O._p=new Promise(function($,ee){O.onload=$,O.onerror=ee}),or(k,"link",g),v.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(v,u),(u=v.state.preload)&&(v.state.loading&3)===0&&(s.count++,v=rv.bind(s),u.addEventListener("load",v),u.addEventListener("error",v))}}var By=0;function j4(s,u){return s.stylesheets&&s.count===0&&iv(s,s.stylesheets),0<s.count||0<s.imgCount?function(v){var g=setTimeout(function(){if(s.stylesheets&&iv(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&By===0&&(By=62500*o4());var C=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&iv(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>By?50:800)+u);return s.unsuspend=v,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(C)}}:null}function rv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)iv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var av=null;function iv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,av=new Map,u.forEach(A4,s),av=null,rv.call(s))}function A4(s,u){if(!(u.state.loading&4)){var v=av.get(s);if(v)var g=v.get(null);else{v=new Map,av.set(s,v);for(var C=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<C.length;k++){var O=C[k];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(v.set(O.dataset.precedence,O),g=O)}g&&v.set(null,g)}C=u.instance,O=C.getAttribute("data-precedence"),k=v.get(O)||g,k===g&&v.set(null,C),v.set(O,C),this.count++,g=rv.bind(this),C.addEventListener("load",g),C.addEventListener("error",g),k?k.parentNode.insertBefore(C,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(C,s.firstChild)),u.state.loading|=4}}var xf={$$typeof:E,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function R4(s,u,v,g,C,k,O,$,ee){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=hn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hn(0),this.hiddenUpdates=hn(null),this.identifierPrefix=g,this.onUncaughtError=C,this.onCaughtError=k,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function _C(s,u,v,g,C,k,O,$,ee,fe,we,Ee){return s=new R4(s,u,v,O,ee,fe,we,Ee,$),u=1,k===!0&&(u|=24),k=ea(3,null,null,u),s.current=k,k.stateNode=s,u=mg(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:g,isDehydrated:v,cache:u},bg(k),s}function OC(s){return s?(s=Ko,s):Ko}function LC(s,u,v,g,C,k){C=OC(C),g.context===null?g.context=C:g.pendingContext=C,g=ks(u),g.payload={element:v},k=k===void 0?null:k,k!==null&&(g.callback=k),v=Ts(s,g,u),v!==null&&(Ur(v,s,u),Qc(v,s,u))}function PC(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var v=s.retryLane;s.retryLane=v!==0&&v<u?v:u}}function zy(s,u){PC(s,u),(s=s.alternate)&&PC(s,u)}function BC(s){if(s.tag===13||s.tag===31){var u=Il(s,67108864);u!==null&&Ur(u,s,67108864),zy(s,67108864)}}function zC(s){if(s.tag===13||s.tag===31){var u=ia();u=Nn(u);var v=Il(s,u);v!==null&&Ur(v,s,u),zy(s,u)}}var sv=!0;function D4(s,u,v,g){var C=I.T;I.T=null;var k=V.p;try{V.p=2,Iy(s,u,v,g)}finally{V.p=k,I.T=C}}function M4(s,u,v,g){var C=I.T;I.T=null;var k=V.p;try{V.p=8,Iy(s,u,v,g)}finally{V.p=k,I.T=C}}function Iy(s,u,v,g){if(sv){var C=Fy(g);if(C===null)Ny(s,u,g,lv,v),FC(s,g);else if(O4(C,s,u,v,g))g.stopPropagation();else if(FC(s,g),u&4&&-1<_4.indexOf(s)){for(;C!==null;){var k=gs(C);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var O=ut(k.pendingLanes);if(O!==0){var $=k;for($.pendingLanes|=2,$.entangledLanes|=2;O;){var ee=1<<31-de(O);$.entanglements[1]|=ee,O&=~ee}ri(k),(Pt&6)===0&&(Vh=ze()+500,hf(0))}}break;case 31:case 13:$=Il(k,2),$!==null&&Ur($,k,2),Gh(),zy(k,2)}if(k=Fy(g),k===null&&Ny(s,u,g,lv,v),k===C)break;C=k}C!==null&&g.stopPropagation()}else Ny(s,u,g,null,v)}}function Fy(s){return s=qm(s),Uy(s)}var lv=null;function Uy(s){if(lv=null,s=ms(s),s!==null){var u=i(s);if(u===null)s=null;else{var v=u.tag;if(v===13){if(s=l(u),s!==null)return s;s=null}else if(v===31){if(s=o(u),s!==null)return s;s=null}else if(v===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return lv=s,null}function IC(s){switch(s){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(dt()){case he:return 2;case Ce:return 8;case Me:case Fe:return 32;case _e:return 268435456;default:return 32}default:return 32}}var qy=!1,zs=null,Is=null,Fs=null,bf=new Map,wf=new Map,Us=[],_4="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".split(" ");function FC(s,u){switch(s){case"focusin":case"focusout":zs=null;break;case"dragenter":case"dragleave":Is=null;break;case"mouseover":case"mouseout":Fs=null;break;case"pointerover":case"pointerout":bf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":wf.delete(u.pointerId)}}function Sf(s,u,v,g,C,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:v,eventSystemFlags:g,nativeEvent:k,targetContainers:[C]},u!==null&&(u=gs(u),u!==null&&BC(u)),s):(s.eventSystemFlags|=g,u=s.targetContainers,C!==null&&u.indexOf(C)===-1&&u.push(C),s)}function O4(s,u,v,g,C){switch(u){case"focusin":return zs=Sf(zs,s,u,v,g,C),!0;case"dragenter":return Is=Sf(Is,s,u,v,g,C),!0;case"mouseover":return Fs=Sf(Fs,s,u,v,g,C),!0;case"pointerover":var k=C.pointerId;return bf.set(k,Sf(bf.get(k)||null,s,u,v,g,C)),!0;case"gotpointercapture":return k=C.pointerId,wf.set(k,Sf(wf.get(k)||null,s,u,v,g,C)),!0}return!1}function UC(s){var u=ms(s.target);if(u!==null){var v=i(u);if(v!==null){if(u=v.tag,u===13){if(u=l(v),u!==null){s.blockedOn=u,va(s.priority,function(){zC(v)});return}}else if(u===31){if(u=o(v),u!==null){s.blockedOn=u,va(s.priority,function(){zC(v)});return}}else if(u===3&&v.stateNode.current.memoizedState.isDehydrated){s.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}s.blockedOn=null}function ov(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var v=Fy(s.nativeEvent);if(v===null){v=s.nativeEvent;var g=new v.constructor(v.type,v);Um=g,v.target.dispatchEvent(g),Um=null}else return u=gs(v),u!==null&&BC(u),s.blockedOn=v,!1;u.shift()}return!0}function qC(s,u,v){ov(s)&&v.delete(u)}function L4(){qy=!1,zs!==null&&ov(zs)&&(zs=null),Is!==null&&ov(Is)&&(Is=null),Fs!==null&&ov(Fs)&&(Fs=null),bf.forEach(qC),wf.forEach(qC)}function uv(s,u){s.blockedOn===u&&(s.blockedOn=null,qy||(qy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,L4)))}var cv=null;function VC(s){cv!==s&&(cv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){cv===s&&(cv=null);for(var u=0;u<s.length;u+=3){var v=s[u],g=s[u+1],C=s[u+2];if(typeof g!="function"){if(Uy(g||v)===null)continue;break}var k=gs(v);k!==null&&(s.splice(u,3),u-=3,Fg(k,{pending:!0,data:C,method:v.method,action:g},g,C))}}))}function gu(s){function u(ee){return uv(ee,s)}zs!==null&&uv(zs,s),Is!==null&&uv(Is,s),Fs!==null&&uv(Fs,s),bf.forEach(u),wf.forEach(u);for(var v=0;v<Us.length;v++){var g=Us[v];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Us.length&&(v=Us[0],v.blockedOn===null);)UC(v),v.blockedOn===null&&Us.shift();if(v=(s.ownerDocument||s).$$reactFormReplay,v!=null)for(g=0;g<v.length;g+=3){var C=v[g],k=v[g+1],O=C[In]||null;if(typeof k=="function")O||VC(v);else if(O){var $=null;if(k&&k.hasAttribute("formAction")){if(C=k,O=k[In]||null)$=O.formAction;else if(Uy(C)!==null)continue}else $=O.action;typeof $=="function"?v[g+1]=$:(v.splice(g,3),g-=3),VC(v)}}}function HC(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(O){return C=O})},focusReset:"manual",scroll:"manual"})}function u(){C!==null&&(C(),C=null),g||setTimeout(v,20)}function v(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,C=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(v,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),C!==null&&(C(),C=null)}}}function Vy(s){this._internalRoot=s}fv.prototype.render=Vy.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var v=u.current,g=ia();LC(v,g,s,u,null,null)},fv.prototype.unmount=Vy.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;LC(s.current,2,null,s,null,null),Gh(),u[Or]=null}};function fv(s){this._internalRoot=s}fv.prototype.unstable_scheduleHydration=function(s){if(s){var u=pn();s={blockedOn:null,target:s,priority:u};for(var v=0;v<Us.length&&u!==0&&u<Us[v].priority;v++);Us.splice(v,0,s),v===0&&UC(s)}};var GC=t.version;if(GC!=="19.2.4")throw Error(r(527,GC,"19.2.4"));V.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=c(u),s=s!==null?h(s):null,s=s===null?null:s.stateNode,s};var P4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dv.isDisabled&&dv.supportsFiber)try{Y=dv.inject(P4),ue=dv}catch{}}return Cf.createRoot=function(s,u){if(!a(s))throw Error(r(299));var v=!1,g="",C=Z2,k=J2,O=eE;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(C=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError)),u=_C(s,1,!1,null,null,v,g,null,C,k,O,HC),s[Or]=u.current,Cy(s),new Vy(u)},Cf.hydrateRoot=function(s,u,v){if(!a(s))throw Error(r(299));var g=!1,C="",k=Z2,O=J2,$=eE,ee=null;return v!=null&&(v.unstable_strictMode===!0&&(g=!0),v.identifierPrefix!==void 0&&(C=v.identifierPrefix),v.onUncaughtError!==void 0&&(k=v.onUncaughtError),v.onCaughtError!==void 0&&(O=v.onCaughtError),v.onRecoverableError!==void 0&&($=v.onRecoverableError),v.formState!==void 0&&(ee=v.formState)),u=_C(s,1,!0,u,v??null,g,C,ee,k,O,$,HC),u.context=OC(null),v=u.current,g=ia(),g=Nn(g),C=ks(g),C.callback=null,Ts(v,C,g),v=g,u.current.lanes=v,Vt(u,v),ri(u),s[Or]=u.current,Cy(s),new fv(u)},Cf.version="19.2.4",Cf}var nN;function $4(){if(nN)return Ky.exports;nN=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ky.exports=G4(),Ky.exports}var K4=$4();const Y4=Nd(K4);var fc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},uo,el,Yu,iR,X4=(iR=class extends fc{constructor(){super();et(this,uo);et(this,el);et(this,Yu);Pe(this,Yu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){te(this,el)||this.setEventListener(te(this,Yu))}onUnsubscribe(){var t;this.hasListeners()||((t=te(this,el))==null||t.call(this),Pe(this,el,void 0))}setEventListener(t){var n;Pe(this,Yu,t),(n=te(this,el))==null||n.call(this),Pe(this,el,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){te(this,uo)!==t&&(Pe(this,uo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof te(this,uo)=="boolean"?te(this,uo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},uo=new WeakMap,el=new WeakMap,Yu=new WeakMap,iR),C1=new X4,Q4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},tl,S1,sR,W4=(sR=class{constructor(){et(this,tl,Q4);et(this,S1,!1)}setTimeoutProvider(e){Pe(this,tl,e)}setTimeout(e,t){return te(this,tl).setTimeout(e,t)}clearTimeout(e){te(this,tl).clearTimeout(e)}setInterval(e,t){return te(this,tl).setInterval(e,t)}clearInterval(e){te(this,tl).clearInterval(e)}},tl=new WeakMap,S1=new WeakMap,sR),so=new W4;function Z4(e){setTimeout(e,0)}var J4=typeof window>"u"||"Deno"in globalThis;function jr(){}function eP(e,t){return typeof e=="function"?e(t):e}function cb(e){return typeof e=="number"&&e>=0&&e!==1/0}function yR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dl(e,t){return typeof e=="function"?e(t):e}function ja(e,t){return typeof e=="function"?e(t):e}function rN(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==N1(l,t.options))return!1}else if(!rd(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function aN(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(wo(t.options.mutationKey)!==wo(i))return!1}else if(!rd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function N1(e,t){return((t==null?void 0:t.queryKeyHashFn)||wo)(e)}function wo(e){return JSON.stringify(e,(t,n)=>fb(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function rd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>rd(e[n],t[n])):!1}var tP=Object.prototype.hasOwnProperty;function xR(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=iN(e)&&iN(t);if(!r&&!(fb(e)&&fb(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,f=r?new Array(o):{};let c=0;for(let h=0;h<o;h++){const p=r?h:l[h],m=e[p],y=t[p];if(m===y){f[p]=m,(r?h<i:tP.call(e,p))&&c++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[p]=y;continue}const x=xR(m,y,n+1);f[p]=x,x===m&&c++}return i===o&&c===i?e:f}function fp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function iN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fb(e){if(!sN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!sN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function sN(e){return Object.prototype.toString.call(e)==="[object Object]"}function nP(e){return new Promise(t=>{so.setTimeout(t,e)})}function db(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xR(e,t):t}function rP(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function aP(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k1=Symbol();function bR(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===k1?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function T1(e,t){return typeof e=="function"?e(...t):!!e}function iP(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var ad=(()=>{let e=()=>J4;return{isServer(){return e()},setIsServer(t){e=t}}})();function hb(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var sP=Z4;function lP(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=sP;const i=o=>{t?e.push(o):a(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&a(()=>{r(()=>{o.forEach(f=>{n(f)})})})};return{batch:o=>{let f;t++;try{f=o()}finally{t--,t||l()}return f},batchCalls:o=>(...f)=>{i(()=>{o(...f)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{a=o}}}var Vn=lP(),Xu,nl,Qu,lR,oP=(lR=class extends fc{constructor(){super();et(this,Xu,!0);et(this,nl);et(this,Qu);Pe(this,Qu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){te(this,nl)||this.setEventListener(te(this,Qu))}onUnsubscribe(){var t;this.hasListeners()||((t=te(this,nl))==null||t.call(this),Pe(this,nl,void 0))}setEventListener(t){var n;Pe(this,Qu,t),(n=te(this,nl))==null||n.call(this),Pe(this,nl,t(this.setOnline.bind(this)))}setOnline(t){te(this,Xu)!==t&&(Pe(this,Xu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return te(this,Xu)}},Xu=new WeakMap,nl=new WeakMap,Qu=new WeakMap,lR),dp=new oP;function uP(e){return Math.min(1e3*2**e,3e4)}function wR(e){return(e??"online")==="online"?dp.isOnline():!0}var vb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function SR(e){let t=!1,n=0,r;const a=hb(),i=()=>a.status!=="pending",l=b=>{var w;if(!i()){const S=new vb(b);m(S),(w=e.onCancel)==null||w.call(e,S)}},o=()=>{t=!0},f=()=>{t=!1},c=()=>C1.isFocused()&&(e.networkMode==="always"||dp.isOnline())&&e.canRun(),h=()=>wR(e.networkMode)&&e.canRun(),p=b=>{i()||(r==null||r(),a.resolve(b))},m=b=>{i()||(r==null||r(),a.reject(b))},y=()=>new Promise(b=>{var w;r=S=>{(i()||c())&&b(S)},(w=e.onPause)==null||w.call(e)}).then(()=>{var b;r=void 0,i()||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(i())return;let b;const w=n===0?e.initialPromise:void 0;try{b=w??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{var A;if(i())return;const N=e.retry??(ad.isServer()?0:3),E=e.retryDelay??uP,T=typeof E=="function"?E(n,S):E,R=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!R){m(S);return}n++,(A=e.onFail)==null||A.call(e,n,S),nP(T).then(()=>c()?void 0:y()).then(()=>{t?m(S):x()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:o,continueRetry:f,canStart:h,start:()=>(h()?x():y().then(x),a)}}var co,oR,ER=(oR=class{constructor(){et(this,co)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cb(this.gcTime)&&Pe(this,co,so.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ad.isServer()?1/0:300*1e3))}clearGcTimeout(){te(this,co)&&(so.clearTimeout(te(this,co)),Pe(this,co,void 0))}},co=new WeakMap,oR),fo,Wu,Ta,ho,Jn,bd,vo,la,CR,Yi,uR,cP=(uR=class extends ER{constructor(t){super();et(this,la);et(this,fo);et(this,Wu);et(this,Ta);et(this,ho);et(this,Jn);et(this,bd);et(this,vo);Pe(this,vo,!1),Pe(this,bd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Pe(this,ho,t.client),Pe(this,Ta,te(this,ho).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Pe(this,fo,oN(this.options)),this.state=t.state??te(this,fo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=te(this,Jn))==null?void 0:t.promise}setOptions(t){if(this.options={...te(this,bd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=oN(this.options);n.data!==void 0&&(this.setState(lN(n.data,n.dataUpdatedAt)),Pe(this,fo,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&te(this,Ta).remove(this)}setData(t,n){const r=db(this.state.data,t,this.options);return mt(this,la,Yi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){mt(this,la,Yi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=te(this,Jn))==null?void 0:r.promise;return(a=te(this,Jn))==null||a.cancel(t),n?n.then(jr).catch(jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return te(this,fo)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>ja(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>dl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!yR(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=te(this,Jn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=te(this,Jn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),te(this,Ta).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(te(this,Jn)&&(te(this,vo)||mt(this,la,CR).call(this)?te(this,Jn).cancel({revert:!0}):te(this,Jn).cancelRetry()),this.scheduleGc()),te(this,Ta).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mt(this,la,Yi).call(this,{type:"invalidate"})}async fetch(t,n){var f,c,h,p,m,y,x,b,w,S,N,E;if(this.state.fetchStatus!=="idle"&&((f=te(this,Jn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(te(this,Jn))return te(this,Jn).continueRetry(),te(this,Jn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(R=>R.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,a=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Pe(this,vo,!0),r.signal)})},i=()=>{const T=bR(this.options,n),A=(()=>{const D={client:te(this,ho),queryKey:this.queryKey,meta:this.meta};return a(D),D})();return Pe(this,vo,!1),this.options.persister?this.options.persister(T,A,this):T(A)},o=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:te(this,ho),state:this.state,fetchFn:i};return a(T),T})();(c=this.options.behavior)==null||c.onFetch(o,this),Pe(this,Wu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=o.fetchOptions)==null?void 0:h.meta))&&mt(this,la,Yi).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),Pe(this,Jn,SR({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:T=>{T instanceof vb&&T.revert&&this.setState({...te(this,Wu),fetchStatus:"idle"}),r.abort()},onFail:(T,R)=>{mt(this,la,Yi).call(this,{type:"failed",failureCount:T,error:R})},onPause:()=>{mt(this,la,Yi).call(this,{type:"pause"})},onContinue:()=>{mt(this,la,Yi).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const T=await te(this,Jn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(m=te(this,Ta).config).onSuccess)==null||y.call(m,T,this),(b=(x=te(this,Ta).config).onSettled)==null||b.call(x,T,this.state.error,this),T}catch(T){if(T instanceof vb){if(T.silent)return te(this,Jn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw mt(this,la,Yi).call(this,{type:"error",error:T}),(S=(w=te(this,Ta).config).onError)==null||S.call(w,T,this),(E=(N=te(this,Ta).config).onSettled)==null||E.call(N,this.state.data,T,this),T}finally{this.scheduleGc()}}},fo=new WeakMap,Wu=new WeakMap,Ta=new WeakMap,ho=new WeakMap,Jn=new WeakMap,bd=new WeakMap,vo=new WeakMap,la=new WeakSet,CR=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Yi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...NR(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...lN(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Pe(this,Wu,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Vn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),te(this,Ta).notify({query:this,type:"updated",action:t})})},uR);function NR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wR(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function lN(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function oN(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Vr,At,wd,kr,po,Zu,Wi,rl,Sd,Ju,ec,mo,go,al,tc,It,Gf,pb,mb,gb,yb,xb,bb,wb,kR,cR,fP=(cR=class extends fc{constructor(t,n){super();et(this,It);et(this,Vr);et(this,At);et(this,wd);et(this,kr);et(this,po);et(this,Zu);et(this,Wi);et(this,rl);et(this,Sd);et(this,Ju);et(this,ec);et(this,mo);et(this,go);et(this,al);et(this,tc,new Set);this.options=n,Pe(this,Vr,t),Pe(this,rl,null),Pe(this,Wi,hb()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(te(this,At).addObserver(this),uN(te(this,At),this.options)?mt(this,It,Gf).call(this):this.updateResult(),mt(this,It,yb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sb(te(this,At),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sb(te(this,At),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,mt(this,It,xb).call(this),mt(this,It,bb).call(this),te(this,At).removeObserver(this)}setOptions(t){const n=this.options,r=te(this,At);if(this.options=te(this,Vr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ja(this.options.enabled,te(this,At))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");mt(this,It,wb).call(this),te(this,At).setOptions(this.options),n._defaulted&&!fp(this.options,n)&&te(this,Vr).getQueryCache().notify({type:"observerOptionsUpdated",query:te(this,At),observer:this});const a=this.hasListeners();a&&cN(te(this,At),r,this.options,n)&&mt(this,It,Gf).call(this),this.updateResult(),a&&(te(this,At)!==r||ja(this.options.enabled,te(this,At))!==ja(n.enabled,te(this,At))||dl(this.options.staleTime,te(this,At))!==dl(n.staleTime,te(this,At)))&&mt(this,It,pb).call(this);const i=mt(this,It,mb).call(this);a&&(te(this,At)!==r||ja(this.options.enabled,te(this,At))!==ja(n.enabled,te(this,At))||i!==te(this,al))&&mt(this,It,gb).call(this,i)}getOptimisticResult(t){const n=te(this,Vr).getQueryCache().build(te(this,Vr),t),r=this.createResult(n,t);return hP(this,r)&&(Pe(this,kr,r),Pe(this,Zu,this.options),Pe(this,po,te(this,At).state)),r}getCurrentResult(){return te(this,kr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&te(this,Wi).status==="pending"&&te(this,Wi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){te(this,tc).add(t)}getCurrentQuery(){return te(this,At)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=te(this,Vr).defaultQueryOptions(t),r=te(this,Vr).getQueryCache().build(te(this,Vr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return mt(this,It,Gf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),te(this,kr)))}createResult(t,n){var L;const r=te(this,At),a=this.options,i=te(this,kr),l=te(this,po),o=te(this,Zu),c=t!==r?t.state:te(this,wd),{state:h}=t;let p={...h},m=!1,y;if(n._optimisticResults){const M=this.hasListeners(),z=!M&&uN(t,n),B=M&&cN(t,r,n,a);(z||B)&&(p={...p,...NR(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:w}=p;y=p.data;let S=!1;if(n.placeholderData!==void 0&&y===void 0&&w==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(M=i.data,S=!0):M=typeof n.placeholderData=="function"?n.placeholderData((L=te(this,ec))==null?void 0:L.state.data,te(this,ec)):n.placeholderData,M!==void 0&&(w="success",y=db(i==null?void 0:i.data,M,n),m=!0)}if(n.select&&y!==void 0&&!S)if(i&&y===(l==null?void 0:l.data)&&n.select===te(this,Sd))y=te(this,Ju);else try{Pe(this,Sd,n.select),y=n.select(y),y=db(i==null?void 0:i.data,y,n),Pe(this,Ju,y),Pe(this,rl,null)}catch(M){Pe(this,rl,M)}te(this,rl)&&(x=te(this,rl),y=te(this,Ju),b=Date.now(),w="error");const N=p.fetchStatus==="fetching",E=w==="pending",T=w==="error",R=E&&N,A=y!==void 0,_={status:w,fetchStatus:p.fetchStatus,isPending:E,isSuccess:w==="success",isError:T,isInitialLoading:R,isLoading:R,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:N,isRefetching:N&&!E,isLoadingError:T&&!A,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:T&&A,isStale:j1(t,n),refetch:this.refetch,promise:te(this,Wi),isEnabled:ja(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=_.data!==void 0,z=_.status==="error"&&!M,B=U=>{z?U.reject(_.error):M&&U.resolve(_.data)},H=()=>{const U=Pe(this,Wi,_.promise=hb());B(U)},G=te(this,Wi);switch(G.status){case"pending":t.queryHash===r.queryHash&&B(G);break;case"fulfilled":(z||_.data!==G.value)&&H();break;case"rejected":(!z||_.error!==G.reason)&&H();break}}return _}updateResult(){const t=te(this,kr),n=this.createResult(te(this,At),this.options);if(Pe(this,po,te(this,At).state),Pe(this,Zu,this.options),te(this,po).data!==void 0&&Pe(this,ec,te(this,At)),fp(n,t))return;Pe(this,kr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!te(this,tc).size)return!0;const l=new Set(i??te(this,tc));return this.options.throwOnError&&l.add("error"),Object.keys(te(this,kr)).some(o=>{const f=o;return te(this,kr)[f]!==t[f]&&l.has(f)})};mt(this,It,kR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&mt(this,It,yb).call(this)}},Vr=new WeakMap,At=new WeakMap,wd=new WeakMap,kr=new WeakMap,po=new WeakMap,Zu=new WeakMap,Wi=new WeakMap,rl=new WeakMap,Sd=new WeakMap,Ju=new WeakMap,ec=new WeakMap,mo=new WeakMap,go=new WeakMap,al=new WeakMap,tc=new WeakMap,It=new WeakSet,Gf=function(t){mt(this,It,wb).call(this);let n=te(this,At).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jr)),n},pb=function(){mt(this,It,xb).call(this);const t=dl(this.options.staleTime,te(this,At));if(ad.isServer()||te(this,kr).isStale||!cb(t))return;const r=yR(te(this,kr).dataUpdatedAt,t)+1;Pe(this,mo,so.setTimeout(()=>{te(this,kr).isStale||this.updateResult()},r))},mb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(te(this,At)):this.options.refetchInterval)??!1},gb=function(t){mt(this,It,bb).call(this),Pe(this,al,t),!(ad.isServer()||ja(this.options.enabled,te(this,At))===!1||!cb(te(this,al))||te(this,al)===0)&&Pe(this,go,so.setInterval(()=>{(this.options.refetchIntervalInBackground||C1.isFocused())&&mt(this,It,Gf).call(this)},te(this,al)))},yb=function(){mt(this,It,pb).call(this),mt(this,It,gb).call(this,mt(this,It,mb).call(this))},xb=function(){te(this,mo)&&(so.clearTimeout(te(this,mo)),Pe(this,mo,void 0))},bb=function(){te(this,go)&&(so.clearInterval(te(this,go)),Pe(this,go,void 0))},wb=function(){const t=te(this,Vr).getQueryCache().build(te(this,Vr),this.options);if(t===te(this,At))return;const n=te(this,At);Pe(this,At,t),Pe(this,wd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},kR=function(t){Vn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(te(this,kr))}),te(this,Vr).getQueryCache().notify({query:te(this,At),type:"observerResultsUpdated"})})},cR);function dP(e,t){return ja(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function uN(e,t){return dP(e,t)||e.state.data!==void 0&&Sb(e,t,t.refetchOnMount)}function Sb(e,t,n){if(ja(t.enabled,e)!==!1&&dl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&j1(e,t)}return!1}function cN(e,t,n,r){return(e!==t||ja(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&j1(e,n)}function j1(e,t){return ja(t.enabled,e)!==!1&&e.isStaleByTime(dl(t.staleTime,e))}function hP(e,t){return!fp(e.getCurrentResult(),t)}function fN(e){return{onFetch:(t,n)=>{var h,p,m,y,x;const r=t.options,a=(m=(p=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},f=0;const c=async()=>{let b=!1;const w=E=>{iP(E,()=>t.signal,()=>b=!0)},S=bR(t.options,t.fetchOptions),N=async(E,T,R)=>{if(b)return Promise.reject();if(T==null&&E.pages.length)return Promise.resolve(E);const D=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:T,direction:R?"backward":"forward",meta:t.options.meta};return w(z),z})(),_=await S(D),{maxPages:L}=t.options,M=R?aP:rP;return{pages:M(E.pages,_,L),pageParams:M(E.pageParams,T,L)}};if(a&&i.length){const E=a==="backward",T=E?vP:dN,R={pages:i,pageParams:l},A=T(r,R);o=await N(R,A,E)}else{const E=e??i.length;do{const T=f===0?l[0]??r.initialPageParam:dN(r,o);if(f>0&&T==null)break;o=await N(o,T),f++}while(f<E)}return o};t.options.persister?t.fetchFn=()=>{var b,w;return(w=(b=t.options).persister)==null?void 0:w.call(b,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function dN(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function vP(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ed,ui,gr,yo,ci,Qs,fR,pP=(fR=class extends ER{constructor(t){super();et(this,ci);et(this,Ed);et(this,ui);et(this,gr);et(this,yo);Pe(this,Ed,t.client),this.mutationId=t.mutationId,Pe(this,gr,t.mutationCache),Pe(this,ui,[]),this.state=t.state||TR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){te(this,ui).includes(t)||(te(this,ui).push(t),this.clearGcTimeout(),te(this,gr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Pe(this,ui,te(this,ui).filter(n=>n!==t)),this.scheduleGc(),te(this,gr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){te(this,ui).length||(this.state.status==="pending"?this.scheduleGc():te(this,gr).remove(this))}continue(){var t;return((t=te(this,yo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,f,c,h,p,m,y,x,b,w,S,N,E,T,R,A,D;const n=()=>{mt(this,ci,Qs).call(this,{type:"continue"})},r={client:te(this,Ed),meta:this.options.meta,mutationKey:this.options.mutationKey};Pe(this,yo,SR({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(_,L)=>{mt(this,ci,Qs).call(this,{type:"failed",failureCount:_,error:L})},onPause:()=>{mt(this,ci,Qs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>te(this,gr).canRun(this)}));const a=this.state.status==="pending",i=!te(this,yo).canStart();try{if(a)n();else{mt(this,ci,Qs).call(this,{type:"pending",variables:t,isPaused:i}),te(this,gr).config.onMutate&&await te(this,gr).config.onMutate(t,this,r);const L=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));L!==this.state.context&&mt(this,ci,Qs).call(this,{type:"pending",context:L,variables:t,isPaused:i})}const _=await te(this,yo).start();return await((c=(f=te(this,gr).config).onSuccess)==null?void 0:c.call(f,_,t,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,_,t,this.state.context,r)),await((y=(m=te(this,gr).config).onSettled)==null?void 0:y.call(m,_,null,this.state.variables,this.state.context,this,r)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,_,null,t,this.state.context,r)),mt(this,ci,Qs).call(this,{type:"success",data:_}),_}catch(_){try{await((S=(w=te(this,gr).config).onError)==null?void 0:S.call(w,_,t,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((E=(N=this.options).onError)==null?void 0:E.call(N,_,t,this.state.context,r))}catch(L){Promise.reject(L)}try{await((R=(T=te(this,gr).config).onSettled)==null?void 0:R.call(T,void 0,_,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((D=(A=this.options).onSettled)==null?void 0:D.call(A,void 0,_,t,this.state.context,r))}catch(L){Promise.reject(L)}throw mt(this,ci,Qs).call(this,{type:"error",error:_}),_}finally{te(this,gr).runNext(this)}}},Ed=new WeakMap,ui=new WeakMap,gr=new WeakMap,yo=new WeakMap,ci=new WeakSet,Qs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Vn.batch(()=>{te(this,ui).forEach(r=>{r.onMutationUpdate(t)}),te(this,gr).notify({mutation:this,type:"updated",action:t})})},fR);function TR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zi,Fa,Cd,dR,mP=(dR=class extends fc{constructor(t={}){super();et(this,Zi);et(this,Fa);et(this,Cd);this.config=t,Pe(this,Zi,new Set),Pe(this,Fa,new Map),Pe(this,Cd,0)}build(t,n,r){const a=new pP({client:t,mutationCache:this,mutationId:++hv(this,Cd)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){te(this,Zi).add(t);const n=vv(t);if(typeof n=="string"){const r=te(this,Fa).get(n);r?r.push(t):te(this,Fa).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(te(this,Zi).delete(t)){const n=vv(t);if(typeof n=="string"){const r=te(this,Fa).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&te(this,Fa).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=vv(t);if(typeof n=="string"){const r=te(this,Fa).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=vv(t);if(typeof n=="string"){const a=(r=te(this,Fa).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vn.batch(()=>{te(this,Zi).forEach(t=>{this.notify({type:"removed",mutation:t})}),te(this,Zi).clear(),te(this,Fa).clear()})}getAll(){return Array.from(te(this,Zi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>aN(n,r))}findAll(t={}){return this.getAll().filter(n=>aN(t,n))}notify(t){Vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Vn.batch(()=>Promise.all(t.map(n=>n.continue().catch(jr))))}},Zi=new WeakMap,Fa=new WeakMap,Cd=new WeakMap,dR);function vv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ji,il,Hr,es,rs,Kv,Eb,hR,gP=(hR=class extends fc{constructor(n,r){super();et(this,rs);et(this,Ji);et(this,il);et(this,Hr);et(this,es);Pe(this,Ji,n),this.setOptions(r),this.bindMethods(),mt(this,rs,Kv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=te(this,Ji).defaultMutationOptions(n),fp(this.options,r)||te(this,Ji).getMutationCache().notify({type:"observerOptionsUpdated",mutation:te(this,Hr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&wo(r.mutationKey)!==wo(this.options.mutationKey)?this.reset():((a=te(this,Hr))==null?void 0:a.state.status)==="pending"&&te(this,Hr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=te(this,Hr))==null||n.removeObserver(this)}onMutationUpdate(n){mt(this,rs,Kv).call(this),mt(this,rs,Eb).call(this,n)}getCurrentResult(){return te(this,il)}reset(){var n;(n=te(this,Hr))==null||n.removeObserver(this),Pe(this,Hr,void 0),mt(this,rs,Kv).call(this),mt(this,rs,Eb).call(this)}mutate(n,r){var a;return Pe(this,es,r),(a=te(this,Hr))==null||a.removeObserver(this),Pe(this,Hr,te(this,Ji).getMutationCache().build(te(this,Ji),this.options)),te(this,Hr).addObserver(this),te(this,Hr).execute(n)}},Ji=new WeakMap,il=new WeakMap,Hr=new WeakMap,es=new WeakMap,rs=new WeakSet,Kv=function(){var r;const n=((r=te(this,Hr))==null?void 0:r.state)??TR();Pe(this,il,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Eb=function(n){Vn.batch(()=>{var r,a,i,l,o,f,c,h;if(te(this,es)&&this.hasListeners()){const p=te(this,il).variables,m=te(this,il).context,y={client:te(this,Ji),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=te(this,es)).onSuccess)==null||a.call(r,n.data,p,m,y)}catch(x){Promise.reject(x)}try{(l=(i=te(this,es)).onSettled)==null||l.call(i,n.data,null,p,m,y)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(f=(o=te(this,es)).onError)==null||f.call(o,n.error,p,m,y)}catch(x){Promise.reject(x)}try{(h=(c=te(this,es)).onSettled)==null||h.call(c,void 0,n.error,p,m,y)}catch(x){Promise.reject(x)}}}this.listeners.forEach(p=>{p(te(this,il))})})},hR),fi,vR,yP=(vR=class extends fc{constructor(t={}){super();et(this,fi);this.config=t,Pe(this,fi,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??N1(a,n);let l=this.get(i);return l||(l=new cP({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){te(this,fi).has(t.queryHash)||(te(this,fi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=te(this,fi).get(t.queryHash);n&&(t.destroy(),n===t&&te(this,fi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Vn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return te(this,fi).get(t)}getAll(){return[...te(this,fi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>rN(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>rN(t,r)):n}notify(t){Vn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Vn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Vn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fi=new WeakMap,vR),wn,sl,ll,nc,rc,ol,ac,ic,pR,xP=(pR=class{constructor(e={}){et(this,wn);et(this,sl);et(this,ll);et(this,nc);et(this,rc);et(this,ol);et(this,ac);et(this,ic);Pe(this,wn,e.queryCache||new yP),Pe(this,sl,e.mutationCache||new mP),Pe(this,ll,e.defaultOptions||{}),Pe(this,nc,new Map),Pe(this,rc,new Map),Pe(this,ol,0)}mount(){hv(this,ol)._++,te(this,ol)===1&&(Pe(this,ac,C1.subscribe(async e=>{e&&(await this.resumePausedMutations(),te(this,wn).onFocus())})),Pe(this,ic,dp.subscribe(async e=>{e&&(await this.resumePausedMutations(),te(this,wn).onOnline())})))}unmount(){var e,t;hv(this,ol)._--,te(this,ol)===0&&((e=te(this,ac))==null||e.call(this),Pe(this,ac,void 0),(t=te(this,ic))==null||t.call(this),Pe(this,ic,void 0))}isFetching(e){return te(this,wn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return te(this,sl).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=te(this,wn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=te(this,wn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return te(this,wn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=te(this,wn).get(r.queryHash),i=a==null?void 0:a.state.data,l=eP(t,i);if(l!==void 0)return te(this,wn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Vn.batch(()=>te(this,wn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=te(this,wn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=te(this,wn);Vn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=te(this,wn);return Vn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Vn.batch(()=>te(this,wn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(jr).catch(jr)}invalidateQueries(e,t={}){return Vn.batch(()=>(te(this,wn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Vn.batch(()=>te(this,wn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(jr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(jr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=te(this,wn).build(this,t);return n.isStaleByTime(dl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jr).catch(jr)}fetchInfiniteQuery(e){return e.behavior=fN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}ensureInfiniteQueryData(e){return e.behavior=fN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return dp.isOnline()?te(this,sl).resumePausedMutations():Promise.resolve()}getQueryCache(){return te(this,wn)}getMutationCache(){return te(this,sl)}getDefaultOptions(){return te(this,ll)}setDefaultOptions(e){Pe(this,ll,e)}setQueryDefaults(e,t){te(this,nc).set(wo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...te(this,nc).values()],n={};return t.forEach(r=>{rd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){te(this,rc).set(wo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...te(this,rc).values()],n={};return t.forEach(r=>{rd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...te(this,ll).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=N1(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===k1&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...te(this,ll).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){te(this,wn).clear(),te(this,sl).clear()}},wn=new WeakMap,sl=new WeakMap,ll=new WeakMap,nc=new WeakMap,rc=new WeakMap,ol=new WeakMap,ac=new WeakMap,ic=new WeakMap,pR),jR=j.createContext(void 0),Sn=e=>{const t=j.useContext(jR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},bP=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(jR.Provider,{value:e,children:t})),AR=j.createContext(!1),wP=()=>j.useContext(AR);AR.Provider;function SP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var EP=j.createContext(SP()),CP=()=>j.useContext(EP),NP=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?T1(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},kP=e=>{j.useEffect(()=>{e.clearReset()},[e])},TP=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||T1(n,[e.error,r])),jP=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},AP=(e,t)=>e.isLoading&&e.isFetching&&!t,RP=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,hN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function DP(e,t,n){var m,y,x,b;const r=wP(),a=CP(),i=Sn(),l=i.defaultQueryOptions(e);(y=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||y.call(m,l);const o=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",jP(l),NP(l,a,o),kP(a);const f=!i.getQueryCache().get(l.queryHash),[c]=j.useState(()=>new t(i,l)),h=c.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(w=>{const S=p?c.subscribe(Vn.batchCalls(w)):jr;return c.updateResult(),S},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),j.useEffect(()=>{c.setOptions(l)},[l,c]),RP(l,h))throw hN(l,c,a);if(TP({result:h,errorResetBoundary:a,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw h.error;if((b=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||b.call(x,l,h),l.experimental_prefetchInRender&&!ad.isServer()&&AP(h,r)){const w=f?hN(l,c,a):o==null?void 0:o.promise;w==null||w.catch(jr).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?h:c.trackResult(h)}function qt(e,t){return DP(e,fP)}function fr(e,t){const n=Sn(),[r]=j.useState(()=>new gP(n,e));j.useEffect(()=>{r.setOptions(e)},[r,e]);const a=j.useSyncExternalStore(j.useCallback(l=>r.subscribe(Vn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=j.useCallback((l,o)=>{r.mutate(l,o).catch(jr)},[r]);if(a.error&&T1(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/**
|
|
50
|
+
* react-router v7.13.1
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var vN="popstate";function pN(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function MP(e={}){function t(r,a){var c;let i=(c=a.state)==null?void 0:c.masked,{pathname:l,search:o,hash:f}=i||r.location;return Cb("",{pathname:l,search:o,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:id(a)}return OP(t,n,null,e)}function mn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function bi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _P(){return Math.random().toString(36).substring(2,10)}function mN(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Cb(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?dc(t):t,state:n,key:t&&t.key||r||_P(),unstable_mask:a}}function id({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function dc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function OP(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,o="POP",f=null,c=h();c==null&&(c=0,l.replaceState({...l.state,idx:c},""));function h(){return(l.state||{idx:null}).idx}function p(){o="POP";let w=h(),S=w==null?null:w-c;c=w,f&&f({action:o,location:b.location,delta:S})}function m(w,S){o="PUSH";let N=pN(w)?w:Cb(b.location,w,S);c=h()+1;let E=mN(N,c),T=b.createHref(N.unstable_mask||N);try{l.pushState(E,"",T)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;a.location.assign(T)}i&&f&&f({action:o,location:b.location,delta:1})}function y(w,S){o="REPLACE";let N=pN(w)?w:Cb(b.location,w,S);c=h();let E=mN(N,c),T=b.createHref(N.unstable_mask||N);l.replaceState(E,"",T),i&&f&&f({action:o,location:b.location,delta:0})}function x(w){return LP(w)}let b={get action(){return o},get location(){return e(a,l)},listen(w){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(vN,p),f=w,()=>{a.removeEventListener(vN,p),f=null}},createHref(w){return t(a,w)},createURL:x,encodeLocation(w){let S=x(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:m,replace:y,go(w){return l.go(w)}};return b}function LP(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),mn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:id(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function RR(e,t,n="/"){return PP(e,t,n,!1)}function PP(e,t,n,r){let a=typeof t=="string"?dc(t):t,i=as(a.pathname||"/",n);if(i==null)return null;let l=DR(e);BP(l);let o=null;for(let f=0;o==null&&f<l.length;++f){let c=YP(i);o=$P(l[f],c,r)}return o}function DR(e,t=[],n=[],r="",a=!1){let i=(l,o,f=a,c)=>{let h={relativePath:c===void 0?l.path||"":c,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&f)return;mn(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let p=gi([r,h.relativePath]),m=n.concat(h);l.children&&l.children.length>0&&(mn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),DR(l.children,t,m,p,f)),!(l.path==null&&!l.index)&&t.push({path:p,score:HP(p,l.index),routesMeta:m})};return e.forEach((l,o)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,o);else for(let c of MR(l.path))i(l,o,!0,c)}),t}function MR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=MR(r.join("/")),o=[];return o.push(...l.map(f=>f===""?i:[i,f].join("/"))),a&&o.push(...l),o.map(f=>e.startsWith("/")&&f===""?"/":f)}function BP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var zP=/^:[\w-]+$/,IP=3,FP=2,UP=1,qP=10,VP=-2,gN=e=>e==="*";function HP(e,t){let n=e.split("/"),r=n.length;return n.some(gN)&&(r+=VP),t&&(r+=FP),n.filter(a=>!gN(a)).reduce((a,i)=>a+(zP.test(i)?IP:i===""?UP:qP),r)}function GP(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function $P(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",l=[];for(let o=0;o<r.length;++o){let f=r[o],c=o===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=hp({path:f.relativePath,caseSensitive:f.caseSensitive,end:c},h),m=f.route;if(!p&&c&&n&&!r[r.length-1].route.index&&(p=hp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},h)),!p)return null;Object.assign(a,p.params),l.push({params:a,pathname:gi([i,p.pathname]),pathnameBase:ZP(gi([i,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(i=gi([i,p.pathnameBase]))}return l}function hp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=KP(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:r.reduce((c,{paramName:h,isOptional:p},m)=>{if(h==="*"){let x=o[m]||"";l=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const y=o[m];return p&&!y?c[h]=void 0:c[h]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:l,pattern:e}}function KP(e,t=!1,n=!0){bi(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,f,c,h)=>{if(r.push({paramName:o,isOptional:f!=null}),f){let p=h.charAt(c+l.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function YP(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return bi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function as(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)||"/"}var XP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function QP(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?dc(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=yN(n.substring(1),"/"):i=yN(n,t)):i=t,{pathname:i,search:JP(r),hash:eB(a)}}function yN(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Wy(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 WP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _R(e){let t=WP(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function A1(e,t,n,r=!1){let a;typeof e=="string"?a=dc(e):(a={...e},mn(!a.pathname||!a.pathname.includes("?"),Wy("?","pathname","search",a)),mn(!a.pathname||!a.pathname.includes("#"),Wy("#","pathname","hash",a)),mn(!a.search||!a.search.includes("#"),Wy("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,o;if(l==null)o=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),p-=1;a.pathname=m.join("/")}o=p>=0?t[p]:"/"}let f=QP(a,o),c=l&&l!=="/"&&l.endsWith("/"),h=(i||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(c||h)&&(f.pathname+="/"),f}var gi=e=>e.join("/").replace(/\/\/+/g,"/"),ZP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),JP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,eB=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,tB=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function nB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function rB(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var OR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function LR(e,t){let n=e;if(typeof n!="string"||!XP.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(OR)try{let i=new URL(window.location.href),l=n.startsWith("//")?new URL(i.protocol+n):new URL(n),o=as(l.pathname,t);l.origin===i.origin&&o!=null?n=o+l.search+l.hash:a=!0}catch{bi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var PR=["POST","PUT","PATCH","DELETE"];new Set(PR);var aB=["GET",...PR];new Set(aB);var hc=j.createContext(null);hc.displayName="DataRouter";var Vp=j.createContext(null);Vp.displayName="DataRouterState";var iB=j.createContext(!1),BR=j.createContext({isTransitioning:!1});BR.displayName="ViewTransition";var sB=j.createContext(new Map);sB.displayName="Fetchers";var lB=j.createContext(null);lB.displayName="Await";var Oa=j.createContext(null);Oa.displayName="Navigation";var kd=j.createContext(null);kd.displayName="Location";var Qa=j.createContext({outlet:null,matches:[],isDataRoute:!1});Qa.displayName="Route";var R1=j.createContext(null);R1.displayName="RouteError";var zR="REACT_ROUTER_ERROR",oB="REDIRECT",uB="ROUTE_ERROR_RESPONSE";function cB(e){if(e.startsWith(`${zR}:${oB}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function fB(e){if(e.startsWith(`${zR}:${uB}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new tB(t.status,t.statusText,t.data)}catch{}}function dB(e,{relative:t}={}){mn(Td(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=j.useContext(Oa),{hash:a,pathname:i,search:l}=jd(e,{relative:t}),o=i;return n!=="/"&&(o=i==="/"?n:gi([n,i])),r.createHref({pathname:o,search:l,hash:a})}function Td(){return j.useContext(kd)!=null}function La(){return mn(Td(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(kd).location}var IR="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function FR(e){j.useContext(Oa).static||j.useLayoutEffect(e)}function Wa(){let{isDataRoute:e}=j.useContext(Qa);return e?jB():hB()}function hB(){mn(Td(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(hc),{basename:t,navigator:n}=j.useContext(Oa),{matches:r}=j.useContext(Qa),{pathname:a}=La(),i=JSON.stringify(_R(r)),l=j.useRef(!1);return FR(()=>{l.current=!0}),j.useCallback((f,c={})=>{if(bi(l.current,IR),!l.current)return;if(typeof f=="number"){n.go(f);return}let h=A1(f,JSON.parse(i),a,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:gi([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,i,a,e])}var vB=j.createContext(null);function pB(e){let t=j.useContext(Qa).outlet;return j.useMemo(()=>t&&j.createElement(vB.Provider,{value:e},t),[t,e])}function mB(){let{matches:e}=j.useContext(Qa),t=e[e.length-1];return t?t.params:{}}function jd(e,{relative:t}={}){let{matches:n}=j.useContext(Qa),{pathname:r}=La(),a=JSON.stringify(_R(n));return j.useMemo(()=>A1(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function gB(e,t){return UR(e,t)}function UR(e,t,n){var w;mn(Td(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=j.useContext(Oa),{matches:a}=j.useContext(Qa),i=a[a.length-1],l=i?i.params:{},o=i?i.pathname:"/",f=i?i.pathnameBase:"/",c=i&&i.route;{let S=c&&c.path||"";VR(o,!c||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let h=La(),p;if(t){let S=typeof t=="string"?dc(t):t;mn(f==="/"||((w=S.pathname)==null?void 0:w.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${S.pathname}" was given in the \`location\` prop.`),p=S}else p=h;let m=p.pathname||"/",y=m;if(f!=="/"){let S=f.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=RR(e,{pathname:y});bi(c||x!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),bi(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=SB(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:gi([f,r.encodeLocation?r.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?f:gi([f,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n);return t&&b?j.createElement(kd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},b):b}function yB(){let e=TB(),t=nB(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:i},"ErrorBoundary")," or"," ",j.createElement("code",{style:i},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:a},n):null,l)}var xB=j.createElement(yB,null),qR=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=fB(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Qa.Provider,{value:this.props.routeContext},j.createElement(R1.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(bB,{error:e},t):t}};qR.contextType=iB;var Zy=new WeakMap;function bB({children:e,error:t}){let{basename:n}=j.useContext(Oa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=cB(t.digest);if(r){let a=Zy.get(t);if(a)throw a;let i=LR(r.location,n);if(OR&&!Zy.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw Zy.set(t,l),l}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function wB({routeContext:e,match:t,children:n}){let r=j.useContext(hc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Qa.Provider,{value:e},n)}function SB(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let h=a.findIndex(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);mn(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,h+1))}let l=!1,o=-1;if(n&&r){l=r.renderFallback;for(let h=0;h<a.length;h++){let p=a[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(o=h),p.route.id){let{loaderData:m,errors:y}=r,x=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||x){n.isStatic&&(l=!0),o>=0?a=a.slice(0,o+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,c=r&&f?(h,p)=>{var m,y;f(h,{location:r.location,params:((y=(m=r.matches)==null?void 0:m[0])==null?void 0:y.params)??{},unstable_pattern:rB(r.matches),errorInfo:p})}:void 0;return a.reduceRight((h,p,m)=>{let y,x=!1,b=null,w=null;r&&(y=i&&p.route.id?i[p.route.id]:void 0,b=p.route.errorElement||xB,l&&(o<0&&m===0?(VR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,w=null):o===m&&(x=!0,w=p.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,m+1)),N=()=>{let E;return y?E=b:x?E=w:p.route.Component?E=j.createElement(p.route.Component,null):p.route.element?E=p.route.element:E=h,j.createElement(wB,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:r!=null},children:E})};return r&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?j.createElement(qR,{location:r.location,revalidation:r.revalidation,component:b,error:y,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:c}):N()},null)}function D1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function EB(e){let t=j.useContext(hc);return mn(t,D1(e)),t}function CB(e){let t=j.useContext(Vp);return mn(t,D1(e)),t}function NB(e){let t=j.useContext(Qa);return mn(t,D1(e)),t}function M1(e){let t=NB(e),n=t.matches[t.matches.length-1];return mn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kB(){return M1("useRouteId")}function TB(){var r;let e=j.useContext(R1),t=CB("useRouteError"),n=M1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function jB(){let{router:e}=EB("useNavigate"),t=M1("useNavigate"),n=j.useRef(!1);return FR(()=>{n.current=!0}),j.useCallback(async(a,i={})=>{bi(n.current,IR),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var xN={};function VR(e,t,n){!t&&!xN[e]&&(xN[e]=!0,bi(!1,n))}j.memo(AB);function AB({routes:e,future:t,state:n,isStatic:r,onError:a}){return UR(e,void 0,{state:n,isStatic:r,onError:a})}function RB(e){return pB(e.context)}function Na(e){mn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function DB({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:l}){mn(!Td(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),f=j.useMemo(()=>({basename:o,navigator:a,static:i,unstable_useTransitions:l,future:{}}),[o,a,i,l]);typeof n=="string"&&(n=dc(n));let{pathname:c="/",search:h="",hash:p="",state:m=null,key:y="default",unstable_mask:x}=n,b=j.useMemo(()=>{let w=as(c,o);return w==null?null:{location:{pathname:w,search:h,hash:p,state:m,key:y,unstable_mask:x},navigationType:r}},[o,c,h,p,m,y,r,x]);return bi(b!=null,`<Router basename="${o}"> is not able to match the URL "${c}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:j.createElement(Oa.Provider,{value:f},j.createElement(kd.Provider,{children:t,value:b}))}function MB({children:e,location:t}){return gB(Nb(e),t)}function Nb(e,t=[]){let n=[];return j.Children.forEach(e,(r,a)=>{if(!j.isValidElement(r))return;let i=[...t,a];if(r.type===j.Fragment){n.push.apply(n,Nb(r.props.children,i));return}mn(r.type===Na,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),mn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Nb(r.props.children,i)),n.push(l)}),n}var Yv="get",Xv="application/x-www-form-urlencoded";function Hp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function _B(e){return Hp(e)&&e.tagName.toLowerCase()==="button"}function OB(e){return Hp(e)&&e.tagName.toLowerCase()==="form"}function LB(e){return Hp(e)&&e.tagName.toLowerCase()==="input"}function PB(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function BB(e,t){return e.button===0&&(!t||t==="_self")&&!PB(e)}var pv=null;function zB(){if(pv===null)try{new FormData(document.createElement("form"),0),pv=!1}catch{pv=!0}return pv}var IB=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jy(e){return e!=null&&!IB.has(e)?(bi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xv}"`),null):e}function FB(e,t){let n,r,a,i,l;if(OB(e)){let o=e.getAttribute("action");r=o?as(o,t):null,n=e.getAttribute("method")||Yv,a=Jy(e.getAttribute("enctype"))||Xv,i=new FormData(e)}else if(_B(e)||LB(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||o.getAttribute("action");if(r=f?as(f,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||Yv,a=Jy(e.getAttribute("formenctype"))||Jy(o.getAttribute("enctype"))||Xv,i=new FormData(o,e),!zB()){let{name:c,type:h,value:p}=e;if(h==="image"){let m=c?`${c}.`:"";i.append(`${m}x`,"0"),i.append(`${m}y`,"0")}else c&&i.append(c,p)}}else{if(Hp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Yv,r=null,a=Xv,l=e}return i&&a==="text/plain"&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function UB(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&as(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function qB(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function VB(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function HB(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let l=await qB(i,n);return l.links?l.links():[]}return[]}));return YB(r.flat(1).filter(VB).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function bN(e,t,n,r,a,i){let l=(f,c)=>n[c]?f.route.id!==n[c].route.id:!0,o=(f,c)=>{var h;return n[c].pathname!==f.pathname||((h=n[c].route.path)==null?void 0:h.endsWith("*"))&&n[c].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,c)=>l(f,c)||o(f,c)):i==="data"?t.filter((f,c)=>{var p;let h=r.routes[f.route.id];if(!h||!h.hasLoader)return!1;if(l(f,c)||o(f,c))return!0;if(f.route.shouldRevalidate){let m=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function GB(e,t,{includeHydrateFallback:n}={}){return $B(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function $B(e){return[...new Set(e)]}function KB(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function YB(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(KB(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function HR(){let e=j.useContext(hc);return _1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function XB(){let e=j.useContext(Vp);return _1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var O1=j.createContext(void 0);O1.displayName="FrameworkContext";function GR(){let e=j.useContext(O1);return _1(e,"You must render this element inside a <HydratedRouter> element"),e}function QB(e,t){let n=j.useContext(O1),[r,a]=j.useState(!1),[i,l]=j.useState(!1),{onFocus:o,onBlur:f,onMouseEnter:c,onMouseLeave:h,onTouchStart:p}=t,m=j.useRef(null);j.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=S=>{S.forEach(N=>{l(N.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return m.current&&w.observe(m.current),()=>{w.disconnect()}}},[e]),j.useEffect(()=>{if(r){let b=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(b)}}},[r]);let y=()=>{a(!0)},x=()=>{a(!1),l(!1)};return n?e!=="intent"?[i,m,{}]:[i,m,{onFocus:Nf(o,y),onBlur:Nf(f,x),onMouseEnter:Nf(c,y),onMouseLeave:Nf(h,x),onTouchStart:Nf(p,y)}]:[!1,m,{}]}function Nf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function WB({page:e,...t}){let{router:n}=HR(),r=j.useMemo(()=>RR(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?j.createElement(JB,{page:e,matches:r,...t}):null}function ZB(e){let{manifest:t,routeModules:n}=GR(),[r,a]=j.useState([]);return j.useEffect(()=>{let i=!1;return HB(e,t,n).then(l=>{i||a(l)}),()=>{i=!0}},[e,t,n]),r}function JB({page:e,matches:t,...n}){let r=La(),{future:a,manifest:i,routeModules:l}=GR(),{basename:o}=HR(),{loaderData:f,matches:c}=XB(),h=j.useMemo(()=>bN(e,t,c,i,r,"data"),[e,t,c,i,r]),p=j.useMemo(()=>bN(e,t,c,i,r,"assets"),[e,t,c,i,r]),m=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,w=!1;if(t.forEach(N=>{var T;let E=i.routes[N.route.id];!E||!E.hasLoader||(!h.some(R=>R.route.id===N.route.id)&&N.route.id in f&&((T=l[N.route.id])!=null&&T.shouldRevalidate)||E.hasClientLoader?w=!0:b.add(N.route.id))}),b.size===0)return[];let S=UB(e,o,a.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&S.searchParams.set("_routes",t.filter(N=>b.has(N.route.id)).map(N=>N.route.id).join(",")),[S.pathname+S.search]},[o,a.unstable_trailingSlashAwareDataRequests,f,r,i,h,t,e,l]),y=j.useMemo(()=>GB(p,i),[p,i]),x=ZB(p);return j.createElement(j.Fragment,null,m.map(b=>j.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),y.map(b=>j.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),x.map(({key:b,link:w})=>j.createElement("link",{key:b,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function ez(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var tz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tz&&(window.__reactRouterVersion="7.13.1")}catch{}function nz({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=j.useRef();a.current==null&&(a.current=MP({window:r,v5Compat:!0}));let i=a.current,[l,o]=j.useState({action:i.action,location:i.location}),f=j.useCallback(c=>{n===!1?o(c):j.startTransition(()=>o(c))},[n]);return j.useLayoutEffect(()=>i.listen(f),[i,f]),j.createElement(DB,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,unstable_useTransitions:n})}var $R=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ma=j.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:l,unstable_mask:o,state:f,target:c,to:h,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:y,...x},b){let{basename:w,navigator:S,unstable_useTransitions:N}=j.useContext(Oa),E=typeof h=="string"&&$R.test(h),T=LR(h,w);h=T.to;let R=dB(h,{relative:a}),A=La(),D=null;if(o){let U=A1(o,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);w!=="/"&&(U.pathname=U.pathname==="/"?w:gi([w,U.pathname])),D=S.createHref(U)}let[_,L,M]=QB(r,x),z=iz(h,{replace:l,unstable_mask:o,state:f,target:c,preventScrollReset:p,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:y,unstable_useTransitions:N});function B(U){t&&t(U),U.defaultPrevented||z(U)}let H=!(T.isExternal||i),G=j.createElement("a",{...x,...M,href:(H?D:void 0)||T.absoluteURL||R,onClick:H?B:t,ref:ez(b,L),target:c,"data-discover":!E&&n==="render"?"true":void 0});return _&&!E?j.createElement(j.Fragment,null,G,j.createElement(WB,{page:R})):G});Ma.displayName="Link";var L1=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:l,viewTransition:o,children:f,...c},h){let p=jd(l,{relative:c.relative}),m=La(),y=j.useContext(Vp),{navigator:x,basename:b}=j.useContext(Oa),w=y!=null&&cz(p)&&o===!0,S=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,N=m.pathname,E=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(N=N.toLowerCase(),E=E?E.toLowerCase():null,S=S.toLowerCase()),E&&b&&(E=as(E,b)||E);const T=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let R=N===S||!a&&N.startsWith(S)&&N.charAt(T)==="/",A=E!=null&&(E===S||!a&&E.startsWith(S)&&E.charAt(S.length)==="/"),D={isActive:R,isPending:A,isTransitioning:w},_=R?t:void 0,L;typeof r=="function"?L=r(D):L=[r,R?"active":null,A?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(D):i;return j.createElement(Ma,{...c,"aria-current":_,className:L,ref:h,style:M,to:l,viewTransition:o},typeof f=="function"?f(D):f)});L1.displayName="NavLink";var rz=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:l=Yv,action:o,onSubmit:f,relative:c,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m,...y},x)=>{let{unstable_useTransitions:b}=j.useContext(Oa),w=oz(),S=uz(o,{relative:c}),N=l.toLowerCase()==="get"?"get":"post",E=typeof o=="string"&&$R.test(o),T=R=>{if(f&&f(R),R.defaultPrevented)return;R.preventDefault();let A=R.nativeEvent.submitter,D=(A==null?void 0:A.getAttribute("formmethod"))||l,_=()=>w(A||R.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:a,state:i,relative:c,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m});b&&n!==!1?j.startTransition(()=>_()):_()};return j.createElement("form",{ref:x,method:N,action:S,onSubmit:r?f:T,...y,"data-discover":!E&&e==="render"?"true":void 0})});rz.displayName="Form";function az(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function KR(e){let t=j.useContext(hc);return mn(t,az(e)),t}function iz(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:f,unstable_useTransitions:c}={}){let h=Wa(),p=La(),m=jd(e,{relative:l});return j.useCallback(y=>{if(BB(y,t)){y.preventDefault();let x=n!==void 0?n:id(p)===id(m),b=()=>h(e,{replace:x,unstable_mask:r,state:a,preventScrollReset:i,relative:l,viewTransition:o,unstable_defaultShouldRevalidate:f});c?j.startTransition(()=>b()):b()}},[p,h,m,n,r,a,t,e,i,l,o,f,c])}var sz=0,lz=()=>`__${String(++sz)}__`;function oz(){let{router:e}=KR("useSubmit"),{basename:t}=j.useContext(Oa),n=kB(),r=e.fetch,a=e.navigate;return j.useCallback(async(i,l={})=>{let{action:o,method:f,encType:c,formData:h,body:p}=FB(i,t);if(l.navigate===!1){let m=l.fetcherKey||lz();await r(m,n,l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:h,body:p,formMethod:l.method||f,formEncType:l.encType||c,flushSync:l.flushSync})}else await a(l.action||o,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:h,body:p,formMethod:l.method||f,formEncType:l.encType||c,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function uz(e,{relative:t}={}){let{basename:n}=j.useContext(Oa),r=j.useContext(Qa);mn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...jd(e||".",{relative:t})},l=La();if(e==null){i.search=l.search;let o=new URLSearchParams(i.search),f=o.getAll("index");if(f.some(h=>h==="")){o.delete("index"),f.filter(p=>p).forEach(p=>o.append("index",p));let h=o.toString();i.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:gi([n,i.pathname])),id(i)}function cz(e,{relative:t}={}){let n=j.useContext(BR);mn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=KR("useViewTransitionState"),a=jd(e,{relative:t});if(!n.isTransitioning)return!1;let i=as(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=as(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hp(a.pathname,l)!=null||hp(a.pathname,i)!=null}var Ad=gR();const fz=Nd(Ad),YR="myco-ui-theme",dz="system",wN="light",XR="(prefers-color-scheme: dark)",QR=j.createContext(void 0);function hz(){const e=localStorage.getItem(YR);return e==="light"||e==="dark"||e==="system"?e:dz}function SN(e){const t=document.documentElement;e==="light"||e==="system"&&!window.matchMedia(XR).matches?t.classList.add(wN):t.classList.remove(wN)}function vz({children:e}){const[t,n]=j.useState(hz),r=a=>{localStorage.setItem(YR,a),n(a)};return j.useEffect(()=>{SN(t)},[t]),j.useEffect(()=>{if(t!=="system")return;const a=window.matchMedia(XR),i=()=>SN("system");return a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[t]),d.jsx(QR.Provider,{value:{theme:t,setTheme:r},children:e})}function pz(){const e=j.useContext(QR);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}const WR="myco-ui-font",mz="default",ZR={default:{heading:"'Newsreader', Georgia, serif",ui:"'Inter', system-ui, sans-serif",data:"'JetBrains Mono', 'Fira Code', monospace"},"geist-mono":{heading:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",ui:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",data:"'Geist Mono', 'SF Mono', 'Fira Code', monospace"},system:{heading:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",ui:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",data:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace"},"sf-mono":{heading:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",ui:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",data:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace"},"fira-code":{heading:"'Fira Code', 'Fira Mono', ui-monospace, monospace",ui:"'Fira Code', 'Fira Mono', ui-monospace, monospace",data:"'Fira Code', 'Fira Mono', ui-monospace, monospace"},"jetbrains-mono":{heading:"'JetBrains Mono', ui-monospace, monospace",ui:"'JetBrains Mono', ui-monospace, monospace",data:"'JetBrains Mono', ui-monospace, monospace"}},gz=new Set(Object.keys(ZR)),JR=j.createContext(void 0);function yz(){const e=localStorage.getItem(WR);return e&&gz.has(e)?e:mz}function xz(e){const t=ZR[e],n=document.documentElement.style;n.setProperty("--font-heading",t.heading),n.setProperty("--font-ui",t.ui),n.setProperty("--font-data",t.data)}function bz({children:e}){const[t,n]=j.useState(yz),r=a=>{localStorage.setItem(WR,a),n(a)};return j.useEffect(()=>{xz(t)},[t]),d.jsx(JR.Provider,{value:{font:t,setFont:r},children:e})}function wz(){const e=j.useContext(JR);if(!e)throw new Error("useFont must be used within a FontProvider");return e}const EN=6e4,Sz=3e5,Ez=200,CN={active:1,idle:2,deep_sleep:5,hidden:10},NN=["mousemove","mousedown","keydown","scroll","touchstart"],eD=j.createContext(void 0);function Cz({children:e}){const[t,n]=j.useState("active"),r=j.useRef(null),a=j.useRef(null),i=j.useRef(Date.now()),l=j.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),o=j.useCallback(()=>{l(),r.current=setTimeout(()=>{n("idle"),a.current=setTimeout(()=>{n("deep_sleep")},Sz-EN)},EN)},[l]),f=j.useCallback(()=>{const h=Date.now();h-i.current<Ez||(i.current=h,n("active"),o())},[o]),c=j.useCallback(()=>{document.hidden?(l(),n("hidden")):(n("active"),i.current=Date.now(),o())},[l,o]);return j.useEffect(()=>{o();for(const h of NN)document.addEventListener(h,f,{passive:!0});return document.addEventListener("visibilitychange",c),()=>{l();for(const h of NN)document.removeEventListener(h,f);document.removeEventListener("visibilitychange",c)}},[f,c,o,l]),d.jsx(eD.Provider,{value:{powerState:t},children:e})}function Nz(){const e=j.useContext(eD);if(!e)throw new Error("usePowerState must be used within a PowerProvider");return e.powerState}/**
|
|
61
|
+
* @license lucide-react v0.460.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const kz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tD=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.460.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var Tz={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"};/**
|
|
71
|
+
* @license lucide-react v0.460.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const jz=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...o},f)=>j.createElement("svg",{ref:f,...Tz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tD("lucide",a),...o},[...l.map(([c,h])=>j.createElement(c,h)),...Array.isArray(i)?i:[i]]));/**
|
|
76
|
+
* @license lucide-react v0.460.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Ie=(e,t)=>{const n=j.forwardRef(({className:r,...a},i)=>j.createElement(jz,{ref:i,iconNode:t,className:tD(`lucide-${kz(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
|
|
81
|
+
* @license lucide-react v0.460.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const kb=Ie("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"}]]);/**
|
|
86
|
+
* @license lucide-react v0.460.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const nD=Ie("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
91
|
+
* @license lucide-react v0.460.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const yi=Ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
96
|
+
* @license lucide-react v0.460.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const Tb=Ie("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
101
|
+
* @license lucide-react v0.460.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const vp=Ie("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"}]]);/**
|
|
106
|
+
* @license lucide-react v0.460.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const Az=Ie("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
111
|
+
* @license lucide-react v0.460.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const Rd=Ie("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
116
|
+
* @license lucide-react v0.460.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const Dd=Ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
121
|
+
* @license lucide-react v0.460.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const $a=Ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
126
|
+
* @license lucide-react v0.460.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const P1=Ie("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
131
|
+
* @license lucide-react v0.460.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const da=Ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
136
|
+
* @license lucide-react v0.460.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const Rz=Ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
141
|
+
* @license lucide-react v0.460.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const Mr=Ie("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"}]]);/**
|
|
146
|
+
* @license lucide-react v0.460.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const jb=Ie("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
151
|
+
* @license lucide-react v0.460.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const kN=Ie("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
156
|
+
* @license lucide-react v0.460.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const vc=Ie("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
161
|
+
* @license lucide-react v0.460.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const Dz=Ie("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"}]]);/**
|
|
166
|
+
* @license lucide-react v0.460.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const zu=Ie("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"}]]);/**
|
|
171
|
+
* @license lucide-react v0.460.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const Mz=Ie("ClipboardList",[["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:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
176
|
+
* @license lucide-react v0.460.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const rD=Ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
181
|
+
* @license lucide-react v0.460.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const _z=Ie("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
186
|
+
* @license lucide-react v0.460.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const B1=Ie("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"}]]);/**
|
|
191
|
+
* @license lucide-react v0.460.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const aD=Ie("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"}]]);/**
|
|
196
|
+
* @license lucide-react v0.460.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const Oz=Ie("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"}]]);/**
|
|
201
|
+
* @license lucide-react v0.460.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const Lz=Ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
206
|
+
* @license lucide-react v0.460.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const Gp=Ie("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"}]]);/**
|
|
211
|
+
* @license lucide-react v0.460.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const Pz=Ie("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
216
|
+
* @license lucide-react v0.460.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const Bz=Ie("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
221
|
+
* @license lucide-react v0.460.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const zz=Ie("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"}]]);/**
|
|
226
|
+
* @license lucide-react v0.460.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const Iz=Ie("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
|
231
|
+
* @license lucide-react v0.460.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const Fz=Ie("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
236
|
+
* @license lucide-react v0.460.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const Uz=Ie("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
241
|
+
* @license lucide-react v0.460.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const z1=Ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
246
|
+
* @license lucide-react v0.460.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const qz=Ie("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"}]]);/**
|
|
251
|
+
* @license lucide-react v0.460.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const Vz=Ie("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
256
|
+
* @license lucide-react v0.460.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const Hz=Ie("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
261
|
+
* @license lucide-react v0.460.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const jn=Ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
266
|
+
* @license lucide-react v0.460.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const Gz=Ie("MailCheck",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]);/**
|
|
271
|
+
* @license lucide-react v0.460.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const $z=Ie("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
276
|
+
* @license lucide-react v0.460.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const $p=Ie("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"}]]);/**
|
|
281
|
+
* @license lucide-react v0.460.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const Kz=Ie("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
286
|
+
* @license lucide-react v0.460.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const iD=Ie("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
291
|
+
* @license lucide-react v0.460.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const Yz=Ie("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
296
|
+
* @license lucide-react v0.460.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const sD=Ie("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
301
|
+
* @license lucide-react v0.460.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const I1=Ie("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"}]]);/**
|
|
306
|
+
* @license lucide-react v0.460.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const is=Ie("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
311
|
+
* @license lucide-react v0.460.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const Xz=Ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
316
|
+
* @license lucide-react v0.460.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const lD=Ie("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
321
|
+
* @license lucide-react v0.460.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const gl=Ie("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"}]]);/**
|
|
326
|
+
* @license lucide-react v0.460.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const Kp=Ie("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"}]]);/**
|
|
331
|
+
* @license lucide-react v0.460.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const oD=Ie("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
336
|
+
* @license lucide-react v0.460.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const pc=Ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
341
|
+
* @license lucide-react v0.460.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const Qz=Ie("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"}]]);/**
|
|
346
|
+
* @license lucide-react v0.460.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const Wz=Ie("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
351
|
+
* @license lucide-react v0.460.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const Zz=Ie("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"}]]);/**
|
|
356
|
+
* @license lucide-react v0.460.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const Jz=Ie("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"}]]);/**
|
|
361
|
+
* @license lucide-react v0.460.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const F1=Ie("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"}]]);/**
|
|
366
|
+
* @license lucide-react v0.460.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const eI=Ie("Sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);/**
|
|
371
|
+
* @license lucide-react v0.460.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const tI=Ie("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
376
|
+
* @license lucide-react v0.460.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const nI=Ie("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
381
|
+
* @license lucide-react v0.460.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const rI=Ie("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
386
|
+
* @license lucide-react v0.460.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const ss=Ie("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"}]]);/**
|
|
391
|
+
* @license lucide-react v0.460.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const uD=Ie("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"}]]);/**
|
|
396
|
+
* @license lucide-react v0.460.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const aI=Ie("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
|
|
401
|
+
* @license lucide-react v0.460.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const iI=Ie("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"}]]);/**
|
|
406
|
+
* @license lucide-react v0.460.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const sI=Ie("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"}]]);/**
|
|
411
|
+
* @license lucide-react v0.460.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const lI=Ie("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"}]]);/**
|
|
416
|
+
* @license lucide-react v0.460.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const cD=Ie("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"}]]);/**
|
|
421
|
+
* @license lucide-react v0.460.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const kl=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
426
|
+
* @license lucide-react v0.460.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const oI=Ie("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"}]]),uI=6e4,cI=3e4;function fI(e,t,n){if(t==="heartbeat"){const r=e*CN[n];return n==="hidden"?Math.min(r,uI):n==="deep_sleep"?Math.min(r,cI):r}return n==="deep_sleep"||n==="hidden"?!1:e*CN[n]}function Qr(e){const t=Nz(),{pollCategory:n,refetchInterval:r,...a}=e,i=fI(r,n,t);return qt({...a,refetchInterval:i})}const dI="/api";async function lt(e,t){var l;const n=(l=t==null?void 0:t.method)==null?void 0:l.toUpperCase(),a=n==="POST"||n==="PUT"?{"Content-Type":"application/json",...t==null?void 0:t.headers}:t==null?void 0:t.headers,i=await fetch(`${dI}${e}`,{...t,headers:a});if(!i.ok){const o=await i.json().catch(()=>({}));throw new fD(i.status,o)}return i.json()}async function Qt(e,t){return lt(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function mc(e,t){return lt(e,{method:"PUT",body:JSON.stringify(t)})}async function U1(e){return lt(e,{method:"DELETE"})}class fD extends Error{constructor(t,n){const r=typeof n=="object"&&n!==null&&"error"in n?String(n.error):null;super(r?`${r} (API ${t})`:`API error ${t}`),this.status=t,this.body=n}}const Sr={HEALTH:5e3,STATS:1e4,LOGS:3e3,UPDATE:3e5},hI=1e4,vI=3e4,pI=["debug","info","warn","error"],pp={debug:0,info:1,warn:2,error:3},mI="built-in",q1="user",gI=["stable","beta"],Yr=50,Ab=5,dD=5e3,hD=3;function vD(e){switch(e){case"info":return"default";case"warn":return"warning";case"error":return"destructive";default:return"secondary"}}function V1(e){switch(e){case"info":return"bg-primary";case"debug":return"bg-outline";case"warn":return"bg-secondary";case"error":return"bg-tertiary";default:return"bg-outline"}}const H1=["update-status"];function pD(){return Qr({queryKey:[...H1],queryFn:({signal:e})=>lt("/update/status",{signal:e}),refetchInterval:Sr.UPDATE,pollCategory:"standard"})}function yI(){const e=Sn();return fr({mutationFn:()=>Qt("/update/check"),onSuccess:()=>{e.invalidateQueries({queryKey:[...H1]})}})}function xI(){return fr({mutationFn:()=>Qt("/update/apply")})}function bI(){const e=Sn();return fr({mutationFn:t=>mc("/update/channel",{channel:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[...H1]})}})}function Yp(){return Qr({queryKey:["daemon-stats"],queryFn:({signal:e})=>lt("/stats",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}const ex=500,wI=3e4;function G1(){const[e,t]=j.useState(!1),n=j.useRef(null);return{restart:j.useCallback(async(a=!1)=>{t(!0);try{const i=await Qt("/restart",{force:a});if(i.status==="busy")return t(!1),i;const l=Date.now()+wI;n.current=new AbortController,await new Promise((o,f)=>{const c=async()=>{if(Date.now()>l){f(new Error("Restart timeout"));return}try{if((await fetch("/health",{signal:n.current.signal})).ok){o();return}setTimeout(c,ex)}catch{setTimeout(c,ex)}};setTimeout(c,ex)}),window.location.reload()}catch(i){throw t(!1),i}},[]),isRestarting:e}}function mD(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=mD(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gD(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=mD(e))&&(r&&(r+=" "),r+=t);return r}const TN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jN=gD,Xp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return jN(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,l=Object.keys(a).map(c=>{const h=n==null?void 0:n[c],p=i==null?void 0:i[c];if(h===null)return null;const m=TN(h)||TN(p);return a[c][m]}),o=n&&Object.entries(n).reduce((c,h)=>{let[p,m]=h;return m===void 0||(c[p]=m),c},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,h)=>{let{class:p,className:m,...y}=h;return Object.entries(y).every(x=>{let[b,w]=x;return Array.isArray(w)?w.includes({...i,...o}[b]):{...i,...o}[b]===w})?[...c,p,m]:c},[]);return jN(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},$1="-",SI=e=>{const t=CI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const o=l.split($1);return o[0]===""&&o.length!==1&&o.shift(),yD(o,t)||EI(l)},getConflictingClassGroupIds:(l,o)=>{const f=n[l]||[];return o&&r[l]?[...f,...r[l]]:f}}},yD=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?yD(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join($1);return(l=t.validators.find(({validator:o})=>o(i)))==null?void 0:l.classGroupId},AN=/^\[(.+)\]$/,EI=e=>{if(AN.test(e)){const t=AN.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},CI=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return kI(Object.entries(e.classGroups),n).forEach(([i,l])=>{Rb(l,r,i,t)}),r},Rb=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:RN(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(NI(a)){Rb(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,l])=>{Rb(l,RN(t,i),n,r)})})},RN=(e,t)=>{let n=e;return t.split($1).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},NI=e=>e.isThemeGetter,kI=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,o])=>[t+l,o])):i);return[n,a]}):e,TI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,l)=>{n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return a(i,l),l},set(i,l){n.has(i)?n.set(i,l):a(i,l)}}},xD="!",jI=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,l=o=>{const f=[];let c=0,h=0,p;for(let w=0;w<o.length;w++){let S=o[w];if(c===0){if(S===a&&(r||o.slice(w,w+i)===t)){f.push(o.slice(h,w)),h=w+i;continue}if(S==="/"){p=w;continue}}S==="["?c++:S==="]"&&c--}const m=f.length===0?o:o.substring(h),y=m.startsWith(xD),x=y?m.substring(1):m,b=p&&p>h?p-h:void 0;return{modifiers:f,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:b}};return n?o=>n({className:o,parseClassName:l}):l},AI=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},RI=e=>({cache:TI(e.cacheSize),parseClassName:jI(e),...SI(e)}),DI=/\s+/,MI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],l=e.trim().split(DI);let o="";for(let f=l.length-1;f>=0;f-=1){const c=l[f],{modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}=n(c);let x=!!y,b=r(x?m.substring(0,y):m);if(!b){if(!x){o=c+(o.length>0?" "+o:o);continue}if(b=r(m),!b){o=c+(o.length>0?" "+o:o);continue}x=!1}const w=AI(h).join(":"),S=p?w+xD:w,N=S+b;if(i.includes(N))continue;i.push(N);const E=a(b,x);for(let T=0;T<E.length;++T){const R=E[T];i.push(S+R)}o=c+(o.length>0?" "+o:o)}return o};function _I(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=bD(t))&&(r&&(r+=" "),r+=n);return r}const bD=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=bD(e[r]))&&(n&&(n+=" "),n+=t);return n};function OI(e,...t){let n,r,a,i=l;function l(f){const c=t.reduce((h,p)=>p(h),e());return n=RI(c),r=n.cache.get,a=n.cache.set,i=o,o(f)}function o(f){const c=r(f);if(c)return c;const h=MI(f,n);return a(f,h),h}return function(){return i(_I.apply(null,arguments))}}const ln=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wD=/^\[(?:([a-z-]+):)?(.+)\]$/i,LI=/^\d+\/\d+$/,PI=new Set(["px","full","screen"]),BI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zI=/\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$/,II=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,FI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,UI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gi=e=>Iu(e)||PI.has(e)||LI.test(e),Vs=e=>gc(e,"length",XI),Iu=e=>!!e&&!Number.isNaN(Number(e)),tx=e=>gc(e,"number",Iu),kf=e=>!!e&&Number.isInteger(Number(e)),qI=e=>e.endsWith("%")&&Iu(e.slice(0,-1)),gt=e=>wD.test(e),Hs=e=>BI.test(e),VI=new Set(["length","size","percentage"]),HI=e=>gc(e,VI,SD),GI=e=>gc(e,"position",SD),$I=new Set(["image","url"]),KI=e=>gc(e,$I,WI),YI=e=>gc(e,"",QI),Tf=()=>!0,gc=(e,t,n)=>{const r=wD.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},XI=e=>zI.test(e)&&!II.test(e),SD=()=>!1,QI=e=>FI.test(e),WI=e=>UI.test(e),ZI=()=>{const e=ln("colors"),t=ln("spacing"),n=ln("blur"),r=ln("brightness"),a=ln("borderColor"),i=ln("borderRadius"),l=ln("borderSpacing"),o=ln("borderWidth"),f=ln("contrast"),c=ln("grayscale"),h=ln("hueRotate"),p=ln("invert"),m=ln("gap"),y=ln("gradientColorStops"),x=ln("gradientColorStopPositions"),b=ln("inset"),w=ln("margin"),S=ln("opacity"),N=ln("padding"),E=ln("saturate"),T=ln("scale"),R=ln("sepia"),A=ln("skew"),D=ln("space"),_=ln("translate"),L=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",gt,t],B=()=>[gt,t],H=()=>["",Gi,Vs],G=()=>["auto",Iu,gt],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",gt],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[Iu,gt];return{cacheSize:500,separator:":",theme:{colors:[Tf],spacing:[Gi,Vs],blur:["none","",Hs,gt],brightness:q(),borderColor:[e],borderRadius:["none","","full",Hs,gt],borderSpacing:B(),borderWidth:H(),contrast:q(),grayscale:Q(),hueRotate:q(),invert:Q(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[qI,Vs],inset:z(),margin:z(),opacity:q(),padding:B(),saturate:q(),scale:q(),sepia:Q(),skew:q(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",gt]}],container:["container"],columns:[{columns:[Hs]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...U(),gt]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",kf,gt]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",gt]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",kf,gt]}],"grid-cols":[{"grid-cols":[Tf]}],"col-start-end":[{col:["auto",{span:["full",kf,gt]},gt]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[Tf]}],"row-start-end":[{row:["auto",{span:[kf,gt]},gt]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gt]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",gt,t]}],"min-w":[{"min-w":[gt,t,"min","max","fit"]}],"max-w":[{"max-w":[gt,t,"none","full","min","max","fit","prose",{screen:[Hs]},Hs]}],h:[{h:[gt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hs,Vs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",tx]}],"font-family":[{font:[Tf]}],"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",gt]}],"line-clamp":[{"line-clamp":["none",Iu,tx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gi,gt]}],"list-image":[{"list-image":["none",gt]}],"list-style-type":[{list:["none","disc","decimal",gt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gi,Vs]}],"underline-offset":[{"underline-offset":["auto",Gi,gt]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gt]}],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",gt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),GI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",HI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},KI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[S]}],"border-style":[{border:[...I(),"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":[S]}],"divide-style":[{divide:I()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Gi,gt]}],"outline-w":[{outline:[Gi,Vs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Gi,Vs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hs,YI]}],"shadow-color":[{shadow:[Tf]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Hs,gt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[E]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",gt]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",gt]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",gt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[kf,gt]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",gt]}],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",gt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",gt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Gi,Vs,tx]}],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"]}}},JI=OI(ZI);function ke(...e){return JI(gD(e))}const e6=Xp("inline-flex items-center justify-center whitespace-nowrap rounded-md font-sans text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-gradient-to-br from-primary to-primary-container text-on-primary shadow-sm hover:shadow-[0_0_0_1px_rgba(171,207,184,0.4)]",destructive:"bg-gradient-to-br from-tertiary to-tertiary-container text-on-surface shadow-sm hover:shadow-[0_0_0_1px_rgba(255,180,161,0.4)]",outline:"border border-[var(--ghost-border)] bg-transparent shadow-sm hover:bg-surface-container-high hover:text-on-surface",secondary:"border border-outline-variant/20 bg-transparent hover:bg-surface-container-high text-on-surface",ghost:"hover:bg-surface-container-high text-on-surface-variant hover:text-on-surface",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ae=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>d.jsx("button",{className:ke(e6({variant:t,size:n,className:e})),ref:a,...r}));Ae.displayName="Button";function nn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function DN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ED(...e){return t=>{let n=!1;const r=e.map(a=>{const i=DN(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():DN(e[a],null)}}}}function An(...e){return j.useCallback(ED(...e),e)}function t6(e,t){const n=j.createContext(t),r=i=>{const{children:l,...o}=i,f=j.useMemo(()=>o,Object.values(o));return d.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function a(i){const l=j.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function Qp(e,t=[]){let n=[];function r(i,l){const o=j.createContext(l),f=n.length;n=[...n,l];const c=p=>{var S;const{scope:m,children:y,...x}=p,b=((S=m==null?void 0:m[e])==null?void 0:S[f])||o,w=j.useMemo(()=>x,Object.values(x));return d.jsx(b.Provider,{value:w,children:y})};c.displayName=i+"Provider";function h(p,m){var b;const y=((b=m==null?void 0:m[e])==null?void 0:b[f])||o,x=j.useContext(y);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[c,h]}const a=()=>{const i=n.map(l=>j.createContext(l));return function(o){const f=(o==null?void 0:o[e])||i;return j.useMemo(()=>({[`__scope${e}`]:{...o,[e]:f}}),[o,f])}};return a.scopeName=e,[r,n6(a,...t)]}function n6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((o,{useScope:f,scopeName:c})=>{const p=f(i)[`__scope${c}`];return{...o,...p}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var xr=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},r6=mR[" useId ".trim().toString()]||(()=>{}),a6=0;function Fu(e){const[t,n]=j.useState(r6());return xr(()=>{n(r=>r??String(a6++))},[e]),t?`radix-${t}`:""}var i6=mR[" useInsertionEffect ".trim().toString()]||xr;function mp({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,l]=s6({defaultProp:t,onChange:n}),o=e!==void 0,f=o?e:a;{const h=j.useRef(e!==void 0);j.useEffect(()=>{const p=h.current;p!==o&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=o},[o,r])}const c=j.useCallback(h=>{var p;if(o){const m=l6(h)?h(e):h;m!==e&&((p=l.current)==null||p.call(l,m))}else i(h)},[o,e,i,l]);return[f,c]}function s6({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),a=j.useRef(n),i=j.useRef(t);return i6(()=>{i.current=t},[t]),j.useEffect(()=>{var l;a.current!==n&&((l=i.current)==null||l.call(i,n),a.current=n)},[n,a]),[n,r,i]}function l6(e){return typeof e=="function"}function sd(e){const t=o6(e),n=j.forwardRef((r,a)=>{const{children:i,...l}=r,o=j.Children.toArray(i),f=o.find(c6);if(f){const c=f.props.children,h=o.map(p=>p===f?j.Children.count(c)>1?j.Children.only(null):j.isValidElement(c)?c.props.children:null:p);return d.jsx(t,{...l,ref:a,children:j.isValidElement(c)?j.cloneElement(c,void 0,h):null})}return d.jsx(t,{...l,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function o6(e){const t=j.forwardRef((n,r)=>{const{children:a,...i}=n;if(j.isValidElement(a)){const l=d6(a),o=f6(i,a.props);return a.type!==j.Fragment&&(o.ref=r?ED(r,l):l),j.cloneElement(a,o)}return j.Children.count(a)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var u6=Symbol("radix.slottable");function c6(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===u6}function f6(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...o)=>{const f=i(...o);return a(...o),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function d6(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var h6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jt=h6.reduce((e,t)=>{const n=sd(`Primitive.${t}`),r=j.forwardRef((a,i)=>{const{asChild:l,...o}=a,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(f,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function v6(e,t){e&&Ad.flushSync(()=>e.dispatchEvent(t))}function So(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function p6(e,t=globalThis==null?void 0:globalThis.document){const n=So(e);j.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var m6="DismissableLayer",Db="dismissableLayer.update",g6="dismissableLayer.pointerDownOutside",y6="dismissableLayer.focusOutside",MN,CD=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),K1=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:o,...f}=e,c=j.useContext(CD),[h,p]=j.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=j.useState({}),x=An(t,D=>p(D)),b=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(w),N=h?b.indexOf(h):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,T=N>=S,R=w6(D=>{const _=D.target,L=[...c.branches].some(M=>M.contains(_));!T||L||(a==null||a(D),l==null||l(D),D.defaultPrevented||o==null||o())},m),A=S6(D=>{const _=D.target;[...c.branches].some(M=>M.contains(_))||(i==null||i(D),l==null||l(D),D.defaultPrevented||o==null||o())},m);return p6(D=>{N===c.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&o&&(D.preventDefault(),o()))},m),j.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(MN=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),_N(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=MN)}},[h,m,n,c]),j.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),_N())},[h,c]),j.useEffect(()=>{const D=()=>y({});return document.addEventListener(Db,D),()=>document.removeEventListener(Db,D)},[]),d.jsx(Jt.div,{...f,ref:x,style:{pointerEvents:E?T?"auto":"none":void 0,...e.style},onFocusCapture:nn(e.onFocusCapture,A.onFocusCapture),onBlurCapture:nn(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:nn(e.onPointerDownCapture,R.onPointerDownCapture)})});K1.displayName=m6;var x6="DismissableLayerBranch",b6=j.forwardRef((e,t)=>{const n=j.useContext(CD),r=j.useRef(null),a=An(t,r);return j.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.jsx(Jt.div,{...e,ref:a})});b6.displayName=x6;function w6(e,t=globalThis==null?void 0:globalThis.document){const n=So(e),r=j.useRef(!1),a=j.useRef(()=>{});return j.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let f=function(){ND(g6,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function S6(e,t=globalThis==null?void 0:globalThis.document){const n=So(e),r=j.useRef(!1);return j.useEffect(()=>{const a=i=>{i.target&&!r.current&&ND(y6,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _N(){const e=new CustomEvent(Db);document.dispatchEvent(e)}function ND(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?v6(a,i):a.dispatchEvent(i)}var nx="focusScope.autoFocusOnMount",rx="focusScope.autoFocusOnUnmount",ON={bubbles:!1,cancelable:!0},E6="FocusScope",Y1=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[o,f]=j.useState(null),c=So(a),h=So(i),p=j.useRef(null),m=An(t,b=>f(b)),y=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let b=function(E){if(y.paused||!o)return;const T=E.target;o.contains(T)?p.current=T:Ws(p.current,{select:!0})},w=function(E){if(y.paused||!o)return;const T=E.relatedTarget;T!==null&&(o.contains(T)||Ws(p.current,{select:!0}))},S=function(E){if(document.activeElement===document.body)for(const R of E)R.removedNodes.length>0&&Ws(o)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const N=new MutationObserver(S);return o&&N.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),N.disconnect()}}},[r,o,y.paused]),j.useEffect(()=>{if(o){PN.add(y);const b=document.activeElement;if(!o.contains(b)){const S=new CustomEvent(nx,ON);o.addEventListener(nx,c),o.dispatchEvent(S),S.defaultPrevented||(C6(A6(kD(o)),{select:!0}),document.activeElement===b&&Ws(o))}return()=>{o.removeEventListener(nx,c),setTimeout(()=>{const S=new CustomEvent(rx,ON);o.addEventListener(rx,h),o.dispatchEvent(S),S.defaultPrevented||Ws(b??document.body,{select:!0}),o.removeEventListener(rx,h),PN.remove(y)},0)}}},[o,c,h,y]);const x=j.useCallback(b=>{if(!n&&!r||y.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(w&&S){const N=b.currentTarget,[E,T]=N6(N);E&&T?!b.shiftKey&&S===T?(b.preventDefault(),n&&Ws(E,{select:!0})):b.shiftKey&&S===E&&(b.preventDefault(),n&&Ws(T,{select:!0})):S===N&&b.preventDefault()}},[n,r,y.paused]);return d.jsx(Jt.div,{tabIndex:-1,...l,ref:m,onKeyDown:x})});Y1.displayName=E6;function C6(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ws(r,{select:t}),document.activeElement!==n)return}function N6(e){const t=kD(e),n=LN(t,e),r=LN(t.reverse(),e);return[n,r]}function kD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function LN(e,t){for(const n of e)if(!k6(n,{upTo:t}))return n}function k6(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function T6(e){return e instanceof HTMLInputElement&&"select"in e}function Ws(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&T6(e)&&t&&e.select()}}var PN=j6();function j6(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=BN(e,t),e.unshift(t)},remove(t){var n;e=BN(e,t),(n=e[0])==null||n.resume()}}}function BN(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function A6(e){return e.filter(t=>t.tagName!=="A")}var R6="Portal",X1=j.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[a,i]=j.useState(!1);xr(()=>i(!0),[]);const l=n||a&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return l?fz.createPortal(d.jsx(Jt.div,{...r,ref:t}),l):null});X1.displayName=R6;function D6(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Wp=e=>{const{present:t,children:n}=e,r=M6(t),a=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=An(r.ref,_6(a));return typeof n=="function"||r.isPresent?j.cloneElement(a,{ref:i}):null};Wp.displayName="Presence";function M6(e){const[t,n]=j.useState(),r=j.useRef(null),a=j.useRef(e),i=j.useRef("none"),l=e?"mounted":"unmounted",[o,f]=D6(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const c=mv(r.current);i.current=o==="mounted"?c:"none"},[o]),xr(()=>{const c=r.current,h=a.current;if(h!==e){const m=i.current,y=mv(c);e?f("MOUNT"):y==="none"||(c==null?void 0:c.display)==="none"?f("UNMOUNT"):f(h&&m!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),xr(()=>{if(t){let c;const h=t.ownerDocument.defaultView??window,p=y=>{const b=mv(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&b&&(f("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=y=>{y.target===t&&(i.current=mv(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:j.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function mv(e){return(e==null?void 0:e.animationName)||"none"}function _6(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ax=0;function TD(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zN()),document.body.insertAdjacentElement("beforeend",e[1]??zN()),ax++,()=>{ax===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ax--}},[])}function zN(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var di=function(){return di=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},di.apply(this,arguments)};function jD(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function O6(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Qv="right-scroll-bar-position",Wv="width-before-scroll-bar",L6="with-scroll-bars-hidden",P6="--removed-body-scroll-bar-size";function ix(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function B6(e,t){var n=j.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var z6=typeof window<"u"?j.useLayoutEffect:j.useEffect,IN=new WeakMap;function I6(e,t){var n=B6(null,function(r){return e.forEach(function(a){return ix(a,r)})});return z6(function(){var r=IN.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(o){i.has(o)||ix(o,null)}),i.forEach(function(o){a.has(o)||ix(o,l)})}IN.set(n,e)},[e]),n}function F6(e){return e}function U6(e,t){t===void 0&&(t=F6);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(o){return o!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var o=n;n=[],o.forEach(i),l=n}var f=function(){var h=l;l=[],h.forEach(i)},c=function(){return Promise.resolve().then(f)};c(),n={push:function(h){l.push(h),c()},filter:function(h){return l=l.filter(h),n}}}};return a}function q6(e){e===void 0&&(e={});var t=U6(null);return t.options=di({async:!0,ssr:!1},e),t}var AD=function(e){var t=e.sideCar,n=jD(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return j.createElement(r,di({},n))};AD.isSideCarExport=!0;function V6(e,t){return e.useMedium(t),AD}var RD=q6(),sx=function(){},Zp=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:sx,onWheelCapture:sx,onTouchMoveCapture:sx}),a=r[0],i=r[1],l=e.forwardProps,o=e.children,f=e.className,c=e.removeScrollBar,h=e.enabled,p=e.shards,m=e.sideCar,y=e.noRelative,x=e.noIsolation,b=e.inert,w=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,E=e.gapMode,T=jD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,A=I6([n,t]),D=di(di({},T),a);return j.createElement(j.Fragment,null,h&&j.createElement(R,{sideCar:RD,removeScrollBar:c,shards:p,noRelative:y,noIsolation:x,inert:b,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:E}),l?j.cloneElement(j.Children.only(o),di(di({},D),{ref:A})):j.createElement(N,di({},D,{className:f,ref:A}),o))});Zp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zp.classNames={fullWidth:Wv,zeroRight:Qv};var H6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function G6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=H6();return t&&e.setAttribute("nonce",t),e}function $6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function K6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Y6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=G6())&&($6(t,n),K6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},X6=function(){var e=Y6();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},DD=function(){var e=X6(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Q6={left:0,top:0,right:0,gap:0},lx=function(e){return parseInt(e||"",10)||0},W6=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[lx(n),lx(r),lx(a)]},Z6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Q6;var t=W6(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},J6=DD(),Uu="data-scroll-locked",eF=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
431
|
+
.`.concat(L6,` {
|
|
432
|
+
overflow: hidden `).concat(r,`;
|
|
433
|
+
padding-right: `).concat(o,"px ").concat(r,`;
|
|
434
|
+
}
|
|
435
|
+
body[`).concat(Uu,`] {
|
|
436
|
+
overflow: hidden `).concat(r,`;
|
|
437
|
+
overscroll-behavior: contain;
|
|
438
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
439
|
+
padding-left: `.concat(a,`px;
|
|
440
|
+
padding-top: `).concat(i,`px;
|
|
441
|
+
padding-right: `).concat(l,`px;
|
|
442
|
+
margin-left:0;
|
|
443
|
+
margin-top:0;
|
|
444
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
445
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.`).concat(Qv,` {
|
|
449
|
+
right: `).concat(o,"px ").concat(r,`;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.`).concat(Wv,` {
|
|
453
|
+
margin-right: `).concat(o,"px ").concat(r,`;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.`).concat(Qv," .").concat(Qv,` {
|
|
457
|
+
right: 0 `).concat(r,`;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.`).concat(Wv," .").concat(Wv,` {
|
|
461
|
+
margin-right: 0 `).concat(r,`;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
body[`).concat(Uu,`] {
|
|
465
|
+
`).concat(P6,": ").concat(o,`px;
|
|
466
|
+
}
|
|
467
|
+
`)},FN=function(){var e=parseInt(document.body.getAttribute(Uu)||"0",10);return isFinite(e)?e:0},tF=function(){j.useEffect(function(){return document.body.setAttribute(Uu,(FN()+1).toString()),function(){var e=FN()-1;e<=0?document.body.removeAttribute(Uu):document.body.setAttribute(Uu,e.toString())}},[])},nF=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;tF();var i=j.useMemo(function(){return Z6(a)},[a]);return j.createElement(J6,{styles:eF(i,!t,a,n?"":"!important")})},Mb=!1;if(typeof window<"u")try{var gv=Object.defineProperty({},"passive",{get:function(){return Mb=!0,!0}});window.addEventListener("test",gv,gv),window.removeEventListener("test",gv,gv)}catch{Mb=!1}var yu=Mb?{passive:!1}:!1,rF=function(e){return e.tagName==="TEXTAREA"},MD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!rF(e)&&n[t]==="visible")},aF=function(e){return MD(e,"overflowY")},iF=function(e){return MD(e,"overflowX")},UN=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=_D(e,r);if(a){var i=OD(e,r),l=i[1],o=i[2];if(l>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sF=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},lF=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_D=function(e,t){return e==="v"?aF(t):iF(t)},OD=function(e,t){return e==="v"?sF(t):lF(t)},oF=function(e,t){return e==="h"&&t==="rtl"?-1:1},uF=function(e,t,n,r,a){var i=oF(e,window.getComputedStyle(t).direction),l=i*r,o=n.target,f=t.contains(o),c=!1,h=l>0,p=0,m=0;do{if(!o)break;var y=OD(e,o),x=y[0],b=y[1],w=y[2],S=b-w-i*x;(x||S)&&_D(e,o)&&(p+=S,m+=x);var N=o.parentNode;o=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!f&&o!==document.body||f&&(t.contains(o)||t===o));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(c=!0),c},yv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qN=function(e){return[e.deltaX,e.deltaY]},VN=function(e){return e&&"current"in e?e.current:e},cF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fF=function(e){return`
|
|
468
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
469
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
470
|
+
`)},dF=0,xu=[];function hF(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),a=j.useState(dF++)[0],i=j.useState(DD)[0],l=j.useRef(e);j.useEffect(function(){l.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=O6([e.lockRef.current],(e.shards||[]).map(VN),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var o=j.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var S=yv(b),N=n.current,E="deltaX"in b?b.deltaX:N[0]-S[0],T="deltaY"in b?b.deltaY:N[1]-S[1],R,A=b.target,D=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in b&&D==="h"&&A.type==="range")return!1;var _=window.getSelection(),L=_&&_.anchorNode,M=L?L===A||L.contains(A):!1;if(M)return!1;var z=UN(D,A);if(!z)return!0;if(z?R=D:(R=D==="v"?"h":"v",z=UN(D,A)),!z)return!1;if(!r.current&&"changedTouches"in b&&(E||T)&&(r.current=R),!R)return!0;var B=r.current||R;return uF(B,w,b,B==="h"?E:T)},[]),f=j.useCallback(function(b){var w=b;if(!(!xu.length||xu[xu.length-1]!==i)){var S="deltaY"in w?qN(w):yv(w),N=t.current.filter(function(R){return R.name===w.type&&(R.target===w.target||w.target===R.shadowParent)&&cF(R.delta,S)})[0];if(N&&N.should){w.cancelable&&w.preventDefault();return}if(!N){var E=(l.current.shards||[]).map(VN).filter(Boolean).filter(function(R){return R.contains(w.target)}),T=E.length>0?o(w,E[0]):!l.current.noIsolation;T&&w.cancelable&&w.preventDefault()}}},[]),c=j.useCallback(function(b,w,S,N){var E={name:b,delta:w,target:S,should:N,shadowParent:vF(S)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),h=j.useCallback(function(b){n.current=yv(b),r.current=void 0},[]),p=j.useCallback(function(b){c(b.type,qN(b),b.target,o(b,e.lockRef.current))},[]),m=j.useCallback(function(b){c(b.type,yv(b),b.target,o(b,e.lockRef.current))},[]);j.useEffect(function(){return xu.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",f,yu),document.addEventListener("touchmove",f,yu),document.addEventListener("touchstart",h,yu),function(){xu=xu.filter(function(b){return b!==i}),document.removeEventListener("wheel",f,yu),document.removeEventListener("touchmove",f,yu),document.removeEventListener("touchstart",h,yu)}},[]);var y=e.removeScrollBar,x=e.inert;return j.createElement(j.Fragment,null,x?j.createElement(i,{styles:fF(a)}):null,y?j.createElement(nF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pF=V6(RD,hF);var Q1=j.forwardRef(function(e,t){return j.createElement(Zp,di({},e,{ref:t,sideCar:pF}))});Q1.classNames=Zp.classNames;var mF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bu=new WeakMap,xv=new WeakMap,bv={},ox=0,LD=function(e){return e&&(e.host||LD(e.parentNode))},gF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=LD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},yF=function(e,t,n,r){var a=gF(t,Array.isArray(e)?e:[e]);bv[n]||(bv[n]=new WeakMap);var i=bv[n],l=[],o=new Set,f=new Set(a),c=function(p){!p||o.has(p)||(o.add(p),c(p.parentNode))};a.forEach(c);var h=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(m){if(o.has(m))h(m);else try{var y=m.getAttribute(r),x=y!==null&&y!=="false",b=(bu.get(m)||0)+1,w=(i.get(m)||0)+1;bu.set(m,b),i.set(m,w),l.push(m),b===1&&x&&xv.set(m,!0),w===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return h(t),o.clear(),ox++,function(){l.forEach(function(p){var m=bu.get(p)-1,y=i.get(p)-1;bu.set(p,m),i.set(p,y),m||(xv.has(p)||p.removeAttribute(r),xv.delete(p)),y||p.removeAttribute(n)}),ox--,ox||(bu=new WeakMap,bu=new WeakMap,xv=new WeakMap,bv={})}},PD=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=mF(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),yF(r,a,n,"aria-hidden")):function(){return null}},Jp="Dialog",[BD]=Qp(Jp),[xF,Za]=BD(Jp),zD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,o=j.useRef(null),f=j.useRef(null),[c,h]=mp({prop:r,defaultProp:a??!1,onChange:i,caller:Jp});return d.jsx(xF,{scope:t,triggerRef:o,contentRef:f,contentId:Fu(),titleId:Fu(),descriptionId:Fu(),open:c,onOpenChange:h,onOpenToggle:j.useCallback(()=>h(p=>!p),[h]),modal:l,children:n})};zD.displayName=Jp;var ID="DialogTrigger",FD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Za(ID,n),i=An(t,a.triggerRef);return d.jsx(Jt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":J1(a.open),...r,ref:i,onClick:nn(e.onClick,a.onOpenToggle)})});FD.displayName=ID;var W1="DialogPortal",[bF,UD]=BD(W1,{forceMount:void 0}),qD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Za(W1,t);return d.jsx(bF,{scope:t,forceMount:n,children:j.Children.map(r,l=>d.jsx(Wp,{present:n||i.open,children:d.jsx(X1,{asChild:!0,container:a,children:l})}))})};qD.displayName=W1;var gp="DialogOverlay",VD=j.forwardRef((e,t)=>{const n=UD(gp,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Za(gp,e.__scopeDialog);return i.modal?d.jsx(Wp,{present:r||i.open,children:d.jsx(SF,{...a,ref:t})}):null});VD.displayName=gp;var wF=sd("DialogOverlay.RemoveScroll"),SF=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Za(gp,n);return d.jsx(Q1,{as:wF,allowPinchZoom:!0,shards:[a.contentRef],children:d.jsx(Jt.div,{"data-state":J1(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Eo="DialogContent",HD=j.forwardRef((e,t)=>{const n=UD(Eo,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Za(Eo,e.__scopeDialog);return d.jsx(Wp,{present:r||i.open,children:i.modal?d.jsx(EF,{...a,ref:t}):d.jsx(CF,{...a,ref:t})})});HD.displayName=Eo;var EF=j.forwardRef((e,t)=>{const n=Za(Eo,e.__scopeDialog),r=j.useRef(null),a=An(t,n.contentRef,r);return j.useEffect(()=>{const i=r.current;if(i)return PD(i)},[]),d.jsx(GD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nn(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:nn(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,o=l.button===0&&l.ctrlKey===!0;(l.button===2||o)&&i.preventDefault()}),onFocusOutside:nn(e.onFocusOutside,i=>i.preventDefault())})}),CF=j.forwardRef((e,t)=>{const n=Za(Eo,e.__scopeDialog),r=j.useRef(!1),a=j.useRef(!1);return d.jsx(GD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,o;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var f,c;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),GD=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,o=Za(Eo,n),f=j.useRef(null),c=An(t,f);return TD(),d.jsxs(d.Fragment,{children:[d.jsx(Y1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:d.jsx(K1,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":J1(o.open),...l,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(NF,{titleId:o.titleId}),d.jsx(TF,{contentRef:f,descriptionId:o.descriptionId})]})]})}),Z1="DialogTitle",$D=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Za(Z1,n);return d.jsx(Jt.h2,{id:a.titleId,...r,ref:t})});$D.displayName=Z1;var KD="DialogDescription",YD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Za(KD,n);return d.jsx(Jt.p,{id:a.descriptionId,...r,ref:t})});YD.displayName=KD;var XD="DialogClose",QD=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Za(XD,n);return d.jsx(Jt.button,{type:"button",...r,ref:t,onClick:nn(e.onClick,()=>a.onOpenChange(!1))})});QD.displayName=XD;function J1(e){return e?"open":"closed"}var WD="DialogTitleWarning",[Sie,ZD]=t6(WD,{contentName:Eo,titleName:Z1,docsSlug:"dialog"}),NF=({titleId:e})=>{const t=ZD(WD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
471
|
+
|
|
472
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
473
|
+
|
|
474
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},kF="DialogDescriptionWarning",TF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ZD(kF).contentName}}.`;return j.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},jF=zD,AF=FD,RF=qD,JD=VD,eM=HD,tM=$D,nM=YD,DF=QD;const Md=jF,MF=AF,_F=RF,rM=j.forwardRef(({className:e,...t},n)=>d.jsx(JD,{ref:n,className:ke("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));rM.displayName=JD.displayName;const yc=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(_F,{children:[d.jsx(rM,{}),d.jsxs(eM,{ref:r,className:ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 [&>*]:min-w-0 border-0 bg-surface-container-highest p-6 shadow-ambient duration-200 sm:rounded-lg",e),...n,children:[t,d.jsxs(DF,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(kl,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yc.displayName=eM.displayName;function _d({className:e,...t}){return d.jsx("div",{className:ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}_d.displayName="DialogHeader";function em({className:e,...t}){return d.jsx("div",{className:ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}em.displayName="DialogFooter";const xc=j.forwardRef(({className:e,...t},n)=>d.jsx(tM,{ref:n,className:ke("text-lg font-serif font-semibold leading-none tracking-tight",e),...t}));xc.displayName=tM.displayName;const tm=j.forwardRef(({className:e,...t},n)=>d.jsx(nM,{ref:n,className:ke("text-sm text-on-surface-variant",e),...t}));tm.displayName=nM.displayName;const fn=j.forwardRef(({className:e,type:t,...n},r)=>d.jsx("input",{type:t,className:ke("flex h-9 w-full rounded-md bg-surface-container-lowest border border-[var(--ghost-border)] px-3 py-1 font-sans text-sm text-on-surface shadow-none transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-on-surface","placeholder:text-on-surface-variant/50","focus-visible:outline-none focus-visible:border-primary/40","disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));fn.displayName="Input";var aM="Toggle",iM=j.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:a,...i}=e,[l,o]=mp({prop:n,onChange:a,defaultProp:r??!1,caller:aM});return d.jsx(Jt.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:nn(e.onClick,()=>{e.disabled||o(!l)})})});iM.displayName=aM;var sM=iM;const OF=Xp("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-surface-container-high/80 hover:text-on-surface-variant focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-on-primary",{variants:{variant:{default:"bg-surface-container-high text-on-surface-variant",outline:"border border-input bg-surface-container-high text-on-surface-variant shadow-sm hover:bg-surface-container-high/80 hover:text-on-surface-variant"},size:{default:"h-9 px-3",sm:"h-8 px-2",lg:"h-10 px-3"}},defaultVariants:{variant:"default",size:"default"}}),_b=j.forwardRef(({className:e,variant:t,size:n,...r},a)=>d.jsx(sM,{ref:a,className:ke(OF({variant:t,size:n,className:e})),...r}));_b.displayName=sM.displayName;const LF=Xp("inline-flex items-center rounded-sm px-2 py-0.5 font-sans text-xs font-medium transition-colors",{variants:{variant:{default:"bg-primary/15 text-primary",secondary:"bg-surface-container-high text-on-surface-variant",destructive:"bg-tertiary/15 text-tertiary",warning:"bg-secondary/15 text-secondary",outline:"border border-[var(--ghost-border)] text-on-surface-variant"}},defaultVariants:{variant:"default"}});function xt({className:e,variant:t,...n}){return d.jsx("div",{className:ke(LF({variant:t}),e),...n})}const PF=120,BF={session:{label:"Sessions",icon:$p},spore:{label:"Spores",icon:F1},plan:{label:"Plans",icon:Mz},prompt_batch:{label:"Prompt Batches",icon:kb},activity:{label:"Activities",icon:kb}};function lM(e){return BF[e]??{label:e,icon:zz}}function zF(e,t){return e.length<=t?e:e.slice(0,t)+"…"}function IF({score:e}){const t=Math.round(e*100);return d.jsxs(xt,{variant:"outline",className:"shrink-0 text-xs tabular-nums text-on-surface-variant",children:[t,"%"]})}function FF({result:e,onSelect:t,isHighlighted:n}){const{icon:r}=lM(e.type);return d.jsxs("button",{type:"button",onClick:()=>t(e),className:["w-full flex items-start gap-3 px-3 py-2 text-left rounded-md transition-colors",n?"bg-surface-container-high text-on-surface":"hover:bg-surface-container-high hover:text-on-surface"].join(" "),children:[d.jsx(r,{className:"h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("span",{className:"text-sm font-medium truncate",children:e.title})}),e.preview&&d.jsx("p",{className:"text-xs text-on-surface-variant mt-0.5 line-clamp-2",children:zF(e.preview,PF)})]}),d.jsx(IF,{score:e.score})]})}function UF({results:e,onSelect:t,highlightedIndex:n}){const r=e.reduce((i,l)=>{const o=l.type??"unknown";return(i[o]??(i[o]=[])).push(l),i},{});let a=0;return d.jsx("div",{className:"py-2 space-y-1",children:Object.entries(r).map(([i,l])=>{const{label:o}=lM(i),f=a;return a+=l.length,d.jsxs("div",{children:[d.jsx("div",{className:"px-3 py-1",children:d.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-on-surface-variant",children:o})}),l.map((c,h)=>d.jsx(FF,{result:c,onSelect:t,isHighlighted:n===f+h},c.id))]},i)})})}const qF=2,VF=3e4;function HF(e,t="semantic"){return qt({queryKey:["search",e,t],queryFn:({signal:n})=>lt(`/search?q=${encodeURIComponent(e)}&mode=${t}`,{signal:n}),enabled:e.length>qF,staleTime:VF})}const GF=300,$F=20;function KF(e){switch(e.type){case"session":return`/sessions/${e.id}`;case"spore":return`/mycelium?tab=spores&spore=${encodeURIComponent(e.id)}`;case"plan":return e.session_id?`/sessions/${e.session_id}?tab=plans&plan=${encodeURIComponent(e.id)}`:"/sessions";case"prompt_batch":return e.session_id?`/sessions/${e.session_id}`:"/sessions";case"activity":return e.session_id?`/sessions/${e.session_id}`:"/sessions";case"skill":return`/skills?skill=${encodeURIComponent(e.id)}`;default:return"/"}}function YF({open:e,onOpenChange:t}){const n=Wa(),[r,a]=j.useState(""),[i,l]=j.useState(""),[o,f]=j.useState("semantic"),[c,h]=j.useState(0),p=j.useRef(null);j.useEffect(()=>{const E=setTimeout(()=>{l(r.trim())},GF);return()=>clearTimeout(E)},[r]),j.useEffect(()=>{e&&(a(""),l(""),h(0),setTimeout(()=>{var E;return(E=p.current)==null?void 0:E.focus()},50))},[e]);const{data:m,isLoading:y}=HF(i,o),x=((m==null?void 0:m.results)??[]).slice(0,$F);j.useEffect(()=>{h(0)},[x.length,i]);const b=j.useCallback(E=>{const T=KF(E);t(!1),n(T)},[n,t]),w=j.useCallback(E=>{if(x.length!==0){if(E.key==="ArrowDown")E.preventDefault(),h(T=>Math.min(T+1,x.length-1));else if(E.key==="ArrowUp")E.preventDefault(),h(T=>Math.max(T-1,0));else if(E.key==="Enter"){E.preventDefault();const T=x[c];T&&b(T)}}},[x,c,b]),S=i.length>2&&!y&&x.length===0,N=i.length<=2&&!y;return d.jsx(Md,{open:e,onOpenChange:t,children:d.jsxs(yc,{className:"max-w-2xl p-0 gap-0 overflow-hidden",onKeyDown:w,children:[d.jsx(xc,{className:"sr-only",children:"Search vault"}),d.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--ghost-border)] pl-4 pr-12 py-3",children:[d.jsx(pc,{className:"h-4 w-4 shrink-0 text-on-surface-variant"}),d.jsx(fn,{ref:p,value:r,onChange:E=>a(E.target.value),placeholder:"Search sessions, spores, plans…",className:"border-0 shadow-none focus-visible:ring-0 px-0 h-auto text-base bg-surface-bright font-mono"}),d.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[d.jsx(_b,{size:"sm",pressed:o==="semantic",onPressedChange:()=>f("semantic"),"aria-label":"Semantic search",title:"Semantic (embedded knowledge)",children:"Semantic"}),d.jsx(_b,{size:"sm",pressed:o==="fts",onPressedChange:()=>f("fts"),"aria-label":"Full-text search",title:"Full text (raw data)",children:"Full Text"})]})]}),d.jsxs("div",{className:"max-h-96 overflow-y-auto",children:[y&&i.length>2&&d.jsx("div",{className:"px-4 py-8 text-center",children:d.jsxs("div",{className:"flex flex-col items-center gap-2 text-on-surface-variant",children:[d.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),d.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"}),d.jsx("div",{className:"h-3 w-28 rounded bg-muted animate-pulse"})]})}),N&&d.jsx("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:"Type to search your vault…"}),S&&d.jsxs("div",{className:"px-4 py-8 text-center text-sm text-on-surface-variant",children:["No results for ",d.jsxs("span",{className:"font-medium text-on-surface",children:['"',i,'"']})]}),x.length>0&&!y&&d.jsx(UF,{results:x,onSelect:b,highlightedIndex:c})]}),d.jsxs("div",{className:"border-t border-[var(--ghost-border)] px-4 py-2 flex items-center gap-4 text-xs text-on-surface-variant",children:[d.jsxs("span",{children:[d.jsx("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),d.jsxs("span",{children:[d.jsx("kbd",{className:"font-mono",children:"↵"})," open"]}),d.jsxs("span",{children:[d.jsx("kbd",{className:"font-mono",children:"Esc"})," close"]}),d.jsx("span",{className:"ml-auto",children:(m==null?void 0:m.mode)&&x.length>0&&`${x.length} result${x.length!==1?"s":""} · ${m.mode}`})]})]})})}const XF=Sr.STATS;function QF(){return Qr({queryKey:["notifications","unread-count"],queryFn:({signal:e})=>lt("/notifications/unread-count",{signal:e}),refetchInterval:XF,pollCategory:"standard"})}function ew(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.domain&&t.set("domain",e.domain),e!=null&&e.mode&&t.set("mode",e.mode),e!=null&&e.limit&&t.set("limit",String(e.limit));const n=t.toString(),r=n?`/notifications?${n}`:"/notifications";return qt({queryKey:["notifications","list",e],queryFn:({signal:a})=>lt(r,{signal:a})})}function WF(){return qt({queryKey:["notifications","registry"],queryFn:({signal:e})=>lt("/notifications/registry",{signal:e}),staleTime:6e4})}function oM(){const e=Sn();return fr({mutationFn:({id:t,status:n})=>lt(`/notifications/${t}`,{method:"PATCH",body:JSON.stringify({status:n}),headers:{"Content-Type":"application/json"}}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}function ZF(){const e=Sn();return fr({mutationFn:t=>Qt("/notifications/dismiss-all",t?{domain:t}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}function JF(){const e=Sn();return fr({mutationFn:t=>Qt("/notifications/mark-all-read",t?{domain:t}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})}const eU=3,tU=5e3,nU={info:"bg-primary/10 border-primary/20 text-primary",success:"bg-green-500/10 border-green-500/20 text-green-600 dark:text-green-400",warning:"bg-secondary/10 border-secondary/20 text-secondary",error:"bg-tertiary/10 border-tertiary/20 text-tertiary"},rU={info:z1,success:vc,warning:uD,error:Mr};function aU(){const{data:e}=ew({status:"unread",mode:"banner",limit:eU}),t=oM(),n=Wa(),[r,a]=j.useState(new Set),i=((e==null?void 0:e.items)??[]).filter(f=>!r.has(f.id));if(j.useEffect(()=>{const f=[];for(const c of i)f.push(setTimeout(()=>{a(h=>new Set(h).add(c.id)),t.mutate({id:c.id,status:"read"})},tU));return()=>f.forEach(clearTimeout)},[i.map(f=>f.id).join(",")]),i.length===0)return null;const l=f=>{t.mutate({id:f.id,status:"read"}),a(c=>new Set(c).add(f.id)),f.link&&n(f.link)},o=(f,c)=>{f.stopPropagation(),a(h=>new Set(h).add(c.id)),t.mutate({id:c.id,status:"read"})};return d.jsx("div",{className:"fixed top-3 right-3 z-50 flex flex-col gap-2 w-80",children:i.map(f=>{const c=rU[f.level];return d.jsxs("div",{onClick:()=>l(f),className:ke("flex items-start gap-2 rounded-md border px-3 py-2.5 text-sm shadow-lg cursor-pointer transition-all animate-in slide-in-from-right-5 fade-in duration-200",nU[f.level]),children:[d.jsx(c,{className:"h-4 w-4 mt-0.5 shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"font-medium truncate",children:f.title}),f.message&&d.jsx("div",{className:"text-xs mt-0.5 opacity-80 line-clamp-2",children:f.message})]}),d.jsx("button",{onClick:h=>o(h,f),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:d.jsx(kl,{className:"h-3.5 w-3.5"})})]},f.id)})})}function iU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const sU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oU={};function HN(e,t){return(oU.jsx?lU:sU).test(e)}const uU=/[ \t\n\f\r]/g;function cU(e){return typeof e=="object"?e.type==="text"?GN(e.value):!1:GN(e)}function GN(e){return e.replace(uU,"")===""}class Od{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Od.prototype.normal={};Od.prototype.property={};Od.prototype.space=void 0;function uM(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Od(n,r,t)}function Ob(e){return e.toLowerCase()}class Wr{constructor(t,n){this.attribute=n,this.property=t}}Wr.prototype.attribute="";Wr.prototype.booleanish=!1;Wr.prototype.boolean=!1;Wr.prototype.commaOrSpaceSeparated=!1;Wr.prototype.commaSeparated=!1;Wr.prototype.defined=!1;Wr.prototype.mustUseProperty=!1;Wr.prototype.number=!1;Wr.prototype.overloadedBoolean=!1;Wr.prototype.property="";Wr.prototype.spaceSeparated=!1;Wr.prototype.space=void 0;let fU=0;const yt=Oo(),Ln=Oo(),Lb=Oo(),je=Oo(),tn=Oo(),qu=Oo(),sa=Oo();function Oo(){return 2**++fU}const Pb=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Ln,commaOrSpaceSeparated:sa,commaSeparated:qu,number:je,overloadedBoolean:Lb,spaceSeparated:tn},Symbol.toStringTag,{value:"Module"})),ux=Object.keys(Pb);class tw extends Wr{constructor(t,n,r,a){let i=-1;if(super(t,n),$N(this,"space",a),typeof r=="number")for(;++i<ux.length;){const l=ux[i];$N(this,ux[i],(r&Pb[l])===Pb[l])}}}tw.prototype.defined=!0;function $N(e,t,n){n&&(e[t]=n)}function bc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new tw(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Ob(r)]=r,n[Ob(i.attribute)]=r}return new Od(t,n,e.space)}const cM=bc({properties:{ariaActiveDescendant:null,ariaAtomic:Ln,ariaAutoComplete:null,ariaBusy:Ln,ariaChecked:Ln,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:tn,ariaCurrent:null,ariaDescribedBy:tn,ariaDetails:null,ariaDisabled:Ln,ariaDropEffect:tn,ariaErrorMessage:null,ariaExpanded:Ln,ariaFlowTo:tn,ariaGrabbed:Ln,ariaHasPopup:null,ariaHidden:Ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tn,ariaLevel:je,ariaLive:null,ariaModal:Ln,ariaMultiLine:Ln,ariaMultiSelectable:Ln,ariaOrientation:null,ariaOwns:tn,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:Ln,ariaReadOnly:Ln,ariaRelevant:null,ariaRequired:Ln,ariaRoleDescription:tn,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:Ln,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function fM(e,t){return t in e?e[t]:t}function dM(e,t){return fM(e,t.toLowerCase())}const dU=bc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qu,acceptCharset:tn,accessKey:tn,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:tn,autoFocus:yt,autoPlay:yt,blocking:tn,capture:null,charSet:null,checked:yt,cite:null,className:tn,cols:je,colSpan:null,content:null,contentEditable:Ln,controls:yt,controlsList:tn,coords:je|qu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:Lb,draggable:Ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:tn,height:je,hidden:Lb,high:je,href:null,hrefLang:null,htmlFor:tn,httpEquiv:tn,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:tn,itemRef:tn,itemScope:yt,itemType:tn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,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:yt,optimum:je,pattern:null,ping:tn,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:tn,required:yt,reversed:yt,rows:je,rowSpan:je,sandbox:tn,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:Ln,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Ln,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tn,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:Ln,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:dM}),hU=bc({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:sa,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:tn,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:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,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:qu,g2:qu,glyphName:qu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:sa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,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:je,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:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sa,rev:sa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sa,requiredFeatures:sa,requiredFonts:sa,requiredFormats:sa,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:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:sa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sa,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fM}),hM=bc({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()}}),vM=bc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dM}),pM=bc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vU={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"},pU=/[A-Z]/g,KN=/-[a-z]/g,mU=/^data[-\w.:]+$/i;function gU(e,t){const n=Ob(t);let r=t,a=Wr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&mU.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(KN,xU);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!KN.test(i)){let l=i.replace(pU,yU);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=tw}return new a(r,t)}function yU(e){return"-"+e.toLowerCase()}function xU(e){return e.charAt(1).toUpperCase()}const bU=uM([cM,dU,hM,vM,pM],"html"),nw=uM([cM,hU,hM,vM,pM],"svg");function wU(e){return e.join(" ").trim()}var wu={},cx,YN;function SU(){if(YN)return cx;YN=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,f=`
|
|
475
|
+
`,c="/",h="*",p="",m="comment",y="declaration";function x(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var N=1,E=1;function T(G){var U=G.match(t);U&&(N+=U.length);var I=G.lastIndexOf(f);E=~I?G.length-I:E+G.length}function R(){var G={line:N,column:E};return function(U){return U.position=new A(G),L(),U}}function A(G){this.start=G,this.end={line:N,column:E},this.source=S.source}A.prototype.content=w;function D(G){var U=new Error(S.source+":"+N+":"+E+": "+G);if(U.reason=G,U.filename=S.source,U.line=N,U.column=E,U.source=w,!S.silent)throw U}function _(G){var U=G.exec(w);if(U){var I=U[0];return T(I),w=w.slice(I.length),U}}function L(){_(n)}function M(G){var U;for(G=G||[];U=z();)U!==!1&&G.push(U);return G}function z(){var G=R();if(!(c!=w.charAt(0)||h!=w.charAt(1))){for(var U=2;p!=w.charAt(U)&&(h!=w.charAt(U)||c!=w.charAt(U+1));)++U;if(U+=2,p===w.charAt(U-1))return D("End of comment missing");var I=w.slice(2,U-2);return E+=2,T(I),w=w.slice(U),E+=2,G({type:m,comment:I})}}function B(){var G=R(),U=_(r);if(U){if(z(),!_(a))return D("property missing ':'");var I=_(i),V=G({type:y,property:b(U[0].replace(e,p)),value:I?b(I[0].replace(e,p)):p});return _(l),V}}function H(){var G=[];M(G);for(var U;U=B();)U!==!1&&(G.push(U),M(G));return G}return L(),H()}function b(w){return w?w.replace(o,p):p}return cx=x,cx}var XN;function EU(){if(XN)return wu;XN=1;var e=wu&&wu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wu,"__esModule",{value:!0}),wu.default=n;const t=e(SU());function n(r,a){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),o=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:c,value:h}=f;o?a(c,h,f):h&&(i=i||{},i[c]=h)}),i}return wu}var jf={},QN;function CU(){if(QN)return jf;QN=1,Object.defineProperty(jf,"__esModule",{value:!0}),jf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},l=function(c,h){return h.toUpperCase()},o=function(c,h){return"".concat(h,"-")},f=function(c,h){return h===void 0&&(h={}),i(c)?c:(c=c.toLowerCase(),h.reactCompat?c=c.replace(a,o):c=c.replace(r,o),c.replace(t,l))};return jf.camelCase=f,jf}var Af,WN;function NU(){if(WN)return Af;WN=1;var e=Af&&Af.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(EU()),n=CU();function r(a,i){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(o,f){o&&f&&(l[(0,n.camelCase)(o,i)]=f)}),l}return r.default=r,Af=r,Af}var kU=NU();const TU=Nd(kU),mM=gM("end"),rw=gM("start");function gM(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 jU(e){const t=rw(e),n=mM(e);if(t&&n)return{start:t,end:n}}function Qf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ZN(e.position):"start"in e||"end"in e?ZN(e):"line"in e||"column"in e?Bb(e):""}function Bb(e){return JN(e&&e.line)+":"+JN(e&&e.column)}function ZN(e){return Bb(e&&e.start)+"-"+Bb(e&&e.end)}function JN(e){return e&&typeof e=="number"?e:1}class Er extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(l=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?i.ruleId=r:(i.source=r.slice(0,f),i.ruleId=r.slice(f+1))}if(!i.place&&i.ancestors&&i.ancestors){const f=i.ancestors[i.ancestors.length-1];f&&(i.place=f.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Qf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Er.prototype.file="";Er.prototype.name="";Er.prototype.reason="";Er.prototype.message="";Er.prototype.stack="";Er.prototype.column=void 0;Er.prototype.line=void 0;Er.prototype.ancestors=void 0;Er.prototype.cause=void 0;Er.prototype.fatal=void 0;Er.prototype.place=void 0;Er.prototype.ruleId=void 0;Er.prototype.source=void 0;const aw={}.hasOwnProperty,AU=new Map,RU=/[A-Z]/g,DU=new Set(["table","tbody","thead","tfoot","tr"]),MU=new Set(["td","th"]),yM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _U(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=UU(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=FU(n,t.jsx,t.jsxs)}const a={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"?nw:bU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=xM(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function xM(e,t,n){if(t.type==="element")return OU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return LU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return BU(e,t,n);if(t.type==="mdxjsEsm")return PU(e,t);if(t.type==="root")return zU(e,t,n);if(t.type==="text")return IU(e,t)}function OU(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=nw,e.schema=a),e.ancestors.push(t);const i=wM(e,t.tagName,!1),l=qU(e,t);let o=sw(e,t);return DU.has(t.tagName)&&(o=o.filter(function(f){return typeof f=="string"?!cU(f):!0})),bM(e,l,i,t),iw(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function LU(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)}ld(e,t.position)}function PU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ld(e,t.position)}function BU(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=nw,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:wM(e,t.name,!0),l=VU(e,t),o=sw(e,t);return bM(e,l,i,t),iw(l,o),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function zU(e,t,n){const r={};return iw(r,sw(e,t)),e.create(t,e.Fragment,r,n)}function IU(e,t){return t.value}function bM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function iw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function FU(e,t,n){return r;function r(a,i,l,o){const c=Array.isArray(l.children)?n:t;return o?c(i,l,o):c(i,l)}}function UU(e,t){return n;function n(r,a,i,l){const o=Array.isArray(i.children),f=rw(r);return t(a,i,l,o,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function qU(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&aw.call(t.properties,a)){const i=HU(e,a,t.properties[a]);if(i){const[l,o]=i;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&MU.has(t.tagName)?r=o:n[l]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function VU(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const o=l.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ld(e,t.position);else{const a=r.name;let i;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,i=e.evaluater.evaluateExpression(o.expression)}else ld(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function sw(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:AU;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const f=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(f){const c=a.get(f)||0;l=f+"-"+c,a.set(f,c+1)}}const o=xM(e,i,l);o!==void 0&&n.push(o)}return n}function HU(e,t,n){const r=gU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?iU(n):wU(n)),r.property==="style"){let a=typeof n=="object"?n:GU(e,String(n));return e.stylePropertyNameCase==="css"&&(a=$U(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?vU[r.property]||r.property:r.attribute,n]}}function GU(e,t){try{return TU(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=yM+"#cannot-parse-style-attribute",a}}function wM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,l;for(;++i<a.length;){const o=HN(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=l}else r=HN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return aw.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);ld(e)}function ld(e,t){const n=new Er("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=yM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $U(e){const t={};let n;for(n in e)aw.call(e,n)&&(t[KU(n)]=e[n]);return t}function KU(e){let t=e.replace(RU,YU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function YU(e){return"-"+e.toLowerCase()}const fx={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"]},XU={};function lw(e,t){const n=XU,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return SM(e,r,a)}function SM(e,t,n){if(QU(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 ek(e.children,t,n)}return Array.isArray(e)?ek(e,t,n):""}function ek(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=SM(e[a],t,n);return r.join("")}function QU(e){return!!(e&&typeof e=="object")}const tk=document.createElement("i");function ow(e){const t="&"+e+";";tk.innerHTML=t;const n=tk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ua(e,t,n,r){const a=e.length;let i=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function Ra(e,t){return e.length>0?(ua(e,e.length,0,t),e):t}const nk={}.hasOwnProperty;function EM(e){const t={};let n=-1;for(;++n<e.length;)WU(t,e[n]);return t}function WU(e,t){let n;for(n in t){const a=(nk.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){nk.call(a,l)||(a[l]=[]);const o=i[l];ZU(a[l],Array.isArray(o)?o:o?[o]:[])}}}function ZU(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ua(e,0,0,r)}function CM(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 Ha(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ar=Tl(/[A-Za-z]/),yr=Tl(/[\dA-Za-z]/),JU=Tl(/[#-'*+\--9=?A-Z^-~]/);function yp(e){return e!==null&&(e<32||e===127)}const zb=Tl(/\d/),eq=Tl(/[\dA-Fa-f]/),tq=Tl(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function Zt(e){return e!==null&&(e<0||e===32)}function Nt(e){return e===-2||e===-1||e===32}const nm=Tl(new RegExp("\\p{P}|\\p{S}","u")),Co=Tl(/\s/);function Tl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&yr(e.charCodeAt(n+1))&&yr(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(l=String.fromCharCode(i,o),a=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Rt(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(f){return Nt(f)?(e.enter(n),o(f)):t(f)}function o(f){return Nt(f)&&i++<a?(e.consume(f),o):(e.exit(n),t(f))}}const nq={tokenize:rq};function rq(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Rt(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return rt(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),l)}}const aq={tokenize:iq},rk={tokenize:sq};function iq(e){const t=this,n=[];let r=0,a,i,l;return o;function o(E){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,f,c)(E)}return c(E)}function f(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&N();const T=t.events.length;let R=T,A;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){A=t.events[R][1].end;break}S(r);let D=T;for(;D<t.events.length;)t.events[D][1].end={...A},D++;return ua(t.events,R+1,0,t.events.slice(T)),t.events.length=D,c(E)}return o(E)}function c(E){if(r===n.length){if(!a)return m(E);if(a.currentConstruct&&a.currentConstruct.concrete)return x(E);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rk,h,p)(E)}function h(E){return a&&N(),S(r),m(E)}function p(E){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(E)}function m(E){return t.containerState={},e.attempt(rk,y,x)(E)}function y(E){return r++,n.push([t.currentConstruct,t.containerState]),m(E)}function x(E){if(E===null){a&&N(),S(0),e.consume(E);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),b(E)}function b(E){if(E===null){w(e.exit("chunkFlow"),!0),S(0),e.consume(E);return}return rt(E)?(e.consume(E),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(E),b)}function w(E,T){const R=t.sliceStream(E);if(T&&R.push(null),E.previous=i,i&&(i.next=E),i=E,a.defineSkip(E.start),a.write(R),t.parser.lazy[E.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<l&&(!a.events[A][1].end||a.events[A][1].end.offset>l))return;const D=t.events.length;let _=D,L,M;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(L){M=t.events[_][1].end;break}L=!0}for(S(r),A=D;A<t.events.length;)t.events[A][1].end={...M},A++;ua(t.events,_+1,0,t.events.slice(D)),t.events.length=A}}function S(E){let T=n.length;for(;T-- >E;){const R=n[T];t.containerState=R[1],R[0].exit.call(t,e)}n.length=E}function N(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function sq(e,t,n){return Rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sc(e){if(e===null||Zt(e)||Co(e))return 1;if(nm(e))return 2}function rm(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Ib={name:"attention",resolveAll:lq,tokenize:oq};function lq(e,t){let n=-1,r,a,i,l,o,f,c,h;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;f=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 p={...e[r][1].end},m={...e[n][1].start};ak(p,-f),ak(m,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},o={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},i={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ra(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ra(c,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",i,t]]),c=Ra(c,rm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ra(c,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,c=Ra(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ua(e,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function oq(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=sc(r);let i;return l;function l(f){return i=f,e.enter("attentionSequence"),o(f)}function o(f){if(f===i)return e.consume(f),o;const c=e.exit("attentionSequence"),h=sc(f),p=!h||h===2&&a||n.includes(f),m=!a||a===2&&h||n.includes(r);return c._open=!!(i===42?p:p&&(a||!m)),c._close=!!(i===42?m:m&&(h||!p)),t(f)}}function ak(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const uq={name:"autolink",tokenize:cq};function cq(e,t,n){let r=0;return a;function a(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(y){return Ar(y)?(e.consume(y),l):y===64?n(y):c(y)}function l(y){return y===43||y===45||y===46||yr(y)?(r=1,o(y)):c(y)}function o(y){return y===58?(e.consume(y),r=0,f):(y===43||y===45||y===46||yr(y))&&r++<32?(e.consume(y),o):(r=0,c(y))}function f(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||yp(y)?n(y):(e.consume(y),f)}function c(y){return y===64?(e.consume(y),h):JU(y)?(e.consume(y),c):n(y)}function h(y){return yr(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,h):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):m(y)}function m(y){if((y===45||yr(y))&&r++<63){const x=y===45?m:p;return e.consume(y),x}return n(y)}}const Ld={partial:!0,tokenize:fq};function fq(e,t,n){return r;function r(i){return Nt(i)?Rt(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||rt(i)?t(i):n(i)}}const NM={continuation:{tokenize:hq},exit:vq,name:"blockQuote",tokenize:dq};function dq(e,t,n){const r=this;return a;function a(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),i}return n(l)}function i(l){return Nt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function hq(e,t,n){const r=this;return a;function a(l){return Nt(l)?Rt(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(NM,t,n)(l)}}function vq(e){e.exit("blockQuote")}const kM={name:"characterEscape",tokenize:pq};function pq(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return tq(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const TM={name:"characterReference",tokenize:mq};function mq(e,t,n){const r=this;let a=0,i,l;return o;function o(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,l=yr,h(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=eq,h):(e.enter("characterReferenceValue"),i=7,l=zb,h(p))}function h(p){if(p===59&&a){const m=e.exit("characterReferenceValue");return l===yr&&!ow(r.sliceSerialize(m))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&a++<i?(e.consume(p),h):n(p)}}const ik={partial:!0,tokenize:yq},sk={concrete:!0,name:"codeFenced",tokenize:gq};function gq(e,t,n){const r=this,a={partial:!0,tokenize:R};let i=0,l=0,o;return f;function f(A){return c(A)}function c(A){const D=r.events[r.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(A)}function h(A){return A===o?(l++,e.consume(A),h):l<3?n(A):(e.exit("codeFencedFenceSequence"),Nt(A)?Rt(e,p,"whitespace")(A):p(A))}function p(A){return A===null||rt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(ik,b,T)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(A))}function m(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):Nt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Rt(e,y,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),m)}function y(A){return A===null||rt(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||rt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===o?n(A):(e.consume(A),x)}function b(A){return e.attempt(a,T,w)(A)}function w(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),S}function S(A){return i>0&&Nt(A)?Rt(e,N,"linePrefix",i+1)(A):N(A)}function N(A){return A===null||rt(A)?e.check(ik,b,T)(A):(e.enter("codeFlowValue"),E(A))}function E(A){return A===null||rt(A)?(e.exit("codeFlowValue"),N(A)):(e.consume(A),E)}function T(A){return e.exit("codeFenced"),t(A)}function R(A,D,_){let L=0;return M;function M(U){return A.enter("lineEnding"),A.consume(U),A.exit("lineEnding"),z}function z(U){return A.enter("codeFencedFence"),Nt(U)?Rt(A,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):B(U)}function B(U){return U===o?(A.enter("codeFencedFenceSequence"),H(U)):_(U)}function H(U){return U===o?(L++,A.consume(U),H):L>=l?(A.exit("codeFencedFenceSequence"),Nt(U)?Rt(A,G,"whitespace")(U):G(U)):_(U)}function G(U){return U===null||rt(U)?(A.exit("codeFencedFence"),D(U)):_(U)}}}function yq(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const dx={name:"codeIndented",tokenize:bq},xq={partial:!0,tokenize:wq};function bq(e,t,n){const r=this;return a;function a(c){return e.enter("codeIndented"),Rt(e,i,"linePrefix",5)(c)}function i(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?f(c):rt(c)?e.attempt(xq,l,f)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||rt(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),o)}function f(c){return e.exit("codeIndented"),t(c)}}function wq(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):Rt(e,i,"linePrefix",5)(l)}function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):rt(l)?a(l):n(l)}}const Sq={name:"codeText",previous:Cq,resolve:Eq,tokenize:Nq};function Eq(e){let t=e.length-4,n=3,r,a;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;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function Cq(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Nq(e,t,n){let r=0,a,i;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),o(p)}function o(p){return p===96?(e.consume(p),r++,o):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(i=e.enter("codeTextSequence"),a=0,h(p)):rt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||rt(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),c)}function h(p){return p===96?(e.consume(p),a++,h):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class kq{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 a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Rf(this.left,r),i.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),Rf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Rf(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);Rf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Rf(this.left,n.reverse())}}}function Rf(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 jM(e){const t={};let n=-1,r,a,i,l,o,f,c;const h=new kq(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,i=0,i<f.length&&f[i][1].type==="lineEndingBlank"&&(i+=2),i<f.length&&f[i][1].type==="content"))for(;++i<f.length&&f[i][1].type!=="content";)f[i][1].type==="chunkText"&&(f[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Tq(h,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(l=h.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(h.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...h.get(a)[1].start},o=h.slice(a,n),o.unshift(r),h.splice(a,n-a+1,o))}}return ua(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function Tq(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,f=[],c={};let h,p,m=-1,y=n,x=0,b=0;const w=[b];for(;y;){for(;e.get(++a)[1]!==y;);i.push(a),y._tokenizer||(h=r.sliceStream(y),y.next||h.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(h),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(b=m+1,w.push(b),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):w.pop(),m=w.length;m--;){const S=o.slice(w[m],w[m+1]),N=i.pop();f.push([N,N+S.length-1]),e.splice(N,2,S)}for(f.reverse(),m=-1;++m<f.length;)c[x+f[m][0]]=x+f[m][1],x+=f[m][1]-f[m][0]-1;return c}const jq={resolve:Rq,tokenize:Dq},Aq={partial:!0,tokenize:Mq};function Rq(e){return jM(e),e}function Dq(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):rt(o)?e.check(Aq,l,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function l(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function Mq(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Rt(e,i,"linePrefix")}function i(l){if(l===null||rt(l))return n(l);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(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function AM(e,t,n,r,a,i,l,o,f){const c=f||Number.POSITIVE_INFINITY;let h=0;return p;function p(S){return S===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(S),e.exit(i),m):S===null||S===32||S===41||yp(S)?n(S):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(S))}function m(S){return S===62?(e.enter(i),e.consume(S),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(e.exit("chunkString"),e.exit(o),m(S)):S===null||S===60||rt(S)?n(S):(e.consume(S),S===92?x:y)}function x(S){return S===60||S===62||S===92?(e.consume(S),y):y(S)}function b(S){return!h&&(S===null||S===41||Zt(S))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),t(S)):h<c&&S===40?(e.consume(S),h++,b):S===41?(e.consume(S),h--,b):S===null||S===32||S===40||yp(S)?n(S):(e.consume(S),S===92?w:b)}function w(S){return S===40||S===41||S===92?(e.consume(S),b):b(S)}}function RM(e,t,n,r,a,i){const l=this;let o=0,f;return c;function c(y){return e.enter(r),e.enter(a),e.consume(y),e.exit(a),e.enter(i),h}function h(y){return o>999||y===null||y===91||y===93&&!f||y===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(i),e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):rt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||rt(y)||o++>999?(e.exit("chunkString"),h(y)):(e.consume(y),f||(f=!Nt(y)),y===92?m:p)}function m(y){return y===91||y===92||y===93?(e.consume(y),o++,p):p(y)}}function DM(e,t,n,r,a,i){let l;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),l=m===40?41:m,f):n(m)}function f(m){return m===l?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),c(m))}function c(m){return m===l?(e.exit(i),f(l)):m===null?n(m):rt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Rt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===l||m===null||rt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:h)}function p(m){return m===l||m===92?(e.consume(m),h):h(m)}}function Wf(e,t){let n;return r;function r(a){return rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Nt(a)?Rt(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const _q={name:"definition",tokenize:Lq},Oq={partial:!0,tokenize:Pq};function Lq(e,t,n){const r=this;let a;return i;function i(y){return e.enter("definition"),l(y)}function l(y){return RM.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function o(y){return a=Ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):n(y)}function f(y){return Zt(y)?Wf(e,c)(y):c(y)}function c(y){return AM(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function h(y){return e.attempt(Oq,p,p)(y)}function p(y){return Nt(y)?Rt(e,m,"whitespace")(y):m(y)}function m(y){return y===null||rt(y)?(e.exit("definition"),r.parser.defined.push(a),t(y)):n(y)}}function Pq(e,t,n){return r;function r(o){return Zt(o)?Wf(e,a)(o):n(o)}function a(o){return DM(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Nt(o)?Rt(e,l,"whitespace")(o):l(o)}function l(o){return o===null||rt(o)?t(o):n(o)}}const Bq={name:"hardBreakEscape",tokenize:zq};function zq(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return rt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const Iq={name:"headingAtx",resolve:Fq,tokenize:Uq};function Fq(e,t){let n=e.length-2,r=3,a,i;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&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ua(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function Uq(e,t,n){let r=0;return a;function a(h){return e.enter("atxHeading"),i(h)}function i(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||Zt(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),f(h)):h===null||rt(h)?(e.exit("atxHeading"),t(h)):Nt(h)?Rt(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function f(h){return h===35?(e.consume(h),f):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Zt(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const qq=["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"],lk=["pre","script","style","textarea"],Vq={concrete:!0,name:"htmlFlow",resolveTo:$q,tokenize:Kq},Hq={partial:!0,tokenize:Xq},Gq={partial:!0,tokenize:Yq};function $q(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 Kq(e,t,n){const r=this;let a,i,l,o,f;return c;function c(P){return h(P)}function h(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),p}function p(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),i=!0,b):P===63?(e.consume(P),a=3,r.interrupt?t:F):Ar(P)?(e.consume(P),l=String.fromCharCode(P),w):n(P)}function m(P){return P===45?(e.consume(P),a=2,y):P===91?(e.consume(P),a=5,o=0,x):Ar(P)?(e.consume(P),a=4,r.interrupt?t:F):n(P)}function y(P){return P===45?(e.consume(P),r.interrupt?t:F):n(P)}function x(P){const Z="CDATA[";return P===Z.charCodeAt(o++)?(e.consume(P),o===Z.length?r.interrupt?t:B:x):n(P)}function b(P){return Ar(P)?(e.consume(P),l=String.fromCharCode(P),w):n(P)}function w(P){if(P===null||P===47||P===62||Zt(P)){const Z=P===47,ae=l.toLowerCase();return!Z&&!i&&lk.includes(ae)?(a=1,r.interrupt?t(P):B(P)):qq.includes(l.toLowerCase())?(a=6,Z?(e.consume(P),S):r.interrupt?t(P):B(P)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?N(P):E(P))}return P===45||yr(P)?(e.consume(P),l+=String.fromCharCode(P),w):n(P)}function S(P){return P===62?(e.consume(P),r.interrupt?t:B):n(P)}function N(P){return Nt(P)?(e.consume(P),N):M(P)}function E(P){return P===47?(e.consume(P),M):P===58||P===95||Ar(P)?(e.consume(P),T):Nt(P)?(e.consume(P),E):M(P)}function T(P){return P===45||P===46||P===58||P===95||yr(P)?(e.consume(P),T):R(P)}function R(P){return P===61?(e.consume(P),A):Nt(P)?(e.consume(P),R):E(P)}function A(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),f=P,D):Nt(P)?(e.consume(P),A):_(P)}function D(P){return P===f?(e.consume(P),f=null,L):P===null||rt(P)?n(P):(e.consume(P),D)}function _(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Zt(P)?R(P):(e.consume(P),_)}function L(P){return P===47||P===62||Nt(P)?E(P):n(P)}function M(P){return P===62?(e.consume(P),z):n(P)}function z(P){return P===null||rt(P)?B(P):Nt(P)?(e.consume(P),z):n(P)}function B(P){return P===45&&a===2?(e.consume(P),I):P===60&&a===1?(e.consume(P),V):P===62&&a===4?(e.consume(P),q):P===63&&a===3?(e.consume(P),F):P===93&&a===5?(e.consume(P),Q):rt(P)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(Hq,X,H)(P)):P===null||rt(P)?(e.exit("htmlFlowData"),H(P)):(e.consume(P),B)}function H(P){return e.check(Gq,G,X)(P)}function G(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),U}function U(P){return P===null||rt(P)?H(P):(e.enter("htmlFlowData"),B(P))}function I(P){return P===45?(e.consume(P),F):B(P)}function V(P){return P===47?(e.consume(P),l="",K):B(P)}function K(P){if(P===62){const Z=l.toLowerCase();return lk.includes(Z)?(e.consume(P),q):B(P)}return Ar(P)&&l.length<8?(e.consume(P),l+=String.fromCharCode(P),K):B(P)}function Q(P){return P===93?(e.consume(P),F):B(P)}function F(P){return P===62?(e.consume(P),q):P===45&&a===2?(e.consume(P),F):B(P)}function q(P){return P===null||rt(P)?(e.exit("htmlFlowData"),X(P)):(e.consume(P),q)}function X(P){return e.exit("htmlFlow"),t(P)}}function Yq(e,t,n){const r=this;return a;function a(l){return rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Xq(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Ld,t,n)}}const Qq={name:"htmlText",tokenize:Wq};function Wq(e,t,n){const r=this;let a,i,l;return o;function o(F){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(F),f}function f(F){return F===33?(e.consume(F),c):F===47?(e.consume(F),R):F===63?(e.consume(F),E):Ar(F)?(e.consume(F),_):n(F)}function c(F){return F===45?(e.consume(F),h):F===91?(e.consume(F),i=0,x):Ar(F)?(e.consume(F),N):n(F)}function h(F){return F===45?(e.consume(F),y):n(F)}function p(F){return F===null?n(F):F===45?(e.consume(F),m):rt(F)?(l=p,V(F)):(e.consume(F),p)}function m(F){return F===45?(e.consume(F),y):p(F)}function y(F){return F===62?I(F):F===45?m(F):p(F)}function x(F){const q="CDATA[";return F===q.charCodeAt(i++)?(e.consume(F),i===q.length?b:x):n(F)}function b(F){return F===null?n(F):F===93?(e.consume(F),w):rt(F)?(l=b,V(F)):(e.consume(F),b)}function w(F){return F===93?(e.consume(F),S):b(F)}function S(F){return F===62?I(F):F===93?(e.consume(F),S):b(F)}function N(F){return F===null||F===62?I(F):rt(F)?(l=N,V(F)):(e.consume(F),N)}function E(F){return F===null?n(F):F===63?(e.consume(F),T):rt(F)?(l=E,V(F)):(e.consume(F),E)}function T(F){return F===62?I(F):E(F)}function R(F){return Ar(F)?(e.consume(F),A):n(F)}function A(F){return F===45||yr(F)?(e.consume(F),A):D(F)}function D(F){return rt(F)?(l=D,V(F)):Nt(F)?(e.consume(F),D):I(F)}function _(F){return F===45||yr(F)?(e.consume(F),_):F===47||F===62||Zt(F)?L(F):n(F)}function L(F){return F===47?(e.consume(F),I):F===58||F===95||Ar(F)?(e.consume(F),M):rt(F)?(l=L,V(F)):Nt(F)?(e.consume(F),L):I(F)}function M(F){return F===45||F===46||F===58||F===95||yr(F)?(e.consume(F),M):z(F)}function z(F){return F===61?(e.consume(F),B):rt(F)?(l=z,V(F)):Nt(F)?(e.consume(F),z):L(F)}function B(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),a=F,H):rt(F)?(l=B,V(F)):Nt(F)?(e.consume(F),B):(e.consume(F),G)}function H(F){return F===a?(e.consume(F),a=void 0,U):F===null?n(F):rt(F)?(l=H,V(F)):(e.consume(F),H)}function G(F){return F===null||F===34||F===39||F===60||F===61||F===96?n(F):F===47||F===62||Zt(F)?L(F):(e.consume(F),G)}function U(F){return F===47||F===62||Zt(F)?L(F):n(F)}function I(F){return F===62?(e.consume(F),e.exit("htmlTextData"),e.exit("htmlText"),t):n(F)}function V(F){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),K}function K(F){return Nt(F)?Rt(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):Q(F)}function Q(F){return e.enter("htmlTextData"),l(F)}}const uw={name:"labelEnd",resolveAll:t8,resolveTo:n8,tokenize:r8},Zq={tokenize:a8},Jq={tokenize:i8},e8={tokenize:s8};function t8(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 a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&ua(e,0,e.length,n),e}function n8(e,t){let n=e.length,r=0,a,i,l,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},h={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",f,t],["enter",c,t]],o=Ra(o,e.slice(i+1,i+r+3)),o=Ra(o,[["enter",h,t]]),o=Ra(o,rm(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),o=Ra(o,[["exit",h,t],e[l-2],e[l-1],["exit",c,t]]),o=Ra(o,e.slice(l+1)),o=Ra(o,[["exit",f,t]]),ua(e,i,e.length,o),e}function r8(e,t,n){const r=this;let a=r.events.length,i,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(m){return i?i._inactive?p(m):(l=r.parser.defined.includes(Ha(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),f):n(m)}function f(m){return m===40?e.attempt(Zq,h,l?h:p)(m):m===91?e.attempt(Jq,h,l?c:p)(m):l?h(m):p(m)}function c(m){return e.attempt(e8,h,p)(m)}function h(m){return t(m)}function p(m){return i._balanced=!0,n(m)}}function a8(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return Zt(p)?Wf(e,i)(p):i(p)}function i(p){return p===41?h(p):AM(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Zt(p)?Wf(e,f)(p):h(p)}function o(p){return n(p)}function f(p){return p===34||p===39||p===40?DM(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):h(p)}function c(p){return Zt(p)?Wf(e,h)(p):h(p)}function h(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function i8(e,t,n){const r=this;return a;function a(o){return RM.call(r,e,i,l,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function l(o){return n(o)}}function s8(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const l8={name:"labelStartImage",resolveAll:uw.resolveAll,tokenize:o8};function o8(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),l):n(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const u8={name:"labelStartLink",resolveAll:uw.resolveAll,tokenize:c8};function c8(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const hx={name:"lineEnding",tokenize:f8};function f8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Rt(e,t,"linePrefix")}}const Zv={name:"thematicBreak",tokenize:d8};function d8(e,t,n){let r=0,a;return i;function i(c){return e.enter("thematicBreak"),l(c)}function l(c){return a=c,o(c)}function o(c){return c===a?(e.enter("thematicBreakSequence"),f(c)):r>=3&&(c===null||rt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function f(c){return c===a?(e.consume(c),r++,f):(e.exit("thematicBreakSequence"),Nt(c)?Rt(e,o,"whitespace")(c):o(c))}}const qr={continuation:{tokenize:m8},exit:y8,name:"list",tokenize:p8},h8={partial:!0,tokenize:x8},v8={partial:!0,tokenize:g8};function p8(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return o;function o(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:zb(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Zv,n,c)(y):c(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return n(y)}function f(y){return zb(y)&&++l<10?(e.consume(y),f):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),c(y)):n(y)}function c(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Ld,r.interrupt?n:h,e.attempt(h8,m,p))}function h(y){return r.containerState.initialBlankLine=!0,i++,m(y)}function p(y){return Nt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),m):n(y)}function m(y){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function m8(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ld,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Rt(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Nt(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(v8,t,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Rt(e,e.attempt(qr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function g8(e,t,n){const r=this;return Rt(e,a,"listItemIndent",r.containerState.size+1);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function y8(e){e.exit(this.containerState.type)}function x8(e,t,n){const r=this;return Rt(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const l=r.events[r.events.length-1];return!Nt(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const ok={name:"setextUnderline",resolveTo:b8,tokenize:w8};function b8(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function w8(e,t,n){const r=this;let a;return i;function i(c){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),a=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===a?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),Nt(c)?Rt(e,f,"lineSuffix")(c):f(c))}function f(c){return c===null||rt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const S8={tokenize:E8};function E8(e){const t=this,n=e.attempt(Ld,r,e.attempt(this.parser.constructs.flowInitial,a,Rt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(jq,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const C8={resolveAll:_M()},N8=MM("string"),k8=MM("text");function MM(e){return{resolveAll:_M(e==="text"?T8:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,l,o);return l;function l(h){return c(h)?i(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),f}function f(h){return c(h)?(n.exit("data"),i(h)):(n.consume(h),f)}function c(h){if(h===null)return!0;const p=a[h];let m=-1;if(p)for(;++m<p.length;){const y=p[m];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function _M(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function T8(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],a=t.sliceStream(r);let i=a.length,l=-1,o=0,f;for(;i--;){const c=a[i];if(typeof c=="string"){for(l=c.length;c.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(c===-2)f=!0,o++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const c={type:n===e.length||f||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const j8={42:qr,43:qr,45:qr,48:qr,49:qr,50:qr,51:qr,52:qr,53:qr,54:qr,55:qr,56:qr,57:qr,62:NM},A8={91:_q},R8={[-2]:dx,[-1]:dx,32:dx},D8={35:Iq,42:Zv,45:[ok,Zv],60:Vq,61:ok,95:Zv,96:sk,126:sk},M8={38:TM,92:kM},_8={[-5]:hx,[-4]:hx,[-3]:hx,33:l8,38:TM,42:Ib,60:[uq,Qq],91:u8,92:[Bq,kM],93:uw,95:Ib,96:Sq},O8={null:[Ib,C8]},L8={null:[42,95]},P8={null:[]},B8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:L8,contentInitial:A8,disable:P8,document:j8,flow:D8,flowInitial:R8,insideSpan:O8,string:M8,text:_8},Symbol.toStringTag,{value:"Module"}));function z8(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 a={},i=[];let l=[],o=[];const f={attempt:D(R),check:D(A),consume:N,enter:E,exit:T,interrupt:D(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:y,write:p};let h=t.tokenize.call(c,f);return t.resolveAll&&i.push(t),c;function p(z){return l=Ra(l,z),w(),l[l.length-1]!==null?[]:(_(t,0),c.events=rm(i,c.events,c),c.events)}function m(z,B){return F8(y(z),B)}function y(z){return I8(l,z)}function x(){const{_bufferIndex:z,_index:B,line:H,column:G,offset:U}=r;return{_bufferIndex:z,_index:B,line:H,column:G,offset:U}}function b(z){a[z.line]=z.column,M()}function w(){let z;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<B.length;)S(B.charCodeAt(r._bufferIndex));else S(B)}}function S(z){h=h(z)}function N(z){rt(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,M()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function E(z,B){const H=B||{};return H.type=z,H.start=x(),c.events.push(["enter",H,c]),o.push(H),H}function T(z){const B=o.pop();return B.end=x(),c.events.push(["exit",B,c]),B}function R(z,B){_(z,B.from)}function A(z,B){B.restore()}function D(z,B){return H;function H(G,U,I){let V,K,Q,F;return Array.isArray(G)?X(G):"tokenize"in G?X([G]):q(G);function q(ie){return le;function le(ye){const ne=ye!==null&&ie[ye],W=ye!==null&&ie.null,J=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(W)?W:W?[W]:[]];return X(J)(ye)}}function X(ie){return V=ie,K=0,ie.length===0?I:P(ie[K])}function P(ie){return le;function le(ye){return F=L(),Q=ie,ie.partial||(c.currentConstruct=ie),ie.name&&c.parser.constructs.disable.null.includes(ie.name)?ae():ie.tokenize.call(B?Object.assign(Object.create(c),B):c,f,Z,ae)(ye)}}function Z(ie){return z(Q,F),U}function ae(ie){return F.restore(),++K<V.length?P(V[K]):I}}}function _(z,B){z.resolveAll&&!i.includes(z)&&i.push(z),z.resolve&&ua(c.events,B,c.events.length-B,z.resolve(c.events.slice(B),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function L(){const z=x(),B=c.previous,H=c.currentConstruct,G=c.events.length,U=Array.from(o);return{from:G,restore:I};function I(){r=z,c.previous=B,c.currentConstruct=H,c.events.length=G,o=U,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function I8(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,i)];else{if(l=e.slice(n,a),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}i>0&&l.push(e[a].slice(0,i))}return l}function F8(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
|
|
476
|
+
`;break}case-3:{l=`\r
|
|
477
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(i)}a=i===-2,r.push(l)}return r.join("")}function U8(e){const r={constructs:EM([B8,...(e||{}).extensions||[]]),content:a(nq),defined:[],document:a(aq),flow:a(S8),lazy:{},string:a(N8),text:a(k8)};return r;function a(i){return l;function l(o){return z8(r,i,o)}}}function q8(e){for(;!jM(e););return e}const uk=/[\0\t\n\r]/g;function V8(){let e=1,t="",n=!0,r;return a;function a(i,l,o){const f=[];let c,h,p,m,y;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),p=0,t="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(uk.lastIndex=p,c=uk.exec(i),m=c&&c.index!==void 0?c.index:i.length,y=i.charCodeAt(m),!c){t=i.slice(p);break}if(y===10&&p===m&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),p<m&&(f.push(i.slice(p,m)),e+=m-p),y){case 0:{f.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,f.push(-2);e++<h;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}p=m+1}return o&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const H8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function G8(e){return e.replace(H8,$8)}function $8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return CM(n.slice(i?2:1),i?16:10)}return ow(n)||e}const OM={}.hasOwnProperty;function K8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Y8(n)(q8(U8(n).document().write(V8()(e,t,!0))))}function Y8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ve),autolinkProtocol:L,autolinkEmail:L,atxHeading:i(Be),blockQuote:i(W),characterEscape:L,characterReference:L,codeFenced:i(J),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(J,l),codeText:i(se,l),codeTextData:L,data:L,codeFlowValue:L,definition:i(ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(Te),hardBreakEscape:i(ot),hardBreakTrailing:i(ot),htmlFlow:i(Je,l),htmlFlowData:L,htmlText:i(Je,l),htmlTextData:L,image:i(We),label:l,link:i(Ve),listItem:i(Ye),listItemValue:m,listOrdered:i(De,p),listUnordered:i(De),paragraph:i(Qe),reference:P,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Be),strong:i(st),thematicBreak:i(dt)},exit:{atxHeading:f(),atxHeadingSequence:R,autolink:f(),autolinkEmail:ne,autolinkProtocol:ye,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:ie,characterReference:le,codeFenced:f(w),codeFencedFence:b,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:f(S),codeText:f(U),codeTextData:M,data:M,definition:f(),definitionDestinationString:T,definitionLabelString:N,definitionTitleString:E,emphasis:f(),hardBreakEscape:f(B),hardBreakTrailing:f(B),htmlFlow:f(H),htmlFlowData:M,htmlText:f(G),htmlTextData:M,image:f(V),label:Q,labelText:K,lineEnding:z,link:f(I),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Z,resourceDestinationString:F,resourceTitleString:q,resource:X,setextHeading:f(_),setextHeadingLineSequence:D,setextHeadingText:A,strong:f(),thematicBreak:f()}};LM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let Ce={type:"root",children:[]};const Me={stack:[Ce],tokenStack:[],config:t,enter:o,exit:c,buffer:l,resume:h,data:n},Fe=[];let _e=-1;for(;++_e<he.length;)if(he[_e][1].type==="listOrdered"||he[_e][1].type==="listUnordered")if(he[_e][0]==="enter")Fe.push(_e);else{const Oe=Fe.pop();_e=a(he,Oe,_e)}for(_e=-1;++_e<he.length;){const Oe=t[he[_e][0]];OM.call(Oe,he[_e][1].type)&&Oe[he[_e][1].type].call(Object.assign({sliceSerialize:he[_e][2].sliceSerialize},Me),he[_e][1])}if(Me.tokenStack.length>0){const Oe=Me.tokenStack[Me.tokenStack.length-1];(Oe[1]||ck).call(Me,void 0,Oe[0])}for(Ce.position={start:Gs(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Gs(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)Ce=t.transforms[_e](Ce)||Ce;return Ce}function a(he,Ce,Me){let Fe=Ce-1,_e=-1,Oe=!1,xe,Y,ue,pe;for(;++Fe<=Me;){const de=he[Fe];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?_e++:_e--,pe=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(xe&&!pe&&!_e&&!ue&&(ue=Fe),pe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pe=void 0}if(!_e&&de[0]==="enter"&&de[1].type==="listItemPrefix"||_e===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(xe){let be=Fe;for(Y=void 0;be--;){const Le=he[be];if(Le[1].type==="lineEnding"||Le[1].type==="lineEndingBlank"){if(Le[0]==="exit")continue;Y&&(he[Y][1].type="lineEndingBlank",Oe=!0),Le[1].type="lineEnding",Y=be}else if(!(Le[1].type==="linePrefix"||Le[1].type==="blockQuotePrefix"||Le[1].type==="blockQuotePrefixWhitespace"||Le[1].type==="blockQuoteMarker"||Le[1].type==="listItemIndent"))break}ue&&(!Y||ue<Y)&&(xe._spread=!0),xe.end=Object.assign({},Y?he[Y][1].start:de[1].end),he.splice(Y||Fe,0,["exit",xe,de[2]]),Fe++,Me++}if(de[1].type==="listItemPrefix"){const be={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};xe=be,he.splice(Fe,0,["enter",be,de[2]]),Fe++,Me++,ue=void 0,pe=!0}}}return he[Ce][1]._spread=Oe,Me}function i(he,Ce){return Me;function Me(Fe){o.call(this,he(Fe),Fe),Ce&&Ce.call(this,Fe)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(he,Ce,Me){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ce,Me||void 0]),he.position={start:Gs(Ce.start),end:void 0}}function f(he){return Ce;function Ce(Me){he&&he.call(this,Me),c.call(this,Me)}}function c(he,Ce){const Me=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==he.type&&(Ce?Ce.call(this,he,Fe[0]):(Fe[1]||ck).call(this,he,Fe[0]));else throw new Error("Cannot close `"+he.type+"` ("+Qf({start:he.start,end:he.end})+"): it’s not open");Me.position.end=Gs(he.end)}function h(){return lw(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(he){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function y(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=he}function x(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=he}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/(\r?\n|\r)$/g,"")}function N(he){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=Ha(this.sliceSerialize(he)).toLowerCase()}function E(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function R(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Me=this.sliceSerialize(he).length;Ce.depth=Me}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function D(he){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function L(he){const Me=this.stack[this.stack.length-1].children;let Fe=Me[Me.length-1];(!Fe||Fe.type!=="text")&&(Fe=ze(),Fe.position={start:Gs(he.start),end:void 0},Me.push(Fe)),this.stack.push(Fe)}function M(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=Gs(he.end)}function z(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Ce.children[Ce.children.length-1];Me.position.end=Gs(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(L.call(this,he),M.call(this,he))}function B(){this.data.atHardBreak=!0}function H(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function G(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function U(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function I(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function V(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function K(he){const Ce=this.sliceSerialize(he),Me=this.stack[this.stack.length-2];Me.label=G8(Ce),Me.identifier=Ha(Ce).toLowerCase()}function Q(){const he=this.stack[this.stack.length-1],Ce=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Fe=he.children;Me.children=Fe}else Me.alt=Ce}function F(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function q(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function X(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function Z(he){const Ce=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ce,Me.identifier=Ha(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function ae(he){this.data.characterReferenceType=he.type}function ie(he){const Ce=this.sliceSerialize(he),Me=this.data.characterReferenceType;let Fe;Me?(Fe=CM(Ce,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=ow(Ce);const _e=this.stack[this.stack.length-1];_e.value+=Fe}function le(he){const Ce=this.stack.pop();Ce.position.end=Gs(he.end)}function ye(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(he)}function ne(he){M.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(he)}function W(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function Je(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Ve(){return{type:"link",title:null,url:"",children:[]}}function De(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ye(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function st(){return{type:"strong",children:[]}}function ze(){return{type:"text",value:""}}function dt(){return{type:"thematicBreak"}}}function Gs(e){return{line:e.line,column:e.column,offset:e.offset}}function LM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?LM(e,r):X8(e,r)}}function X8(e,t){let n;for(n in t)if(OM.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 ck(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qf({start:t.start,end:t.end})+") is still open")}function Q8(e){const t=this;t.parser=n;function n(r){return K8(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function W8(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 Z8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
478
|
+
`}]}function J8(e,t){const n=t.value?t.value+`
|
|
479
|
+
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function eV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=wc(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,o+=1,e.footnoteCounts.set(r,o);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const c={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,c),e.applyData(t,c)}function rV(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 aV(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function PM(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 a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function iV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return PM(e,t);const a={src:wc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function sV(e,t){const n={src:wc(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 lV(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 oV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return PM(e,t);const a={href:wc(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function uV(e,t){const n={href:wc(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 cV(e,t,n){const r=e.all(t),a=n?fV(n):BM(t),i={},l=[];if(typeof t.checked=="boolean"){const h=r[0];let p;h&&h.type==="element"&&h.tagName==="p"?p=h:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(a||o!==0||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
480
|
+
`}),h.type==="element"&&h.tagName==="p"&&!a?l.push(...h.children):l.push(h)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
481
|
+
`});const c={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,c),e.applyData(t,c)}function fV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=BM(n[r])}return t}function BM(e){const t=e.spread;return t??e.children.length>1}function dV(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function hV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function pV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mV(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=rw(t.children[1]),f=mM(t.children[t.children.length-1]);o&&f&&(l.position={start:o,end:f}),a.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function gV(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,o=l?l.length:t.children.length;let f=-1;const c=[];for(;++f<o;){const p=t.children[f],m={},y=l?l[f]:void 0;y&&(m.align=y);let x={type:"element",tagName:i,properties:m,children:[]};p&&(x.children=e.all(p),e.patch(p,x),x=e.applyData(p,x)),c.push(x)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function yV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const fk=9,dk=32;function xV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(hk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(hk(t.slice(a),a>0,!1)),i.join("")}function hk(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===fk||i===dk;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===fk||i===dk;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function bV(e,t){const n={type:"text",value:xV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const SV={blockquote:W8,break:Z8,code:J8,delete:eV,emphasis:tV,footnoteReference:nV,heading:rV,html:aV,imageReference:iV,image:sV,inlineCode:lV,linkReference:oV,link:uV,listItem:cV,list:dV,paragraph:hV,root:vV,strong:pV,table:mV,tableCell:yV,tableRow:gV,text:bV,thematicBreak:wV,toml:wv,yaml:wv,definition:wv,footnoteDefinition:wv};function wv(){}const zM=-1,am=0,Zf=1,xp=2,cw=3,fw=4,dw=5,hw=6,IM=7,FM=8,vk=typeof self=="object"?self:globalThis,EV=(e,t)=>{const n=(a,i)=>(e.set(i,a),a),r=a=>{if(e.has(a))return e.get(a);const[i,l]=t[a];switch(i){case am:case zM:return n(l,a);case Zf:{const o=n([],a);for(const f of l)o.push(r(f));return o}case xp:{const o=n({},a);for(const[f,c]of l)o[r(f)]=r(c);return o}case cw:return n(new Date(l),a);case fw:{const{source:o,flags:f}=l;return n(new RegExp(o,f),a)}case dw:{const o=n(new Map,a);for(const[f,c]of l)o.set(r(f),r(c));return o}case hw:{const o=n(new Set,a);for(const f of l)o.add(r(f));return o}case IM:{const{name:o,message:f}=l;return n(new vk[o](f),a)}case FM:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return n(new DataView(o),l)}}return n(new vk[i](l),a)};return r},pk=e=>EV(new Map,e)(0),Su="",{toString:CV}={},{keys:NV}=Object,Df=e=>{const t=typeof e;if(t!=="object"||!e)return[am,t];const n=CV.call(e).slice(8,-1);switch(n){case"Array":return[Zf,Su];case"Object":return[xp,Su];case"Date":return[cw,Su];case"RegExp":return[fw,Su];case"Map":return[dw,Su];case"Set":return[hw,Su];case"DataView":return[Zf,n]}return n.includes("Array")?[Zf,n]:n.includes("Error")?[IM,n]:[xp,n]},Sv=([e,t])=>e===am&&(t==="function"||t==="symbol"),kV=(e,t,n,r)=>{const a=(l,o)=>{const f=r.push(l)-1;return n.set(o,f),f},i=l=>{if(n.has(l))return n.get(l);let[o,f]=Df(l);switch(o){case am:{let h=l;switch(f){case"bigint":o=FM,h=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);h=null;break;case"undefined":return a([zM],l)}return a([o,h],l)}case Zf:{if(f){let m=l;return f==="DataView"?m=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(m=new Uint8Array(l)),a([f,[...m]],l)}const h=[],p=a([o,h],l);for(const m of l)h.push(i(m));return p}case xp:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const h=[],p=a([o,h],l);for(const m of NV(l))(e||!Sv(Df(l[m])))&&h.push([i(m),i(l[m])]);return p}case cw:return a([o,l.toISOString()],l);case fw:{const{source:h,flags:p}=l;return a([o,{source:h,flags:p}],l)}case dw:{const h=[],p=a([o,h],l);for(const[m,y]of l)(e||!(Sv(Df(m))||Sv(Df(y))))&&h.push([i(m),i(y)]);return p}case hw:{const h=[],p=a([o,h],l);for(const m of l)(e||!Sv(Df(m)))&&h.push(i(m));return p}}const{message:c}=l;return a([o,{name:f,message:c}],l)};return i},mk=(e,{json:t,lossy:n}={})=>{const r=[];return kV(!(t||n),!!t,new Map,r)(e),r},bp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?pk(mk(e,t)):structuredClone(e):(e,t)=>pk(mk(e,t));function TV(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 jV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function AV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||TV,r=e.options.footnoteBackLabel||jV,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let f=-1;for(;++f<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[f]);if(!c)continue;const h=e.all(c),p=String(c.identifier).toUpperCase(),m=wc(p.toLowerCase());let y=0;const x=[],b=e.footnoteCounts.get(p);for(;b!==void 0&&++y<=b;){x.length>0&&x.push({type:"text",value:" "});let N=typeof n=="string"?n:n(f,y);typeof N=="string"&&(N={type:"text",value:N}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,y),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const w=h[h.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const N=w.children[w.children.length-1];N&&N.type==="text"?N.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...x)}else h.push(...x);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(h,!0)};e.patch(c,S),o.push(S)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bp(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
482
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
483
|
+
`}]}}const im=(function(e){if(e==null)return _V;if(typeof e=="function")return sm(e);if(typeof e=="object")return Array.isArray(e)?RV(e):DV(e);if(typeof e=="string")return MV(e);throw new Error("Expected function, string, or object as test")});function RV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=im(e[n]);return sm(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function DV(e){const t=e;return sm(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function MV(e){return sm(t);function t(n){return n&&n.type===e}}function sm(e){return t;function t(n,r,a){return!!(OV(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function _V(){return!0}function OV(e){return e!==null&&typeof e=="object"&&"type"in e}const UM=[],LV=!0,Fb=!1,PV="skip";function qM(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=im(a),l=r?-1:1;o(e,void 0,[])();function o(f,c,h){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return m;function m(){let y=UM,x,b,w;if((!t||i(f,c,h[h.length-1]||void 0))&&(y=BV(n(f,h)),y[0]===Fb))return y;if("children"in f&&f.children){const S=f;if(S.children&&y[0]!==PV)for(b=(r?S.children.length:-1)+l,w=h.concat(S);b>-1&&b<S.children.length;){const N=S.children[b];if(x=o(N,b,w)(),x[0]===Fb)return x;b=typeof x[1]=="number"?x[1]:b+l}}return y}}}function BV(e){return Array.isArray(e)?e:typeof e=="number"?[LV,e]:e==null?UM:[e]}function vw(e,t,n,r){let a,i,l;typeof t=="function"&&typeof n!="function"?(i=void 0,l=t,a=n):(i=t,l=n,a=r),qM(e,i,o,a);function o(f,c){const h=c[c.length-1],p=h?h.children.indexOf(f):void 0;return l(f,p,h)}}const Ub={}.hasOwnProperty,zV={};function IV(e,t){const n=t||zV,r=new Map,a=new Map,i=new Map,l={...SV,...n.handlers},o={all:c,applyData:UV,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:l,one:f,options:n,patch:FV,wrap:VV};return vw(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const p=h.type==="definition"?r:a,m=String(h.identifier).toUpperCase();p.has(m)||p.set(m,h)}}),o;function f(h,p){const m=h.type,y=o.handlers[m];if(Ub.call(o.handlers,m)&&y)return y(o,h,p);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in h){const{children:b,...w}=h,S=bp(w);return S.children=o.all(h),S}return bp(h)}return(o.options.unknownHandler||qV)(o,h,p)}function c(h){const p=[];if("children"in h){const m=h.children;let y=-1;for(;++y<m.length;){const x=o.one(m[y],h);if(x){if(y&&m[y-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=gk(x.value)),!Array.isArray(x)&&x.type==="element")){const b=x.children[0];b&&b.type==="text"&&(b.value=gk(b.value))}Array.isArray(x)?p.push(...x):p.push(x)}}}return p}}function FV(e,t){e.position&&(t.position=jU(e))}function UV(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,bp(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function qV(e,t){const n=t.data||{},r="value"in t&&!(Ub.call(n,"hProperties")||Ub.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 VV(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
484
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
485
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
486
|
+
`}),n}function gk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function yk(e,t){const n=IV(e,t),r=n.one(e,void 0),a=AV(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
|
|
487
|
+
`},a),i}function HV(e,t){return e&&"run"in e?async function(n,r){const a=yk(n,{file:r,...t});await e.run(a,r)}:function(n,r){return yk(n,{file:r,...e||t})}}function xk(e){if(e)throw e}var vx,bk;function GV(){if(bk)return vx;bk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var h=e.call(c,"constructor"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!p)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},l=function(c,h){n&&h.name==="__proto__"?n(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},o=function(c,h){if(h==="__proto__")if(e.call(c,h)){if(r)return r(c,h).value}else return;return c[h]};return vx=function f(){var c,h,p,m,y,x,b=arguments[0],w=1,S=arguments.length,N=!1;for(typeof b=="boolean"&&(N=b,b=arguments[1]||{},w=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});w<S;++w)if(c=arguments[w],c!=null)for(h in c)p=o(b,h),m=o(c,h),b!==m&&(N&&m&&(i(m)||(y=a(m)))?(y?(y=!1,x=p&&a(p)?p:[]):x=p&&i(p)?p:{},l(b,{name:h,newValue:f(N,x,m)})):typeof m<"u"&&l(b,{name:h,newValue:m}));return b},vx}var $V=GV();const px=Nd($V);function qb(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 KV(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...a);function o(f,...c){const h=e[++i];let p=-1;if(f){l(f);return}for(;++p<a.length;)(c[p]===null||c[p]===void 0)&&(c[p]=a[p]);a=c,h?YV(h,o)(...c):l(null,...c)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function YV(e,t){let n;return r;function r(...l){const o=e.length>l.length;let f;o&&l.push(a);try{f=e.apply(this,l)}catch(c){const h=c;if(o&&n)throw h;return a(h)}o||(f&&f.then&&typeof f.then=="function"?f.then(i,a):f instanceof Error?a(f):i(f))}function a(l,...o){n||(n=!0,t(l,...o))}function i(l){a(null,l)}}const oi={basename:XV,dirname:QV,extname:WV,join:ZV,sep:"/"};function XV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Pd(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else l<0&&(i=!0,l=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function QV(e){if(Pd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function WV(e){Pd(e);let t=e.length,n=-1,r=0,a=-1,i=0,l;for(;t--;){const o=e.codePointAt(t);if(o===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function ZV(...e){let t=-1,n;for(;++t<e.length;)Pd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":JV(n)}function JV(e){Pd(e);const t=e.codePointAt(0)===47;let n=e9(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function e9(e,t){let n="",r=0,a=-1,i=0,l=-1,o,f;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(a===l-1||i===1))if(a!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,i=0;continue}}else if(n.length>0){n="",r=0,a=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,i=0}else o===46&&i>-1?i++:i=-1}return n}function Pd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const t9={cwd:n9};function n9(){return"/"}function Vb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function r9(e){if(typeof e=="string")e=new URL(e);else if(!Vb(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 a9(e)}function a9(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 a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const mx=["history","path","basename","stem","extname","dirname"];class VM{constructor(t){let n;t?Vb(t)?n={path:t}:typeof t=="string"||i9(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":t9.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<mx.length;){const i=mx[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)mx.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?oi.basename(this.path):void 0}set basename(t){yx(t,"basename"),gx(t,"basename"),this.path=oi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?oi.dirname(this.path):void 0}set dirname(t){wk(this.basename,"dirname"),this.path=oi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?oi.extname(this.path):void 0}set extname(t){if(gx(t,"extname"),wk(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=oi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Vb(t)&&(t=r9(t)),yx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?oi.basename(this.path,this.extname):void 0}set stem(t){yx(t,"stem"),gx(t,"stem"),this.path=oi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Er(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function gx(e,t){if(e&&e.includes(oi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+oi.sep+"`")}function yx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function i9(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s9=(function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),l9={}.hasOwnProperty;class pw extends s9{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=KV()}copy(){const t=new pw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(px(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wx("data",this.frozen),this.namespace[t]=n,this):l9.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wx("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 a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ev(t),r=this.parser||this.Parser;return xx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),xx("process",this.parser||this.Parser),bx("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,l){const o=Ev(t),f=r.parse(o);r.run(f,o,function(h,p,m){if(h||!p||!m)return c(h);const y=p,x=r.stringify(y,m);c9(x)?m.value=x:m.result=x,c(h,m)});function c(h,p){h||!p?l(h):i?i(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),xx("processSync",this.parser||this.Parser),bx("processSync",this.compiler||this.Compiler),this.process(t,a),Ek("processSync","process",n),r;function a(i,l){n=!0,xk(i),r=l}}run(t,n,r){Sk(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,o){const f=Ev(n);a.run(t,f,c);function c(h,p,m){const y=p||t;h?o(h):l?l(y):r(void 0,y,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),Ek("runSync","run",r),a;function i(l,o){xk(l),a=o,r=!0}}stringify(t,n){this.freeze();const r=Ev(n),a=this.compiler||this.Compiler;return bx("stringify",a),Sk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(wx("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")f(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...p]=c;f(h,p)}else l(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function l(c){if(!("plugins"in c)&&!("settings"in c))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(c.plugins),c.settings&&(a.settings=px(!0,a.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const p=c[h];i(p)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function f(c,h){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===c){m=p;break}if(m===-1)r.push([c,...h]);else if(h.length>0){let[y,...x]=h;const b=r[m][1];qb(b)&&qb(y)&&(y=px(!0,b,y)),r[m]=[c,y,...x]}}}}const o9=new pw().freeze();function xx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wx(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 Sk(e){if(!qb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ek(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ev(e){return u9(e)?e:new VM(e)}function u9(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function c9(e){return typeof e=="string"||f9(e)}function f9(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const d9="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ck=[],Nk={allowDangerousHtml:!0},h9=/^(https?|ircs?|mailto|xmpp)$/i,v9=[{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 p9(e){const t=m9(e),n=g9(e);return y9(t.runSync(t.parse(n),n),e)}function m9(e){const t=e.rehypePlugins||Ck,n=e.remarkPlugins||Ck,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Nk}:Nk;return o9().use(Q8).use(n).use(HV,r).use(t)}function g9(e){const t=e.children||"",n=new VM;return typeof t=="string"&&(n.value=t),n}function y9(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,l=t.skipHtml,o=t.unwrapDisallowed,f=t.urlTransform||x9;for(const h of v9)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+d9+h.id,void 0);return vw(e,c),_U(e,{Fragment:d.Fragment,components:a,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(h,p,m){if(h.type==="raw"&&m&&typeof p=="number")return l?m.children.splice(p,1):m.children[p]={type:"text",value:h.value},p;if(h.type==="element"){let y;for(y in fx)if(Object.hasOwn(fx,y)&&Object.hasOwn(h.properties,y)){const x=h.properties[y],b=fx[y];(b===null||b.includes(h.tagName))&&(h.properties[y]=f(String(x||""),y,h))}}if(h.type==="element"){let y=n?!n.includes(h.tagName):i?i.includes(h.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(h,p,m)),y&&m&&typeof p=="number")return o&&h.children?m.children.splice(p,1,...h.children):m.children.splice(p,1),p}}}function x9(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||h9.test(e.slice(0,t))?e:""}function kk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function b9(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function w9(e,t,n){const a=im((n||{}).ignore||[]),i=S9(t);let l=-1;for(;++l<i.length;)qM(e,"text",o);function o(c,h){let p=-1,m;for(;++p<h.length;){const y=h[p],x=m?m.children:void 0;if(a(y,x?x.indexOf(y):void 0,m))return;m=y}if(m)return f(c,h)}function f(c,h){const p=h[h.length-1],m=i[l][0],y=i[l][1];let x=0;const w=p.children.indexOf(c);let S=!1,N=[];m.lastIndex=0;let E=m.exec(c.value);for(;E;){const T=E.index,R={index:E.index,input:E.input,stack:[...h,c]};let A=y(...E,R);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?m.lastIndex=T+1:(x!==T&&N.push({type:"text",value:c.value.slice(x,T)}),Array.isArray(A)?N.push(...A):A&&N.push(A),x=T+E[0].length,S=!0),!m.global)break;E=m.exec(c.value)}return S?(x<c.value.length&&N.push({type:"text",value:c.value.slice(x)}),p.children.splice(w,1,...N)):N=[c],w+N.length}}function S9(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 a=n[r];t.push([E9(a[0]),C9(a[1])])}return t}function E9(e){return typeof e=="string"?new RegExp(b9(e),"g"):e}function C9(e){return typeof e=="function"?e:function(){return e}}const Sx="phrasing",Ex=["autolink","link","image","label"];function N9(){return{transforms:[M9],enter:{literalAutolink:T9,literalAutolinkEmail:Cx,literalAutolinkHttp:Cx,literalAutolinkWww:Cx},exit:{literalAutolink:D9,literalAutolinkEmail:R9,literalAutolinkHttp:j9,literalAutolinkWww:A9}}}function k9(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Sx,notInConstruct:Ex},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Sx,notInConstruct:Ex},{character:":",before:"[ps]",after:"\\/",inConstruct:Sx,notInConstruct:Ex}]}}function T9(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Cx(e){this.config.enter.autolinkProtocol.call(this,e)}function j9(e){this.config.exit.autolinkProtocol.call(this,e)}function A9(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 R9(e){this.config.exit.autolinkEmail.call(this,e)}function D9(e){this.exit(e)}function M9(e){w9(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_9],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),O9]],{ignore:["link","linkReference"]})}function _9(e,t,n,r,a){let i="";if(!HM(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!L9(n)))return!1;const l=P9(n+r);if(!l[0])return!1;const o={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function O9(e,t,n,r){return!HM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function L9(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 P9(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 a=kk(e,"(");let i=kk(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function HM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Co(n)||nm(n))&&(!t||n!==47)}GM.peek=G9;function B9(){this.buffer()}function z9(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function I9(){this.buffer()}function F9(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function U9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function q9(e){this.exit(e)}function V9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function H9(e){this.exit(e)}function G9(){return"["}function GM(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const l=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),l(),i+=a.move("]"),i}function $9(){return{enter:{gfmFootnoteCallString:B9,gfmFootnoteCall:z9,gfmFootnoteDefinitionLabelString:I9,gfmFootnoteDefinition:F9},exit:{gfmFootnoteCallString:U9,gfmFootnoteCall:q9,gfmFootnoteDefinitionLabelString:V9,gfmFootnoteDefinition:H9}}}function K9(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:GM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,i,l){const o=i.createTracker(l);let f=o.move("[^");const c=i.enter("footnoteDefinition"),h=i.enter("label");return f+=o.move(i.safe(i.associationId(r),{before:f,after:"]"})),h(),f+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),f+=o.move((t?`
|
|
488
|
+
`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?$M:Y9))),c(),f}}function Y9(e,t,n){return t===0?e:$M(e,t,n)}function $M(e,t,n){return(n?"":" ")+e}const X9=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];KM.peek=eH;function Q9(){return{canContainEols:["delete"],enter:{strikethrough:Z9},exit:{strikethrough:J9}}}function W9(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:X9}],handlers:{delete:KM}}}function Z9(e){this.enter({type:"delete",children:[]},e)}function J9(e){this.exit(e)}function KM(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),i(),l}function eH(){return"~"}function tH(e){return e.length}function nH(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||tH,i=[],l=[],o=[],f=[];let c=0,h=-1;for(;++h<e.length;){const b=[],w=[];let S=-1;for(e[h].length>c&&(c=e[h].length);++S<e[h].length;){const N=rH(e[h][S]);if(n.alignDelimiters!==!1){const E=a(N);w[S]=E,(f[S]===void 0||E>f[S])&&(f[S]=E)}b.push(N)}l[h]=b,o[h]=w}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<c;)i[p]=Tk(r[p]);else{const b=Tk(r);for(;++p<c;)i[p]=b}p=-1;const m=[],y=[];for(;++p<c;){const b=i[p];let w="",S="";b===99?(w=":",S=":"):b===108?w=":":b===114&&(S=":");let N=n.alignDelimiters===!1?1:Math.max(1,f[p]-w.length-S.length);const E=w+"-".repeat(N)+S;n.alignDelimiters!==!1&&(N=w.length+N+S.length,N>f[p]&&(f[p]=N),y[p]=N),m[p]=E}l.splice(1,0,m),o.splice(1,0,y),h=-1;const x=[];for(;++h<l.length;){const b=l[h],w=o[h];p=-1;const S=[];for(;++p<c;){const N=b[p]||"";let E="",T="";if(n.alignDelimiters!==!1){const R=f[p]-(w[p]||0),A=i[p];A===114?E=" ".repeat(R):A===99?R%2?(E=" ".repeat(R/2+.5),T=" ".repeat(R/2-.5)):(E=" ".repeat(R/2),T=E):T=" ".repeat(R)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(E),S.push(N),n.alignDelimiters!==!1&&S.push(T),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==c-1)&&S.push("|")}x.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return x.join(`
|
|
489
|
+
`)}function rH(e){return e==null?"":String(e)}function Tk(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 a=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),iH);return a(),l}function iH(e,t,n){return">"+(n?"":" ")+e}function sH(e,t){return jk(e,t.inConstruct,!0)&&!jk(e,t.notInConstruct,!1)}function jk(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 Ak(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
490
|
+
`&&sH(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
491
|
+
`}function lH(e,t){const n=String(e);let r=n.indexOf(t),a=r,i=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++i>l&&(l=i):i=1,a=r+t.length,r=n.indexOf(t,a);return l}function oH(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 uH(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 cH(e,t,n,r){const a=uH(n),i=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(oH(e,n)){const p=n.enter("codeIndented"),m=n.indentLines(i,fH);return p(),m}const o=n.createTracker(r),f=a.repeat(Math.max(lH(i,a)+1,3)),c=n.enter("codeFenced");let h=o.move(f);if(e.lang){const p=n.enter(`codeFencedLang${l}`);h+=o.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...o.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);h+=o.move(" "),h+=o.move(n.safe(e.meta,{before:h,after:`
|
|
492
|
+
`,encode:["`"],...o.current()})),p()}return h+=o.move(`
|
|
493
|
+
`),i&&(h+=o.move(i+`
|
|
494
|
+
`)),h+=o.move(f),c(),h}function fH(e,t,n){return(n?"":" ")+e}function mw(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 dH(e,t,n,r){const a=mw(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let o=n.enter("label");const f=n.createTracker(r);let c=f.move("[");return c+=f.move(n.safe(n.associationId(e),{before:c,after:"]",...f.current()})),c+=f.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(e.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(o=n.enter("destinationRaw"),c+=f.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
495
|
+
`,...f.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=f.move(" "+a),c+=f.move(n.safe(e.title,{before:c,after:a,...f.current()})),c+=f.move(a),o()),l(),c}function hH(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 od(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wp(e,t,n){const r=sc(e),a=sc(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}YM.peek=vH;function YM(e,t,n,r){const a=hH(n),i=n.enter("emphasis"),l=n.createTracker(r),o=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:o,...l.current()}));const c=f.charCodeAt(0),h=wp(r.before.charCodeAt(r.before.length-1),c,a);h.inside&&(f=od(c)+f.slice(1));const p=f.charCodeAt(f.length-1),m=wp(r.after.charCodeAt(0),p,a);m.inside&&(f=f.slice(0,-1)+od(p));const y=l.move(a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:h.outside},o+f+y}function vH(e,t,n){return n.options.emphasis||"*"}function pH(e,t){let n=!1;return vw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Fb}),!!((!e.depth||e.depth<3)&&lw(e)&&(t.options.setext||n))}function mH(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(pH(e,n)){const h=n.enter("headingSetext"),p=n.enter("phrasing"),m=n.containerPhrasing(e,{...i.current(),before:`
|
|
496
|
+
`,after:`
|
|
497
|
+
`});return p(),h(),m+`
|
|
498
|
+
`+(a===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
|
|
499
|
+
`))+1))}const l="#".repeat(a),o=n.enter("headingAtx"),f=n.enter("phrasing");i.move(l+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
500
|
+
`,...i.current()});return/^[\t ]/.test(c)&&(c=od(c.charCodeAt(0))+c.slice(1)),c=c?l+" "+c:l,n.options.closeAtx&&(c+=" "+l),f(),o(),c}XM.peek=gH;function XM(e){return e.value||""}function gH(){return"<"}QM.peek=yH;function QM(e,t,n,r){const a=mw(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let o=n.enter("label");const f=n.createTracker(r);let c=f.move("![");return c+=f.move(n.safe(e.alt,{before:c,after:"]",...f.current()})),c+=f.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(e.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(o=n.enter("destinationRaw"),c+=f.move(n.safe(e.url,{before:c,after:e.title?" ":")",...f.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=f.move(" "+a),c+=f.move(n.safe(e.title,{before:c,after:a,...f.current()})),c+=f.move(a),o()),c+=f.move(")"),l(),c}function yH(){return"!"}WM.peek=xH;function WM(e,t,n,r){const a=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const o=n.createTracker(r);let f=o.move("![");const c=n.safe(e.alt,{before:f,after:"]",...o.current()});f+=o.move(c+"]["),l();const h=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=h,i(),a==="full"||!c||c!==p?f+=o.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function xH(){return"!"}ZM.peek=bH;function ZM(e,t,n){let r=e.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const l=n.unsafe[i],o=n.compilePattern(l);let f;if(l.atBreak)for(;f=o.exec(r);){let c=f.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(f.index+1)}}return a+r+a}function bH(){return"`"}function JM(e,t){const n=lw(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))}e_.peek=wH;function e_(e,t,n,r){const a=mw(n),i=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let o,f;if(JM(e,n)){const h=n.stack;n.stack=[],o=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),o(),n.stack=h,p}o=n.enter("link"),f=n.enter("label");let c=l.move("[");return c+=l.move(n.containerPhrasing(e,{before:c,after:"](",...l.current()})),c+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(f=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${i}`),c+=l.move(" "+a),c+=l.move(n.safe(e.title,{before:c,after:a,...l.current()})),c+=l.move(a),f()),c+=l.move(")"),o(),c}function wH(e,t,n){return JM(e,n)?"<":"["}t_.peek=SH;function t_(e,t,n,r){const a=e.referenceType,i=n.enter("linkReference");let l=n.enter("label");const o=n.createTracker(r);let f=o.move("[");const c=n.containerPhrasing(e,{before:f,after:"]",...o.current()});f+=o.move(c+"]["),l();const h=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...o.current()});return l(),n.stack=h,i(),a==="full"||!c||c!==p?f+=o.move(p+"]"):a==="shortcut"?f=f.slice(0,-1):f+=o.move("]"),f}function SH(){return"["}function gw(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 EH(e){const t=gw(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 CH(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 n_(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 NH(e,t,n,r){const a=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?CH(n):gw(n);const o=e.ordered?l==="."?")":".":EH(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&h&&(!h.children||!h.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&&(f=!0),n_(n)===l&&h){let p=-1;for(;++p<e.children.length;){const m=e.children[p];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=o),n.bulletCurrent=l;const c=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=i,a(),c}function kH(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 TH(e,t,n,r){const a=kH(n);let i=n.bulletCurrent||gw(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let l=i.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(l-i.length)),o.shift(l);const f=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),h);return f(),c;function h(p,m,y){return m?(y?"":" ".repeat(l))+p:(y?i:i+" ".repeat(l-i.length))+p}}function jH(e,t,n,r){const a=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,r);return i(),a(),l}const AH=im(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RH(e,t,n,r){return(e.children.some(function(l){return AH(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function DH(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}r_.peek=MH;function r_(e,t,n,r){const a=DH(n),i=n.enter("strong"),l=n.createTracker(r),o=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:o,...l.current()}));const c=f.charCodeAt(0),h=wp(r.before.charCodeAt(r.before.length-1),c,a);h.inside&&(f=od(c)+f.slice(1));const p=f.charCodeAt(f.length-1),m=wp(r.after.charCodeAt(0),p,a);m.inside&&(f=f.slice(0,-1)+od(p));const y=l.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:h.outside},o+f+y}function MH(e,t,n){return n.options.strong||"*"}function _H(e,t,n,r){return n.safe(e.value,r)}function OH(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 LH(e,t,n){const r=(n_(n)+(n.options.ruleSpaces?" ":"")).repeat(OH(n));return n.options.ruleSpaces?r.slice(0,-1):r}const a_={blockquote:aH,break:Ak,code:cH,definition:dH,emphasis:YM,hardBreak:Ak,heading:mH,html:XM,image:QM,imageReference:WM,inlineCode:ZM,link:e_,linkReference:t_,list:NH,listItem:TH,paragraph:jH,root:RH,strong:r_,text:_H,thematicBreak:LH};function PH(){return{enter:{table:BH,tableData:Rk,tableHeader:Rk,tableRow:IH},exit:{codeText:FH,table:zH,tableData:Nx,tableHeader:Nx,tableRow:Nx}}}function BH(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 zH(e){this.exit(e),this.data.inTable=void 0}function IH(e){this.enter({type:"tableRow",children:[]},e)}function Nx(e){this.exit(e)}function Rk(e){this.enter({type:"tableCell",children:[]},e)}function FH(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,UH));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function UH(e,t){return t==="|"?t:e}function qH(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
501
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:l,tableCell:f,tableRow:o}};function l(y,x,b,w){return c(h(y,b,w),y.align)}function o(y,x,b,w){const S=p(y,b,w),N=c([S]);return N.slice(0,N.indexOf(`
|
|
502
|
+
`))}function f(y,x,b,w){const S=b.enter("tableCell"),N=b.enter("phrasing"),E=b.containerPhrasing(y,{...w,before:i,after:i});return N(),S(),E}function c(y,x){return nH(y,{align:x,alignDelimiters:r,padding:n,stringLength:a})}function h(y,x,b){const w=y.children;let S=-1;const N=[],E=x.enter("table");for(;++S<w.length;)N[S]=p(w[S],x,b);return E(),N}function p(y,x,b){const w=y.children;let S=-1;const N=[],E=x.enter("tableRow");for(;++S<w.length;)N[S]=f(w[S],y,x,b);return E(),N}function m(y,x,b){let w=a_.inlineCode(y,x,b);return b.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function VH(){return{exit:{taskListCheckValueChecked:Dk,taskListCheckValueUnchecked:Dk,paragraph:GH}}}function HH(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$H}}}function Dk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function GH(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 a=t.children;let i=-1,l;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){l=o;break}}l===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 $H(e,t,n,r){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(l);let f=a_.listItem(e,t,n,{...r,...o.current()});return i&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),f;function c(h){return h+l}}function KH(){return[N9(),$9(),Q9(),PH(),VH()]}function YH(e){return{extensions:[k9(),K9(e),W9(),qH(e),HH()]}}const XH={tokenize:t7,partial:!0},i_={tokenize:n7,partial:!0},s_={tokenize:r7,partial:!0},l_={tokenize:a7,partial:!0},QH={tokenize:i7,partial:!0},o_={name:"wwwAutolink",tokenize:JH,previous:c_},u_={name:"protocolAutolink",tokenize:e7,previous:f_},fs={name:"emailAutolink",tokenize:ZH,previous:d_},Ci={};function WH(){return{text:Ci}}let Zl=48;for(;Zl<123;)Ci[Zl]=fs,Zl++,Zl===58?Zl=65:Zl===91&&(Zl=97);Ci[43]=fs;Ci[45]=fs;Ci[46]=fs;Ci[95]=fs;Ci[72]=[fs,u_];Ci[104]=[fs,u_];Ci[87]=[fs,o_];Ci[119]=[fs,o_];function ZH(e,t,n){const r=this;let a,i;return l;function l(p){return!Hb(p)||!d_.call(r,r.previous)||yw(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(p))}function o(p){return Hb(p)?(e.consume(p),o):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(QH,h,c)(p):p===45||p===95||yr(p)?(i=!0,e.consume(p),f):h(p)}function c(p){return e.consume(p),a=!0,f}function h(p){return i&&a&&Ar(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function JH(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!c_.call(r,r.previous)||yw(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(XH,e.attempt(i_,e.attempt(s_,i),n),n)(l))}function i(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function e7(e,t,n){const r=this;let a="",i=!1;return l;function l(p){return(p===72||p===104)&&f_.call(r,r.previous)&&!yw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(p),e.consume(p),o):n(p)}function o(p){if(Ar(p)&&a.length<5)return a+=String.fromCodePoint(p),e.consume(p),o;if(p===58){const m=a.toLowerCase();if(m==="http"||m==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),i?c:(i=!0,f)):n(p)}function c(p){return p===null||yp(p)||Zt(p)||Co(p)||nm(p)?n(p):e.attempt(i_,e.attempt(s_,h),n)(p)}function h(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function t7(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),i):n(l)}function i(l){return l===null?n(l):t(l)}}function n7(e,t,n){let r,a,i;return l;function l(c){return c===46||c===95?e.check(l_,f,o)(c):c===null||Zt(c)||Co(c)||c!==45&&nm(c)?f(c):(i=!0,e.consume(c),l)}function o(c){return c===95?r=!0:(a=r,r=void 0),e.consume(c),l}function f(c){return a||r||!i?n(c):t(c)}}function r7(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?i(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(l_,t,i)(l):l===null||Zt(l)||Co(l)?t(l):(e.consume(l),a)}function i(l){return l===41&&r++,e.consume(l),a}}function a7(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),i):o===93?(e.consume(o),a):o===60||o===null||Zt(o)||Co(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||Zt(o)||Co(o)?t(o):r(o)}function i(o){return Ar(o)?l(o):n(o)}function l(o){return o===59?(e.consume(o),r):Ar(o)?(e.consume(o),l):n(o)}}function i7(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return yr(i)?n(i):t(i)}}function c_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Zt(e)}function f_(e){return!Ar(e)}function d_(e){return!(e===47||Hb(e))}function Hb(e){return e===43||e===45||e===46||e===95||yr(e)}function yw(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 s7={tokenize:v7,partial:!0};function l7(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:f7,continuation:{tokenize:d7},exit:h7}},text:{91:{name:"gfmFootnoteCall",tokenize:c7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:o7,resolveTo:u7}}}}function o7(e,t,n){const r=this;let a=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return o;function o(f){if(!l||!l._balanced)return n(f);const c=Ha(r.sliceSerialize({start:l.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function u7(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)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function c7(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return o;function o(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(p){if(i>999||p===93&&!l||p===null||p===91||Zt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return a.includes(Ha(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Zt(p)||(l=!0),i++,e.consume(p),p===92?h:c}function h(p){return p===91||p===92||p===93?(e.consume(p),i++,c):c(p)}}function f7(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,o;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(x)}function h(x){if(l>999||x===93&&!o||x===null||x===91||Zt(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return i=Ha(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Zt(x)||(o=!0),l++,e.consume(x),x===92?p:h}function p(x){return x===91||x===92||x===93?(e.consume(x),l++,h):h(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),a.includes(i)||a.push(i),Rt(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function d7(e,t,n){return e.check(Ld,t,e.attempt(s7,t,n))}function h7(e){e.exit("gfmFootnoteDefinition")}function v7(e,t,n){const r=this;return Rt(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(i):n(i)}}function p7(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,o){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let c=f;for(;c--;)if(l[c][0]==="exit"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[c][1].end.offset-l[c][1].start.offset){l[f][1].type="strikethroughSequence",l[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},l[c][1].start),end:Object.assign({},l[f][1].end)},p={type:"strikethroughText",start:Object.assign({},l[c][1].end),end:Object.assign({},l[f][1].start)},m=[["enter",h,o],["enter",l[c][1],o],["exit",l[c][1],o],["enter",p,o]],y=o.parser.constructs.insideSpan.null;y&&ua(m,m.length,0,rm(y,l.slice(c+1,f),o)),ua(m,m.length,0,[["exit",p,o],["enter",l[f][1],o],["exit",l[f][1],o],["exit",h,o]]),ua(l,c-1,f-c+3,m),f=c+m.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function i(l,o,f){const c=this.previous,h=this.events;let p=0;return m;function m(x){return c===126&&h[h.length-1][1].type!=="characterEscape"?f(x):(l.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const b=sc(c);if(x===126)return p>1?f(x):(l.consume(x),p++,y);if(p<2&&!n)return f(x);const w=l.exit("strikethroughSequenceTemporary"),S=sc(x);return w._open=!S||S===2&&!!b,w._close=!b||b===2&&!!S,o(x)}}}class m7{constructor(){this.map=[]}add(t,n,r){g7(this,t,n,r)}consume(t){if(this.map.sort(function(i,l){return i[0]-l[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 a=r.pop();for(;a;){for(const i of a)t.push(i);a=r.pop()}this.map.length=0}}function g7(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function y7(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function x7(){return{flow:{null:{name:"table",tokenize:b7,resolveAll:w7}}}}function b7(e,t,n){const r=this;let a=0,i=0,l;return o;function o(M){let z=r.events.length-1;for(;z>-1;){const G=r.events[z][1].type;if(G==="lineEnding"||G==="linePrefix")z--;else break}const B=z>-1?r.events[z][1].type:null,H=B==="tableHead"||B==="tableRow"?A:f;return H===A&&r.parser.lazy[r.now().line]?n(M):H(M)}function f(M){return e.enter("tableHead"),e.enter("tableRow"),c(M)}function c(M){return M===124||(l=!0,i+=1),h(M)}function h(M){return M===null?n(M):rt(M)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),y):n(M):Nt(M)?Rt(e,h,"whitespace")(M):(i+=1,l&&(l=!1,a+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),l=!0,h):(e.enter("data"),p(M)))}function p(M){return M===null||M===124||Zt(M)?(e.exit("data"),h(M)):(e.consume(M),M===92?m:p)}function m(M){return M===92||M===124?(e.consume(M),p):p(M)}function y(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),l=!1,Nt(M)?Rt(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):x(M))}function x(M){return M===45||M===58?w(M):M===124?(l=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),b):R(M)}function b(M){return Nt(M)?Rt(e,w,"whitespace")(M):w(M)}function w(M){return M===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),S):M===45?(i+=1,S(M)):M===null||rt(M)?T(M):R(M)}function S(M){return M===45?(e.enter("tableDelimiterFiller"),N(M)):R(M)}function N(M){return M===45?(e.consume(M),N):M===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(M))}function E(M){return Nt(M)?Rt(e,T,"whitespace")(M):T(M)}function T(M){return M===124?x(M):M===null||rt(M)?!l||a!==i?R(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):R(M)}function R(M){return n(M)}function A(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||rt(M)?(e.exit("tableRow"),t(M)):Nt(M)?Rt(e,D,"whitespace")(M):(e.enter("data"),_(M))}function _(M){return M===null||M===124||Zt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?L:_)}function L(M){return M===92||M===124?(e.consume(M),_):_(M)}}function w7(e,t){let n=-1,r=!0,a=0,i=[0,0,0,0],l=[0,0,0,0],o=!1,f=0,c,h,p;const m=new m7;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(o=!1,f!==0&&(Mk(m,t,f,c,h),h=void 0,f=0),c={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",c,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,p=void 0,i=[0,0,0,0],l=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",h,t]])),a=x.type==="tableDelimiterRow"?2:h?3:1):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],p=Cv(m,t,i,a,void 0,p),i=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],p=Cv(m,t,i,a,void 0,p)),i=l,l=[i[1],n,0,0])):x.type==="tableHead"?(o=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,i[1]!==0?(l[0]=l[1],p=Cv(m,t,i,a,n,p)):l[1]!==0&&(p=Cv(m,t,l,a,n,p)),a=0):a&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Mk(m,t,f,c,h),m.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=y7(t.events,n))}return e}function Cv(e,t,n,r,a,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},_u(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const f=_u(t.events,n[1]);if(i={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=_u(t.events,n[2]),h=_u(t.events,n[3]),p={type:o,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const m=t.events[n[2]],y=t.events[n[3]];if(m[1].end=Object.assign({},y[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,b=n[3]-n[2]-1;e.add(x,b,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return a!==void 0&&(i.end=Object.assign({},_u(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function Mk(e,t,n,r,a){const i=[],l=_u(t.events,n);a&&(a.end=Object.assign({},l),i.push(["exit",a,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function _u(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const S7={name:"tasklistCheck",tokenize:C7};function E7(){return{text:{91:S7}}}function C7(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),i)}function i(f){return Zt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(f)}function o(f){return rt(f)?t(f):Nt(f)?e.check({tokenize:N7},t,n)(f):n(f)}}function N7(e,t,n){return Rt(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function k7(e){return EM([WH(),l7(),p7(e),x7(),E7()])}const T7={};function j7(e){const t=this,n=e||T7,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(k7(n)),i.push(KH()),l.push(YH(n))}function Rr({content:e,className:t,compact:n=!1}){return d.jsx("div",{className:ke(n?"prose-myco-compact":"prose-myco",t),children:d.jsx(p9,{remarkPlugins:[j7],children:e})})}const A7={info:"bg-primary",success:"bg-green-500",warning:"bg-secondary",error:"bg-tertiary"},R7={info:z1,success:vc,warning:uD,error:Mr},_k={unread:"New",read:"Earlier"},D7="notification-panel";function M7(e){const t=Math.floor(Date.now()/1e3)-e;if(t<60)return"just now";const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Ok({title:e,count:t}){return d.jsxs("div",{className:"flex items-center justify-between px-1",children:[d.jsx("span",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-on-surface-variant",children:e}),d.jsx("span",{className:"text-[11px] text-on-surface-variant/70",children:t})]})}function Lk({notification:e,onOpen:t,onDismiss:n}){const r=R7[e.level],a=e.status==="unread";return d.jsx("div",{onClick:()=>t(e),className:ke("group cursor-pointer rounded-lg border border-transparent px-4 py-3 transition-colors hover:border-outline-variant/20 hover:bg-surface-container-high/70",a&&"border-primary/10 bg-primary/[0.04]"),children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsxs("div",{className:"relative mt-0.5 shrink-0",children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-surface-container-high text-on-surface-variant",children:d.jsx(r,{className:"h-4 w-4"})}),a&&d.jsx("span",{className:ke("absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full ring-2 ring-surface-container",A7[e.level])})]}),d.jsx("div",{className:"min-w-0 flex-1 space-y-1",children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 space-y-1",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("span",{className:ke("text-sm font-medium",a?"text-on-surface":"text-on-surface-variant"),children:e.title}),d.jsx("span",{className:"rounded-full bg-surface-container-high px-2 py-0.5 text-[10px] uppercase tracking-wider text-on-surface-variant",children:e.domain})]}),e.message&&d.jsx(Rr,{content:e.message,compact:!0,className:"line-clamp-3 text-xs leading-5 text-on-surface-variant"})]}),d.jsxs("div",{className:"flex shrink-0 items-start gap-2",children:[d.jsx("span",{className:"pt-0.5 text-[10px] font-mono text-on-surface-variant/70",children:M7(e.created_at)}),d.jsx("button",{onClick:i=>n(i,e),className:"rounded p-0.5 text-on-surface-variant/40 opacity-0 transition hover:text-on-surface-variant group-hover:opacity-100","aria-label":"Dismiss",children:d.jsx(kl,{className:"h-3.5 w-3.5"})})]})]})})]})})}function _7({open:e,onClose:t}){const{data:n,refetch:r}=ew({limit:50}),a=oM(),i=JF(),l=ZF(),o=Wa();j.useEffect(()=>{e&&r()},[e,r]),j.useEffect(()=>{if(!e)return;const x=b=>{b.key==="Escape"&&(b.preventDefault(),t())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,t]);const f=j.useCallback(x=>{x.status==="unread"&&a.mutate({id:x.id,status:"read"}),x.link&&(o(x.link,{state:{source:D7,triggeredAt:Date.now()}}),t())},[a,o,t]),c=j.useCallback((x,b)=>{x.stopPropagation(),a.mutate({id:b.id,status:"dismissed"})},[a]),h=((n==null?void 0:n.items)??[]).filter(x=>x.status!=="dismissed"),p=(n==null?void 0:n.unread_count)??0,m=h.filter(x=>x.status==="unread"),y=h.filter(x=>x.status!=="unread");return d.jsxs(d.Fragment,{children:[e&&d.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/40 backdrop-blur-sm transition-opacity",onClick:t,"aria-hidden":"true"}),d.jsxs("aside",{className:ke("fixed top-0 right-0 bottom-0 z-50 flex w-96 max-w-[calc(100vw-3rem)] flex-col border-l border-outline-variant/20 bg-surface-container shadow-2xl transition-transform duration-200 ease-out",e?"translate-x-0":"translate-x-full"),children:[d.jsx("div",{className:"border-b border-outline-variant/20 px-4 py-4",children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(vp,{className:"h-4 w-4 text-primary"}),d.jsx("h2",{className:"text-sm font-medium text-on-surface",children:"Notifications"}),p>0&&d.jsx("span",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary/15 px-1.5 text-xs font-medium text-primary",children:p})]}),d.jsx("p",{className:"text-xs text-on-surface-variant",children:"New items stay here until read or dismissed."})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[p>0&&d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>i.mutate(void 0),title:"Mark all as read",className:"h-7 gap-1 px-2 text-xs text-on-surface-variant",children:[d.jsx(Gz,{className:"h-3.5 w-3.5"}),"Mark all read"]}),h.length>0&&d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>l.mutate(void 0),title:"Clear all notifications",className:"h-7 gap-1 px-2 text-xs text-on-surface-variant",children:[d.jsx(ss,{className:"h-3.5 w-3.5"}),"Clear"]}),d.jsx(Ae,{variant:"ghost",size:"sm",onClick:t,className:"h-7 px-2",children:d.jsx(kl,{className:"h-4 w-4"})})]})]})}),d.jsx("div",{className:"flex-1 overflow-y-auto",children:h.length===0?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 px-6 text-center",children:[d.jsx(vp,{className:"h-5 w-5 text-on-surface-variant/50"}),d.jsx("div",{className:"text-sm text-on-surface-variant",children:"No notifications yet"}),d.jsx("div",{className:"text-xs text-on-surface-variant/70",children:"New events will appear here whether they display as banners or summary-only items."})]}):d.jsxs("div",{className:"space-y-4 px-3 py-3",children:[m.length>0&&d.jsxs("section",{className:"space-y-2",children:[d.jsx(Ok,{title:_k.unread,count:m.length}),d.jsx("div",{className:"space-y-2",children:m.map(x=>d.jsx(Lk,{notification:x,onOpen:f,onDismiss:c},x.id))})]}),y.length>0&&d.jsxs("section",{className:"space-y-2",children:[d.jsx(Ok,{title:_k.read,count:y.length}),d.jsx("div",{className:"space-y-2",children:y.map(x=>d.jsx(Lk,{notification:x,onOpen:f,onDismiss:c},x.id))})]})]})})]})]})}function Bd(){const e=Sn(),t=qt({queryKey:["config"],queryFn:({signal:r})=>lt("/config",{signal:r})}),n=fr({mutationFn:r=>mc("/config",r),onSuccess:()=>e.invalidateQueries({queryKey:["config"]})});return{config:t.data,isLoading:t.isLoading,error:t.error,saveConfig:n.mutateAsync,isSaving:n.isPending,saveError:n.error}}function O7(){var a;const{config:e}=Bd(),t=((a=e==null?void 0:e.notifications)==null?void 0:a.system_notifications)??!1,{data:n}=ew({status:"unread",mode:"banner",limit:5}),r=j.useRef(new Set);return j.useEffect(()=>{t&&"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[t]),j.useEffect(()=>{if(!t||!("Notification"in window)||Notification.permission!=="granted"||document.hasFocus())return;const i=(n==null?void 0:n.items)??[];for(const l of i)r.current.has(l.id)||(r.current.add(l.id),L7(l))},[t,n]),null}function L7(e){try{new window.Notification(e.title,{body:e.message??void 0,tag:e.id,icon:"/favicon.svg"})}catch{}}const P7=[{to:"/",label:"Dashboard",icon:Vz},{to:"/sessions",label:"Sessions",icon:$p},{to:"/mycelium",label:"Mycelium",icon:sD},{to:"/skills",label:"Skills",icon:F1},{to:"/agent",label:"Agent",icon:Rd},{to:"/settings",label:"Settings",icon:Zz},{to:"/operations",label:"Operations",icon:cD},{to:"/team",label:"Team",icon:sI},{to:"/logs",label:"Logs",icon:oD}],B7=[{value:"default",label:"Default"},{value:"geist-mono",label:"Geist Mono"},{value:"system",label:"System"},{value:"sf-mono",label:"SF Mono"},{value:"fira-code",label:"Fira Code"},{value:"jetbrains-mono",label:"JetBrains"}],h_={compact:.85,normal:1,comfy:1.15},z7={compact:"Compact",normal:"Normal",comfy:"Comfy"},Mf=["compact","normal","comfy"],Pk="myco-ui-sidebar-collapsed",Bk=768,v_="myco-ui-density",I7="--density",F7="normal";function U7(){const e=localStorage.getItem(v_);return e&&e in h_?e:F7}function q7(e){const t=h_[e];document.documentElement.style.setProperty(I7,String(t)),document.documentElement.style.fontSize=`calc(14px * ${t})`}function V7(){const[e,t]=j.useState(U7),n=j.useCallback(r=>{localStorage.setItem(v_,r),t(r)},[]);return j.useEffect(()=>{q7(e)},[e]),{density:e,setDensity:n}}function H7(){const[e,t]=j.useState(()=>localStorage.getItem(Pk)==="true"),n=j.useCallback(()=>{t(r=>{const a=!r;return localStorage.setItem(Pk,String(a)),a})},[]);return{collapsed:e,toggle:n}}function G7(){const[e,t]=j.useState(!1),[n,r]=j.useState(()=>typeof window<"u"&&window.innerWidth<Bk);j.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Bk-1}px)`),f=c=>{r(c.matches),c.matches||t(!1)};return o.addEventListener("change",f),()=>o.removeEventListener("change",f)},[]);const a=La();j.useEffect(()=>{t(!1)},[a.pathname]),j.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]);const i=j.useCallback(()=>t(o=>!o),[]),l=j.useCallback(()=>t(!1),[]);return{open:e,isMobile:n,toggle:i,close:l}}const kx=["light","dark","system"],$7={light:nI,dark:Yz,system:iD},K7={light:"Light",dark:"Dark",system:"System"};function Y7({collapsed:e=!1}){const{theme:t,setTheme:n}=pz(),r=()=>{const l=kx.indexOf(t),o=kx[(l+1)%kx.length];n(o)},a=$7[t]??iD,i=K7[t]??"System";return d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:r,title:e?`${i} mode`:void 0,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[d.jsx(a,{className:"h-4 w-4"}),!e&&d.jsx("span",{children:i})]})}function X7({collapsed:e=!1}){const{restart:t,isRestarting:n}=G1();return d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t(),disabled:n,title:e?n?"Restarting...":"Restart Daemon":void 0,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),children:[d.jsx(Kp,{className:ke("h-4 w-4",n&&"animate-spin")}),!e&&d.jsx("span",{children:n?"Restarting...":"Restart Daemon"})]})}function Q7(){const{font:e,setFont:t}=wz();return d.jsxs("label",{className:"flex items-center gap-2 px-2 py-1 text-sm text-on-surface-variant hover:text-on-surface cursor-pointer",children:[d.jsx(aI,{className:"h-4 w-4 shrink-0"}),d.jsx("select",{value:e,onChange:n=>t(n.target.value),className:"w-full bg-transparent border-none outline-none cursor-pointer text-sm appearance-none",children:B7.map(n=>d.jsx("option",{value:n.value,children:n.label},n.value))})]})}function W7({density:e,setDensity:t}){const n=Mf.indexOf(e),r=()=>{const i=Mf[n-1];n>0&&i!==void 0&&t(i)},a=()=>{const i=Mf[n+1];n<Mf.length-1&&i!==void 0&&t(i)};return d.jsxs("div",{className:"flex items-center gap-1 px-3 py-1",children:[d.jsx("button",{onClick:r,disabled:n===0,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Decrease density",children:d.jsx(Kz,{className:"h-3 w-3"})}),d.jsx("div",{className:"flex flex-1 justify-center",children:d.jsx("span",{className:"text-xs text-on-surface-variant select-none",children:z7[e]})}),d.jsx("button",{onClick:a,disabled:n===Mf.length-1,className:"rounded p-0.5 text-on-surface-variant hover:text-on-surface disabled:opacity-30","aria-label":"Increase density",children:d.jsx(Xz,{className:"h-3 w-3"})})]})}function Z7({collapsed:e}){const{data:t}=pD(),n=!!(t&&!t.exempt&&t.update_available),r=n?"/operations?tab=system":"/operations";return d.jsxs(L1,{to:r,title:e?"Operations":void 0,className:({isActive:a})=>ke("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",a?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[d.jsx(cD,{className:"h-4 w-4 shrink-0"}),!e&&"Operations",n&&d.jsx("span",{className:"h-2 w-2 rounded-full bg-secondary shrink-0 ml-auto"})]})}function zk({collapsed:e,vaultName:t,density:n,setDensity:r,onSearchOpen:a,onNotificationsOpen:i,unreadCount:l,onCollapseToggle:o,showCollapseToggle:f}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:ke("px-4 py-5",e&&"px-2 py-4 flex justify-center"),children:e?d.jsxs("div",{className:"relative flex items-center",children:[d.jsx("span",{className:"font-serif text-base text-primary",children:"m"}),d.jsx("span",{className:"ml-1 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}):d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),d.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-on-surface-variant/40"})]}),t&&d.jsx("span",{className:"font-mono text-xs text-outline uppercase tracking-widest mt-0.5",children:t})]})}),d.jsxs("div",{className:"px-2 pt-2 pb-1 space-y-0.5",children:[d.jsxs("button",{type:"button",onClick:a,title:e?"Search (⌘K)":void 0,className:ke("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[d.jsx(pc,{className:"h-4 w-4 shrink-0"}),!e&&d.jsx("span",{className:"flex-1 text-left",children:"Search"}),!e&&d.jsxs("kbd",{className:"text-xs text-on-surface-variant/60 font-mono",children:["⌘","K"]})]}),d.jsxs("button",{type:"button",onClick:i,title:e?"Notifications":void 0,className:ke("flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface",e?"justify-center px-2 py-2":"gap-3 px-3 py-2"),children:[d.jsx(vp,{className:"h-4 w-4 shrink-0"}),!e&&d.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),l>0&&d.jsx("span",{className:ke("h-2 w-2 rounded-full bg-primary shrink-0",!e&&"ml-auto")})]})]}),d.jsx("nav",{className:"flex-1 space-y-1 px-2 py-2","aria-label":"Main navigation",children:P7.map(c=>c.to==="/operations"?d.jsx(Z7,{collapsed:e},c.to):d.jsxs(L1,{to:c.to,end:c.to==="/",title:e?c.label:void 0,className:({isActive:h})=>ke("flex items-center rounded-md text-sm font-medium transition-colors",e?"justify-center px-2 py-2":"gap-3 px-3 py-2",h?"bg-primary/10 text-primary":"text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface"),children:[d.jsx(c.icon,{className:"h-4 w-4 shrink-0"}),!e&&c.label]},c.to))}),d.jsxs("div",{className:ke("py-3 space-y-1 mt-auto",e?"px-1 flex flex-col items-center":"px-2"),children:[d.jsx(X7,{collapsed:e}),!e&&d.jsx(Q7,{}),!e&&d.jsx(W7,{density:n,setDensity:r}),d.jsx(Y7,{collapsed:e})]}),f&&o&&d.jsx("div",{className:ke("px-2 py-2",e&&"flex justify-center"),children:d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:o,className:ke("text-on-surface-variant hover:text-on-surface",e?"w-8 p-0 justify-center":"w-full justify-start gap-2"),title:e?"Expand sidebar":"Collapse sidebar",children:[e?d.jsx(da,{className:"h-4 w-4"}):d.jsx(P1,{className:"h-4 w-4"}),!e&&d.jsx("span",{children:"Collapse"})]})})]})}function J7(){const{collapsed:e,toggle:t}=H7(),{density:n,setDensity:r}=V7(),{data:a}=Yp(),i=a==null?void 0:a.vault.name,[l,o]=j.useState(!1),[f,c]=j.useState(!1),{data:h}=QF(),p=(h==null?void 0:h.count)??0,m=G7();j.useEffect(()=>{const w=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),o(N=>!N))};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[]),j.useEffect(()=>{if(!m.open)return;const w=S=>{S.key==="Escape"&&(S.preventDefault(),m.close())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[m.open,m.close]);const y=j.useCallback(()=>o(!0),[]),x=j.useCallback(()=>c(!0),[]),b=j.useCallback(()=>c(!1),[]);return d.jsxs("div",{className:"flex h-screen bg-background",children:[d.jsx(YF,{open:l,onOpenChange:o}),d.jsx(aU,{}),d.jsx(_7,{open:f,onClose:b}),d.jsx(O7,{}),m.isMobile&&d.jsxs("div",{className:"fixed top-0 left-0 right-0 z-40 flex h-12 items-center gap-3 border-b border-outline-variant/20 bg-surface-container px-3",children:[d.jsx("button",{type:"button",onClick:m.toggle,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":m.open?"Close navigation":"Open navigation",children:m.open?d.jsx(kl,{className:"h-5 w-5"}):d.jsx($z,{className:"h-5 w-5"})}),d.jsx("span",{className:"font-serif text-base text-primary tracking-wider",children:"myco"}),i&&d.jsx("span",{className:"font-mono text-[10px] text-outline uppercase tracking-widest",children:i}),d.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d.jsxs("button",{type:"button",onClick:x,className:"relative rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Notifications",children:[d.jsx(vp,{className:"h-4 w-4"}),p>0&&d.jsx("span",{className:"absolute top-0.5 right-0.5 h-2 w-2 rounded-full bg-primary"})]}),d.jsx("button",{type:"button",onClick:y,className:"rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface","aria-label":"Search",children:d.jsx(pc,{className:"h-4 w-4"})})]})]}),m.isMobile&&m.open&&d.jsx("div",{className:"fixed inset-0 z-40 bg-surface-dim/60 backdrop-blur-sm transition-opacity",onClick:m.close,"aria-hidden":"true"}),m.isMobile&&d.jsx("aside",{className:ke("fixed top-12 left-0 bottom-0 z-50 w-64 flex flex-col bg-surface-container transition-transform duration-200 ease-out",m.open?"translate-x-0":"-translate-x-full"),children:d.jsx(zk,{collapsed:!1,vaultName:i,density:n,setDensity:r,onSearchOpen:y,onNotificationsOpen:x,unreadCount:p,showCollapseToggle:!1})}),!m.isMobile&&d.jsx("aside",{className:ke("flex flex-col bg-surface-container transition-[width] duration-200",e?"w-14":"w-56"),children:d.jsx(zk,{collapsed:e,vaultName:i,density:n,setDensity:r,onSearchOpen:y,onNotificationsOpen:x,unreadCount:p,onCollapseToggle:t,showCollapseToggle:!0})}),d.jsx("main",{className:ke("flex-1 overflow-auto bg-surface",m.isMobile&&"pt-12"),"aria-label":"Page content",children:d.jsx(RB,{})})]})}function xw({isLoading:e,error:t,loadingText:n="Loading...",children:r}){return e?d.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(jn,{className:"h-5 w-5 animate-spin"}),d.jsx("span",{className:"font-sans text-sm",children:n})]}):t?d.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to connect to daemon"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:t.message})]}):d.jsx(d.Fragment,{children:r})}const hl=60,lo=3600,Jf=86400,Aa=1e3;function bw(e){if(e<hl)return`${Math.floor(e)}s`;if(e<lo)return`${Math.floor(e/hl)}m`;if(e<Jf){const r=Math.floor(e/lo),a=Math.floor(e%lo/hl);return`${r}h ${a}m`}const t=Math.floor(e/Jf),n=Math.floor(e%Jf/lo);return`${t}d ${n}h`}function lm(e){const t=(Date.now()-new Date(e).getTime())/Aa;return t<hl?"just now":t<lo?`${Math.floor(t/hl)}m ago`:t<Jf?`${Math.floor(t/lo)}h ago`:`${Math.floor(t/Jf)}d ago`}function wi(e){return lm(new Date(e*Aa).toISOString())}function Gb(e){return new Date(e*Aa).toLocaleString()}function Sp(e,t){return e?e.length>t?e.slice(0,t)+"…":e:""}const eG=8;function vl(e){return e?e.slice(0,eG):""}function tG(e){return e.split("/").pop()||e}function ww(e){return e.charAt(0).toUpperCase()+e.slice(1)}function om(e,t){if(e===null||t===null)return"—";const n=(t-e)*Aa;if(n<Aa)return`${n}ms`;if(n<hl*Aa)return`${(n/Aa).toFixed(1)}s`;const r=Math.floor(n/(hl*Aa)),a=Math.floor(n%(hl*Aa)/Aa);return`${r}m ${a}s`}function nG(e){return e===null?"—":e<Aa?`${e}ms`:`${(e/Aa).toFixed(1)}s`}function $b(e,t){if(e.trim()==="")return t;const n=Number(e);return Number.isFinite(n)?n:t}function um(e){return e!==null?wi(e):"—"}const Nv=1024,Ik=["KB","MB","GB","TB"];function xo(e){if(e<Nv)return`${e} B`;let t=e/Nv,n=0;for(;t>=Nv&&n<Ik.length-1;)t/=Nv,n++;const r=t>=100?0:1;return`${t.toFixed(r)} ${Ik[n]}`}const Fk=100,rG=1;function aG(e){const{embedded_count:t,total_embeddable:n}=e.embedding;return n===0?Fk:Number((t/n*Fk).toFixed(rG))}function iG(e){const t=e.agent.last_run_status==="error",n=e.embedding.queue_depth>0||e.unprocessed_batches>0;return t?"Issues detected in the network":n?"Work in progress across the network":"Network Topology Active"}function sG(e){return e.embedding.queue_depth>0||e.unprocessed_batches>0}function lG({active:e}){const t=e?"animate-pulse-slow":"";return d.jsxs("svg",{className:"absolute inset-0 w-full h-full opacity-20 pointer-events-none",viewBox:"0 0 400 300",preserveAspectRatio:"xMidYMid slice",children:[d.jsx("path",{d:"M200,280 Q200,220 200,160",fill:"none",stroke:"var(--primary)",strokeWidth:"2",className:t}),d.jsx("path",{d:"M200,200 Q240,170 280,180",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),d.jsx("path",{d:"M200,170 Q160,140 120,155",fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",className:t}),d.jsx("path",{d:"M200,160 Q230,110 270,90",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),d.jsx("path",{d:"M200,160 Q170,110 130,80",fill:"none",stroke:"var(--secondary)",strokeWidth:"1",className:t}),d.jsx("path",{d:"M280,180 Q310,170 340,190",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),d.jsx("path",{d:"M120,155 Q90,145 60,160",fill:"none",stroke:"var(--tertiary)",strokeWidth:"0.8",opacity:"0.5"}),d.jsx("circle",{cx:"280",cy:"180",r:"3",fill:"var(--primary)",opacity:"0.7"}),d.jsx("circle",{cx:"120",cy:"155",r:"3",fill:"var(--secondary)",opacity:"0.7"}),d.jsx("circle",{cx:"270",cy:"90",r:"2.5",fill:"var(--tertiary)",opacity:"0.6"}),d.jsx("circle",{cx:"130",cy:"80",r:"2.5",fill:"var(--secondary)",opacity:"0.6"}),d.jsx("circle",{cx:"340",cy:"190",r:"2",fill:"var(--tertiary)",opacity:"0.4"}),d.jsx("circle",{cx:"60",cy:"160",r:"2",fill:"var(--primary)",opacity:"0.4"}),d.jsx("circle",{cx:"200",cy:"160",r:"4",fill:"var(--primary)",className:e?"animate-pulse":""})]})}function oG({stats:e}){const t=aG(e),n=iG(e),r=sG(e),a=e.daemon.active_sessions.length,i=bw(e.daemon.uptime_seconds);return d.jsxs("section",{className:"relative flex items-center justify-center rounded-xl overflow-hidden glass-panel border border-outline-variant/10 min-h-[320px]",children:[d.jsx(lG,{active:r}),d.jsxs("div",{className:"text-center relative z-20 space-y-3 py-12",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-on-surface-variant/80",children:n}),d.jsx("h1",{className:"font-serif text-5xl italic text-on-surface drop-shadow-sm",children:"Myco"}),d.jsxs("p",{className:"font-mono text-sm text-outline",children:["Node connectivity at ",t,"% capacity"]}),d.jsxs("div",{className:"flex items-center justify-center gap-6 pt-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-sage shadow-sage-glow animate-pulse"}),d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[a," active ",a===1?"session":"sessions"]})]}),d.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:[e.vault.spore_count," spores"]})}),d.jsx("div",{className:"h-3 w-px bg-outline-variant/30"}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("span",{className:"font-mono text-[11px] text-on-surface/70",children:["uptime ",i]})})]})]})]})}function uG({data:e,width:t=120,height:n=40,className:r}){if(e.length<2)return null;const a=Math.min(...e),l=Math.max(...e)-a||1,o=e.map((h,p)=>({x:p/(e.length-1)*t,y:n-(h-a)/l*n}));let f=`M ${o[0].x} ${o[0].y}`;for(let h=0;h<o.length-1;h++){const p=o[Math.max(0,h-1)],m=o[h],y=o[h+1],x=o[Math.min(o.length-1,h+2)],b=m.x+(y.x-p.x)/6,w=m.y+(y.y-p.y)/6,S=y.x-(x.x-m.x)/6,N=y.y-(x.y-m.y)/6;f+=` C ${b} ${w}, ${S} ${N}, ${y.x} ${y.y}`}const c=`${f} L ${t} ${n} L 0 ${n} Z`;return d.jsxs("svg",{width:t,height:n,className:r,viewBox:`0 0 ${t} ${n}`,children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:"sparkline-fill",x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:"var(--primary)",stopOpacity:"0.2"}),d.jsx("stop",{offset:"100%",stopColor:"var(--primary)",stopOpacity:"0"})]})}),d.jsx("path",{d:c,fill:"url(#sparkline-fill)"}),d.jsx("path",{d:f,fill:"none",stroke:"var(--primary)",strokeWidth:"1.5",strokeOpacity:"0.8"})]})}const cG={sage:"border-t-sage",ochre:"border-t-ochre",terracotta:"border-t-terracotta",outline:"border-t-outline"},fG={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta",outline:"text-on-surface"};function Yt({label:e,value:t,sublabel:n,accent:r,sparklineData:a,className:i,href:l}){const o=ke("rounded-lg border border-outline-variant/10 bg-surface-container/60 p-4 border-t-2 transition-[border-color,background-color] duration-200 hover:border-outline-variant/25 hover:bg-surface-container/80",l&&"cursor-pointer",cG[r],i),f=d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-outline mb-2",children:e}),d.jsxs("div",{className:"flex items-end justify-between gap-2",children:[d.jsx("p",{className:ke("font-serif text-2xl font-bold",fG[r]),children:t}),a&&a.length>=2&&d.jsx(uG,{data:a,width:80,height:28,className:"opacity-60"})]}),n&&d.jsx("p",{className:"font-mono text-[10px] text-outline mt-1",children:n})]});return l?d.jsx(Ma,{to:l,className:ke(o,"block no-underline"),children:f}):d.jsx("div",{className:o,children:f})}function dG({stats:e}){const t=e.embedding.total_embeddable>0?Math.round(e.embedding.embedded_count/e.embedding.total_embeddable*100):0,n=e.digest.tiers_available.length>0?`${e.digest.tiers_available.length} tiers`:"None",r=e.agent.last_run_at?wi(e.agent.last_run_at):"Never";return d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[d.jsx(Yt,{label:"Sessions",value:String(e.vault.session_count),sublabel:`${e.daemon.active_sessions.length} active`,accent:"sage",href:"/sessions"}),d.jsx(Yt,{label:"Spores",value:String(e.vault.spore_count),sublabel:`${e.vault.entity_count} entities`,accent:"sage",href:"/mycelium?tab=spores"}),d.jsx(Yt,{label:"Embedding",value:`${t}%`,sublabel:`${e.embedding.embedded_count}/${e.embedding.total_embeddable}`,accent:e.embedding.queue_depth>0?"ochre":"sage",href:"/operations"}),d.jsx(Yt,{label:"Agent",value:`${e.agent.total_runs}`,sublabel:`last: ${r}`,accent:e.agent.last_run_status==="error"?"terracotta":"outline",href:"/agent"}),d.jsx(Yt,{label:"Digest",value:n,sublabel:e.digest.generated_at?wi(e.digest.generated_at):void 0,accent:"outline",href:"/mycelium?tab=digest"}),d.jsx(Yt,{label:"Uptime",value:bw(e.daemon.uptime_seconds),sublabel:`v${e.daemon.version}`,accent:"outline"})]})}function p_(e=20){return Qr({queryKey:["activity",e],queryFn:({signal:t})=>lt(`/activity?limit=${e}`,{signal:t}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function hG(e){return e==="agent_run"?"ochre":e==="spore"?"sage":e.includes("error")||e.includes("fail")?"terracotta":"sage"}function vG(e){switch(e){case"sage":return{label:"STABLE",dotClass:"bg-sage shadow-sage-glow"};case"ochre":return{label:"ACTIVE",dotClass:"bg-ochre shadow-ochre-glow"};case"terracotta":return{label:"WARNING",dotClass:"bg-terracotta shadow-terracotta-glow"}}}const pG={sage:"border-l-sage",ochre:"border-l-ochre",terracotta:"border-l-terracotta"},mG={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},gG={sage:"text-sage",ochre:"text-ochre",terracotta:"text-terracotta"},yG={sage:"border-sage/20",ochre:"border-ochre/20",terracotta:"border-terracotta/20"};function xG(e){return`#${e.slice(-6).toUpperCase()}`}function Uk(e){return e.summary}function bG({event:e}){const t=Wa(),n=hG(e.type),r=vG(n),a=wi(e.timestamp),i=e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null;return d.jsxs("div",{className:ke("p-5 rounded-lg border-l-4 bg-surface-container/60 hover:bg-surface-container-high group hover-lift transition-colors",i&&"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",pG[n]),onClick:()=>i&&t(i),onKeyDown:l=>{i&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t(i))},tabIndex:i?0:void 0,role:i?"link":void 0,"aria-label":`${Uk(e)} - ${r.label} - ${a}`,children:[d.jsxs("div",{className:"flex justify-between items-start mb-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:ke("font-mono text-xs font-bold",mG[n]),children:xG(e.id)}),d.jsx("h4",{className:"font-serif text-lg text-on-surface leading-tight mt-0.5 truncate",children:Uk(e)})]}),d.jsx("div",{className:ke("w-8 h-8 rounded-full border-2 flex items-center justify-center shrink-0 ml-3",yG[n]),children:d.jsx("div",{className:ke("w-3.5 h-3.5 rounded-full",r.dotClass)})})]}),d.jsxs("p",{className:"text-xs text-on-surface/60 line-clamp-2 leading-relaxed italic mb-3",children:["> ",e.type.replace(/_/g," ")," event recorded ",a]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:ke("px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono rounded",gG[n]),children:r.label}),d.jsx("span",{className:"px-2 py-0.5 bg-surface-container-highest text-[10px] font-mono text-outline rounded",children:a})]})]})}const qk=6,wG=3;function SG(){return d.jsxs("div",{className:"p-5 rounded-lg border-l-4 border-l-outline-variant/30 bg-surface-container/40 animate-pulse",children:[d.jsxs("div",{className:"flex justify-between items-start mb-3",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high"}),d.jsx("div",{className:"h-5 w-40 rounded bg-surface-container-high"})]}),d.jsx("div",{className:"w-8 h-8 rounded-full bg-surface-container-high"})]}),d.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high/60 mb-3"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("div",{className:"h-5 w-16 rounded bg-surface-container-high/60"}),d.jsx("div",{className:"h-5 w-12 rounded bg-surface-container-high/60"})]})]})}function EG(){const{data:e,isLoading:t}=p_(qk*2),n=(e??[]).filter(r=>r.type!=="agent_run").slice(0,qk);return d.jsxs("section",{className:"space-y-5",children:[d.jsx("div",{className:"flex items-end justify-between border-b border-outline-variant/10 pb-4",children:d.jsxs("div",{children:[d.jsx("h3",{className:"font-serif text-3xl text-on-surface",children:"Session Pods"}),d.jsx("p",{className:"font-mono text-[10px] uppercase text-outline mt-1",children:"Monitoring concurrent thread activity"})]})}),t?d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:wG}).map((r,a)=>d.jsx(SG,{},a))}):n.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[d.jsxs("div",{className:"relative",children:[d.jsx(lD,{className:"h-10 w-10 text-outline/30"}),d.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3 w-3 rounded-full bg-surface-container border-2 border-surface"})]}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No recent activity"}),d.jsx("p",{className:"font-mono text-[10px] uppercase text-outline tracking-wider",children:"Pods appear as sessions and spores are captured"})]}):d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map(r=>d.jsx(bG,{event:r},r.id))})]})}const CG=Sr.STATS,NG=Sr.HEALTH,kG=Sr.STATS,Sw=new Set(["completed","failed","skipped"]),TG=Sr.STATS,Ew=6e4,jG=50;function m_(e){const t=(e==null?void 0:e.limit)??jG,n=new URLSearchParams;n.set("limit",String(t)),(e==null?void 0:e.offset)!==void 0&&n.set("offset",String(e.offset)),e!=null&&e.search&&n.set("search",e.search),e!=null&&e.status&&n.set("status",e.status),e!=null&&e.task&&n.set("task",e.task);const r=n.toString();return Qr({queryKey:["agent-runs",e],queryFn:({signal:a})=>lt(`/agent/runs?${r}`,{signal:a}),pollCategory:"standard",refetchInterval:CG})}function AG(e){return qt({queryKey:["agent-run",e],queryFn:({signal:n})=>lt(`/agent/runs/${e}`,{signal:n}),enabled:e!==void 0,refetchInterval:n=>{var a,i;const r=(i=(a=n.state.data)==null?void 0:a.run)==null?void 0:i.status;return r&&Sw.has(r)?!1:NG}})}function RG(e,t){const n=t?Sw.has(t):!1;return Qr({queryKey:["agent-reports",e],queryFn:({signal:r})=>lt(`/agent/runs/${e}/reports`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:kG})}function DG(e,t){const n=t?Sw.has(t):!1;return Qr({queryKey:["agent-turns",e],queryFn:({signal:r})=>lt(`/agent/runs/${e}/turns`,{signal:r}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:n?0:TG})}function Sc(){return qt({queryKey:["agent-tasks"],queryFn:({signal:e})=>lt("/agent/tasks",{signal:e}),staleTime:Ew})}function MG(e){return qt({queryKey:["agent-task",e],queryFn:({signal:t})=>lt(`/agent/tasks/${e}`,{signal:t}),enabled:e!==void 0,staleTime:Ew})}function _G(){const e=Sn();return fr({mutationFn:({taskId:t,name:n})=>Qt(`/agent/tasks/${t}/copy`,n?{name:n}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function OG(){const e=Sn();return fr({mutationFn:t=>U1(`/agent/tasks/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]})}})}function LG(e){return qt({queryKey:["agent-task-yaml",e],queryFn:({signal:t})=>lt(`/agent/tasks/${e}/yaml`,{signal:t}),enabled:e!==void 0,staleTime:Ew})}function PG(){const e=Sn();return fr({mutationFn:({taskId:t,yaml:n})=>mc(`/agent/tasks/${t}`,{yaml:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-tasks"]}),e.invalidateQueries({queryKey:["agent-task"]}),e.invalidateQueries({queryKey:["agent-task-yaml"]})}})}function Cw(){const e=Sn();return fr({mutationFn:t=>Qt("/agent/run",t),onSuccess:()=>{e.invalidateQueries({queryKey:["agent-runs"]})}})}function Nw(e){return e===null?"—":`$${e.toFixed(4)}`}function kw(e){return e===null?"—":e.toLocaleString()}function g_(e){switch(e){case"completed":return"default";case"running":return"warning";case"failed":return"destructive";default:return"secondary"}}function y_(e){return e===q1?"warning":"secondary"}const x_="Default task";function b_(e,t){if(!e)return x_;const n=t.find(r=>r.name===e);return(n==null?void 0:n.displayName)??e}const BG=5,Vk={running:"bg-sage animate-pulse",completed:"bg-sage",failed:"bg-terracotta",skipped:"bg-outline/40",pending:"bg-outline/40"};function zG({run:e,taskName:t,onClick:n}){const r=Vk[e.status]??Vk.pending;return d.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-outline-variant/5 last:border-0 cursor-pointer hover:bg-surface-container-high/50 -mx-2 px-2 rounded transition-colors",onClick:n,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n())},role:"link",tabIndex:0,"aria-label":`View run: ${t}`,children:[d.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[d.jsx("span",{className:ke("h-2 w-2 shrink-0 rounded-full",r)}),d.jsx("span",{className:"text-sm text-on-surface truncate",children:t})]}),d.jsxs("div",{className:"flex items-center gap-3 shrink-0 font-mono text-[11px] text-outline",children:[d.jsx("span",{children:e.started_at!==null?wi(e.started_at):"—"}),d.jsx("span",{children:om(e.started_at,e.completed_at)})]})]})}function IG(){const{data:e,isLoading:t}=m_({limit:BG}),{data:n}=Sc(),r=Wa(),a=(n==null?void 0:n.tasks)??[],i=(e==null?void 0:e.runs)??[];return d.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10",children:[d.jsxs("div",{className:"flex justify-between items-center mb-6",children:[d.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"Agent Runs"}),d.jsx(Rd,{className:"h-5 w-5 text-outline"})]}),t?d.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"Loading runs..."}):i.length===0?d.jsx("div",{className:"font-mono text-[11px] text-outline py-4",children:"No agent runs yet"}):d.jsx("div",{children:i.map(l=>d.jsx(zG,{run:l,taskName:b_(l.task,a),onClick:()=>r("/agent")},l.id))})]})}const FG=12,UG=8;function qG(e){return e.includes("error")||e.includes("fail")?"error":e==="agent_run"?"warn":"ok"}const VG={ok:"[OK]",warn:"[WRN]",error:"[ERR]"},HG={ok:"text-sage",warn:"text-ochre",error:"text-terracotta"};function GG(e){return new Date(e*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function $G(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="agent_run"?"/agent":e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null}function KG({event:e,onClick:t}){const n=qG(e.type);return d.jsxs("div",{className:ke("flex gap-4 items-start border-b border-outline-variant/5 pb-2 font-mono text-[11px] transition-all duration-150",t&&"cursor-pointer hover:bg-surface-container-high/50 hover:translate-x-1 -mx-2 px-2 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"),onClick:t,onKeyDown:t?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())}:void 0,tabIndex:t?0:void 0,role:t?"link":void 0,"aria-label":t?`${e.type.replace(/_/g," ")}: ${e.summary}`:void 0,children:[d.jsx("span",{className:"text-outline shrink-0 tabular-nums",children:GG(e.timestamp)}),d.jsx("span",{className:ke("shrink-0 font-bold",HG[n]),children:VG[n]}),d.jsx("span",{className:"text-on-surface/70 truncate",children:e.summary})]})}function YG(){const{data:e,isLoading:t}=p_(FG),n=Wa(),r=(e==null?void 0:e.slice(0,UG))??[];return d.jsxs("div",{className:"glass-panel p-6 rounded-xl border border-outline-variant/10 transition-[border-color] duration-200 hover:border-outline-variant/25",children:[d.jsxs("div",{className:"flex justify-between items-center mb-6",children:[d.jsx("h4",{className:"font-serif text-xl text-on-surface",children:"System Integrity Logs"}),d.jsx("span",{className:"text-[10px] font-mono text-sage px-2 py-1 bg-sage-muted rounded",children:"LIVE"})]}),t?d.jsx("div",{className:"space-y-3",children:[1,2,3].map(a=>d.jsxs("div",{className:"flex gap-4 items-start pb-2 animate-pulse",children:[d.jsx("div",{className:"h-3 w-14 rounded bg-surface-container-high/50"}),d.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high/50"}),d.jsx("div",{className:"h-3 flex-1 rounded bg-surface-container-high/40"})]},a))}):r.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[d.jsx(oD,{className:"h-8 w-8 text-outline/20"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"No log entries yet"})]}):d.jsx("div",{className:"space-y-3",children:r.map(a=>{const i=$G(a);return d.jsx(KG,{event:a,onClick:i?()=>n(i):void 0},a.id)})})]})}function XG(e){const{embedded_count:t,total_embeddable:n}=e.embedding;if(n===0)return"Initializing";const r=t/n;return r>=.95?"Optimal":r>=.7?"Good":"Degraded"}function QG({stats:e}){const t=XG(e);return d.jsxs("div",{className:"flex items-center justify-between px-2 py-3 border-t border-outline-variant/10",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("span",{className:"font-mono text-[10px] uppercase text-sage",children:["System Connectivity: ",t]}),d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-sage animate-pulse"})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:e.vault.name}),d.jsxs("span",{className:"font-mono text-[10px] uppercase text-outline/50",children:["v",e.daemon.version]})]})]})}function WG(){const{data:e,isLoading:t,isError:n,error:r}=Yp();return d.jsx(xw,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Connecting to daemon...",children:e&&d.jsxs("div",{className:"relative min-h-full",children:[d.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.04]",children:d.jsxs("svg",{height:"100%",width:"100%",viewBox:"0 0 800 800",preserveAspectRatio:"none",children:[d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 300 500 200 400C100 300 0 400 0 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 600 500 500 600 400C700 300 800 400 800 400",fill:"none",stroke:"#abcfb8",strokeWidth:"1"}),d.jsx("path",{className:"mycelial-connector",d:"M400 800C400 500 450 300 400 100",fill:"none",stroke:"#abcfb8",strokeWidth:"1"})]})}),d.jsxs("div",{className:"relative z-10 p-6 lg:p-8 max-w-7xl mx-auto space-y-10",children:[d.jsx(oG,{stats:e}),d.jsx(dG,{stats:e}),d.jsx(EG,{}),d.jsxs("section",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsx(IG,{}),d.jsx(YG,{})]}),d.jsx(QG,{stats:e})]})]})})}const ZG=Xp("rounded-md transition-colors",{variants:{level:{lowest:"bg-surface-container-lowest",low:"bg-surface-container-low",default:"bg-surface-container",high:"bg-surface-container-high",highest:"bg-surface-container-highest",bright:"bg-surface-bright"},interactive:{true:"cursor-pointer hover-lift hover:brightness-[1.08]",false:""},ghostBorder:{true:"border border-[var(--ghost-border)]",false:""},glass:{true:"backdrop-blur-xl bg-surface-variant/60",false:""},glow:{true:"shadow-[inset_0_0_12px_rgba(171,207,184,0.2)]",false:""}},defaultVariants:{level:"low",interactive:!1,ghostBorder:!1,glass:!1,glow:!1}}),$e=j.forwardRef(({className:e,level:t,interactive:n,ghostBorder:r,glass:a,glow:i,...l},o)=>d.jsx("div",{ref:o,className:ke(ZG({level:t,interactive:n,ghostBorder:r,glass:a,glow:i}),e),...l}));$e.displayName="Surface";function JG({tabs:e,activeTab:t,onTabChange:n,className:r}){return d.jsx("div",{className:ke("flex items-center gap-6",r),children:e.map(a=>d.jsx("button",{onClick:()=>n(a.id),className:ke("pb-2 font-sans text-sm font-medium transition-colors border-b-2",t===a.id?"text-primary border-primary":"text-on-surface-variant border-transparent hover:text-on-surface"),children:a.label},a.id))})}function Si({title:e,subtitle:t,tabs:n,activeTab:r,onTabChange:a,actions:i,className:l}){return d.jsxs("div",{className:ke("pb-6",l),children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:e}),t&&d.jsx("p",{className:"mt-1 font-sans text-sm text-on-surface-variant",children:t})]}),i&&d.jsx("div",{className:"flex items-center gap-2",children:i})]}),n&&r&&a&&d.jsx(JG,{tabs:n,activeTab:r,onTabChange:a,className:"mt-4"})]})}function cm({open:e,onOpenChange:t,title:n,description:r,icon:a,meta:i,impact:l,confirmLabel:o="Confirm",variant:f="destructive",onConfirm:c,isPending:h=!1}){var p,m;return d.jsx(Md,{open:e,onOpenChange:t,children:d.jsxs(yc,{className:"sm:max-w-md border border-outline-variant/20 [&>button:last-child]:hidden",children:[d.jsxs(_d,{children:[d.jsxs("div",{className:"flex items-center gap-3",children:[a&&d.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-tertiary/15",children:a}),d.jsx(xc,{children:n})]}),d.jsx(tm,{children:r})]}),i&&i.length>0&&d.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-outline-variant/20 px-4 py-3",children:[d.jsx("span",{className:"font-mono text-xs text-on-surface-variant bg-surface-container px-1.5 py-0.5 rounded shrink-0",children:(p=i[0])==null?void 0:p.value}),i.length>1&&d.jsx("span",{className:"text-sm font-medium text-on-surface truncate",children:(m=i[1])==null?void 0:m.value})]}),l&&l.length>0&&d.jsx("div",{className:"grid grid-cols-2 gap-2",children:l.map(y=>d.jsxs("div",{className:"rounded-md border border-outline-variant/20 px-3 py-2",children:[d.jsx("div",{className:"font-sans text-[10px] font-medium uppercase tracking-wider text-on-surface-variant",children:y.label}),d.jsx("div",{className:"font-sans text-base font-medium text-on-surface",children:y.value})]},y.label))}),d.jsxs(em,{children:[d.jsx(Ae,{variant:"secondary",size:"sm",onClick:()=>t(!1),disabled:h,children:"Cancel"}),d.jsxs(Ae,{variant:f,size:"sm",onClick:c,disabled:h,className:"gap-2",children:[h&&d.jsx(jn,{className:"h-4 w-4 animate-spin"}),o]})]})]})})}function Hk(e,[t,n]){return Math.min(n,Math.max(t,e))}function e$(e){const t=e+"CollectionProvider",[n,r]=Qp(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:w,children:S}=b,N=Xi.useRef(null),E=Xi.useRef(new Map).current;return d.jsx(a,{scope:w,itemMap:E,collectionRef:N,children:S})};l.displayName=t;const o=e+"CollectionSlot",f=sd(o),c=Xi.forwardRef((b,w)=>{const{scope:S,children:N}=b,E=i(o,S),T=An(w,E.collectionRef);return d.jsx(f,{ref:T,children:N})});c.displayName=o;const h=e+"CollectionItemSlot",p="data-radix-collection-item",m=sd(h),y=Xi.forwardRef((b,w)=>{const{scope:S,children:N,...E}=b,T=Xi.useRef(null),R=An(w,T),A=i(h,S);return Xi.useEffect(()=>(A.itemMap.set(T,{ref:T,...E}),()=>void A.itemMap.delete(T))),d.jsx(m,{[p]:"",ref:R,children:N})});y.displayName=h;function x(b){const w=i(e+"CollectionConsumer",b);return Xi.useCallback(()=>{const N=w.collectionRef.current;if(!N)return[];const E=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((A,D)=>E.indexOf(A.ref.current)-E.indexOf(D.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:c,ItemSlot:y},x,r]}var t$=j.createContext(void 0);function n$(e){const t=j.useContext(t$);return e||t||"ltr"}const r$=["top","right","bottom","left"],yl=Math.min,oa=Math.max,Ep=Math.round,kv=Math.floor,xi=e=>({x:e,y:e}),a$={left:"right",right:"left",bottom:"top",top:"bottom"};function Kb(e,t,n){return oa(e,yl(t,n))}function ls(e,t){return typeof e=="function"?e(t):e}function os(e){return e.split("-")[0]}function Ec(e){return e.split("-")[1]}function Tw(e){return e==="x"?"y":"x"}function jw(e){return e==="y"?"height":"width"}function hi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Aw(e){return Tw(hi(e))}function i$(e,t,n){n===void 0&&(n=!1);const r=Ec(e),a=Aw(e),i=jw(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Cp(l)),[l,Cp(l)]}function s$(e){const t=Cp(e);return[Yb(e),t,Yb(t)]}function Yb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Gk=["left","right"],$k=["right","left"],l$=["top","bottom"],o$=["bottom","top"];function u$(e,t,n){switch(e){case"top":case"bottom":return n?t?$k:Gk:t?Gk:$k;case"left":case"right":return t?l$:o$;default:return[]}}function c$(e,t,n,r){const a=Ec(e);let i=u$(os(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(Yb)))),i}function Cp(e){const t=os(e);return a$[t]+e.slice(t.length)}function f$(e){return{top:0,right:0,bottom:0,left:0,...e}}function w_(e){return typeof e!="number"?f$(e):{top:e,right:e,bottom:e,left:e}}function Np(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Kk(e,t,n){let{reference:r,floating:a}=e;const i=hi(t),l=Aw(t),o=jw(l),f=os(t),c=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,m=r[o]/2-a[o]/2;let y;switch(f){case"top":y={x:h,y:r.y-a.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(Ec(t)){case"start":y[l]-=m*(n&&c?-1:1);break;case"end":y[l]+=m*(n&&c?-1:1);break}return y}async function d$(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:o,strategy:f}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:y=0}=ls(t,e),x=w_(y),w=o[m?p==="floating"?"reference":"floating":p],S=Np(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:h,strategy:f})),N=p==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),T=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},R=Np(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:N,offsetParent:E,strategy:f}):N);return{top:(S.top-R.top+x.top)/T.y,bottom:(R.bottom-S.bottom+x.bottom)/T.y,left:(S.left-R.left+x.left)/T.x,right:(R.right-S.right+x.right)/T.x}}const h$=50,v$=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,o=l.detectOverflow?l:{...l,detectOverflow:d$},f=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=Kk(c,r,f),m=r,y=0;const x={};for(let b=0;b<i.length;b++){const w=i[b];if(!w)continue;const{name:S,fn:N}=w,{x:E,y:T,data:R,reset:A}=await N({x:h,y:p,initialPlacement:r,placement:m,strategy:a,middlewareData:x,rects:c,platform:o,elements:{reference:e,floating:t}});h=E??h,p=T??p,x[S]={...x[S],...R},A&&y<h$&&(y++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(c=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:h,y:p}=Kk(c,m,f)),b=-1)}return{x:h,y:p,placement:m,strategy:a,middlewareData:x}},p$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:o,middlewareData:f}=t,{element:c,padding:h=0}=ls(e,t)||{};if(c==null)return{};const p=w_(h),m={x:n,y:r},y=Aw(a),x=jw(y),b=await l.getDimensions(c),w=y==="y",S=w?"top":"left",N=w?"bottom":"right",E=w?"clientHeight":"clientWidth",T=i.reference[x]+i.reference[y]-m[y]-i.floating[x],R=m[y]-i.reference[y],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=A?A[E]:0;(!D||!await(l.isElement==null?void 0:l.isElement(A)))&&(D=o.floating[E]||i.floating[x]);const _=T/2-R/2,L=D/2-b[x]/2-1,M=yl(p[S],L),z=yl(p[N],L),B=M,H=D-b[x]-z,G=D/2-b[x]/2+_,U=Kb(B,G,H),I=!f.arrow&&Ec(a)!=null&&G!==U&&i.reference[x]/2-(G<B?M:z)-b[x]/2<0,V=I?G<B?G-B:G-H:0;return{[y]:m[y]+V,data:{[y]:U,centerOffset:G-U-V,...I&&{alignmentOffset:V}},reset:I}}}),m$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:o,platform:f,elements:c}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...w}=ls(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=os(a),N=hi(o),E=os(o)===o,T=await(f.isRTL==null?void 0:f.isRTL(c.floating)),R=m||(E||!b?[Cp(o)]:s$(o)),A=x!=="none";!m&&A&&R.push(...c$(o,b,x,T));const D=[o,...R],_=await f.detectOverflow(t,w),L=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&L.push(_[S]),p){const G=i$(a,l,T);L.push(_[G[0]],_[G[1]])}if(M=[...M,{placement:a,overflows:L}],!L.every(G=>G<=0)){var z,B;const G=(((z=i.flip)==null?void 0:z.index)||0)+1,U=D[G];if(U&&(!(p==="alignment"?N!==hi(U):!1)||M.every(K=>hi(K.placement)===N?K.overflows[0]>0:!0)))return{data:{index:G,overflows:M},reset:{placement:U}};let I=(B=M.filter(V=>V.overflows[0]<=0).sort((V,K)=>V.overflows[1]-K.overflows[1])[0])==null?void 0:B.placement;if(!I)switch(y){case"bestFit":{var H;const V=(H=M.filter(K=>{if(A){const Q=hi(K.placement);return Q===N||Q==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(Q=>Q>0).reduce((Q,F)=>Q+F,0)]).sort((K,Q)=>K[1]-Q[1])[0])==null?void 0:H[0];V&&(I=V);break}case"initialPlacement":I=o;break}if(a!==I)return{reset:{placement:I}}}return{}}}};function Yk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xk(e){return r$.some(t=>e[t]>=0)}const g$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=ls(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...i,elementContext:"reference"}),o=Yk(l,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Xk(o)}}}case"escaped":{const l=await r.detectOverflow(t,{...i,altBoundary:!0}),o=Yk(l,n.floating);return{data:{escapedOffsets:o,escaped:Xk(o)}}}default:return{}}}}},S_=new Set(["left","top"]);async function y$(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=os(n),o=Ec(n),f=hi(n)==="y",c=S_.has(l)?-1:1,h=i&&f?-1:1,p=ls(t,e);let{mainAxis:m,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return o&&typeof x=="number"&&(y=o==="end"?x*-1:x),f?{x:y*h,y:m*c}:{x:m*c,y:y*h}}const x$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:o}=t,f=await y$(t,e);return l===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:l}}}}},b$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:l=!0,crossAxis:o=!1,limiter:f={fn:S=>{let{x:N,y:E}=S;return{x:N,y:E}}},...c}=ls(e,t),h={x:n,y:r},p=await i.detectOverflow(t,c),m=hi(os(a)),y=Tw(m);let x=h[y],b=h[m];if(l){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",E=x+p[S],T=x-p[N];x=Kb(E,x,T)}if(o){const S=m==="y"?"top":"left",N=m==="y"?"bottom":"right",E=b+p[S],T=b-p[N];b=Kb(E,b,T)}const w=f.fn({...t,[y]:x,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[y]:l,[m]:o}}}}}},w$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:o=0,mainAxis:f=!0,crossAxis:c=!0}=ls(e,t),h={x:n,y:r},p=hi(a),m=Tw(p);let y=h[m],x=h[p];const b=ls(o,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const E=m==="y"?"height":"width",T=i.reference[m]-i.floating[E]+w.mainAxis,R=i.reference[m]+i.reference[E]-w.mainAxis;y<T?y=T:y>R&&(y=R)}if(c){var S,N;const E=m==="y"?"width":"height",T=S_.has(os(a)),R=i.reference[p]-i.floating[E]+(T&&((S=l.offset)==null?void 0:S[p])||0)+(T?0:w.crossAxis),A=i.reference[p]+i.reference[E]+(T?0:((N=l.offset)==null?void 0:N[p])||0)-(T?w.crossAxis:0);x<R?x=R:x>A&&(x=A)}return{[m]:y,[p]:x}}}},S$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:o}=t,{apply:f=()=>{},...c}=ls(e,t),h=await l.detectOverflow(t,c),p=os(a),m=Ec(a),y=hi(a)==="y",{width:x,height:b}=i.floating;let w,S;p==="top"||p==="bottom"?(w=p,S=m===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(S=p,w=m==="end"?"top":"bottom");const N=b-h.top-h.bottom,E=x-h.left-h.right,T=yl(b-h[w],N),R=yl(x-h[S],E),A=!t.middlewareData.shift;let D=T,_=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=N),A&&!m){const M=oa(h.left,0),z=oa(h.right,0),B=oa(h.top,0),H=oa(h.bottom,0);y?_=x-2*(M!==0||z!==0?M+z:oa(h.left,h.right)):D=b-2*(B!==0||H!==0?B+H:oa(h.top,h.bottom))}await f({...t,availableWidth:_,availableHeight:D});const L=await l.getDimensions(o.floating);return x!==L.width||b!==L.height?{reset:{rects:!0}}:{}}}};function fm(){return typeof window<"u"}function Cc(e){return E_(e)?(e.nodeName||"").toLowerCase():"#document"}function ca(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ni(e){var t;return(t=(E_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function E_(e){return fm()?e instanceof Node||e instanceof ca(e).Node:!1}function Ka(e){return fm()?e instanceof Element||e instanceof ca(e).Element:!1}function ds(e){return fm()?e instanceof HTMLElement||e instanceof ca(e).HTMLElement:!1}function Qk(e){return!fm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ca(e).ShadowRoot}function zd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ya(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function E$(e){return/^(table|td|th)$/.test(Cc(e))}function dm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const C$=/transform|translate|scale|rotate|perspective|filter/,N$=/paint|layout|strict|content/,Jl=e=>!!e&&e!=="none";let Tx;function Rw(e){const t=Ka(e)?Ya(e):e;return Jl(t.transform)||Jl(t.translate)||Jl(t.scale)||Jl(t.rotate)||Jl(t.perspective)||!Dw()&&(Jl(t.backdropFilter)||Jl(t.filter))||C$.test(t.willChange||"")||N$.test(t.contain||"")}function k$(e){let t=xl(e);for(;ds(t)&&!lc(t);){if(Rw(t))return t;if(dm(t))return null;t=xl(t)}return null}function Dw(){return Tx==null&&(Tx=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Tx}function lc(e){return/^(html|body|#document)$/.test(Cc(e))}function Ya(e){return ca(e).getComputedStyle(e)}function hm(e){return Ka(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xl(e){if(Cc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qk(e)&&e.host||Ni(e);return Qk(t)?t.host:t}function C_(e){const t=xl(e);return lc(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&zd(t)?t:C_(t)}function ud(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=C_(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=ca(a);if(i){const o=Xb(l);return t.concat(l,l.visualViewport||[],zd(a)?a:[],o&&n?ud(o):[])}else return t.concat(a,ud(a,[],n))}function Xb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function N_(e){const t=Ya(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ds(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,o=Ep(n)!==i||Ep(r)!==l;return o&&(n=i,r=l),{width:n,height:r,$:o}}function Mw(e){return Ka(e)?e:e.contextElement}function Vu(e){const t=Mw(e);if(!ds(t))return xi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=N_(t);let l=(i?Ep(n.width):n.width)/r,o=(i?Ep(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const T$=xi(0);function k_(e){const t=ca(e);return!Dw()||!t.visualViewport?T$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function j$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ca(e)?!1:t}function No(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Mw(e);let l=xi(1);t&&(r?Ka(r)&&(l=Vu(r)):l=Vu(e));const o=j$(i,n,r)?k_(i):xi(0);let f=(a.left+o.x)/l.x,c=(a.top+o.y)/l.y,h=a.width/l.x,p=a.height/l.y;if(i){const m=ca(i),y=r&&Ka(r)?ca(r):r;let x=m,b=Xb(x);for(;b&&r&&y!==x;){const w=Vu(b),S=b.getBoundingClientRect(),N=Ya(b),E=S.left+(b.clientLeft+parseFloat(N.paddingLeft))*w.x,T=S.top+(b.clientTop+parseFloat(N.paddingTop))*w.y;f*=w.x,c*=w.y,h*=w.x,p*=w.y,f+=E,c+=T,x=ca(b),b=Xb(x)}}return Np({width:h,height:p,x:f,y:c})}function vm(e,t){const n=hm(e).scrollLeft;return t?t.left+n:No(Ni(e)).left+n}function T_(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-vm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function A$(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Ni(r),o=t?dm(t.floating):!1;if(r===l||o&&i)return n;let f={scrollLeft:0,scrollTop:0},c=xi(1);const h=xi(0),p=ds(r);if((p||!p&&!i)&&((Cc(r)!=="body"||zd(l))&&(f=hm(r)),p)){const y=No(r);c=Vu(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const m=l&&!p&&!i?T_(l,f):xi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-f.scrollLeft*c.x+h.x+m.x,y:n.y*c.y-f.scrollTop*c.y+h.y+m.y}}function R$(e){return Array.from(e.getClientRects())}function D$(e){const t=Ni(e),n=hm(e),r=e.ownerDocument.body,a=oa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=oa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+vm(e);const o=-n.scrollTop;return Ya(r).direction==="rtl"&&(l+=oa(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:o}}const Wk=25;function M$(e,t){const n=ca(e),r=Ni(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,o=0,f=0;if(a){i=a.width,l=a.height;const h=Dw();(!h||h&&t==="fixed")&&(o=a.offsetLeft,f=a.offsetTop)}const c=vm(r);if(c<=0){const h=r.ownerDocument,p=h.body,m=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-y);x<=Wk&&(i-=x)}else c<=Wk&&(i+=c);return{width:i,height:l,x:o,y:f}}function _$(e,t){const n=No(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ds(e)?Vu(e):xi(1),l=e.clientWidth*i.x,o=e.clientHeight*i.y,f=a*i.x,c=r*i.y;return{width:l,height:o,x:f,y:c}}function Zk(e,t,n){let r;if(t==="viewport")r=M$(e,n);else if(t==="document")r=D$(Ni(e));else if(Ka(t))r=_$(t,n);else{const a=k_(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Np(r)}function j_(e,t){const n=xl(e);return n===t||!Ka(n)||lc(n)?!1:Ya(n).position==="fixed"||j_(n,t)}function O$(e,t){const n=t.get(e);if(n)return n;let r=ud(e,[],!1).filter(o=>Ka(o)&&Cc(o)!=="body"),a=null;const i=Ya(e).position==="fixed";let l=i?xl(e):e;for(;Ka(l)&&!lc(l);){const o=Ya(l),f=Rw(l);!f&&o.position==="fixed"&&(a=null),(i?!f&&!a:!f&&o.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||zd(l)&&!f&&j_(e,l))?r=r.filter(h=>h!==l):a=o,l=xl(l)}return t.set(e,r),r}function L$(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?dm(t)?[]:O$(t,this._c):[].concat(n),r],o=Zk(t,l[0],a);let f=o.top,c=o.right,h=o.bottom,p=o.left;for(let m=1;m<l.length;m++){const y=Zk(t,l[m],a);f=oa(y.top,f),c=yl(y.right,c),h=yl(y.bottom,h),p=oa(y.left,p)}return{width:c-p,height:h-f,x:p,y:f}}function P$(e){const{width:t,height:n}=N_(e);return{width:t,height:n}}function B$(e,t,n){const r=ds(t),a=Ni(t),i=n==="fixed",l=No(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const f=xi(0);function c(){f.x=vm(a)}if(r||!r&&!i)if((Cc(t)!=="body"||zd(a))&&(o=hm(t)),r){const y=No(t,!0,i,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else a&&c();i&&!r&&a&&c();const h=a&&!r&&!i?T_(a,o):xi(0),p=l.left+o.scrollLeft-f.x-h.x,m=l.top+o.scrollTop-f.y-h.y;return{x:p,y:m,width:l.width,height:l.height}}function jx(e){return Ya(e).position==="static"}function Jk(e,t){if(!ds(e)||Ya(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ni(e)===n&&(n=n.ownerDocument.body),n}function A_(e,t){const n=ca(e);if(dm(e))return n;if(!ds(e)){let a=xl(e);for(;a&&!lc(a);){if(Ka(a)&&!jx(a))return a;a=xl(a)}return n}let r=Jk(e,t);for(;r&&E$(r)&&jx(r);)r=Jk(r,t);return r&&lc(r)&&jx(r)&&!Rw(r)?n:r||k$(e)||n}const z$=async function(e){const t=this.getOffsetParent||A_,n=this.getDimensions,r=await n(e.floating);return{reference:B$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function I$(e){return Ya(e).direction==="rtl"}const F$={convertOffsetParentRelativeRectToViewportRelativeRect:A$,getDocumentElement:Ni,getClippingRect:L$,getOffsetParent:A_,getElementRects:z$,getClientRects:R$,getDimensions:P$,getScale:Vu,isElement:Ka,isRTL:I$};function R_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function U$(e,t){let n=null,r;const a=Ni(e);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function l(o,f){o===void 0&&(o=!1),f===void 0&&(f=1),i();const c=e.getBoundingClientRect(),{left:h,top:p,width:m,height:y}=c;if(o||t(),!m||!y)return;const x=kv(p),b=kv(a.clientWidth-(h+m)),w=kv(a.clientHeight-(p+y)),S=kv(h),E={rootMargin:-x+"px "+-b+"px "+-w+"px "+-S+"px",threshold:oa(0,yl(1,f))||1};let T=!0;function R(A){const D=A[0].intersectionRatio;if(D!==f){if(!T)return l();D?l(!1,D):r=setTimeout(()=>{l(!1,1e-7)},1e3)}D===1&&!R_(c,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver(R,{...E,root:a.ownerDocument})}catch{n=new IntersectionObserver(R,E)}n.observe(e)}return l(!0),i}function q$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,c=Mw(e),h=a||i?[...c?ud(c):[],...t?ud(t):[]]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=c&&o?U$(c,n):null;let m=-1,y=null;l&&(y=new ResizeObserver(S=>{let[N]=S;N&&N.target===c&&y&&t&&(y.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=y)==null||E.observe(t)})),n()}),c&&!f&&y.observe(c),t&&y.observe(t));let x,b=f?No(e):null;f&&w();function w(){const S=No(e);b&&!R_(b,S)&&n(),b=S,x=requestAnimationFrame(w)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p==null||p(),(S=y)==null||S.disconnect(),y=null,f&&cancelAnimationFrame(x)}}const V$=x$,H$=b$,G$=m$,$$=S$,K$=g$,eT=p$,Y$=w$,X$=(e,t,n)=>{const r=new Map,a={platform:F$,...n},i={...a.platform,_c:r};return v$(e,t,{...a,platform:i})};var Q$=typeof document<"u",W$=function(){},Jv=Q$?j.useLayoutEffect:W$;function kp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!kp(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!kp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function D_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tT(e,t){const n=D_(e);return Math.round(t*n)/n}function Ax(e){const t=j.useRef(e);return Jv(()=>{t.current=e}),t}function Z$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:o=!0,whileElementsMounted:f,open:c}=e,[h,p]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,y]=j.useState(r);kp(m,r)||y(r);const[x,b]=j.useState(null),[w,S]=j.useState(null),N=j.useCallback(K=>{K!==A.current&&(A.current=K,b(K))},[]),E=j.useCallback(K=>{K!==D.current&&(D.current=K,S(K))},[]),T=i||x,R=l||w,A=j.useRef(null),D=j.useRef(null),_=j.useRef(h),L=f!=null,M=Ax(f),z=Ax(a),B=Ax(c),H=j.useCallback(()=>{if(!A.current||!D.current)return;const K={placement:t,strategy:n,middleware:m};z.current&&(K.platform=z.current),X$(A.current,D.current,K).then(Q=>{const F={...Q,isPositioned:B.current!==!1};G.current&&!kp(_.current,F)&&(_.current=F,Ad.flushSync(()=>{p(F)}))})},[m,t,n,z,B]);Jv(()=>{c===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,p(K=>({...K,isPositioned:!1})))},[c]);const G=j.useRef(!1);Jv(()=>(G.current=!0,()=>{G.current=!1}),[]),Jv(()=>{if(T&&(A.current=T),R&&(D.current=R),T&&R){if(M.current)return M.current(T,R,H);H()}},[T,R,H,M,L]);const U=j.useMemo(()=>({reference:A,floating:D,setReference:N,setFloating:E}),[N,E]),I=j.useMemo(()=>({reference:T,floating:R}),[T,R]),V=j.useMemo(()=>{const K={position:n,left:0,top:0};if(!I.floating)return K;const Q=tT(I.floating,h.x),F=tT(I.floating,h.y);return o?{...K,transform:"translate("+Q+"px, "+F+"px)",...D_(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:F}},[n,o,I.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:H,refs:U,elements:I,floatingStyles:V}),[h,H,U,I,V])}const J$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?eT({element:r.current,padding:a}).fn(n):{}:r?eT({element:r,padding:a}).fn(n):{}}}},eK=(e,t)=>{const n=V$(e);return{name:n.name,fn:n.fn,options:[e,t]}},tK=(e,t)=>{const n=H$(e);return{name:n.name,fn:n.fn,options:[e,t]}},nK=(e,t)=>({fn:Y$(e).fn,options:[e,t]}),rK=(e,t)=>{const n=G$(e);return{name:n.name,fn:n.fn,options:[e,t]}},aK=(e,t)=>{const n=$$(e);return{name:n.name,fn:n.fn,options:[e,t]}},iK=(e,t)=>{const n=K$(e);return{name:n.name,fn:n.fn,options:[e,t]}},sK=(e,t)=>{const n=J$(e);return{name:n.name,fn:n.fn,options:[e,t]}};var lK="Arrow",M_=j.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return d.jsx(Jt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});M_.displayName=lK;var oK=M_;function uK(e){const[t,n]=j.useState(void 0);return xr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,o;if("borderBoxSize"in i){const f=i.borderBoxSize,c=Array.isArray(f)?f[0]:f;l=c.inlineSize,o=c.blockSize}else l=e.offsetWidth,o=e.offsetHeight;n({width:l,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _w="Popper",[__,O_]=Qp(_w),[cK,L_]=__(_w),P_=e=>{const{__scopePopper:t,children:n}=e,[r,a]=j.useState(null);return d.jsx(cK,{scope:t,anchor:r,onAnchorChange:a,children:n})};P_.displayName=_w;var B_="PopperAnchor",z_=j.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=L_(B_,n),l=j.useRef(null),o=An(t,l),f=j.useRef(null);return j.useEffect(()=>{const c=f.current;f.current=(r==null?void 0:r.current)||l.current,c!==f.current&&i.onAnchorChange(f.current)}),r?null:d.jsx(Jt.div,{...a,ref:o})});z_.displayName=B_;var Ow="PopperContent",[fK,dK]=__(Ow),I_=j.forwardRef((e,t)=>{var le,ye,ne,W,J,se;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:o=0,avoidCollisions:f=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:x,...b}=e,w=L_(Ow,n),[S,N]=j.useState(null),E=An(t,ge=>N(ge)),[T,R]=j.useState(null),A=uK(T),D=(A==null?void 0:A.width)??0,_=(A==null?void 0:A.height)??0,L=r+(i!=="center"?"-"+i:""),M=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(c)?c:[c],B=z.length>0,H={padding:M,boundary:z.filter(vK),altBoundary:B},{refs:G,floatingStyles:U,placement:I,isPositioned:V,middlewareData:K}=Z$({strategy:"fixed",placement:L,whileElementsMounted:(...ge)=>q$(...ge,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[eK({mainAxis:a+_,alignmentAxis:l}),f&&tK({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?nK():void 0,...H}),f&&rK({...H}),aK({...H,apply:({elements:ge,rects:Te,availableWidth:Be,availableHeight:ot})=>{const{width:Je,height:We}=Te.reference,Ve=ge.floating.style;Ve.setProperty("--radix-popper-available-width",`${Be}px`),Ve.setProperty("--radix-popper-available-height",`${ot}px`),Ve.setProperty("--radix-popper-anchor-width",`${Je}px`),Ve.setProperty("--radix-popper-anchor-height",`${We}px`)}}),T&&sK({element:T,padding:o}),pK({arrowWidth:D,arrowHeight:_}),m&&iK({strategy:"referenceHidden",...H})]}),[Q,F]=q_(I),q=So(x);xr(()=>{V&&(q==null||q())},[V,q]);const X=(le=K.arrow)==null?void 0:le.x,P=(ye=K.arrow)==null?void 0:ye.y,Z=((ne=K.arrow)==null?void 0:ne.centerOffset)!==0,[ae,ie]=j.useState();return xr(()=>{S&&ie(window.getComputedStyle(S).zIndex)},[S]),d.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:V?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(W=K.transformOrigin)==null?void 0:W.x,(J=K.transformOrigin)==null?void 0:J.y].join(" "),...((se=K.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(fK,{scope:n,placedSide:Q,onArrowChange:R,arrowX:X,arrowY:P,shouldHideArrow:Z,children:d.jsx(Jt.div,{"data-side":Q,"data-align":F,...b,ref:E,style:{...b.style,animation:V?void 0:"none"}})})})});I_.displayName=Ow;var F_="PopperArrow",hK={top:"bottom",right:"left",bottom:"top",left:"right"},U_=j.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=dK(F_,r),l=hK[i.placedSide];return d.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:d.jsx(oK,{...a,ref:n,style:{...a.style,display:"block"}})})});U_.displayName=F_;function vK(e){return e!==null}var pK=e=>({name:"transformOrigin",options:e,fn(t){var w,S,N;const{placement:n,rects:r,middlewareData:a}=t,l=((w=a.arrow)==null?void 0:w.centerOffset)!==0,o=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[c,h]=q_(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((S=a.arrow)==null?void 0:S.x)??0)+o/2,y=(((N=a.arrow)==null?void 0:N.y)??0)+f/2;let x="",b="";return c==="bottom"?(x=l?p:`${m}px`,b=`${-f}px`):c==="top"?(x=l?p:`${m}px`,b=`${r.floating.height+f}px`):c==="right"?(x=`${-f}px`,b=l?p:`${y}px`):c==="left"&&(x=`${r.floating.width+f}px`,b=l?p:`${y}px`),{data:{x,y:b}}}});function q_(e){const[t,n="center"]=e.split("-");return[t,n]}var mK=P_,gK=z_,yK=I_,xK=U_;function bK(e){const t=j.useRef({value:e,previous:e});return j.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var V_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wK="VisuallyHidden",SK=j.forwardRef((e,t)=>d.jsx(Jt.span,{...e,ref:t,style:{...V_,...e.style}}));SK.displayName=wK;var EK=[" ","Enter","ArrowUp","ArrowDown"],CK=[" ","Enter"],ko="Select",[pm,mm,NK]=e$(ko),[Nc]=Qp(ko,[NK,O_]),gm=O_(),[kK,jl]=Nc(ko),[TK,jK]=Nc(ko),H_=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:l,defaultValue:o,onValueChange:f,dir:c,name:h,autoComplete:p,disabled:m,required:y,form:x}=e,b=gm(t),[w,S]=j.useState(null),[N,E]=j.useState(null),[T,R]=j.useState(!1),A=n$(c),[D,_]=mp({prop:r,defaultProp:a??!1,onChange:i,caller:ko}),[L,M]=mp({prop:l,defaultProp:o,onChange:f,caller:ko}),z=j.useRef(null),B=w?x||!!w.closest("form"):!0,[H,G]=j.useState(new Set),U=Array.from(H).map(I=>I.props.value).join(";");return d.jsx(mK,{...b,children:d.jsxs(kK,{required:y,scope:t,trigger:w,onTriggerChange:S,valueNode:N,onValueNodeChange:E,valueNodeHasChildren:T,onValueNodeHasChildrenChange:R,contentId:Fu(),value:L,onValueChange:M,open:D,onOpenChange:_,dir:A,triggerPointerDownPosRef:z,disabled:m,children:[d.jsx(pm.Provider,{scope:t,children:d.jsx(TK,{scope:e.__scopeSelect,onNativeOptionAdd:j.useCallback(I=>{G(V=>new Set(V).add(I))},[]),onNativeOptionRemove:j.useCallback(I=>{G(V=>{const K=new Set(V);return K.delete(I),K})},[]),children:n})}),B?d.jsxs(cO,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:L,onChange:I=>M(I.target.value),disabled:m,form:x,children:[L===void 0?d.jsx("option",{value:""}):null,Array.from(H)]},U):null]})})};H_.displayName=ko;var G_="SelectTrigger",$_=j.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=gm(n),l=jl(G_,n),o=l.disabled||r,f=An(t,l.onTriggerChange),c=mm(n),h=j.useRef("touch"),[p,m,y]=dO(b=>{const w=c().filter(E=>!E.disabled),S=w.find(E=>E.value===l.value),N=hO(w,b,S);N!==void 0&&l.onValueChange(N.value)}),x=b=>{o||(l.onOpenChange(!0),y()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return d.jsx(gK,{asChild:!0,...i,children:d.jsx(Jt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":fO(l.value)?"":void 0,...a,ref:f,onClick:nn(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&x(b)}),onPointerDown:nn(a.onPointerDown,b=>{h.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(x(b),b.preventDefault())}),onKeyDown:nn(a.onKeyDown,b=>{const w=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&m(b.key),!(w&&b.key===" ")&&EK.includes(b.key)&&(x(),b.preventDefault())})})})});$_.displayName=G_;var K_="SelectValue",Y_=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:l="",...o}=e,f=jl(K_,n),{onValueNodeHasChildrenChange:c}=f,h=i!==void 0,p=An(t,f.onValueNodeChange);return xr(()=>{c(h)},[c,h]),d.jsx(Jt.span,{...o,ref:p,style:{pointerEvents:"none"},children:fO(f.value)?d.jsx(d.Fragment,{children:l}):i})});Y_.displayName=K_;var AK="SelectIcon",X_=j.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return d.jsx(Jt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});X_.displayName=AK;var RK="SelectPortal",Q_=e=>d.jsx(X1,{asChild:!0,...e});Q_.displayName=RK;var To="SelectContent",W_=j.forwardRef((e,t)=>{const n=jl(To,e.__scopeSelect),[r,a]=j.useState();if(xr(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Ad.createPortal(d.jsx(Z_,{scope:e.__scopeSelect,children:d.jsx(pm.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(J_,{...e,ref:t})});W_.displayName=To;var Ia=10,[Z_,Al]=Nc(To),DK="SelectContentImpl",MK=sd("SelectContent.RemoveScroll"),J_=j.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:o,sideOffset:f,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:b,avoidCollisions:w,...S}=e,N=jl(To,n),[E,T]=j.useState(null),[R,A]=j.useState(null),D=An(t,le=>T(le)),[_,L]=j.useState(null),[M,z]=j.useState(null),B=mm(n),[H,G]=j.useState(!1),U=j.useRef(!1);j.useEffect(()=>{if(E)return PD(E)},[E]),TD();const I=j.useCallback(le=>{const[ye,...ne]=B().map(se=>se.ref.current),[W]=ne.slice(-1),J=document.activeElement;for(const se of le)if(se===J||(se==null||se.scrollIntoView({block:"nearest"}),se===ye&&R&&(R.scrollTop=0),se===W&&R&&(R.scrollTop=R.scrollHeight),se==null||se.focus(),document.activeElement!==J))return},[B,R]),V=j.useCallback(()=>I([_,E]),[I,_,E]);j.useEffect(()=>{H&&V()},[H,V]);const{onOpenChange:K,triggerPointerDownPosRef:Q}=N;j.useEffect(()=>{if(E){let le={x:0,y:0};const ye=W=>{var J,se;le={x:Math.abs(Math.round(W.pageX)-(((J=Q.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(W.pageY)-(((se=Q.current)==null?void 0:se.y)??0))}},ne=W=>{le.x<=10&&le.y<=10?W.preventDefault():E.contains(W.target)||K(!1),document.removeEventListener("pointermove",ye),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ne,{capture:!0})}}},[E,K,Q]),j.useEffect(()=>{const le=()=>K(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[K]);const[F,q]=dO(le=>{const ye=B().filter(J=>!J.disabled),ne=ye.find(J=>J.ref.current===document.activeElement),W=hO(ye,le,ne);W&&setTimeout(()=>W.ref.current.focus())}),X=j.useCallback((le,ye,ne)=>{const W=!U.current&&!ne;(N.value!==void 0&&N.value===ye||W)&&(L(le),W&&(U.current=!0))},[N.value]),P=j.useCallback(()=>E==null?void 0:E.focus(),[E]),Z=j.useCallback((le,ye,ne)=>{const W=!U.current&&!ne;(N.value!==void 0&&N.value===ye||W)&&z(le)},[N.value]),ae=r==="popper"?Qb:eO,ie=ae===Qb?{side:o,sideOffset:f,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:y,sticky:x,hideWhenDetached:b,avoidCollisions:w}:{};return d.jsx(Z_,{scope:n,content:E,viewport:R,onViewportChange:A,itemRefCallback:X,selectedItem:_,onItemLeave:P,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:M,position:r,isPositioned:H,searchRef:F,children:d.jsx(Q1,{as:MK,allowPinchZoom:!0,children:d.jsx(Y1,{asChild:!0,trapped:N.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:nn(a,le=>{var ye;(ye=N.trigger)==null||ye.focus({preventScroll:!0}),le.preventDefault()}),children:d.jsx(K1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:d.jsx(ae,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:le=>le.preventDefault(),...S,...ie,onPlaced:()=>G(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:nn(S.onKeyDown,le=>{const ye=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!ye&&le.key.length===1&&q(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let W=B().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(le.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const J=le.target,se=W.indexOf(J);W=W.slice(se+1)}setTimeout(()=>I(W)),le.preventDefault()}})})})})})})});J_.displayName=DK;var _K="SelectItemAlignedPosition",eO=j.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=jl(To,n),l=Al(To,n),[o,f]=j.useState(null),[c,h]=j.useState(null),p=An(t,D=>h(D)),m=mm(n),y=j.useRef(!1),x=j.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:S,focusSelectedItem:N}=l,E=j.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&c&&b&&w&&S){const D=i.trigger.getBoundingClientRect(),_=c.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),M=S.getBoundingClientRect();if(i.dir!=="rtl"){const J=M.left-_.left,se=L.left-J,ge=D.left-se,Te=D.width+ge,Be=Math.max(Te,_.width),ot=window.innerWidth-Ia,Je=Hk(se,[Ia,Math.max(Ia,ot-Be)]);o.style.minWidth=Te+"px",o.style.left=Je+"px"}else{const J=_.right-M.right,se=window.innerWidth-L.right-J,ge=window.innerWidth-D.right-se,Te=D.width+ge,Be=Math.max(Te,_.width),ot=window.innerWidth-Ia,Je=Hk(se,[Ia,Math.max(Ia,ot-Be)]);o.style.minWidth=Te+"px",o.style.right=Je+"px"}const z=m(),B=window.innerHeight-Ia*2,H=b.scrollHeight,G=window.getComputedStyle(c),U=parseInt(G.borderTopWidth,10),I=parseInt(G.paddingTop,10),V=parseInt(G.borderBottomWidth,10),K=parseInt(G.paddingBottom,10),Q=U+I+H+K+V,F=Math.min(w.offsetHeight*5,Q),q=window.getComputedStyle(b),X=parseInt(q.paddingTop,10),P=parseInt(q.paddingBottom,10),Z=D.top+D.height/2-Ia,ae=B-Z,ie=w.offsetHeight/2,le=w.offsetTop+ie,ye=U+I+le,ne=Q-ye;if(ye<=Z){const J=z.length>0&&w===z[z.length-1].ref.current;o.style.bottom="0px";const se=c.clientHeight-b.offsetTop-b.offsetHeight,ge=Math.max(ae,ie+(J?P:0)+se+V),Te=ye+ge;o.style.height=Te+"px"}else{const J=z.length>0&&w===z[0].ref.current;o.style.top="0px";const ge=Math.max(Z,U+b.offsetTop+(J?X:0)+ie)+ne;o.style.height=ge+"px",b.scrollTop=ye-Z+b.offsetTop}o.style.margin=`${Ia}px 0`,o.style.minHeight=F+"px",o.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,o,c,b,w,S,i.dir,r]);xr(()=>E(),[E]);const[T,R]=j.useState();xr(()=>{c&&R(window.getComputedStyle(c).zIndex)},[c]);const A=j.useCallback(D=>{D&&x.current===!0&&(E(),N==null||N(),x.current=!1)},[E,N]);return d.jsx(LK,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:y,onScrollButtonChange:A,children:d.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:d.jsx(Jt.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});eO.displayName=_K;var OK="SelectPopperPosition",Qb=j.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Ia,...i}=e,l=gm(n);return d.jsx(yK,{...l,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Qb.displayName=OK;var[LK,Lw]=Nc(To,{}),Wb="SelectViewport",tO=j.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Al(Wb,n),l=Lw(Wb,n),o=An(t,i.onViewportChange),f=j.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(pm.Slot,{scope:n,children:d.jsx(Jt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:nn(a.onScroll,c=>{const h=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=l;if(m!=null&&m.current&&p){const y=Math.abs(f.current-h.scrollTop);if(y>0){const x=window.innerHeight-Ia*2,b=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),S=Math.max(b,w);if(S<x){const N=S+y,E=Math.min(x,N),T=N-E;p.style.height=E+"px",p.style.bottom==="0px"&&(h.scrollTop=T>0?T:0,p.style.justifyContent="flex-end")}}}f.current=h.scrollTop})})})]})});tO.displayName=Wb;var nO="SelectGroup",[PK,BK]=Nc(nO),zK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Fu();return d.jsx(PK,{scope:n,id:a,children:d.jsx(Jt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});zK.displayName=nO;var rO="SelectLabel",IK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=BK(rO,n);return d.jsx(Jt.div,{id:a.id,...r,ref:t})});IK.displayName=rO;var Tp="SelectItem",[FK,aO]=Nc(Tp),iO=j.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...l}=e,o=jl(Tp,n),f=Al(Tp,n),c=o.value===r,[h,p]=j.useState(i??""),[m,y]=j.useState(!1),x=An(t,N=>{var E;return(E=f.itemRefCallback)==null?void 0:E.call(f,N,r,a)}),b=Fu(),w=j.useRef("touch"),S=()=>{a||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(FK,{scope:n,value:r,disabled:a,textId:b,isSelected:c,onItemTextChange:j.useCallback(N=>{p(E=>E||((N==null?void 0:N.textContent)??"").trim())},[]),children:d.jsx(pm.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:d.jsx(Jt.div,{role:"option","aria-labelledby":b,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:x,onFocus:nn(l.onFocus,()=>y(!0)),onBlur:nn(l.onBlur,()=>y(!1)),onClick:nn(l.onClick,()=>{w.current!=="mouse"&&S()}),onPointerUp:nn(l.onPointerUp,()=>{w.current==="mouse"&&S()}),onPointerDown:nn(l.onPointerDown,N=>{w.current=N.pointerType}),onPointerMove:nn(l.onPointerMove,N=>{var E;w.current=N.pointerType,a?(E=f.onItemLeave)==null||E.call(f):w.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:nn(l.onPointerLeave,N=>{var E;N.currentTarget===document.activeElement&&((E=f.onItemLeave)==null||E.call(f))}),onKeyDown:nn(l.onKeyDown,N=>{var T;((T=f.searchRef)==null?void 0:T.current)!==""&&N.key===" "||(CK.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});iO.displayName=Tp;var $f="SelectItemText",sO=j.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,l=jl($f,n),o=Al($f,n),f=aO($f,n),c=jK($f,n),[h,p]=j.useState(null),m=An(t,S=>p(S),f.onItemTextChange,S=>{var N;return(N=o.itemTextRefCallback)==null?void 0:N.call(o,S,f.value,f.disabled)}),y=h==null?void 0:h.textContent,x=j.useMemo(()=>d.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=c;return xr(()=>(b(x),()=>w(x)),[b,w,x]),d.jsxs(d.Fragment,{children:[d.jsx(Jt.span,{id:f.textId,...i,ref:m}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ad.createPortal(i.children,l.valueNode):null]})});sO.displayName=$f;var lO="SelectItemIndicator",oO=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return aO(lO,n).isSelected?d.jsx(Jt.span,{"aria-hidden":!0,...r,ref:t}):null});oO.displayName=lO;var Zb="SelectScrollUpButton",UK=j.forwardRef((e,t)=>{const n=Al(Zb,e.__scopeSelect),r=Lw(Zb,e.__scopeSelect),[a,i]=j.useState(!1),l=An(t,r.onScrollButtonChange);return xr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollTop>0;i(c)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?d.jsx(uO,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop-f.offsetHeight)}}):null});UK.displayName=Zb;var Jb="SelectScrollDownButton",qK=j.forwardRef((e,t)=>{const n=Al(Jb,e.__scopeSelect),r=Lw(Jb,e.__scopeSelect),[a,i]=j.useState(!1),l=An(t,r.onScrollButtonChange);return xr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=f.scrollHeight-f.clientHeight,h=Math.ceil(f.scrollTop)<c;i(h)};const f=n.viewport;return o(),f.addEventListener("scroll",o),()=>f.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),a?d.jsx(uO,{...e,ref:l,onAutoScroll:()=>{const{viewport:o,selectedItem:f}=n;o&&f&&(o.scrollTop=o.scrollTop+f.offsetHeight)}}):null});qK.displayName=Jb;var uO=j.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Al("SelectScrollButton",n),l=j.useRef(null),o=mm(n),f=j.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return j.useEffect(()=>()=>f(),[f]),xr(()=>{var h;const c=o().find(p=>p.ref.current===document.activeElement);(h=c==null?void 0:c.ref.current)==null||h.scrollIntoView({block:"nearest"})},[o]),d.jsx(Jt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:nn(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:nn(a.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:nn(a.onPointerLeave,()=>{f()})})}),VK="SelectSeparator",HK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Jt.div,{"aria-hidden":!0,...r,ref:t})});HK.displayName=VK;var e1="SelectArrow",GK=j.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=gm(n),i=jl(e1,n),l=Al(e1,n);return i.open&&l.position==="popper"?d.jsx(xK,{...a,...r,ref:t}):null});GK.displayName=e1;var $K="SelectBubbleInput",cO=j.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=j.useRef(null),i=An(r,a),l=bK(t);return j.useEffect(()=>{const o=a.current;if(!o)return;const f=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==t&&h){const p=new Event("change",{bubbles:!0});h.call(o,t),o.dispatchEvent(p)}},[l,t]),d.jsx(Jt.select,{...n,style:{...V_,...n.style},ref:i,defaultValue:t})});cO.displayName=$K;function fO(e){return e===""||e===void 0}function dO(e){const t=So(e),n=j.useRef(""),r=j.useRef(0),a=j.useCallback(l=>{const o=n.current+l;t(o),(function f(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(o)},[t]),i=j.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function hO(e,t,n){const a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=KK(e,Math.max(i,0));a.length===1&&(l=l.filter(c=>c!==n));const f=l.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function KK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var YK=H_,vO=$_,XK=Y_,QK=X_,WK=Q_,pO=W_,ZK=tO,mO=iO,JK=sO,eY=oO;const vi=YK,pi=XK,qa=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(vO,{ref:r,className:ke("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-[var(--ghost-border)] bg-surface-container-lowest px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,d.jsx(QK,{asChild:!0,children:d.jsx($a,{className:"h-4 w-4 opacity-50"})})]}));qa.displayName=vO.displayName;const Va=j.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>d.jsx(WK,{children:d.jsx(pO,{ref:a,className:ke("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border-0 bg-surface-container-highest text-card-foreground shadow-ambient",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:d.jsx(ZK,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Va.displayName=pO.displayName;const Kr=j.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(mO,{ref:r,className:ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-surface-bright focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(eY,{children:d.jsx(Dd,{className:"h-4 w-4"})})}),d.jsx(JK,{children:t})]}));Kr.displayName=mO.displayName;function Id({searchPlaceholder:e="Search...",searchValue:t,onSearchChange:n,filters:r=[],filterValues:a={},onFilterChange:i}){return d.jsxs($e,{level:"bright",className:"flex items-center gap-3 px-4 py-2 rounded-md",children:[d.jsx(pc,{className:"h-3.5 w-3.5 text-on-surface-variant shrink-0"}),d.jsx(fn,{placeholder:e,value:t,onChange:l=>n(l.target.value),className:"bg-transparent border-none shadow-none focus-visible:ring-0 px-0 h-auto py-0 font-sans text-sm flex-1","aria-label":e}),r.map(l=>d.jsx("div",{className:"w-40 shrink-0",children:d.jsxs(vi,{value:a[l.key]??"all",onValueChange:o=>i==null?void 0:i(l.key,o),children:[d.jsx(qa,{children:d.jsx(pi,{placeholder:l.label})}),d.jsx(Va,{children:l.options.map(o=>d.jsx(Kr,{value:o.value,children:o.label},o.value))})]})},l.key))]})}function kc({total:e,offset:t,limit:n,onPageChange:r}){if(Math.ceil(e/n)<=1)return null;const i=t>0,l=t+n<e,o=t+1,f=Math.min(t+n,e);return d.jsxs("div",{className:"flex items-center justify-center gap-3 pt-1",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",disabled:!i,onClick:()=>r(Math.max(0,t-n)),className:"gap-1 text-on-surface-variant",children:[d.jsx(P1,{className:"h-4 w-4"}),"Prev"]}),d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:[o,"–",f," of ",e]}),d.jsxs(Ae,{variant:"ghost",size:"sm",disabled:!l,onClick:()=>r(t+n),className:"gap-1 text-on-surface-variant",children:["Next",d.jsx(da,{className:"h-4 w-4"})]})]})}const tY=Sr.STATS,nY=Sr.STATS,rY=Sr.STATS,aY=3e4,iY=6e4,sY=1e4,lY=6e4;function oY(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.agent&&t.set("agent",e.agent),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/sessions?${n}`:"/sessions";return Qr({queryKey:["sessions",e],queryFn:({signal:a})=>lt(r,{signal:a}),pollCategory:"standard",refetchInterval:tY})}function uY(e){return Qr({queryKey:["session",e],queryFn:({signal:t})=>lt(`/sessions/${e}`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:nY})}function cY(e){return Qr({queryKey:["session-batches",e],queryFn:({signal:t})=>lt(`/sessions/${e}/batches`,{signal:t}),enabled:e!==void 0,pollCategory:"standard",refetchInterval:rY})}function fY(e){return qt({queryKey:["batch-activities",e],queryFn:({signal:t})=>lt(`/batches/${e}/activities`,{signal:t}),enabled:e!==void 0,staleTime:aY})}function dY(e){return qt({queryKey:["session-attachments",e],queryFn:({signal:t})=>lt(`/sessions/${e}/attachments`,{signal:t}),enabled:e!==void 0,staleTime:iY})}function gO(){const e=Sn();return fr({mutationFn:t=>U1(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function hY(){const e=Sn();return fr({mutationFn:t=>Qt(`/sessions/${t}/complete`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["session",n]}),e.invalidateQueries({queryKey:["sessions"]})}})}function yO(e){return qt({queryKey:["session-impact",e],queryFn:({signal:t})=>lt(`/sessions/${e}/impact`,{signal:t}),enabled:e!==null,staleTime:sY})}function xO(e){return qt({queryKey:["session-plans",e],queryFn:({signal:t})=>lt(`/sessions/${e}/plans`,{signal:t}),enabled:!!e,staleTime:lY})}const vY=3e5;function bO(){return qt({queryKey:["symbionts"],queryFn:({signal:e})=>lt("/symbionts",{signal:e}),staleTime:vY})}function pY(e,t,n){const r=e.find(a=>a.name===t);return r!=null&&r.resumeCommand?r.resumeCommand.replace("{sessionId}",n):null}const mY=300;function gY(e,t=mY){const[n,r]=j.useState(e);return j.useEffect(()=>{const a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}const tr="all";function Fd({initialFilters:e}){const[t,n]=j.useState(""),r=gY(t),[a,i]=j.useState(e),[l,o]=j.useState(0),f=j.useCallback((p,m)=>{i(y=>({...y,[p]:m})),o(0)},[]),c=j.useCallback(p=>{n(p),o(0)},[]),h=j.useCallback(p=>{const m=a[p];return m&&m!==tr?m:void 0},[a]);return{searchInput:t,debouncedSearch:r.length>0?r:void 0,filterValues:a,offset:l,setOffset:o,handleSearchChange:c,handleFilterChange:f,activeFilter:h}}function wO(e){return e==="active"?"active":e==="completed"?"completed":"error"}const yY={active:"bg-primary",completed:"bg-secondary",error:"bg-tertiary"},xY={active:"bg-primary/15 text-primary",completed:"bg-surface-container-high text-on-surface-variant",error:"bg-tertiary/15 text-tertiary"};function bY({status:e}){const t=wO(e);return d.jsx("span",{className:ke("inline-block h-2 w-2 rounded-full shrink-0",yY[t])})}function SO({status:e}){const t=wO(e),n=e.charAt(0).toUpperCase()+e.slice(1);return d.jsxs("span",{className:ke("inline-flex items-center gap-1.5 rounded-sm px-2 py-0.5 font-sans text-xs font-medium",xY[t]),children:[d.jsx(bY,{status:e}),n]})}const wY=5,SY=12,EY={key:"status",label:"Status",options:[{value:tr,label:"All statuses"},{value:"active",label:"Active"},{value:"completed",label:"Completed"}]};function CY({session:e,symbiontDisplayName:t,onClick:n,onDelete:r}){const a=e.title||vl(e.id);return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:n,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n())},tabIndex:0,role:"row","aria-label":`Session: ${a}`,children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.id.slice(0,SY)})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate block max-w-xs",children:a})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(xt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:t})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(SO,{status:e.status})}),d.jsx("td",{className:"px-4 py-3 text-center",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.prompt_count})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.date}),d.jsx("button",{onClick:i=>{i.stopPropagation(),r()},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&i.stopPropagation()},className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 p-1 rounded hover:bg-tertiary/10 hover:text-tertiary transition-all shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-tertiary/40","aria-label":`Delete session ${a}`,title:"Delete session",children:d.jsx(ss,{className:"h-3.5 w-3.5"})})]})})]})}function NY(){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-8 rounded bg-surface-container-high animate-pulse mx-auto"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function Eu({children:e,className:t}){return d.jsx("th",{className:ke("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function kY(){const e=Wa(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Fd({initialFilters:{status:tr,agent:tr}}),[c,h]=j.useState(null),p=gO(),{data:m}=yO((c==null?void 0:c.id)??null),{data:y}=bO(),x=j.useMemo(()=>{const z=((y==null?void 0:y.symbionts)??[]).filter(H=>H.enabled),B={key:"agent",label:"Symbiont",options:[{value:tr,label:"All symbionts"},...z.map(H=>({value:H.name,label:H.displayName}))]};return[EY,B]},[y]),b=j.useMemo(()=>{const z=new Map;for(const B of(y==null?void 0:y.symbionts)??[])z.set(B.name,B.displayName);return B=>B?z.get(B)??B:"unknown"},[y]),w=f("status"),S=f("agent"),{data:N,isLoading:E,isError:T,error:R}=oY({limit:Yr,offset:a,status:w,agent:S,search:n});function A(){c&&p.mutate(c.id,{onSuccess:()=>h(null)})}const D=(N==null?void 0:N.sessions)??[],_=(N==null?void 0:N.total)??0,L=d.jsx(Id,{searchPlaceholder:"Search sessions...",searchValue:t,onSearchChange:l,filters:x,filterValues:r,onFilterChange:o}),M=d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[d.jsx(Eu,{children:"Session ID"}),d.jsx(Eu,{children:"Title"}),d.jsx(Eu,{children:"Symbiont"}),d.jsx(Eu,{children:"Status"}),d.jsx(Eu,{className:"text-center",children:"Turns"}),d.jsx(Eu,{children:"Date"})]})});return T?d.jsxs("div",{children:[d.jsx(Si,{title:"Session Archive"}),L,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load sessions"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:R instanceof Error?R.message:"Unknown error"})]})]}):d.jsxs("div",{children:[d.jsx(Si,{title:"Session Archive",subtitle:E?"Loading...":`${_} session${_!==1?"s":""} captured`}),L,E?d.jsx($e,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full",children:[M,d.jsx("tbody",{children:Array.from({length:wY}).map((z,B)=>d.jsx(NY,{},B))})]})}):D.length===0?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant mt-4",children:[d.jsx($p,{className:"h-8 w-8 opacity-30"}),d.jsx("span",{className:"font-sans text-sm",children:_===0&&!n&&!w&&!S?"No sessions yet":"No matching sessions"}),_===0&&!n&&!w&&!S&&d.jsx("span",{className:"font-sans text-xs",children:"Sessions appear here as you work with your agent"})]}):d.jsx($e,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full","aria-label":"Session archive",children:[M,d.jsx("tbody",{children:D.map(z=>d.jsx(CY,{session:z,symbiontDisplayName:b(z.agent),onClick:()=>e(`/sessions/${z.id}`),onDelete:()=>h(z)},z.id))})]})}),d.jsx(kc,{total:_,offset:a,limit:Yr,onPageChange:i}),d.jsx(cm,{open:c!==null,onOpenChange:z=>{z||h(null)},title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:d.jsx(ss,{className:"h-4 w-4 text-tertiary"}),meta:c?[{label:"ID",value:vl(c.id)},{label:"Title",value:c.title||vl(c.id)}]:[],impact:m?[{label:"Prompts",value:m.promptCount},{label:"Spores",value:m.sporeCount},{label:"Attachments",value:m.attachmentCount},{label:"Graph Edges",value:m.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:A,isPending:p.isPending})]})}function St({children:e,className:t}){return d.jsx("div",{className:ke("font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function TY({images:e,index:t,onClose:n,onNavigate:r}){const a=e[t],i=t>0,l=t<e.length-1;j.useEffect(()=>{const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[]);const o=j.useCallback(f=>{f.key==="Escape"&&n(),f.key==="ArrowLeft"&&i&&r(t-1),f.key==="ArrowRight"&&l&&r(t+1)},[n,r,t,i,l]);return j.useEffect(()=>(document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)),[o]),a?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-surface-dim/90 backdrop-blur-sm",onClick:n,children:[d.jsx("button",{onClick:n,className:"absolute top-4 right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(kl,{className:"h-5 w-5"})}),e.length>1&&d.jsxs("span",{className:"absolute top-4 left-1/2 -translate-x-1/2 font-mono text-xs text-on-surface/60 z-10",children:[t+1," / ",e.length]}),i&&d.jsx("button",{onClick:f=>{f.stopPropagation(),r(t-1)},className:"absolute left-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(P1,{className:"h-6 w-6"})}),l&&d.jsx("button",{onClick:f=>{f.stopPropagation(),r(t+1)},className:"absolute right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10",children:d.jsx(da,{className:"h-6 w-6"})}),d.jsx("img",{src:a.src,alt:a.alt,className:"max-h-[90vh] max-w-[90vw] rounded-lg shadow-ambient object-contain",onClick:f=>f.stopPropagation()})]}):null}const jY=3;function AY({activity:e}){const[t,n]=j.useState(!1),r=e.success===1,a=!!(e.tool_input||e.tool_output_summary||e.error_message);return d.jsxs("div",{className:ke("border-l-2 transition-colors",t?"border-l-primary/30":"border-transparent hover:border-l-primary/20"),children:[d.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-surface-container/30 transition-all",onClick:()=>n(i=>!i),"aria-expanded":t,children:[t?d.jsx($a,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):d.jsx(da,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),d.jsx("span",{className:"font-mono text-xs font-medium text-on-surface",children:e.tool_name}),e.file_path&&d.jsx("span",{className:"truncate font-sans text-xs text-on-surface-variant flex-1",children:e.file_path}),d.jsx("span",{className:"shrink-0 ml-auto"}),d.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:nG(e.duration_ms)}),r?d.jsx(vc,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):d.jsx(zu,{className:"h-3.5 w-3.5 shrink-0 text-tertiary"})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-150 ease-out",style:{gridTemplateRows:t?"1fr":"0fr"},children:d.jsx("div",{className:"overflow-hidden",children:d.jsxs("div",{className:"px-8 pb-3 space-y-2",children:[!a&&d.jsx("p",{className:"font-sans text-xs text-on-surface-variant/60 italic py-1",children:"No input/output details captured"}),e.tool_input&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Input"}),d.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_input})]}),e.tool_output_summary&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-on-surface-variant mb-1",children:"Output"}),d.jsx("pre",{className:"font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface",children:e.tool_output_summary})]}),e.error_message&&d.jsxs("div",{children:[d.jsx("div",{className:"font-sans text-xs font-medium text-tertiary mb-1",children:"Error"}),d.jsx("pre",{className:"font-mono text-xs bg-tertiary/10 text-tertiary rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all",children:e.error_message})]})]})})})]})}function RY({batchId:e,activityCount:t}){const[n,r]=j.useState(!1),{data:a,isLoading:i}=fY(n?e:void 0);if(t===0)return null;const l=a??[];return d.jsxs("div",{className:"border-t border-[var(--ghost-border)]",children:[d.jsxs("button",{type:"button",className:ke("w-full flex items-center gap-2 px-4 py-2 text-left transition-colors","hover:bg-surface-container/30"),onClick:()=>r(o=>!o),children:[n?d.jsx($a,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}):d.jsx(da,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Tool Calls"}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60",children:t})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:n?"1fr":"0fr"},children:d.jsxs("div",{className:"overflow-hidden",children:[i&&d.jsx("div",{className:"px-3 py-2 space-y-1",children:Array.from({length:Math.min(t,jY)}).map((o,f)=>d.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container-high w-full"},f))}),!i&&l.length>0&&d.jsx("div",{className:"space-y-0",children:l.map(o=>d.jsx(AY,{activity:o},o.id))})]})})]})}const t1=120,DY="h-7 w-7",MY=3;function _Y(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function OY(e){return e?e.length>t1?e.slice(0,t1)+"…":e:"(no prompt)"}function LY({batch:e,batchAttachments:t,defaultOpen:n=!1,promptIndex:r,isLast:a}){const[i,l]=j.useState(n),[o,f]=j.useState(null);return d.jsxs("div",{className:"relative flex gap-4",children:[d.jsxs("div",{className:"relative flex flex-col items-center shrink-0",style:{width:"28px"},children:[r>0&&d.jsx("div",{className:"absolute top-0 w-px bg-outline-variant/40",style:{height:"14px"}}),d.jsx("div",{className:ke(DY,"rounded-full flex items-center justify-center shrink-0 text-[10px] font-mono font-bold transition-colors z-10",i?"bg-primary text-on-primary":"bg-surface-container-high text-on-surface-variant border border-outline-variant/40"),children:r+1}),!a&&d.jsx("div",{className:"flex-1 w-px bg-outline-variant/40"})]}),d.jsxs($e,{level:"low",className:"flex-1 overflow-hidden rounded-md max-w-full border border-outline-variant/10 mb-2",children:[d.jsxs("button",{type:"button",className:ke("flex w-full items-start gap-3 px-4 py-3 text-left transition-colors overflow-hidden","hover:bg-surface-container/40",i&&"bg-surface-container/20"),onClick:()=>l(c=>!c),"aria-expanded":i,children:[i?d.jsx($a,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}):d.jsx(da,{className:"mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform"}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-2 mb-0.5",children:[d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant shrink-0",children:"Prompt"}),e.activity_count>0&&d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/70 shrink-0",children:[e.activity_count," tool call",e.activity_count!==1?"s":""]}),e.started_at&&d.jsx("span",{className:"shrink-0 font-mono text-xs text-on-surface-variant",children:_Y(e.started_at)})]}),d.jsx("p",{className:"font-sans text-sm text-on-surface truncate",children:i?e.user_prompt??"(no prompt)":OY(e.user_prompt)})]})]}),d.jsx("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:i?"1fr":"0fr"},children:d.jsxs("div",{className:"overflow-hidden",children:[d.jsxs("div",{className:"px-4 pt-0 pb-3 overflow-hidden",children:[e.user_prompt&&e.user_prompt.length>t1&&d.jsx(Rr,{content:e.user_prompt}),t.length>0&&d.jsx("div",{className:"mt-3 flex flex-wrap gap-3",children:t.map((c,h)=>d.jsx("button",{type:"button",className:"rounded-md overflow-hidden hover:ring-2 hover:ring-primary/40 transition-all",onClick:()=>f(h),children:d.jsx("img",{src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??"",className:"max-w-[200px] max-h-[140px] object-cover rounded-md",loading:"lazy"})},c.id))}),o!==null&&d.jsx(TY,{images:t.map(c=>({src:`/api/attachments/${c.file_path}`,alt:c.description??c.file_path??""})),index:o,onNavigate:f,onClose:()=>f(null)})]}),e.activity_count>0&&d.jsx(RY,{batchId:e.id,activityCount:e.activity_count}),e.response_summary&&d.jsx("div",{className:"border-t border-[var(--ghost-border)] overflow-hidden",children:d.jsxs("div",{className:"flex gap-3 px-4 py-3",children:[d.jsx("div",{className:"w-0.5 shrink-0 rounded-full bg-primary/30"}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[d.jsx(Rd,{className:"h-3 w-3 text-primary/60"}),d.jsx("span",{className:"font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",children:"Response"})]}),d.jsx(Rr,{content:e.response_summary})]})]})})]})})]})]})}function PY({sessionId:e}){const{data:t,isLoading:n}=cY(e),{data:r}=dY(e),a=r??[],{byBatchId:i,byTurnNumber:l}=j.useMemo(()=>{var h;const f=new Map,c=new Map;for(const p of a){if(p.prompt_batch_id!=null){const y=f.get(p.prompt_batch_id)??[];y.push(p),f.set(p.prompt_batch_id,y)}const m=(h=p.file_path)==null?void 0:h.match(/-t(\d+)-/);if(m!=null&&m[1]){const y=parseInt(m[1]),x=c.get(y)??[];x.push(p),c.set(y,x)}}return{byBatchId:f,byTurnNumber:c}},[a]);if(n)return d.jsx("div",{className:"space-y-3 pl-11",children:Array.from({length:MY}).map((f,c)=>d.jsx("div",{className:"h-16 animate-pulse rounded-md bg-surface-container-low"},c))});const o=[...t??[]].sort((f,c)=>(f.started_at??0)-(c.started_at??0));return o.length===0?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx($p,{className:"h-8 w-8 opacity-30"}),d.jsx("span",{className:"font-sans text-sm",children:"No prompts recorded"})]}):d.jsx("div",{children:o.map((f,c)=>{const h=i.get(f.id)??(f.prompt_number!==null?l.get(f.prompt_number)??[]:[]);return d.jsx(LY,{batch:f,batchAttachments:h,defaultOpen:c===o.length-1,promptIndex:c,isLast:c===o.length-1},f.id)})})}const BY="▲",zY="▼";function IY(e){const t=(e.match(/- \[x\]/gi)??[]).length,n=(e.match(/- \[ \]/g)??[]).length;return{total:t+n,checked:t}}const FY={active:"bg-green-500/10 text-green-500",completed:"bg-blue-500/10 text-blue-500"},UY="bg-muted text-muted-foreground";function qY({status:e}){const t=ke("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide",FY[e]??UY);return d.jsx("span",{className:t,children:e})}function VY({plan:e,initialExpanded:t=!1}){const[n,r]=j.useState(t),a=j.useMemo(()=>e.content?IY(e.content):null,[e.content]),i=a!==null&&a.total>0,l=i?Math.round(a.checked/a.total*100):0;return d.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 overflow-hidden",children:[d.jsxs("div",{className:"flex items-start gap-3 p-4",children:[d.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(qY,{status:e.status}),e.title&&d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.title})]}),e.source_path&&d.jsx("p",{className:"font-mono text-xs text-muted-foreground truncate",title:e.source_path,children:e.source_path}),d.jsxs("div",{className:"flex gap-3 font-sans text-xs text-muted-foreground",children:[d.jsxs("span",{children:["Created ",wi(e.created_at)]}),e.updated_at&&e.updated_at!==e.created_at&&d.jsxs("span",{title:Gb(e.updated_at),children:["Updated ",wi(e.updated_at)]})]}),i&&d.jsxs("div",{className:"space-y-1 pt-0.5",children:[d.jsxs("div",{className:"flex items-center justify-between font-sans text-xs text-muted-foreground",children:[d.jsxs("span",{children:[a.checked,"/",a.total," items"]}),d.jsxs("span",{children:[l,"%"]})]}),d.jsx("div",{className:"h-1.5 rounded-full bg-border overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${l}%`}})})]})]}),e.content&&d.jsx("button",{onClick:()=>r(o=>!o),className:"shrink-0 mt-0.5 text-xs text-muted-foreground hover:text-on-surface transition-colors cursor-pointer","aria-label":n?"Collapse plan":"Expand plan",children:n?BY:zY})]}),n&&e.content&&d.jsx("div",{className:"border-t border-border px-4 py-3",children:d.jsx(Rr,{content:e.content,className:"text-sm"})})]})}function HY({sessionId:e,expandedPlanId:t}){const{data:n,isLoading:r,isError:a}=xO(e);return r?d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Loading plans..."})}):a?d.jsx("div",{className:"flex h-32 items-center justify-center",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"Failed to load plans."})}):!n||n.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center rounded-lg border border-border bg-muted/30",children:d.jsx("span",{className:"font-sans text-sm text-muted-foreground",children:"No plans captured for this session"})}):d.jsx("div",{className:"space-y-3",children:n.map(i=>d.jsx(VY,{plan:i,initialExpanded:String(i.id)===t},i.id))})}function GY(e){return e===null?"—":lm(new Date(e*1e3).toISOString())}const $Y=1500;function _f({label:e,value:t,mono:n=!0,copyable:r=!1,code:a=!1}){const[i,l]=j.useState(!1),o=j.useCallback(()=>{navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),$Y)},[t]),f=a?d.jsx("code",{className:"text-xs font-mono text-primary bg-surface-container-lowest rounded px-1.5 py-0.5",children:t}):d.jsx("span",{className:ke("text-xs text-on-surface",n&&"font-mono"),children:t});return d.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0",children:[d.jsx("span",{className:"shrink-0 w-20 font-sans text-xs font-medium text-on-surface-variant",children:e}),r?d.jsxs("button",{onClick:o,title:"Click to copy",className:"flex items-center gap-1.5 min-w-0 hover:text-primary transition-colors cursor-pointer",children:[f,i&&d.jsx(Dd,{className:"h-3 w-3 text-primary shrink-0"})]}):d.jsx("span",{className:"min-w-0",children:f})]})}function nT({label:e,value:t,activeTab:n,onClick:r}){return d.jsx("button",{onClick:()=>r(t),className:ke("px-4 py-2 font-sans text-sm font-medium transition-colors cursor-pointer",n===t?"border-b-2 border-primary text-on-surface":"text-muted-foreground hover:text-on-surface"),children:e})}function KY({id:e}){const t=Wa(),{data:n,isLoading:r,isError:a,error:i}=uY(e),{data:l}=bO(),o=Cw(),f=hY(),[c,h]=j.useState("idle"),[p,m]=j.useState(!1),[y,x]=j.useState(()=>new URLSearchParams(window.location.search).get("tab")==="plans"?"plans":"conversation"),[b]=j.useState(()=>new URLSearchParams(window.location.search).get("plan")),w=gO(),{data:S}=yO(p?e:null),{data:N}=xO(e);if(r)return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(jn,{className:"h-5 w-5 animate-spin"}),d.jsx("span",{className:"font-sans text-sm",children:"Loading session..."})]})]});if(a||!n)return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Session not found"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:i instanceof Error?i.message:"Unknown error"})]})]});const E=l?pY(l.symbionts,n.agent,e):null;return d.jsxs("div",{className:"p-6 space-y-6 overflow-hidden",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:()=>t("/sessions"),className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Session Archive"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsx("h1",{className:"font-serif text-2xl font-normal text-on-surface tracking-wide",children:n.title??vl(n.id)}),d.jsx(SO,{status:n.status}),n.agent&&d.jsx(xt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:n.agent}),d.jsxs(Ae,{variant:"secondary",size:"sm",className:"ml-auto gap-2",disabled:c==="running",onClick:async()=>{h("running");try{await o.mutateAsync({task:"title-summary",instruction:`Process session ${e} only`}),h("done")}catch{h("error")}},children:[c==="running"?d.jsx(jn,{className:"h-4 w-4 animate-spin"}):d.jsx(F1,{className:"h-4 w-4"}),c==="done"?"Summary Requested":"Generate Summary"]}),(()=>{const T=n.status!=="active",R=f.isSuccess?"Session Completed":T?"Already Completed":"Complete Session";return d.jsxs(Ae,{variant:"secondary",size:"sm",className:"gap-2",disabled:f.isPending||T,title:T?"Session is already completed":"Mark this session completed and regenerate its summary",onClick:()=>f.mutate(e),children:[f.isPending?d.jsx(jn,{className:"h-4 w-4 animate-spin"}):d.jsx(vc,{className:"h-4 w-4"}),R]})})(),d.jsxs(Ae,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>m(!0),children:[d.jsx(ss,{className:"h-4 w-4"}),"Delete"]})]}),d.jsxs("div",{className:"flex flex-wrap gap-4 font-sans text-sm text-on-surface-variant",children:[n.user&&d.jsxs("span",{children:["User: ",d.jsx("span",{className:"text-on-surface",children:n.user})]}),n.branch&&d.jsxs("span",{children:["Branch: ",d.jsx("span",{className:"font-mono text-on-surface",children:n.branch})]}),d.jsxs("span",{children:["Started ",GY(n.started_at)]}),n.ended_at&&d.jsxs("span",{children:["Duration: ",om(n.started_at,n.ended_at)]})]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsx(Yt,{label:"Prompts",value:String(n.prompt_count),accent:"sage"}),d.jsx(Yt,{label:"Tool Calls",value:String(n.tool_count),accent:"sage"}),d.jsx(Yt,{label:"Plans",value:String((N==null?void 0:N.length)??0),accent:"outline"})]}),d.jsxs($e,{level:"low",className:"p-4 overflow-hidden",children:[d.jsx(St,{className:"mb-3",children:"Metadata"}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6",children:[d.jsx(_f,{label:"Session ID",value:e,copyable:!0}),E&&d.jsx(_f,{label:"Resume",value:E,copyable:!0,code:!0}),n.parent_session_id&&d.jsx(_f,{label:"Parent",value:n.parent_session_id}),n.parent_session_reason&&d.jsx(_f,{label:"Reason",value:n.parent_session_reason,mono:!1}),n.project_root&&d.jsx(_f,{label:"Project",value:n.project_root})]})]}),n.summary&&d.jsxs($e,{level:"low",className:"p-4 overflow-hidden",children:[d.jsx(St,{className:"mb-2",children:"Summary"}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant whitespace-pre-wrap break-words",children:n.summary})]}),d.jsxs("div",{className:"min-w-0 overflow-hidden",children:[d.jsxs("div",{className:"flex gap-0 border-b border-border mb-4",children:[d.jsx(nT,{label:"Conversation",value:"conversation",activeTab:y,onClick:x}),d.jsx(nT,{label:"Plans",value:"plans",activeTab:y,onClick:x})]}),y==="conversation"&&d.jsx(PY,{sessionId:e}),y==="plans"&&d.jsx(HY,{sessionId:e,expandedPlanId:b})]}),d.jsx(cm,{open:p,onOpenChange:m,title:"Delete Session",description:"This will permanently remove this session and all related data. This action cannot be undone.",icon:d.jsx(ss,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"ID",value:vl(n.id)},{label:"Title",value:n.title||vl(n.id)}]:[],impact:S?[{label:"Prompts",value:S.promptCount},{label:"Spores",value:S.sporeCount},{label:"Attachments",value:S.attachmentCount},{label:"Graph Edges",value:S.graphEdgeCount}]:[],confirmLabel:"Delete Session",variant:"destructive",onConfirm:()=>{w.mutate(n.id,{onSuccess:()=>{m(!1),t("/sessions")}})},isPending:w.isPending})]})}function rT(){const{id:e}=mB();return e?d.jsx(KY,{id:e}):d.jsx("div",{className:"p-6",children:d.jsx(kY,{})})}function n1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function YY(e){if(Array.isArray(e))return e}function XY(e){if(Array.isArray(e))return n1(e)}function Rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CO(r.key),r)}}function Dl(e,t,n){return t&&QY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Pw(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
503
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,l=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return l=f.done,f},e:function(f){o=!0,i=f},f:function(){try{l||n.return==null||n.return()}finally{if(o)throw i}}}}function EO(e,t,n){return(t=CO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,l,o=[],f=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=i.call(n)).done)&&(o.push(r.value),o.length!==t);f=!0);}catch(h){c=!0,a=h}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw a}}return o}}function JY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
504
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
505
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bn(e,t){return YY(e)||ZY(e,t)||Pw(e,t)||JY()}function jp(e){return XY(e)||WY(e)||Pw(e)||eX()}function tX(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 String(e)}function CO(e){var t=tX(e,"string");return typeof t=="symbol"?t:t+""}function Gn(e){"@babel/helpers - typeof";return Gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gn(e)}function Pw(e,t){if(e){if(typeof e=="string")return n1(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?n1(e,t):void 0}}var qn=typeof window>"u"?null:window,aT=qn?qn.navigator:null;qn&&qn.document;var nX=Gn(""),NO=Gn({}),rX=Gn(function(){}),aX=typeof HTMLElement>"u"?"undefined":Gn(HTMLElement),Ud=function(t){return t&&t.instanceString&&gn(t.instanceString)?t.instanceString():null},tt=function(t){return t!=null&&Gn(t)==nX},gn=function(t){return t!=null&&Gn(t)===rX},Wt=function(t){return!fa(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)},Mt=function(t){return t!=null&&Gn(t)===NO&&!Wt(t)&&t.constructor===Object},iX=function(t){return t!=null&&Gn(t)===NO},Re=function(t){return t!=null&&Gn(t)===Gn(1)&&!isNaN(t)},sX=function(t){return Re(t)&&Math.floor(t)===t},Ap=function(t){if(aX!=="undefined")return t!=null&&t instanceof HTMLElement},fa=function(t){return qd(t)||kO(t)},qd=function(t){return Ud(t)==="collection"&&t._private.single},kO=function(t){return Ud(t)==="collection"&&!t._private.single},Bw=function(t){return Ud(t)==="core"},TO=function(t){return Ud(t)==="stylesheet"},lX=function(t){return Ud(t)==="event"},bl=function(t){return t==null?!0:!!(t===""||t.match(/^\s+$/))},oX=function(t){return typeof HTMLElement>"u"?!1:t instanceof HTMLElement},uX=function(t){return Mt(t)&&Re(t.x1)&&Re(t.x2)&&Re(t.y1)&&Re(t.y2)},cX=function(t){return iX(t)&&gn(t.then)},fX=function(){return aT&&aT.userAgent.match(/msie|trident|edge/i)},oc=function(t,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],l=0;l<arguments.length;l++)i.push(arguments[l]);return i.join("$")});var r=function(){var i=this,l=arguments,o,f=n.apply(i,l),c=r.cache;return(o=c[f])||(o=c[f]=t.apply(i,l)),o};return r.cache={},r},zw=oc(function(e){return e.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}),ym=oc(function(e){return e.replace(/(-\w)/g,function(t){return t[1].toUpperCase()})}),jO=oc(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),iT=function(t){return bl(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},ul=function(t,n){return t.slice(-1*n.length)===n},Hn="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",dX="rgb[a]?\\(("+Hn+"[%]?)\\s*,\\s*("+Hn+"[%]?)\\s*,\\s*("+Hn+"[%]?)(?:\\s*,\\s*("+Hn+"))?\\)",hX="rgb[a]?\\((?:"+Hn+"[%]?)\\s*,\\s*(?:"+Hn+"[%]?)\\s*,\\s*(?:"+Hn+"[%]?)(?:\\s*,\\s*(?:"+Hn+"))?\\)",vX="hsl[a]?\\(("+Hn+")\\s*,\\s*("+Hn+"[%])\\s*,\\s*("+Hn+"[%])(?:\\s*,\\s*("+Hn+"))?\\)",pX="hsl[a]?\\((?:"+Hn+")\\s*,\\s*(?:"+Hn+"[%])\\s*,\\s*(?:"+Hn+"[%])(?:\\s*,\\s*(?:"+Hn+"))?\\)",mX="\\#[0-9a-fA-F]{3}",gX="\\#[0-9a-fA-F]{6}",AO=function(t,n){return t<n?-1:t>n?1:0},yX=function(t,n){return-1*AO(t,n)},at=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(r!=null)for(var a=Object.keys(r),i=0;i<a.length;i++){var l=a[i];e[l]=r[l]}}return e},xX=function(t){if(!(!(t.length===4||t.length===7)||t[0]!=="#")){var n=t.length===4,r,a,i,l=16;return n?(r=parseInt(t[1]+t[1],l),a=parseInt(t[2]+t[2],l),i=parseInt(t[3]+t[3],l)):(r=parseInt(t[1]+t[2],l),a=parseInt(t[3]+t[4],l),i=parseInt(t[5]+t[6],l)),[r,a,i]}},bX=function(t){var n,r,a,i,l,o,f,c;function h(x,b,w){return w<0&&(w+=1),w>1&&(w-=1),w<1/6?x+(b-x)*6*w:w<1/2?b:w<2/3?x+(b-x)*(2/3-w)*6:x}var p=new RegExp("^"+vX+"$").exec(t);if(p){if(r=parseInt(p[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(p[2]),a<0||a>100||(a=a/100,i=parseFloat(p[3]),i<0||i>100)||(i=i/100,l=p[4],l!==void 0&&(l=parseFloat(l),l<0||l>1)))return;if(a===0)o=f=c=Math.round(i*255);else{var m=i<.5?i*(1+a):i+a-i*a,y=2*i-m;o=Math.round(255*h(y,m,r+1/3)),f=Math.round(255*h(y,m,r)),c=Math.round(255*h(y,m,r-1/3))}n=[o,f,c,l]}return n},wX=function(t){var n,r=new RegExp("^"+dX+"$").exec(t);if(r){n=[];for(var a=[],i=1;i<=3;i++){var l=r[i];if(l[l.length-1]==="%"&&(a[i]=!0),l=parseFloat(l),a[i]&&(l=l/100*255),l<0||l>255)return;n.push(Math.floor(l))}var o=a[1]||a[2]||a[3],f=a[1]&&a[2]&&a[3];if(o&&!f)return;var c=r[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;n.push(c)}}return n},SX=function(t){return EX[t.toLowerCase()]},RO=function(t){return(Wt(t)?t:null)||SX(t)||xX(t)||wX(t)||bX(t)},EX={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},DO=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(Mt(l))throw Error("Tried to set map with object key");i<r.length-1?(n[l]==null&&(n[l]={}),n=n[l]):n[l]=t.value}},MO=function(t){for(var n=t.map,r=t.keys,a=r.length,i=0;i<a;i++){var l=r[i];if(Mt(l))throw Error("Tried to get map with object key");if(n=n[l],n==null)return n}return n},Tv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rx,sT;function Hd(){if(sT)return Rx;sT=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Rx=e,Rx}var Dx,lT;function CX(){if(lT)return Dx;lT=1;var e=typeof Tv=="object"&&Tv&&Tv.Object===Object&&Tv;return Dx=e,Dx}var Mx,oT;function xm(){if(oT)return Mx;oT=1;var e=CX(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Mx=n,Mx}var _x,uT;function NX(){if(uT)return _x;uT=1;var e=xm(),t=function(){return e.Date.now()};return _x=t,_x}var Ox,cT;function kX(){if(cT)return Ox;cT=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Ox=t,Ox}var Lx,fT;function TX(){if(fT)return Lx;fT=1;var e=kX(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Lx=n,Lx}var Px,dT;function Iw(){if(dT)return Px;dT=1;var e=xm(),t=e.Symbol;return Px=t,Px}var Bx,hT;function jX(){if(hT)return Bx;hT=1;var e=Iw(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(l){var o=n.call(l,a),f=l[a];try{l[a]=void 0;var c=!0}catch{}var h=r.call(l);return c&&(o?l[a]=f:delete l[a]),h}return Bx=i,Bx}var zx,vT;function AX(){if(vT)return zx;vT=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return zx=n,zx}var Ix,pT;function _O(){if(pT)return Ix;pT=1;var e=Iw(),t=jX(),n=AX(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function l(o){return o==null?o===void 0?a:r:i&&i in Object(o)?t(o):n(o)}return Ix=l,Ix}var Fx,mT;function RX(){if(mT)return Fx;mT=1;function e(t){return t!=null&&typeof t=="object"}return Fx=e,Fx}var Ux,gT;function Gd(){if(gT)return Ux;gT=1;var e=_O(),t=RX(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return Ux=r,Ux}var qx,yT;function DX(){if(yT)return qx;yT=1;var e=TX(),t=Hd(),n=Gd(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,o=parseInt;function f(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=t(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=e(c);var p=i.test(c);return p||l.test(c)?o(c.slice(2),p?2:8):a.test(c)?r:+c}return qx=f,qx}var Vx,xT;function MX(){if(xT)return Vx;xT=1;var e=Hd(),t=NX(),n=DX(),r="Expected a function",a=Math.max,i=Math.min;function l(o,f,c){var h,p,m,y,x,b,w=0,S=!1,N=!1,E=!0;if(typeof o!="function")throw new TypeError(r);f=n(f)||0,e(c)&&(S=!!c.leading,N="maxWait"in c,m=N?a(n(c.maxWait)||0,f):m,E="trailing"in c?!!c.trailing:E);function T(H){var G=h,U=p;return h=p=void 0,w=H,y=o.apply(U,G),y}function R(H){return w=H,x=setTimeout(_,f),S?T(H):y}function A(H){var G=H-b,U=H-w,I=f-G;return N?i(I,m-U):I}function D(H){var G=H-b,U=H-w;return b===void 0||G>=f||G<0||N&&U>=m}function _(){var H=t();if(D(H))return L(H);x=setTimeout(_,A(H))}function L(H){return x=void 0,E&&h?T(H):(h=p=void 0,y)}function M(){x!==void 0&&clearTimeout(x),w=0,h=b=p=x=void 0}function z(){return x===void 0?y:L(t())}function B(){var H=t(),G=D(H);if(h=arguments,p=this,b=H,G){if(x===void 0)return R(b);if(N)return clearTimeout(x),x=setTimeout(_,f),T(b)}return x===void 0&&(x=setTimeout(_,f)),y}return B.cancel=M,B.flush=z,B}return Vx=l,Vx}var _X=MX(),$d=Vd(_X),Hx=qn?qn.performance:null,OO=Hx&&Hx.now?function(){return Hx.now()}:function(){return Date.now()},OX=(function(){if(qn){if(qn.requestAnimationFrame)return function(e){qn.requestAnimationFrame(e)};if(qn.mozRequestAnimationFrame)return function(e){qn.mozRequestAnimationFrame(e)};if(qn.webkitRequestAnimationFrame)return function(e){qn.webkitRequestAnimationFrame(e)};if(qn.msRequestAnimationFrame)return function(e){qn.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(OO())},1e3/60)}})(),Rp=function(t){return OX(t)},us=OO,ao=9261,LO=65599,Ou=5381,PO=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ao,r=n,a;a=t.next(),!a.done;)r=r*LO+a.value|0;return r},cd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ao;return n*LO+t|0},fd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ou;return(n<<5)+n+t|0},LX=function(t,n){return t*2097152+n},$s=function(t){return t[0]*2097152+t[1]},jv=function(t,n){return[cd(t[0],n[0]),fd(t[1],n[1])]},bT=function(t,n){var r={value:0,done:!1},a=0,i=t.length,l={next:function(){return a<i?r.value=t[a++]:r.done=!0,r}};return PO(l,n)},jo=function(t,n){var r={value:0,done:!1},a=0,i=t.length,l={next:function(){return a<i?r.value=t.charCodeAt(a++):r.done=!0,r}};return PO(l,n)},BO=function(){return PX(arguments)},PX=function(t){for(var n,r=0;r<t.length;r++){var a=t[r];r===0?n=jo(a):n=jo(a,n)}return n};function BX(e,t,n,r,a){var i=a*Math.PI/180,l=Math.cos(i)*(e-n)-Math.sin(i)*(t-r)+n,o=Math.sin(i)*(e-n)+Math.cos(i)*(t-r)+r;return{x:l,y:o}}var zX=function(t,n,r,a,i,l){return{x:(t-r)*i+r,y:(n-a)*l+a}};function IX(e,t,n){if(n===0)return e;var r=(t.x1+t.x2)/2,a=(t.y1+t.y2)/2,i=t.w/t.h,l=1/i,o=BX(e.x,e.y,r,a,n),f=zX(o.x,o.y,r,a,i,l);return{x:f.x,y:f.y}}var wT=!0,FX=console.warn!=null,UX=console.trace!=null,Fw=Number.MAX_SAFE_INTEGER||9007199254740991,zO=function(){return!0},Dp=function(){return!1},ST=function(){return 0},Uw=function(){},dn=function(t){throw new Error(t)},IO=function(t){if(t!==void 0)wT=!!t;else return wT},zt=function(t){IO()&&(FX?console.warn(t):(console.log(t),UX&&console.trace()))},qX=function(t){return at({},t)},mi=function(t){return t==null?t:Wt(t)?t.slice():Mt(t)?qX(t):t},VX=function(t){return t.slice()},FO=function(t,n){for(n=t="";t++<36;n+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-");return n},HX={},UO=function(){return HX},dr=function(t){var n=Object.keys(t);return function(r){for(var a={},i=0;i<n.length;i++){var l=n[i],o=r==null?void 0:r[l];a[l]=o===void 0?t[l]:o}return a}},wl=function(t,n,r){for(var a=t.length-1;a>=0;a--)t[a]===n&&t.splice(a,1)},qw=function(t){t.splice(0,t.length)},GX=function(t,n){for(var r=0;r<n.length;r++){var a=n[r];t.push(a)}},Gr=function(t,n,r){return r&&(n=jO(r,n)),t[n]},Qi=function(t,n,r,a){r&&(n=jO(r,n)),t[n]=a},$X=(function(){function e(){Rl(this,e),this._obj={}}return Dl(e,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}])})(),ts=typeof Map<"u"?Map:$X,KX="undefined",YX=(function(){function e(t){if(Rl(this,e),this._obj=Object.create(null),this.size=0,t!=null){var n;t.instanceString!=null&&t.instanceString()===this.instanceString()?n=t.toArray():n=t;for(var r=0;r<n.length;r++)this.add(n[r])}}return Dl(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}])})(),Tc=(typeof Set>"u"?"undefined":Gn(Set))!==KX?Set:YX,bm=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(t===void 0||n===void 0||!Bw(t)){dn("An element must have a core reference and parameters set");return}var a=n.group;if(a==null&&(n.data&&n.data.source!=null&&n.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){dn("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:t,single:!0,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?a==="edges":!!n.pannable,active:!1,classes:new Tc,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),n.renderedPosition){var l=n.renderedPosition,o=t.pan(),f=t.zoom();i.position={x:(l.x-o.x)/f,y:(l.y-o.y)/f}}var c=[];Wt(n.classes)?c=n.classes:tt(n.classes)&&(c=n.classes.split(/\s+/));for(var h=0,p=c.length;h<p;h++){var m=c[h];!m||m===""||i.classes.add(m)}this.createEmitter(),(r===void 0||r)&&this.restore();var y=n.style||n.css;y&&(zt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(y))},ET=function(t){return t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs},function(r,a,i){var l;Mt(r)&&!fa(r)&&(l=r,r=l.roots||l.root,a=l.visit,i=l.directed),i=arguments.length===2&&!gn(a)?a:i,a=gn(a)?a:function(){};for(var o=this._private.cy,f=r=tt(r)?this.filter(r):r,c=[],h=[],p={},m={},y={},x=0,b,w=this.byGroup(),S=w.nodes,N=w.edges,E=0;E<f.length;E++){var T=f[E],R=T.id();T.isNode()&&(c.unshift(T),t.bfs&&(y[R]=!0,h.push(T)),m[R]=0)}for(var A=function(){var H=t.bfs?c.shift():c.pop(),G=H.id();if(t.dfs){if(y[G])return 0;y[G]=!0,h.push(H)}var U=m[G],I=p[G],V=I!=null?I.source():null,K=I!=null?I.target():null,Q=I==null?void 0:H.same(V)?K[0]:V[0],F;if(F=a(H,I,Q,x++,U),F===!0)return b=H,1;if(F===!1)return 1;for(var q=H.connectedEdges().filter(function(ie){return(!i||ie.source().same(H))&&N.has(ie)}),X=0;X<q.length;X++){var P=q[X],Z=P.connectedNodes().filter(function(ie){return!ie.same(H)&&S.has(ie)}),ae=Z.id();Z.length!==0&&!y[ae]&&(Z=Z[0],c.push(Z),t.bfs&&(y[ae]=!0,h.push(Z)),p[ae]=P,m[ae]=m[G]+1)}},D;c.length!==0&&(D=A(),!(D!==0&&D===1)););for(var _=o.collection(),L=0;L<h.length;L++){var M=h[L],z=p[M.id()];z!=null&&_.push(z),_.push(M)}return{path:o.collection(_),found:o.collection(b)}}},dd={breadthFirstSearch:ET({bfs:!0}),depthFirstSearch:ET({dfs:!0})};dd.bfs=dd.breadthFirstSearch;dd.dfs=dd.depthFirstSearch;var ep={exports:{}},XX=ep.exports,CT;function QX(){return CT||(CT=1,(function(e,t){(function(){var n,r,a,i,l,o,f,c,h,p,m,y,x,b,w;a=Math.floor,p=Math.min,r=function(S,N){return S<N?-1:S>N?1:0},h=function(S,N,E,T,R){var A;if(E==null&&(E=0),R==null&&(R=r),E<0)throw new Error("lo must be non-negative");for(T==null&&(T=S.length);E<T;)A=a((E+T)/2),R(N,S[A])<0?T=A:E=A+1;return[].splice.apply(S,[E,E-E].concat(N)),N},o=function(S,N,E){return E==null&&(E=r),S.push(N),b(S,0,S.length-1,E)},l=function(S,N){var E,T;return N==null&&(N=r),E=S.pop(),S.length?(T=S[0],S[0]=E,w(S,0,N)):T=E,T},c=function(S,N,E){var T;return E==null&&(E=r),T=S[0],S[0]=N,w(S,0,E),T},f=function(S,N,E){var T;return E==null&&(E=r),S.length&&E(S[0],N)<0&&(T=[S[0],N],N=T[0],S[0]=T[1],w(S,0,E)),N},i=function(S,N){var E,T,R,A,D,_;for(N==null&&(N=r),A=(function(){_=[];for(var L=0,M=a(S.length/2);0<=M?L<M:L>M;0<=M?L++:L--)_.push(L);return _}).apply(this).reverse(),D=[],T=0,R=A.length;T<R;T++)E=A[T],D.push(w(S,E,N));return D},x=function(S,N,E){var T;if(E==null&&(E=r),T=S.indexOf(N),T!==-1)return b(S,0,T,E),w(S,T,E)},m=function(S,N,E){var T,R,A,D,_;if(E==null&&(E=r),R=S.slice(0,N),!R.length)return R;for(i(R,E),_=S.slice(N),A=0,D=_.length;A<D;A++)T=_[A],f(R,T,E);return R.sort(E).reverse()},y=function(S,N,E){var T,R,A,D,_,L,M,z,B;if(E==null&&(E=r),N*10<=S.length){if(A=S.slice(0,N).sort(E),!A.length)return A;for(R=A[A.length-1],M=S.slice(N),D=0,L=M.length;D<L;D++)T=M[D],E(T,R)<0&&(h(A,T,0,null,E),A.pop(),R=A[A.length-1]);return A}for(i(S,E),B=[],_=0,z=p(N,S.length);0<=z?_<z:_>z;0<=z?++_:--_)B.push(l(S,E));return B},b=function(S,N,E,T){var R,A,D;for(T==null&&(T=r),R=S[E];E>N;){if(D=E-1>>1,A=S[D],T(R,A)<0){S[E]=A,E=D;continue}break}return S[E]=R},w=function(S,N,E){var T,R,A,D,_;for(E==null&&(E=r),R=S.length,_=N,A=S[N],T=2*N+1;T<R;)D=T+1,D<R&&!(E(S[T],S[D])<0)&&(T=D),S[N]=S[T],N=T,T=2*N+1;return S[N]=A,b(S,_,N,E)},n=(function(){S.push=o,S.pop=l,S.replace=c,S.pushpop=f,S.heapify=i,S.updateItem=x,S.nlargest=m,S.nsmallest=y;function S(N){this.cmp=N??r,this.nodes=[]}return S.prototype.push=function(N){return o(this.nodes,N,this.cmp)},S.prototype.pop=function(){return l(this.nodes,this.cmp)},S.prototype.peek=function(){return this.nodes[0]},S.prototype.contains=function(N){return this.nodes.indexOf(N)!==-1},S.prototype.replace=function(N){return c(this.nodes,N,this.cmp)},S.prototype.pushpop=function(N){return f(this.nodes,N,this.cmp)},S.prototype.heapify=function(){return i(this.nodes,this.cmp)},S.prototype.updateItem=function(N){return x(this.nodes,N,this.cmp)},S.prototype.clear=function(){return this.nodes=[]},S.prototype.empty=function(){return this.nodes.length===0},S.prototype.size=function(){return this.nodes.length},S.prototype.clone=function(){var N;return N=new S,N.nodes=this.nodes.slice(0),N},S.prototype.toArray=function(){return this.nodes.slice(0)},S.prototype.insert=S.prototype.push,S.prototype.top=S.prototype.peek,S.prototype.front=S.prototype.peek,S.prototype.has=S.prototype.contains,S.prototype.copy=S.prototype.clone,S})(),(function(S,N){return e.exports=N()})(this,function(){return n})}).call(XX)})(ep)),ep.exports}var Gx,NT;function WX(){return NT||(NT=1,Gx=QX()),Gx}var ZX=WX(),Kd=Vd(ZX),JX=dr({root:null,weight:function(t){return 1},directed:!1}),eQ={dijkstra:function(t){if(!Mt(t)){var n=arguments;t={root:n[0],weight:n[1],directed:n[2]}}var r=JX(t),a=r.root,i=r.weight,l=r.directed,o=this,f=i,c=tt(a)?this.filter(a)[0]:a[0],h={},p={},m={},y=this.byGroup(),x=y.nodes,b=y.edges;b.unmergeBy(function(U){return U.isLoop()});for(var w=function(I){return h[I.id()]},S=function(I,V){h[I.id()]=V,N.updateItem(I)},N=new Kd(function(U,I){return w(U)-w(I)}),E=0;E<x.length;E++){var T=x[E];h[T.id()]=T.same(c)?0:1/0,N.push(T)}for(var R=function(I,V){for(var K=(l?I.edgesTo(V):I.edgesWith(V)).intersect(b),Q=1/0,F,q=0;q<K.length;q++){var X=K[q],P=f(X);(P<Q||!F)&&(Q=P,F=X)}return{edge:F,dist:Q}};N.size()>0;){var A=N.pop(),D=w(A),_=A.id();if(m[_]=D,D!==1/0)for(var L=A.neighborhood().intersect(x),M=0;M<L.length;M++){var z=L[M],B=z.id(),H=R(A,z),G=D+H.dist;G<w(z)&&(S(z,G),p[B]={node:A,edge:H.edge})}}return{distanceTo:function(I){var V=tt(I)?x.filter(I)[0]:I[0];return m[V.id()]},pathTo:function(I){var V=tt(I)?x.filter(I)[0]:I[0],K=[],Q=V,F=Q.id();if(V.length>0)for(K.unshift(V);p[F];){var q=p[F];K.unshift(q.edge),K.unshift(q.node),Q=q.node,F=Q.id()}return o.spawn(K)}}}},tQ={kruskal:function(t){t=t||function(E){return 1};for(var n=this.byGroup(),r=n.nodes,a=n.edges,i=r.length,l=new Array(i),o=r,f=function(T){for(var R=0;R<l.length;R++){var A=l[R];if(A.has(T))return R}},c=0;c<i;c++)l[c]=this.spawn(r[c]);for(var h=a.sort(function(E,T){return t(E)-t(T)}),p=0;p<h.length;p++){var m=h[p],y=m.source()[0],x=m.target()[0],b=f(y),w=f(x),S=l[b],N=l[w];b!==w&&(o.merge(m),S.merge(N),l.splice(w,1))}return o}},nQ=dr({root:null,goal:null,weight:function(t){return 1},heuristic:function(t){return 0},directed:!1}),rQ={aStar:function(t){var n=this.cy(),r=nQ(t),a=r.root,i=r.goal,l=r.heuristic,o=r.directed,f=r.weight;a=n.collection(a)[0],i=n.collection(i)[0];var c=a.id(),h=i.id(),p={},m={},y={},x=new Kd(function(F,q){return m[F.id()]-m[q.id()]}),b=new Tc,w={},S={},N=function(q,X){x.push(q),b.add(X)},E,T,R=function(){E=x.pop(),T=E.id(),b.delete(T)},A=function(q){return b.has(q)};N(a,c),p[c]=0,m[c]=l(a);for(var D=0;x.size()>0;){if(R(),D++,T===h){for(var _=[],L=i,M=h,z=S[M];_.unshift(L),z!=null&&_.unshift(z),L=w[M],L!=null;)M=L.id(),z=S[M];return{found:!0,distance:p[T],path:this.spawn(_),steps:D}}y[T]=!0;for(var B=E._private.edges,H=0;H<B.length;H++){var G=B[H];if(this.hasElementWithId(G.id())&&!(o&&G.data("source")!==T)){var U=G.source(),I=G.target(),V=U.id()!==T?U:I,K=V.id();if(this.hasElementWithId(K)&&!y[K]){var Q=p[T]+f(G);if(!A(K)){p[K]=Q,m[K]=Q+l(V),N(V,K),w[K]=E,S[K]=G;continue}Q<p[K]&&(p[K]=Q,m[K]=Q+l(V),w[K]=E,S[K]=G)}}}}return{found:!1,distance:void 0,path:void 0,steps:D}}},aQ=dr({weight:function(t){return 1},directed:!1}),iQ={floydWarshall:function(t){for(var n=this.cy(),r=aQ(t),a=r.weight,i=r.directed,l=a,o=this.byGroup(),f=o.nodes,c=o.edges,h=f.length,p=h*h,m=function(P){return f.indexOf(P)},y=function(P){return f[P]},x=new Array(p),b=0;b<p;b++){var w=b%h,S=(b-w)/h;S===w?x[b]=0:x[b]=1/0}for(var N=new Array(p),E=new Array(p),T=0;T<c.length;T++){var R=c[T],A=R.source()[0],D=R.target()[0];if(A!==D){var _=m(A),L=m(D),M=_*h+L,z=l(R);if(x[M]>z&&(x[M]=z,N[M]=L,E[M]=R),!i){var B=L*h+_;!i&&x[B]>z&&(x[B]=z,N[B]=_,E[B]=R)}}}for(var H=0;H<h;H++)for(var G=0;G<h;G++)for(var U=G*h+H,I=0;I<h;I++){var V=G*h+I,K=H*h+I;x[U]+x[K]<x[V]&&(x[V]=x[U]+x[K],N[V]=N[U])}var Q=function(P){return(tt(P)?n.filter(P):P)[0]},F=function(P){return m(Q(P))},q={distance:function(P,Z){var ae=F(P),ie=F(Z);return x[ae*h+ie]},path:function(P,Z){var ae=F(P),ie=F(Z),le=y(ae);if(ae===ie)return le.collection();if(N[ae*h+ie]==null)return n.collection();var ye=n.collection(),ne=ae,W;for(ye.merge(le);ae!==ie;)ne=ae,ae=N[ae*h+ie],W=E[ne*h+ae],ye.merge(W),ye.merge(y(ae));return ye}};return q}},sQ=dr({weight:function(t){return 1},directed:!1,root:null}),lQ={bellmanFord:function(t){var n=this,r=sQ(t),a=r.weight,i=r.directed,l=r.root,o=a,f=this,c=this.cy(),h=this.byGroup(),p=h.edges,m=h.nodes,y=m.length,x=new ts,b=!1,w=[];l=c.collection(l)[0],p.unmergeBy(function(Je){return Je.isLoop()});for(var S=p.length,N=function(We){var Ve=x.get(We.id());return Ve||(Ve={},x.set(We.id(),Ve)),Ve},E=function(We){return(tt(We)?c.$(We):We)[0]},T=function(We){return N(E(We)).dist},R=function(We){for(var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,De=E(We),Ye=[],Qe=De;;){if(Qe==null)return n.spawn();var st=N(Qe),ze=st.edge,dt=st.pred;if(Ye.unshift(Qe[0]),Qe.same(Ve)&&Ye.length>0)break;ze!=null&&Ye.unshift(ze),Qe=dt}return f.spawn(Ye)},A=0;A<y;A++){var D=m[A],_=N(D);D.same(l)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var L=!1,M=function(We,Ve,De,Ye,Qe,st){var ze=Ye.dist+st;ze<Qe.dist&&!De.same(Ye.edge)&&(Qe.dist=ze,Qe.pred=We,Qe.edge=De,L=!0)},z=1;z<y;z++){L=!1;for(var B=0;B<S;B++){var H=p[B],G=H.source(),U=H.target(),I=o(H),V=N(G),K=N(U);M(G,U,H,V,K,I),i||M(U,G,H,K,V,I)}if(!L)break}if(L)for(var Q=[],F=0;F<S;F++){var q=p[F],X=q.source(),P=q.target(),Z=o(q),ae=N(X).dist,ie=N(P).dist;if(ae+Z<ie||!i&&ie+Z<ae)if(b||(zt("Graph contains a negative weight cycle for Bellman-Ford"),b=!0),t.findNegativeWeightCycles!==!1){var le=[];ae+Z<ie&&le.push(X),!i&&ie+Z<ae&&le.push(P);for(var ye=le.length,ne=0;ne<ye;ne++){var W=le[ne],J=[W];J.push(N(W).edge);for(var se=N(W).pred;J.indexOf(se)===-1;)J.push(se),J.push(N(se).edge),se=N(se).pred;J=J.slice(J.indexOf(se));for(var ge=J[0].id(),Te=0,Be=2;Be<J.length;Be+=2)J[Be].id()<ge&&(ge=J[Be].id(),Te=Be);J=J.slice(Te).concat(J.slice(0,Te)),J.push(J[0]);var ot=J.map(function(Je){return Je.id()}).join(",");Q.indexOf(ot)===-1&&(w.push(f.spawn(J)),Q.push(ot))}}else break}return{distanceTo:T,pathTo:R,hasNegativeWeightCycle:b,negativeWeightCycles:w}}},oQ=Math.sqrt(2),uQ=function(t,n,r){r.length===0&&dn("Karger-Stein must be run on a connected (sub)graph");for(var a=r[t],i=a[1],l=a[2],o=n[i],f=n[l],c=r,h=c.length-1;h>=0;h--){var p=c[h],m=p[1],y=p[2];(n[m]===o&&n[y]===f||n[m]===f&&n[y]===o)&&c.splice(h,1)}for(var x=0;x<c.length;x++){var b=c[x];b[1]===f?(c[x]=b.slice(),c[x][1]=o):b[2]===f&&(c[x]=b.slice(),c[x][2]=o)}for(var w=0;w<n.length;w++)n[w]===f&&(n[w]=o);return c},$x=function(t,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=uQ(i,t,n),r--}return n},cQ={kargerStein:function(){var t=this,n=this.byGroup(),r=n.nodes,a=n.edges;a.unmergeBy(function(K){return K.isLoop()});var i=r.length,l=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),f=Math.floor(i/oQ);if(i<2){dn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],h=0;h<l;h++){var p=a[h];c.push([h,r.indexOf(p.source()),r.indexOf(p.target())])}for(var m=1/0,y=[],x=new Array(i),b=new Array(i),w=new Array(i),S=function(Q,F){for(var q=0;q<i;q++)F[q]=Q[q]},N=0;N<=o;N++){for(var E=0;E<i;E++)b[E]=E;var T=$x(b,c.slice(),i,f),R=T.slice();S(b,w);var A=$x(b,T,f,2),D=$x(w,R,f,2);A.length<=D.length&&A.length<m?(m=A.length,y=A,S(b,x)):D.length<=A.length&&D.length<m&&(m=D.length,y=D,S(w,x))}for(var _=this.spawn(y.map(function(K){return a[K[0]]})),L=this.spawn(),M=this.spawn(),z=x[0],B=0;B<x.length;B++){var H=x[B],G=r[B];H===z?L.merge(G):M.merge(G)}var U=function(Q){var F=t.spawn();return Q.forEach(function(q){F.merge(q),q.connectedEdges().forEach(function(X){t.contains(X)&&!_.contains(X)&&F.merge(X)})}),F},I=[U(L),U(M)],V={cut:_,components:I,partition1:L,partition2:M};return V}},Kx,fQ=function(t){return{x:t.x,y:t.y}},wm=function(t,n,r){return{x:t.x*n+r.x,y:t.y*n+r.y}},qO=function(t,n,r){return{x:(t.x-r.x)/n,y:(t.y-r.y)/n}},Lu=function(t){return{x:t[0],y:t[1]}},dQ=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=1/0,i=n;i<r;i++){var l=t[i];isFinite(l)&&(a=Math.min(l,a))}return a},hQ=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=-1/0,i=n;i<r;i++){var l=t[i];isFinite(l)&&(a=Math.max(l,a))}return a},vQ=function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=0,i=0,l=n;l<r;l++){var o=t[l];isFinite(o)&&(a+=o,i++)}return a/i},pQ=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?t=t.slice(n,r):(r<t.length&&t.splice(r,t.length-r),n>0&&t.splice(0,n));for(var o=0,f=t.length-1;f>=0;f--){var c=t[f];l?isFinite(c)||(t[f]=-1/0,o++):t.splice(f,1)}i&&t.sort(function(m,y){return m-y});var h=t.length,p=Math.floor(h/2);return h%2!==0?t[p+1+o]:(t[p-1+o]+t[p+o])/2},mQ=function(t){return Math.PI*t/180},Av=function(t,n){return Math.atan2(n,t)-Math.PI/2},Vw=Math.log2||function(e){return Math.log(e)/Math.log(2)},Hw=function(t){return t>0?1:t<0?-1:0},Ao=function(t,n){return Math.sqrt(no(t,n))},no=function(t,n){var r=n.x-t.x,a=n.y-t.y;return r*r+a*a},gQ=function(t){for(var n=t.length,r=0,a=0;a<n;a++)r+=t[a];for(var i=0;i<n;i++)t[i]=t[i]/r;return t},er=function(t,n,r,a){return(1-a)*(1-a)*t+2*(1-a)*a*n+a*a*r},Hu=function(t,n,r,a){return{x:er(t.x,n.x,r.x,a),y:er(t.y,n.y,r.y,a)}},yQ=function(t,n,r,a){var i={x:n.x-t.x,y:n.y-t.y},l=Ao(t,n),o={x:i.x/l,y:i.y/l};return r=r??0,a=a??r*l,{x:t.x+o.x*a,y:t.y+o.y*a}},hd=function(t,n,r){return Math.max(t,Math.min(r,n))},Dr=function(t){if(t==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(t.x1!=null&&t.y1!=null){if(t.x2!=null&&t.y2!=null&&t.x2>=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}},xQ=function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}},bQ=function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0},wQ=function(t,n){t.x1=Math.min(t.x1,n.x1),t.x2=Math.max(t.x2,n.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,n.y1),t.y2=Math.max(t.y2,n.y2),t.h=t.y2-t.y1},VO=function(t,n,r){t.x1=Math.min(t.x1,n),t.x2=Math.max(t.x2,n),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,r),t.y2=Math.max(t.y2,r),t.h=t.y2-t.y1},tp=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t.x1-=n,t.x2+=n,t.y1-=n,t.y2+=n,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},np=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,a,i,l;if(n.length===1)r=a=i=l=n[0];else if(n.length===2)r=i=n[0],l=a=n[1];else if(n.length===4){var o=Bn(n,4);r=o[0],a=o[1],i=o[2],l=o[3]}return t.x1-=l,t.x2+=a,t.y1-=r,t.y2+=i,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},kT=function(t,n){t.x1=n.x1,t.y1=n.y1,t.x2=n.x2,t.y2=n.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1},Gw=function(t,n){return!(t.x1>n.x2||n.x1>t.x2||t.x2<n.x1||n.x2<t.x1||t.y2<n.y1||n.y2<t.y1||t.y1>n.y2||n.y1>t.y2)},cl=function(t,n,r){return t.x1<=n&&n<=t.x2&&t.y1<=r&&r<=t.y2},TT=function(t,n){return cl(t,n.x,n.y)},HO=function(t,n){return cl(t,n.x1,n.y1)&&cl(t,n.x2,n.y2)},SQ=(Kx=Math.hypot)!==null&&Kx!==void 0?Kx:function(e,t){return Math.sqrt(e*e+t*t)};function EQ(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(_,L){return{x:_.x+L.x,y:_.y+L.y}},r=function(_,L){return{x:_.x-L.x,y:_.y-L.y}},a=function(_,L){return{x:_.x*L,y:_.y*L}},i=function(_,L){return _.x*L.y-_.y*L.x},l=function(_){var L=SQ(_.x,_.y);return L===0?{x:0,y:0}:{x:_.x/L,y:_.y/L}},o=function(_){for(var L=0,M=0;M<_.length;M++){var z=_[M],B=_[(M+1)%_.length];L+=z.x*B.y-B.x*z.y}return L/2},f=function(_,L,M,z){var B=r(L,_),H=r(z,M),G=i(B,H);if(Math.abs(G)<1e-9)return n(_,a(B,.5));var U=i(r(M,_),H)/G;return n(_,a(B,U))},c=e.map(function(D){return{x:D.x,y:D.y}});o(c)<0&&c.reverse();for(var h=c.length,p=[],m=0;m<h;m++){var y=c[m],x=c[(m+1)%h],b=r(x,y),w=l({x:b.y,y:-b.x});p.push(w)}for(var S=p.map(function(D,_){var L=n(c[_],a(D,t)),M=n(c[(_+1)%h],a(D,t));return{p1:L,p2:M}}),N=[],E=0;E<h;E++){var T=S[(E-1+h)%h],R=S[E],A=f(T.p1,T.p2,R.p1,R.p2);N.push(A)}return N}function CQ(e,t,n,r,a,i){var l=_Q(e,t,n,r,a),o=EQ(l,i),f=Dr();return o.forEach(function(c){return VO(f,c.x,c.y)}),f}var GO=function(t,n,r,a,i,l,o){var f=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=f==="auto"?Sl(i,l):f,h=i/2,p=l/2;c=Math.min(c,h,p);var m=c!==h,y=c!==p,x;if(m){var b=r-h+c-o,w=a-p-o,S=r+h-c+o,N=w;if(x=fl(t,n,r,a,b,w,S,N,!1),x.length>0)return x}if(y){var E=r+h+o,T=a-p+c-o,R=E,A=a+p-c+o;if(x=fl(t,n,r,a,E,T,R,A,!1),x.length>0)return x}if(m){var D=r-h+c-o,_=a+p+o,L=r+h-c+o,M=_;if(x=fl(t,n,r,a,D,_,L,M,!1),x.length>0)return x}if(y){var z=r-h-o,B=a-p+c-o,H=z,G=a+p-c+o;if(x=fl(t,n,r,a,z,B,H,G,!1),x.length>0)return x}var U;{var I=r-h+c,V=a-p+c;if(U=Kf(t,n,r,a,I,V,c+o),U.length>0&&U[0]<=I&&U[1]<=V)return[U[0],U[1]]}{var K=r+h-c,Q=a-p+c;if(U=Kf(t,n,r,a,K,Q,c+o),U.length>0&&U[0]>=K&&U[1]<=Q)return[U[0],U[1]]}{var F=r+h-c,q=a+p-c;if(U=Kf(t,n,r,a,F,q,c+o),U.length>0&&U[0]>=F&&U[1]>=q)return[U[0],U[1]]}{var X=r-h+c,P=a+p-c;if(U=Kf(t,n,r,a,X,P,c+o),U.length>0&&U[0]<=X&&U[1]>=P)return[U[0],U[1]]}return[]},NQ=function(t,n,r,a,i,l,o){var f=o,c=Math.min(r,i),h=Math.max(r,i),p=Math.min(a,l),m=Math.max(a,l);return c-f<=t&&t<=h+f&&p-f<=n&&n<=m+f},kQ=function(t,n,r,a,i,l,o,f,c){var h={x1:Math.min(r,o,i)-c,x2:Math.max(r,o,i)+c,y1:Math.min(a,f,l)-c,y2:Math.max(a,f,l)+c};return!(t<h.x1||t>h.x2||n<h.y1||n>h.y2)},TQ=function(t,n,r,a){r-=a;var i=n*n-4*t*r;if(i<0)return[];var l=Math.sqrt(i),o=2*t,f=(-n+l)/o,c=(-n-l)/o;return[f,c]},jQ=function(t,n,r,a,i){var l=1e-5;t===0&&(t=l),n/=t,r/=t,a/=t;var o,f,c,h,p,m,y,x;if(f=(3*r-n*n)/9,c=-(27*a)+n*(9*r-2*(n*n)),c/=54,o=f*f*f+c*c,i[1]=0,y=n/3,o>0){p=c+Math.sqrt(o),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),m=c-Math.sqrt(o),m=m<0?-Math.pow(-m,1/3):Math.pow(m,1/3),i[0]=-y+p+m,y+=(p+m)/2,i[4]=i[2]=-y,y=Math.sqrt(3)*(-m+p)/2,i[3]=y,i[5]=-y;return}if(i[5]=i[3]=0,o===0){x=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-y+2*x,i[4]=i[2]=-(x+y);return}f=-f,h=f*f*f,h=Math.acos(c/Math.sqrt(h)),x=2*Math.sqrt(f),i[0]=-y+x*Math.cos(h/3),i[2]=-y+x*Math.cos((h+2*Math.PI)/3),i[4]=-y+x*Math.cos((h+4*Math.PI)/3)},AQ=function(t,n,r,a,i,l,o,f){var c=1*r*r-4*r*i+2*r*o+4*i*i-4*i*o+o*o+a*a-4*a*l+2*a*f+4*l*l-4*l*f+f*f,h=9*r*i-3*r*r-3*r*o-6*i*i+3*i*o+9*a*l-3*a*a-3*a*f-6*l*l+3*l*f,p=3*r*r-6*r*i+r*o-r*t+2*i*i+2*i*t-o*t+3*a*a-6*a*l+a*f-a*n+2*l*l+2*l*n-f*n,m=1*r*i-r*r+r*t-i*t+a*l-a*a+a*n-l*n,y=[];jQ(c,h,p,m,y);for(var x=1e-7,b=[],w=0;w<6;w+=2)Math.abs(y[w+1])<x&&y[w]>=0&&y[w]<=1&&b.push(y[w]);b.push(1),b.push(0);for(var S=-1,N,E,T,R=0;R<b.length;R++)N=Math.pow(1-b[R],2)*r+2*(1-b[R])*b[R]*i+b[R]*b[R]*o,E=Math.pow(1-b[R],2)*a+2*(1-b[R])*b[R]*l+b[R]*b[R]*f,T=Math.pow(N-t,2)+Math.pow(E-n,2),S>=0?T<S&&(S=T):S=T;return S},RQ=function(t,n,r,a,i,l){var o=[t-r,n-a],f=[i-r,l-a],c=f[0]*f[0]+f[1]*f[1],h=o[0]*o[0]+o[1]*o[1],p=o[0]*f[0]+o[1]*f[1],m=p*p/c;return p<0?h:m>c?(t-i)*(t-i)+(n-l)*(n-l):h-m},$r=function(t,n,r){for(var a,i,l,o,f,c=0,h=0;h<r.length/2;h++)if(a=r[h*2],i=r[h*2+1],h+1<r.length/2?(l=r[(h+1)*2],o=r[(h+1)*2+1]):(l=r[(h+1-r.length/2)*2],o=r[(h+1-r.length/2)*2+1]),!(a==t&&l==t))if(a>=t&&t>=l||a<=t&&t<=l)f=(t-a)/(l-a)*(o-i)+i,f>n&&c++;else continue;return c%2!==0},cs=function(t,n,r,a,i,l,o,f,c){var h=new Array(r.length),p;f[0]!=null?(p=Math.atan(f[1]/f[0]),f[0]<0?p=p+Math.PI/2:p=-p-Math.PI/2):p=f;for(var m=Math.cos(-p),y=Math.sin(-p),x=0;x<h.length/2;x++)h[x*2]=l/2*(r[x*2]*m-r[x*2+1]*y),h[x*2+1]=o/2*(r[x*2+1]*m+r[x*2]*y),h[x*2]+=a,h[x*2+1]+=i;var b;if(c>0){var w=_p(h,-c);b=Mp(w)}else b=h;return $r(t,n,b)},DQ=function(t,n,r,a,i,l,o,f){for(var c=new Array(r.length*2),h=0;h<f.length;h++){var p=f[h];c[h*4+0]=p.startX,c[h*4+1]=p.startY,c[h*4+2]=p.stopX,c[h*4+3]=p.stopY;var m=Math.pow(p.cx-t,2)+Math.pow(p.cy-n,2);if(m<=Math.pow(p.radius,2))return!0}return $r(t,n,c)},Mp=function(t){for(var n=new Array(t.length/2),r,a,i,l,o,f,c,h,p=0;p<t.length/4;p++){r=t[p*4],a=t[p*4+1],i=t[p*4+2],l=t[p*4+3],p<t.length/4-1?(o=t[(p+1)*4],f=t[(p+1)*4+1],c=t[(p+1)*4+2],h=t[(p+1)*4+3]):(o=t[0],f=t[1],c=t[2],h=t[3]);var m=fl(r,a,i,l,o,f,c,h,!0);n[p*2]=m[0],n[p*2+1]=m[1]}return n},_p=function(t,n){for(var r=new Array(t.length*2),a,i,l,o,f=0;f<t.length/2;f++){a=t[f*2],i=t[f*2+1],f<t.length/2-1?(l=t[(f+1)*2],o=t[(f+1)*2+1]):(l=t[0],o=t[1]);var c=o-i,h=-(l-a),p=Math.sqrt(c*c+h*h),m=c/p,y=h/p;r[f*4]=a+m*n,r[f*4+1]=i+y*n,r[f*4+2]=l+m*n,r[f*4+3]=o+y*n}return r},MQ=function(t,n,r,a,i,l){var o=r-t,f=a-n;o/=i,f/=l;var c=Math.sqrt(o*o+f*f),h=c-1;if(h<0)return[];var p=h/c;return[(r-t)*p+t,(a-n)*p+n]},oo=function(t,n,r,a,i,l,o){return t-=i,n-=l,t/=r/2+o,n/=a/2+o,t*t+n*n<=1},Kf=function(t,n,r,a,i,l,o){var f=[r-t,a-n],c=[t-i,n-l],h=f[0]*f[0]+f[1]*f[1],p=2*(c[0]*f[0]+c[1]*f[1]),m=c[0]*c[0]+c[1]*c[1]-o*o,y=p*p-4*h*m;if(y<0)return[];var x=(-p+Math.sqrt(y))/(2*h),b=(-p-Math.sqrt(y))/(2*h),w=Math.min(x,b),S=Math.max(x,b),N=[];if(w>=0&&w<=1&&N.push(w),S>=0&&S<=1&&N.push(S),N.length===0)return[];var E=N[0]*f[0]+t,T=N[0]*f[1]+n;if(N.length>1){if(N[0]==N[1])return[E,T];var R=N[1]*f[0]+t,A=N[1]*f[1]+n;return[E,T,R,A]}else return[E,T]},Yx=function(t,n,r){return n<=t&&t<=r||r<=t&&t<=n?t:t<=n&&n<=r||r<=n&&n<=t?n:r},fl=function(t,n,r,a,i,l,o,f,c){var h=t-i,p=r-t,m=o-i,y=n-l,x=a-n,b=f-l,w=m*y-b*h,S=p*y-x*h,N=b*p-m*x;if(N!==0){var E=w/N,T=S/N,R=.001,A=0-R,D=1+R;return A<=E&&E<=D&&A<=T&&T<=D?[t+E*p,n+E*x]:c?[t+E*p,n+E*x]:[]}else return w===0||S===0?Yx(t,r,o)===o?[o,f]:Yx(t,r,i)===i?[i,l]:Yx(i,o,r)===r?[r,a]:[]:[]},_Q=function(t,n,r,a,i){var l=[],o=a/2,f=i/2,c=n,h=r;l.push({x:c+o*t[0],y:h+f*t[1]});for(var p=1;p<t.length/2;p++)l.push({x:c+o*t[p*2],y:h+f*t[p*2+1]});return l},vd=function(t,n,r,a,i,l,o,f){var c=[],h,p=new Array(r.length),m=!0;l==null&&(m=!1);var y;if(m){for(var x=0;x<p.length/2;x++)p[x*2]=r[x*2]*l+a,p[x*2+1]=r[x*2+1]*o+i;if(f>0){var b=_p(p,-f);y=Mp(b)}else y=p}else y=r;for(var w,S,N,E,T=0;T<y.length/2;T++)w=y[T*2],S=y[T*2+1],T<y.length/2-1?(N=y[(T+1)*2],E=y[(T+1)*2+1]):(N=y[0],E=y[1]),h=fl(t,n,a,i,w,S,N,E),h.length!==0&&c.push(h[0],h[1]);return c},OQ=function(t,n,r,a,i,l,o,f,c){var h=[],p,m=new Array(r.length*2);c.forEach(function(N,E){E===0?(m[m.length-2]=N.startX,m[m.length-1]=N.startY):(m[E*4-2]=N.startX,m[E*4-1]=N.startY),m[E*4]=N.stopX,m[E*4+1]=N.stopY,p=Kf(t,n,a,i,N.cx,N.cy,N.radius),p.length!==0&&h.push(p[0],p[1])});for(var y=0;y<m.length/4;y++)p=fl(t,n,a,i,m[y*4],m[y*4+1],m[y*4+2],m[y*4+3],!1),p.length!==0&&h.push(p[0],p[1]);if(h.length>2){for(var x=[h[0],h[1]],b=Math.pow(x[0]-t,2)+Math.pow(x[1]-n,2),w=1;w<h.length/2;w++){var S=Math.pow(h[w*2]-t,2)+Math.pow(h[w*2+1]-n,2);S<=b&&(x[0]=h[w*2],x[1]=h[w*2+1],b=S)}return x}return h},Rv=function(t,n,r){var a=[t[0]-n[0],t[1]-n[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=(i-r)/i;return l<0&&(l=1e-5),[n[0]+l*a[0],n[1]+l*a[1]]},Tr=function(t,n){var r=r1(t,n);return r=$O(r),r},$O=function(t){for(var n,r,a=t.length/2,i=1/0,l=1/0,o=-1/0,f=-1/0,c=0;c<a;c++)n=t[2*c],r=t[2*c+1],i=Math.min(i,n),o=Math.max(o,n),l=Math.min(l,r),f=Math.max(f,r);for(var h=2/(o-i),p=2/(f-l),m=0;m<a;m++)n=t[2*m]=t[2*m]*h,r=t[2*m+1]=t[2*m+1]*p,i=Math.min(i,n),o=Math.max(o,n),l=Math.min(l,r),f=Math.max(f,r);if(l<-1)for(var y=0;y<a;y++)r=t[2*y+1]=t[2*y+1]+(-1-l);return t},r1=function(t,n){var r=1/t*2*Math.PI,a=t%2===0?Math.PI/2+r/2:Math.PI/2;a+=n;for(var i=new Array(t*2),l,o=0;o<t;o++)l=o*r+a,i[2*o]=Math.cos(l),i[2*o+1]=Math.sin(-l);return i},Sl=function(t,n){return Math.min(t/4,n/4,8)},KO=function(t,n){return Math.min(t/10,n/10,8)},$w=function(){return 8},LQ=function(t,n,r){return[t-2*n+r,2*(n-t),t]},a1=function(t,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}};function Xx(e,t){function n(p){for(var m=[],y=0;y<p.length;y++){var x=p[y],b=p[(y+1)%p.length],w={x:b.x-x.x,y:b.y-x.y},S={x:-w.y,y:w.x},N=Math.sqrt(S.x*S.x+S.y*S.y);m.push({x:S.x/N,y:S.y/N})}return m}function r(p,m){var y=1/0,x=-1/0,b=Xr(p),w;try{for(b.s();!(w=b.n()).done;){var S=w.value,N=S.x*m.x+S.y*m.y;y=Math.min(y,N),x=Math.max(x,N)}}catch(E){b.e(E)}finally{b.f()}return{min:y,max:x}}function a(p,m){return!(p.max<m.min||m.max<p.min)}var i=[].concat(jp(n(e)),jp(n(t))),l=Xr(i),o;try{for(l.s();!(o=l.n()).done;){var f=o.value,c=r(e,f),h=r(t,f);if(!a(c,h))return!1}}catch(p){l.e(p)}finally{l.f()}return!0}var PQ=dr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(t){return 1}}),BQ={pageRank:function(t){for(var n=PQ(t),r=n.dampingFactor,a=n.precision,i=n.iterations,l=n.weight,o=this._private.cy,f=this.byGroup(),c=f.nodes,h=f.edges,p=c.length,m=p*p,y=h.length,x=new Array(m),b=new Array(p),w=(1-r)/p,S=0;S<p;S++){for(var N=0;N<p;N++){var E=S*p+N;x[E]=0}b[S]=0}for(var T=0;T<y;T++){var R=h[T],A=R.data("source"),D=R.data("target");if(A!==D){var _=c.indexOfId(A),L=c.indexOfId(D),M=l(R),z=L*p+_;x[z]+=M,b[_]+=M}}for(var B=1/p+w,H=0;H<p;H++)if(b[H]===0)for(var G=0;G<p;G++){var U=G*p+H;x[U]=B}else for(var I=0;I<p;I++){var V=I*p+H;x[V]=x[V]/b[H]+w}for(var K=new Array(p),Q=new Array(p),F,q=0;q<p;q++)K[q]=1;for(var X=0;X<i;X++){for(var P=0;P<p;P++)Q[P]=0;for(var Z=0;Z<p;Z++)for(var ae=0;ae<p;ae++){var ie=Z*p+ae;Q[Z]+=x[ie]*K[ae]}gQ(Q),F=K,K=Q,Q=F;for(var le=0,ye=0;ye<p;ye++){var ne=F[ye]-K[ye];le+=ne*ne}if(le<a)break}var W={rank:function(se){return se=o.collection(se)[0],K[c.indexOf(se)]}};return W}},jT=dr({root:null,weight:function(t){return 1},directed:!1,alpha:0}),Gu={degreeCentralityNormalized:function(t){t=jT(t);var n=this.cy(),r=this.nodes(),a=r.length;if(t.directed){for(var h={},p={},m=0,y=0,x=0;x<a;x++){var b=r[x],w=b.id();t.root=b;var S=this.degreeCentrality(t);m<S.indegree&&(m=S.indegree),y<S.outdegree&&(y=S.outdegree),h[w]=S.indegree,p[w]=S.outdegree}return{indegree:function(E){return m==0?0:(tt(E)&&(E=n.filter(E)),h[E.id()]/m)},outdegree:function(E){return y===0?0:(tt(E)&&(E=n.filter(E)),p[E.id()]/y)}}}else{for(var i={},l=0,o=0;o<a;o++){var f=r[o];t.root=f;var c=this.degreeCentrality(t);l<c.degree&&(l=c.degree),i[f.id()]=c.degree}return{degree:function(E){return l===0?0:(tt(E)&&(E=n.filter(E)),i[E.id()]/l)}}}},degreeCentrality:function(t){t=jT(t);var n=this.cy(),r=this,a=t,i=a.root,l=a.weight,o=a.directed,f=a.alpha;if(i=n.collection(i)[0],o){for(var y=i.connectedEdges(),x=y.filter(function(A){return A.target().same(i)&&r.has(A)}),b=y.filter(function(A){return A.source().same(i)&&r.has(A)}),w=x.length,S=b.length,N=0,E=0,T=0;T<x.length;T++)N+=l(x[T]);for(var R=0;R<b.length;R++)E+=l(b[R]);return{indegree:Math.pow(w,1-f)*Math.pow(N,f),outdegree:Math.pow(S,1-f)*Math.pow(E,f)}}else{for(var c=i.connectedEdges().intersection(r),h=c.length,p=0,m=0;m<c.length;m++)p+=l(c[m]);return{degree:Math.pow(h,1-f)*Math.pow(p,f)}}}};Gu.dc=Gu.degreeCentrality;Gu.dcn=Gu.degreeCentralityNormalised=Gu.degreeCentralityNormalized;var AT=dr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),$u={closenessCentralityNormalized:function(t){for(var n=AT(t),r=n.harmonic,a=n.weight,i=n.directed,l=this.cy(),o={},f=0,c=this.nodes(),h=this.floydWarshall({weight:a,directed:i}),p=0;p<c.length;p++){for(var m=0,y=c[p],x=0;x<c.length;x++)if(p!==x){var b=h.distance(y,c[x]);r?m+=1/b:m+=b}r||(m=1/m),f<m&&(f=m),o[y.id()]=m}return{closeness:function(S){return f==0?0:(tt(S)?S=l.filter(S)[0].id():S=S.id(),o[S]/f)}}},closenessCentrality:function(t){var n=AT(t),r=n.root,a=n.weight,i=n.directed,l=n.harmonic;r=this.filter(r)[0];for(var o=this.dijkstra({root:r,weight:a,directed:i}),f=0,c=this.nodes(),h=0;h<c.length;h++){var p=c[h];if(!p.same(r)){var m=o.distanceTo(p);l?f+=1/m:f+=m}}return l?f:1/f}};$u.cc=$u.closenessCentrality;$u.ccn=$u.closenessCentralityNormalised=$u.closenessCentralityNormalized;var zQ=dr({weight:null,directed:!1}),i1={betweennessCentrality:function(t){for(var n=zQ(t),r=n.directed,a=n.weight,i=a!=null,l=this.cy(),o=this.nodes(),f={},c={},h=0,p={set:function(E,T){c[E]=T,T>h&&(h=T)},get:function(E){return c[E]}},m=0;m<o.length;m++){var y=o[m],x=y.id();r?f[x]=y.outgoers().nodes():f[x]=y.openNeighborhood().nodes(),p.set(x,0)}for(var b=function(){for(var E=o[w].id(),T=[],R={},A={},D={},_=new Kd(function(Z,ae){return D[Z]-D[ae]}),L=0;L<o.length;L++){var M=o[L].id();R[M]=[],A[M]=0,D[M]=1/0}for(A[E]=1,D[E]=0,_.push(E);!_.empty();){var z=_.pop();if(T.push(z),i)for(var B=0;B<f[z].length;B++){var H=f[z][B],G=l.getElementById(z),U=void 0;G.edgesTo(H).length>0?U=G.edgesTo(H)[0]:U=H.edgesTo(G)[0];var I=a(U);H=H.id(),D[H]>D[z]+I&&(D[H]=D[z]+I,_.nodes.indexOf(H)<0?_.push(H):_.updateItem(H),A[H]=0,R[H]=[]),D[H]==D[z]+I&&(A[H]=A[H]+A[z],R[H].push(z))}else for(var V=0;V<f[z].length;V++){var K=f[z][V].id();D[K]==1/0&&(_.push(K),D[K]=D[z]+1),D[K]==D[z]+1&&(A[K]=A[K]+A[z],R[K].push(z))}}for(var Q={},F=0;F<o.length;F++)Q[o[F].id()]=0;for(;T.length>0;){for(var q=T.pop(),X=0;X<R[q].length;X++){var P=R[q][X];Q[P]=Q[P]+A[P]/A[q]*(1+Q[q])}q!=o[w].id()&&p.set(q,p.get(q)+Q[q])}},w=0;w<o.length;w++)b();var S={betweenness:function(E){var T=l.collection(E).id();return p.get(T)},betweennessNormalized:function(E){if(h==0)return 0;var T=l.collection(E).id();return p.get(T)/h}};return S.betweennessNormalised=S.betweennessNormalized,S}};i1.bc=i1.betweennessCentrality;var IQ=dr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),FQ=function(t){return IQ(t)},UQ=function(t,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](t);return r},qQ=function(t,n,r){for(var a=0;a<n;a++)t[a*n+a]=r},YO=function(t,n){for(var r,a=0;a<n;a++){r=0;for(var i=0;i<n;i++)r+=t[i*n+a];for(var l=0;l<n;l++)t[l*n+a]=t[l*n+a]/r}},VQ=function(t,n,r){for(var a=new Array(r*r),i=0;i<r;i++){for(var l=0;l<r;l++)a[i*r+l]=0;for(var o=0;o<r;o++)for(var f=0;f<r;f++)a[i*r+f]+=t[i*r+o]*n[o*r+f]}return a},HQ=function(t,n,r){for(var a=t.slice(0),i=1;i<r;i++)t=VQ(t,a,n);return t},GQ=function(t,n,r){for(var a=new Array(n*n),i=0;i<n*n;i++)a[i]=Math.pow(t[i],r);return YO(a,n),a},$Q=function(t,n,r,a){for(var i=0;i<r;i++){var l=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a),o=Math.round(n[i]*Math.pow(10,a))/Math.pow(10,a);if(l!==o)return!1}return!0},KQ=function(t,n,r,a){for(var i=[],l=0;l<n;l++){for(var o=[],f=0;f<n;f++)Math.round(t[l*n+f]*1e3)/1e3>0&&o.push(r[f]);o.length!==0&&i.push(a.collection(o))}return i},YQ=function(t,n){for(var r=0;r<t.length;r++)if(!n[r]||t[r].id()!==n[r].id())return!1;return!0},XQ=function(t){for(var n=0;n<t.length;n++)for(var r=0;r<t.length;r++)n!=r&&YQ(t[n],t[r])&&t.splice(r,1);return t},RT=function(t){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=FQ(t),l={},o=0;o<n.length;o++)l[n[o].id()]=o;for(var f=n.length,c=f*f,h=new Array(c),p,m=0;m<c;m++)h[m]=0;for(var y=0;y<r.length;y++){var x=r[y],b=l[x.source().id()],w=l[x.target().id()],S=UQ(x,i.attributes);h[b*f+w]+=S,h[w*f+b]+=S}qQ(h,f,i.multFactor),YO(h,f);for(var N=!0,E=0;N&&E<i.maxIterations;)N=!1,p=HQ(h,f,i.expandFactor),h=GQ(p,f,i.inflateFactor),$Q(h,p,c,4)||(N=!0),E++;var T=KQ(h,f,n,a);return T=XQ(T),T},QQ={markovClustering:RT,mcl:RT},WQ=function(t){return t},XO=function(t,n){return Math.abs(n-t)},DT=function(t,n,r){return t+XO(n,r)},MT=function(t,n,r){return t+Math.pow(r-n,2)},ZQ=function(t){return Math.sqrt(t)},JQ=function(t,n,r){return Math.max(t,XO(n,r))},Of=function(t,n,r,a,i){for(var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:WQ,o=a,f,c,h=0;h<t;h++)f=n(h),c=r(h),o=i(o,f,c);return l(o)},uc={euclidean:function(t,n,r){return t>=2?Of(t,n,r,0,MT,ZQ):Of(t,n,r,0,DT)},squaredEuclidean:function(t,n,r){return Of(t,n,r,0,MT)},manhattan:function(t,n,r){return Of(t,n,r,0,DT)},max:function(t,n,r){return Of(t,n,r,-1/0,JQ)}};uc["squared-euclidean"]=uc.squaredEuclidean;uc.squaredeuclidean=uc.squaredEuclidean;function Sm(e,t,n,r,a,i){var l;return gn(e)?l=e:l=uc[e]||uc.euclidean,t===0&&gn(e)?l(a,i):l(t,n,r,a,i)}var eW=dr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Kw=function(t){return eW(t)},Op=function(t,n,r,a,i){var l=i!=="kMedoids",o=l?function(p){return r[p]}:function(p){return a[p](r)},f=function(m){return a[m](n)},c=r,h=n;return Sm(t,a.length,o,f,c,h)},Qx=function(t,n,r){for(var a=r.length,i=new Array(a),l=new Array(a),o=new Array(n),f=null,c=0;c<a;c++)i[c]=t.min(r[c]).value,l[c]=t.max(r[c]).value;for(var h=0;h<n;h++){f=[];for(var p=0;p<a;p++)f[p]=Math.random()*(l[p]-i[p])+i[p];o[h]=f}return o},QO=function(t,n,r,a,i){for(var l=1/0,o=0,f=0;f<n.length;f++){var c=Op(r,t,n[f],a,i);c<l&&(l=c,o=f)}return o},WO=function(t,n,r){for(var a=[],i=null,l=0;l<n.length;l++)i=n[l],r[i.id()]===t&&a.push(i);return a},tW=function(t,n,r){return Math.abs(n-t)<=r},nW=function(t,n,r){for(var a=0;a<t.length;a++)for(var i=0;i<t[a].length;i++){var l=Math.abs(t[a][i]-n[a][i]);if(l>r)return!1}return!0},rW=function(t,n,r){for(var a=0;a<r;a++)if(t===n[a])return!0;return!1},_T=function(t,n){var r=new Array(n);if(t.length<50)for(var a=0;a<n;a++){for(var i=t[Math.floor(Math.random()*t.length)];rW(i,r,a);)i=t[Math.floor(Math.random()*t.length)];r[a]=i}else for(var l=0;l<n;l++)r[l]=t[Math.floor(Math.random()*t.length)];return r},OT=function(t,n,r){for(var a=0,i=0;i<n.length;i++)a+=Op("manhattan",n[i],t,r,"kMedoids");return a},aW=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Kw(t),l=new Array(i.k),o={},f;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,f=Qx(r,i.k,i.attributes)):Gn(i.testCentroids)==="object"?f=i.testCentroids:f=Qx(r,i.k,i.attributes):f=Qx(r,i.k,i.attributes);for(var c=!0,h=0;c&&h<i.maxIterations;){for(var p=0;p<r.length;p++)a=r[p],o[a.id()]=QO(a,f,i.distance,i.attributes,"kMeans");c=!1;for(var m=0;m<i.k;m++){var y=WO(m,r,o);if(y.length!==0){for(var x=i.attributes.length,b=f[m],w=new Array(x),S=new Array(x),N=0;N<x;N++){S[N]=0;for(var E=0;E<y.length;E++)a=y[E],S[N]+=i.attributes[N](a);w[N]=S[N]/y.length,tW(w[N],b[N],i.sensitivityThreshold)||(c=!0)}f[m]=w,l[m]=n.collection(y)}}h++}return l},iW=function(t){var n=this.cy(),r=this.nodes(),a=null,i=Kw(t),l=new Array(i.k),o,f={},c,h=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(Gn(i.testCentroids)==="object"?o=i.testCentroids:o=_T(r,i.k)):o=_T(r,i.k);for(var p=!0,m=0;p&&m<i.maxIterations;){for(var y=0;y<r.length;y++)a=r[y],f[a.id()]=QO(a,o,i.distance,i.attributes,"kMedoids");p=!1;for(var x=0;x<o.length;x++){var b=WO(x,r,f);if(b.length!==0){h[x]=OT(o[x],b,i.attributes);for(var w=0;w<b.length;w++)c=OT(b[w],b,i.attributes),c<h[x]&&(h[x]=c,o[x]=b[w],p=!0);l[x]=n.collection(b)}}m++}return l},sW=function(t,n,r,a,i){for(var l,o,f=0;f<n.length;f++)for(var c=0;c<t.length;c++)a[f][c]=Math.pow(r[f][c],i.m);for(var h=0;h<t.length;h++)for(var p=0;p<i.attributes.length;p++){l=0,o=0;for(var m=0;m<n.length;m++)l+=a[m][h]*i.attributes[p](n[m]),o+=a[m][h];t[h][p]=l/o}},lW=function(t,n,r,a,i){for(var l=0;l<t.length;l++)n[l]=t[l].slice();for(var o,f,c,h=2/(i.m-1),p=0;p<r.length;p++)for(var m=0;m<a.length;m++){o=0;for(var y=0;y<r.length;y++)f=Op(i.distance,a[m],r[p],i.attributes,"cmeans"),c=Op(i.distance,a[m],r[y],i.attributes,"cmeans"),o+=Math.pow(f/c,h);t[m][p]=1/o}},oW=function(t,n,r,a){for(var i=new Array(r.k),l=0;l<i.length;l++)i[l]=[];for(var o,f,c=0;c<n.length;c++){o=-1/0,f=-1;for(var h=0;h<n[0].length;h++)n[c][h]>o&&(o=n[c][h],f=h);i[f].push(t[c])}for(var p=0;p<i.length;p++)i[p]=a.collection(i[p]);return i},LT=function(t){var n=this.cy(),r=this.nodes(),a=Kw(t),i,l,o,f,c;f=new Array(r.length);for(var h=0;h<r.length;h++)f[h]=new Array(a.k);o=new Array(r.length);for(var p=0;p<r.length;p++)o[p]=new Array(a.k);for(var m=0;m<r.length;m++){for(var y=0,x=0;x<a.k;x++)o[m][x]=Math.random(),y+=o[m][x];for(var b=0;b<a.k;b++)o[m][b]=o[m][b]/y}l=new Array(a.k);for(var w=0;w<a.k;w++)l[w]=new Array(a.attributes.length);c=new Array(r.length);for(var S=0;S<r.length;S++)c[S]=new Array(a.k);for(var N=!0,E=0;N&&E<a.maxIterations;)N=!1,sW(l,r,o,c,a),lW(o,f,l,r,a),nW(o,f,a.sensitivityThreshold)||(N=!0),E++;return i=oW(r,o,a,n),{clusters:i,degreeOfMembership:o}},uW={kMeans:aW,kMedoids:iW,fuzzyCMeans:LT,fcm:LT},cW=dr({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),fW={single:"min",complete:"max"},dW=function(t){var n=cW(t),r=fW[n.linkage];return r!=null&&(n.linkage=r),n},PT=function(t,n,r,a,i){for(var l=0,o=1/0,f,c=i.attributes,h=function(L,M){return Sm(i.distance,c.length,function(z){return c[z](L)},function(z){return c[z](M)},L,M)},p=0;p<t.length;p++){var m=t[p].key,y=r[m][a[m]];y<o&&(l=m,o=y)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&t.length===1)return!1;var x=n[l],b=n[a[l]],w;i.mode==="dendrogram"?w={left:x,right:b,key:x.key}:w={value:x.value.concat(b.value),key:x.key},t[x.index]=w,t.splice(b.index,1),n[x.key]=w;for(var S=0;S<t.length;S++){var N=t[S];x.key===N.key?f=1/0:i.linkage==="min"?(f=r[x.key][N.key],r[x.key][N.key]>r[b.key][N.key]&&(f=r[b.key][N.key])):i.linkage==="max"?(f=r[x.key][N.key],r[x.key][N.key]<r[b.key][N.key]&&(f=r[b.key][N.key])):i.linkage==="mean"?f=(r[x.key][N.key]*x.size+r[b.key][N.key]*b.size)/(x.size+b.size):i.mode==="dendrogram"?f=h(N.value,x.value):f=h(N.value[0],x.value[0]),r[x.key][N.key]=r[N.key][x.key]=f}for(var E=0;E<t.length;E++){var T=t[E].key;if(a[T]===x.key||a[T]===b.key){for(var R=T,A=0;A<t.length;A++){var D=t[A].key;r[T][D]<r[T][R]&&(R=D)}a[T]=R}t[E].index=E}return x.key=b.key=x.index=b.index=null,!0},Pu=function(t,n,r){t&&(t.value?n.push(t.value):(t.left&&Pu(t.left,n),t.right&&Pu(t.right,n)))},s1=function(t,n){if(!t)return"";if(t.left&&t.right){var r=s1(t.left,n),a=s1(t.right,n),i=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(t.value)return t.value.id()},l1=function(t,n,r){if(!t)return[];var a=[],i=[],l=[];return n===0?(t.left&&Pu(t.left,a),t.right&&Pu(t.right,i),l=a.concat(i),[r.collection(l)]):n===1?t.value?[r.collection(t.value)]:(t.left&&Pu(t.left,a),t.right&&Pu(t.right,i),[r.collection(a),r.collection(i)]):t.value?[r.collection(t.value)]:(t.left&&(a=l1(t.left,n-1,r)),t.right&&(i=l1(t.right,n-1,r)),a.concat(i))},BT=function(t){for(var n=this.cy(),r=this.nodes(),a=dW(t),i=a.attributes,l=function(E,T){return Sm(a.distance,i.length,function(R){return i[R](E)},function(R){return i[R](T)},E,T)},o=[],f=[],c=[],h=[],p=0;p<r.length;p++){var m={value:a.mode==="dendrogram"?r[p]:[r[p]],key:p,index:p};o[p]=m,h[p]=m,f[p]=[],c[p]=0}for(var y=0;y<o.length;y++)for(var x=0;x<=y;x++){var b=void 0;a.mode==="dendrogram"?b=y===x?1/0:l(o[y].value,o[x].value):b=y===x?1/0:l(o[y].value[0],o[x].value[0]),f[y][x]=b,f[x][y]=b,b<f[y][c[y]]&&(c[y]=x)}for(var w=PT(o,h,f,c,a);w;)w=PT(o,h,f,c,a);var S;return a.mode==="dendrogram"?(S=l1(o[0],a.dendrogramDepth,n),a.addDendrogram&&s1(o[0],n)):(S=new Array(o.length),o.forEach(function(N,E){N.key=N.index=null,S[E]=n.collection(N.value)})),S},hW={hierarchicalClustering:BT,hca:BT},vW=dr({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),pW=function(t){var n=t.damping,r=t.preference;.5<=n&&n<1||dn("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||Re(r)||dn("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),vW(t)},mW=function(t,n,r,a){var i=function(o,f){return a[f](o)};return-Sm(t,a.length,function(l){return i(n,l)},function(l){return i(r,l)},n,r)},gW=function(t,n){var r=null;return n==="median"?r=pQ(t):n==="mean"?r=vQ(t):n==="min"?r=dQ(t):n==="max"?r=hQ(t):r=n,r},yW=function(t,n,r){for(var a=[],i=0;i<t;i++)n[i*t+i]+r[i*t+i]>0&&a.push(i);return a},zT=function(t,n,r){for(var a=[],i=0;i<t;i++){for(var l=-1,o=-1/0,f=0;f<r.length;f++){var c=r[f];n[i*t+c]>o&&(l=c,o=n[i*t+c])}l>0&&a.push(l)}for(var h=0;h<r.length;h++)a[r[h]]=r[h];return a},xW=function(t,n,r){for(var a=zT(t,n,r),i=0;i<r.length;i++){for(var l=[],o=0;o<a.length;o++)a[o]===r[i]&&l.push(o);for(var f=-1,c=-1/0,h=0;h<l.length;h++){for(var p=0,m=0;m<l.length;m++)p+=n[l[m]*t+l[h]];p>c&&(f=h,c=p)}r[i]=l[f]}return a=zT(t,n,r),a},IT=function(t){for(var n=this.cy(),r=this.nodes(),a=pW(t),i={},l=0;l<r.length;l++)i[r[l].id()]=l;var o,f,c,h,p,m;o=r.length,f=o*o,c=new Array(f);for(var y=0;y<f;y++)c[y]=-1/0;for(var x=0;x<o;x++)for(var b=0;b<o;b++)x!==b&&(c[x*o+b]=mW(a.distance,r[x],r[b],a.attributes));h=gW(c,a.preference);for(var w=0;w<o;w++)c[w*o+w]=h;p=new Array(f);for(var S=0;S<f;S++)p[S]=0;m=new Array(f);for(var N=0;N<f;N++)m[N]=0;for(var E=new Array(o),T=new Array(o),R=new Array(o),A=0;A<o;A++)E[A]=0,T[A]=0,R[A]=0;for(var D=new Array(o*a.minIterations),_=0;_<D.length;_++)D[_]=0;var L;for(L=0;L<a.maxIterations;L++){for(var M=0;M<o;M++){for(var z=-1/0,B=-1/0,H=-1,G=0,U=0;U<o;U++)E[U]=p[M*o+U],G=m[M*o+U]+c[M*o+U],G>=z?(B=z,z=G,H=U):G>B&&(B=G);for(var I=0;I<o;I++)p[M*o+I]=(1-a.damping)*(c[M*o+I]-z)+a.damping*E[I];p[M*o+H]=(1-a.damping)*(c[M*o+H]-B)+a.damping*E[H]}for(var V=0;V<o;V++){for(var K=0,Q=0;Q<o;Q++)E[Q]=m[Q*o+V],T[Q]=Math.max(0,p[Q*o+V]),K+=T[Q];K-=T[V],T[V]=p[V*o+V],K+=T[V];for(var F=0;F<o;F++)m[F*o+V]=(1-a.damping)*Math.min(0,K-T[F])+a.damping*E[F];m[V*o+V]=(1-a.damping)*(K-T[V])+a.damping*E[V]}for(var q=0,X=0;X<o;X++){var P=m[X*o+X]+p[X*o+X]>0?1:0;D[L%a.minIterations*o+X]=P,q+=P}if(q>0&&(L>=a.minIterations-1||L==a.maxIterations-1)){for(var Z=0,ae=0;ae<o;ae++){R[ae]=0;for(var ie=0;ie<a.minIterations;ie++)R[ae]+=D[ie*o+ae];(R[ae]===0||R[ae]===a.minIterations)&&Z++}if(Z===o)break}}for(var le=yW(o,p,m),ye=xW(o,c,le),ne={},W=0;W<le.length;W++)ne[le[W]]=[];for(var J=0;J<r.length;J++){var se=i[r[J].id()],ge=ye[se];ge!=null&&ne[ge].push(r[J])}for(var Te=new Array(le.length),Be=0;Be<le.length;Be++)Te[Be]=n.collection(ne[le[Be]]);return Te},bW={affinityPropagation:IT,ap:IT},wW=dr({root:void 0,directed:!1}),SW={hierholzer:function(t){if(!Mt(t)){var n=arguments;t={root:n[0],directed:n[1]}}var r=wW(t),a=r.root,i=r.directed,l=this,o=!1,f,c,h;a&&(h=tt(a)?this.filter(a)[0].id():a[0].id());var p={},m={};i?l.forEach(function(N){var E=N.id();if(N.isNode()){var T=N.indegree(!0),R=N.outdegree(!0),A=T-R,D=R-T;A==1?f?o=!0:f=E:D==1?c?o=!0:c=E:(D>1||A>1)&&(o=!0),p[E]=[],N.outgoers().forEach(function(_){_.isEdge()&&p[E].push(_.id())})}else m[E]=[void 0,N.target().id()]}):l.forEach(function(N){var E=N.id();if(N.isNode()){var T=N.degree(!0);T%2&&(f?c?o=!0:c=E:f=E),p[E]=[],N.connectedEdges().forEach(function(R){return p[E].push(R.id())})}else m[E]=[N.source().id(),N.target().id()]});var y={found:!1,trail:void 0};if(o)return y;if(c&&f)if(i){if(h&&c!=h)return y;h=c}else{if(h&&c!=h&&f!=h)return y;h||(h=c)}else h||(h=l[0].id());var x=function(E){for(var T=E,R=[E],A,D,_;p[T].length;)A=p[T].shift(),D=m[A][0],_=m[A][1],T!=_?(p[_]=p[_].filter(function(L){return L!=A}),T=_):!i&&T!=D&&(p[D]=p[D].filter(function(L){return L!=A}),T=D),R.unshift(A),R.unshift(T);return R},b=[],w=[];for(w=x(h);w.length!=1;)p[w[0]].length==0?(b.unshift(l.getElementById(w.shift())),b.unshift(l.getElementById(w.shift()))):w=x(w.shift()).concat(w);b.unshift(l.getElementById(w.shift()));for(var S in p)if(p[S].length)return y;return y.found=!0,y.trail=this.spawn(b,!0),y}},Dv=function(){var t=this,n={},r=0,a=0,i=[],l=[],o={},f=function(m,y){for(var x=l.length-1,b=[],w=t.spawn();l[x].x!=m||l[x].y!=y;)b.push(l.pop().edge),x--;b.push(l.pop().edge),b.forEach(function(S){var N=S.connectedNodes().intersection(t);w.merge(S),N.forEach(function(E){var T=E.id(),R=E.connectedEdges().intersection(t);w.merge(E),n[T].cutVertex?w.merge(R.filter(function(A){return A.isLoop()})):w.merge(R)})}),i.push(w)},c=function(m,y,x){m===x&&(a+=1),n[y]={id:r,low:r++,cutVertex:!1};var b=t.getElementById(y).connectedEdges().intersection(t);if(b.size()===0)i.push(t.spawn(t.getElementById(y)));else{var w,S,N,E;b.forEach(function(T){w=T.source().id(),S=T.target().id(),N=w===y?S:w,N!==x&&(E=T.id(),o[E]||(o[E]=!0,l.push({x:y,y:N,edge:T})),N in n?n[y].low=Math.min(n[y].low,n[N].id):(c(m,N,y),n[y].low=Math.min(n[y].low,n[N].low),n[y].id<=n[N].low&&(n[y].cutVertex=!0,f(y,N))))})}};t.forEach(function(p){if(p.isNode()){var m=p.id();m in n||(a=0,c(m,m),n[m].cutVertex=a>1)}});var h=Object.keys(n).filter(function(p){return n[p].cutVertex}).map(function(p){return t.getElementById(p)});return{cut:t.spawn(h),components:i}},EW={hopcroftTarjanBiconnected:Dv,htbc:Dv,htb:Dv,hopcroftTarjanBiconnectedComponents:Dv},Mv=function(){var t=this,n={},r=0,a=[],i=[],l=t.spawn(t),o=function(c){i.push(c),n[c]={index:r,low:r++,explored:!1};var h=t.getElementById(c).connectedEdges().intersection(t);if(h.forEach(function(b){var w=b.target().id();w!==c&&(w in n||o(w),n[w].explored||(n[c].low=Math.min(n[c].low,n[w].low)))}),n[c].index===n[c].low){for(var p=t.spawn();;){var m=i.pop();if(p.merge(t.getElementById(m)),n[m].low=n[c].index,n[m].explored=!0,m===c)break}var y=p.edgesWith(p),x=p.merge(y);a.push(x),l=l.difference(x)}};return t.forEach(function(f){if(f.isNode()){var c=f.id();c in n||o(c)}}),{cut:l,components:a}},CW={tarjanStronglyConnected:Mv,tsc:Mv,tscc:Mv,tarjanStronglyConnectedComponents:Mv},ZO={};[dd,eQ,tQ,rQ,iQ,lQ,cQ,BQ,Gu,$u,i1,QQ,uW,hW,bW,SW,EW,CW].forEach(function(e){at(ZO,e)});/*!
|
|
506
|
+
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
507
|
+
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
508
|
+
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
509
|
+
*/var JO=0,eL=1,tL=2,Xa=function(t){if(!(this instanceof Xa))return new Xa(t);this.id="Thenable/1.0.7",this.state=JO,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof t=="function"&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};Xa.prototype={fulfill:function(t){return FT(this,eL,"fulfillValue",t)},reject:function(t){return FT(this,tL,"rejectReason",t)},then:function(t,n){var r=this,a=new Xa;return r.onFulfilled.push(qT(t,a,"fulfill")),r.onRejected.push(qT(n,a,"reject")),nL(r),a.proxy}};var FT=function(t,n,r,a){return t.state===JO&&(t.state=n,t[r]=a,nL(t)),t},nL=function(t){t.state===eL?UT(t,"onFulfilled",t.fulfillValue):t.state===tL&&UT(t,"onRejected",t.rejectReason)},UT=function(t,n,r){if(t[n].length!==0){var a=t[n];t[n]=[];var i=function(){for(var o=0;o<a.length;o++)a[o](r)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},qT=function(t,n,r){return function(a){if(typeof t!="function")n[r].call(n,a);else{var i;try{i=t(a)}catch(l){n.reject(l);return}rL(n,i)}}},rL=function(t,n){if(t===n||t.proxy===n){t.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(Gn(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(i){t.reject(i);return}if(typeof r=="function"){var a=!1;try{r.call(n,function(i){a||(a=!0,i===n?t.reject(new TypeError("circular thenable chain")):rL(t,i))},function(i){a||(a=!0,t.reject(i))})}catch(i){a||t.reject(i)}return}t.fulfill(n)};Xa.all=function(e){return new Xa(function(t,n){for(var r=new Array(e.length),a=0,i=function(f,c){r[f]=c,a++,a===e.length&&t(r)},l=0;l<e.length;l++)(function(o){var f=e[o],c=f!=null&&f.then!=null;if(c)f.then(function(p){i(o,p)},function(p){n(p)});else{var h=f;i(o,h)}})(l)})};Xa.resolve=function(e){return new Xa(function(t,n){t(e)})};Xa.reject=function(e){return new Xa(function(t,n){n(e)})};var jc=typeof Promise<"u"?Promise:Xa,o1=function(t,n,r){var a=Bw(t),i=!a,l=this._private=at({duration:1e3},n,r);if(l.target=t,l.style=l.style||l.css,l.started=!1,l.playing=!1,l.hooked=!1,l.applying=!1,l.progress=0,l.completes=[],l.frames=[],l.complete&&gn(l.complete)&&l.completes.push(l.complete),i){var o=t.position();l.startPosition=l.startPosition||{x:o.x,y:o.y},l.startStyle=l.startStyle||t.cy().style().getAnimationStartStyle(t,l.style)}if(a){var f=t.pan();l.startPan={x:f.x,y:f.y},l.startZoom=t.zoom()}this.length=1,this[0]=this},Ro=o1.prototype;at(Ro,{instanceString:function(){return"animation"},hook:function(){var t=this._private;if(!t.hooked){var n,r=t.target._private.animation;t.queue?n=r.queue:n=r.current,n.push(this),fa(t.target)&&t.target.cy().addToAnimationPool(t.target),t.hooked=!0}return this},play:function(){var t=this._private;return t.progress===1&&(t.progress=0),t.playing=!0,t.started=!1,t.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var t=this._private;return t.applying=!0,t.started=!1,t.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var t=this._private;return t.playing=!1,t.started=!1,this},stop:function(){var t=this._private;return t.playing=!1,t.started=!1,t.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(t){var n=this._private;return t===void 0?n.progress*n.duration:this.progress(t/n.duration)},progress:function(t){var n=this._private,r=n.playing;return t===void 0?n.progress:(r&&this.pause(),n.progress=t,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var t=this._private,n=t.playing;n&&this.pause(),t.progress=1-t.progress,t.started=!1;var r=function(c,h){var p=t[c];p!=null&&(t[c]=t[h],t[h]=p)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),t.style)for(var a=0;a<t.style.length;a++){var i=t.style[a],l=i.name,o=t.startStyle[l];t.startStyle[l]=i,t.style[a]=o}return n&&this.play(),this},promise:function(t){var n=this._private,r;switch(t){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new jc(function(a,i){r.push(function(){a()})})}});Ro.complete=Ro.completed;Ro.run=Ro.play;Ro.running=Ro.playing;var NW={animated:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return!1;var l=a[0];if(l)return l._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var l=0;l<a.length;l++){var o=a[l];o._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this,f=!i,c=!f;if(!o.styleEnabled())return this;var h=o.style();n=at({},n,r);var p=Object.keys(n).length===0;if(p)return new o1(l[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(c&&(n.style=h.getPropsList(n.style||n.css),n.css=void 0),c&&n.renderedPosition!=null){var m=n.renderedPosition,y=o.pan(),x=o.zoom();n.position=qO(m,x,y)}if(f&&n.panBy!=null){var b=n.panBy,w=o.pan();n.pan={x:w.x+b.x,y:w.y+b.y}}var S=n.center||n.centre;if(f&&S!=null){var N=o.getCenterPan(S.eles,n.zoom);N!=null&&(n.pan=N)}if(f&&n.fit!=null){var E=n.fit,T=o.getFitViewport(E.eles||E.boundingBox,E.padding);T!=null&&(n.pan=T.pan,n.zoom=T.zoom)}if(f&&Mt(n.zoom)){var R=o.getZoomedViewport(n.zoom);R!=null?(R.zoomed&&(n.zoom=R.zoom),R.panned&&(n.pan=R.pan)):n.zoom=null}return new o1(l[0],n)}},animate:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;r&&(n=at({},n,r));for(var f=0;f<l.length;f++){var c=l[f],h=c.animated()&&(n.queue===void 0||n.queue),p=c.animation(n,h?{queue:!0}:void 0);p.play()}return this}},stop:function(){return function(n,r){var a=this,i=a.length!==void 0,l=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var f=0;f<l.length;f++){for(var c=l[f],h=c._private,p=h.animation.current,m=0;m<p.length;m++){var y=p[m],x=y._private;r&&(x.duration=0)}n&&(h.animation.queue=[]),r||(h.animation.current=[])}return o.notify("draw"),this}}},Wx,VT;function Em(){if(VT)return Wx;VT=1;var e=Array.isArray;return Wx=e,Wx}var Zx,HT;function kW(){if(HT)return Zx;HT=1;var e=Em(),t=Gd(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,l){if(e(i))return!1;var o=typeof i;return o=="number"||o=="symbol"||o=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||l!=null&&i in Object(l)}return Zx=a,Zx}var Jx,GT;function TW(){if(GT)return Jx;GT=1;var e=_O(),t=Hd(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function l(o){if(!t(o))return!1;var f=e(o);return f==r||f==a||f==n||f==i}return Jx=l,Jx}var e0,$T;function jW(){if($T)return e0;$T=1;var e=xm(),t=e["__core-js_shared__"];return e0=t,e0}var t0,KT;function AW(){if(KT)return t0;KT=1;var e=jW(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return t0=n,t0}var n0,YT;function RW(){if(YT)return n0;YT=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return n0=n,n0}var r0,XT;function DW(){if(XT)return r0;XT=1;var e=TW(),t=AW(),n=Hd(),r=RW(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,l=Function.prototype,o=Object.prototype,f=l.toString,c=o.hasOwnProperty,h=RegExp("^"+f.call(c).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(m){if(!n(m)||t(m))return!1;var y=e(m)?h:i;return y.test(r(m))}return r0=p,r0}var a0,QT;function MW(){if(QT)return a0;QT=1;function e(t,n){return t==null?void 0:t[n]}return a0=e,a0}var i0,WT;function Yw(){if(WT)return i0;WT=1;var e=DW(),t=MW();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return i0=n,i0}var s0,ZT;function Cm(){if(ZT)return s0;ZT=1;var e=Yw(),t=e(Object,"create");return s0=t,s0}var l0,JT;function _W(){if(JT)return l0;JT=1;var e=Cm();function t(){this.__data__=e?e(null):{},this.size=0}return l0=t,l0}var o0,ej;function OW(){if(ej)return o0;ej=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return o0=e,o0}var u0,tj;function LW(){if(tj)return u0;tj=1;var e=Cm(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var l=this.__data__;if(e){var o=l[i];return o===t?void 0:o}return r.call(l,i)?l[i]:void 0}return u0=a,u0}var c0,nj;function PW(){if(nj)return c0;nj=1;var e=Cm(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return c0=r,c0}var f0,rj;function BW(){if(rj)return f0;rj=1;var e=Cm(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return f0=n,f0}var d0,aj;function zW(){if(aj)return d0;aj=1;var e=_W(),t=OW(),n=LW(),r=PW(),a=BW();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,d0=i,d0}var h0,ij;function IW(){if(ij)return h0;ij=1;function e(){this.__data__=[],this.size=0}return h0=e,h0}var v0,sj;function aL(){if(sj)return v0;sj=1;function e(t,n){return t===n||t!==t&&n!==n}return v0=e,v0}var p0,lj;function Nm(){if(lj)return p0;lj=1;var e=aL();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return p0=t,p0}var m0,oj;function FW(){if(oj)return m0;oj=1;var e=Nm(),t=Array.prototype,n=t.splice;function r(a){var i=this.__data__,l=e(i,a);if(l<0)return!1;var o=i.length-1;return l==o?i.pop():n.call(i,l,1),--this.size,!0}return m0=r,m0}var g0,uj;function UW(){if(uj)return g0;uj=1;var e=Nm();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return g0=t,g0}var y0,cj;function qW(){if(cj)return y0;cj=1;var e=Nm();function t(n){return e(this.__data__,n)>-1}return y0=t,y0}var x0,fj;function VW(){if(fj)return x0;fj=1;var e=Nm();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return x0=t,x0}var b0,dj;function HW(){if(dj)return b0;dj=1;var e=IW(),t=FW(),n=UW(),r=qW(),a=VW();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,b0=i,b0}var w0,hj;function GW(){if(hj)return w0;hj=1;var e=Yw(),t=xm(),n=e(t,"Map");return w0=n,w0}var S0,vj;function $W(){if(vj)return S0;vj=1;var e=zW(),t=HW(),n=GW();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return S0=r,S0}var E0,pj;function KW(){if(pj)return E0;pj=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return E0=e,E0}var C0,mj;function km(){if(mj)return C0;mj=1;var e=KW();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return C0=t,C0}var N0,gj;function YW(){if(gj)return N0;gj=1;var e=km();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return N0=t,N0}var k0,yj;function XW(){if(yj)return k0;yj=1;var e=km();function t(n){return e(this,n).get(n)}return k0=t,k0}var T0,xj;function QW(){if(xj)return T0;xj=1;var e=km();function t(n){return e(this,n).has(n)}return T0=t,T0}var j0,bj;function WW(){if(bj)return j0;bj=1;var e=km();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return j0=t,j0}var A0,wj;function ZW(){if(wj)return A0;wj=1;var e=$W(),t=YW(),n=XW(),r=QW(),a=WW();function i(l){var o=-1,f=l==null?0:l.length;for(this.clear();++o<f;){var c=l[o];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,A0=i,A0}var R0,Sj;function JW(){if(Sj)return R0;Sj=1;var e=ZW(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var l=arguments,o=a?a.apply(this,l):l[0],f=i.cache;if(f.has(o))return f.get(o);var c=r.apply(this,l);return i.cache=f.set(o,c)||f,c};return i.cache=new(n.Cache||e),i}return n.Cache=e,R0=n,R0}var D0,Ej;function eZ(){if(Ej)return D0;Ej=1;var e=JW(),t=500;function n(r){var a=e(r,function(l){return i.size===t&&i.clear(),l}),i=a.cache;return a}return D0=n,D0}var M0,Cj;function iL(){if(Cj)return M0;Cj=1;var e=eZ(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(l,o,f,c){i.push(f?c.replace(n,"$1"):o||l)}),i});return M0=r,M0}var _0,Nj;function sL(){if(Nj)return _0;Nj=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=Array(a);++r<a;)i[r]=n(t[r],r,t);return i}return _0=e,_0}var O0,kj;function tZ(){if(kj)return O0;kj=1;var e=Iw(),t=sL(),n=Em(),r=Gd(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function l(o){if(typeof o=="string")return o;if(n(o))return t(o,l)+"";if(r(o))return i?i.call(o):"";var f=o+"";return f=="0"&&1/o==-1/0?"-0":f}return O0=l,O0}var L0,Tj;function lL(){if(Tj)return L0;Tj=1;var e=tZ();function t(n){return n==null?"":e(n)}return L0=t,L0}var P0,jj;function oL(){if(jj)return P0;jj=1;var e=Em(),t=kW(),n=iL(),r=lL();function a(i,l){return e(i)?i:t(i,l)?[i]:n(r(i))}return P0=a,P0}var B0,Aj;function Xw(){if(Aj)return B0;Aj=1;var e=Gd();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return B0=t,B0}var z0,Rj;function nZ(){if(Rj)return z0;Rj=1;var e=oL(),t=Xw();function n(r,a){a=e(a,r);for(var i=0,l=a.length;r!=null&&i<l;)r=r[t(a[i++])];return i&&i==l?r:void 0}return z0=n,z0}var I0,Dj;function rZ(){if(Dj)return I0;Dj=1;var e=nZ();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return I0=t,I0}var aZ=rZ(),iZ=Vd(aZ),F0,Mj;function sZ(){if(Mj)return F0;Mj=1;var e=Yw(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return F0=t,F0}var U0,_j;function lZ(){if(_j)return U0;_j=1;var e=sZ();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return U0=t,U0}var q0,Oj;function oZ(){if(Oj)return q0;Oj=1;var e=lZ(),t=aL(),n=Object.prototype,r=n.hasOwnProperty;function a(i,l,o){var f=i[l];(!(r.call(i,l)&&t(f,o))||o===void 0&&!(l in i))&&e(i,l,o)}return q0=a,q0}var V0,Lj;function uZ(){if(Lj)return V0;Lj=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var i=typeof r;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return V0=n,V0}var H0,Pj;function cZ(){if(Pj)return H0;Pj=1;var e=oZ(),t=oL(),n=uZ(),r=Hd(),a=Xw();function i(l,o,f,c){if(!r(l))return l;o=t(o,l);for(var h=-1,p=o.length,m=p-1,y=l;y!=null&&++h<p;){var x=a(o[h]),b=f;if(x==="__proto__"||x==="constructor"||x==="prototype")return l;if(h!=m){var w=y[x];b=c?c(w,x,y):void 0,b===void 0&&(b=r(w)?w:n(o[h+1])?[]:{})}e(y,x,b),y=y[x]}return l}return H0=i,H0}var G0,Bj;function fZ(){if(Bj)return G0;Bj=1;var e=cZ();function t(n,r,a){return n==null?n:e(n,r,a)}return G0=t,G0}var dZ=fZ(),hZ=Vd(dZ),$0,zj;function vZ(){if(zj)return $0;zj=1;function e(t,n){var r=-1,a=t.length;for(n||(n=Array(a));++r<a;)n[r]=t[r];return n}return $0=e,$0}var K0,Ij;function pZ(){if(Ij)return K0;Ij=1;var e=sL(),t=vZ(),n=Em(),r=Gd(),a=iL(),i=Xw(),l=lL();function o(f){return n(f)?e(f,i):r(f)?[f]:t(a(l(f)))}return K0=o,K0}var mZ=pZ(),gZ=Vd(mZ),yZ={data:function(t){var n={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return t=at({},n,t),function(a,i){var l=t,o=this,f=o.length!==void 0,c=f?o:[o],h=f?o[0]:o;if(tt(a)){var p=a.indexOf(".")!==-1,m=p&&gZ(a);if(l.allowGetting&&i===void 0){var y;return h&&(l.beforeGet(h),m&&h._private[l.field][a]===void 0?y=iZ(h._private[l.field],m):y=h._private[l.field][a]),y}else if(l.allowSetting&&i!==void 0){var x=!l.immutableKeys[a];if(x){var b=EO({},a,i);l.beforeSet(o,b);for(var w=0,S=c.length;w<S;w++){var N=c[w];l.canSet(N)&&(m&&h._private[l.field][a]===void 0?hZ(N._private[l.field],m,i):N._private[l.field][a]=i)}l.updateStyle&&o.updateStyle(),l.onSet(o),l.settingTriggersEvent&&o[l.triggerFnName](l.settingEvent)}}}else if(l.allowSetting&&Mt(a)){var E=a,T,R,A=Object.keys(E);l.beforeSet(o,E);for(var D=0;D<A.length;D++){T=A[D],R=E[T];var _=!l.immutableKeys[T];if(_)for(var L=0;L<c.length;L++){var M=c[L];l.canSet(M)&&(M._private[l.field][T]=R)}}l.updateStyle&&o.updateStyle(),l.onSet(o),l.settingTriggersEvent&&o[l.triggerFnName](l.settingEvent)}else if(l.allowBinding&&gn(a)){var z=a;o.on(l.bindingEvent,z)}else if(l.allowGetting&&a===void 0){var B;return h&&(l.beforeGet(h),B=h._private[l.field]),B}return o}},removeData:function(t){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return t=at({},n,t),function(a){var i=t,l=this,o=l.length!==void 0,f=o?l:[l];if(tt(a)){for(var c=a.split(/\s+/),h=c.length,p=0;p<h;p++){var m=c[p];if(!bl(m)){var y=!i.immutableKeys[m];if(y)for(var x=0,b=f.length;x<b;x++)f[x]._private[i.field][m]=void 0}}i.triggerEvent&&l[i.triggerFnName](i.event)}else if(a===void 0){for(var w=0,S=f.length;w<S;w++)for(var N=f[w]._private[i.field],E=Object.keys(N),T=0;T<E.length;T++){var R=E[T],A=!i.immutableKeys[R];A&&(N[R]=void 0)}i.triggerEvent&&l[i.triggerFnName](i.event)}return l}}},xZ={eventAliasesOn:function(t){var n=t;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,a){var i=this,l=Array.prototype.slice.call(arguments,0);return new jc(function(o,f){var c=function(y){i.off.apply(i,p),o(y)},h=l.concat([c]),p=h.concat([]);i.on.apply(i,h)})}}},Bt={};[NW,yZ,xZ].forEach(function(e){at(Bt,e)});var bZ={animate:Bt.animate(),animation:Bt.animation(),animated:Bt.animated(),clearQueue:Bt.clearQueue(),delay:Bt.delay(),delayAnimation:Bt.delayAnimation(),stop:Bt.stop()},rp={classes:function(t){var n=this;if(t===void 0){var r=[];return n[0]._private.classes.forEach(function(x){return r.push(x)}),r}else Wt(t)||(t=(t||"").match(/\S+/g)||[]);for(var a=[],i=new Tc(t),l=0;l<n.length;l++){for(var o=n[l],f=o._private,c=f.classes,h=!1,p=0;p<t.length;p++){var m=t[p],y=c.has(m);if(!y){h=!0;break}}h||(h=c.size!==t.length),h&&(f.classes=i,a.push(o))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},addClass:function(t){return this.toggleClass(t,!0)},hasClass:function(t){var n=this[0];return n!=null&&n._private.classes.has(t)},toggleClass:function(t,n){Wt(t)||(t=t.match(/\S+/g)||[]);for(var r=this,a=n===void 0,i=[],l=0,o=r.length;l<o;l++)for(var f=r[l],c=f._private.classes,h=!1,p=0;p<t.length;p++){var m=t[p],y=c.has(m),x=!1;n||a&&!y?(c.add(m),x=!0):(!n||a&&y)&&(c.delete(m),x=!0),!h&&x&&(i.push(f),h=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(t){return this.toggleClass(t,!1)},flashClass:function(t,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(t),setTimeout(function(){r.removeClass(t)},n),r}};rp.className=rp.classNames=rp.classes;var Dt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Hn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Dt.variable="(?:[\\w-.]|(?:\\\\"+Dt.metaChar+"))+";Dt.className="(?:[\\w-]|(?:\\\\"+Dt.metaChar+"))+";Dt.value=Dt.string+"|"+Dt.number;Dt.id=Dt.variable;(function(){var e,t,n;for(e=Dt.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],Dt.comparatorOp+="|@"+t;for(e=Dt.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],!(t.indexOf("!")>=0)&&t!=="="&&(Dt.comparatorOp+="|\\!"+t)})();var Kt=function(){return{checks:[]}},qe={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},u1=[{selector:":selected",matches:function(t){return t.selected()}},{selector:":unselected",matches:function(t){return!t.selected()}},{selector:":selectable",matches:function(t){return t.selectable()}},{selector:":unselectable",matches:function(t){return!t.selectable()}},{selector:":locked",matches:function(t){return t.locked()}},{selector:":unlocked",matches:function(t){return!t.locked()}},{selector:":visible",matches:function(t){return t.visible()}},{selector:":hidden",matches:function(t){return!t.visible()}},{selector:":transparent",matches:function(t){return t.transparent()}},{selector:":grabbed",matches:function(t){return t.grabbed()}},{selector:":free",matches:function(t){return!t.grabbed()}},{selector:":removed",matches:function(t){return t.removed()}},{selector:":inside",matches:function(t){return!t.removed()}},{selector:":grabbable",matches:function(t){return t.grabbable()}},{selector:":ungrabbable",matches:function(t){return!t.grabbable()}},{selector:":animated",matches:function(t){return t.animated()}},{selector:":unanimated",matches:function(t){return!t.animated()}},{selector:":parent",matches:function(t){return t.isParent()}},{selector:":childless",matches:function(t){return t.isChildless()}},{selector:":child",matches:function(t){return t.isChild()}},{selector:":orphan",matches:function(t){return t.isOrphan()}},{selector:":nonorphan",matches:function(t){return t.isChild()}},{selector:":compound",matches:function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()}},{selector:":loop",matches:function(t){return t.isLoop()}},{selector:":simple",matches:function(t){return t.isSimple()}},{selector:":active",matches:function(t){return t.active()}},{selector:":inactive",matches:function(t){return!t.active()}},{selector:":backgrounding",matches:function(t){return t.backgrounding()}},{selector:":nonbackgrounding",matches:function(t){return!t.backgrounding()}}].sort(function(e,t){return yX(e.selector,t.selector)}),wZ=(function(){for(var e={},t,n=0;n<u1.length;n++)t=u1[n],e[t.selector]=t.matches;return e})(),SZ=function(t,n){return wZ[t](n)},EZ="("+u1.map(function(e){return e.selector}).join("|")+")",Cu=function(t){return t.replace(new RegExp("\\\\("+Dt.metaChar+")","g"),function(n,r){return r})},Ks=function(t,n,r){t[t.length-1]=r},c1=[{name:"group",query:!0,regex:"("+Dt.group+")",populate:function(t,n,r){var a=Bn(r,1),i=a[0];n.checks.push({type:qe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:EZ,populate:function(t,n,r){var a=Bn(r,1),i=a[0];n.checks.push({type:qe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Dt.id+")",populate:function(t,n,r){var a=Bn(r,1),i=a[0];n.checks.push({type:qe.ID,value:Cu(i)})}},{name:"className",query:!0,regex:"\\.("+Dt.className+")",populate:function(t,n,r){var a=Bn(r,1),i=a[0];n.checks.push({type:qe.CLASS,value:Cu(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Dt.variable+")\\s*\\]",populate:function(t,n,r){var a=Bn(r,1),i=a[0];n.checks.push({type:qe.DATA_EXIST,field:Cu(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Dt.variable+")\\s*("+Dt.comparatorOp+")\\s*("+Dt.value+")\\s*\\]",populate:function(t,n,r){var a=Bn(r,3),i=a[0],l=a[1],o=a[2],f=new RegExp("^"+Dt.string+"$").exec(o)!=null;f?o=o.substring(1,o.length-1):o=parseFloat(o),n.checks.push({type:qe.DATA_COMPARE,field:Cu(i),operator:l,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Dt.boolOp+")\\s*("+Dt.variable+")\\s*\\]",populate:function(t,n,r){var a=Bn(r,2),i=a[0],l=a[1];n.checks.push({type:qe.DATA_BOOL,field:Cu(l),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Dt.meta+")\\s*("+Dt.comparatorOp+")\\s*("+Dt.number+")\\s*\\]\\]",populate:function(t,n,r){var a=Bn(r,3),i=a[0],l=a[1],o=a[2];n.checks.push({type:qe.META_COMPARE,field:Cu(i),operator:l,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Dt.separator,populate:function(t,n){var r=t.currentSubject,a=t.edgeCount,i=t.compoundCount,l=t[t.length-1];r!=null&&(l.subject=r,t.currentSubject=null),l.edgeCount=a,l.compoundCount=i,t.edgeCount=0,t.compoundCount=0;var o=t[t.length++]=Kt();return o}},{name:"directedEdge",separator:!0,regex:Dt.directedEdge,populate:function(t,n){if(t.currentSubject==null){var r=Kt(),a=n,i=Kt();return r.checks.push({type:qe.DIRECTED_EDGE,source:a,target:i}),Ks(t,n,r),t.edgeCount++,i}else{var l=Kt(),o=n,f=Kt();return l.checks.push({type:qe.NODE_SOURCE,source:o,target:f}),Ks(t,n,l),t.edgeCount++,f}}},{name:"undirectedEdge",separator:!0,regex:Dt.undirectedEdge,populate:function(t,n){if(t.currentSubject==null){var r=Kt(),a=n,i=Kt();return r.checks.push({type:qe.UNDIRECTED_EDGE,nodes:[a,i]}),Ks(t,n,r),t.edgeCount++,i}else{var l=Kt(),o=n,f=Kt();return l.checks.push({type:qe.NODE_NEIGHBOR,node:o,neighbor:f}),Ks(t,n,l),f}}},{name:"child",separator:!0,regex:Dt.child,populate:function(t,n){if(t.currentSubject==null){var r=Kt(),a=Kt(),i=t[t.length-1];return r.checks.push({type:qe.CHILD,parent:i,child:a}),Ks(t,n,r),t.compoundCount++,a}else if(t.currentSubject===n){var l=Kt(),o=t[t.length-1],f=Kt(),c=Kt(),h=Kt(),p=Kt();return l.checks.push({type:qe.COMPOUND_SPLIT,left:o,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:qe.TRUE}],p.checks.push({type:qe.TRUE}),f.checks.push({type:qe.PARENT,parent:p,child:h}),Ks(t,o,l),t.currentSubject=c,t.compoundCount++,h}else{var m=Kt(),y=Kt(),x=[{type:qe.PARENT,parent:m,child:y}];return m.checks=n.checks,n.checks=x,t.compoundCount++,y}}},{name:"descendant",separator:!0,regex:Dt.descendant,populate:function(t,n){if(t.currentSubject==null){var r=Kt(),a=Kt(),i=t[t.length-1];return r.checks.push({type:qe.DESCENDANT,ancestor:i,descendant:a}),Ks(t,n,r),t.compoundCount++,a}else if(t.currentSubject===n){var l=Kt(),o=t[t.length-1],f=Kt(),c=Kt(),h=Kt(),p=Kt();return l.checks.push({type:qe.COMPOUND_SPLIT,left:o,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:qe.TRUE}],p.checks.push({type:qe.TRUE}),f.checks.push({type:qe.ANCESTOR,ancestor:p,descendant:h}),Ks(t,o,l),t.currentSubject=c,t.compoundCount++,h}else{var m=Kt(),y=Kt(),x=[{type:qe.ANCESTOR,ancestor:m,descendant:y}];return m.checks=n.checks,n.checks=x,t.compoundCount++,y}}},{name:"subject",modifier:!0,regex:Dt.subject,populate:function(t,n){if(t.currentSubject!=null&&t.currentSubject!==n)return zt("Redefinition of subject in selector `"+t.toString()+"`"),!1;t.currentSubject=n;var r=t[t.length-1],a=r.checks[0],i=a==null?null:a.type;i===qe.DIRECTED_EDGE?a.type=qe.NODE_TARGET:i===qe.UNDIRECTED_EDGE&&(a.type=qe.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];c1.forEach(function(e){return e.regexObj=new RegExp("^"+e.regex)});var CZ=function(t){for(var n,r,a,i=0;i<c1.length;i++){var l=c1[i],o=l.name,f=t.match(l.regexObj);if(f!=null){r=f,n=l,a=o;var c=f[0];t=t.substring(c.length);break}}return{expr:n,match:r,name:a,remaining:t}},NZ=function(t){var n=t.match(/^\s+/);if(n){var r=n[0];t=t.substring(r.length)}return t},kZ=function(t){var n=this,r=n.inputText=t,a=n[0]=Kt();for(n.length=1,r=NZ(r);;){var i=CZ(r);if(i.expr==null)return zt("The selector `"+t+"`is invalid"),!1;var l=i.match.slice(1),o=i.expr.populate(n,a,l);if(o===!1)return!1;if(o!=null&&(a=o),r=i.remaining,r.match(/^\s*$/))break}var f=n[n.length-1];n.currentSubject!=null&&(f.subject=n.currentSubject),f.edgeCount=n.edgeCount,f.compoundCount=n.compoundCount;for(var c=0;c<n.length;c++){var h=n[c];if(h.compoundCount>0&&h.edgeCount>0)return zt("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return zt("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&zt("The selector `"+t+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},TZ=function(){if(this.toStringCache!=null)return this.toStringCache;for(var t=function(h){return h??""},n=function(h){return tt(h)?'"'+h+'"':t(h)},r=function(h){return" "+h+" "},a=function(h,p){var m=h.type,y=h.value;switch(m){case qe.GROUP:{var x=t(y);return x.substring(0,x.length-1)}case qe.DATA_COMPARE:{var b=h.field,w=h.operator;return"["+b+r(t(w))+n(y)+"]"}case qe.DATA_BOOL:{var S=h.operator,N=h.field;return"["+t(S)+N+"]"}case qe.DATA_EXIST:{var E=h.field;return"["+E+"]"}case qe.META_COMPARE:{var T=h.operator,R=h.field;return"[["+R+r(t(T))+n(y)+"]]"}case qe.STATE:return y;case qe.ID:return"#"+y;case qe.CLASS:return"."+y;case qe.PARENT:case qe.CHILD:return i(h.parent,p)+r(">")+i(h.child,p);case qe.ANCESTOR:case qe.DESCENDANT:return i(h.ancestor,p)+" "+i(h.descendant,p);case qe.COMPOUND_SPLIT:{var A=i(h.left,p),D=i(h.subject,p),_=i(h.right,p);return A+(A.length>0?" ":"")+D+_}case qe.TRUE:return""}},i=function(h,p){return h.checks.reduce(function(m,y,x){return m+(p===h&&x===0?"$":"")+a(y,p)},"")},l="",o=0;o<this.length;o++){var f=this[o];l+=i(f,f.subject),this.length>1&&o<this.length-1&&(l+=", ")}return this.toStringCache=l,l},jZ={parse:kZ,toString:TZ},uL=function(t,n,r){var a,i=tt(t),l=Re(t),o=tt(r),f,c,h=!1,p=!1,m=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),p=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),h=!0),(i||o||h)&&(f=!i&&!l?"":""+t,c=""+r),h&&(t=f=f.toLowerCase(),r=c=c.toLowerCase()),n){case"*=":a=f.indexOf(c)>=0;break;case"$=":a=f.indexOf(c,f.length-c.length)>=0;break;case"^=":a=f.indexOf(c)===0;break;case"=":a=t===r;break;case">":m=!0,a=t>r;break;case">=":m=!0,a=t>=r;break;case"<":m=!0,a=t<r;break;case"<=":m=!0,a=t<=r;break;default:a=!1;break}return p&&(t!=null||!m)&&(a=!a),a},AZ=function(t,n){switch(n){case"?":return!!t;case"!":return!t;case"^":return t===void 0}},RZ=function(t){return t!==void 0},Qw=function(t,n){return t.data(n)},DZ=function(t,n){return t[n]()},En=[],on=function(t,n){return t.checks.every(function(r){return En[r.type](r,n)})};En[qe.GROUP]=function(e,t){var n=e.value;return n==="*"||n===t.group()};En[qe.STATE]=function(e,t){var n=e.value;return SZ(n,t)};En[qe.ID]=function(e,t){var n=e.value;return t.id()===n};En[qe.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)};En[qe.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,a=e.value;return uL(DZ(t,n),r,a)};En[qe.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,a=e.value;return uL(Qw(t,n),r,a)};En[qe.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return AZ(Qw(t,n),r)};En[qe.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,RZ(Qw(t,n))};En[qe.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],a=t.source(),i=t.target();return on(n,a)&&on(r,i)||on(r,a)&&on(n,i)};En[qe.NODE_NEIGHBOR]=function(e,t){return on(e.node,t)&&t.neighborhood().some(function(n){return n.isNode()&&on(e.neighbor,n)})};En[qe.DIRECTED_EDGE]=function(e,t){return on(e.source,t.source())&&on(e.target,t.target())};En[qe.NODE_SOURCE]=function(e,t){return on(e.source,t)&&t.outgoers().some(function(n){return n.isNode()&&on(e.target,n)})};En[qe.NODE_TARGET]=function(e,t){return on(e.target,t)&&t.incomers().some(function(n){return n.isNode()&&on(e.source,n)})};En[qe.CHILD]=function(e,t){return on(e.child,t)&&on(e.parent,t.parent())};En[qe.PARENT]=function(e,t){return on(e.parent,t)&&t.children().some(function(n){return on(e.child,n)})};En[qe.DESCENDANT]=function(e,t){return on(e.descendant,t)&&t.ancestors().some(function(n){return on(e.ancestor,n)})};En[qe.ANCESTOR]=function(e,t){return on(e.ancestor,t)&&t.descendants().some(function(n){return on(e.descendant,n)})};En[qe.COMPOUND_SPLIT]=function(e,t){return on(e.subject,t)&&on(e.left,t)&&on(e.right,t)};En[qe.TRUE]=function(){return!0};En[qe.COLLECTION]=function(e,t){var n=e.value;return n.has(t)};En[qe.FILTER]=function(e,t){var n=e.value;return n(t)};var MZ=function(t){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===qe.ID)return t.getElementById(n[0].checks[0].value).collection();var r=function(i){for(var l=0;l<n.length;l++){var o=n[l];if(on(o,i))return!0}return!1};return n.text()==null&&(r=function(){return!0}),t.filter(r)},_Z=function(t){for(var n=this,r=0;r<n.length;r++){var a=n[r];if(on(a,t))return!0}return!1},OZ={matches:_Z,filter:MZ},El=function(t){this.inputText=t,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,t==null||tt(t)&&t.match(/^\s*$/)||(fa(t)?this.addQuery({checks:[{type:qe.COLLECTION,value:t.collection()}]}):gn(t)?this.addQuery({checks:[{type:qe.FILTER,value:t}]}):tt(t)?this.parse(t)||(this.invalid=!0):dn("A selector must be created from a string; found "))},Cl=El.prototype;[jZ,OZ].forEach(function(e){return at(Cl,e)});Cl.text=function(){return this.inputText};Cl.size=function(){return this.length};Cl.eq=function(e){return this[e]};Cl.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()};Cl.addQuery=function(e){this[this.length++]=e};Cl.selector=Cl.toString;var pl={allAre:function(t){var n=new El(t);return this.every(function(r){return n.matches(r)})},is:function(t){var n=new El(t);return this.some(function(r){return n.matches(r)})},some:function(t,n){for(var r=0;r<this.length;r++){var a=n?t.apply(n,[this[r],r,this]):t(this[r],r,this);if(a)return!0}return!1},every:function(t,n){for(var r=0;r<this.length;r++){var a=n?t.apply(n,[this[r],r,this]):t(this[r],r,this);if(!a)return!1}return!0},same:function(t){if(this===t)return!0;t=this.cy().collection(t);var n=this.length,r=t.length;return n!==r?!1:n===1?this[0]===t[0]:this.every(function(a){return t.hasElementWithId(a.id())})},anySame:function(t){return t=this.cy().collection(t),this.some(function(n){return t.hasElementWithId(n.id())})},allAreNeighbors:function(t){t=this.cy().collection(t);var n=this.neighborhood();return t.every(function(r){return n.hasElementWithId(r.id())})},contains:function(t){t=this.cy().collection(t);var n=this;return t.every(function(r){return n.hasElementWithId(r.id())})}};pl.allAreNeighbours=pl.allAreNeighbors;pl.has=pl.contains;pl.equal=pl.equals=pl.same;var _a=function(t,n){return function(a,i,l,o){var f=a,c=this,h;if(f==null?h="":fa(f)&&f.length===1&&(h=f.id()),c.length===1&&h){var p=c[0]._private,m=p.traversalCache=p.traversalCache||{},y=m[n]=m[n]||[],x=jo(h),b=y[x];return b||(y[x]=t.call(c,a,i,l,o))}else return t.call(c,a,i,l,o)}},cc={parent:function(t){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var a=0;a<this.length;a++){var i=this[a],l=i._private.parent;l&&n.push(l)}return this.spawn(n,!0).filter(t)},parents:function(t){for(var n=[],r=this.parent();r.nonempty();){for(var a=0;a<r.length;a++){var i=r[a];n.push(i)}r=r.parent()}return this.spawn(n,!0).filter(t)},commonAncestors:function(t){for(var n,r=0;r<this.length;r++){var a=this[r],i=a.parents();n=n||i,n=n.intersect(i)}return n.filter(t)},orphans:function(t){return this.stdFilter(function(n){return n.isOrphan()}).filter(t)},nonorphans:function(t){return this.stdFilter(function(n){return n.isChild()}).filter(t)},children:_a(function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n],a=r._private.children,i=0;i<a.length;i++)t.push(a[i]);return this.spawn(t,!0).filter(e)},"children"),siblings:function(t){return this.parent().children().not(this).filter(t)},isParent:function(){var t=this[0];if(t)return t.isNode()&&t._private.children.length!==0},isChildless:function(){var t=this[0];if(t)return t.isNode()&&t._private.children.length===0},isChild:function(){var t=this[0];if(t)return t.isNode()&&t._private.parent!=null},isOrphan:function(){var t=this[0];if(t)return t.isNode()&&t._private.parent==null},descendants:function(t){var n=[];function r(a){for(var i=0;i<a.length;i++){var l=a[i];n.push(l),l.children().nonempty()&&r(l.children())}}return r(this.children()),this.spawn(n,!0).filter(t)}};function Ww(e,t,n,r){for(var a=[],i=new Tc,l=e.cy(),o=l.hasCompoundNodes(),f=0;f<e.length;f++){var c=e[f];n?a.push(c):o&&r(a,i,c)}for(;a.length>0;){var h=a.shift();t(h),i.add(h.id()),o&&r(a,i,h)}return e}function cL(e,t,n){if(n.isParent())for(var r=n._private.children,a=0;a<r.length;a++){var i=r[a];t.has(i.id())||e.push(i)}}cc.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ww(this,e,t,cL)};function fL(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}cc.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ww(this,e,t,fL)};function LZ(e,t,n){fL(e,t,n),cL(e,t,n)}cc.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ww(this,e,t,LZ)};cc.ancestors=cc.parents;var pd,dL;pd=dL={data:Bt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Bt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Bt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Bt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Bt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Bt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var t=this[0];if(t)return t._private.data.id}};pd.attr=pd.data;pd.removeAttr=pd.removeData;var PZ=dL,Tm={};function Y0(e){return function(t){var n=this;if(t===void 0&&(t=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,a=n[0],i=a._private.edges,l=0;l<i.length;l++){var o=i[l];!t&&o.isLoop()||(r+=e(a,o))}return r}else return}}at(Tm,{degree:Y0(function(e,t){return t.source().same(t.target())?2:1}),indegree:Y0(function(e,t){return t.target().same(e)?1:0}),outdegree:Y0(function(e,t){return t.source().same(e)?1:0})});function Nu(e,t){return function(n){for(var r,a=this.nodes(),i=0;i<a.length;i++){var l=a[i],o=l[e](n);o!==void 0&&(r===void 0||t(o,r))&&(r=o)}return r}}at(Tm,{minDegree:Nu("degree",function(e,t){return e<t}),maxDegree:Nu("degree",function(e,t){return e>t}),minIndegree:Nu("indegree",function(e,t){return e<t}),maxIndegree:Nu("indegree",function(e,t){return e>t}),minOutdegree:Nu("outdegree",function(e,t){return e<t}),maxOutdegree:Nu("outdegree",function(e,t){return e>t})});at(Tm,{totalDegree:function(t){for(var n=0,r=this.nodes(),a=0;a<r.length;a++)n+=r[a].degree(t);return n}});var Ga,hL,vL=function(t,n,r){for(var a=0;a<t.length;a++){var i=t[a];if(!i.locked()){var l=i._private.position,o={x:n.x!=null?n.x-l.x:0,y:n.y!=null?n.y-l.y:0};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,r),i.dirtyBoundingBoxCache()}}},Fj={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(t){t.updateCompoundBounds()},beforeSet:function(t,n){vL(t,n,!1)},onSet:function(t){t.dirtyCompoundBoundsCache()},canSet:function(t){return!t.locked()}};Ga=hL={position:Bt.data(Fj),silentPosition:Bt.data(at({},Fj,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(t,n){vL(t,n,!0)},onSet:function(t){t.dirtyCompoundBoundsCache()}})),positions:function(t,n){if(Mt(t))n?this.silentPosition(t):this.position(t);else if(gn(t)){var r=t,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var l=this[i],o=void 0;(o=r(l,i))&&(n?l.silentPosition(o):l.position(o))}a.endBatch()}return this},silentPositions:function(t){return this.positions(t,!0)},shift:function(t,n,r){var a;if(Mt(t)?(a={x:Re(t.x)?t.x:0,y:Re(t.y)?t.y:0},r=n):tt(t)&&Re(n)&&(a={x:0,y:0},a[t]=n),a!=null){var i=this.cy();i.startBatch();for(var l=0;l<this.length;l++){var o=this[l];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var f=o.position(),c={x:f.x+a.x,y:f.y+a.y};r?o.silentPosition(c):o.position(c)}}i.endBatch()}return this},silentShift:function(t,n){return Mt(t)?this.shift(t,!0):tt(t)&&Re(n)&&this.shift(t,n,!0),this},renderedPosition:function(t,n){var r=this[0],a=this.cy(),i=a.zoom(),l=a.pan(),o=Mt(t)?t:void 0,f=o!==void 0||n!==void 0&&tt(t);if(r&&r.isNode())if(f)for(var c=0;c<this.length;c++){var h=this[c];n!==void 0?h.position(t,(n-l[t])/i):o!==void 0&&h.position(qO(o,i,l))}else{var p=r.position();return o=wm(p,i,l),t===void 0?o:o[t]}else if(!f)return;return this},relativePosition:function(t,n){var r=this[0],a=this.cy(),i=Mt(t)?t:void 0,l=i!==void 0||n!==void 0&&tt(t),o=a.hasCompoundNodes();if(r&&r.isNode())if(l)for(var f=0;f<this.length;f++){var c=this[f],h=o?c.parent():null,p=h&&h.length>0,m=p;p&&(h=h[0]);var y=m?h.position():{x:0,y:0};n!==void 0?c.position(t,n+y[t]):i!==void 0&&c.position({x:i.x+y.x,y:i.y+y.y})}else{var x=r.position(),b=o?r.parent():null,w=b&&b.length>0,S=w;w&&(b=b[0]);var N=S?b.position():{x:0,y:0};return i={x:x.x-N.x,y:x.y-N.y},t===void 0?i:i[t]}else if(!l)return;return this}};Ga.modelPosition=Ga.point=Ga.position;Ga.modelPositions=Ga.points=Ga.positions;Ga.renderedPoint=Ga.renderedPosition;Ga.relativePoint=Ga.relativePosition;var BZ=hL,Ku,Ml;Ku=Ml={};Ml.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),a=n.pan(),i=t.x1*r+a.x,l=t.x2*r+a.x,o=t.y1*r+a.y,f=t.y2*r+a.y;return{x1:i,x2:l,y1:o,y2:f,w:l-i,h:f-o}};Ml.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();return!t.styleEnabled()||!t.hasCompoundNodes()?this:(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,e||n.emitAndNotify("bounds")}}),this)};Ml.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(l){if(!l.isParent())return;var o=l._private,f=l.children(),c=l.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:l.pstyle("min-width").pfValue,left:l.pstyle("min-width-bias-left"),right:l.pstyle("min-width-bias-right")},height:{val:l.pstyle("min-height").pfValue,top:l.pstyle("min-height-bias-top"),bottom:l.pstyle("min-height-bias-bottom")}},p=f.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),m=o.position;(p.w===0||p.h===0)&&(p={w:l.pstyle("width").pfValue,h:l.pstyle("height").pfValue},p.x1=m.x-p.w/2,p.x2=m.x+p.w/2,p.y1=m.y-p.h/2,p.y2=m.y+p.h/2);function y(L,M,z){var B=0,H=0,G=M+z;return L>0&&G>0&&(B=M/G*L,H=z/G*L),{biasDiff:B,biasComplementDiff:H}}function x(L,M,z,B){if(z.units==="%")switch(B){case"width":return L>0?z.pfValue*L:0;case"height":return M>0?z.pfValue*M:0;case"average":return L>0&&M>0?z.pfValue*(L+M)/2:0;case"min":return L>0&&M>0?L>M?z.pfValue*M:z.pfValue*L:0;case"max":return L>0&&M>0?L>M?z.pfValue*L:z.pfValue*M:0;default:return 0}else return z.units==="px"?z.pfValue:0}var b=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(b=b*100/h.width.val);var w=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(w=w*100/h.width.val);var S=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(S=S*100/h.height.val);var N=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(N=N*100/h.height.val);var E=y(h.width.val-p.w,b,w),T=E.biasDiff,R=E.biasComplementDiff,A=y(h.height.val-p.h,S,N),D=A.biasDiff,_=A.biasComplementDiff;o.autoPadding=x(p.w,p.h,l.pstyle("padding"),l.pstyle("padding-relative-to").value),o.autoWidth=Math.max(p.w,h.width.val),m.x=(-T+p.x1+p.x2+R)/2,o.autoHeight=Math.max(p.h,h.height.val),m.y=(-D+p.y1+p.y2+_)/2}for(var r=0;r<this.length;r++){var a=this[r],i=a._private;(!i.compoundBoundsClean||e)&&(n(a),t.batching()||(i.compoundBoundsClean=!0))}return this};var Da=function(t){return t===1/0||t===-1/0?0:t},Ua=function(t,n,r,a,i){a-n===0||i-r===0||n==null||r==null||a==null||i==null||(t.x1=n<t.x1?n:t.x1,t.x2=a>t.x2?a:t.x2,t.y1=r<t.y1?r:t.y1,t.y2=i>t.y2?i:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)},Zs=function(t,n){return n==null?t:Ua(t,n.x1,n.y1,n.x2,n.y2)},Lf=function(t,n,r){return Gr(t,n,r)},_v=function(t,n,r){if(!n.cy().headless()){var a=n._private,i=a.rstyle,l=i.arrowWidth/2,o=n.pstyle(r+"-arrow-shape").value,f,c;if(o!=="none"){r==="source"?(f=i.srcX,c=i.srcY):r==="target"?(f=i.tgtX,c=i.tgtY):(f=i.midX,c=i.midY);var h=a.arrowBounds=a.arrowBounds||{},p=h[r]=h[r]||{};p.x1=f-l,p.y1=c-l,p.x2=f+l,p.y2=c+l,p.w=p.x2-p.x1,p.h=p.y2-p.y1,tp(p,1),Ua(t,p.x1,p.y1,p.x2,p.y2)}}},X0=function(t,n,r){if(!n.cy().headless()){var a;r?a=r+"-":a="";var i=n._private,l=i.rstyle,o=n.pstyle(a+"label").strValue;if(o){var f=n.pstyle("text-halign"),c=n.pstyle("text-valign"),h=Lf(l,"labelWidth",r),p=Lf(l,"labelHeight",r),m=Lf(l,"labelX",r),y=Lf(l,"labelY",r),x=n.pstyle(a+"text-margin-x").pfValue,b=n.pstyle(a+"text-margin-y").pfValue,w=n.isEdge(),S=n.pstyle(a+"text-rotation"),N=n.pstyle("text-outline-width").pfValue,E=n.pstyle("text-border-width").pfValue,T=E/2,R=n.pstyle("text-background-padding").pfValue,A=2,D=p,_=h,L=_/2,M=D/2,z,B,H,G;if(w)z=m-L,B=m+L,H=y-M,G=y+M;else{switch(f.value){case"left":z=m-_,B=m;break;case"center":z=m-L,B=m+L;break;case"right":z=m,B=m+_;break}switch(c.value){case"top":H=y-D,G=y;break;case"center":H=y-M,G=y+M;break;case"bottom":H=y,G=y+D;break}}var U=x-Math.max(N,T)-R-A,I=x+Math.max(N,T)+R+A,V=b-Math.max(N,T)-R-A,K=b+Math.max(N,T)+R+A;z+=U,B+=I,H+=V,G+=K;var Q=r||"main",F=i.labelBounds,q=F[Q]=F[Q]||{};q.x1=z,q.y1=H,q.x2=B,q.y2=G,q.w=B-z,q.h=G-H,q.leftPad=U,q.rightPad=I,q.topPad=V,q.botPad=K;var X=w&&S.strValue==="autorotate",P=S.pfValue!=null&&S.pfValue!==0;if(X||P){var Z=X?Lf(i.rstyle,"labelAngle",r):S.pfValue,ae=Math.cos(Z),ie=Math.sin(Z),le=(z+B)/2,ye=(H+G)/2;if(!w){switch(f.value){case"left":le=B;break;case"right":le=z;break}switch(c.value){case"top":ye=G;break;case"bottom":ye=H;break}}var ne=function(Je,We){return Je=Je-le,We=We-ye,{x:Je*ae-We*ie+le,y:Je*ie+We*ae+ye}},W=ne(z,H),J=ne(z,G),se=ne(B,H),ge=ne(B,G);z=Math.min(W.x,J.x,se.x,ge.x),B=Math.max(W.x,J.x,se.x,ge.x),H=Math.min(W.y,J.y,se.y,ge.y),G=Math.max(W.y,J.y,se.y,ge.y)}var Te=Q+"Rot",Be=F[Te]=F[Te]||{};Be.x1=z,Be.y1=H,Be.x2=B,Be.y2=G,Be.w=B-z,Be.h=G-H,Ua(t,z,H,B,G),Ua(i.labelBounds.all,z,H,B,G)}return t}},Uj=function(t,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,a=n.pstyle("outline-width").value,i=n.pstyle("outline-offset").value,l=a+i;pL(t,n,r,l,"outside",l/2)}},pL=function(t,n,r,a,i,l){if(!(r===0||a<=0||i==="inside")){var o=n.cy(),f=n.pstyle("shape").value,c=o.renderer().nodeShapes[f],h=n.position(),p=h.x,m=h.y,y=n.width(),x=n.height();if(c.hasMiterBounds){i==="center"&&(a/=2);var b=c.miterBounds(p,m,y,x,a);Zs(t,b)}else l!=null&&l>0&&np(t,[l,l,l,l])}},zZ=function(t,n){if(!n.cy().headless()){var r=n.pstyle("border-opacity").value,a=n.pstyle("border-width").pfValue,i=n.pstyle("border-position").value;pL(t,n,r,a,i)}},IZ=function(t,n){var r=t._private.cy,a=r.styleEnabled(),i=r.headless(),l=Dr(),o=t._private,f=t.isNode(),c=t.isEdge(),h,p,m,y,x,b,w=o.rstyle,S=f&&a?t.pstyle("bounds-expansion").pfValue:[0],N=function(ot){return ot.pstyle("display").value!=="none"},E=!a||N(t)&&(!c||N(t.source())&&N(t.target()));if(E){var T=0,R=0;a&&n.includeOverlays&&(T=t.pstyle("overlay-opacity").value,T!==0&&(R=t.pstyle("overlay-padding").value));var A=0,D=0;a&&n.includeUnderlays&&(A=t.pstyle("underlay-opacity").value,A!==0&&(D=t.pstyle("underlay-padding").value));var _=Math.max(R,D),L=0,M=0;if(a&&(L=t.pstyle("width").pfValue,M=L/2),f&&n.includeNodes){var z=t.position();x=z.x,b=z.y;var B=t.outerWidth(),H=B/2,G=t.outerHeight(),U=G/2;h=x-H,p=x+H,m=b-U,y=b+U,Ua(l,h,m,p,y),a&&Uj(l,t),a&&n.includeOutlines&&!i&&Uj(l,t),a&&zZ(l,t)}else if(c&&n.includeEdges)if(a&&!i){var I=t.pstyle("curve-style").strValue;if(h=Math.min(w.srcX,w.midX,w.tgtX),p=Math.max(w.srcX,w.midX,w.tgtX),m=Math.min(w.srcY,w.midY,w.tgtY),y=Math.max(w.srcY,w.midY,w.tgtY),h-=M,p+=M,m-=M,y+=M,Ua(l,h,m,p,y),I==="haystack"){var V=w.haystackPts;if(V&&V.length===2){if(h=V[0].x,m=V[0].y,p=V[1].x,y=V[1].y,h>p){var K=h;h=p,p=K}if(m>y){var Q=m;m=y,y=Q}Ua(l,h-M,m-M,p+M,y+M)}}else if(I==="bezier"||I==="unbundled-bezier"||ul(I,"segments")||ul(I,"taxi")){var F;switch(I){case"bezier":case"unbundled-bezier":F=w.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=w.linePts;break}if(F!=null)for(var q=0;q<F.length;q++){var X=F[q];h=X.x-M,p=X.x+M,m=X.y-M,y=X.y+M,Ua(l,h,m,p,y)}}}else{var P=t.source(),Z=P.position(),ae=t.target(),ie=ae.position();if(h=Z.x,p=ie.x,m=Z.y,y=ie.y,h>p){var le=h;h=p,p=le}if(m>y){var ye=m;m=y,y=ye}h-=M,p+=M,m-=M,y+=M,Ua(l,h,m,p,y)}if(a&&n.includeEdges&&c&&(_v(l,t,"mid-source"),_v(l,t,"mid-target"),_v(l,t,"source"),_v(l,t,"target")),a){var ne=t.pstyle("ghost").value==="yes";if(ne){var W=t.pstyle("ghost-offset-x").pfValue,J=t.pstyle("ghost-offset-y").pfValue;Ua(l,l.x1+W,l.y1+J,l.x2+W,l.y2+J)}}var se=o.bodyBounds=o.bodyBounds||{};kT(se,l),np(se,S),tp(se,1),a&&(h=l.x1,p=l.x2,m=l.y1,y=l.y2,Ua(l,h-_,m-_,p+_,y+_));var ge=o.overlayBounds=o.overlayBounds||{};kT(ge,l),np(ge,S),tp(ge,1);var Te=o.labelBounds=o.labelBounds||{};Te.all!=null?bQ(Te.all):Te.all=Dr(),a&&n.includeLabels&&(n.includeMainLabels&&X0(l,t,null),c&&(n.includeSourceLabels&&X0(l,t,"source"),n.includeTargetLabels&&X0(l,t,"target")))}return l.x1=Da(l.x1),l.y1=Da(l.y1),l.x2=Da(l.x2),l.y2=Da(l.y2),l.w=Da(l.x2-l.x1),l.h=Da(l.y2-l.y1),l.w>0&&l.h>0&&E&&(np(l,S),tp(l,1)),l},mL=function(t){var n=0,r=function(l){return(l?1:0)<<n++},a=0;return a+=r(t.incudeNodes),a+=r(t.includeEdges),a+=r(t.includeLabels),a+=r(t.includeMainLabels),a+=r(t.includeSourceLabels),a+=r(t.includeTargetLabels),a+=r(t.includeOverlays),a+=r(t.includeOutlines),a},gL=function(t){var n=function(o){return Math.round(o)};if(t.isEdge()){var r=t.source().position(),a=t.target().position();return bT([n(r.x),n(r.y),n(a.x),n(a.y)])}else{var i=t.position();return bT([n(i.x),n(i.y)])}},qj=function(t,n){var r=t._private,a,i=t.isEdge(),l=n==null?Vj:mL(n),o=l===Vj;if(r.bbCache==null?(a=IZ(t,md),r.bbCache=a,r.bbCachePosKey=gL(t)):a=r.bbCache,!o){var f=t.isNode();a=Dr(),(n.includeNodes&&f||n.includeEdges&&!f)&&(n.includeOverlays?Zs(a,r.overlayBounds):Zs(a,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!i||n.includeSourceLabels&&n.includeTargetLabels)?Zs(a,r.labelBounds.all):(n.includeMainLabels&&Zs(a,r.labelBounds.mainRot),n.includeSourceLabels&&Zs(a,r.labelBounds.sourceRot),n.includeTargetLabels&&Zs(a,r.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},md={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Vj=mL(md),Hj=dr(md);Ml.boundingBox=function(e){var t,n=e===void 0||e.useCache===void 0||e.useCache===!0,r=oc(function(h){var p=h._private;return p.bbCache==null||p.styleDirty||p.bbCachePosKey!==gL(h)},function(h){return h.id()});if(n&&this.length===1&&!r(this[0]))e===void 0?e=md:e=Hj(e),t=qj(this[0],e);else{t=Dr(),e=e||md;var a=Hj(e),i=this,l=i.cy(),o=l.styleEnabled();this.edges().forEach(r),this.nodes().forEach(r),o&&this.recalculateRenderedStyle(n),this.updateCompoundBounds(!n);for(var f=0;f<i.length;f++){var c=i[f];r(c)&&c.dirtyBoundingBoxCache(),Zs(t,qj(c,a))}}return t.x1=Da(t.x1),t.y1=Da(t.y1),t.x2=Da(t.x2),t.y2=Da(t.y2),t.w=Da(t.x2-t.x1),t.h=Da(t.y2-t.y1),t};Ml.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Ml.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),a=n.collection();if(r&&(a=t.filter(function(c){return c.isParent()}),t=t.not(a)),Mt(e)){var i=e;e=function(){return i}}var l=function(h,p){return h._private.bbAtOldPos=e(h,p)},o=function(h){return h._private.bbAtOldPos};n.startBatch(),t.forEach(l).silentPositions(e),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var f=xQ(this.boundingBox({useCache:!1}));return t.silentPositions(o),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),f};Ku.boundingbox=Ku.bb=Ku.boundingBox;Ku.renderedBoundingbox=Ku.renderedBoundingBox;var FZ=Ml,Yf,Yd;Yf=Yd={};var yL=function(t){t.uppercaseName=iT(t.name),t.autoName="auto"+t.uppercaseName,t.labelName="label"+t.uppercaseName,t.outerName="outer"+t.uppercaseName,t.uppercaseOuterName=iT(t.outerName),Yf[t.name]=function(){var r=this[0],a=r._private,i=a.cy,l=i._private.styleEnabled;if(r)if(l){if(r.isParent())return r.updateCompoundBounds(),a[t.autoName]||0;var o=r.pstyle(t.name);switch(o.strValue){case"label":return r.recalculateRenderedStyle(),a.rstyle[t.labelName]||0;default:return o.pfValue}}else return 1},Yf["outer"+t.uppercaseName]=function(){var r=this[0],a=r._private,i=a.cy,l=i._private.styleEnabled;if(r)if(l){var o=r[t.name](),f=r.pstyle("border-position").value,c;f==="center"?c=r.pstyle("border-width").pfValue:f==="outside"?c=2*r.pstyle("border-width").pfValue:c=0;var h=2*r.padding();return o+c+h}else return 1},Yf["rendered"+t.uppercaseName]=function(){var r=this[0];if(r){var a=r[t.name]();return a*this.cy().zoom()}},Yf["rendered"+t.uppercaseOuterName]=function(){var r=this[0];if(r){var a=r[t.outerName]();return a*this.cy().zoom()}}};yL({name:"width"});yL({name:"height"});Yd.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),t.autoPadding!==void 0?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue};Yd.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()};Yd.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var UZ=Yd,qZ=function(t,n){if(t.isEdge()&&t.takesUpSpace())return n(t)},VZ=function(t,n){if(t.isEdge()&&t.takesUpSpace()){var r=t.cy();return wm(n(t),r.zoom(),r.pan())}},HZ=function(t,n){if(t.isEdge()&&t.takesUpSpace()){var r=t.cy(),a=r.pan(),i=r.zoom();return n(t).map(function(l){return wm(l,i,a)})}},GZ=function(t){return t.renderer().getControlPoints(t)},$Z=function(t){return t.renderer().getSegmentPoints(t)},KZ=function(t){return t.renderer().getSourceEndpoint(t)},YZ=function(t){return t.renderer().getTargetEndpoint(t)},XZ=function(t){return t.renderer().getEdgeMidpoint(t)},Gj={controlPoints:{get:GZ,mult:!0},segmentPoints:{get:$Z,mult:!0},sourceEndpoint:{get:KZ},targetEndpoint:{get:YZ},midpoint:{get:XZ}},QZ=function(t){return"rendered"+t[0].toUpperCase()+t.substr(1)},WZ=Object.keys(Gj).reduce(function(e,t){var n=Gj[t],r=QZ(t);return e[t]=function(){return qZ(this,n.get)},n.mult?e[r]=function(){return HZ(this,n.get)}:e[r]=function(){return VZ(this,n.get)},e},{}),ZZ=at({},BZ,FZ,UZ,WZ);/*!
|
|
510
|
+
Event object based on jQuery events, MIT license
|
|
511
|
+
|
|
512
|
+
https://jquery.org/license/
|
|
513
|
+
https://tldrlegal.com/license/mit-license
|
|
514
|
+
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
515
|
+
*/var xL=function(t,n){this.recycle(t,n)};function Pf(){return!1}function Ov(){return!0}xL.prototype={instanceString:function(){return"event"},recycle:function(t,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Pf,t!=null&&t.preventDefault?(this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?Ov:Pf):t!=null&&t.type?n=t:this.type=t,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:r.x*a+i.x,y:r.y*a+i.y}}this.timeStamp=t&&t.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Ov;var t=this.originalEvent;t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ov;var t=this.originalEvent;t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ov,this.stopPropagation()},isDefaultPrevented:Pf,isPropagationStopped:Pf,isImmediatePropagationStopped:Pf};var bL=/^([^.]+)(\.(?:[^.]+))?$/,JZ=".*",wL={qualifierCompare:function(t,n){return t===n},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(t){return t},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},$j=Object.keys(wL),eJ={};function jm(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:eJ,t=arguments.length>1?arguments[1]:void 0,n=0;n<$j.length;n++){var r=$j[n];this[r]=e[r]||wL[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Nl=jm.prototype,SL=function(t,n,r,a,i,l,o){gn(a)&&(i=a,a=null),o&&(l==null?l=o:l=at({},l,o));for(var f=Wt(r)?r:r.split(/\s+/),c=0;c<f.length;c++){var h=f[c];if(!bl(h)){var p=h.match(bL);if(p){var m=p[1],y=p[2]?p[2]:null,x=n(t,h,m,y,a,i,l);if(x===!1)break}}}},Kj=function(t,n){return t.addEventFields(t.context,n),new xL(n.type,n)},tJ=function(t,n,r){if(lX(r)){n(t,r);return}else if(Mt(r)){n(t,Kj(t,r));return}for(var a=Wt(r)?r:r.split(/\s+/),i=0;i<a.length;i++){var l=a[i];if(!bl(l)){var o=l.match(bL);if(o){var f=o[1],c=o[2]?o[2]:null,h=Kj(t,{type:f,namespace:c,target:t.context});n(t,h)}}}};Nl.on=Nl.addListener=function(e,t,n,r,a){return SL(this,function(i,l,o,f,c,h,p){gn(h)&&i.listeners.push({event:l,callback:h,type:o,namespace:f,qualifier:c,conf:p})},e,t,n,r,a),this};Nl.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})};Nl.removeListener=Nl.off=function(e,t,n,r){var a=this;this.emitting!==0&&(this.listeners=VX(this.listeners));for(var i=this.listeners,l=function(c){var h=i[c];SL(a,function(p,m,y,x,b,w){if((h.type===y||e==="*")&&(!x&&h.namespace!==".*"||h.namespace===x)&&(!b||p.qualifierCompare(h.qualifier,b))&&(!w||h.callback===w))return i.splice(c,1),!1},e,t,n,r)},o=i.length-1;o>=0;o--)l(o);return this};Nl.removeAllListeners=function(){return this.removeListener("*")};Nl.emit=Nl.trigger=function(e,t,n){var r=this.listeners,a=r.length;return this.emitting++,Wt(t)||(t=[t]),tJ(this,function(i,l){n!=null&&(r=[{event:l.event,type:l.type,namespace:l.namespace,callback:n}],a=r.length);for(var o=function(){var h=r[f];if(h.type===l.type&&(!h.namespace||h.namespace===l.namespace||h.namespace===JZ)&&i.eventMatches(i.context,h,l)){var p=[l];t!=null&&GX(p,t),i.beforeEmit(i.context,h,l),h.conf&&h.conf.one&&(i.listeners=i.listeners.filter(function(x){return x!==h}));var m=i.callbackContext(i.context,h,l),y=h.callback.apply(m,p);i.afterEmit(i.context,h,l),y===!1&&(l.stopPropagation(),l.preventDefault())}},f=0;f<a;f++)o();i.bubble(i.context)&&!l.isPropagationStopped()&&i.parent(i.context).emit(l,t)},e),this.emitting--,this};var nJ={qualifierCompare:function(t,n){return t==null||n==null?t==null&&n==null:t.sameText(n)},eventMatches:function(t,n,r){var a=n.qualifier;return a!=null?t!==r.target&&qd(r.target)&&a.matches(r.target):!0},addEventFields:function(t,n){n.cy=t.cy(),n.target=t},callbackContext:function(t,n,r){return n.qualifier!=null?r.target:t},beforeEmit:function(t,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(t){return t.isChild()?t.parent():t.cy()}},Lv=function(t){return tt(t)?new El(t):t},EL={createEmitter:function(){for(var t=0;t<this.length;t++){var n=this[t],r=n._private;r.emitter||(r.emitter=new jm(nJ,n))}return this},emitter:function(){return this._private.emitter},on:function(t,n,r){for(var a=Lv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().on(t,a,r)}return this},removeListener:function(t,n,r){for(var a=Lv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().removeListener(t,a,r)}return this},removeAllListeners:function(){for(var t=0;t<this.length;t++){var n=this[t];n.emitter().removeAllListeners()}return this},one:function(t,n,r){for(var a=Lv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().one(t,a,r)}return this},once:function(t,n,r){for(var a=Lv(n),i=0;i<this.length;i++){var l=this[i];l.emitter().on(t,a,r,{once:!0,onceCollection:this})}},emit:function(t,n){for(var r=0;r<this.length;r++){var a=this[r];a.emitter().emit(t,n)}return this},emitAndNotify:function(t,n){if(this.length!==0)return this.cy().notify(t,this),this.emit(t,n),this}};Bt.eventAliasesOn(EL);var CL={nodes:function(t){return this.filter(function(n){return n.isNode()}).filter(t)},edges:function(t){return this.filter(function(n){return n.isEdge()}).filter(t)},byGroup:function(){for(var t=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var a=this[r];a.isNode()?t.push(a):n.push(a)}return{nodes:t,edges:n}},filter:function(t,n){if(t===void 0)return this;if(tt(t)||fa(t))return new El(t).filter(this);if(gn(t)){for(var r=this.spawn(),a=this,i=0;i<a.length;i++){var l=a[i],o=n?t.apply(n,[l,i,a]):t(l,i,a);o&&r.push(l)}return r}return this.spawn()},not:function(t){if(t){tt(t)&&(t=this.filter(t));for(var n=this.spawn(),r=0;r<this.length;r++){var a=this[r],i=t.has(a);i||n.push(a)}return n}else return this},absoluteComplement:function(){var t=this.cy();return t.mutableElements().not(this)},intersect:function(t){if(tt(t)){var n=t;return this.filter(n)}for(var r=this.spawn(),a=this,i=t,l=this.length<t.length,o=l?a:i,f=l?i:a,c=0;c<o.length;c++){var h=o[c];f.has(h)&&r.push(h)}return r},xor:function(t){var n=this._private.cy;tt(t)&&(t=n.$(t));var r=this.spawn(),a=this,i=t,l=function(f,c){for(var h=0;h<f.length;h++){var p=f[h],m=p._private.data.id,y=c.hasElementWithId(m);y||r.push(p)}};return l(a,i),l(i,a),r},diff:function(t){var n=this._private.cy;tt(t)&&(t=n.$(t));var r=this.spawn(),a=this.spawn(),i=this.spawn(),l=this,o=t,f=function(h,p,m){for(var y=0;y<h.length;y++){var x=h[y],b=x._private.data.id,w=p.hasElementWithId(b);w?i.merge(x):m.push(x)}};return f(l,o,r),f(o,l,a),{left:r,right:a,both:i}},add:function(t){var n=this._private.cy;if(!t)return this;if(tt(t)){var r=t;t=n.mutableElements().filter(r)}for(var a=this.spawnSelf(),i=0;i<t.length;i++){var l=t[i],o=!this.has(l);o&&a.push(l)}return a},merge:function(t){var n=this._private,r=n.cy;if(!t)return this;if(t&&tt(t)){var a=t;t=r.mutableElements().filter(a)}for(var i=n.map,l=0;l<t.length;l++){var o=t[l],f=o._private.data.id,c=!i.has(f);if(c){var h=this.length++;this[h]=o,i.set(f,{ele:o,index:h})}}return this},unmergeAt:function(t){var n=this[t],r=n.id(),a=this._private,i=a.map;this[t]=void 0,i.delete(r);var l=t===this.length-1;if(this.length>1&&!l){var o=this.length-1,f=this[o],c=f._private.data.id;this[o]=void 0,this[t]=f,i.set(c,{ele:f,index:t})}return this.length--,this},unmergeOne:function(t){t=t[0];var n=this._private,r=t._private.data.id,a=n.map,i=a.get(r);if(!i)return this;var l=i.index;return this.unmergeAt(l),this},unmerge:function(t){var n=this._private.cy;if(!t)return this;if(t&&tt(t)){var r=t;t=n.mutableElements().filter(r)}for(var a=0;a<t.length;a++)this.unmergeOne(t[a]);return this},unmergeBy:function(t){for(var n=this.length-1;n>=0;n--){var r=this[n];t(r)&&this.unmergeAt(n)}return this},map:function(t,n){for(var r=[],a=this,i=0;i<a.length;i++){var l=a[i],o=n?t.apply(n,[l,i,a]):t(l,i,a);r.push(o)}return r},reduce:function(t,n){for(var r=n,a=this,i=0;i<a.length;i++)r=t(r,a[i],i,a);return r},max:function(t,n){for(var r=-1/0,a,i=this,l=0;l<i.length;l++){var o=i[l],f=n?t.apply(n,[o,l,i]):t(o,l,i);f>r&&(r=f,a=o)}return{value:r,ele:a}},min:function(t,n){for(var r=1/0,a,i=this,l=0;l<i.length;l++){var o=i[l],f=n?t.apply(n,[o,l,i]):t(o,l,i);f<r&&(r=f,a=o)}return{value:r,ele:a}}},Lt=CL;Lt.u=Lt["|"]=Lt["+"]=Lt.union=Lt.or=Lt.add;Lt["\\"]=Lt["!"]=Lt["-"]=Lt.difference=Lt.relativeComplement=Lt.subtract=Lt.not;Lt.n=Lt["&"]=Lt["."]=Lt.and=Lt.intersection=Lt.intersect;Lt["^"]=Lt["(+)"]=Lt["(-)"]=Lt.symmetricDifference=Lt.symdiff=Lt.xor;Lt.fnFilter=Lt.filterFn=Lt.stdFilter=Lt.filter;Lt.complement=Lt.abscomp=Lt.absoluteComplement;var rJ={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var t=this[0];if(t)return t._private.group}},NL=function(t,n){var r=t.cy(),a=r.hasCompoundNodes();function i(h){var p=h.pstyle("z-compound-depth");return p.value==="auto"?a?h.zDepth():0:p.value==="bottom"?-1:p.value==="top"?Fw:0}var l=i(t)-i(n);if(l!==0)return l;function o(h){var p=h.pstyle("z-index-compare");return p.value==="auto"&&h.isNode()?1:0}var f=o(t)-o(n);if(f!==0)return f;var c=t.pstyle("z-index").value-n.pstyle("z-index").value;return c!==0?c:t.poolIndex()-n.poolIndex()},Lp={forEach:function(t,n){if(gn(t))for(var r=this.length,a=0;a<r;a++){var i=this[a],l=n?t.apply(n,[i,a,this]):t(i,a,this);if(l===!1)break}return this},toArray:function(){for(var t=[],n=0;n<this.length;n++)t.push(this[n]);return t},slice:function(t,n){var r=[],a=this.length;n==null&&(n=a),t==null&&(t=0),t<0&&(t=a+t),n<0&&(n=a+n);for(var i=t;i>=0&&i<n&&i<a;i++)r.push(this[i]);return this.spawn(r)},size:function(){return this.length},eq:function(t){return this[t]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(t){if(!gn(t))return this;var n=this.toArray().sort(t);return this.spawn(n)},sortByZIndex:function(){return this.sort(NL)},zDepth:function(){var t=this[0];if(t){var n=t._private,r=n.group;if(r==="nodes"){var a=n.data.parent?t.parents().size():0;return t.isParent()?a:Fw-1}else{var i=n.source,l=n.target,o=i.zDepth(),f=l.zDepth();return Math.max(o,f,0)}}}};Lp.each=Lp.forEach;var aJ=function(){var t="undefined",n=(typeof Symbol>"u"?"undefined":Gn(Symbol))!=t&&Gn(Symbol.iterator)!=t;n&&(Lp[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},i=0,l=this.length;return EO({next:function(){return i<l?a.value=r[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};aJ();var iJ=dr({nodeDimensionsIncludeLabels:!1}),ap={layoutDimensions:function(t){t=iJ(t);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(t.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(t,n,r){var a=this.nodes().filter(function(R){return!R.isParent()}),i=this.cy(),l=n.eles,o=function(A){return A.id()},f=oc(r,o);t.emit({type:"layoutstart",layout:t}),t.animations=[];var c=function(A,D,_){var L={x:D.x1+D.w/2,y:D.y1+D.h/2},M={x:(_.x-L.x)*A,y:(_.y-L.y)*A};return{x:L.x+M.x,y:L.y+M.y}},h=n.spacingFactor&&n.spacingFactor!==1,p=function(){if(!h)return null;for(var A=Dr(),D=0;D<a.length;D++){var _=a[D],L=f(_,D);VO(A,L.x,L.y)}return A},m=p(),y=oc(function(R,A){var D=f(R,A);if(h){var _=Math.abs(n.spacingFactor);D=c(_,m,D)}return n.transform!=null&&(D=n.transform(R,D)),D},o);if(n.animate){for(var x=0;x<a.length;x++){var b=a[x],w=y(b,x),S=n.animateFilter==null||n.animateFilter(b,x);if(S){var N=b.animation({position:w,duration:n.animationDuration,easing:n.animationEasing});t.animations.push(N)}else b.position(w)}if(n.fit){var E=i.animation({fit:{boundingBox:l.boundingBoxAt(y),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});t.animations.push(E)}else if(n.zoom!==void 0&&n.pan!==void 0){var T=i.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});t.animations.push(T)}t.animations.forEach(function(R){return R.play()}),t.one("layoutready",n.ready),t.emit({type:"layoutready",layout:t}),jc.all(t.animations.map(function(R){return R.promise()})).then(function(){t.one("layoutstop",n.stop),t.emit({type:"layoutstop",layout:t})})}else a.positions(y),n.fit&&i.fit(n.eles,n.padding),n.zoom!=null&&i.zoom(n.zoom),n.pan&&i.pan(n.pan),t.one("layoutready",n.ready),t.emit({type:"layoutready",layout:t}),t.one("layoutstop",n.stop),t.emit({type:"layoutstop",layout:t});return this},layout:function(t){var n=this.cy();return n.makeLayout(at({},t,{eles:this}))}};ap.createLayout=ap.makeLayout=ap.layout;function kL(e,t,n){var r=n._private,a=r.styleCache=r.styleCache||[],i;return(i=a[e])!=null||(i=a[e]=t(n)),i}function Am(e,t){return e=jo(e),function(r){return kL(e,t,r)}}function Rm(e,t){e=jo(e);var n=function(a){return t.call(a)};return function(){var a=this[0];if(a)return kL(e,n,a)}}var ur={recalculateRenderedStyle:function(t){var n=this.cy(),r=n.renderer(),a=n.styleEnabled();return r&&a&&r.recalculateRenderedStyle(this,t),this},dirtyStyleCache:function(){var t=this.cy(),n=function(i){return i._private.styleCache=null};if(t.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(a){n(a),a.connectedEdges().forEach(n)});return this},updateStyle:function(t){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var a=n.hasCompoundNodes(),i=this;t=!!(t||t===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var l=i;return t?l.emitAndNotify("style"):l.emit("style"),i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var t=this.cy();if(t.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,t.style().apply(r))}},parsedStyle:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],a=r.cy();if(a.styleEnabled()&&r){r._private.styleDirty&&(r._private.styleDirty=!1,a.style().apply(r));var i=r._private.style[t];return i??(n?a.style().getDefaultProperty(t):null)}},numericStyle:function(t){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(t);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(t){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(t).units},renderedStyle:function(t){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,t)},style:function(t,n){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,i=r.style();if(Mt(t)){var l=t;i.applyBypass(this,l,a),this.emitAndNotify("style")}else if(tt(t))if(n===void 0){var o=this[0];return o?i.getStylePropertyValue(o,t):void 0}else i.applyBypass(this,t,n,a),this.emitAndNotify("style");else if(t===void 0){var f=this[0];return f?i.getRawStyle(f):void 0}return this},removeStyle:function(t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,a=n.style(),i=this;if(t===void 0)for(var l=0;l<i.length;l++){var o=i[l];a.removeAllBypasses(o,r)}else{t=t.split(/\s+/);for(var f=0;f<i.length;f++){var c=i[f];a.removeBypasses(c,t,r)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var t=this.cy();if(!t.styleEnabled())return 1;var n=t.hasCompoundNodes(),r=this[0];if(r){var a=r._private,i=r.pstyle("opacity").value;if(!n)return i;var l=a.data.parent?r.parents():null;if(l)for(var o=0;o<l.length;o++){var f=l[o],c=f.pstyle("opacity").value;i=c*i}return i}},transparent:function(){var t=this.cy();if(!t.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var t=this.cy();if(!t.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function Q0(e,t){var n=e._private,r=n.data.parent?e.parents():null;if(r)for(var a=0;a<r.length;a++){var i=r[a];if(!t(i))return!1}return!0}function Zw(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],l=a.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!l||Q0(i,r);var f=o.source,c=o.target;return n(f)&&(!l||Q0(f,n))&&(f===c||n(c)&&(!l||Q0(c,n)))}}}var Ac=Am("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});ur.takesUpSpace=Rm("takesUpSpace",Zw({ok:Ac}));var sJ=Am("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&Ac(e)}),lJ=Am("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&Ac(e)});ur.interactive=Rm("interactive",Zw({ok:sJ,parentOk:lJ,edgeOkViaNode:Ac}));ur.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var oJ=Am("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&Ac(e)}),uJ=Ac;ur.visible=Rm("visible",Zw({ok:oJ,edgeOkViaNode:uJ}));ur.hidden=function(){var e=this[0];if(e)return!e.visible()};ur.isBundledBezier=Rm("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});ur.bypass=ur.css=ur.style;ur.renderedCss=ur.renderedStyle;ur.removeBypass=ur.removeCss=ur.removeStyle;ur.pstyle=ur.parsedStyle;var ml={};function Yj(e){return function(){var t=arguments,n=[];if(t.length===2){var r=t[0],a=t[1];this.on(e.event,r,a)}else if(t.length===1&&gn(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&Wt(t[0])){for(var l=t.length===1?t[0]:null,o=0;o<this.length;o++){var f=this[o],c=!e.ableField||f._private[e.ableField],h=f._private[e.field]!=e.value;if(e.overrideAble){var p=e.overrideAble(f);if(p!==void 0&&(c=p,!p))return this}c&&(f._private[e.field]=e.value,h&&n.push(f))}var m=this.spawn(n);m.updateStyle(),m.emit(e.event),l&&m.emit(l)}return this}}function Rc(e){ml[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},ml[e.on]=Yj({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),ml[e.off]=Yj({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}Rc({field:"locked",overrideField:function(t){return t.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Rc({field:"grabbable",overrideField:function(t){return t.cy().autoungrabify()||t.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Rc({field:"selected",ableField:"selectable",overrideAble:function(t){return t.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Rc({field:"selectable",overrideField:function(t){return t.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});ml.deselect=ml.unselect;ml.grabbed=function(){var e=this[0];if(e)return e._private.grabbed};Rc({field:"active",on:"activate",off:"unactivate"});Rc({field:"pannable",on:"panify",off:"unpanify"});ml.inactive=function(){var e=this[0];if(e)return!e._private.active};var br={},Xj=function(t){return function(r){for(var a=this,i=[],l=0;l<a.length;l++){var o=a[l];if(o.isNode()){for(var f=!1,c=o.connectedEdges(),h=0;h<c.length;h++){var p=c[h],m=p.source(),y=p.target();if(t.noIncomingEdges&&y===o&&m!==o||t.noOutgoingEdges&&m===o&&y!==o){f=!0;break}}f||i.push(o)}}return this.spawn(i,!0).filter(r)}},Qj=function(t){return function(n){for(var r=this,a=[],i=0;i<r.length;i++){var l=r[i];if(l.isNode())for(var o=l.connectedEdges(),f=0;f<o.length;f++){var c=o[f],h=c.source(),p=c.target();t.outgoing&&h===l?(a.push(c),a.push(p)):t.incoming&&p===l&&(a.push(c),a.push(h))}}return this.spawn(a,!0).filter(n)}},Wj=function(t){return function(n){for(var r=this,a=[],i={};;){var l=t.outgoing?r.outgoers():r.incomers();if(l.length===0)break;for(var o=!1,f=0;f<l.length;f++){var c=l[f],h=c.id();i[h]||(i[h]=!0,a.push(c),o=!0)}if(!o)break;r=l}return this.spawn(a,!0).filter(n)}};br.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null};at(br,{roots:Xj({noIncomingEdges:!0}),leaves:Xj({noOutgoingEdges:!0}),outgoers:_a(Qj({outgoing:!0}),"outgoers"),successors:Wj({outgoing:!0}),incomers:_a(Qj({incoming:!0}),"incomers"),predecessors:Wj({})});at(br,{neighborhood:_a(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var a=n[r],i=a.connectedEdges(),l=0;l<i.length;l++){var o=i[l],f=o.source(),c=o.target(),h=a===f?c:f;h.length>0&&t.push(h[0]),t.push(o[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(t){return this.neighborhood().add(this).filter(t)},openNeighborhood:function(t){return this.neighborhood(t)}});br.neighbourhood=br.neighborhood;br.closedNeighbourhood=br.closedNeighborhood;br.openNeighbourhood=br.openNeighborhood;at(br,{source:_a(function(t){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&t?r.filter(t):r},"source"),target:_a(function(t){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&t?r.filter(t):r},"target"),sources:Zj({attr:"source"}),targets:Zj({attr:"target"})});function Zj(e){return function(n){for(var r=[],a=0;a<this.length;a++){var i=this[a],l=i._private[e.attr];l&&r.push(l)}return this.spawn(r,!0).filter(n)}}at(br,{edgesWith:_a(Jj(),"edgesWith"),edgesTo:_a(Jj({thisIsSrc:!0}),"edgesTo")});function Jj(e){return function(n){var r=[],a=this._private.cy,i=e||{};tt(n)&&(n=a.$(n));for(var l=0;l<n.length;l++)for(var o=n[l]._private.edges,f=0;f<o.length;f++){var c=o[f],h=c._private.data,p=this.hasElementWithId(h.source)&&n.hasElementWithId(h.target),m=n.hasElementWithId(h.source)&&this.hasElementWithId(h.target),y=p||m;y&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!p||i.thisIsTgt&&!m)||r.push(c))}return this.spawn(r,!0)}}at(br,{connectedEdges:_a(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var a=n[r];if(a.isNode())for(var i=a._private.edges,l=0;l<i.length;l++){var o=i[l];t.push(o)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:_a(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var a=n[r];a.isEdge()&&(t.push(a.source()[0]),t.push(a.target()[0]))}return this.spawn(t,!0).filter(e)},"connectedNodes"),parallelEdges:_a(eA(),"parallelEdges"),codirectedEdges:_a(eA({codirected:!0}),"codirectedEdges")});function eA(e){var t={codirected:!1};return e=at({},t,e),function(r){for(var a=[],i=this.edges(),l=e,o=0;o<i.length;o++)for(var f=i[o],c=f._private,h=c.source,p=h._private.data.id,m=c.data.target,y=h._private.edges,x=0;x<y.length;x++){var b=y[x],w=b._private.data,S=w.target,N=w.source,E=S===m&&N===p,T=p===S&&m===N;(l.codirected&&E||!l.codirected&&(E||T))&&a.push(b)}return this.spawn(a,!0).filter(r)}}at(br,{components:function(t){var n=this,r=n.cy(),a=r.collection(),i=t==null?n.nodes():t.nodes(),l=[];t!=null&&i.empty()&&(i=t.sources());var o=function(h,p){a.merge(h),i.unmerge(h),p.merge(h)};if(i.empty())return n.spawn();var f=function(){var h=r.collection();l.push(h);var p=i[0];o(p,h),n.bfs({directed:!1,roots:p,visit:function(y){return o(y,h)}}),h.forEach(function(m){m.connectedEdges().forEach(function(y){n.has(y)&&h.has(y.source())&&h.has(y.target())&&h.merge(y)})})};do f();while(i.length>0);return l},component:function(){var t=this[0];return t.cy().mutableElements().components(t)[0]}});br.componentsOf=br.components;var cr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t===void 0){dn("A collection must have a reference to the core");return}var i=new ts,l=!1;if(!n)n=[];else if(n.length>0&&Mt(n[0])&&!qd(n[0])){l=!0;for(var o=[],f=new Tc,c=0,h=n.length;c<h;c++){var p=n[c];p.data==null&&(p.data={});var m=p.data;if(m.id==null)m.id=FO();else if(t.hasElementWithId(m.id)||f.has(m.id))continue;var y=new bm(t,p,!1);o.push(y),f.add(m.id)}n=o}this.length=0;for(var x=0,b=n.length;x<b;x++){var w=n[x][0];if(w!=null){var S=w._private.data.id;(!r||!i.has(S))&&(r&&i.set(S,{index:this.length,ele:w}),this[this.length]=w,this.length++)}}this._private={eles:this,cy:t,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(N){this.lazyMap=N},rebuildMap:function(){for(var E=this.lazyMap=new ts,T=this.eles,R=0;R<T.length;R++){var A=T[R];E.set(A.id(),{index:R,ele:A})}}},r&&(this._private.map=i),l&&!a&&this.restore()},rn=bm.prototype=cr.prototype=Object.create(Array.prototype);rn.instanceString=function(){return"collection"};rn.spawn=function(e,t){return new cr(this.cy(),e,t)};rn.spawnSelf=function(){return this.spawn(this)};rn.cy=function(){return this._private.cy};rn.renderer=function(){return this._private.cy.renderer()};rn.element=function(){return this[0]};rn.collection=function(){return kO(this)?this:new cr(this._private.cy,[this])};rn.unique=function(){return new cr(this._private.cy,this,!0)};rn.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)};rn.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new cr(t)};rn.$id=rn.getElementById;rn.poolIndex=function(){var e=this._private.cy,t=e._private.elements,n=this[0]._private.data.id;return t._private.map.get(n).index};rn.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index};rn.indexOfId=function(e){return e=""+e,this._private.map.get(e).index};rn.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(Mt(e)){if(n.startBatch(),e.data){t.data(e.data);var a=r.data;if(t.isEdge()){var i=!1,l={},o=e.data.source,f=e.data.target;o!=null&&o!=a.source&&(l.source=""+o,i=!0),f!=null&&f!=a.target&&(l.target=""+f,i=!0),i&&(t=t.move(l))}else{var c="parent"in e.data,h=e.data.parent;c&&(h!=null||a.parent!=null)&&h!=a.parent&&(h===void 0&&(h=null),h!=null&&(h=""+h),t=t.move({parent:h}))}}e.position&&t.position(e.position);var p=function(b,w,S){var N=e[b];N!=null&&N!==r[b]&&(N?t[w]():t[S]())};return p("removed","remove","restore"),p("selected","select","unselect"),p("selectable","selectify","unselectify"),p("locked","lock","unlock"),p("grabbable","grabify","ungrabify"),p("pannable","panify","unpanify"),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}else if(e===void 0){var m={data:mi(r.data),position:mi(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};m.classes="";var y=0;return r.classes.forEach(function(x){return m.classes+=y++===0?x:" "+x}),m}}};rn.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t],r=n.json();e.push(r)}return e};rn.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n],a=r.json(),i=new bm(e,a,!1);t.push(i)}return new cr(e,t)};rn.copy=rn.clone;rn.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),a=r._private,i=[],l=[],o,f=0,c=n.length;f<c;f++){var h=n[f];t&&!h.removed()||(h.isNode()?i.push(h):l.push(h))}o=i.concat(l);var p,m=function(){o.splice(p,1),p--};for(p=0;p<o.length;p++){var y=o[p],x=y._private,b=x.data;if(y.clearTraversalCache(),!(!t&&!x.removed)){if(b.id===void 0)b.id=FO();else if(Re(b.id))b.id=""+b.id;else if(bl(b.id)||!tt(b.id)){dn("Can not create element with invalid string ID `"+b.id+"`"),m();continue}else if(r.hasElementWithId(b.id)){dn("Can not create second element with ID `"+b.id+"`"),m();continue}}var w=b.id;if(y.isNode()){var S=x.position;S.x==null&&(S.x=0),S.y==null&&(S.y=0)}if(y.isEdge()){for(var N=y,E=["source","target"],T=E.length,R=!1,A=0;A<T;A++){var D=E[A],_=b[D];Re(_)&&(_=b[D]=""+b[D]),_==null||_===""?(dn("Can not create edge `"+w+"` with unspecified "+D),R=!0):r.hasElementWithId(_)||(dn("Can not create edge `"+w+"` with nonexistant "+D+" `"+_+"`"),R=!0)}if(R){m();continue}var L=r.getElementById(b.source),M=r.getElementById(b.target);L.same(M)?L._private.edges.push(N):(L._private.edges.push(N),M._private.edges.push(N)),N._private.source=L,N._private.target=M}x.map=new ts,x.map.set(w,{ele:y,index:0}),x.removed=!1,t&&r.addToPool(y)}for(var z=0;z<i.length;z++){var B=i[z],H=B._private.data;Re(H.parent)&&(H.parent=""+H.parent);var G=H.parent,U=G!=null;if(U||B._private.parent){var I=B._private.parent?r.collection().merge(B._private.parent):r.getElementById(G);if(I.empty())H.parent=void 0;else if(I[0].removed())zt("Node added with missing parent, reference to parent removed"),H.parent=void 0,B._private.parent=null;else{for(var V=!1,K=I;!K.empty();){if(B.same(K)){V=!0,H.parent=void 0;break}K=K.parent()}V||(I[0]._private.children.push(B),B._private.parent=I[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var Q=o.length===n.length?n:new cr(r,o),F=0;F<Q.length;F++){var q=Q[F];q.isNode()||(q.parallelEdges().clearTraversalCache(),q.source().clearTraversalCache(),q.target().clearTraversalCache())}var X;a.hasCompoundNodes?X=r.collection().merge(Q).merge(Q.connectedNodes()).merge(Q.parent()):X=Q,X.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?Q.emitAndNotify("add"):t&&Q.emit("add")}return n};rn.removed=function(){var e=this[0];return e&&e._private.removed};rn.inside=function(){var e=this[0];return e&&!e._private.removed};rn.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],a={},i=n._private.cy;function l(G){for(var U=G._private.edges,I=0;I<U.length;I++)f(U[I])}function o(G){for(var U=G._private.children,I=0;I<U.length;I++)f(U[I])}function f(G){var U=a[G.id()];t&&G.removed()||U||(a[G.id()]=!0,G.isNode()?(r.push(G),l(G),o(G)):r.unshift(G))}for(var c=0,h=n.length;c<h;c++){var p=n[c];f(p)}function m(G,U){var I=G._private.edges;wl(I,U),G.clearTraversalCache()}function y(G){G.clearTraversalCache()}var x=[];x.ids={};function b(G,U){U=U[0],G=G[0];var I=G._private.children,V=G.id();wl(I,U),U._private.parent=null,x.ids[V]||(x.ids[V]=!0,x.push(G))}n.dirtyCompoundBoundsCache(),t&&i.removeFromPool(r);for(var w=0;w<r.length;w++){var S=r[w];if(S.isEdge()){var N=S.source()[0],E=S.target()[0];m(N,S),m(E,S);for(var T=S.parallelEdges(),R=0;R<T.length;R++){var A=T[R];y(A),A.isBundledBezier()&&A.dirtyBoundingBoxCache()}}else{var D=S.parent();D.length!==0&&b(D,S)}t&&(S._private.removed=!0)}var _=i._private.elements;i._private.hasCompoundNodes=!1;for(var L=0;L<_.length;L++){var M=_[L];if(M.isParent()){i._private.hasCompoundNodes=!0;break}}var z=new cr(this.cy(),r);z.size()>0&&(e?z.emitAndNotify("remove"):t&&z.emit("remove"));for(var B=0;B<x.length;B++){var H=x[B];(!t||!H.removed())&&H.updateStyle()}return z};rn.move=function(e){var t=this._private.cy,n=this,r=!1,a=!1,i=function(x){return x==null?x:""+x};if(e.source!==void 0||e.target!==void 0){var l=i(e.source),o=i(e.target),f=l!=null&&t.hasElementWithId(l),c=o!=null&&t.hasElementWithId(o);(f||c)&&(t.batch(function(){n.remove(r,a),n.emitAndNotify("moveout");for(var y=0;y<n.length;y++){var x=n[y],b=x._private.data;x.isEdge()&&(f&&(b.source=l),c&&(b.target=o))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(e.parent!==void 0){var h=i(e.parent),p=h===null||t.hasElementWithId(h);if(p){var m=h===null?void 0:h;t.batch(function(){var y=n.remove(r,a);y.emitAndNotify("moveout");for(var x=0;x<n.length;x++){var b=n[x],w=b._private.data;b.isNode()&&(w.parent=m)}y.restore(r,a)}),n.emitAndNotify("move")}}return this};[ZO,bZ,rp,pl,cc,PZ,Tm,ZZ,EL,CL,rJ,Lp,ap,ur,ml,br].forEach(function(e){at(rn,e)});var cJ={add:function(t){var n,r=this;if(fa(t)){var a=t;if(a._private.cy===r)n=a.restore();else{for(var i=[],l=0;l<a.length;l++){var o=a[l];i.push(o.json())}n=new cr(r,i)}}else if(Wt(t)){var f=t;n=new cr(r,f)}else if(Mt(t)&&(Wt(t.nodes)||Wt(t.edges))){for(var c=t,h=[],p=["nodes","edges"],m=0,y=p.length;m<y;m++){var x=p[m],b=c[x];if(Wt(b))for(var w=0,S=b.length;w<S;w++){var N=at({group:x},b[w]);h.push(N)}}n=new cr(r,h)}else{var E=t;n=new bm(r,E).collection()}return n},remove:function(t){if(!fa(t)){if(tt(t)){var n=t;t=this.$(n)}}return t.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function fJ(e,t,n,r){var a=4,i=.001,l=1e-7,o=10,f=11,c=1/(f-1),h=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var p=0;p<4;++p)if(typeof arguments[p]!="number"||isNaN(arguments[p])||!isFinite(arguments[p]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var m=h?new Float32Array(f):new Array(f);function y(M,z){return 1-3*z+3*M}function x(M,z){return 3*z-6*M}function b(M){return 3*M}function w(M,z,B){return((y(z,B)*M+x(z,B))*M+b(z))*M}function S(M,z,B){return 3*y(z,B)*M*M+2*x(z,B)*M+b(z)}function N(M,z){for(var B=0;B<a;++B){var H=S(z,e,n);if(H===0)return z;var G=w(z,e,n)-M;z-=G/H}return z}function E(){for(var M=0;M<f;++M)m[M]=w(M*c,e,n)}function T(M,z,B){var H,G,U=0;do G=z+(B-z)/2,H=w(G,e,n)-M,H>0?B=G:z=G;while(Math.abs(H)>l&&++U<o);return G}function R(M){for(var z=0,B=1,H=f-1;B!==H&&m[B]<=M;++B)z+=c;--B;var G=(M-m[B])/(m[B+1]-m[B]),U=z+G*c,I=S(U,e,n);return I>=i?N(M,U):I===0?U:T(M,z,z+c)}var A=!1;function D(){A=!0,(e!==t||n!==r)&&E()}var _=function(z){return A||D(),e===t&&n===r?z:z===0?0:z===1?1:w(R(z),t,r)};_.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var L="generateBezier("+[e,t,n,r]+")";return _.toString=function(){return L},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var dJ=(function(){function e(r){return-r.tension*r.x-r.friction*r.v}function t(r,a,i){var l={x:r.x+i.dx*a,v:r.v+i.dv*a,tension:r.tension,friction:r.friction};return{dx:l.v,dv:e(l)}}function n(r,a){var i={dx:r.v,dv:e(r)},l=t(r,a*.5,i),o=t(r,a*.5,l),f=t(r,a,o),c=1/6*(i.dx+2*(l.dx+o.dx)+f.dx),h=1/6*(i.dv+2*(l.dv+o.dv)+f.dv);return r.x=r.x+c*a,r.v=r.v+h*a,r}return function r(a,i,l){var o={x:-1,v:0,tension:null,friction:null},f=[0],c=0,h=1/1e4,p=16/1e3,m,y,x;for(a=parseFloat(a)||500,i=parseFloat(i)||20,l=l||null,o.tension=a,o.friction=i,m=l!==null,m?(c=r(a,i),y=c/l*p):y=p;x=n(x||o,y),f.push(1+x.x),c+=16,Math.abs(x.x)>h&&Math.abs(x.v)>h;);return m?function(b){return f[b*(f.length-1)|0]}:c}})(),en=function(t,n,r,a){var i=fJ(t,n,r,a);return function(l,o,f){return l+(o-l)*i(f)}},ip={linear:function(t,n,r){return t+(n-t)*r},ease:en(.25,.1,.25,1),"ease-in":en(.42,0,1,1),"ease-out":en(0,0,.58,1),"ease-in-out":en(.42,0,.58,1),"ease-in-sine":en(.47,0,.745,.715),"ease-out-sine":en(.39,.575,.565,1),"ease-in-out-sine":en(.445,.05,.55,.95),"ease-in-quad":en(.55,.085,.68,.53),"ease-out-quad":en(.25,.46,.45,.94),"ease-in-out-quad":en(.455,.03,.515,.955),"ease-in-cubic":en(.55,.055,.675,.19),"ease-out-cubic":en(.215,.61,.355,1),"ease-in-out-cubic":en(.645,.045,.355,1),"ease-in-quart":en(.895,.03,.685,.22),"ease-out-quart":en(.165,.84,.44,1),"ease-in-out-quart":en(.77,0,.175,1),"ease-in-quint":en(.755,.05,.855,.06),"ease-out-quint":en(.23,1,.32,1),"ease-in-out-quint":en(.86,0,.07,1),"ease-in-expo":en(.95,.05,.795,.035),"ease-out-expo":en(.19,1,.22,1),"ease-in-out-expo":en(1,0,0,1),"ease-in-circ":en(.6,.04,.98,.335),"ease-out-circ":en(.075,.82,.165,1),"ease-in-out-circ":en(.785,.135,.15,.86),spring:function(t,n,r){if(r===0)return ip.linear;var a=dJ(t,n,r);return function(i,l,o){return i+(l-i)*a(o)}},"cubic-bezier":en};function tA(e,t,n,r,a){if(r===1||t===n)return n;var i=a(t,n,r);return e==null||((e.roundValue||e.color)&&(i=Math.round(i)),e.min!==void 0&&(i=Math.max(i,e.min)),e.max!==void 0&&(i=Math.min(i,e.max))),i}function nA(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function ku(e,t,n,r,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var l=nA(e,a),o=nA(t,a);if(Re(l)&&Re(o))return tA(i,l,o,n,r);if(Wt(l)&&Wt(o)){for(var f=[],c=0;c<o.length;c++){var h=l[c],p=o[c];if(h!=null&&p!=null){var m=tA(i,h,p,n,r);f.push(m)}else f.push(p)}return f}}function hJ(e,t,n,r){var a=!r,i=e._private,l=t._private,o=l.easing,f=l.startTime,c=r?e:e.cy(),h=c.style();if(!l.easingImpl)if(o==null)l.easingImpl=ip.linear;else{var p;if(tt(o)){var m=h.parse("transition-timing-function",o);p=m.value}else p=o;var y,x;tt(p)?(y=p,x=[]):(y=p[1],x=p.slice(2).map(function(Q){return+Q})),x.length>0?(y==="spring"&&x.push(l.duration),l.easingImpl=ip[y].apply(null,x)):l.easingImpl=ip[y]}var b=l.easingImpl,w;if(l.duration===0?w=1:w=(n-f)/l.duration,l.applying&&(w=l.progress),w<0?w=0:w>1&&(w=1),l.delay==null){var S=l.startPosition,N=l.position;if(N&&a&&!e.locked()){var E={};Bf(S.x,N.x)&&(E.x=ku(S.x,N.x,w,b)),Bf(S.y,N.y)&&(E.y=ku(S.y,N.y,w,b)),e.position(E)}var T=l.startPan,R=l.pan,A=i.pan,D=R!=null&&r;D&&(Bf(T.x,R.x)&&(A.x=ku(T.x,R.x,w,b)),Bf(T.y,R.y)&&(A.y=ku(T.y,R.y,w,b)),e.emit("pan"));var _=l.startZoom,L=l.zoom,M=L!=null&&r;M&&(Bf(_,L)&&(i.zoom=hd(i.minZoom,ku(_,L,w,b),i.maxZoom)),e.emit("zoom")),(D||M)&&e.emit("viewport");var z=l.style;if(z&&z.length>0&&a){for(var B=0;B<z.length;B++){var H=z[B],G=H.name,U=H,I=l.startStyle[G],V=h.properties[I.name],K=ku(I,U,w,b,V);h.overrideBypass(e,G,K)}e.emit("style")}}return l.progress=w,w}function Bf(e,t){return e==null||t==null?!1:Re(e)&&Re(t)?!0:!!(e&&t)}function vJ(e,t,n,r){var a=t._private;a.started=!0,a.startTime=n-a.progress*a.duration}function rA(e,t){var n=t._private.aniEles,r=[];function a(h,p){var m=h._private,y=m.animation.current,x=m.animation.queue,b=!1;if(y.length===0){var w=x.shift();w&&y.push(w)}for(var S=function(A){for(var D=A.length-1;D>=0;D--){var _=A[D];_()}A.splice(0,A.length)},N=y.length-1;N>=0;N--){var E=y[N],T=E._private;if(T.stopped){y.splice(N,1),T.hooked=!1,T.playing=!1,T.started=!1,S(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||vJ(h,E,e),hJ(h,E,e,p),T.applying&&(T.applying=!1),S(T.frames),T.step!=null&&T.step(e),E.completed()&&(y.splice(N,1),T.hooked=!1,T.playing=!1,T.started=!1,S(T.completes)),b=!0)}return!p&&y.length===0&&x.length===0&&r.push(h),b}for(var i=!1,l=0;l<n.length;l++){var o=n[l],f=a(o);i=i||f}var c=a(t,!0);(i||c)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var pJ={animate:Bt.animate(),animation:Bt.animation(),animated:Bt.animated(),clearQueue:Bt.clearQueue(),delay:Bt.delay(),delayAnimation:Bt.delayAnimation(),stop:Bt.stop(),addToAnimationPool:function(t){var n=this;n.styleEnabled()&&n._private.aniEles.merge(t)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var t=this;if(t._private.animationsRunning=!0,!t.styleEnabled())return;function n(){t._private.animationsRunning&&Rp(function(i){rA(i,t),n()})}var r=t.renderer();r&&r.beforeRender?r.beforeRender(function(i,l){rA(l,t)},r.beforeRenderPriorities.animations):n()}},mJ={qualifierCompare:function(t,n){return t==null||n==null?t==null&&n==null:t.sameText(n)},eventMatches:function(t,n,r){var a=n.qualifier;return a!=null?t!==r.target&&qd(r.target)&&a.matches(r.target):!0},addEventFields:function(t,n){n.cy=t,n.target=t},callbackContext:function(t,n,r){return n.qualifier!=null?r.target:t}},Pv=function(t){return tt(t)?new El(t):t},TL={createEmitter:function(){var t=this._private;return t.emitter||(t.emitter=new jm(mJ,this)),this},emitter:function(){return this._private.emitter},on:function(t,n,r){return this.emitter().on(t,Pv(n),r),this},removeListener:function(t,n,r){return this.emitter().removeListener(t,Pv(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(t,n,r){return this.emitter().one(t,Pv(n),r),this},once:function(t,n,r){return this.emitter().one(t,Pv(n),r),this},emit:function(t,n){return this.emitter().emit(t,n),this},emitAndNotify:function(t,n){return this.emit(t),this.notify(t,n),this}};Bt.eventAliasesOn(TL);var f1={png:function(t){var n=this._private.renderer;return t=t||{},n.png(t)},jpg:function(t){var n=this._private.renderer;return t=t||{},t.bg=t.bg||"#fff",n.jpg(t)}};f1.jpeg=f1.jpg;var sp={layout:function(t){var n=this;if(t==null){dn("Layout options must be specified to make a layout");return}if(t.name==null){dn("A `name` must be specified to make a layout");return}var r=t.name,a=n.extension("layout",r);if(a==null){dn("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;tt(t.eles)?i=n.$(t.eles):i=t.eles!=null?t.eles:n.$();var l=new a(at({},t,{cy:n,eles:i}));return l}};sp.createLayout=sp.makeLayout=sp.layout;var gJ={notify:function(t,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var a=r.batchNotifications[t]=r.batchNotifications[t]||this.collection();n!=null&&a.merge(n);return}if(r.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(t,n)}},notifications:function(t){var n=this._private;return t===void 0?n.notificationsEnabled:(n.notificationsEnabled=!!t,this)},noNotifications:function(t){this.notifications(!1),t(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var t=this._private;return t.batchCount==null&&(t.batchCount=0),t.batchCount===0&&(t.batchStyleEles=this.collection(),t.batchNotifications={}),t.batchCount++,this},endBatch:function(){var t=this._private;if(t.batchCount===0)return this;if(t.batchCount--,t.batchCount===0){t.batchStyleEles.updateStyle();var n=this.renderer();Object.keys(t.batchNotifications).forEach(function(r){var a=t.batchNotifications[r];a.empty()?n.notify(r):n.notify(r,a)})}return this},batch:function(t){return this.startBatch(),t(),this.endBatch(),this},batchData:function(t){var n=this;return this.batch(function(){for(var r=Object.keys(t),a=0;a<r.length;a++){var i=r[a],l=t[i],o=n.getElementById(i);o.data(l)}})}},yJ=dr({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),d1={renderTo:function(t,n,r,a){var i=this._private.renderer;return i.renderTo(t,n,r,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(t){var n=this,r=n.extension("renderer",t.name);if(r==null){dn("Can not initialise: No such renderer `".concat(t.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}t.wheelSensitivity!==void 0&&zt("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=yJ(t);a.cy=n,n._private.renderer=new r(a),this.notify("init")},destroyRenderer:function(){var t=this;t.notify("destroy");var n=t.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);t._private.renderer=null,t.mutableElements().forEach(function(r){var a=r._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(t){return this.on("render",t)},offRender:function(t){return this.off("render",t)}};d1.invalidateDimensions=d1.resize;var lp={collection:function(t,n){return tt(t)?this.$(t):fa(t)?t.collection():Wt(t)?(n||(n={}),new cr(this,t,n.unique,n.removed)):new cr(this)},nodes:function(t){var n=this.$(function(r){return r.isNode()});return t?n.filter(t):n},edges:function(t){var n=this.$(function(r){return r.isEdge()});return t?n.filter(t):n},$:function(t){var n=this._private.elements;return t?n.filter(t):n.spawnSelf()},mutableElements:function(){return this._private.elements}};lp.elements=lp.filter=lp.$;var rr={},ed="t",xJ="f";rr.apply=function(e){for(var t=this,n=t._private,r=n.cy,a=r.collection(),i=0;i<e.length;i++){var l=e[i],o=t.getContextMeta(l);if(!o.empty){var f=t.getContextStyle(o),c=t.applyContextStyle(o,f,l);l._private.appliedInitStyle?t.updateTransitions(l,c.diffProps):l._private.appliedInitStyle=!0;var h=t.updateStyleHints(l);h&&a.push(l)}}return a};rr.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},a=e+"-"+t,i=r[a];if(i)return i;for(var l=[],o={},f=0;f<n.length;f++){var c=n[f],h=e[f]===ed,p=t[f]===ed,m=h!==p,y=c.mappedProperties.length>0;if(m||p&&y){var x=void 0;m&&y||m?x=c.properties:y&&(x=c.mappedProperties);for(var b=0;b<x.length;b++){for(var w=x[b],S=w.name,N=!1,E=f+1;E<n.length;E++){var T=n[E],R=t[E]===ed;if(R&&(N=T.properties[w.name]!=null,N))break}!o[S]&&!N&&(o[S]=!0,l.push(S))}}}return r[a]=l,l};rr.getContextMeta=function(e){for(var t=this,n="",r,a=e._private.styleCxtKey||"",i=0;i<t.length;i++){var l=t[i],o=l.selector&&l.selector.matches(e);o?n+=ed:n+=xJ}return r=t.getPropertiesDiff(a,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}};rr.getContextStyle=function(e){var t=e.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var a={_private:{key:t}},i=0;i<n.length;i++){var l=n[i],o=t[i]===ed;if(o)for(var f=0;f<l.properties.length;f++){var c=l.properties[f];a[c.name]=c}}return r[t]=a,a};rr.applyContextStyle=function(e,t,n){for(var r=this,a=e.diffPropNames,i={},l=r.types,o=0;o<a.length;o++){var f=a[o],c=t[f],h=n.pstyle(f);if(!c)if(h)h.bypass?c={name:f,deleteBypassed:!0}:c={name:f,delete:!0};else continue;if(h!==c){if(c.mapped===l.fn&&h!=null&&h.mapping!=null&&h.mapping.value===c.value){var p=h.mapping,m=p.fnValue=c.value(n);if(m===p.prevFnValue)continue}var y=i[f]={prev:h};r.applyParsedProperty(n,c),y.next=n.pstyle(f),y.next&&y.next.bypass&&(y.next=y.next.bypassed)}}return{diffProps:i}};rr.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(se,ge,Te){return n.getPropertiesHash(se,ge,Te)},l=t.styleKey;if(e.removed())return!1;var o=t.group==="nodes",f=e._private.style;r=Object.keys(f);for(var c=0;c<a.length;c++){var h=a[c];t.styleKeys[h]=[ao,Ou]}for(var p=function(se,ge){return t.styleKeys[ge][0]=cd(se,t.styleKeys[ge][0])},m=function(se,ge){return t.styleKeys[ge][1]=fd(se,t.styleKeys[ge][1])},y=function(se,ge){p(se,ge),m(se,ge)},x=function(se,ge){for(var Te=0;Te<se.length;Te++){var Be=se.charCodeAt(Te);p(Be,ge),m(Be,ge)}},b=2e9,w=function(se){return-128<se&&se<128&&Math.floor(se)!==se?b-(se*1024|0):se},S=0;S<r.length;S++){var N=r[S],E=f[N];if(E!=null){var T=this.properties[N],R=T.type,A=T.groupKey,D=void 0;T.hashOverride!=null?D=T.hashOverride(e,E):E.pfValue!=null&&(D=E.pfValue);var _=T.enums==null?E.value:null,L=D!=null,M=_!=null,z=L||M,B=E.units;if(R.number&&z&&!R.multiple){var H=L?D:_;y(w(H),A),!L&&B!=null&&x(B,A)}else x(E.strValue,A)}}for(var G=[ao,Ou],U=0;U<a.length;U++){var I=a[U],V=t.styleKeys[I];G[0]=cd(V[0],G[0]),G[1]=fd(V[1],G[1])}t.styleKey=LX(G[0],G[1]);var K=t.styleKeys;t.labelDimsKey=$s(K.labelDimensions);var Q=i(e,["label"],K.labelDimensions);if(t.labelKey=$s(Q),t.labelStyleKey=$s(jv(K.commonLabel,Q)),!o){var F=i(e,["source-label"],K.labelDimensions);t.sourceLabelKey=$s(F),t.sourceLabelStyleKey=$s(jv(K.commonLabel,F));var q=i(e,["target-label"],K.labelDimensions);t.targetLabelKey=$s(q),t.targetLabelStyleKey=$s(jv(K.commonLabel,q))}if(o){var X=t.styleKeys,P=X.nodeBody,Z=X.nodeBorder,ae=X.nodeOutline,ie=X.backgroundImage,le=X.compound,ye=X.pie,ne=X.stripe,W=[P,Z,ae,ie,le,ye,ne].filter(function(J){return J!=null}).reduce(jv,[ao,Ou]);t.nodeKey=$s(W),t.hasPie=ye!=null&&ye[0]!==ao&&ye[1]!==Ou,t.hasStripe=ne!=null&&ne[0]!==ao&&ne[1]!==Ou}return l!==t.styleKey};rr.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null,t.hasStripe=null};rr.applyParsedProperty=function(e,t){var n=this,r=t,a=e._private.style,i,l=n.types,o=n.properties[r.name].type,f=r.bypass,c=a[r.name],h=c&&c.bypass,p=e._private,m="mapping",y=function(P){return P==null?null:P.pfValue!=null?P.pfValue:P.value},x=function(){var P=y(c),Z=y(r);n.checkTriggers(e,r.name,P,Z)};if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))&&(r=t=this.parse(t.name,"bezier",f)),r.delete)return a[r.name]=void 0,x(),!0;if(r.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,x(),!0):!1:(x(),!0);if(r.deleteBypass)return c?c.bypass?(a[r.name]=c.bypassed,x(),!0):!1:(x(),!0);var b=function(){zt("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case l.mapData:{for(var w=r.field.split("."),S=p.data,N=0;N<w.length&&S;N++){var E=w[N];S=S[E]}if(S==null)return b(),!1;var T;if(Re(S)){var R=r.fieldMax-r.fieldMin;R===0?T=0:T=(S-r.fieldMin)/R}else return zt("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+S+"` for `"+e.id()+"` is non-numeric)"),!1;if(T<0?T=0:T>1&&(T=1),o.color){var A=r.valueMin[0],D=r.valueMax[0],_=r.valueMin[1],L=r.valueMax[1],M=r.valueMin[2],z=r.valueMax[2],B=r.valueMin[3]==null?1:r.valueMin[3],H=r.valueMax[3]==null?1:r.valueMax[3],G=[Math.round(A+(D-A)*T),Math.round(_+(L-_)*T),Math.round(M+(z-M)*T),Math.round(B+(H-B)*T)];i={bypass:r.bypass,name:r.name,value:G,strValue:"rgb("+G[0]+", "+G[1]+", "+G[2]+")"}}else if(o.number){var U=r.valueMin+(r.valueMax-r.valueMin)*T;i=this.parse(r.name,U,r.bypass,m)}else return!1;if(!i)return b(),!1;i.mapping=r,r=i;break}case l.data:{for(var I=r.field.split("."),V=p.data,K=0;K<I.length&&V;K++){var Q=I[K];V=V[Q]}if(V!=null&&(i=this.parse(r.name,V,r.bypass,m)),!i)return b(),!1;i.mapping=r,r=i;break}case l.fn:{var F=r.value,q=r.fnValue!=null?r.fnValue:F(e);if(r.prevFnValue=q,q==null)return zt("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(i=this.parse(r.name,q,r.bypass,m),!i)return zt("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+e.id()+"` is invalid)"),!1;i.mapping=mi(r),r=i;break}case void 0:break;default:return!1}return f?(h?r.bypassed=c.bypassed:r.bypassed=c,a[r.name]=r):h?c.bypassed=r:a[r.name]=r,x(),!0};rr.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!t)r._private.style={};else for(var a=r._private.style,i=Object.keys(a),l=0;l<i.length;l++){var o=i[l],f=a[o];f!=null&&(f.bypass?f.bypassed=null:a[o]=null)}}};rr.update=function(){var e=this._private.cy,t=e.mutableElements();t.updateStyle()};rr.updateTransitions=function(e,t){var n=this,r=e._private,a=e.pstyle("transition-property").value,i=e.pstyle("transition-duration").pfValue,l=e.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var o={},f=!1,c=0;c<a.length;c++){var h=a[c],p=e.pstyle(h),m=t[h];if(m){var y=m.prev,x=y,b=m.next!=null?m.next:p,w=!1,S=void 0,N=1e-6;x&&(Re(x.pfValue)&&Re(b.pfValue)?(w=b.pfValue-x.pfValue,S=x.pfValue+N*w):Re(x.value)&&Re(b.value)?(w=b.value-x.value,S=x.value+N*w):Wt(x.value)&&Wt(b.value)&&(w=x.value[0]!==b.value[0]||x.value[1]!==b.value[1]||x.value[2]!==b.value[2],S=x.strValue),w&&(o[h]=b.strValue,this.applyBypass(e,h,S),f=!0))}}if(!f)return;r.transitioning=!0,new jc(function(E){l>0?e.delayAnimation(l).play().promise().then(E):E()}).then(function(){return e.animation({style:o,duration:i,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,a),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,a),e.emitAndNotify("style"),r.transitioning=!1)};rr.checkTrigger=function(e,t,n,r,a,i){var l=this.properties[t],o=a(l);e.removed()||o!=null&&o(n,r,e)&&i(l)};rr.checkZOrderTrigger=function(e,t,n,r){var a=this;this.checkTrigger(e,t,n,r,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",e)})};rr.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBounds},function(a){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})};rr.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBoundsOfConnectedEdges},function(a){e.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};rr.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBoundsOfParallelEdges},function(a){e.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};rr.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)};var Xd={};Xd.applyBypass=function(e,t,n,r){var a=this,i=[],l=!0;if(t==="*"||t==="**"){if(n!==void 0)for(var o=0;o<a.properties.length;o++){var f=a.properties[o],c=f.name,h=this.parse(c,n,!0);h&&i.push(h)}}else if(tt(t)){var p=this.parse(t,n,!0);p&&i.push(p)}else if(Mt(t)){var m=t;r=n;for(var y=Object.keys(m),x=0;x<y.length;x++){var b=y[x],w=m[b];if(w===void 0&&(w=m[ym(b)]),w!==void 0){var S=this.parse(b,w,!0);S&&i.push(S)}}}else return!1;if(i.length===0)return!1;for(var N=!1,E=0;E<e.length;E++){for(var T=e[E],R={},A=void 0,D=0;D<i.length;D++){var _=i[D];if(r){var L=T.pstyle(_.name);A=R[_.name]={prev:L}}N=this.applyParsedProperty(T,mi(_))||N,r&&(A.next=T.pstyle(_.name))}N&&this.updateStyleHints(T),r&&this.updateTransitions(T,R,l)}return N};Xd.overrideBypass=function(e,t,n){t=zw(t);for(var r=0;r<e.length;r++){var a=e[r],i=a._private.style[t],l=this.properties[t].type,o=l.color,f=l.mutiple,c=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,t,n):(i.value=n,i.pfValue!=null&&(i.pfValue=n),o?i.strValue="rgb("+n.join(",")+")":f?i.strValue=n.join(" "):i.strValue=""+n,this.updateStyleHints(a)),this.checkTriggers(a,t,c,n)}};Xd.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)};Xd.removeBypasses=function(e,t,n){for(var r=!0,a=0;a<e.length;a++){for(var i=e[a],l={},o=0;o<t.length;o++){var f=t[o],c=this.properties[f],h=i.pstyle(c.name);if(!(!h||!h.bypass)){var p="",m=this.parse(f,p,!0),y=l[c.name]={prev:h};this.applyParsedProperty(i,m),y.next=i.pstyle(c.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,l,r)}};var Jw={};Jw.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1};Jw.containerCss=function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)};var Ei={};Ei.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)};Ei.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var r={},a=0;a<n.properties.length;a++){var i=n.properties[a],l=n.getStylePropertyValue(e,i.name,t);l!=null&&(r[i.name]=l,r[ym(i.name)]=l)}return r}};Ei.getIndexedStyle=function(e,t,n,r){var a=e.pstyle(t)[n][r];return a??e.cy().style().getDefaultProperty(t)[n][0]};Ei.getStylePropertyValue=function(e,t,n){var r=this;if(e=e[0],e){var a=r.properties[t];a.alias&&(a=a.pointsTo);var i=a.type,l=e.pstyle(a.name);if(l){var o=l.value,f=l.units,c=l.strValue;if(n&&i.number&&o!=null&&Re(o)){var h=e.cy().zoom(),p=function(w){return w*h},m=function(w,S){return p(w)+S},y=Wt(o),x=y?f.every(function(b){return b!=null}):f!=null;return x?y?o.map(function(b,w){return m(b,f[w])}).join(" "):m(o,f):y?o.map(function(b){return tt(b)?b:""+p(b)}).join(" "):""+p(o)}else if(c!=null)return c}return null}};Ei.getAnimationStartStyle=function(e,t){for(var n={},r=0;r<t.length;r++){var a=t[r],i=a.name,l=e.pstyle(i);l!==void 0&&(Mt(l)?l=this.parse(i,l.strValue):l=this.parse(i,l)),l&&(n[i]=l)}return n};Ei.getPropsList=function(e){var t=this,n=[],r=e,a=t.properties;if(r)for(var i=Object.keys(r),l=0;l<i.length;l++){var o=i[l],f=r[o],c=a[o]||a[zw(o)],h=this.parse(c.name,f);h&&n.push(h)}return n};Ei.getNonDefaultPropertiesHash=function(e,t,n){var r=n.slice(),a,i,l,o,f,c;for(f=0;f<t.length;f++)if(a=t[f],i=e.pstyle(a,!1),i!=null)if(i.pfValue!=null)r[0]=cd(o,r[0]),r[1]=fd(o,r[1]);else for(l=i.strValue,c=0;c<l.length;c++)o=l.charCodeAt(c),r[0]=cd(o,r[0]),r[1]=fd(o,r[1]);return r};Ei.getPropertiesHash=Ei.getNonDefaultPropertiesHash;var Dm={};Dm.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],a=r.selector,i=r.style||r.css,l=Object.keys(i);t.selector(a);for(var o=0;o<l.length;o++){var f=l[o],c=i[f];t.css(f,c)}}return t};Dm.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t};Dm.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,a=n.properties,i={},l=0;l<a.length;l++){var o=a[l];i[o.name]=o.strValue}e.push({selector:r?r.toString():"core",style:i})}return e};var eS={};eS.appendFromString=function(e){var t=this,n=this,r=""+e,a,i,l;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){r.length>a.length?r=r.substr(a.length):r=""}function f(){i.length>l.length?i=i.substr(l.length):i=""}for(;;){var c=r.match(/^\s*$/);if(c)break;var h=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){zt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}a=h[0];var p=h[1];if(p!=="core"){var m=new El(p);if(m.invalid){zt("Skipping parsing of block: Invalid selector found in string stylesheet: "+p),o();continue}}var y=h[2],x=!1;i=y;for(var b=[];;){var w=i.match(/^\s*$/);if(w)break;var S=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!S){zt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+y),x=!0;break}l=S[0];var N=S[1],E=S[2],T=t.properties[N];if(!T){zt("Skipping property: Invalid property name in: "+l),f();continue}var R=n.parse(N,E);if(!R){zt("Skipping property: Invalid property definition in: "+l),f();continue}b.push({name:N,val:E}),f()}if(x){o();break}n.selector(p);for(var A=0;A<b.length;A++){var D=b[A];n.css(D.name,D.val)}o()}return n};eS.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var Pn={};(function(){var e=Hn,t=hX,n=pX,r=mX,a=gX,i=function(J){return"^"+J+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},l=function(J){var se=e+"|\\w+|"+t+"|"+n+"|"+r+"|"+a;return"^"+J+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+se+")\\s*\\,\\s*("+se+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Pn.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:l("mapData")},mapLayoutData:{mapping:!0,regex:l("mapLayoutData")},mapScratch:{mapping:!0,regex:l("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(J,se){switch(J.length){case 2:return se[0]!=="deg"&&se[0]!=="rad"&&se[1]!=="deg"&&se[1]!=="rad";case 1:return tt(J[0])||se[0]==="deg"||se[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(J){var se=J.length;return se===1||se===2||se===4}}};var f={zeroNonZero:function(J,se){return(J==null||se==null)&&J!==se||J==0&&se!=0?!0:J!=0&&se==0},any:function(J,se){return J!=se},emptyNonEmpty:function(J,se){var ge=bl(J),Te=bl(se);return ge&&!Te||!ge&&Te}},c=Pn.types,h=[{name:"label",type:c.text,triggersBounds:f.any,triggersZOrder:f.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any}],p=[{name:"source-label",type:c.text,triggersBounds:f.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-offset",type:c.size,triggersBounds:f.any}],m=[{name:"target-label",type:c.text,triggersBounds:f.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-offset",type:c.size,triggersBounds:f.any}],y=[{name:"font-family",type:c.fontFamily,triggersBounds:f.any},{name:"font-style",type:c.fontStyle,triggersBounds:f.any},{name:"font-weight",type:c.fontWeight,triggersBounds:f.any},{name:"font-size",type:c.size,triggersBounds:f.any},{name:"text-transform",type:c.textTransform,triggersBounds:f.any},{name:"text-wrap",type:c.textWrap,triggersBounds:f.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:f.any},{name:"text-max-width",type:c.size,triggersBounds:f.any},{name:"text-outline-width",type:c.size,triggersBounds:f.any},{name:"line-height",type:c.positiveNumber,triggersBounds:f.any}],x=[{name:"text-valign",type:c.valign,triggersBounds:f.any},{name:"text-halign",type:c.halign,triggersBounds:f.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:f.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:f.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:f.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:f.any},{name:"text-justification",type:c.justification},{name:"box-select-labels",type:c.bool,triggersBounds:f.any}],b=[{name:"events",type:c.bool,triggersZOrder:f.any},{name:"text-events",type:c.bool,triggersZOrder:f.any},{name:"box-selection",type:c.boxSelection,triggersZOrder:f.any}],w=[{name:"display",type:c.display,triggersZOrder:f.any,triggersBounds:f.any,triggersBoundsOfConnectedEdges:f.any,triggersBoundsOfParallelEdges:function(J,se,ge){return J===se?!1:ge.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:c.visibility,triggersZOrder:f.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:f.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:f.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:f.any},{name:"z-index",type:c.number,triggersZOrder:f.any}],S=[{name:"overlay-padding",type:c.size,triggersBounds:f.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"overlay-corner-radius",type:c.cornerRadius}],N=[{name:"underlay-padding",type:c.size,triggersBounds:f.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"underlay-corner-radius",type:c.cornerRadius}],E=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],T=function(J,se){return se.value==="label"?-J.poolIndex():se.pfValue},R=[{name:"height",type:c.nodeSize,triggersBounds:f.any,hashOverride:T},{name:"width",type:c.nodeSize,triggersBounds:f.any,hashOverride:T},{name:"shape",type:c.nodeShape,triggersBounds:f.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:f.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:f.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:f.any}],A=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:f.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],D=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:f.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:f.any}],_=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],L=[{name:"position",type:c.position,triggersBounds:f.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:f.any},{name:"min-width",type:c.size,triggersBounds:f.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height",type:c.size,triggersBounds:f.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:f.any}],M=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:f.any,triggersBoundsOfParallelEdges:function(J,se){return J===se?!1:J==="bezier"||se==="bezier"}},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:f.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"control-point-step-size",type:c.size,triggersBounds:f.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"control-point-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"segment-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-radii",type:c.numbers,triggersBounds:f.any},{name:"radius-type",type:c.radiusType,triggersBounds:f.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:f.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:f.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:f.any},{name:"taxi-radius",type:c.number,triggersBounds:f.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:f.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:f.any},{name:"loop-direction",type:c.angle,triggersBounds:f.any},{name:"loop-sweep",type:c.angle,triggersBounds:f.any},{name:"source-distance-from-node",type:c.size,triggersBounds:f.any},{name:"target-distance-from-node",type:c.size,triggersBounds:f.any}],z=[{name:"ghost",type:c.bool,triggersBounds:f.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-opacity",type:c.zeroOneNumber}],B=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],H=[];Pn.pieBackgroundN=16,H.push({name:"pie-size",type:c.sizeMaybePercent}),H.push({name:"pie-hole",type:c.sizeMaybePercent}),H.push({name:"pie-start-angle",type:c.angle});for(var G=1;G<=Pn.pieBackgroundN;G++)H.push({name:"pie-"+G+"-background-color",type:c.color}),H.push({name:"pie-"+G+"-background-size",type:c.percent}),H.push({name:"pie-"+G+"-background-opacity",type:c.zeroOneNumber});var U=[];Pn.stripeBackgroundN=16,U.push({name:"stripe-size",type:c.sizeMaybePercent}),U.push({name:"stripe-direction",type:c.axisDirectionPrimary});for(var I=1;I<=Pn.stripeBackgroundN;I++)U.push({name:"stripe-"+I+"-background-color",type:c.color}),U.push({name:"stripe-"+I+"-background-size",type:c.percent}),U.push({name:"stripe-"+I+"-background-opacity",type:c.zeroOneNumber});var V=[],K=Pn.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:f.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(W){K.forEach(function(J){var se=J+"-"+W.name,ge=W.type,Te=W.triggersBounds;V.push({name:se,type:ge,triggersBounds:Te})})},{});var Q=Pn.properties=[].concat(b,E,w,S,N,z,x,y,h,p,m,R,A,D,_,H,U,L,M,V,B),F=Pn.propertyGroups={behavior:b,transition:E,visibility:w,overlay:S,underlay:N,ghost:z,commonLabel:x,labelDimensions:y,mainLabel:h,sourceLabel:p,targetLabel:m,nodeBody:R,nodeBorder:A,nodeOutline:D,backgroundImage:_,pie:H,stripe:U,compound:L,edgeLine:M,edgeArrow:V,core:B},q=Pn.propertyGroupNames={},X=Pn.propertyGroupKeys=Object.keys(F);X.forEach(function(W){q[W]=F[W].map(function(J){return J.name}),F[W].forEach(function(J){return J.groupKey=W})});var P=Pn.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Pn.propertyNames=Q.map(function(W){return W.name});for(var Z=0;Z<Q.length;Z++){var ae=Q[Z];Q[ae.name]=ae}for(var ie=0;ie<P.length;ie++){var le=P[ie],ye=Q[le.pointsTo],ne={name:le.name,alias:!0,pointsTo:ye};Q.push(ne),Q[le.name]=ne}})();Pn.getDefaultProperty=function(e){return this.getDefaultProperties()[e]};Pn.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=at({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(f,c){for(var h=1;h<=Pn.pieBackgroundN;h++){var p=c.name.replace("{{i}}",h),m=c.value;f[p]=m}return f},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(f,c){for(var h=1;h<=Pn.stripeBackgroundN;h++){var p=c.name.replace("{{i}}",h),m=c.value;f[p]=m}return f},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(f,c){return Pn.arrowPrefixes.forEach(function(h){var p=h+"-"+c.name,m=c.value;f[p]=m}),f},{})),n={},r=0;r<this.properties.length;r++){var a=this.properties[r];if(!a.pointsTo){var i=a.name,l=t[i],o=this.parse(i,l);n[i]=o}}return e.defaultProperties=n,e.defaultProperties};Pn.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Mm={};Mm.parse=function(e,t,n,r){var a=this;if(gn(t))return a.parseImplWarn(e,t,n,r);var i=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,l=n?"t":"f",o=""+t,f=BO(e,o,l,i),c=a.propCache=a.propCache||[],h;return(h=c[f])||(h=c[f]=a.parseImplWarn(e,t,n,r)),(n||r==="mapping")&&(h=mi(h),h&&(h.value=mi(h.value))),h};Mm.parseImplWarn=function(e,t,n,r){var a=this.parseImpl(e,t,n,r);return!a&&t!=null&&zt("The style property `".concat(e,": ").concat(t,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&t==="label"&&zt("The style value of `label` is deprecated for `"+a.name+"`"),a};Mm.parseImpl=function(e,t,n,r){var a=this;e=zw(e);var i=a.properties[e],l=t,o=a.types;if(!i||t===void 0)return null;i.alias&&(i=i.pointsTo,e=i.name);var f=tt(t);f&&(t=t.trim());var c=i.type;if(!c)return null;if(n&&(t===""||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(gn(t))return{name:e,value:t,strValue:"fn",mapped:o.fn,bypass:n};var h,p;if(!(!f||r||t.length<7||t[1]!=="a")){if(t.length>=7&&t[0]==="d"&&(h=new RegExp(o.data.regex).exec(t))){if(n)return!1;var m=o.data;return{name:e,value:h,strValue:""+t,mapped:m,field:h[1],bypass:n}}else if(t.length>=10&&t[0]==="m"&&(p=new RegExp(o.mapData.regex).exec(t))){if(n||c.multiple)return!1;var y=o.mapData;if(!(c.color||c.number))return!1;var x=this.parse(e,p[4]);if(!x||x.mapped)return!1;var b=this.parse(e,p[5]);if(!b||b.mapped)return!1;if(x.pfValue===b.pfValue||x.strValue===b.strValue)return zt("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+x.strValue+"`"),this.parse(e,x.strValue);if(c.color){var w=x.value,S=b.value,N=w[0]===S[0]&&w[1]===S[1]&&w[2]===S[2]&&(w[3]===S[3]||(w[3]==null||w[3]===1)&&(S[3]==null||S[3]===1));if(N)return!1}return{name:e,value:p,strValue:""+t,mapped:y,field:p[1],fieldMin:parseFloat(p[2]),fieldMax:parseFloat(p[3]),valueMin:x.value,valueMax:b.value,bypass:n}}}if(c.multiple&&r!=="multiple"){var E;if(f?E=t.split(/\s+/):Wt(t)?E=t:E=[t],c.evenMultiple&&E.length%2!==0)return null;for(var T=[],R=[],A=[],D="",_=!1,L=0;L<E.length;L++){var M=a.parse(e,E[L],n,"multiple");_=_||tt(M.value),T.push(M.value),A.push(M.pfValue!=null?M.pfValue:M.value),R.push(M.units),D+=(L>0?" ":"")+M.strValue}return c.validate&&!c.validate(T,R)?null:c.singleEnum&&_?T.length===1&&tt(T[0])?{name:e,value:T[0],strValue:T[0],bypass:n}:null:{name:e,value:T,pfValue:A,strValue:D,bypass:n,units:R}}var z=function(){for(var ne=0;ne<c.enums.length;ne++){var W=c.enums[ne];if(W===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(c.number){var B,H="px";if(c.units&&(B=c.units),c.implicitUnits&&(H=c.implicitUnits),!c.unitless)if(f){var G="px|em"+(c.allowPercent?"|\\%":"");B&&(G=B);var U=t.match("^("+Hn+")("+G+")?$");U&&(t=U[1],B=U[2]||H)}else(!B||c.implicitUnits)&&(B=H);if(t=parseFloat(t),isNaN(t)&&c.enums===void 0)return null;if(isNaN(t)&&c.enums!==void 0)return t=l,z();if(c.integer&&!sX(t)||c.min!==void 0&&(t<c.min||c.strictMin&&t===c.min)||c.max!==void 0&&(t>c.max||c.strictMax&&t===c.max))return null;var I={name:e,value:t,strValue:""+t+(B||""),units:B,bypass:n};return c.unitless||B!=="px"&&B!=="em"?I.pfValue=t:I.pfValue=B==="px"||!B?t:this.getEmSizeInPixels()*t,(B==="ms"||B==="s")&&(I.pfValue=B==="ms"?t:1e3*t),(B==="deg"||B==="rad")&&(I.pfValue=B==="rad"?t:mQ(t)),B==="%"&&(I.pfValue=t/100),I}else if(c.propList){var V=[],K=""+t;if(K!=="none"){for(var Q=K.split(/\s*,\s*|\s+/),F=0;F<Q.length;F++){var q=Q[F].trim();a.properties[q]?V.push(q):zt("`"+q+"` is not a valid property name")}if(V.length===0)return null}return{name:e,value:V,strValue:V.length===0?"none":V.join(" "),bypass:n}}else if(c.color){var X=RO(t);return X?{name:e,value:X,pfValue:X,strValue:"rgb("+X[0]+","+X[1]+","+X[2]+")",bypass:n}:null}else if(c.regex||c.regexes){if(c.enums){var P=z();if(P)return P}for(var Z=c.regexes?c.regexes:[c.regex],ae=0;ae<Z.length;ae++){var ie=new RegExp(Z[ae]),le=ie.exec(t);if(le)return{name:e,value:c.singleRegexMatchValue?le[1]:le,strValue:""+t,bypass:n}}return null}else return c.string?{name:e,value:""+t,strValue:""+t,bypass:n}:c.enums?z():null};var nr=function(t){if(!(this instanceof nr))return new nr(t);if(!Bw(t)){dn("A style must have a core reference");return}this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()},wr=nr.prototype;wr.instanceString=function(){return"style"};wr.clear=function(){for(var e=this._private,t=e.cy,n=t.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};wr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};wr.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)};wr.selector=function(e){var t=e==="core"?null:new El(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this};wr.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],r=0;r<e.properties.length;r++){var a=e.properties[r],i=n[a.name];i===void 0&&(i=n[ym(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else t.length===2&&this.cssRule(t[0],t[1]);return this};wr.style=wr.css;wr.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.name.match(/stripe-(\d+)-background-size/)&&n.value&&(this._private.hasStripe=!0),n.mapped&&this[r].mappedProperties.push(n);var a=!this[r].selector;a&&(this._private.coreStyle[n.name]=n)}return this};wr.append=function(e){return TO(e)?e.appendToStyle(this):Wt(e)?this.appendFromJson(e):tt(e)&&this.appendFromString(e),this};nr.fromJson=function(e,t){var n=new nr(e);return n.fromJson(t),n};nr.fromString=function(e,t){return new nr(e).fromString(t)};[rr,Xd,Jw,Ei,Dm,eS,Pn,Mm].forEach(function(e){at(wr,e)});nr.types=wr.types;nr.properties=wr.properties;nr.propertyGroups=wr.propertyGroups;nr.propertyGroupNames=wr.propertyGroupNames;nr.propertyGroupKeys=wr.propertyGroupKeys;var bJ={style:function(t){if(t){var n=this.setStyle(t);n.update()}return this._private.style},setStyle:function(t){var n=this._private;return TO(t)?n.style=t.generateStyle(this):Wt(t)?n.style=nr.fromJson(this,t):tt(t)?n.style=nr.fromString(this,t):n.style=nr(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},wJ="single",Do={autolock:function(t){if(t!==void 0)this._private.autolock=!!t;else return this._private.autolock;return this},autoungrabify:function(t){if(t!==void 0)this._private.autoungrabify=!!t;else return this._private.autoungrabify;return this},autounselectify:function(t){if(t!==void 0)this._private.autounselectify=!!t;else return this._private.autounselectify;return this},selectionType:function(t){var n=this._private;if(n.selectionType==null&&(n.selectionType=wJ),t!==void 0)(t==="additive"||t==="single")&&(n.selectionType=t);else return n.selectionType;return this},panningEnabled:function(t){if(t!==void 0)this._private.panningEnabled=!!t;else return this._private.panningEnabled;return this},userPanningEnabled:function(t){if(t!==void 0)this._private.userPanningEnabled=!!t;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(t){if(t!==void 0)this._private.zoomingEnabled=!!t;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(t){if(t!==void 0)this._private.userZoomingEnabled=!!t;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(t){if(t!==void 0)this._private.boxSelectionEnabled=!!t;else return this._private.boxSelectionEnabled;return this},pan:function(){var t=arguments,n=this._private.pan,r,a,i,l,o;switch(t.length){case 0:return n;case 1:if(tt(t[0]))return r=t[0],n[r];if(Mt(t[0])){if(!this._private.panningEnabled)return this;i=t[0],l=i.x,o=i.y,Re(l)&&(n.x=l),Re(o)&&(n.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=t[0],a=t[1],(r==="x"||r==="y")&&Re(a)&&(n[r]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(t,n){var r=arguments,a=this._private.pan,i,l,o,f,c;if(!this._private.panningEnabled)return this;switch(r.length){case 1:Mt(t)&&(o=r[0],f=o.x,c=o.y,Re(f)&&(a.x+=f),Re(c)&&(a.y+=c),this.emit("pan viewport"));break;case 2:i=t,l=n,(i==="x"||i==="y")&&Re(l)&&(a[i]+=l),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(t,n){var r=this.getFitViewport(t,n);if(r){var a=this._private;a.zoom=r.zoom,a.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(t,n){if(Re(t)&&n===void 0&&(n=t,t=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(tt(t)){var a=t;t=this.$(a)}else if(uX(t)){var i=t;r={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else fa(t)||(t=this.mutableElements());if(!(fa(t)&&t.empty())){r=r||t.boundingBox();var l=this.width(),o=this.height(),f;if(n=Re(n)?n:0,!isNaN(l)&&!isNaN(o)&&l>0&&o>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){f=Math.min((l-2*n)/r.w,(o-2*n)/r.h),f=f>this._private.maxZoom?this._private.maxZoom:f,f=f<this._private.minZoom?this._private.minZoom:f;var c={x:(l-f*(r.x1+r.x2))/2,y:(o-f*(r.y1+r.y2))/2};return{zoom:f,pan:c}}}}},zoomRange:function(t,n){var r=this._private;if(n==null){var a=t;t=a.min,n=a.max}return Re(t)&&Re(n)&&t<=n?(r.minZoom=t,r.maxZoom=n):Re(t)&&n===void 0&&t<=r.maxZoom?r.minZoom=t:Re(n)&&t===void 0&&n>=r.minZoom&&(r.maxZoom=n),this},minZoom:function(t){return t===void 0?this._private.minZoom:this.zoomRange({min:t})},maxZoom:function(t){return t===void 0?this._private.maxZoom:this.zoomRange({max:t})},getZoomedViewport:function(t){var n=this._private,r=n.pan,a=n.zoom,i,l,o=!1;if(n.zoomingEnabled||(o=!0),Re(t)?l=t:Mt(t)&&(l=t.level,t.position!=null?i=wm(t.position,a,r):t.renderedPosition!=null&&(i=t.renderedPosition),i!=null&&!n.panningEnabled&&(o=!0)),l=l>n.maxZoom?n.maxZoom:l,l=l<n.minZoom?n.minZoom:l,o||!Re(l)||l===a||i!=null&&(!Re(i.x)||!Re(i.y)))return null;if(i!=null){var f=r,c=a,h=l,p={x:-h/c*(i.x-f.x)+i.x,y:-h/c*(i.y-f.y)+i.y};return{zoomed:!0,panned:!0,zoom:h,pan:p}}else return{zoomed:!0,panned:!1,zoom:l,pan:r}},zoom:function(t){if(t===void 0)return this._private.zoom;var n=this.getZoomedViewport(t),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(t){var n=this._private,r=!0,a=!0,i=[],l=!1,o=!1;if(!t)return this;if(Re(t.zoom)||(r=!1),Mt(t.pan)||(a=!1),!r&&!a)return this;if(r){var f=t.zoom;f<n.minZoom||f>n.maxZoom||!n.zoomingEnabled?l=!0:(n.zoom=f,i.push("zoom"))}if(a&&(!l||!t.cancelOnFailedZoom)&&n.panningEnabled){var c=t.pan;Re(c.x)&&(n.pan.x=c.x,o=!1),Re(c.y)&&(n.pan.y=c.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(t){var n=this.getCenterPan(t);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(t,n){if(this._private.panningEnabled){if(tt(t)){var r=t;t=this.mutableElements().filter(r)}else fa(t)||(t=this.mutableElements());if(t.length!==0){var a=t.boundingBox(),i=this.width(),l=this.height();n=n===void 0?this._private.zoom:n;var o={x:(i-n*(a.x1+a.x2))/2,y:(l-n*(a.y1+a.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var t=this._private,n=t.container,r=this;return t.sizeCache=t.sizeCache||(n?(function(){var a=r.window().getComputedStyle(n),i=function(o){return parseFloat(a.getPropertyValue(o))};return{width:n.clientWidth-i("padding-left")-i("padding-right"),height:n.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var t=this._private.pan,n=this._private.zoom,r=this.renderedExtent(),a={x1:(r.x1-t.x)/n,x2:(r.x2-t.x)/n,y1:(r.y1-t.y)/n,y2:(r.y2-t.y)/n};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var t=this.width(),n=this.height();return{x1:0,y1:0,x2:t,y2:n,w:t,h:n}},multiClickDebounceTime:function(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this}};Do.centre=Do.center;Do.autolockNodes=Do.autolock;Do.autoungrabifyNodes=Do.autoungrabify;var gd={data:Bt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Bt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Bt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Bt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};gd.attr=gd.data;gd.removeAttr=gd.removeData;var yd=function(t){var n=this;t=at({},t);var r=t.container;r&&!Ap(r)&&Ap(r[0])&&(r=r[0]);var a=r?r._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];r&&(r._cyreg=a),a.cy=n;var l=qn!==void 0&&r!==void 0&&!t.headless,o=t;o.layout=at({name:l?"grid":"null"},o.layout),o.renderer=at({name:l?"canvas":"null"},o.renderer);var f=function(x,b,w){return b!==void 0?b:w!==void 0?w:x},c=this._private={container:r,ready:!1,options:o,elements:new cr(this),listeners:[],aniEles:new cr(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:f(!0,o.zoomingEnabled),userZoomingEnabled:f(!0,o.userZoomingEnabled),panningEnabled:f(!0,o.panningEnabled),userPanningEnabled:f(!0,o.userPanningEnabled),boxSelectionEnabled:f(!0,o.boxSelectionEnabled),autolock:f(!1,o.autolock,o.autolockNodes),autoungrabify:f(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:f(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?l:o.styleEnabled,zoom:Re(o.zoom)?o.zoom:1,pan:{x:Mt(o.pan)&&Re(o.pan.x)?o.pan.x:0,y:Mt(o.pan)&&Re(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:f(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(x,b){var w=x.some(cX);if(w)return jc.all(x).then(b);b(x)};c.styleEnabled&&n.setStyle([]);var p=at({},o,o.renderer);n.initRenderer(p);var m=function(x,b,w){n.notifications(!1);var S=n.mutableElements();S.length>0&&S.remove(),x!=null&&(Mt(x)||Wt(x))&&n.add(x),n.one("layoutready",function(E){n.notifications(!0),n.emit(E),n.one("load",b),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",w),n.emit("done")});var N=at({},n._private.options.layout);N.eles=n.elements(),n.layout(N).run()};h([o.style,o.elements],function(y){var x=y[0],b=y[1];c.styleEnabled&&n.style().append(x),m(b,function(){n.startAnimationLoop(),c.ready=!0,gn(o.ready)&&n.on("ready",o.ready);for(var w=0;w<i.length;w++){var S=i[w];n.on("ready",S)}a&&(a.readies=[]),n.emit("ready")},o.done)})},Pp=yd.prototype;at(Pp,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(t){return this.isReady()?this.emitter().emit("ready",[],t):this.on("ready",t),this},destroy:function(){var t=this;if(!t.destroyed())return t.stopAnimationLoop(),t.destroyRenderer(),this.emit("destroy"),t._private.destroyed=!0,t},hasElementWithId:function(t){return this._private.elements.hasElementWithId(t)},getElementById:function(t){return this._private.elements.getElementById(t)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(t){return this._private.elements.merge(t),this},removeFromPool:function(t){return this._private.elements.unmerge(t),this},container:function(){return this._private.container||null},window:function(){var t=this._private.container;if(t==null)return qn;var n=this._private.container.ownerDocument;return n===void 0||n==null?qn:n.defaultView||qn},mount:function(t){if(t!=null){var n=this,r=n._private,a=r.options;return!Ap(t)&&Ap(t[0])&&(t=t[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=t,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(at({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),n.startAnimationLoop(),n.style(a.style),n.emit("mount"),n}},unmount:function(){var t=this;return t.stopAnimationLoop(),t.destroyRenderer(),t.initRenderer({name:"null"}),t.emit("unmount"),t},options:function(){return mi(this._private.options)},json:function(t){var n=this,r=n._private,a=n.mutableElements(),i=function(T){return n.getElementById(T.id())};if(Mt(t)){if(n.startBatch(),t.elements){var l={},o=function(T,R){for(var A=[],D=[],_=0;_<T.length;_++){var L=T[_];if(!L.data.id){zt("cy.json() cannot handle elements without an ID attribute");continue}var M=""+L.data.id,z=n.getElementById(M);l[M]=!0,z.length!==0?D.push({ele:z,json:L}):(R&&(L.group=R),A.push(L))}n.add(A);for(var B=0;B<D.length;B++){var H=D[B],G=H.ele,U=H.json;G.json(U)}};if(Wt(t.elements))o(t.elements);else for(var f=["nodes","edges"],c=0;c<f.length;c++){var h=f[c],p=t.elements[h];Wt(p)&&o(p,h)}var m=n.collection();a.filter(function(E){return!l[E.id()]}).forEach(function(E){E.isParent()?m.merge(E):E.remove()}),m.forEach(function(E){return E.children().move({parent:null})}),m.forEach(function(E){return i(E).remove()})}t.style&&n.style(t.style),t.zoom!=null&&t.zoom!==r.zoom&&n.zoom(t.zoom),t.pan&&(t.pan.x!==r.pan.x||t.pan.y!==r.pan.y)&&n.pan(t.pan),t.data&&n.data(t.data);for(var y=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],x=0;x<y.length;x++){var b=y[x];t[b]!=null&&n[b](t[b])}return n.endBatch(),this}else{var w=!!t,S={};w?S.elements=this.elements().map(function(E){return E.json()}):(S.elements={},a.forEach(function(E){var T=E.group();S.elements[T]||(S.elements[T]=[]),S.elements[T].push(E.json())})),this._private.styleEnabled&&(S.style=n.style().json()),S.data=mi(n.data());var N=r.options;return S.zoomingEnabled=r.zoomingEnabled,S.userZoomingEnabled=r.userZoomingEnabled,S.zoom=r.zoom,S.minZoom=r.minZoom,S.maxZoom=r.maxZoom,S.panningEnabled=r.panningEnabled,S.userPanningEnabled=r.userPanningEnabled,S.pan=mi(r.pan),S.boxSelectionEnabled=r.boxSelectionEnabled,S.renderer=mi(N.renderer),S.hideEdgesOnViewport=N.hideEdgesOnViewport,S.textureOnViewport=N.textureOnViewport,S.wheelSensitivity=N.wheelSensitivity,S.motionBlur=N.motionBlur,S.multiClickDebounceTime=N.multiClickDebounceTime,S}}});Pp.$id=Pp.getElementById;[cJ,pJ,TL,f1,sp,gJ,d1,lp,bJ,Do,gd].forEach(function(e){at(Pp,e)});var SJ={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}},EJ={maximal:!1,acyclic:!1},Tu=function(t){return t.scratch("breadthfirst")},aA=function(t,n){return t.scratch("breadthfirst",n)};function jL(e){this.options=at({},SJ,EJ,e)}jL.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().filter(function(Ve){return Ve.isChildless()}),a=n,i=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,o=!!e.boundingBox,f=Dr(o?e.boundingBox:structuredClone(t.extent())),c;if(fa(e.roots))c=e.roots;else if(Wt(e.roots)){for(var h=[],p=0;p<e.roots.length;p++){var m=e.roots[p],y=t.getElementById(m);h.push(y)}c=t.collection(h)}else if(tt(e.roots))c=t.$(e.roots);else if(i)c=r.roots();else{var x=n.components();c=t.collection();for(var b=function(){var De=x[w],Ye=De.maxDegree(!1),Qe=De.filter(function(st){return st.degree(!1)===Ye});c=c.add(Qe)},w=0;w<x.length;w++)b()}var S=[],N={},E=function(De,Ye){S[Ye]==null&&(S[Ye]=[]);var Qe=S[Ye].length;S[Ye].push(De),aA(De,{index:Qe,depth:Ye})},T=function(De,Ye){var Qe=Tu(De),st=Qe.depth,ze=Qe.index;S[st][ze]=null,De.isChildless()&&E(De,Ye)};a.bfs({roots:c,directed:e.directed,visit:function(De,Ye,Qe,st,ze){var dt=De[0],he=dt.id();dt.isChildless()&&E(dt,ze),N[he]=!0}});for(var R=[],A=0;A<r.length;A++){var D=r[A];N[D.id()]||R.push(D)}var _=function(De){for(var Ye=S[De],Qe=0;Qe<Ye.length;Qe++){var st=Ye[Qe];if(st==null){Ye.splice(Qe,1),Qe--;continue}aA(st,{depth:De,index:Qe})}},L=function(De,Ye){for(var Qe=Tu(De),st=De.incomers().filter(function(_e){return _e.isNode()&&n.has(_e)}),ze=-1,dt=De.id(),he=0;he<st.length;he++){var Ce=st[he],Me=Tu(Ce);ze=Math.max(ze,Me.depth)}if(Qe.depth<=ze){if(!e.acyclic&&Ye[dt])return null;var Fe=ze+1;return T(De,Fe),Ye[dt]=Fe,!0}return!1};if(i&&l){var M=[],z={},B=function(De){return M.push(De)},H=function(){return M.shift()};for(r.forEach(function(Ve){return M.push(Ve)});M.length>0;){var G=H(),U=L(G,z);if(U)G.outgoers().filter(function(Ve){return Ve.isNode()&&n.has(Ve)}).forEach(B);else if(U===null){zt("Detected double maximal shift for node `"+G.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(e.avoidOverlap)for(var V=0;V<r.length;V++){var K=r[V],Q=K.layoutDimensions(e),F=Q.w,q=Q.h;I=Math.max(I,F,q)}var X={},P=function(De){if(X[De.id()])return X[De.id()];for(var Ye=Tu(De).depth,Qe=De.neighborhood(),st=0,ze=0,dt=0;dt<Qe.length;dt++){var he=Qe[dt];if(!(he.isEdge()||he.isParent()||!r.has(he))){var Ce=Tu(he);if(Ce!=null){var Me=Ce.index,Fe=Ce.depth;if(!(Me==null||Fe==null)){var _e=S[Fe].length;Fe<Ye&&(st+=Me/_e,ze++)}}}}return ze=Math.max(1,ze),st=st/ze,ze===0&&(st=0),X[De.id()]=st,st},Z=function(De,Ye){var Qe=P(De),st=P(Ye),ze=Qe-st;return ze===0?AO(De.id(),Ye.id()):ze};e.depthSort!==void 0&&(Z=e.depthSort);for(var ae=S.length,ie=0;ie<ae;ie++)S[ie].sort(Z),_(ie);for(var le=[],ye=0;ye<R.length;ye++)le.push(R[ye]);var ne=function(){for(var De=0;De<ae;De++)_(De)};le.length&&(S.unshift(le),ae=S.length,ne());for(var W=0,J=0;J<ae;J++)W=Math.max(S[J].length,W);var se={x:f.x1+f.w/2,y:f.y1+f.h/2},ge=r.reduce(function(Ve,De){return(function(Ye){return{w:Ve.w===-1?Ye.w:(Ve.w+Ye.w)/2,h:Ve.h===-1?Ye.h:(Ve.h+Ye.h)/2}})(De.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Te=Math.max(ae===1?0:o?(f.h-e.padding*2-ge.h)/(ae-1):(f.h-e.padding*2-ge.h)/(ae+1),I),Be=S.reduce(function(Ve,De){return Math.max(Ve,De.length)},0),ot=function(De){var Ye=Tu(De),Qe=Ye.depth,st=Ye.index;if(e.circle){var ze=Math.min(f.w/2/ae,f.h/2/ae);ze=Math.max(ze,I);var dt=ze*Qe+ze-(ae>0&&S[0].length<=3?ze/2:0),he=2*Math.PI/S[Qe].length*st;return Qe===0&&S[0].length===1&&(dt=1),{x:se.x+dt*Math.cos(he),y:se.y+dt*Math.sin(he)}}else{var Ce=S[Qe].length,Me=Math.max(Ce===1?0:o?(f.w-e.padding*2-ge.w)/((e.grid?Be:Ce)-1):(f.w-e.padding*2-ge.w)/((e.grid?Be:Ce)+1),I),Fe={x:se.x+(st+1-(Ce+1)/2)*Me,y:se.y+(Qe+1-(ae+1)/2)*Te};return Fe}},Je={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Je).indexOf(e.direction)===-1&&dn("Invalid direction '".concat(e.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Je).join(", ")));var We=function(De){return IX(ot(De),f,Je[e.direction])};return n.nodes().layoutPositions(this,e,We),this};var CJ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function AL(e){this.options=at({},CJ,e)}AL.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,a=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));for(var l=Dr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:l.x1+l.w/2,y:l.y1+l.h/2},f=t.sweep===void 0?2*Math.PI-2*Math.PI/i.length:t.sweep,c=f/Math.max(1,i.length-1),h,p=0,m=0;m<i.length;m++){var y=i[m],x=y.layoutDimensions(t),b=x.w,w=x.h;p=Math.max(p,b,w)}if(Re(t.radius)?h=t.radius:i.length<=1?h=0:h=Math.min(l.h,l.w)/2-p,i.length>1&&t.avoidOverlap){p*=1.75;var S=Math.cos(c)-Math.cos(0),N=Math.sin(c)-Math.sin(0),E=Math.sqrt(p*p/(S*S+N*N));h=Math.max(E,h)}var T=function(A,D){var _=t.startAngle+D*c*(a?1:-1),L=h*Math.cos(_),M=h*Math.sin(_),z={x:o.x+L,y:o.y+M};return z};return r.nodes().layoutPositions(this,t,T),this};var NJ={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(t){return t.degree()},levelWidth:function(t){return t.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function RL(e){this.options=at({},NJ,e)}RL.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,r=e.cy,a=t.eles,i=a.nodes().not(":parent"),l=Dr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:l.x1+l.w/2,y:l.y1+l.h/2},f=[],c=0,h=0;h<i.length;h++){var p=i[h],m=void 0;m=t.concentric(p),f.push({value:m,node:p}),p._private.scratch.concentric=m}i.updateStyle();for(var y=0;y<i.length;y++){var x=i[y],b=x.layoutDimensions(t);c=Math.max(c,b.w,b.h)}f.sort(function(Te,Be){return Be.value-Te.value});for(var w=t.levelWidth(i),S=[[]],N=S[0],E=0;E<f.length;E++){var T=f[E];if(N.length>0){var R=Math.abs(N[0].value-T.value);R>=w&&(N=[],S.push(N))}N.push(T)}var A=c+t.minNodeSpacing;if(!t.avoidOverlap){var D=S.length>0&&S[0].length>1,_=Math.min(l.w,l.h)/2-A,L=_/(S.length+D?1:0);A=Math.min(A,L)}for(var M=0,z=0;z<S.length;z++){var B=S[z],H=t.sweep===void 0?2*Math.PI-2*Math.PI/B.length:t.sweep,G=B.dTheta=H/Math.max(1,B.length-1);if(B.length>1&&t.avoidOverlap){var U=Math.cos(G)-Math.cos(0),I=Math.sin(G)-Math.sin(0),V=Math.sqrt(A*A/(U*U+I*I));M=Math.max(V,M)}B.r=M,M+=A}if(t.equidistant){for(var K=0,Q=0,F=0;F<S.length;F++){var q=S[F],X=q.r-Q;K=Math.max(K,X)}Q=0;for(var P=0;P<S.length;P++){var Z=S[P];P===0&&(Q=Z.r),Z.r=Q,Q+=K}}for(var ae={},ie=0;ie<S.length;ie++)for(var le=S[ie],ye=le.dTheta,ne=le.r,W=0;W<le.length;W++){var J=le[W],se=t.startAngle+(n?1:-1)*ye*W,ge={x:o.x+ne*Math.cos(se),y:o.y+ne*Math.sin(se)};ae[J.node.id()]=ge}return a.nodes().layoutPositions(this,t,function(Te){var Be=Te.id();return ae[Be]}),this};var W0,kJ={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(t,n){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(t){return 2048},nodeOverlap:4,idealEdgeLength:function(t){return 32},edgeElasticity:function(t){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function _m(e){this.options=at({},kJ,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(a){var i=a.source().data("id"),l=a.target().data("id"),o=t.some(function(c){return c.data("id")===i}),f=t.some(function(c){return c.data("id")===l});return!o||!f});this.options.eles=this.options.eles.not(r)}_m.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(e.animate===!0||e.animate===!1)&&n.emit({type:"layoutstart",layout:n}),e.debug===!0?W0=!0:W0=!1;var r=TJ(t,n,e);W0&&AJ(r),e.randomize&&RJ(r);var a=us(),i=function(){DJ(r,t,e),e.fit===!0&&t.fit(e.padding)},l=function(m){return!(n.stopped||m>=e.numIter||(MJ(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature<e.minTemp))},o=function(){if(e.animate===!0||e.animate===!1)i(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var m=e.eles.nodes(),y=ML(r,e,m);m.layoutPositions(n,e,y)}},f=0,c=!0;if(e.animate===!0){var h=function(){for(var m=0;c&&m<e.refresh;)c=l(f),f++,m++;if(!c)sA(r,e),o();else{var y=us();y-a>=e.animationThreshold&&i(),Rp(h)}};h()}else{for(;c;)c=l(f),f++;sA(r,e),o()}return this};_m.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};_m.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var TJ=function(t,n,r){for(var a=r.eles.edges(),i=r.eles.nodes(),l=Dr(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:r.initialTemp,clientWidth:l.w,clientHeight:l.h,boundingBox:l},f=r.eles.components(),c={},h=0;h<f.length;h++)for(var p=f[h],m=0;m<p.length;m++){var y=p[m];c[y.id()]=h}for(var h=0;h<o.nodeSize;h++){var x=i[h],b=x.layoutDimensions(r),w={};w.isLocked=x.locked(),w.id=x.data("id"),w.parentId=x.data("parent"),w.cmptId=c[x.id()],w.children=[],w.positionX=x.position("x"),w.positionY=x.position("y"),w.offsetX=0,w.offsetY=0,w.height=b.w,w.width=b.h,w.maxX=w.positionX+w.width/2,w.minX=w.positionX-w.width/2,w.maxY=w.positionY+w.height/2,w.minY=w.positionY-w.height/2,w.padLeft=parseFloat(x.style("padding")),w.padRight=parseFloat(x.style("padding")),w.padTop=parseFloat(x.style("padding")),w.padBottom=parseFloat(x.style("padding")),w.nodeRepulsion=gn(r.nodeRepulsion)?r.nodeRepulsion(x):r.nodeRepulsion,o.layoutNodes.push(w),o.idToIndex[w.id]=h}for(var S=[],N=0,E=-1,T=[],h=0;h<o.nodeSize;h++){var x=o.layoutNodes[h],R=x.parentId;R!=null?o.layoutNodes[o.idToIndex[R]].children.push(x.id):(S[++E]=x.id,T.push(x.id))}for(o.graphSet.push(T);N<=E;){var A=S[N++],D=o.idToIndex[A],y=o.layoutNodes[D],_=y.children;if(_.length>0){o.graphSet.push(_);for(var h=0;h<_.length;h++)S[++E]=_[h]}}for(var h=0;h<o.graphSet.length;h++)for(var L=o.graphSet[h],m=0;m<L.length;m++){var M=o.idToIndex[L[m]];o.indexToGraph[M]=h}for(var h=0;h<o.edgeSize;h++){var z=a[h],B={};B.id=z.data("id"),B.sourceId=z.data("source"),B.targetId=z.data("target");var H=gn(r.idealEdgeLength)?r.idealEdgeLength(z):r.idealEdgeLength,G=gn(r.edgeElasticity)?r.edgeElasticity(z):r.edgeElasticity,U=o.idToIndex[B.sourceId],I=o.idToIndex[B.targetId],V=o.indexToGraph[U],K=o.indexToGraph[I];if(V!=K){for(var Q=jJ(B.sourceId,B.targetId,o),F=o.graphSet[Q],q=0,w=o.layoutNodes[U];F.indexOf(w.id)===-1;)w=o.layoutNodes[o.idToIndex[w.parentId]],q++;for(w=o.layoutNodes[I];F.indexOf(w.id)===-1;)w=o.layoutNodes[o.idToIndex[w.parentId]],q++;H*=q*r.nestingFactor}B.idealLength=H,B.elasticity=G,o.layoutEdges.push(B)}return o},jJ=function(t,n,r){var a=DL(t,n,0,r);return 2>a.count?0:a.graph},DL=function(t,n,r,a){var i=a.graphSet[r];if(-1<i.indexOf(t)&&-1<i.indexOf(n))return{count:2,graph:r};for(var l=0,o=0;o<i.length;o++){var f=i[o],c=a.idToIndex[f],h=a.layoutNodes[c].children;if(h.length!==0){var p=a.indexToGraph[a.idToIndex[h[0]]],m=DL(t,n,p,a);if(m.count!==0)if(m.count===1){if(l++,l===2)break}else return m}}return{count:l,graph:r}},AJ,RJ=function(t,n){for(var r=t.clientWidth,a=t.clientHeight,i=0;i<t.nodeSize;i++){var l=t.layoutNodes[i];l.children.length===0&&!l.isLocked&&(l.positionX=Math.random()*r,l.positionY=Math.random()*a)}},ML=function(t,n,r){var a=t.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(l){var o=t.layoutNodes[t.idToIndex[l.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(l,o){var f=t.layoutNodes[t.idToIndex[l.data("id")]];if(n.boundingBox){var c=i.w===0?.5:(f.positionX-i.x1)/i.w,h=i.h===0?.5:(f.positionY-i.y1)/i.h;return{x:a.x1+c*a.w,y:a.y1+h*a.h}}else return{x:f.positionX,y:f.positionY}}},DJ=function(t,n,r){var a=r.layout,i=r.eles.nodes(),l=ML(t,r,i);i.positions(l),t.ready!==!0&&(t.ready=!0,a.one("layoutready",r.ready),a.emit({type:"layoutready",layout:this}))},MJ=function(t,n,r){_J(t,n),PJ(t),BJ(t,n),zJ(t),IJ(t)},_J=function(t,n){for(var r=0;r<t.graphSet.length;r++)for(var a=t.graphSet[r],i=a.length,l=0;l<i;l++)for(var o=t.layoutNodes[t.idToIndex[a[l]]],f=l+1;f<i;f++){var c=t.layoutNodes[t.idToIndex[a[f]]];OJ(o,c,t,n)}},iA=function(t){return-1+2*t*Math.random()},OJ=function(t,n,r,a){var i=t.cmptId,l=n.cmptId;if(!(i!==l&&!r.isCompound)){var o=n.positionX-t.positionX,f=n.positionY-t.positionY,c=1;o===0&&f===0&&(o=iA(c),f=iA(c));var h=LJ(t,n,o,f);if(h>0)var p=a.nodeOverlap*h,m=Math.sqrt(o*o+f*f),y=p*o/m,x=p*f/m;else var b=Bp(t,o,f),w=Bp(n,-1*o,-1*f),S=w.x-b.x,N=w.y-b.y,E=S*S+N*N,m=Math.sqrt(E),p=(t.nodeRepulsion+n.nodeRepulsion)/E,y=p*S/m,x=p*N/m;t.isLocked||(t.offsetX-=y,t.offsetY-=x),n.isLocked||(n.offsetX+=y,n.offsetY+=x)}},LJ=function(t,n,r,a){if(r>0)var i=t.maxX-n.minX;else var i=n.maxX-t.minX;if(a>0)var l=t.maxY-n.minY;else var l=n.maxY-t.minY;return i>=0&&l>=0?Math.sqrt(i*i+l*l):0},Bp=function(t,n,r){var a=t.positionX,i=t.positionY,l=t.height||1,o=t.width||1,f=r/n,c=l/o,h={};return n===0&&0<r||n===0&&0>r?(h.x=a,h.y=i+l/2,h):0<n&&-1*c<=f&&f<=c?(h.x=a+o/2,h.y=i+o*r/2/n,h):0>n&&-1*c<=f&&f<=c?(h.x=a-o/2,h.y=i-o*r/2/n,h):0<r&&(f<=-1*c||f>=c)?(h.x=a+l*n/2/r,h.y=i+l/2,h):(0>r&&(f<=-1*c||f>=c)&&(h.x=a-l*n/2/r,h.y=i-l/2),h)},PJ=function(t,n){for(var r=0;r<t.edgeSize;r++){var a=t.layoutEdges[r],i=t.idToIndex[a.sourceId],l=t.layoutNodes[i],o=t.idToIndex[a.targetId],f=t.layoutNodes[o],c=f.positionX-l.positionX,h=f.positionY-l.positionY;if(!(c===0&&h===0)){var p=Bp(l,c,h),m=Bp(f,-1*c,-1*h),y=m.x-p.x,x=m.y-p.y,b=Math.sqrt(y*y+x*x),w=Math.pow(a.idealLength-b,2)/a.elasticity;if(b!==0)var S=w*y/b,N=w*x/b;else var S=0,N=0;l.isLocked||(l.offsetX+=S,l.offsetY+=N),f.isLocked||(f.offsetX-=S,f.offsetY-=N)}}},BJ=function(t,n){if(n.gravity!==0)for(var r=1,a=0;a<t.graphSet.length;a++){var i=t.graphSet[a],l=i.length;if(a===0)var o=t.clientHeight/2,f=t.clientWidth/2;else var c=t.layoutNodes[t.idToIndex[i[0]]],h=t.layoutNodes[t.idToIndex[c.parentId]],o=h.positionX,f=h.positionY;for(var p=0;p<l;p++){var m=t.layoutNodes[t.idToIndex[i[p]]];if(!m.isLocked){var y=o-m.positionX,x=f-m.positionY,b=Math.sqrt(y*y+x*x);if(b>r){var w=n.gravity*y/b,S=n.gravity*x/b;m.offsetX+=w,m.offsetY+=S}}}}},zJ=function(t,n){var r=[],a=0,i=-1;for(r.push.apply(r,t.graphSet[0]),i+=t.graphSet[0].length;a<=i;){var l=r[a++],o=t.idToIndex[l],f=t.layoutNodes[o],c=f.children;if(0<c.length&&!f.isLocked){for(var h=f.offsetX,p=f.offsetY,m=0;m<c.length;m++){var y=t.layoutNodes[t.idToIndex[c[m]]];y.offsetX+=h,y.offsetY+=p,r[++i]=c[m]}f.offsetX=0,f.offsetY=0}}},IJ=function(t,n){for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];if(!(0<a.children.length||a.isLocked)){var i=FJ(a.offsetX,a.offsetY,t.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,_L(a,t)}}for(var r=0;r<t.nodeSize;r++){var a=t.layoutNodes[r];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},FJ=function(t,n,r){var a=Math.sqrt(t*t+n*n);if(a>r)var i={x:r*t/a,y:r*n/a};else var i={x:t,y:n};return i},_L=function(t,n){var r=t.parentId;if(r!=null){var a=n.layoutNodes[n.idToIndex[r]],i=!1;if((a.maxX==null||t.maxX+a.padRight>a.maxX)&&(a.maxX=t.maxX+a.padRight,i=!0),(a.minX==null||t.minX-a.padLeft<a.minX)&&(a.minX=t.minX-a.padLeft,i=!0),(a.maxY==null||t.maxY+a.padBottom>a.maxY)&&(a.maxY=t.maxY+a.padBottom,i=!0),(a.minY==null||t.minY-a.padTop<a.minY)&&(a.minY=t.minY-a.padTop,i=!0),i)return _L(a,n)}},sA=function(t,n){for(var r=t.layoutNodes,a=[],i=0;i<r.length;i++){var l=r[i],o=l.cmptId,f=a[o]=a[o]||[];f.push(l)}for(var c=0,i=0;i<a.length;i++){var h=a[i];if(h){h.x1=1/0,h.x2=-1/0,h.y1=1/0,h.y2=-1/0;for(var p=0;p<h.length;p++){var m=h[p];h.x1=Math.min(h.x1,m.positionX-m.width/2),h.x2=Math.max(h.x2,m.positionX+m.width/2),h.y1=Math.min(h.y1,m.positionY-m.height/2),h.y2=Math.max(h.y2,m.positionY+m.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,c+=h.w*h.h}}a.sort(function(N,E){return E.w*E.h-N.w*N.h});for(var y=0,x=0,b=0,w=0,S=Math.sqrt(c)*t.clientWidth/t.clientHeight,i=0;i<a.length;i++){var h=a[i];if(h){for(var p=0;p<h.length;p++){var m=h[p];m.isLocked||(m.positionX+=y-h.x1,m.positionY+=x-h.y1)}y+=h.w+n.componentSpacing,b+=h.w+n.componentSpacing,w=Math.max(w,h.h),b>S&&(x+=w+n.componentSpacing,y=0,b=0,w=0)}}},UJ={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(t){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function OL(e){this.options=at({},UJ,e)}OL.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));var i=Dr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)r.nodes().layoutPositions(this,t,function(P){return{x:i.x1,y:i.y1}});else{var l=a.size(),o=Math.sqrt(l*i.h/i.w),f=Math.round(o),c=Math.round(i.w/i.h*o),h=function(Z){if(Z==null)return Math.min(f,c);var ae=Math.min(f,c);ae==f?f=Z:c=Z},p=function(Z){if(Z==null)return Math.max(f,c);var ae=Math.max(f,c);ae==f?f=Z:c=Z},m=t.rows,y=t.cols!=null?t.cols:t.columns;if(m!=null&&y!=null)f=m,c=y;else if(m!=null&&y==null)f=m,c=Math.ceil(l/f);else if(m==null&&y!=null)c=y,f=Math.ceil(l/c);else if(c*f>l){var x=h(),b=p();(x-1)*b>=l?h(x-1):(b-1)*x>=l&&p(b-1)}else for(;c*f<l;){var w=h(),S=p();(S+1)*w>=l?p(S+1):h(w+1)}var N=i.w/c,E=i.h/f;if(t.condense&&(N=0,E=0),t.avoidOverlap)for(var T=0;T<a.length;T++){var R=a[T],A=R._private.position;(A.x==null||A.y==null)&&(A.x=0,A.y=0);var D=R.layoutDimensions(t),_=t.avoidOverlapPadding,L=D.w+_,M=D.h+_;N=Math.max(N,L),E=Math.max(E,M)}for(var z={},B=function(Z,ae){return!!z["c-"+Z+"-"+ae]},H=function(Z,ae){z["c-"+Z+"-"+ae]=!0},G=0,U=0,I=function(){U++,U>=c&&(U=0,G++)},V={},K=0;K<a.length;K++){var Q=a[K],F=t.position(Q);if(F&&(F.row!==void 0||F.col!==void 0)){var q={row:F.row,col:F.col};if(q.col===void 0)for(q.col=0;B(q.row,q.col);)q.col++;else if(q.row===void 0)for(q.row=0;B(q.row,q.col);)q.row++;V[Q.id()]=q,H(q.row,q.col)}}var X=function(Z,ae){var ie,le;if(Z.locked()||Z.isParent())return!1;var ye=V[Z.id()];if(ye)ie=ye.col*N+N/2+i.x1,le=ye.row*E+E/2+i.y1;else{for(;B(G,U);)I();ie=U*N+N/2+i.x1,le=G*E+E/2+i.y1,H(G,U),I()}return{x:ie,y:le}};a.layoutPositions(this,t,X)}return this};var qJ={ready:function(){},stop:function(){}};function tS(e){this.options=at({},qJ,e)}tS.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this};tS.prototype.stop=function(){return this};var VJ={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function LL(e){this.options=at({},VJ,e)}LL.prototype.run=function(){var e=this.options,t=e.eles,n=t.nodes(),r=gn(e.positions);function a(i){if(e.positions==null)return fQ(i.position());if(r)return e.positions(i);var l=e.positions[i._private.data.id];return l??null}return n.layoutPositions(this,e,function(i,l){var o=a(i);return i.locked()||o==null?!1:o}),this};var HJ={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(t,n){return!0},ready:void 0,stop:void 0,transform:function(t,n){return n}};function PL(e){this.options=at({},HJ,e)}PL.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=Dr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),a=function(l,o){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,e,a),this};var GJ=[{name:"breadthfirst",impl:jL},{name:"circle",impl:AL},{name:"concentric",impl:RL},{name:"cose",impl:_m},{name:"grid",impl:OL},{name:"null",impl:tS},{name:"preset",impl:LL},{name:"random",impl:PL}];function BL(e){this.options=e,this.notifications=0}var lA=function(){},oA=function(){throw new Error("A headless instance can not render images")};BL.prototype={recalculateRenderedStyle:lA,notify:function(){this.notifications++},init:lA,isHeadless:function(){return!0},png:oA,jpg:oA};var nS={};nS.arrowShapeWidth=.3;nS.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(c,h,p,m,y,x,b){var w=y.x-p/2-b,S=y.x+p/2+b,N=y.y-p/2-b,E=y.y+p/2+b,T=w<=c&&c<=S&&N<=h&&h<=E;return T},r=function(c,h,p,m,y){var x=c*Math.cos(m)-h*Math.sin(m),b=c*Math.sin(m)+h*Math.cos(m),w=x*p,S=b*p,N=w+y.x,E=S+y.y;return{x:N,y:E}},a=function(c,h,p,m){for(var y=[],x=0;x<c.length;x+=2){var b=c[x],w=c[x+1];y.push(r(b,w,h,p,m))}return y},i=function(c){for(var h=[],p=0;p<c.length;p++){var m=c[p];h.push(m.x,m.y)}return h},l=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},o=function(c,h){tt(h)&&(h=e[h]),e[c]=at({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(m,y,x,b,w,S){var N=i(a(this.points,x+2*S,b,w)),E=$r(m,y,N);return E},roughCollide:n,draw:function(m,y,x,b){var w=a(this.points,y,x,b);t.arrowShapeImpl("polygon")(m,w)},spacing:function(m){return 0},gap:l},h)};o("none",{collide:Dp,roughCollide:Dp,draw:Uw,spacing:ST,gap:ST}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,h,p,m,y){var x=a(this.points,h,p,m),b=this.controlPoint,w=r(b[0],b[1],h,p,m);t.arrowShapeImpl(this.name)(c,x,w)},gap:function(c){return l(c)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,h,p,m,y,x,b){var w=i(a(this.points,p+2*b,m,y)),S=i(a(this.pointsTee,p+2*b,m,y)),N=$r(c,h,w)||$r(c,h,S);return N},draw:function(c,h,p,m,y){var x=a(this.points,h,p,m),b=a(this.pointsTee,h,p,m);t.arrowShapeImpl(this.name)(c,x,b)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,h,p,m,y,x,b){var w=y,S=Math.pow(w.x-c,2)+Math.pow(w.y-h,2)<=Math.pow((p+2*b)*this.radius,2),N=i(a(this.points,p+2*b,m,y));return $r(c,h,N)||S},draw:function(c,h,p,m,y){var x=a(this.pointsTr,h,p,m);t.arrowShapeImpl(this.name)(c,x,m.x,m.y,this.radius*h)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,h){var p=this.baseCrossLinePts.slice(),m=h/c,y=3,x=5;return p[y]=p[y]-m,p[x]=p[x]-m,p},collide:function(c,h,p,m,y,x,b){var w=i(a(this.points,p+2*b,m,y)),S=i(a(this.crossLinePts(p,x),p+2*b,m,y)),N=$r(c,h,w)||$r(c,h,S);return N},draw:function(c,h,p,m,y){var x=a(this.points,h,p,m),b=a(this.crossLinePts(h,y),h,p,m);t.arrowShapeImpl(this.name)(c,x,b)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return l(c)*.525}}),o("circle",{radius:.15,collide:function(c,h,p,m,y,x,b){var w=y,S=Math.pow(w.x-c,2)+Math.pow(w.y-h,2)<=Math.pow((p+2*b)*this.radius,2);return S},draw:function(c,h,p,m,y){t.arrowShapeImpl(this.name)(c,m.x,m.y,this.radius*h)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var Lo={};Lo.projectIntoViewport=function(e,t){var n=this.cy,r=this.findContainerClientCoords(),a=r[0],i=r[1],l=r[4],o=n.pan(),f=n.zoom(),c=((e-a)/l-o.x)/f,h=((t-i)/l-o.y)/f;return[c,h]};Lo.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(S){return parseFloat(n.getPropertyValue(S))},a={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},i={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},l=e.clientWidth,o=e.clientHeight,f=a.left+a.right,c=a.top+a.bottom,h=i.left+i.right,p=t.width/(l+h),m=l-f,y=o-c,x=t.left+a.left+i.left,b=t.top+a.top+i.top;return this.containerBB=[x,b,m,y,p]};Lo.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Lo.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]};Lo.findNearestElements=function(e,t,n,r){var a=this,i=this,l=i.getCachedZSortedEles(),o=[],f=i.cy.zoom(),c=i.cy.hasCompoundNodes(),h=(r?24:8)/f,p=(r?8:2)/f,m=(r?8:2)/f,y=1/0,x,b;n&&(l=l.interactive);function w(D,_){if(D.isNode()){if(b)return;b=D,o.push(D)}if(D.isEdge()&&(_==null||_<y))if(x){if(x.pstyle("z-compound-depth").value===D.pstyle("z-compound-depth").value&&x.pstyle("z-compound-depth").value===D.pstyle("z-compound-depth").value){for(var L=0;L<o.length;L++)if(o[L].isEdge()){o[L]=D,x=D,y=_??y;break}}}else o.push(D),x=D,y=_??y}function S(D){var _=D.outerWidth()+2*p,L=D.outerHeight()+2*p,M=_/2,z=L/2,B=D.position(),H=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,G=D._private.rscratch;if(B.x-M<=e&&e<=B.x+M&&B.y-z<=t&&t<=B.y+z){var U=i.nodeShapes[a.getNodeShape(D)];if(U.checkPoint(e,t,0,_,L,B.x,B.y,H,G))return w(D,0),!0}}function N(D){var _=D._private,L=_.rscratch,M=D.pstyle("width").pfValue,z=D.pstyle("arrow-scale").value,B=M/2+h,H=B*B,G=B*2,K=_.source,Q=_.target,U;if(L.edgeType==="segments"||L.edgeType==="straight"||L.edgeType==="haystack"){for(var I=L.allpts,V=0;V+3<I.length;V+=2)if(NQ(e,t,I[V],I[V+1],I[V+2],I[V+3],G)&&H>(U=RQ(e,t,I[V],I[V+1],I[V+2],I[V+3])))return w(D,U),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var I=L.allpts,V=0;V+5<L.allpts.length;V+=4)if(kQ(e,t,I[V],I[V+1],I[V+2],I[V+3],I[V+4],I[V+5],G)&&H>(U=AQ(e,t,I[V],I[V+1],I[V+2],I[V+3],I[V+4],I[V+5])))return w(D,U),!0}for(var K=K||_.source,Q=Q||_.target,F=a.getArrowWidth(M,z),q=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],V=0;V<q.length;V++){var X=q[V],P=i.arrowShapes[D.pstyle(X.name+"-arrow-shape").value],Z=D.pstyle("width").pfValue;if(P.roughCollide(e,t,F,X.angle,{x:X.x,y:X.y},Z,h)&&P.collide(e,t,F,X.angle,{x:X.x,y:X.y},Z,h))return w(D),!0}c&&o.length>0&&(S(K),S(Q))}function E(D,_,L){return Gr(D,_,L)}function T(D,_){var L=D._private,M=m,z;_?z=_+"-":z="",D.boundingBox();var B=L.labelBounds[_||"main"],H=D.pstyle(z+"label").value,G=D.pstyle("text-events").strValue==="yes";if(!(!G||!H)){var U=E(L.rscratch,"labelX",_),I=E(L.rscratch,"labelY",_),V=E(L.rscratch,"labelAngle",_),K=D.pstyle(z+"text-margin-x").pfValue,Q=D.pstyle(z+"text-margin-y").pfValue,F=B.x1-M-K,q=B.x2+M-K,X=B.y1-M-Q,P=B.y2+M-Q;if(V){var Z=Math.cos(V),ae=Math.sin(V),ie=function(ge,Te){return ge=ge-U,Te=Te-I,{x:ge*Z-Te*ae+U,y:ge*ae+Te*Z+I}},le=ie(F,X),ye=ie(F,P),ne=ie(q,X),W=ie(q,P),J=[le.x+K,le.y+Q,ne.x+K,ne.y+Q,W.x+K,W.y+Q,ye.x+K,ye.y+Q];if($r(e,t,J))return w(D),!0}else if(cl(B,e,t))return w(D),!0}}for(var R=l.length-1;R>=0;R--){var A=l[R];A.isNode()?S(A)||T(A):N(A)||T(A)||T(A,"source")||T(A,"target")}return o};Lo.getAllInBox=function(e,t,n,r){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),l=2/i,o=[],f=Math.min(e,n),c=Math.max(e,n),h=Math.min(t,r),p=Math.max(t,r);e=f,n=c,t=h,r=p;var m=Dr({x1:e,y1:t,x2:n,y2:r}),y=[{x:m.x1,y:m.y1},{x:m.x2,y:m.y1},{x:m.x2,y:m.y2},{x:m.x1,y:m.y2}],x=[[y[0],y[1]],[y[1],y[2]],[y[2],y[3]],[y[3],y[0]]];function b(ge,Te,Be){return Gr(ge,Te,Be)}function w(ge,Te){var Be=ge._private,ot=l,Je="";ge.boundingBox();var We=Be.labelBounds.main;if(!We)return null;var Ve=b(Be.rscratch,"labelX",Te),De=b(Be.rscratch,"labelY",Te),Ye=b(Be.rscratch,"labelAngle",Te),Qe=ge.pstyle(Je+"text-margin-x").pfValue,st=ge.pstyle(Je+"text-margin-y").pfValue,ze=We.x1-ot-Qe,dt=We.x2+ot-Qe,he=We.y1-ot-st,Ce=We.y2+ot-st;if(Ye){var Me=Math.cos(Ye),Fe=Math.sin(Ye),_e=function(xe,Y){return xe=xe-Ve,Y=Y-De,{x:xe*Me-Y*Fe+Ve,y:xe*Fe+Y*Me+De}};return[_e(ze,he),_e(dt,he),_e(dt,Ce),_e(ze,Ce)]}else return[{x:ze,y:he},{x:dt,y:he},{x:dt,y:Ce},{x:ze,y:Ce}]}function S(ge,Te,Be,ot){function Je(We,Ve,De){return(De.y-We.y)*(Ve.x-We.x)>(Ve.y-We.y)*(De.x-We.x)}return Je(ge,Be,ot)!==Je(Te,Be,ot)&&Je(ge,Te,Be)!==Je(ge,Te,ot)}for(var N=0;N<a.length;N++){var E=a[N];if(E.isNode()){var T=E,R=T.pstyle("text-events").strValue==="yes",A=T.pstyle("box-selection").strValue,D=T.pstyle("box-select-labels").strValue==="yes";if(A==="none")continue;var _=(A==="overlap"||D)&&R,L=T.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:_});if(A==="contain"){var M=!1;if(D&&R){var z=w(T);z&&Xx(z,y)&&(o.push(T),M=!0)}!M&&HO(m,L)&&o.push(T)}else if(A==="overlap"&&Gw(m,L)){var B=T.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),H=[{x:B.x1,y:B.y1},{x:B.x2,y:B.y1},{x:B.x2,y:B.y2},{x:B.x1,y:B.y2}];if(Xx(H,y))o.push(T);else{var G=w(T);G&&Xx(G,y)&&o.push(T)}}}else{var U=E,I=U._private,V=I.rscratch,K=U.pstyle("box-selection").strValue;if(K==="none")continue;if(K==="contain"){if(V.startX!=null&&V.startY!=null&&!cl(m,V.startX,V.startY)||V.endX!=null&&V.endY!=null&&!cl(m,V.endX,V.endY))continue;if(V.edgeType==="bezier"||V.edgeType==="multibezier"||V.edgeType==="self"||V.edgeType==="compound"||V.edgeType==="segments"||V.edgeType==="haystack"){for(var Q=I.rstyle.bezierPts||I.rstyle.linePts||I.rstyle.haystackPts,F=!0,q=0;q<Q.length;q++)if(!TT(m,Q[q])){F=!1;break}F&&o.push(U)}else V.edgeType==="straight"&&o.push(U)}else if(K==="overlap"){var X=!1;if(V.startX!=null&&V.startY!=null&&V.endX!=null&&V.endY!=null&&(cl(m,V.startX,V.startY)||cl(m,V.endX,V.endY)))o.push(U),X=!0;else if(!X&&V.edgeType==="haystack"){for(var P=I.rstyle.haystackPts,Z=0;Z<P.length;Z++)if(TT(m,P[Z])){o.push(U),X=!0;break}}if(!X){var ae=I.rstyle.bezierPts||I.rstyle.linePts||I.rstyle.haystackPts;if((!ae||ae.length<2)&&V.edgeType==="straight"&&V.startX!=null&&V.startY!=null&&V.endX!=null&&V.endY!=null&&(ae=[{x:V.startX,y:V.startY},{x:V.endX,y:V.endY}]),!ae||ae.length<2)continue;for(var ie=0;ie<ae.length-1;ie++){for(var le=ae[ie],ye=ae[ie+1],ne=0;ne<x.length;ne++){var W=Bn(x[ne],2),J=W[0],se=W[1];if(S(le,ye,J,se)){o.push(U),X=!0;break}}if(X)break}}}}}return o};var zp={};zp.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType==="haystack",r=t.edgeType==="bezier",a=t.edgeType==="multibezier",i=t.edgeType==="segments",l=t.edgeType==="compound",o=t.edgeType==="self",f,c,h,p,m,y,S,N;if(n?(h=t.haystackPts[0],p=t.haystackPts[1],m=t.haystackPts[2],y=t.haystackPts[3]):(h=t.arrowStartX,p=t.arrowStartY,m=t.arrowEndX,y=t.arrowEndY),S=t.midX,N=t.midY,i)f=h-t.segpts[0],c=p-t.segpts[1];else if(a||l||o||r){var x=t.allpts,b=er(x[0],x[2],x[4],.1),w=er(x[1],x[3],x[5],.1);f=h-b,c=p-w}else f=h-S,c=p-N;t.srcArrowAngle=Av(f,c);var S=t.midX,N=t.midY;if(n&&(S=(h+m)/2,N=(p+y)/2),f=m-h,c=y-p,i){var x=t.allpts;if(x.length/2%2===0){var E=x.length/2,T=E-2;f=x[E]-x[T],c=x[E+1]-x[T+1]}else if(t.isRound)f=t.midVector[1],c=-t.midVector[0];else{var E=x.length/2-1,T=E-2;f=x[E]-x[T],c=x[E+1]-x[T+1]}}else if(a||l||o){var x=t.allpts,R=t.ctrlpts,A,D,_,L;if(R.length/2%2===0){var M=x.length/2-1,z=M+2,B=z+2;A=er(x[M],x[z],x[B],0),D=er(x[M+1],x[z+1],x[B+1],0),_=er(x[M],x[z],x[B],1e-4),L=er(x[M+1],x[z+1],x[B+1],1e-4)}else{var z=x.length/2-1,M=z-2,B=z+2;A=er(x[M],x[z],x[B],.4999),D=er(x[M+1],x[z+1],x[B+1],.4999),_=er(x[M],x[z],x[B],.5),L=er(x[M+1],x[z+1],x[B+1],.5)}f=_-A,c=L-D}if(t.midtgtArrowAngle=Av(f,c),t.midDispX=f,t.midDispY=c,f*=-1,c*=-1,i){var x=t.allpts;if(x.length/2%2!==0){if(!t.isRound){var E=x.length/2-1,H=E+2;f=-(x[H]-x[E]),c=-(x[H+1]-x[E+1])}}}if(t.midsrcArrowAngle=Av(f,c),i)f=m-t.segpts[t.segpts.length-2],c=y-t.segpts[t.segpts.length-1];else if(a||l||o||r){var x=t.allpts,G=x.length,b=er(x[G-6],x[G-4],x[G-2],.9),w=er(x[G-5],x[G-3],x[G-1],.9);f=m-b,c=y-w}else f=m-S,c=y-N;t.tgtArrowAngle=Av(f,c)};zp.getArrowWidth=zp.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(e*13.37,.9),29)*t,n[e+", "+t]=r,r)};var h1,v1,li={},ka={},uA,cA,io,op,$i,eo,ro,ai,ju,Bv,zL,IL,p1,m1,fA,dA=function(t,n,r){r.x=n.x-t.x,r.y=n.y-t.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},$J=function(t,n){n.x=t.x*-1,n.y=t.y*-1,n.nx=t.nx*-1,n.ny=t.ny*-1,n.ang=t.ang>0?-(Math.PI-t.ang):Math.PI+t.ang},KJ=function(t,n,r,a,i){if(t!==fA?dA(n,t,li):$J(ka,li),dA(n,r,ka),uA=li.nx*ka.ny-li.ny*ka.nx,cA=li.nx*ka.nx-li.ny*-ka.ny,$i=Math.asin(Math.max(-1,Math.min(1,uA))),Math.abs($i)<1e-6){h1=n.x,v1=n.y,ro=ju=0;return}io=1,op=!1,cA<0?$i<0?$i=Math.PI+$i:($i=Math.PI-$i,io=-1,op=!0):$i>0&&(io=-1,op=!0),n.radius!==void 0?ju=n.radius:ju=a,eo=$i/2,Bv=Math.min(li.len/2,ka.len/2),i?(ai=Math.abs(Math.cos(eo)*ju/Math.sin(eo)),ai>Bv?(ai=Bv,ro=Math.abs(ai*Math.sin(eo)/Math.cos(eo))):ro=ju):(ai=Math.min(Bv,ju),ro=Math.abs(ai*Math.sin(eo)/Math.cos(eo))),p1=n.x+ka.nx*ai,m1=n.y+ka.ny*ai,h1=p1-ka.ny*ro*io,v1=m1+ka.nx*ro*io,zL=n.x+li.nx*ai,IL=n.y+li.ny*ai,fA=n};function FL(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function rS(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(KJ(e,t,n,r,a),{cx:h1,cy:v1,radius:ro,startX:zL,startY:IL,stopX:p1,stopY:m1,startAngle:li.ang+Math.PI/2*io,endAngle:ka.ang-Math.PI/2*io,counterClockwise:op})}var xd=.01,YJ=Math.sqrt(2*xd),Cr={};Cr.findMidptPtsEtc=function(e,t){var n=t.posPts,r=t.intersectionPts,a=t.vectorNormInverse,i,l=e.pstyle("source-endpoint"),o=e.pstyle("target-endpoint"),f=l.units!=null&&o.units!=null,c=function(R,A,D,_){var L=_-A,M=D-R,z=Math.sqrt(M*M+L*L);return{x:-L/z,y:M/z}},h=e.pstyle("edge-distances").value;switch(h){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(f){var p=this.manualEndptToPx(e.source()[0],l),m=Bn(p,2),y=m[0],x=m[1],b=this.manualEndptToPx(e.target()[0],o),w=Bn(b,2),S=w[0],N=w[1],E={x1:y,y1:x,x2:S,y2:N};a=c(y,x,S,N),i=E}else zt("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=r;break}}return{midptPts:i,vectorNormInverse:a}};Cr.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,a=r.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var l=r.source,o=r.target,f=l.position(),c=o.position(),h=l.width(),p=o.width(),m=l.height(),y=o.height(),x=n.pstyle("haystack-radius").value,b=x/2;a.haystackPts=a.allpts=[a.source.x*h*b+f.x,a.source.y*m*b+f.y,a.target.x*p*b+c.x,a.target.y*y*b+c.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}};Cr.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle("segment-weights"),a=e.pstyle("segment-distances"),i=e.pstyle("segment-radii"),l=e.pstyle("radius-type"),o=Math.min(r.pfValue.length,a.pfValue.length),f=i.pfValue[i.pfValue.length-1],c=l.pfValue[l.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var h=0;h<o;h++){var p=r.pfValue[h],m=a.pfValue[h],y=1-p,x=p,b=this.findMidptPtsEtc(e,t),w=b.midptPts,S=b.vectorNormInverse,N={x:w.x1*y+w.x2*x,y:w.y1*y+w.y2*x};n.segpts.push(N.x+S.x*m,N.y+S.y*m),n.radii.push(i.pfValue[h]!==void 0?i.pfValue[h]:f),n.isArcRadius.push((l.pfValue[h]!==void 0?l.pfValue[h]:c)==="arc-radius")}};Cr.findLoopPoints=function(e,t,n,r){var a=e._private.rscratch,i=t.dirCounts,l=t.srcPos,o=e.pstyle("control-point-distances"),f=o?o.pfValue[0]:void 0,c=e.pstyle("loop-direction").pfValue,h=e.pstyle("loop-sweep").pfValue,p=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var m=n,y=p;r&&(m=0,y=f);var x=c-Math.PI/2,b=x-h/2,w=x+h/2,S=c+"_"+h;m=i[S]===void 0?i[S]=0:++i[S],a.ctrlpts=[l.x+Math.cos(b)*1.4*y*(m/3+1),l.y+Math.sin(b)*1.4*y*(m/3+1),l.x+Math.cos(w)*1.4*y*(m/3+1),l.y+Math.sin(w)*1.4*y*(m/3+1)]};Cr.findCompoundLoopPoints=function(e,t,n,r){var a=e._private.rscratch;a.edgeType="compound";var i=t.srcPos,l=t.tgtPos,o=t.srcW,f=t.srcH,c=t.tgtW,h=t.tgtH,p=e.pstyle("control-point-step-size").pfValue,m=e.pstyle("control-point-distances"),y=m?m.pfValue[0]:void 0,x=n,b=p;r&&(x=0,b=y);var w=50,S={x:i.x-o/2,y:i.y-f/2},N={x:l.x-c/2,y:l.y-h/2},E={x:Math.min(S.x,N.x),y:Math.min(S.y,N.y)},T=.5,R=Math.max(T,Math.log(o*xd)),A=Math.max(T,Math.log(c*xd));a.ctrlpts=[E.x,E.y-(1+Math.pow(w,1.12)/100)*b*(x/3+1)*R,E.x-(1+Math.pow(w,1.12)/100)*b*(x/3+1)*A,E.y]};Cr.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"};Cr.findBezierPoints=function(e,t,n,r,a){var i=e._private.rscratch,l=e.pstyle("control-point-step-size").pfValue,o=e.pstyle("control-point-distances"),f=e.pstyle("control-point-weights"),c=o&&f?Math.min(o.value.length,f.value.length):1,h=o?o.pfValue[0]:void 0,p=f.value[0],m=r;i.edgeType=m?"multibezier":"bezier",i.ctrlpts=[];for(var y=0;y<c;y++){var x=(.5-t.eles.length/2+n)*l*(a?-1:1),b=void 0,w=Hw(x);m&&(h=o?o.pfValue[y]:l,p=f.value[y]),r?b=h:b=h!==void 0?w*h:void 0;var S=b!==void 0?b:x,N=1-p,E=p,T=this.findMidptPtsEtc(e,t),R=T.midptPts,A=T.vectorNormInverse,D={x:R.x1*N+R.x2*E,y:R.y1*N+R.y2*E};i.ctrlpts.push(D.x+A.x*S,D.y+A.y*S)}};Cr.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",a="horizontal",i="leftward",l="rightward",o="downward",f="upward",c="auto",h=t.posPts,p=t.srcW,m=t.srcH,y=t.tgtW,x=t.tgtH,b=e.pstyle("edge-distances").value,w=b!=="node-position",S=e.pstyle("taxi-direction").value,N=S,E=e.pstyle("taxi-turn"),T=E.units==="%",R=E.pfValue,A=R<0,D=e.pstyle("taxi-turn-min-distance").pfValue,_=w?(p+y)/2:0,L=w?(m+x)/2:0,M=h.x2-h.x1,z=h.y2-h.y1,B=function(Y,ue){return Y>0?Math.max(Y-ue,0):Math.min(Y+ue,0)},H=B(M,_),G=B(z,L),U=!1;N===c?S=Math.abs(H)>Math.abs(G)?a:r:N===f||N===o?(S=r,U=!0):(N===i||N===l)&&(S=a,U=!0);var I=S===r,V=I?G:H,K=I?z:M,Q=Hw(K),F=!1;!(U&&(T||A))&&(N===o&&K<0||N===f&&K>0||N===i&&K>0||N===l&&K<0)&&(Q*=-1,V=Q*Math.abs(V),F=!0);var q;if(T){var X=R<0?1+R:R;q=X*V}else{var P=R<0?V:0;q=P+R*Q}var Z=function(Y){return Math.abs(Y)<D||Math.abs(Y)>=Math.abs(V)},ae=Z(q),ie=Z(Math.abs(V)-Math.abs(q)),le=ae||ie;if(le&&!F)if(I){var ye=Math.abs(K)<=m/2,ne=Math.abs(M)<=y/2;if(ye){var W=(h.x1+h.x2)/2,J=h.y1,se=h.y2;n.segpts=[W,J,W,se]}else if(ne){var ge=(h.y1+h.y2)/2,Te=h.x1,Be=h.x2;n.segpts=[Te,ge,Be,ge]}else n.segpts=[h.x1,h.y2]}else{var ot=Math.abs(K)<=p/2,Je=Math.abs(z)<=x/2;if(ot){var We=(h.y1+h.y2)/2,Ve=h.x1,De=h.x2;n.segpts=[Ve,We,De,We]}else if(Je){var Ye=(h.x1+h.x2)/2,Qe=h.y1,st=h.y2;n.segpts=[Ye,Qe,Ye,st]}else n.segpts=[h.x2,h.y1]}else if(I){var ze=h.y1+q+(w?m/2*Q:0),dt=h.x1,he=h.x2;n.segpts=[dt,ze,he,ze]}else{var Ce=h.x1+q+(w?p/2*Q:0),Me=h.y1,Fe=h.y2;n.segpts=[Ce,Me,Ce,Fe]}if(n.isRound){var _e=e.pstyle("taxi-radius").value,Oe=e.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(_e),n.isArcRadius=new Array(n.segpts.length/2).fill(Oe)}};Cr.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType==="bezier"){var r=t.srcPos,a=t.tgtPos,i=t.srcW,l=t.srcH,o=t.tgtW,f=t.tgtH,c=t.srcShape,h=t.tgtShape,p=t.srcCornerRadius,m=t.tgtCornerRadius,y=t.srcRs,x=t.tgtRs,b=!Re(n.startX)||!Re(n.startY),w=!Re(n.arrowStartX)||!Re(n.arrowStartY),S=!Re(n.endX)||!Re(n.endY),N=!Re(n.arrowEndX)||!Re(n.arrowEndY),E=3,T=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,R=E*T,A=Ao({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),D=A<R,_=Ao({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),L=_<R,M=!1;if(b||w||D){M=!0;var z={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},B=Math.sqrt(z.x*z.x+z.y*z.y),H={x:z.x/B,y:z.y/B},G=Math.max(i,l),U={x:n.ctrlpts[0]+H.x*2*G,y:n.ctrlpts[1]+H.y*2*G},I=c.intersectLine(r.x,r.y,i,l,U.x,U.y,0,p,y);D?(n.ctrlpts[0]=n.ctrlpts[0]+H.x*(R-A),n.ctrlpts[1]=n.ctrlpts[1]+H.y*(R-A)):(n.ctrlpts[0]=I[0]+H.x*R,n.ctrlpts[1]=I[1]+H.y*R)}if(S||N||L){M=!0;var V={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},K=Math.sqrt(V.x*V.x+V.y*V.y),Q={x:V.x/K,y:V.y/K},F=Math.max(i,l),q={x:n.ctrlpts[0]+Q.x*2*F,y:n.ctrlpts[1]+Q.y*2*F},X=h.intersectLine(a.x,a.y,o,f,q.x,q.y,0,m,x);L?(n.ctrlpts[0]=n.ctrlpts[0]+Q.x*(R-_),n.ctrlpts[1]=n.ctrlpts[1]+Q.y*(R-_)):(n.ctrlpts[0]=X[0]+Q.x*R,n.ctrlpts[1]=X[1]+Q.y*R)}M&&this.findEndpoints(e)}};Cr.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);t.allpts.push(t.endX,t.endY);var r,a;t.ctrlpts.length/2%2===0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,a=.5,t.midX=er(t.allpts[r],t.allpts[r+2],t.allpts[r+4],a),t.midY=er(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],a))}else if(t.edgeType==="straight")t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType==="segments"){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var i=2;i+3<t.allpts.length;i+=2){var l=t.radii[i/2-1],o=t.isArcRadius[i/2-1];t.roundCorners.push(rS({x:t.allpts[i-2],y:t.allpts[i-1]},{x:t.allpts[i],y:t.allpts[i+1],radius:l},{x:t.allpts[i+2],y:t.allpts[i+3]},l,o))}}if(t.segpts.length%4===0){var f=t.segpts.length/2,c=f-2;t.midX=(t.segpts[c]+t.segpts[f])/2,t.midY=(t.segpts[c+1]+t.segpts[f+1])/2}else{var h=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[h],t.midY=t.segpts[h+1];else{var p={x:t.segpts[h],y:t.segpts[h+1]},m=t.roundCorners[h/2];if(m.radius===0){var y={x:t.segpts[h+2],y:t.segpts[h+3]};t.midX=p.x,t.midY=p.y,t.midVector=[p.y-y.y,y.x-p.x]}else{var x=[p.x-m.cx,p.y-m.cy],b=m.radius/Math.sqrt(Math.pow(x[0],2)+Math.pow(x[1],2));x=x.map(function(w){return w*b}),t.midX=m.cx+x[0],t.midY=m.cy+x[1],t.midVector=x}}}}};Cr.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Re(t.startX)&&Re(t.startY)&&Re(t.endX)&&Re(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,zt("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};Cr.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,r=n.cy,a=r.hasCompoundNodes(),i=new ts,l=function(L,M){return[].concat(jp(L),[M?1:0]).join("-")},o=[],f=[],c=0;c<e.length;c++){var h=e[c],p=h._private,m=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(m==="haystack"){f.push(h);continue}var y=m==="unbundled-bezier"||ul(m,"segments")||m==="straight"||m==="straight-triangle"||ul(m,"taxi"),x=m==="unbundled-bezier"||m==="bezier",b=p.source,w=p.target,S=b.poolIndex(),N=w.poolIndex(),E=[S,N].sort(),T=l(E,y),R=i.get(T);R==null&&(R={eles:[]},o.push({pairId:E,edgeIsUnbundled:y}),i.set(T,R)),R.eles.push(h),y&&(R.hasUnbundled=!0),x&&(R.hasBezier=!0)}}for(var A=function(){var L=o[D],M=L.pairId,z=L.edgeIsUnbundled,B=l(M,z),H=i.get(B),G;if(!H.hasUnbundled){var U=H.eles[0].parallelEdges().filter(function(Oe){return Oe.isBundledBezier()});qw(H.eles),U.forEach(function(Oe){return H.eles.push(Oe)}),H.eles.sort(function(Oe,xe){return Oe.poolIndex()-xe.poolIndex()})}var I=H.eles[0],V=I.source(),K=I.target();if(V.poolIndex()>K.poolIndex()){var Q=V;V=K,K=Q}var F=H.srcPos=V.position(),q=H.tgtPos=K.position(),X=H.srcW=V.outerWidth(),P=H.srcH=V.outerHeight(),Z=H.tgtW=K.outerWidth(),ae=H.tgtH=K.outerHeight(),ie=H.srcShape=n.nodeShapes[t.getNodeShape(V)],le=H.tgtShape=n.nodeShapes[t.getNodeShape(K)],ye=H.srcCornerRadius=V.pstyle("corner-radius").value==="auto"?"auto":V.pstyle("corner-radius").pfValue,ne=H.tgtCornerRadius=K.pstyle("corner-radius").value==="auto"?"auto":K.pstyle("corner-radius").pfValue,W=H.tgtRs=K._private.rscratch,J=H.srcRs=V._private.rscratch;H.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var se=0;se<H.eles.length;se++){var ge=H.eles[se],Te=ge[0]._private.rscratch,Be=ge.pstyle("curve-style").value,ot=Be==="unbundled-bezier"||ul(Be,"segments")||ul(Be,"taxi"),Je=!V.same(ge.source());if(!H.calculatedIntersection&&V!==K&&(H.hasBezier||H.hasUnbundled)){H.calculatedIntersection=!0;var We=ie.intersectLine(F.x,F.y,X,P,q.x,q.y,0,ye,J),Ve=H.srcIntn=We,De=le.intersectLine(q.x,q.y,Z,ae,F.x,F.y,0,ne,W),Ye=H.tgtIntn=De,Qe=H.intersectionPts={x1:We[0],x2:De[0],y1:We[1],y2:De[1]},st=H.posPts={x1:F.x,x2:q.x,y1:F.y,y2:q.y},ze=De[1]-We[1],dt=De[0]-We[0],he=Math.sqrt(dt*dt+ze*ze);Re(he)&&he>=YJ||(he=Math.sqrt(Math.max(dt*dt,xd)+Math.max(ze*ze,xd)));var Ce=H.vector={x:dt,y:ze},Me=H.vectorNorm={x:Ce.x/he,y:Ce.y/he},Fe={x:-Me.y,y:Me.x};H.nodesOverlap=!Re(he)||le.checkPoint(We[0],We[1],0,Z,ae,q.x,q.y,ne,W)||ie.checkPoint(De[0],De[1],0,X,P,F.x,F.y,ye,J),H.vectorNormInverse=Fe,G={nodesOverlap:H.nodesOverlap,dirCounts:H.dirCounts,calculatedIntersection:!0,hasBezier:H.hasBezier,hasUnbundled:H.hasUnbundled,eles:H.eles,srcPos:q,srcRs:W,tgtPos:F,tgtRs:J,srcW:Z,srcH:ae,tgtW:X,tgtH:P,srcIntn:Ye,tgtIntn:Ve,srcShape:le,tgtShape:ie,posPts:{x1:st.x2,y1:st.y2,x2:st.x1,y2:st.y1},intersectionPts:{x1:Qe.x2,y1:Qe.y2,x2:Qe.x1,y2:Qe.y1},vector:{x:-Ce.x,y:-Ce.y},vectorNorm:{x:-Me.x,y:-Me.y},vectorNormInverse:{x:-Fe.x,y:-Fe.y}}}var _e=Je?G:H;Te.nodesOverlap=_e.nodesOverlap,Te.srcIntn=_e.srcIntn,Te.tgtIntn=_e.tgtIntn,Te.isRound=Be.startsWith("round"),a&&(V.isParent()||V.isChild()||K.isParent()||K.isChild())&&(V.parents().anySame(K)||K.parents().anySame(V)||V.same(K)&&V.isParent())?t.findCompoundLoopPoints(ge,_e,se,ot):V===K?t.findLoopPoints(ge,_e,se,ot):Be.endsWith("segments")?t.findSegmentsPoints(ge,_e):Be.endsWith("taxi")?t.findTaxiPoints(ge,_e):Be==="straight"||!ot&&H.eles.length%2===1&&se===Math.floor(H.eles.length/2)?t.findStraightEdgePoints(ge):t.findBezierPoints(ge,_e,se,ot,Je),t.findEndpoints(ge),t.tryToCorrectInvalidPoints(ge,_e),t.checkForInvalidEdgeWarning(ge),t.storeAllpts(ge),t.storeEdgeProjections(ge),t.calculateArrowAngles(ge),t.recalculateEdgeLabelProjections(ge),t.calculateLabelAngles(ge)}},D=0;D<o.length;D++)A();this.findHaystackPoints(f)}};function UL(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1];t.push({x:r,y:a})}return t}}Cr.getSegmentPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n==="segments")return UL(t.segpts)};Cr.getControlPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return UL(t.ctrlpts)};Cr.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Qd={};Qd.manualEndptToPx=function(e,t){var n=this,r=e.position(),a=e.outerWidth(),i=e.outerHeight(),l=e._private.rscratch;if(t.value.length===2){var o=[t.pfValue[0],t.pfValue[1]];return t.units[0]==="%"&&(o[0]=o[0]*a),t.units[1]==="%"&&(o[1]=o[1]*i),o[0]+=r.x,o[1]+=r.y,o}else{var f=t.pfValue[0];f=-Math.PI/2+f;var c=2*Math.max(a,i),h=[r.x+Math.cos(f)*c,r.y+Math.sin(f)*c];return n.nodeShapes[this.getNodeShape(e)].intersectLine(r.x,r.y,a,i,h[0],h[1],0,e.pstyle("corner-radius").value==="auto"?"auto":e.pstyle("corner-radius").pfValue,l)}};Qd.findEndpoints=function(e){var t,n,r,a,i=this,l,o=e.source()[0],f=e.target()[0],c=o.position(),h=f.position(),p=e.pstyle("target-arrow-shape").value,m=e.pstyle("source-arrow-shape").value,y=e.pstyle("target-distance-from-node").pfValue,x=e.pstyle("source-distance-from-node").pfValue,b=o._private.rscratch,w=f._private.rscratch,S=e.pstyle("curve-style").value,N=e._private.rscratch,E=N.edgeType,T=ul(S,"taxi"),R=E==="self"||E==="compound",A=E==="bezier"||E==="multibezier"||R,D=E!=="bezier",_=E==="straight"||E==="segments",L=E==="segments",M=A||D||_,z=R||T,B=e.pstyle("source-endpoint"),H=z?"outside-to-node":B.value,G=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,U=e.pstyle("target-endpoint"),I=z?"outside-to-node":U.value,V=f.pstyle("corner-radius").value==="auto"?"auto":f.pstyle("corner-radius").pfValue;N.srcManEndpt=B,N.tgtManEndpt=U;var K,Q,F,q,X=(t=(U==null||(n=U.pfValue)===null||n===void 0?void 0:n.length)===2?U.pfValue:null)!==null&&t!==void 0?t:[0,0],P=(r=(B==null||(a=B.pfValue)===null||a===void 0?void 0:a.length)===2?B.pfValue:null)!==null&&r!==void 0?r:[0,0];if(A){var Z=[N.ctrlpts[0],N.ctrlpts[1]],ae=D?[N.ctrlpts[N.ctrlpts.length-2],N.ctrlpts[N.ctrlpts.length-1]]:Z;K=ae,Q=Z}else if(_){var ie=L?N.segpts.slice(0,2):[h.x+X[0],h.y+X[1]],le=L?N.segpts.slice(N.segpts.length-2):[c.x+P[0],c.y+P[1]];K=le,Q=ie}if(I==="inside-to-node")l=[h.x,h.y];else if(U.units)l=this.manualEndptToPx(f,U);else if(I==="outside-to-line")l=N.tgtIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?F=K:(I==="outside-to-line"||I==="outside-to-line-or-label")&&(F=[c.x,c.y]),l=i.nodeShapes[this.getNodeShape(f)].intersectLine(h.x,h.y,f.outerWidth(),f.outerHeight(),F[0],F[1],0,V,w),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var ye=f._private.rscratch,ne=ye.labelWidth,W=ye.labelHeight,J=ye.labelX,se=ye.labelY,ge=ne/2,Te=W/2,Be=f.pstyle("text-valign").value;Be==="top"?se-=Te:Be==="bottom"&&(se+=Te);var ot=f.pstyle("text-halign").value;ot==="left"?J-=ge:ot==="right"&&(J+=ge);var Je=vd(F[0],F[1],[J-ge,se-Te,J+ge,se-Te,J+ge,se+Te,J-ge,se+Te],h.x,h.y);if(Je.length>0){var We=c,Ve=no(We,Lu(l)),De=no(We,Lu(Je)),Ye=Ve;if(De<Ve&&(l=Je,Ye=De),Je.length>2){var Qe=no(We,{x:Je[2],y:Je[3]});Qe<Ye&&(l=[Je[2],Je[3]])}}}var st=Rv(l,K,i.arrowShapes[p].spacing(e)+y),ze=Rv(l,K,i.arrowShapes[p].gap(e)+y);if(N.endX=ze[0],N.endY=ze[1],N.arrowEndX=st[0],N.arrowEndY=st[1],H==="inside-to-node")l=[c.x,c.y];else if(B.units)l=this.manualEndptToPx(o,B);else if(H==="outside-to-line")l=N.srcIntn;else if(H==="outside-to-node"||H==="outside-to-node-or-label"?q=Q:(H==="outside-to-line"||H==="outside-to-line-or-label")&&(q=[h.x,h.y]),l=i.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),q[0],q[1],0,G,b),H==="outside-to-node-or-label"||H==="outside-to-line-or-label"){var dt=o._private.rscratch,he=dt.labelWidth,Ce=dt.labelHeight,Me=dt.labelX,Fe=dt.labelY,_e=he/2,Oe=Ce/2,xe=o.pstyle("text-valign").value;xe==="top"?Fe-=Oe:xe==="bottom"&&(Fe+=Oe);var Y=o.pstyle("text-halign").value;Y==="left"?Me-=_e:Y==="right"&&(Me+=_e);var ue=vd(q[0],q[1],[Me-_e,Fe-Oe,Me+_e,Fe-Oe,Me+_e,Fe+Oe,Me-_e,Fe+Oe],c.x,c.y);if(ue.length>0){var pe=h,de=no(pe,Lu(l)),be=no(pe,Lu(ue)),Le=de;if(be<de&&(l=[ue[0],ue[1]],Le=be),ue.length>2){var Ne=no(pe,{x:ue[2],y:ue[3]});Ne<Le&&(l=[ue[2],ue[3]])}}}var Ke=Rv(l,Q,i.arrowShapes[m].spacing(e)+x),Ue=Rv(l,Q,i.arrowShapes[m].gap(e)+x);N.startX=Ue[0],N.startY=Ue[1],N.arrowStartX=Ke[0],N.arrowStartY=Ke[1],M&&(!Re(N.startX)||!Re(N.startY)||!Re(N.endX)||!Re(N.endY)?N.badLine=!0:N.badLine=!1)};Qd.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}};Qd.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var aS={};function XJ(e,t,n){for(var r=function(c,h,p,m){return er(c,h,p,m)},a=t._private,i=a.rstyle.bezierPts,l=0;l<e.bezierProjPcts.length;l++){var o=e.bezierProjPcts[l];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}aS.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){t.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)XJ(this,e,n.allpts.slice(a,a+6))}else if(r==="segments")for(var i=t.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(r==="haystack"){var l=n.haystackPts;t.rstyle.haystackPts=[{x:l[0],y:l[1]},{x:l[2],y:l[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth};aS.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var ki={};ki.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(!bl(t)){var n,r,a=e._private,i=e.width(),l=e.height(),o=e.padding(),f=e.position(),c=e.pstyle("text-halign").strValue,h=e.pstyle("text-valign").strValue,p=a.rscratch,m=a.rstyle;switch(c){case"left":n=f.x-i/2-o;break;case"right":n=f.x+i/2+o;break;default:n=f.x}switch(h){case"top":r=f.y-l/2-o;break;case"bottom":r=f.y+l/2+o;break;default:r=f.y}p.labelX=n,p.labelY=r,m.labelX=n,m.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var qL=function(t,n){var r=Math.atan(n/t);return t===0&&r<0&&(r=r*-1),r},VL=function(t,n){var r=n.x-t.x,a=n.y-t.y;return qL(r,a)},QJ=function(t,n,r,a){var i=hd(0,a-.001,1),l=hd(0,a+.001,1),o=Hu(t,n,r,i),f=Hu(t,n,r,l);return VL(o,f)};ki.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,a=this,i={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(i.mid||i.source||i.target){t={x:r.midX,y:r.midY};var l=function(p,m,y){Qi(n.rscratch,p,m,y),Qi(n.rstyle,p,m,y)};l("labelX",null,t.x),l("labelY",null,t.y);var o=qL(r.midDispX,r.midDispY);l("labelAutoAngle",null,o);var f=function(){if(f.cache)return f.cache;for(var p=[],m=0;m+5<r.allpts.length;m+=4){var y={x:r.allpts[m],y:r.allpts[m+1]},x={x:r.allpts[m+2],y:r.allpts[m+3]},b={x:r.allpts[m+4],y:r.allpts[m+5]};p.push({p0:y,p1:x,p2:b,startDist:0,length:0,segments:[]})}var w=n.rstyle.bezierPts,S=a.bezierProjPcts.length;function N(D,_,L,M,z){var B=Ao(_,L),H=D.segments[D.segments.length-1],G={p0:_,p1:L,t0:M,t1:z,startDist:H?H.startDist+H.length:0,length:B};D.segments.push(G),D.length+=B}for(var E=0;E<p.length;E++){var T=p[E],R=p[E-1];R&&(T.startDist=R.startDist+R.length),N(T,T.p0,w[E*S],0,a.bezierProjPcts[0]);for(var A=0;A<S-1;A++)N(T,w[E*S+A],w[E*S+A+1],a.bezierProjPcts[A],a.bezierProjPcts[A+1]);N(T,w[E*S+S-1],T.p2,a.bezierProjPcts[S-1],1)}return f.cache=p},c=function(p){var m,y=p==="source";if(i[p]){var x=e.pstyle(p+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var b=f(),w,S=0,N=0,E=0;E<b.length;E++){for(var T=b[y?E:b.length-1-E],R=0;R<T.segments.length;R++){var A=T.segments[y?R:T.segments.length-1-R],D=E===b.length-1&&R===T.segments.length-1;if(S=N,N+=A.length,N>=x||D){w={cp:T,segment:A};break}}if(w)break}var _=w.cp,L=w.segment,M=(x-S)/L.length,z=L.t1-L.t0,B=y?L.t0+z*M:L.t1-z*M;B=hd(0,B,1),t=Hu(_.p0,_.p1,_.p2,B),m=QJ(_.p0,_.p1,_.p2,B);break}case"straight":case"segments":case"haystack":{for(var H=0,G,U,I,V,K=r.allpts.length,Q=0;Q+3<K&&(y?(I={x:r.allpts[Q],y:r.allpts[Q+1]},V={x:r.allpts[Q+2],y:r.allpts[Q+3]}):(I={x:r.allpts[K-2-Q],y:r.allpts[K-1-Q]},V={x:r.allpts[K-4-Q],y:r.allpts[K-3-Q]}),G=Ao(I,V),U=H,H+=G,!(H>=x));Q+=2);var F=x-U,q=F/G;q=hd(0,q,1),t=yQ(I,V,q),m=VL(I,V);break}}l("labelX",p,t.x),l("labelY",p,t.y),l("labelAutoAngle",p,m)}};c("source"),c("target"),this.applyLabelDimensions(e)}};ki.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))};ki.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),a=jo(r,e._private.labelDimsKey);if(Gr(n.rscratch,"prefixedLabelDimsKey",t)!==a){Qi(n.rscratch,"prefixedLabelDimsKey",t,a);var i=this.calculateLabelDimensions(e,r),l=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,f=Gr(n.rscratch,"labelWrapCachedLines",t)||[],c=o!=="wrap"?1:Math.max(f.length,1),h=i.height/c,p=h*l,m=i.width,y=i.height+(c-1)*(l-1)*h;Qi(n.rstyle,"labelWidth",t,m),Qi(n.rscratch,"labelWidth",t,m),Qi(n.rstyle,"labelHeight",t,y),Qi(n.rscratch,"labelHeight",t,y),Qi(n.rscratch,"labelLineHeight",t,p)}};ki.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",a=e.pstyle(r+"label").strValue,i=e.pstyle("text-transform").value,l=function(P,Z){return Z?(Qi(n.rscratch,P,t,Z),Z):Gr(n.rscratch,P,t)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var o=e.pstyle("text-wrap").value;if(o==="wrap"){var f=l("labelKey");if(f!=null&&l("labelWrapKey")===f)return l("labelWrapCachedText");for(var c="",h=a.split(`
|
|
516
|
+
`),p=e.pstyle("text-max-width").pfValue,m=e.pstyle("text-overflow-wrap").value,y=m==="anywhere",x=[],b=/[\s\u200b]+|$/g,w=0;w<h.length;w++){var S=h[w],N=this.calculateLabelDimensions(e,S),E=N.width;if(y){var T=S.split("").join(c);S=T}if(E>p){var R=S.matchAll(b),A="",D=0,_=Xr(R),L;try{for(_.s();!(L=_.n()).done;){var M=L.value,z=M[0],B=S.substring(D,M.index);D=M.index+z.length;var H=A.length===0?B:A+B+z,G=this.calculateLabelDimensions(e,H),U=G.width;U<=p?A+=B+z:(A&&x.push(A),A=B+z)}}catch(X){_.e(X)}finally{_.f()}A.match(/^[\s\u200b]+$/)||x.push(A)}else x.push(S)}l("labelWrapCachedLines",x),a=l("labelWrapCachedText",x.join(`
|
|
517
|
+
`)),l("labelWrapKey",f)}else if(o==="ellipsis"){var I=e.pstyle("text-max-width").pfValue,V="",K="…",Q=!1;if(this.calculateLabelDimensions(e,a).width<I)return a;for(var F=0;F<a.length;F++){var q=this.calculateLabelDimensions(e,V+a[F]+K).width;if(q>I)break;V+=a[F],F===a.length-1&&(Q=!0)}return Q||(V+=K),V}return a};ki.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if(t==="auto")if(e.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return t};ki.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window(),a=r.document,i=0,l=e.pstyle("font-style").strValue,o=e.pstyle("font-size").pfValue,f=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,h=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=h.getContext("2d");var m=h.style;m.position="absolute",m.left="-9999px",m.top="-9999px",m.zIndex="-1",m.visibility="hidden",m.pointerEvents="none"}p.font="".concat(l," ").concat(c," ").concat(o,"px ").concat(f);for(var y=0,x=0,b=t.split(`
|
|
518
|
+
`),w=0;w<b.length;w++){var S=b[w],N=p.measureText(S),E=Math.ceil(N.width),T=o;y=Math.max(E,y),x+=T}return y+=i,x+=i,{width:y,height:x}};ki.calculateLabelAngle=function(e,t){var n=e._private,r=n.rscratch,a=e.isEdge(),i=t?t+"-":"",l=e.pstyle(i+"text-rotation"),o=l.strValue;return o==="none"?0:a&&o==="autorotate"?r.labelAutoAngle:o==="autorotate"?0:l.pfValue};ki.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private,a=r.rscratch;a.labelAngle=t.calculateLabelAngle(e),n&&(a.sourceLabelAngle=t.calculateLabelAngle(e,"source"),a.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var HL={},hA=28,vA=!1;HL.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<hA||e.height()<hA))return vA||(zt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),vA=!0),"rectangle";if(e.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n};var Om={};Om.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(l),o)for(var f=0;f<l.length;f++){var c=l[f],h=c._private,p=h.rstyle;p.clean=!1,p.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(l){var o=l.target;r(o)}).on("style.* background.*",function(l){var o=l.target;r(o,!1)});var a=function(l){if(l){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var f=0;f<t.length;f++){var c=t[f],h=c._private.rstyle;c.isNode()&&!h.cleanConnected&&(r(c.connectedEdges()),h.cleanConnected=!0)}if(o)for(var p=0;p<o.length;p++){var m=o[p];m(l,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)};Om.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)};Om.recalculateRenderedStyle=function(e,t){var n=function(T){return T._private.rstyle.cleanConnected};if(e.length!==0){var r=[],a=[];if(!this.destroyed){t===void 0&&(t=!0);for(var i=0;i<e.length;i++){var l=e[i],o=l._private,f=o.rstyle;l.isEdge()&&(!n(l.source())||!n(l.target()))&&(f.clean=!1),l.isEdge()&&l.isBundledBezier()&&l.parallelEdges().some(function(E){return!E._private.rstyle.clean&&E.isBundledBezier()})&&(f.clean=!1),!(t&&f.clean||l.removed())&&l.pstyle("display").value!=="none"&&(o.group==="nodes"?a.push(l):r.push(l),f.clean=!0)}for(var c=0;c<a.length;c++){var h=a[c],p=h._private,m=p.rstyle,y=h.position();this.recalculateNodeLabelProjection(h),m.nodeX=y.x,m.nodeY=y.y,m.nodeW=h.pstyle("width").pfValue,m.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var x=0;x<r.length;x++){var b=r[x],w=b._private,S=w.rstyle,N=w.rscratch;S.srcX=N.arrowStartX,S.srcY=N.arrowStartY,S.tgtX=N.arrowEndX,S.tgtY=N.arrowEndY,S.midX=N.midX,S.midY=N.midY,S.labelAngle=N.labelAngle,S.sourceLabelAngle=N.sourceLabelAngle,S.targetLabelAngle=N.targetLabelAngle}}}};var Lm={};Lm.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],a=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):a.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}};Lm.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Lm.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(NL),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var GL={};[Lo,zp,Cr,Qd,aS,ki,HL,Om,Lm].forEach(function(e){at(GL,e)});var $L={};$L.getCachedImage=function(e,t,n){var r=this,a=r.imageCache=r.imageCache||{},i=a[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[e]=a[e]||{};var l=i.image=new Image;l.addEventListener("load",n),l.addEventListener("error",function(){l.error=!0});var o="data:",f=e.substring(0,o.length).toLowerCase()===o;return f||(t=t==="null"?null:t,l.crossOrigin=t),l.src=e,l};var Dc={};Dc.registerBinding=function(e,t,n,r){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(e)){for(var i=[],l=0;l<e.length;l++){var o=e[l];if(o!==void 0){var f=this.binder(o);i.push(f.on.apply(f,a))}}return i}var f=this.binder(e);return f.on.apply(f,a)};Dc.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||oX(e);if(t.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}t.supportsPassiveEvents=a}var l=function(f,c,h){var p=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(p[2]={capture:h??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:p}),(e.addEventListener||e.on).apply(e,p),this};return{on:l,addEventListener:l,addListener:l,bind:l}};Dc.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()};Dc.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()};Dc.load=function(){var e=this,t=e.cy.window(),n=function(Y){return Y.selected()},r=function(Y){var ue=Y.getRootNode();if(ue&&ue.nodeType===11&&ue.host!==void 0)return ue},a=function(Y,ue,pe,de){Y==null&&(Y=e.cy);for(var be=0;be<ue.length;be++){var Le=ue[be];Y.emit({originalEvent:pe,type:Le,position:de})}},i=function(Y){return Y.shiftKey||Y.metaKey||Y.ctrlKey},l=function(Y,ue){var pe=!0;if(e.cy.hasCompoundNodes()&&Y&&Y.pannable())for(var de=0;ue&&de<ue.length;de++){var Y=ue[de];if(Y.isNode()&&Y.isParent()&&!Y.pannable()){pe=!1;break}}else pe=!0;return pe},o=function(Y){Y[0]._private.grabbed=!0},f=function(Y){Y[0]._private.grabbed=!1},c=function(Y){Y[0]._private.rscratch.inDragLayer=!0},h=function(Y){Y[0]._private.rscratch.inDragLayer=!1},p=function(Y){Y[0]._private.rscratch.isGrabTarget=!0},m=function(Y){Y[0]._private.rscratch.isGrabTarget=!1},y=function(Y,ue){var pe=ue.addToList,de=pe.has(Y);!de&&Y.grabbable()&&!Y.locked()&&(pe.merge(Y),o(Y))},x=function(Y,ue){if(Y.cy().hasCompoundNodes()&&!(ue.inDragLayer==null&&ue.addToList==null)){var pe=Y.descendants();ue.inDragLayer&&(pe.forEach(c),pe.connectedEdges().forEach(c)),ue.addToList&&y(pe,ue)}},b=function(Y,ue){ue=ue||{};var pe=Y.cy().hasCompoundNodes();ue.inDragLayer&&(Y.forEach(c),Y.neighborhood().stdFilter(function(de){return!pe||de.isEdge()}).forEach(c)),ue.addToList&&Y.forEach(function(de){y(de,ue)}),x(Y,ue),N(Y,{inDragLayer:ue.inDragLayer}),e.updateCachedGrabbedEles()},w=b,S=function(Y){Y&&(e.getCachedZSortedEles().forEach(function(ue){f(ue),h(ue),m(ue)}),e.updateCachedGrabbedEles())},N=function(Y,ue){if(!(ue.inDragLayer==null&&ue.addToList==null)&&Y.cy().hasCompoundNodes()){var pe=Y.ancestors().orphans();if(!pe.same(Y)){var de=pe.descendants().spawnSelf().merge(pe).unmerge(Y).unmerge(Y.descendants()),be=de.connectedEdges();ue.inDragLayer&&(be.forEach(c),de.forEach(c)),ue.addToList&&de.forEach(function(Le){y(Le,ue)})}}},E=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},T=typeof MutationObserver<"u",R=typeof ResizeObserver<"u";T?(e.removeObserver=new MutationObserver(function(xe){for(var Y=0;Y<xe.length;Y++){var ue=xe[Y],pe=ue.removedNodes;if(pe)for(var de=0;de<pe.length;de++){var be=pe[de];if(be===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(xe){e.destroy()});var A=$d(function(){e.cy.resize()},100);T&&(e.styleObserver=new MutationObserver(A),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",A),R&&(e.resizeObserver=new ResizeObserver(A),e.resizeObserver.observe(e.container));var D=function(Y,ue){for(;Y!=null;)ue(Y),Y=Y.parentNode},_=function(){e.invalidateContainerClientCoordsCache()};D(e.container,function(xe){e.registerBinding(xe,"transitionend",_),e.registerBinding(xe,"animationend",_),e.registerBinding(xe,"scroll",_)}),e.registerBinding(e.container,"contextmenu",function(xe){xe.preventDefault()});var L=function(){return e.selection[4]!==0},M=function(Y){for(var ue=e.findContainerClientCoords(),pe=ue[0],de=ue[1],be=ue[2],Le=ue[3],Ne=Y.touches?Y.touches:[Y],Ke=!1,Ue=0;Ue<Ne.length;Ue++){var Ze=Ne[Ue];if(pe<=Ze.clientX&&Ze.clientX<=pe+be&&de<=Ze.clientY&&Ze.clientY<=de+Le){Ke=!0;break}}if(!Ke)return!1;for(var ut=e.container,ct=Y.target,He=ct.parentNode,bt=!1;He;){if(He===ut){bt=!0;break}He=He.parentNode}return!!bt};e.registerBinding(e.container,"mousedown",function(Y){if(M(Y)&&!(e.hoverData.which===1&&Y.which!==1)){Y.preventDefault(),E(),e.hoverData.capture=!0,e.hoverData.which=Y.which;var ue=e.cy,pe=[Y.clientX,Y.clientY],de=e.projectIntoViewport(pe[0],pe[1]),be=e.selection,Le=e.findNearestElements(de[0],de[1],!0,!1),Ne=Le[0],Ke=e.dragData.possibleDragElements;e.hoverData.mdownPos=de,e.hoverData.mdownGPos=pe;var Ue=function(vt){return{originalEvent:Y,type:vt,position:{x:de[0],y:de[1]}}},Ze=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var vt=e.hoverData.down;vt?vt.emit(Ue("taphold")):ue.emit(Ue("taphold"))}},e.tapholdDuration)};if(Y.which==3){e.hoverData.cxtStarted=!0;var ut={originalEvent:Y,type:"cxttapstart",position:{x:de[0],y:de[1]}};Ne?(Ne.activate(),Ne.emit(ut),e.hoverData.down=Ne):ue.emit(ut),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(Y.which==1){Ne&&Ne.activate();{if(Ne!=null&&e.nodeIsGrabbable(Ne)){var ct=function(vt){vt.emit(Ue("grab"))};if(p(Ne),!Ne.selected())Ke=e.dragData.possibleDragElements=ue.collection(),w(Ne,{addToList:Ke}),Ne.emit(Ue("grabon")).emit(Ue("grab"));else{Ke=e.dragData.possibleDragElements=ue.collection();var He=ue.$(function(bt){return bt.isNode()&&bt.selected()&&e.nodeIsGrabbable(bt)});b(He,{addToList:Ke}),Ne.emit(Ue("grabon")),He.forEach(ct)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=Ne,e.hoverData.downs=Le,e.hoverData.downTime=new Date().getTime()}a(Ne,["mousedown","tapstart","vmousedown"],Y,{x:de[0],y:de[1]}),Ne==null?(be[4]=1,e.data.bgActivePosistion={x:de[0],y:de[1]},e.redrawHint("select",!0),e.redraw()):Ne.pannable()&&(be[4]=1),Ze()}be[0]=be[2]=de[0],be[1]=be[3]=de[1]}},!1);var z=r(e.container);e.registerBinding([t,z],"mousemove",function(Y){var ue=e.hoverData.capture;if(!(!ue&&!M(Y))){var pe=!1,de=e.cy,be=de.zoom(),Le=[Y.clientX,Y.clientY],Ne=e.projectIntoViewport(Le[0],Le[1]),Ke=e.hoverData.mdownPos,Ue=e.hoverData.mdownGPos,Ze=e.selection,ut=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(ut=e.findNearestElement(Ne[0],Ne[1],!0,!1));var ct=e.hoverData.last,He=e.hoverData.down,bt=[Ne[0]-Ze[2],Ne[1]-Ze[3]],vt=e.dragData.possibleDragElements,hn;if(Ue){var Vt=Le[0]-Ue[0],ar=Vt*Vt,vn=Le[1]-Ue[1],Cn=vn*vn,yn=ar+Cn;e.hoverData.isOverThresholdDrag=hn=yn>=e.desktopTapThreshold2}var Nn=i(Y);hn&&(e.hoverData.tapholdCancelled=!0);var ha=function(){var Qn=e.hoverData.dragDelta=e.hoverData.dragDelta||[];Qn.length===0?(Qn.push(bt[0]),Qn.push(bt[1])):(Qn[0]+=bt[0],Qn[1]+=bt[1])};pe=!0,a(ut,["mousemove","vmousemove","tapdrag"],Y,{x:Ne[0],y:Ne[1]});var pn=function(Qn){return{originalEvent:Y,type:Qn,position:{x:Ne[0],y:Ne[1]}}},va=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||de.emit(pn("boxstart")),Ze[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(hn){var Kn=pn("cxtdrag");He?He.emit(Kn):de.emit(Kn),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||ut!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(pn("cxtdragout")),e.hoverData.cxtOver=ut,ut&&ut.emit(pn("cxtdragover")))}}else if(e.hoverData.dragging){if(pe=!0,de.panningEnabled()&&de.userPanningEnabled()){var un;if(e.hoverData.justStartedPan){var In=e.hoverData.mdownPos;un={x:(Ne[0]-In[0])*be,y:(Ne[1]-In[1])*be},e.hoverData.justStartedPan=!1}else un={x:bt[0]*be,y:bt[1]*be};de.panBy(un),de.emit(pn("dragpan")),e.hoverData.dragged=!0}Ne=e.projectIntoViewport(Y.clientX,Y.clientY)}else if(Ze[4]==1&&(He==null||He.pannable())){if(hn){if(!e.hoverData.dragging&&de.boxSelectionEnabled()&&(Nn||!de.panningEnabled()||!de.userPanningEnabled()))va();else if(!e.hoverData.selecting&&de.panningEnabled()&&de.userPanningEnabled()){var Or=l(He,e.hoverData.downs);Or&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,Ze[4]=0,e.data.bgActivePosistion=Lu(Ke),e.redrawHint("select",!0),e.redraw())}He&&He.pannable()&&He.active()&&He.unactivate()}}else{if(He&&He.pannable()&&He.active()&&He.unactivate(),(!He||!He.grabbed())&&ut!=ct&&(ct&&a(ct,["mouseout","tapdragout"],Y,{x:Ne[0],y:Ne[1]}),ut&&a(ut,["mouseover","tapdragover"],Y,{x:Ne[0],y:Ne[1]}),e.hoverData.last=ut),He)if(hn){if(de.boxSelectionEnabled()&&Nn)He&&He.grabbed()&&(S(vt),He.emit(pn("freeon")),vt.emit(pn("free")),e.dragData.didDrag&&(He.emit(pn("dragfreeon")),vt.emit(pn("dragfree")))),va();else if(He&&He.grabbed()&&e.nodeIsDraggable(He)){var Yn=!e.dragData.didDrag;Yn&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||b(vt,{inDragLayer:!0});var Xn={x:0,y:0};if(Re(bt[0])&&Re(bt[1])&&(Xn.x+=bt[0],Xn.y+=bt[1],Yn)){var vr=e.hoverData.dragDelta;vr&&Re(vr[0])&&Re(vr[1])&&(Xn.x+=vr[0],Xn.y+=vr[1])}e.hoverData.draggingEles=!0,vt.silentShift(Xn).emit(pn("position")).emit(pn("drag")),e.redrawHint("drag",!0),e.redraw()}}else ha();pe=!0}if(Ze[2]=Ne[0],Ze[3]=Ne[1],pe)return Y.stopPropagation&&Y.stopPropagation(),Y.preventDefault&&Y.preventDefault(),!1}},!1);var B,H,G;e.registerBinding(t,"mouseup",function(Y){if(!(e.hoverData.which===1&&Y.which!==1&&e.hoverData.capture)){var ue=e.hoverData.capture;if(ue){e.hoverData.capture=!1;var pe=e.cy,de=e.projectIntoViewport(Y.clientX,Y.clientY),be=e.selection,Le=e.findNearestElement(de[0],de[1],!0,!1),Ne=e.dragData.possibleDragElements,Ke=e.hoverData.down,Ue=i(Y);e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,Ke&&Ke.unactivate();var Ze=function(Vt){return{originalEvent:Y,type:Vt,position:{x:de[0],y:de[1]}}};if(e.hoverData.which===3){var ut=Ze("cxttapend");if(Ke?Ke.emit(ut):pe.emit(ut),!e.hoverData.cxtDragged){var ct=Ze("cxttap");Ke?Ke.emit(ct):pe.emit(ct)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(a(Le,["mouseup","tapend","vmouseup"],Y,{x:de[0],y:de[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(a(Ke,["click","tap","vclick"],Y,{x:de[0],y:de[1]}),H=!1,Y.timeStamp-G<=pe.multiClickDebounceTime()?(B&&clearTimeout(B),H=!0,G=null,a(Ke,["dblclick","dbltap","vdblclick"],Y,{x:de[0],y:de[1]})):(B=setTimeout(function(){H||a(Ke,["oneclick","onetap","voneclick"],Y,{x:de[0],y:de[1]})},pe.multiClickDebounceTime()),G=Y.timeStamp)),Ke==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!i(Y)&&(pe.$(n).unselect(["tapunselect"]),Ne.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=Ne=pe.collection()),Le==Ke&&!e.dragData.didDrag&&!e.hoverData.selecting&&Le!=null&&Le._private.selectable&&(e.hoverData.dragging||(pe.selectionType()==="additive"||Ue?Le.selected()?Le.unselect(["tapunselect"]):Le.select(["tapselect"]):Ue||(pe.$(n).unmerge(Le).unselect(["tapunselect"]),Le.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var He=pe.collection(e.getAllInBox(be[0],be[1],be[2],be[3]));e.redrawHint("select",!0),He.length>0&&e.redrawHint("eles",!0),pe.emit(Ze("boxend"));var bt=function(Vt){return Vt.selectable()&&!Vt.selected()};pe.selectionType()==="additive"||Ue||pe.$(n).unmerge(He).unselect(),He.emit(Ze("box")).stdFilter(bt).select().emit(Ze("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!be[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var vt=Ke&&Ke.grabbed();S(Ne),vt&&(Ke.emit(Ze("freeon")),Ne.emit(Ze("free")),e.dragData.didDrag&&(Ke.emit(Ze("dragfreeon")),Ne.emit(Ze("dragfree"))))}}be[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}},!1);var U=[],I=4,V,K=1e5,Q=function(Y,ue){for(var pe=0;pe<Y.length;pe++)if(Y[pe]%ue!==0)return!1;return!0},F=function(Y){for(var ue=Math.abs(Y[0]),pe=1;pe<Y.length;pe++)if(Math.abs(Y[pe])!==ue)return!1;return!0},q=function(Y){var ue=!1,pe=Y.deltaY;if(pe==null&&(Y.wheelDeltaY!=null?pe=Y.wheelDeltaY/4:Y.wheelDelta!=null&&(pe=Y.wheelDelta/4)),pe!==0){if(V==null)if(U.length>=I){var de=U;if(V=Q(de,5),!V){var be=Math.abs(de[0]);V=F(de)&&be>5}if(V)for(var Le=0;Le<de.length;Le++)K=Math.min(Math.abs(de[Le]),K)}else U.push(pe),ue=!0;else V&&(K=Math.min(Math.abs(pe),K));if(!e.scrollingPage){var Ne=e.cy,Ke=Ne.zoom(),Ue=Ne.pan(),Ze=e.projectIntoViewport(Y.clientX,Y.clientY),ut=[Ze[0]*Ke+Ue.x,Ze[1]*Ke+Ue.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||L()){Y.preventDefault();return}if(Ne.panningEnabled()&&Ne.userPanningEnabled()&&Ne.zoomingEnabled()&&Ne.userZoomingEnabled()){Y.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var ct;ue&&Math.abs(pe)>5&&(pe=Hw(pe)*5),ct=pe/-250,V&&(ct/=K,ct*=3),ct=ct*e.wheelSensitivity;var He=Y.deltaMode===1;He&&(ct*=33);var bt=Ne.zoom()*Math.pow(10,ct);Y.type==="gesturechange"&&(bt=e.gestureStartZoom*Y.scale),Ne.zoom({level:bt,renderedPosition:{x:ut[0],y:ut[1]}}),Ne.emit({type:Y.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:Y,position:{x:Ze[0],y:Ze[1]}})}}}};e.registerBinding(e.container,"wheel",q,!0),e.registerBinding(t,"scroll",function(Y){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(Y){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||Y.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(xe){e.hasTouchStarted||q(xe)},!0),e.registerBinding(e.container,"mouseout",function(Y){var ue=e.projectIntoViewport(Y.clientX,Y.clientY);e.cy.emit({originalEvent:Y,type:"mouseout",position:{x:ue[0],y:ue[1]}})},!1),e.registerBinding(e.container,"mouseover",function(Y){var ue=e.projectIntoViewport(Y.clientX,Y.clientY);e.cy.emit({originalEvent:Y,type:"mouseover",position:{x:ue[0],y:ue[1]}})},!1);var X,P,Z,ae,ie,le,ye,ne,W,J,se,ge,Te,Be=function(Y,ue,pe,de){return Math.sqrt((pe-Y)*(pe-Y)+(de-ue)*(de-ue))},ot=function(Y,ue,pe,de){return(pe-Y)*(pe-Y)+(de-ue)*(de-ue)},Je;e.registerBinding(e.container,"touchstart",Je=function(Y){if(e.hasTouchStarted=!0,!!M(Y)){E(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var ue=e.cy,pe=e.touchData.now,de=e.touchData.earlier;if(Y.touches[0]){var be=e.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);pe[0]=be[0],pe[1]=be[1]}if(Y.touches[1]){var be=e.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);pe[2]=be[0],pe[3]=be[1]}if(Y.touches[2]){var be=e.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);pe[4]=be[0],pe[5]=be[1]}var Le=function(Nn){return{originalEvent:Y,type:Nn,position:{x:pe[0],y:pe[1]}}};if(Y.touches[1]){e.touchData.singleTouchMoved=!0,S(e.dragData.touchDragEles);var Ne=e.findContainerClientCoords();W=Ne[0],J=Ne[1],se=Ne[2],ge=Ne[3],X=Y.touches[0].clientX-W,P=Y.touches[0].clientY-J,Z=Y.touches[1].clientX-W,ae=Y.touches[1].clientY-J,Te=0<=X&&X<=se&&0<=Z&&Z<=se&&0<=P&&P<=ge&&0<=ae&&ae<=ge;var Ke=ue.pan(),Ue=ue.zoom();ie=Be(X,P,Z,ae),le=ot(X,P,Z,ae),ye=[(X+Z)/2,(P+ae)/2],ne=[(ye[0]-Ke.x)/Ue,(ye[1]-Ke.y)/Ue];var Ze=200,ut=Ze*Ze;if(le<ut&&!Y.touches[2]){var ct=e.findNearestElement(pe[0],pe[1],!0,!0),He=e.findNearestElement(pe[2],pe[3],!0,!0);ct&&ct.isNode()?(ct.activate().emit(Le("cxttapstart")),e.touchData.start=ct):He&&He.isNode()?(He.activate().emit(Le("cxttapstart")),e.touchData.start=He):ue.emit(Le("cxttapstart")),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,e.redraw();return}}if(Y.touches[2])ue.boxSelectionEnabled()&&Y.preventDefault();else if(!Y.touches[1]){if(Y.touches[0]){var bt=e.findNearestElements(pe[0],pe[1],!0,!0),vt=bt[0];if(vt!=null&&(vt.activate(),e.touchData.start=vt,e.touchData.starts=bt,e.nodeIsGrabbable(vt))){var hn=e.dragData.touchDragEles=ue.collection(),Vt=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),vt.selected()?(Vt=ue.$(function(yn){return yn.selected()&&e.nodeIsGrabbable(yn)}),b(Vt,{addToList:hn})):w(vt,{addToList:hn}),p(vt),vt.emit(Le("grabon")),Vt?Vt.forEach(function(yn){yn.emit(Le("grab"))}):vt.emit(Le("grab"))}a(vt,["touchstart","tapstart","vmousedown"],Y,{x:pe[0],y:pe[1]}),vt==null&&(e.data.bgActivePosistion={x:be[0],y:be[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){e.touchData.singleTouchMoved===!1&&!e.pinching&&!e.touchData.selecting&&a(e.touchData.start,["taphold"],Y,{x:pe[0],y:pe[1]})},e.tapholdDuration)}}if(Y.touches.length>=1){for(var ar=e.touchData.startPosition=[null,null,null,null,null,null],vn=0;vn<pe.length;vn++)ar[vn]=de[vn]=pe[vn];var Cn=Y.touches[0];e.touchData.startGPosition=[Cn.clientX,Cn.clientY]}}},!1);var We;e.registerBinding(t,"touchmove",We=function(Y){var ue=e.touchData.capture;if(!(!ue&&!M(Y))){var pe=e.selection,de=e.cy,be=e.touchData.now,Le=e.touchData.earlier,Ne=de.zoom();if(Y.touches[0]){var Ke=e.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);be[0]=Ke[0],be[1]=Ke[1]}if(Y.touches[1]){var Ke=e.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);be[2]=Ke[0],be[3]=Ke[1]}if(Y.touches[2]){var Ke=e.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);be[4]=Ke[0],be[5]=Ke[1]}var Ue=function(nh){return{originalEvent:Y,type:nh,position:{x:be[0],y:be[1]}}},Ze=e.touchData.startGPosition,ut;if(ue&&Y.touches[0]&&Ze){for(var ct=[],He=0;He<be.length;He++)ct[He]=be[He]-Le[He];var bt=Y.touches[0].clientX-Ze[0],vt=bt*bt,hn=Y.touches[0].clientY-Ze[1],Vt=hn*hn,ar=vt+Vt;ut=ar>=e.touchTapThreshold2}if(ue&&e.touchData.cxt){Y.preventDefault();var vn=Y.touches[0].clientX-W,Cn=Y.touches[0].clientY-J,yn=Y.touches[1].clientX-W,Nn=Y.touches[1].clientY-J,ha=ot(vn,Cn,yn,Nn),pn=ha/le,va=150,Kn=va*va,un=1.5,In=un*un;if(pn>=In||ha>=Kn){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Or=Ue("cxttapend");e.touchData.start?(e.touchData.start.unactivate().emit(Or),e.touchData.start=null):de.emit(Or)}}if(ue&&e.touchData.cxt){var Or=Ue("cxtdrag");e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(Or):de.emit(Or),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var Yn=e.findNearestElement(be[0],be[1],!0,!0);(!e.touchData.cxtOver||Yn!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit(Ue("cxtdragout")),e.touchData.cxtOver=Yn,Yn&&Yn.emit(Ue("cxtdragover")))}else if(ue&&Y.touches[2]&&de.boxSelectionEnabled())Y.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||de.emit(Ue("boxstart")),e.touchData.selecting=!0,e.touchData.didSelect=!0,pe[4]=1,!pe||pe.length===0||pe[0]===void 0?(pe[0]=(be[0]+be[2]+be[4])/3,pe[1]=(be[1]+be[3]+be[5])/3,pe[2]=(be[0]+be[2]+be[4])/3+1,pe[3]=(be[1]+be[3]+be[5])/3+1):(pe[2]=(be[0]+be[2]+be[4])/3,pe[3]=(be[1]+be[3]+be[5])/3),e.redrawHint("select",!0),e.redraw();else if(ue&&Y.touches[1]&&!e.touchData.didSelect&&de.zoomingEnabled()&&de.panningEnabled()&&de.userZoomingEnabled()&&de.userPanningEnabled()){Y.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Xn=e.dragData.touchDragEles;if(Xn){e.redrawHint("drag",!0);for(var vr=0;vr<Xn.length;vr++){var ps=Xn[vr]._private;ps.grabbed=!1,ps.rscratch.inDragLayer=!1}}var Qn=e.touchData.start,vn=Y.touches[0].clientX-W,Cn=Y.touches[0].clientY-J,yn=Y.touches[1].clientX-W,Nn=Y.touches[1].clientY-J,Bo=Be(vn,Cn,yn,Nn),ms=Bo/ie;if(Te){var gs=vn-X,Ll=Cn-P,ys=yn-Z,Rn=Nn-ae,Jd=(gs+ys)/2,eh=(Ll+Rn)/2,Zr=de.zoom(),Ja=Zr*ms,zo=de.pan(),_c=ne[0]*Zr+zo.x,Oc=ne[1]*Zr+zo.y,Pm={x:-Ja/Zr*(_c-zo.x-Jd)+_c,y:-Ja/Zr*(Oc-zo.y-eh)+Oc};if(Qn&&Qn.active()){var Xn=e.dragData.touchDragEles;S(Xn),e.redrawHint("drag",!0),e.redrawHint("eles",!0),Qn.unactivate().emit(Ue("freeon")),Xn.emit(Ue("free")),e.dragData.didDrag&&(Qn.emit(Ue("dragfreeon")),Xn.emit(Ue("dragfree")))}de.viewport({zoom:Ja,pan:Pm,cancelOnFailedZoom:!0}),de.emit(Ue("pinchzoom")),ie=Bo,X=vn,P=Cn,Z=yn,ae=Nn,e.pinching=!0}if(Y.touches[0]){var Ke=e.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);be[0]=Ke[0],be[1]=Ke[1]}if(Y.touches[1]){var Ke=e.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);be[2]=Ke[0],be[3]=Ke[1]}if(Y.touches[2]){var Ke=e.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);be[4]=Ke[0],be[5]=Ke[1]}}else if(Y.touches[0]&&!e.touchData.didSelect){var pr=e.touchData.start,xs=e.touchData.last,Yn;if(!e.hoverData.draggingEles&&!e.swipePanning&&(Yn=e.findNearestElement(be[0],be[1],!0,!0)),ue&&pr!=null&&Y.preventDefault(),ue&&pr!=null&&e.nodeIsDraggable(pr))if(ut){var Xn=e.dragData.touchDragEles,pa=!e.dragData.didDrag;pa&&b(Xn,{inDragLayer:!0}),e.dragData.didDrag=!0;var Wn={x:0,y:0};if(Re(ct[0])&&Re(ct[1])&&(Wn.x+=ct[0],Wn.y+=ct[1],pa)){e.redrawHint("eles",!0);var Lr=e.touchData.dragDelta;Lr&&Re(Lr[0])&&Re(Lr[1])&&(Wn.x+=Lr[0],Wn.y+=Lr[1])}e.hoverData.draggingEles=!0,Xn.silentShift(Wn).emit(Ue("position")).emit(Ue("drag")),e.redrawHint("drag",!0),e.touchData.startPosition[0]==Le[0]&&e.touchData.startPosition[1]==Le[1]&&e.redrawHint("eles",!0),e.redraw()}else{var Lr=e.touchData.dragDelta=e.touchData.dragDelta||[];Lr.length===0?(Lr.push(ct[0]),Lr.push(ct[1])):(Lr[0]+=ct[0],Lr[1]+=ct[1])}if(a(pr||Yn,["touchmove","tapdrag","vmousemove"],Y,{x:be[0],y:be[1]}),(!pr||!pr.grabbed())&&Yn!=xs&&(xs&&xs.emit(Ue("tapdragout")),Yn&&Yn.emit(Ue("tapdragover"))),e.touchData.last=Yn,ue)for(var vr=0;vr<be.length;vr++)be[vr]&&e.touchData.startPosition[vr]&&ut&&(e.touchData.singleTouchMoved=!0);if(ue&&(pr==null||pr.pannable())&&de.panningEnabled()&&de.userPanningEnabled()){var Bm=l(pr,e.touchData.starts);Bm&&(Y.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=Lu(e.touchData.startPosition)),e.swipePanning?(de.panBy({x:ct[0]*Ne,y:ct[1]*Ne}),de.emit(Ue("dragpan"))):ut&&(e.swipePanning=!0,de.panBy({x:bt*Ne,y:hn*Ne}),de.emit(Ue("dragpan")),pr&&(pr.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var Ke=e.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);be[0]=Ke[0],be[1]=Ke[1]}}for(var He=0;He<be.length;He++)Le[He]=be[He];ue&&Y.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var Ve;e.registerBinding(t,"touchcancel",Ve=function(Y){var ue=e.touchData.start;e.touchData.capture=!1,ue&&ue.unactivate()});var De,Ye,Qe,st;if(e.registerBinding(t,"touchend",De=function(Y){var ue=e.touchData.start,pe=e.touchData.capture;if(pe)Y.touches.length===0&&(e.touchData.capture=!1),Y.preventDefault();else return;var de=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var be=e.cy,Le=be.zoom(),Ne=e.touchData.now,Ke=e.touchData.earlier;if(Y.touches[0]){var Ue=e.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);Ne[0]=Ue[0],Ne[1]=Ue[1]}if(Y.touches[1]){var Ue=e.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);Ne[2]=Ue[0],Ne[3]=Ue[1]}if(Y.touches[2]){var Ue=e.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);Ne[4]=Ue[0],Ne[5]=Ue[1]}var Ze=function(Kn){return{originalEvent:Y,type:Kn,position:{x:Ne[0],y:Ne[1]}}};ue&&ue.unactivate();var ut;if(e.touchData.cxt){if(ut=Ze("cxttapend"),ue?ue.emit(ut):be.emit(ut),!e.touchData.cxtDragged){var ct=Ze("cxttap");ue?ue.emit(ct):be.emit(ct)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!Y.touches[2]&&be.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var He=be.collection(e.getAllInBox(de[0],de[1],de[2],de[3]));de[0]=void 0,de[1]=void 0,de[2]=void 0,de[3]=void 0,de[4]=0,e.redrawHint("select",!0),be.emit(Ze("boxend"));var bt=function(Kn){return Kn.selectable()&&!Kn.selected()};He.emit(Ze("box")).stdFilter(bt).select().emit(Ze("boxselect")),He.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(ue!=null&&ue.unactivate(),Y.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!Y.touches[1]){if(!Y.touches[0]){if(!Y.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var vt=e.dragData.touchDragEles;if(ue!=null){var hn=ue._private.grabbed;S(vt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),hn&&(ue.emit(Ze("freeon")),vt.emit(Ze("free")),e.dragData.didDrag&&(ue.emit(Ze("dragfreeon")),vt.emit(Ze("dragfree")))),a(ue,["touchend","tapend","vmouseup","tapdragout"],Y,{x:Ne[0],y:Ne[1]}),ue.unactivate(),e.touchData.start=null}else{var Vt=e.findNearestElement(Ne[0],Ne[1],!0,!0);a(Vt,["touchend","tapend","vmouseup","tapdragout"],Y,{x:Ne[0],y:Ne[1]})}var ar=e.touchData.startPosition[0]-Ne[0],vn=ar*ar,Cn=e.touchData.startPosition[1]-Ne[1],yn=Cn*Cn,Nn=vn+yn,ha=Nn*Le*Le;e.touchData.singleTouchMoved||(ue||be.$(":selected").unselect(["tapunselect"]),a(ue,["tap","vclick"],Y,{x:Ne[0],y:Ne[1]}),Ye=!1,Y.timeStamp-st<=be.multiClickDebounceTime()?(Qe&&clearTimeout(Qe),Ye=!0,st=null,a(ue,["dbltap","vdblclick"],Y,{x:Ne[0],y:Ne[1]})):(Qe=setTimeout(function(){Ye||a(ue,["onetap","voneclick"],Y,{x:Ne[0],y:Ne[1]})},be.multiClickDebounceTime()),st=Y.timeStamp)),ue!=null&&!e.dragData.didDrag&&ue._private.selectable&&ha<e.touchTapThreshold2&&!e.pinching&&(be.selectionType()==="single"?(be.$(n).unmerge(ue).unselect(["tapunselect"]),ue.select(["tapselect"])):ue.selected()?ue.unselect(["tapunselect"]):ue.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}}}for(var pn=0;pn<Ne.length;pn++)Ke[pn]=Ne[pn];e.dragData.didDrag=!1,Y.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),Y.touches.length<2&&(Y.touches.length===1&&(e.touchData.startGPosition=[Y.touches[0].clientX,Y.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},!1),typeof TouchEvent>"u"){var ze=[],dt=function(Y){return{clientX:Y.clientX,clientY:Y.clientY,force:1,identifier:Y.pointerId,pageX:Y.pageX,pageY:Y.pageY,radiusX:Y.width/2,radiusY:Y.height/2,screenX:Y.screenX,screenY:Y.screenY,target:Y.target}},he=function(Y){return{event:Y,touch:dt(Y)}},Ce=function(Y){ze.push(he(Y))},Me=function(Y){for(var ue=0;ue<ze.length;ue++){var pe=ze[ue];if(pe.event.pointerId===Y.pointerId){ze.splice(ue,1);return}}},Fe=function(Y){var ue=ze.filter(function(pe){return pe.event.pointerId===Y.pointerId})[0];ue.event=Y,ue.touch=dt(Y)},_e=function(Y){Y.touches=ze.map(function(ue){return ue.touch})},Oe=function(Y){return Y.pointerType==="mouse"||Y.pointerType===4};e.registerBinding(e.container,"pointerdown",function(xe){Oe(xe)||(xe.preventDefault(),Ce(xe),_e(xe),Je(xe))}),e.registerBinding(e.container,"pointerup",function(xe){Oe(xe)||(Me(xe),_e(xe),De(xe))}),e.registerBinding(e.container,"pointercancel",function(xe){Oe(xe)||(Me(xe),_e(xe),Ve(xe))}),e.registerBinding(e.container,"pointermove",function(xe){Oe(xe)||(xe.preventDefault(),Fe(xe),_e(xe),We(xe))})}};var hs={};hs.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(r,a,i,l,o,f){this.renderer.nodeShapeImpl("polygon",r,a,i,l,o,this.points)},intersectLine:function(r,a,i,l,o,f,c,h){return vd(o,f,this.points,r,a,i/2,l/2,c)},checkPoint:function(r,a,i,l,o,f,c,h){return cs(r,a,this.points,f,c,l,o,[0,-1],i)},hasMiterBounds:e!=="rectangle",miterBounds:function(r,a,i,l,o,f){return CQ(this.points,r,a,i,l,o)}}};hs.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i)},intersectLine:function(t,n,r,a,i,l,o,f){return MQ(i,l,t,n,r/2+o,a/2+o)},checkPoint:function(t,n,r,a,i,l,o,f){return oo(t,n,a,i,l,o,r)}}};hs.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(r,a,i,l,o,f,c){if(f[c]!==void 0&&f[c+"-cx"]===r&&f[c+"-cy"]===a)return f[c];f[c]=new Array(t.length/2),f[c+"-cx"]=r,f[c+"-cy"]=a;var h=i/2,p=l/2;o=o==="auto"?KO(i,l):o;for(var m=new Array(t.length/2),y=0;y<t.length/2;y++)m[y]={x:r+h*t[y*2],y:a+p*t[y*2+1]};var x,b,w,S,N=m.length;for(b=m[N-1],x=0;x<N;x++)w=m[x%N],S=m[(x+1)%N],f[c][x]=rS(b,w,S,o),b=w,w=S;return f[c]},draw:function(r,a,i,l,o,f,c){this.renderer.nodeShapeImpl("round-polygon",r,a,i,l,o,this.points,this.getOrCreateCorners(a,i,l,o,f,c,"drawCorners"))},intersectLine:function(r,a,i,l,o,f,c,h,p){return OQ(o,f,this.points,r,a,i,l,c,this.getOrCreateCorners(r,a,i,l,h,p,"corners"))},checkPoint:function(r,a,i,l,o,f,c,h,p){return DQ(r,a,this.points,f,c,l,o,this.getOrCreateCorners(f,c,l,o,h,p,"corners"))}}};hs.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Tr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,this.points,l)},intersectLine:function(t,n,r,a,i,l,o,f){return GO(i,l,t,n,r,a,o,f)},checkPoint:function(t,n,r,a,i,l,o,f){var c=a/2,h=i/2;f=f==="auto"?Sl(a,i):f,f=Math.min(c,h,f);var p=f*2;return!!(cs(t,n,this.points,l,o,a,i-p,[0,-1],r)||cs(t,n,this.points,l,o,a-p,i,[0,-1],r)||oo(t,n,p,p,l-c+f,o-h+f,r)||oo(t,n,p,p,l+c-f,o-h+f,r)||oo(t,n,p,p,l+c-f,o+h-f,r)||oo(t,n,p,p,l-c+f,o+h-f,r))}}};hs.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:$w(),points:Tr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,null,l)},generateCutTrianglePts:function(t,n,r,a,i){var l=i==="auto"?this.cornerLength:i,o=n/2,f=t/2,c=r-f,h=r+f,p=a-o,m=a+o;return{topLeft:[c,p+l,c+l,p,c+l,p+l],topRight:[h-l,p,h,p+l,h-l,p+l],bottomRight:[h,m-l,h-l,m,h-l,m-l],bottomLeft:[c+l,m,c,m-l,c+l,m-l]}},intersectLine:function(t,n,r,a,i,l,o,f){var c=this.generateCutTrianglePts(r+2*o,a+2*o,t,n,f),h=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return vd(i,l,h,t,n)},checkPoint:function(t,n,r,a,i,l,o,f){var c=f==="auto"?this.cornerLength:f;if(cs(t,n,this.points,l,o,a,i-2*c,[0,-1],r)||cs(t,n,this.points,l,o,a-2*c,i,[0,-1],r))return!0;var h=this.generateCutTrianglePts(a,i,l,o);return $r(t,n,h.topLeft)||$r(t,n,h.topRight)||$r(t,n,h.bottomRight)||$r(t,n,h.bottomLeft)}}};hs.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Tr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i)},intersectLine:function(t,n,r,a,i,l,o,f){var c=.15,h=.5,p=.85,m=this.generateBarrelBezierPts(r+2*o,a+2*o,t,n),y=function(w){var S=Hu({x:w[0],y:w[1]},{x:w[2],y:w[3]},{x:w[4],y:w[5]},c),N=Hu({x:w[0],y:w[1]},{x:w[2],y:w[3]},{x:w[4],y:w[5]},h),E=Hu({x:w[0],y:w[1]},{x:w[2],y:w[3]},{x:w[4],y:w[5]},p);return[w[0],w[1],S.x,S.y,N.x,N.y,E.x,E.y,w[4],w[5]]},x=[].concat(y(m.topLeft),y(m.topRight),y(m.bottomRight),y(m.bottomLeft));return vd(i,l,x,t,n)},generateBarrelBezierPts:function(t,n,r,a){var i=n/2,l=t/2,o=r-l,f=r+l,c=a-i,h=a+i,p=a1(t,n),m=p.heightOffset,y=p.widthOffset,x=p.ctrlPtOffsetPct*t,b={topLeft:[o,c+m,o+x,c,o+y,c],topRight:[f-y,c,f-x,c,f,c+m],bottomRight:[f,h-m,f-x,h,f-y,h],bottomLeft:[o+y,h,o+x,h,o,h-m]};return b.topLeft.isTop=!0,b.topRight.isTop=!0,b.bottomLeft.isBottom=!0,b.bottomRight.isBottom=!0,b},checkPoint:function(t,n,r,a,i,l,o,f){var c=a1(a,i),h=c.heightOffset,p=c.widthOffset;if(cs(t,n,this.points,l,o,a,i-2*h,[0,-1],r)||cs(t,n,this.points,l,o,a-2*p,i,[0,-1],r))return!0;for(var m=this.generateBarrelBezierPts(a,i,l,o),y=function(_,L,M){var z=M[4],B=M[2],H=M[0],G=M[5],U=M[1],I=Math.min(z,H),V=Math.max(z,H),K=Math.min(G,U),Q=Math.max(G,U);if(I<=_&&_<=V&&K<=L&&L<=Q){var F=LQ(z,B,H),q=TQ(F[0],F[1],F[2],_),X=q.filter(function(P){return 0<=P&&P<=1});if(X.length>0)return X[0]}return null},x=Object.keys(m),b=0;b<x.length;b++){var w=x[b],S=m[w],N=y(t,n,S);if(N!=null){var E=S[5],T=S[3],R=S[1],A=er(E,T,R,N);if(S.isTop&&A<=n||S.isBottom&&n<=A)return!0}}return!1}}};hs.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Tr(4,0),draw:function(t,n,r,a,i,l){this.renderer.nodeShapeImpl(this.name,t,n,r,a,i,this.points,l)},intersectLine:function(t,n,r,a,i,l,o,f){var c=t-(r/2+o),h=n-(a/2+o),p=h,m=t+(r/2+o),y=fl(i,l,t,n,c,h,m,p,!1);return y.length>0?y:GO(i,l,t,n,r,a,o,f)},checkPoint:function(t,n,r,a,i,l,o,f){f=f==="auto"?Sl(a,i):f;var c=2*f;if(cs(t,n,this.points,l,o,a,i-c,[0,-1],r)||cs(t,n,this.points,l,o,a-c,i,[0,-1],r))return!0;var h=a/2+2*r,p=i/2+2*r,m=[l-h,o-p,l-h,o,l+h,o,l+h,o-p];return!!($r(t,n,m)||oo(t,n,c,c,l+a/2-f,o+i/2-f,r)||oo(t,n,c,c,l-a/2+f,o+i/2-f,r))}}};hs.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Tr(3,0)),this.generateRoundPolygon("round-triangle",Tr(3,0)),this.generatePolygon("rectangle",Tr(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",Tr(5,0)),this.generateRoundPolygon("round-pentagon",Tr(5,0)),this.generatePolygon("hexagon",Tr(6,0)),this.generateRoundPolygon("round-hexagon",Tr(6,0)),this.generatePolygon("heptagon",Tr(7,0)),this.generateRoundPolygon("round-heptagon",Tr(7,0)),this.generatePolygon("octagon",Tr(8,0)),this.generateRoundPolygon("round-octagon",Tr(8,0));var r=new Array(20);{var a=r1(5,0),i=r1(5,Math.PI/5),l=.5*(3-Math.sqrt(5));l*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=l,i[o*2+1]*=l;for(var o=0;o<20/4;o++)r[o*4]=a[o*2],r[o*4+1]=a[o*2+1],r[o*4+2]=i[o*2],r[o*4+3]=i[o*2+1]}r=$O(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var f=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",f),this.generateRoundPolygon("round-tag",f)}e.makePolygon=function(c){var h=c.join("$"),p="polygon-"+h,m;return(m=this[p])?m:t.generatePolygon(p,c)}};var Wd={};Wd.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Wd.redraw=function(e){e=e||UO();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e};Wd.beforeRender=function(e,t){if(!this.destroyed){t==null&&dn("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(r,a){return a.priority-r.priority})}};var pA=function(t,n,r){for(var a=t.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(n,r)};Wd.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function(a){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){pA(e,!0,a);var i=us();e.render(e.renderOptions);var l=e.lastDrawTime=us();e.averageRedrawTime===void 0&&(e.averageRedrawTime=l-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var o=l-i;e.redrawTotalTime+=o,e.lastRedrawTime=o,e.averageRedrawTime=e.averageRedrawTime/2+o/2,e.requestedFrame=!1}else pA(e,!1,a);e.skipFrame=!1,Rp(n)}};Rp(n)}};var WJ=function(t){this.init(t)},KL=WJ,Mc=KL.prototype;Mc.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Mc.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var a=r.document,i=a.head,l="__________cytoscape_stylesheet",o="__________cytoscape_container",f=a.getElementById(l)!=null;if(n.className.indexOf(o)<0&&(n.className=(n.className||"")+" "+o),!f){var c=a.createElement("style");c.id=l,c.textContent="."+o+" { position: relative; }",i.insertBefore(c,i.children[0])}var h=r.getComputedStyle(n),p=h.getPropertyValue("position");p==="static"&&zt("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.webgl=e.webgl,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=Re(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()};Mc.notify=function(e,t){var n=this,r=n.cy;if(!this.destroyed){if(e==="init"){n.load();return}if(e==="destroy"){n.destroy();return}(e==="add"||e==="remove"||e==="move"&&r.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount")&&n.invalidateCachedZSortedEles(),e==="viewport"&&n.redrawHint("select",!0),e==="gc"&&n.redrawHint("gc",!0),(e==="load"||e==="resize"||e==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Mc.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n,a=r.target;(a.off||a.removeEventListener).apply(a,r.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch{}};Mc.isHeadless=function(){return!1};[nS,GL,$L,Dc,hs,Wd].forEach(function(e){at(Mc,e)});var Z0=1e3/60,YL={setupDequeueing:function(t){return function(){var r=this,a=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var i=$d(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},t.deqRedrawThreshold),l=function(c,h){var p=us(),m=a.averageRedrawTime,y=a.lastRedrawTime,x=[],b=a.cy.extent(),w=a.getPixelRatio();for(c||a.flushRenderedStyleQueue();;){var S=us(),N=S-p,E=S-h;if(y<Z0){var T=Z0-(c?m:0);if(E>=t.deqFastCost*T)break}else if(c){if(N>=t.deqCost*y||N>=t.deqAvgCost*m)break}else if(E>=t.deqNoDrawCost*Z0)break;var R=t.deq(r,w,b);if(R.length>0)for(var A=0;A<R.length;A++)x.push(R[A]);else break}x.length>0&&(t.onDeqd(r,x),!c&&t.shouldRedraw(r,x,w,b)&&i())},o=t.priority||Uw;a.beforeRender(l,o(r))}}}},ZJ=(function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dp;Rl(this,e),this.idsByKey=new ts,this.keyForId=new ts,this.cachesByLvl=new ts,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return Dl(e,[{key:"getIdsFor",value:function(n){n==null&&dn("Can not get id list for null key");var r=this.idsByKey,a=this.idsByKey.get(n);return a||(a=new Tc,r.set(n,a)),a}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);this.deleteIdForKey(a,r),this.addIdForKey(i,r),this.keyForId.set(r,i)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteIdForKey(a,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);return a!==i}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,a=this.lvls,i=r.get(n);return i||(i=new ts,r.set(n,i),a.push(n)),i}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var a=this.getKey(n),i=this.getCache(a,r);return i!=null&&this.updateKeyMappingFor(n),i}},{key:"getForCachedKey",value:function(n,r){var a=this.keyForId.get(n.id()),i=this.getCache(a,r);return i}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var a=this.getKey(n);return this.hasCache(a,r)}},{key:"setCache",value:function(n,r,a){a.key=n,this.getCachesAt(r).set(n,a)}},{key:"set",value:function(n,r,a){var i=this.getKey(n);this.setCache(i,r,a),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var a=this.getKey(n);this.deleteCache(a,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(a){return r.deleteCache(n,a)})}},{key:"invalidate",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteKeyMappingFor(n);var i=this.doesEleInvalidateKey(n);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}])})(),mA=25,zv=50,up=-4,g1=3,XL=7.99,JJ=8,eee=1024,tee=1024,nee=1024,ree=.2,aee=.8,iee=10,see=.15,lee=.1,oee=.9,uee=.9,cee=100,fee=1,Bu={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},dee=dr({getKey:null,doesEleInvalidateKey:Dp,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:zO,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Xf=function(t,n){var r=this;r.renderer=t,r.onDequeues=[];var a=dee(n);at(r,a),r.lookup=new ZJ(a.getKey,a.doesEleInvalidateKey),r.setupDequeueing()},$n=Xf.prototype;$n.reasons=Bu;$n.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]};$n.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{},r=n[e]=n[e]||[];return r};$n.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new Kd(function(n,r){return r.reqs-n.reqs});return t};$n.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};$n.getElement=function(e,t,n,r,a){var i=this,l=this.renderer,o=l.cy.zoom(),f=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent())return null;if(r==null&&(r=Math.ceil(Vw(o*n))),r<up)r=up;else if(o>=XL||r>g1)return null;var c=Math.pow(2,r),h=t.h*c,p=t.w*c,m=l.eleTextBiggerThanMin(e,c);if(!this.isVisible(e,m))return null;var y=f.get(e,r);if(y&&y.invalidated&&(y.invalidated=!1,y.texture.invalidatedWidth-=y.width),y)return y;var x;if(h<=mA?x=mA:h<=zv?x=zv:x=Math.ceil(h/zv)*zv,h>nee||p>tee)return null;var b=i.getTextureQueue(x),w=b[b.length-2],S=function(){return i.recycleTexture(x,p)||i.addTexture(x,p)};w||(w=b[b.length-1]),w||(w=S()),w.width-w.usedWidth<p&&(w=S());for(var N=function(I){return I&&I.scaledLabelShown===m},E=a&&a===Bu.dequeue,T=a&&a===Bu.highQuality,R=a&&a===Bu.downscale,A,D=r+1;D<=g1;D++){var _=f.get(e,D);if(_){A=_;break}}var L=A&&A.level===r+1?A:null,M=function(){w.context.drawImage(L.texture.canvas,L.x,0,L.width,L.height,w.usedWidth,0,p,h)};if(w.context.setTransform(1,0,0,1,0,0),w.context.clearRect(w.usedWidth,0,p,x),N(L))M();else if(N(A))if(T){for(var z=A.level;z>r;z--)L=i.getElement(e,t,n,z,Bu.downscale);M()}else return i.queueElement(e,A.level-1),A;else{var B;if(!E&&!T&&!R)for(var H=r-1;H>=up;H--){var G=f.get(e,H);if(G){B=G;break}}if(N(B))return i.queueElement(e,r),B;w.context.translate(w.usedWidth,0),w.context.scale(c,c),this.drawElement(w.context,e,t,m,!1),w.context.scale(1/c,1/c),w.context.translate(-w.usedWidth,0)}return y={x:w.usedWidth,texture:w,level:r,scale:c,width:p,height:h,scaledLabelShown:m},w.usedWidth+=Math.ceil(p+JJ),w.eleCaches.push(y),f.set(e,r,y),i.checkTextureFullness(w),y};$n.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])};$n.invalidateElement=function(e){var t=this,n=t.lookup,r=[],a=n.isInvalid(e);if(a){for(var i=up;i<=g1;i++){var l=n.getForCachedKey(e,i);l&&r.push(l)}var o=n.invalidate(e);if(o)for(var f=0;f<r.length;f++){var c=r[f],h=c.texture;h.invalidatedWidth+=c.width,c.invalidated=!0,t.checkTextureUtility(h)}t.removeFromQueue(e)}};$n.checkTextureUtility=function(e){e.invalidatedWidth>=ree*e.width&&this.retireTexture(e)};$n.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>aee&&e.fullnessChecks>=iee?wl(n,e):e.fullnessChecks++};$n.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),a=this.lookup;wl(r,e),e.retired=!0;for(var i=e.eleCaches,l=0;l<i.length;l++){var o=i[l];a.deleteCache(o.key,o.level)}qw(i);var f=t.getRetiredTextureQueue(n);f.push(e)};$n.addTexture=function(e,t){var n=this,r=n.getTextureQueue(e),a={};return r.push(a),a.eleCaches=[],a.height=e,a.width=Math.max(eee,t),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=n.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};$n.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),a=n.getRetiredTextureQueue(e),i=0;i<a.length;i++){var l=a[i];if(l.width>=t)return l.retired=!1,l.usedWidth=0,l.invalidatedWidth=0,l.fullnessChecks=0,qw(l.eleCaches),l.context.setTransform(1,0,0,1,0,0),l.context.clearRect(0,0,l.width,l.height),wl(a,l),r.push(l),l}};$n.queueElement=function(e,t){var n=this,r=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(e),l=a[i];if(l)l.level=Math.max(l.level,t),l.eles.merge(e),l.reqs++,r.updateItem(l);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};r.push(o),a[i]=o}};$n.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=[],i=t.lookup,l=0;l<fee&&n.size()>0;l++){var o=n.pop(),f=o.key,c=o.eles[0],h=i.hasCache(c,o.level);if(r[f]=null,h)continue;a.push(o);var p=t.getBoundingBox(c);t.getElement(c,p,e,o.level,Bu.dequeue)}return a};$n.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=this.getKey(e),i=r[a];i!=null&&(i.eles.length===1?(i.reqs=Fw,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(e))};$n.onDequeue=function(e){this.onDequeues.push(e)};$n.offDequeue=function(e){wl(this.onDequeues,e)};$n.setupDequeueing=YL.setupDequeueing({deqRedrawThreshold:cee,deqCost:see,deqAvgCost:lee,deqNoDrawCost:oee,deqFastCost:uee,deq:function(t,n,r){return t.dequeue(n,r)},onDeqd:function(t,n){for(var r=0;r<t.onDequeues.length;r++){var a=t.onDequeues[r];a(n)}},shouldRedraw:function(t,n,r,a){for(var i=0;i<n.length;i++)for(var l=n[i].eles,o=0;o<l.length;o++){var f=l[o].boundingBox();if(Gw(f,a))return!0}return!1},priority:function(t){return t.renderer.beforeRenderPriorities.eleTxrDeq}});var hee=1,td=-4,Ip=2,vee=3.99,pee=50,mee=50,gee=.15,yee=.1,xee=.9,bee=.9,wee=1,gA=250,See=4e3*4e3,yA=32767,Eee=!0,QL=function(t){var n=this,r=n.renderer=t,a=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=us()-2*gA,n.skipping=!1,n.eleTxrDeqs=a.collection(),n.scheduleElementRefinement=$d(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},mee),r.beforeRender(function(l,o){o-n.lastInvalidationTime<=gA?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var i=function(o,f){return f.reqs-o.reqs};n.layersQueue=new Kd(i),n.setupDequeueing()},hr=QL.prototype,xA=0,Cee=Math.pow(2,53)-1;hr.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),a=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(r,a),l={id:xA=++xA%Cee,bb:e,level:t,width:r,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=l.context,f=-l.bb.x1,c=-l.bb.y1;return o.scale(n,n),o.translate(f,c),l};hr.getLayers=function(e,t,n){var r=this,a=r.renderer,i=a.cy,l=i.zoom(),o=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(Vw(l*t)),n<td)n=td;else if(l>=vee||n>Ip)return null}r.validateLayersElesOrdering(n,e);var f=r.layersByLevel,c=Math.pow(2,n),h=f[n]=f[n]||[],p,m=r.levelIsComplete(n,e),y,x=function(){var M=function(U){if(r.validateLayersElesOrdering(U,e),r.levelIsComplete(U,e))return y=f[U],!0},z=function(U){if(!y)for(var I=n+U;td<=I&&I<=Ip&&!M(I);I+=U);};z(1),z(-1);for(var B=h.length-1;B>=0;B--){var H=h[B];H.invalid&&wl(h,H)}};if(!m)x();else return h;var b=function(){if(!p){p=Dr();for(var M=0;M<e.length;M++)wQ(p,e[M].boundingBox())}return p},w=function(M){M=M||{};var z=M.after;b();var B=Math.ceil(p.w*c),H=Math.ceil(p.h*c);if(B>yA||H>yA)return null;var G=B*H;if(G>See)return null;var U=r.makeLayer(p,n);if(z!=null){var I=h.indexOf(z)+1;h.splice(I,0,U)}else(M.insert===void 0||M.insert)&&h.unshift(U);return U};if(r.skipping&&!o)return null;for(var S=null,N=e.length/hee,E=!o,T=0;T<e.length;T++){var R=e[T],A=R._private.rscratch,D=A.imgLayerCaches=A.imgLayerCaches||{},_=D[n];if(_){S=_;continue}if((!S||S.eles.length>=N||!HO(S.bb,R.boundingBox()))&&(S=w({insert:!0,after:S}),!S))return null;y||E?r.queueLayer(S,R):r.drawEleInLayer(S,R,n,t),S.eles.push(R),D[n]=S}return y||(E?null:h)};hr.getEleLevelForLayerLevel=function(e,t){return e};hr.drawEleInLayer=function(e,t,n,r){var a=this,i=this.renderer,l=e.context,o=t.boundingBox();o.w===0||o.h===0||!t.visible()||(n=a.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(l,!1),i.drawCachedElement(l,t,null,null,n,Eee),i.setImgSmoothing(l,!0))};hr.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||r.length===0)return!1;for(var a=0,i=0;i<r.length;i++){var l=r[i];if(l.reqs>0||l.invalid)return!1;a+=l.eles.length}return a===t.length};hr.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],i=-1,l=0;l<t.length;l++)if(a.eles[0]===t[l]){i=l;break}if(i<0){this.invalidateLayer(a);continue}for(var o=i,l=0;l<a.eles.length;l++)if(a.eles[l]!==t[o+l]){this.invalidateLayer(a);break}}};hr.updateElementsInLayers=function(e,t){for(var n=this,r=qd(e[0]),a=0;a<e.length;a++)for(var i=r?null:e[a],l=r?e[a]:e[a].ele,o=l._private.rscratch,f=o.imgLayerCaches=o.imgLayerCaches||{},c=td;c<=Ip;c++){var h=f[c];h&&(i&&n.getEleLevelForLayerLevel(h.level)!==i.level||t(h,l,i))}};hr.haveLayers=function(){for(var e=this,t=!1,n=td;n<=Ip;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t};hr.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=us(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(r,a,i){t.invalidateLayer(r)}))};hr.invalidateLayer=function(e){if(this.lastInvalidationTime=us(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];wl(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}};hr.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(r,a,i){var l=r.replacement;if(l||(l=r.replacement=t.makeLayer(r.bb,r.level),l.replaces=r,l.eles=r.eles),!l.reqs)for(var o=0;o<l.eles.length;o++)t.queueLayer(l,l.eles[o])})};hr.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()};hr.queueLayer=function(e,t){var n=this,r=n.layersQueue,a=e.elesQueue,i=a.hasId=a.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;a.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,r.updateItem(e)):(e.reqs=1,r.push(e))}};hr.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],a=0;a<wee&&n.size()!==0;){var i=n.peek();if(i.replacement){n.pop();continue}if(i.replaces&&i!==i.replaces.replacement){n.pop();continue}if(i.invalid){n.pop();continue}var l=i.elesQueue.shift();l&&(t.drawEleInLayer(i,l,i.level,e),a++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}return r};hr.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,a=n.indexOf(r);if(!(a<0||r.invalid)){n[a]=e;for(var i=0;i<e.eles.length;i++){var l=e.eles[i]._private,o=l.imgLayerCaches=l.imgLayerCaches||{};o&&(o[e.level]=e)}t.requestRedraw()}};hr.requestRedraw=$d(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100);hr.setupDequeueing=YL.setupDequeueing({deqRedrawThreshold:pee,deqCost:gee,deqAvgCost:yee,deqNoDrawCost:xee,deqFastCost:bee,deq:function(t,n){return t.dequeue(n)},onDeqd:Uw,shouldRedraw:zO,priority:function(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq}});var WL={},bA;function Nee(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function kee(e,t,n){for(var r,a=0;a<t.length;a++){var i=t[a];a===0&&(r=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function wA(e,t,n){e.beginPath&&e.beginPath();for(var r=t,a=0;a<r.length;a++){var i=r[a];e.lineTo(i.x,i.y)}var l=n,o=n[0];e.moveTo(o.x,o.y);for(var a=1;a<l.length;a++){var i=l[a];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function Tee(e,t,n,r,a){e.beginPath&&e.beginPath(),e.arc(n,r,a,0,Math.PI*2,!1);var i=t,l=i[0];e.moveTo(l.x,l.y);for(var o=0;o<i.length;o++){var f=i[o];e.lineTo(f.x,f.y)}e.closePath&&e.closePath()}function jee(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}WL.arrowShapeImpl=function(e){return(bA||(bA={polygon:Nee,"triangle-backcurve":kee,"triangle-tee":wA,"circle-triangle":Tee,"triangle-cross":wA,circle:jee}))[e]};var Ti={};Ti.drawElement=function(e,t,n,r,a,i){var l=this;t.isNode()?l.drawNode(e,t,n,r,a,i):l.drawEdge(e,t,n,r,a,i)};Ti.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)};Ti.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)};Ti.drawCachedElementPortion=function(e,t,n,r,a,i,l,o){var f=this,c=n.getBoundingBox(t);if(!(c.w===0||c.h===0)){var h=n.getElement(t,c,r,a,i);if(h!=null){var p=o(f,t);if(p===0)return;var m=l(f,t),y=c.x1,x=c.y1,b=c.w,w=c.h,S,N,E,T,R;if(m!==0){var A=n.getRotationPoint(t);E=A.x,T=A.y,e.translate(E,T),e.rotate(m),R=f.getImgSmoothing(e),R||f.setImgSmoothing(e,!0);var D=n.getRotationOffset(t);S=D.x,N=D.y}else S=y,N=x;var _;p!==1&&(_=e.globalAlpha,e.globalAlpha=_*p),e.drawImage(h.texture.canvas,h.x,0,h.width,h.height,S,N,b,w),p!==1&&(e.globalAlpha=_),m!==0&&(e.rotate(-m),e.translate(-E,-T),R||f.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var Aee=function(){return 0},Ree=function(t,n){return t.getTextAngle(n,null)},Dee=function(t,n){return t.getTextAngle(n,"source")},Mee=function(t,n){return t.getTextAngle(n,"target")},_ee=function(t,n){return n.effectiveOpacity()},J0=function(t,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};Ti.drawCachedElement=function(e,t,n,r,a,i){var l=this,o=l.data,f=o.eleTxrCache,c=o.lblTxrCache,h=o.slbTxrCache,p=o.tlbTxrCache,m=t.boundingBox(),y=i===!0?f.reasons.highQuality:null;if(!(m.w===0||m.h===0||!t.visible())&&(!r||Gw(m,r))){var x=t.isEdge(),b=t.element()._private.rscratch.badLine;l.drawElementUnderlay(e,t),l.drawCachedElementPortion(e,t,f,n,a,y,Aee,_ee),(!x||!b)&&l.drawCachedElementPortion(e,t,c,n,a,y,Ree,J0),x&&!b&&(l.drawCachedElementPortion(e,t,h,n,a,y,Dee,J0),l.drawCachedElementPortion(e,t,p,n,a,y,Mee,J0)),l.drawElementOverlay(e,t)}};Ti.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var a=t[r];n.drawElement(e,a)}};Ti.drawCachedElements=function(e,t,n,r){for(var a=this,i=0;i<t.length;i++){var l=t[i];a.drawCachedElement(e,l,n,r)}};Ti.drawCachedNodes=function(e,t,n,r){for(var a=this,i=0;i<t.length;i++){var l=t[i];l.isNode()&&a.drawCachedElement(e,l,n,r)}};Ti.drawLayeredElements=function(e,t,n,r){var a=this,i=a.data.lyrTxrCache.getLayers(t,n);if(i)for(var l=0;l<i.length;l++){var o=i[l],f=o.bb;f.w===0||f.h===0||e.drawImage(o.canvas,f.x1,f.y1,f.w,f.h)}else a.drawCachedElements(e,t,n,r)};var vs={};vs.drawEdge=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this,o=t._private.rscratch;if(!(i&&!t.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var f;n&&(f=n,e.translate(-f.x1,-f.y1));var c=i?t.pstyle("opacity").value:1,h=i?t.pstyle("line-opacity").value:1,p=t.pstyle("curve-style").value,m=t.pstyle("line-style").value,y=t.pstyle("width").pfValue,x=t.pstyle("line-cap").value,b=t.pstyle("line-outline-width").value,w=t.pstyle("line-outline-color").value,S=c*h,N=c*h,E=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S;p==="straight-triangle"?(l.eleStrokeStyle(e,t,U),l.drawEdgeTrianglePath(t,e,o.allpts)):(e.lineWidth=y,e.lineCap=x,l.eleStrokeStyle(e,t,U),l.drawEdgePath(t,e,o.allpts,m),e.lineCap="butt")},T=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S;if(e.lineWidth=y+b,e.lineCap=x,b>0)l.colorStrokeStyle(e,w[0],w[1],w[2],U);else{e.lineCap="butt";return}p==="straight-triangle"?l.drawEdgeTrianglePath(t,e,o.allpts):(l.drawEdgePath(t,e,o.allpts,m),e.lineCap="butt")},R=function(){a&&l.drawEdgeOverlay(e,t)},A=function(){a&&l.drawEdgeUnderlay(e,t)},D=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;l.drawArrowheads(e,t,U)},_=function(){l.drawElementText(e,t,null,r)};e.lineJoin="round";var L=t.pstyle("ghost").value==="yes";if(L){var M=t.pstyle("ghost-offset-x").pfValue,z=t.pstyle("ghost-offset-y").pfValue,B=t.pstyle("ghost-opacity").value,H=S*B;e.translate(M,z),E(H),D(H),e.translate(-M,-z)}else T();A(),E(),D(),R(),_(),n&&e.translate(f.x1,f.y1)}};var ZL=function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(n,r){if(r.visible()){var a=r.pstyle("".concat(t,"-opacity")).value;if(a!==0){var i=this,l=i.usePaths(),o=r._private.rscratch,f=r.pstyle("".concat(t,"-padding")).pfValue,c=2*f,h=r.pstyle("".concat(t,"-color")).value;n.lineWidth=c,o.edgeType==="self"&&!l?n.lineCap="butt":n.lineCap="round",i.colorStrokeStyle(n,h[0],h[1],h[2],a),i.drawEdgePath(r,n,o.allpts,"solid")}}}};vs.drawEdgeOverlay=ZL("overlay");vs.drawEdgeUnderlay=ZL("underlay");vs.drawEdgePath=function(e,t,n,r){var a=e._private.rscratch,i=t,l,o=!1,f=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,h=e.pstyle("line-dash-offset").pfValue;if(f){var p=n.join("$"),m=a.pathCacheKey&&a.pathCacheKey===p;m?(l=t=a.pathCache,o=!0):(l=t=new Path2D,a.pathCacheKey=p,a.pathCache=l)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(c),i.lineDashOffset=h;break;case"solid":i.setLineDash([]);break}if(!o&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var y=2;y+3<n.length;y+=4)t.quadraticCurveTo(n[y],n[y+1],n[y+2],n[y+3]);break;case"straight":case"haystack":for(var x=2;x+1<n.length;x+=2)t.lineTo(n[x],n[x+1]);break;case"segments":if(a.isRound){var b=Xr(a.roundCorners),w;try{for(b.s();!(w=b.n()).done;){var S=w.value;FL(t,S)}}catch(E){b.e(E)}finally{b.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var N=2;N+1<n.length;N+=2)t.lineTo(n[N],n[N+1]);break}t=i,f?t.stroke(l):t.stroke(),t.setLineDash&&t.setLineDash([])};vs.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var i=[n[a+2]-n[a],n[a+3]-n[a+1]],l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/l,-i[0]/l],f=[o[0]*r/2,o[1]*r/2];t.beginPath(),t.moveTo(n[a]-f[0],n[a+1]-f[1]),t.lineTo(n[a]+f[0],n[a+1]+f[1]),t.lineTo(n[a+2],n[a+3]),t.closePath(),t.fill()}};vs.drawArrowheads=function(e,t,n){var r=t._private.rscratch,a=r.edgeType==="haystack";a||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),a||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)};vs.drawArrowhead=function(e,t,n,r,a,i,l){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(i)||i==null)){var o=this,f=t.pstyle(n+"-arrow-shape").value;if(f!=="none"){var c=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",h=t.pstyle(n+"-arrow-fill").value,p=t.pstyle("width").pfValue,m=t.pstyle(n+"-arrow-width"),y=m.value==="match-line"?p:m.pfValue;m.units==="%"&&(y*=p);var x=t.pstyle("opacity").value;l===void 0&&(l=x);var b=e.globalCompositeOperation;(l!==1||h==="hollow")&&(e.globalCompositeOperation="destination-out",o.colorFillStyle(e,255,255,255,1),o.colorStrokeStyle(e,255,255,255,1),o.drawArrowShape(t,e,c,p,f,y,r,a,i),e.globalCompositeOperation=b);var w=t.pstyle(n+"-arrow-color").value;o.colorFillStyle(e,w[0],w[1],w[2],l),o.colorStrokeStyle(e,w[0],w[1],w[2],l),o.drawArrowShape(t,e,h,p,f,y,r,a,i)}}};vs.drawArrowShape=function(e,t,n,r,a,i,l,o,f){var c=this,h=this.usePaths()&&a!=="triangle-cross",p=!1,m,y=t,x={x:l,y:o},b=e.pstyle("arrow-scale").value,w=this.getArrowWidth(r,b),S=c.arrowShapes[a];if(h){var N=c.arrowPathCache=c.arrowPathCache||[],E=jo(a),T=N[E];T!=null?(m=t=T,p=!0):(m=t=new Path2D,N[E]=m)}p||(t.beginPath&&t.beginPath(),h?S.draw(t,1,0,{x:0,y:0},1):S.draw(t,w,f,x,r),t.closePath&&t.closePath()),t=y,h&&(t.translate(l,o),t.rotate(f),t.scale(w,w)),(n==="filled"||n==="both")&&(h?t.fill(m):t.fill()),(n==="hollow"||n==="both")&&(t.lineWidth=i/(h?w:1),t.lineJoin="miter",h?t.stroke(m):t.stroke()),h&&(t.scale(1/w,1/w),t.rotate(-f),t.translate(-l,-o))};var iS={};iS.safeDrawImage=function(e,t,n,r,a,i,l,o,f,c){if(!(a<=0||i<=0||f<=0||c<=0))try{e.drawImage(t,n,r,a,i,l,o,f,c)}catch(h){zt(h)}};iS.drawInscribedImage=function(e,t,n,r,a){var i=this,l=n.position(),o=l.x,f=l.y,c=n.cy().style(),h=c.getIndexedStyle.bind(c),p=h(n,"background-fit","value",r),m=h(n,"background-repeat","value",r),y=n.width(),x=n.height(),b=n.padding()*2,w=y+(h(n,"background-width-relative-to","value",r)==="inner"?0:b),S=x+(h(n,"background-height-relative-to","value",r)==="inner"?0:b),N=n._private.rscratch,E=h(n,"background-clip","value",r),T=E==="node",R=h(n,"background-image-opacity","value",r)*a,A=h(n,"background-image-smoothing","value",r),D=n.pstyle("corner-radius").value;D!=="auto"&&(D=n.pstyle("corner-radius").pfValue);var _=t.width||t.cachedW,L=t.height||t.cachedH;(_==null||L==null)&&(document.body.appendChild(t),_=t.cachedW=t.width||t.offsetWidth,L=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var M=_,z=L;if(h(n,"background-width","value",r)!=="auto"&&(h(n,"background-width","units",r)==="%"?M=h(n,"background-width","pfValue",r)*w:M=h(n,"background-width","pfValue",r)),h(n,"background-height","value",r)!=="auto"&&(h(n,"background-height","units",r)==="%"?z=h(n,"background-height","pfValue",r)*S:z=h(n,"background-height","pfValue",r)),!(M===0||z===0)){if(p==="contain"){var B=Math.min(w/M,S/z);M*=B,z*=B}else if(p==="cover"){var B=Math.max(w/M,S/z);M*=B,z*=B}var H=o-w/2,G=h(n,"background-position-x","units",r),U=h(n,"background-position-x","pfValue",r);G==="%"?H+=(w-M)*U:H+=U;var I=h(n,"background-offset-x","units",r),V=h(n,"background-offset-x","pfValue",r);I==="%"?H+=(w-M)*V:H+=V;var K=f-S/2,Q=h(n,"background-position-y","units",r),F=h(n,"background-position-y","pfValue",r);Q==="%"?K+=(S-z)*F:K+=F;var q=h(n,"background-offset-y","units",r),X=h(n,"background-offset-y","pfValue",r);q==="%"?K+=(S-z)*X:K+=X,N.pathCache&&(H-=o,K-=f,o=0,f=0);var P=e.globalAlpha;e.globalAlpha=R;var Z=i.getImgSmoothing(e),ae=!1;if(A==="no"&&Z?(i.setImgSmoothing(e,!1),ae=!0):A==="yes"&&!Z&&(i.setImgSmoothing(e,!0),ae=!0),m==="no-repeat")T&&(e.save(),N.pathCache?e.clip(N.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,o,f,w,S,D,N),e.clip())),i.safeDrawImage(e,t,0,0,_,L,H,K,M,z),T&&e.restore();else{var ie=e.createPattern(t,m);e.fillStyle=ie,i.nodeShapes[i.getNodeShape(n)].draw(e,o,f,w,S,D,N),e.translate(H,K),e.fill(),e.translate(-H,-K)}e.globalAlpha=P,ae&&i.setImgSmoothing(e,Z)}};var Po={};Po.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(Vw(n*r));t=Math.pow(2,a)}var i=e.pstyle("font-size").pfValue*t,l=e.pstyle("min-zoomed-font-size").pfValue;return!(i<l)};Po.drawElementText=function(e,t,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this;if(r==null){if(i&&!l.eleTextBiggerThanMin(t))return}else if(r===!1)return;if(t.isNode()){var o=t.pstyle("label");if(!o||!o.value)return;var f=l.getLabelJustification(t);e.textAlign=f,e.textBaseline="bottom"}else{var c=t.element()._private.rscratch.badLine,h=t.pstyle("label"),p=t.pstyle("source-label"),m=t.pstyle("target-label");if(c||(!h||!h.value)&&(!p||!p.value)&&(!m||!m.value))return;e.textAlign="center",e.textBaseline="bottom"}var y=!n,x;n&&(x=n,e.translate(-x.x1,-x.y1)),a==null?(l.drawText(e,t,null,y,i),t.isEdge()&&(l.drawText(e,t,"source",y,i),l.drawText(e,t,"target",y,i))):l.drawText(e,t,a,y,i),n&&e.translate(x.x1,x.y1)};Po.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(t=this.fontCaches[n],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t};Po.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=t.pstyle("font-style").strValue,a=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,l=t.pstyle("font-weight").strValue,o=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,f=t.pstyle("text-outline-opacity").value*o,c=t.pstyle("color").value,h=t.pstyle("text-outline-color").value;e.font=r+" "+l+" "+a+" "+i,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],o),this.colorStrokeStyle(e,h[0],h[1],h[2],f)};function Oee(e,t,n,r,a){var i=Math.min(r,a),l=i/2,o=t+r/2,f=n+a/2;e.beginPath(),e.arc(o,f,l,0,Math.PI*2),e.closePath()}function SA(e,t,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,l=Math.min(i,r/2,a/2);e.beginPath(),e.moveTo(t+l,n),e.lineTo(t+r-l,n),e.quadraticCurveTo(t+r,n,t+r,n+l),e.lineTo(t+r,n+a-l),e.quadraticCurveTo(t+r,n+a,t+r-l,n+a),e.lineTo(t+l,n+a),e.quadraticCurveTo(t,n+a,t,n+a-l),e.lineTo(t,n+l),e.quadraticCurveTo(t,n,t+l,n),e.closePath()}Po.getTextAngle=function(e,t){var n,r=e._private,a=r.rscratch,i=t?t+"-":"",l=e.pstyle(i+"text-rotation");if(l.strValue==="autorotate"){var o=Gr(a,"labelAngle",t);n=e.isEdge()?o:0}else l.strValue==="none"?n=0:n=l.pfValue;return n};Po.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=t._private,l=i.rscratch,o=a?t.effectiveOpacity():1;if(!(a&&(o===0||t.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var f=Gr(l,"labelX",n),c=Gr(l,"labelY",n),h,p,m=this.getLabelText(t,n);if(m!=null&&m!==""&&!isNaN(f)&&!isNaN(c)){this.setupTextStyle(e,t,a);var y=n?n+"-":"",x=Gr(l,"labelWidth",n),b=Gr(l,"labelHeight",n),w=t.pstyle(y+"text-margin-x").pfValue,S=t.pstyle(y+"text-margin-y").pfValue,N=t.isEdge(),E=t.pstyle("text-halign").value,T=t.pstyle("text-valign").value;N&&(E="center",T="center"),f+=w,c+=S;var R;switch(r?R=this.getTextAngle(t,n):R=0,R!==0&&(h=f,p=c,e.translate(h,p),e.rotate(R),f=0,c=0),T){case"top":break;case"center":c+=b/2;break;case"bottom":c+=b;break}var A=t.pstyle("text-background-opacity").value,D=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,L=t.pstyle("text-background-padding").pfValue,M=t.pstyle("text-background-shape").strValue,z=M==="round-rectangle"||M==="roundrectangle",B=M==="circle",H=2;if(A>0||_>0&&D>0){var G=e.fillStyle,U=e.strokeStyle,I=e.lineWidth,V=t.pstyle("text-background-color").value,K=t.pstyle("text-border-color").value,Q=t.pstyle("text-border-style").value,F=A>0,q=_>0&&D>0,X=f-L;switch(E){case"left":X-=x;break;case"center":X-=x/2;break}var P=c-b-L,Z=x+2*L,ae=b+2*L;if(F&&(e.fillStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(A*o,")")),q&&(e.strokeStyle="rgba(".concat(K[0],",").concat(K[1],",").concat(K[2],",").concat(D*o,")"),e.lineWidth=_,e.setLineDash))switch(Q){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":default:e.setLineDash([]);break}if(z?(e.beginPath(),SA(e,X,P,Z,ae,H)):B?(e.beginPath(),Oee(e,X,P,Z,ae)):(e.beginPath(),e.rect(X,P,Z,ae)),F&&e.fill(),q&&e.stroke(),q&&Q==="double"){var ie=_/2;e.beginPath(),z?SA(e,X+ie,P+ie,Z-2*ie,ae-2*ie,H):e.rect(X+ie,P+ie,Z-2*ie,ae-2*ie),e.stroke()}e.fillStyle=G,e.strokeStyle=U,e.lineWidth=I,e.setLineDash&&e.setLineDash([])}var le=2*t.pstyle("text-outline-width").pfValue;if(le>0&&(e.lineWidth=le),t.pstyle("text-wrap").value==="wrap"){var ye=Gr(l,"labelWrapCachedLines",n),ne=Gr(l,"labelLineHeight",n),W=x/2,J=this.getLabelJustification(t);switch(J==="auto"||(E==="left"?J==="left"?f+=-x:J==="center"&&(f+=-W):E==="center"?J==="left"?f+=-W:J==="right"&&(f+=W):E==="right"&&(J==="center"?f+=W:J==="right"&&(f+=x))),T){case"top":c-=(ye.length-1)*ne;break;case"center":case"bottom":c-=(ye.length-1)*ne;break}for(var se=0;se<ye.length;se++)le>0&&e.strokeText(ye[se],f,c),e.fillText(ye[se],f,c),c+=ne}else le>0&&e.strokeText(m,f,c),e.fillText(m,f,c);R!==0&&(e.rotate(-R),e.translate(-h,-p))}}};var _l={};_l.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,l=this,o,f,c=t._private,h=c.rscratch,p=t.position();if(!(!Re(p.x)||!Re(p.y))&&!(i&&!t.visible())){var m=i?t.effectiveOpacity():1,y=l.usePaths(),x,b=!1,w=t.padding();o=t.width()+2*w,f=t.height()+2*w;var S;n&&(S=n,e.translate(-S.x1,-S.y1));for(var N=t.pstyle("background-image"),E=N.value,T=new Array(E.length),R=new Array(E.length),A=0,D=0;D<E.length;D++){var _=E[D],L=T[D]=_!=null&&_!=="none";if(L){var M=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",D);A++,R[D]=l.getCachedImage(_,M,function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var z=t.pstyle("background-blacken").value,B=t.pstyle("border-width").pfValue,H=t.pstyle("background-opacity").value*m,G=t.pstyle("border-color").value,U=t.pstyle("border-style").value,I=t.pstyle("border-join").value,V=t.pstyle("border-cap").value,K=t.pstyle("border-position").value,Q=t.pstyle("border-dash-pattern").pfValue,F=t.pstyle("border-dash-offset").pfValue,q=t.pstyle("border-opacity").value*m,X=t.pstyle("outline-width").pfValue,P=t.pstyle("outline-color").value,Z=t.pstyle("outline-style").value,ae=t.pstyle("outline-opacity").value*m,ie=t.pstyle("outline-offset").value,le=t.pstyle("corner-radius").value;le!=="auto"&&(le=t.pstyle("corner-radius").pfValue);var ye=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;l.eleFillStyle(e,t,Oe)},ne=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;l.colorStrokeStyle(e,G[0],G[1],G[2],Oe)},W=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ae;l.colorStrokeStyle(e,P[0],P[1],P[2],Oe)},J=function(Oe,xe,Y,ue){var pe=l.nodePathCache=l.nodePathCache||[],de=BO(Y==="polygon"?Y+","+ue.join(","):Y,""+xe,""+Oe,""+le),be=pe[de],Le,Ne=!1;return be!=null?(Le=be,Ne=!0,h.pathCache=Le):(Le=new Path2D,pe[de]=h.pathCache=Le),{path:Le,cacheHit:Ne}},se=t.pstyle("shape").strValue,ge=t.pstyle("shape-polygon-points").pfValue;if(y){e.translate(p.x,p.y);var Te=J(o,f,se,ge);x=Te.path,b=Te.cacheHit}var Be=function(){if(!b){var Oe=p;y&&(Oe={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(x||e,Oe.x,Oe.y,o,f,le,h)}y?e.fill(x):e.fill()},ot=function(){for(var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Y=c.backgrounding,ue=0,pe=0;pe<R.length;pe++){var de=t.cy().style().getIndexedStyle(t,"background-image-containment","value",pe);if(xe&&de==="over"||!xe&&de==="inside"){ue++;continue}T[pe]&&R[pe].complete&&!R[pe].error&&(ue++,l.drawInscribedImage(e,R[pe],t,pe,Oe))}c.backgrounding=ue!==A,Y!==c.backgrounding&&t.updateStyle(!1)},Je=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;l.hasPie(t)&&(l.drawPie(e,t,xe),Oe&&(y||l.nodeShapes[l.getNodeShape(t)].draw(e,p.x,p.y,o,f,le,h)))},We=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;l.hasStripe(t)&&(e.save(),y?e.clip(h.pathCache):(l.nodeShapes[l.getNodeShape(t)].draw(e,p.x,p.y,o,f,le,h),e.clip()),l.drawStripe(e,t,xe),e.restore(),Oe&&(y||l.nodeShapes[l.getNodeShape(t)].draw(e,p.x,p.y,o,f,le,h)))},Ve=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,xe=(z>0?z:-z)*Oe,Y=z>0?0:255;z!==0&&(l.colorFillStyle(e,Y,Y,Y,xe),y?e.fill(x):e.fill())},De=function(){if(B>0){if(e.lineWidth=B,e.lineCap=V,e.lineJoin=I,e.setLineDash)switch(U){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(Q),e.lineDashOffset=F;break;case"solid":case"double":e.setLineDash([]);break}if(K!=="center"){if(e.save(),e.lineWidth*=2,K==="inside")y?e.clip(x):e.clip();else{var Oe=new Path2D;Oe.rect(-o/2-B,-f/2-B,o+2*B,f+2*B),Oe.addPath(x),e.clip(Oe,"evenodd")}y?e.stroke(x):e.stroke(),e.restore()}else y?e.stroke(x):e.stroke();if(U==="double"){e.lineWidth=B/3;var xe=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",y?e.stroke(x):e.stroke(),e.globalCompositeOperation=xe}e.setLineDash&&e.setLineDash([])}},Ye=function(){if(X>0){if(e.lineWidth=X,e.lineCap="butt",e.setLineDash)switch(Z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var Oe=p;y&&(Oe={x:0,y:0});var xe=l.getNodeShape(t),Y=B;K==="inside"&&(Y=0),K==="outside"&&(Y*=2);var ue=(o+Y+(X+ie))/o,pe=(f+Y+(X+ie))/f,de=o*ue,be=f*pe,Le=l.nodeShapes[xe].points,Ne;if(y){var Ke=J(de,be,xe,Le);Ne=Ke.path}if(xe==="ellipse")l.drawEllipsePath(Ne||e,Oe.x,Oe.y,de,be);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(xe)){var Ue=0,Ze=0,ut=0;xe==="round-diamond"?Ue=(Y+ie+X)*1.4:xe==="round-heptagon"?(Ue=(Y+ie+X)*1.075,ut=-(Y/2+ie+X)/35):xe==="round-hexagon"?Ue=(Y+ie+X)*1.12:xe==="round-pentagon"?(Ue=(Y+ie+X)*1.13,ut=-(Y/2+ie+X)/15):xe==="round-tag"?(Ue=(Y+ie+X)*1.12,Ze=(Y/2+X+ie)*.07):xe==="round-triangle"&&(Ue=(Y+ie+X)*(Math.PI/2),ut=-(Y+ie/2+X)/Math.PI),Ue!==0&&(ue=(o+Ue)/o,de=o*ue,["round-hexagon","round-tag"].includes(xe)||(pe=(f+Ue)/f,be=f*pe)),le=le==="auto"?KO(de,be):le;for(var ct=de/2,He=be/2,bt=le+(Y+X+ie)/2,vt=new Array(Le.length/2),hn=new Array(Le.length/2),Vt=0;Vt<Le.length/2;Vt++)vt[Vt]={x:Oe.x+Ze+ct*Le[Vt*2],y:Oe.y+ut+He*Le[Vt*2+1]};var ar,vn,Cn,yn,Nn=vt.length;for(vn=vt[Nn-1],ar=0;ar<Nn;ar++)Cn=vt[ar%Nn],yn=vt[(ar+1)%Nn],hn[ar]=rS(vn,Cn,yn,bt),vn=Cn,Cn=yn;l.drawRoundPolygonPath(Ne||e,Oe.x+Ze,Oe.y+ut,o*ue,f*pe,Le,hn)}else if(["roundrectangle","round-rectangle"].includes(xe))le=le==="auto"?Sl(de,be):le,l.drawRoundRectanglePath(Ne||e,Oe.x,Oe.y,de,be,le+(Y+X+ie)/2);else if(["cutrectangle","cut-rectangle"].includes(xe))le=le==="auto"?$w():le,l.drawCutRectanglePath(Ne||e,Oe.x,Oe.y,de,be,null,le+(Y+X+ie)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(xe))le=le==="auto"?Sl(de,be):le,l.drawBottomRoundRectanglePath(Ne||e,Oe.x,Oe.y,de,be,le+(Y+X+ie)/2);else if(xe==="barrel")l.drawBarrelPath(Ne||e,Oe.x,Oe.y,de,be);else if(xe.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(xe)){var ha=(Y+X+ie)/o;Le=Mp(_p(Le,ha)),l.drawPolygonPath(Ne||e,Oe.x,Oe.y,o,f,Le)}else{var pn=(Y+X+ie)/o;Le=Mp(_p(Le,-pn)),l.drawPolygonPath(Ne||e,Oe.x,Oe.y,o,f,Le)}if(y?e.stroke(Ne):e.stroke(),Z==="double"){e.lineWidth=Y/3;var va=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",y?e.stroke(Ne):e.stroke(),e.globalCompositeOperation=va}e.setLineDash&&e.setLineDash([])}},Qe=function(){a&&l.drawNodeOverlay(e,t,p,o,f)},st=function(){a&&l.drawNodeUnderlay(e,t,p,o,f)},ze=function(){l.drawElementText(e,t,null,r)},dt=t.pstyle("ghost").value==="yes";if(dt){var he=t.pstyle("ghost-offset-x").pfValue,Ce=t.pstyle("ghost-offset-y").pfValue,Me=t.pstyle("ghost-opacity").value,Fe=Me*m;e.translate(he,Ce),W(),Ye(),ye(Me*H),Be(),ot(Fe,!0),ne(Me*q),De(),Je(z!==0||B!==0),We(z!==0||B!==0),ot(Fe,!1),Ve(Fe),e.translate(-he,-Ce)}y&&e.translate(-p.x,-p.y),st(),y&&e.translate(p.x,p.y),W(),Ye(),ye(),Be(),ot(m,!0),ne(),De(),Je(z!==0||B!==0),We(z!==0||B!==0),ot(m,!1),Ve(),y&&e.translate(-p.x,-p.y),ze(),Qe(),n&&e.translate(S.x1,S.y1)}};var JL=function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(n,r,a,i,l){var o=this;if(r.visible()){var f=r.pstyle("".concat(t,"-padding")).pfValue,c=r.pstyle("".concat(t,"-opacity")).value,h=r.pstyle("".concat(t,"-color")).value,p=r.pstyle("".concat(t,"-shape")).value,m=r.pstyle("".concat(t,"-corner-radius")).value;if(c>0){if(a=a||r.position(),i==null||l==null){var y=r.padding();i=r.width()+2*y,l=r.height()+2*y}o.colorFillStyle(n,h[0],h[1],h[2],c),o.nodeShapes[p].draw(n,a.x,a.y,i+f*2,l+f*2,m),n.fill()}}}};_l.drawNodeOverlay=JL("overlay");_l.drawNodeUnderlay=JL("underlay");_l.hasPie=function(e){return e=e[0],e._private.hasPie};_l.hasStripe=function(e){return e=e[0],e._private.hasStripe};_l.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var a=t.cy().style(),i=t.pstyle("pie-size"),l=t.pstyle("pie-hole"),o=t.pstyle("pie-start-angle").pfValue,f=r.x,c=r.y,h=t.width(),p=t.height(),m=Math.min(h,p)/2,y,x=0,b=this.usePaths();if(b&&(f=0,c=0),i.units==="%"?m=m*i.pfValue:i.pfValue!==void 0&&(m=i.pfValue/2),l.units==="%"?y=m*l.pfValue:l.pfValue!==void 0&&(y=l.pfValue/2),!(y>=m))for(var w=1;w<=a.pieBackgroundN;w++){var S=t.pstyle("pie-"+w+"-background-size").value,N=t.pstyle("pie-"+w+"-background-color").value,E=t.pstyle("pie-"+w+"-background-opacity").value*n,T=S/100;T+x>1&&(T=1-x);var R=1.5*Math.PI+2*Math.PI*x;R+=o;var A=2*Math.PI*T,D=R+A;S===0||x>=1||x+T>1||(y===0?(e.beginPath(),e.moveTo(f,c),e.arc(f,c,m,R,D),e.closePath()):(e.beginPath(),e.arc(f,c,m,R,D),e.arc(f,c,y,D,R,!0),e.closePath()),this.colorFillStyle(e,N[0],N[1],N[2],E),e.fill(),x+=T)}};_l.drawStripe=function(e,t,n,r){t=t[0],r=r||t.position();var a=t.cy().style(),i=r.x,l=r.y,o=t.width(),f=t.height(),c=0,h=this.usePaths();e.save();var p=t.pstyle("stripe-direction").value,m=t.pstyle("stripe-size");switch(p){case"vertical":break;case"righward":e.rotate(-Math.PI/2);break}var y=o,x=f;m.units==="%"?(y=y*m.pfValue,x=x*m.pfValue):m.pfValue!==void 0&&(y=m.pfValue,x=m.pfValue),h&&(i=0,l=0),l-=y/2,i-=x/2;for(var b=1;b<=a.stripeBackgroundN;b++){var w=t.pstyle("stripe-"+b+"-background-size").value,S=t.pstyle("stripe-"+b+"-background-color").value,N=t.pstyle("stripe-"+b+"-background-opacity").value*n,E=w/100;E+c>1&&(E=1-c),!(w===0||c>=1||c+E>1)&&(e.beginPath(),e.rect(i,l+x*c,y,x*E),e.closePath(),this.colorFillStyle(e,S[0],S[1],S[2],N),e.fill(),c+=E)}e.restore()};var _r={},Lee=100;_r.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n};_r.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,r,a=0;a<t.length;a++)if(r=t[a],r.context===e){n=!1;break}return n&&(r={context:e},t.push(r)),r};_r.createGradientStyleFor=function(e,t,n,r,a){var i,l=this.usePaths(),o=n.pstyle(t+"-gradient-stop-colors").value,f=n.pstyle(t+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var c=n.sourceEndpoint(),h=n.targetEndpoint(),p=n.midpoint(),m=Ao(c,p),y=Ao(h,p);i=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(m,y))}else{var x=l?{x:0,y:0}:n.position(),b=n.paddedWidth(),w=n.paddedHeight();i=e.createRadialGradient(x.x,x.y,0,x.x,x.y,Math.max(b,w))}else if(n.isEdge()){var S=n.sourceEndpoint(),N=n.targetEndpoint();i=e.createLinearGradient(S.x,S.y,N.x,N.y)}else{var E=l?{x:0,y:0}:n.position(),T=n.paddedWidth(),R=n.paddedHeight(),A=T/2,D=R/2,_=n.pstyle("background-gradient-direction").value;switch(_){case"to-bottom":i=e.createLinearGradient(E.x,E.y-D,E.x,E.y+D);break;case"to-top":i=e.createLinearGradient(E.x,E.y+D,E.x,E.y-D);break;case"to-left":i=e.createLinearGradient(E.x+A,E.y,E.x-A,E.y);break;case"to-right":i=e.createLinearGradient(E.x-A,E.y,E.x+A,E.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(E.x-A,E.y-D,E.x+A,E.y+D);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(E.x-A,E.y+D,E.x+A,E.y-D);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(E.x+A,E.y-D,E.x-A,E.y+D);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(E.x+A,E.y+D,E.x-A,E.y-D);break}}if(!i)return null;for(var L=f.length===o.length,M=o.length,z=0;z<M;z++)i.addColorStop(L?f[z]:z/(M-1),"rgba("+o[z][0]+","+o[z][1]+","+o[z][2]+","+a+")");return i};_r.gradientFillStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"background",t,n,r);if(!a)return null;e.fillStyle=a};_r.colorFillStyle=function(e,t,n,r,a){e.fillStyle="rgba("+t+","+n+","+r+","+a+")"};_r.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(e,t,r,n);else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],n)}};_r.gradientStrokeStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"line",t,n,r);if(!a)return null;e.strokeStyle=a};_r.colorStrokeStyle=function(e,t,n,r,a){e.strokeStyle="rgba("+t+","+n+","+r+","+a+")"};_r.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(e,t,r,n);else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],n)}};_r.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),a=r[2],i=r[3],l=t.getPixelRatio(),o=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(l=o);var f=a*l,c=i*l,h;if(!(f===t.canvasWidth&&c===t.canvasHeight)){t.fontCaches=null;var p=n.canvasContainer;p.style.width=a+"px",p.style.height=i+"px";for(var m=0;m<t.CANVAS_LAYERS;m++)h=n.canvases[m],h.width=f,h.height=c,h.style.width=a+"px",h.style.height=i+"px";for(var m=0;m<t.BUFFER_COUNT;m++)h=n.bufferCanvases[m],h.width=f,h.height=c,h.style.width=a+"px",h.style.height=i+"px";t.textureMult=1,l<=1&&(h=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,h.width=f*t.textureMult,h.height=c*t.textureMult),t.canvasWidth=f,t.canvasHeight=c,t.pixelRatio=l}};_r.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})};_r.clearCanvas=function(){var e=this,t=e.data;function n(r){r.clearRect(0,0,e.canvasWidth,e.canvasHeight)}n(t.contexts[e.NODE]),n(t.contexts[e.DRAG])};_r.render=function(e){var t=this;e=e||UO();var n=t.cy,r=e.forcedContext,a=e.drawAllLayers,i=e.drawOnlyNodeLayer,l=e.forcedZoom,o=e.forcedPan,f=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,c=t.data,h=c.canvasNeedsRedraw,p=t.textureOnViewport&&!r&&(t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming),m=e.motionBlur!==void 0?e.motionBlur:t.motionBlur,y=t.motionBlurPxRatio,x=n.hasCompoundNodes(),b=t.hoverData.draggingEles,w=!!(t.hoverData.selecting||t.touchData.selecting);m=m&&!r&&t.motionBlurEnabled&&!w;var S=m;r||(t.prevPxRatio!==f&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container),t.redrawHint("eles",!0),t.redrawHint("drag",!0)),t.prevPxRatio=f),!r&&t.motionBlurTimeout&&clearTimeout(t.motionBlurTimeout),m&&(t.mbFrames==null&&(t.mbFrames=0),t.mbFrames++,t.mbFrames<3&&(S=!1),t.mbFrames>t.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!p&&(h[t.NODE]=!0,h[t.SELECT_BOX]=!0);var N=n.style(),E=n.zoom(),T=l!==void 0?l:E,R=n.pan(),A={x:R.x,y:R.y},D={zoom:E,pan:{x:R.x,y:R.y}},_=t.prevViewport,L=_===void 0||D.zoom!==_.zoom||D.pan.x!==_.pan.x||D.pan.y!==_.pan.y;!L&&!(b&&!x)&&(t.motionBlurPxRatio=1),o&&(A=o),T*=f,A.x*=f,A.y*=f;var M=t.getCachedZSortedEles();function z(ne,W,J,se,ge){var Te=ne.globalCompositeOperation;ne.globalCompositeOperation="destination-out",t.colorFillStyle(ne,255,255,255,t.motionBlurTransparency),ne.fillRect(W,J,se,ge),ne.globalCompositeOperation=Te}function B(ne,W){var J,se,ge,Te;!t.clearingMotionBlur&&(ne===c.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||ne===c.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])?(J={x:R.x*y,y:R.y*y},se=E*y,ge=t.canvasWidth*y,Te=t.canvasHeight*y):(J=A,se=T,ge=t.canvasWidth,Te=t.canvasHeight),ne.setTransform(1,0,0,1,0,0),W==="motionBlur"?z(ne,0,0,ge,Te):!r&&(W===void 0||W)&&ne.clearRect(0,0,ge,Te),a||(ne.translate(J.x,J.y),ne.scale(se,se)),o&&ne.translate(o.x,o.y),l&&ne.scale(l,l)}if(p||(t.textureDrawLastFrame=!1),p){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var H=t.data.bufferContexts[t.TEXTURE_BUFFER];H.setTransform(1,0,0,1,0,0),H.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:H,drawOnlyNodeLayer:!0,forcedPxRatio:f*t.textureMult});var D=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight};D.mpan={x:(0-D.pan.x)/D.zoom,y:(0-D.pan.y)/D.zoom}}h[t.DRAG]=!1,h[t.NODE]=!1;var G=c.contexts[t.NODE],U=t.textureCache.texture,D=t.textureCache.viewport;G.setTransform(1,0,0,1,0,0),m?z(G,0,0,D.width,D.height):G.clearRect(0,0,D.width,D.height);var I=N.core("outside-texture-bg-color").value,V=N.core("outside-texture-bg-opacity").value;t.colorFillStyle(G,I[0],I[1],I[2],V),G.fillRect(0,0,D.width,D.height);var E=n.zoom();B(G,!1),G.clearRect(D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f),G.drawImage(U,D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f)}else t.textureOnViewport&&!r&&(t.textureCache=null);var K=n.extent(),Q=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),F=t.hideEdgesOnViewport&&Q,q=[];if(q[t.NODE]=!h[t.NODE]&&m&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,q[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),q[t.DRAG]=!h[t.DRAG]&&m&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,q[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),h[t.NODE]||a||i||q[t.NODE]){var X=m&&!q[t.NODE]&&y!==1,G=r||(X?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:c.contexts[t.NODE]),P=m&&!X?"motionBlur":void 0;B(G,P),F?t.drawCachedNodes(G,M.nondrag,f,K):t.drawLayeredElements(G,M.nondrag,f,K),t.debug&&t.drawDebugPoints(G,M.nondrag),!a&&!m&&(h[t.NODE]=!1)}if(!i&&(h[t.DRAG]||a||q[t.DRAG])){var X=m&&!q[t.DRAG]&&y!==1,G=r||(X?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:c.contexts[t.DRAG]);B(G,m&&!X?"motionBlur":void 0),F?t.drawCachedNodes(G,M.drag,f,K):t.drawCachedElements(G,M.drag,f,K),t.debug&&t.drawDebugPoints(G,M.drag),!a&&!m&&(h[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,B),m&&y!==1){var Z=c.contexts[t.NODE],ae=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],ie=c.contexts[t.DRAG],le=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],ye=function(W,J,se){W.setTransform(1,0,0,1,0,0),se||!S?W.clearRect(0,0,t.canvasWidth,t.canvasHeight):z(W,0,0,t.canvasWidth,t.canvasHeight);var ge=y;W.drawImage(J,0,0,t.canvasWidth*ge,t.canvasHeight*ge,0,0,t.canvasWidth,t.canvasHeight)};(h[t.NODE]||q[t.NODE])&&(ye(Z,ae,q[t.NODE]),h[t.NODE]=!1),(h[t.DRAG]||q[t.DRAG])&&(ye(ie,le,q[t.DRAG]),h[t.DRAG]=!1)}t.prevViewport=D,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),m&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!p,t.mbFrames=0,h[t.NODE]=!0,h[t.DRAG]=!0,t.redraw()},Lee)),r||n.emit("render")};var zf;_r.drawSelectionRectangle=function(e,t){var n=this,r=n.cy,a=n.data,i=r.style(),l=e.drawOnlyNodeLayer,o=e.drawAllLayers,f=a.canvasNeedsRedraw,c=e.forcedContext;if(n.showFps||!l&&f[n.SELECT_BOX]&&!o){var h=c||a.contexts[n.SELECT_BOX];if(t(h),n.selection[4]==1&&(n.hoverData.selecting||n.touchData.selecting)){var p=n.cy.zoom(),m=i.core("selection-box-border-width").value/p;h.lineWidth=m,h.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",h.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),m>0&&(h.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",h.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(a.bgActivePosistion&&!n.hoverData.selecting){var p=n.cy.zoom(),y=a.bgActivePosistion;h.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",h.beginPath(),h.arc(y.x,y.y,i.core("active-bg-size").pfValue/p,0,2*Math.PI),h.fill()}var x=n.lastRedrawTime;if(n.showFps&&x){x=Math.round(x);var b=Math.round(1e3/x),w="1 frame = "+x+" ms = "+b+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!zf){var S=h.measureText(w);zf=S.actualBoundingBoxAscent}h.fillText(w,0,zf);var N=60;h.strokeRect(0,zf+10,250,20),h.fillRect(0,zf+10,250*Math.min(b/N,1),20)}o||(f[n.SELECT_BOX]=!1)}};function EA(e,t,n){var r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(r));return r}function Pee(e,t,n){var r=EA(e,e.VERTEX_SHADER,t),a=EA(e,e.FRAGMENT_SHADER,n),i=e.createProgram();if(e.attachShader(i,r),e.attachShader(i,a),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function Bee(e,t,n){n===void 0&&(n=t);var r=e.makeOffscreenCanvas(t,n),a=r.context=r.getContext("2d");return r.clear=function(){return a.clearRect(0,0,r.width,r.height)},r.clear(),r}function sS(e){var t=e.pixelRatio,n=e.cy.zoom(),r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function zee(e){var t=e.pixelRatio,n=e.cy.zoom();return n*t}function Iee(e,t,n,r,a){var i=r*n+t.x,l=a*n+t.y;return l=Math.round(e.canvasHeight-l),[i,l]}function Fee(e){return e.pstyle("background-fill").value!=="solid"||e.pstyle("background-image").strValue!=="none"?!1:e.pstyle("border-width").value===0||e.pstyle("border-opacity").value===0?!0:e.pstyle("border-style").value==="solid"}function Uee(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function to(e,t,n){var r=e[0]/255,a=e[1]/255,i=e[2]/255,l=t,o=n||new Array(4);return o[0]=r*l,o[1]=a*l,o[2]=i*l,o[3]=l,o}function Au(e,t){var n=t||new Array(4);return n[0]=(e>>0&255)/255,n[1]=(e>>8&255)/255,n[2]=(e>>16&255)/255,n[3]=(e>>24&255)/255,n}function qee(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function Vee(e,t){var n=e.createTexture();return n.buffer=function(r){e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null)},n.deleteTexture=function(){e.deleteTexture(n)},n}function e3(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function t3(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function Hee(e,t,n,r,a,i){switch(t){case e.FLOAT:return new Float32Array(n.buffer,i*r,a);case e.INT:return new Int32Array(n.buffer,i*r,a)}}function Gee(e,t,n,r){var a=e3(e,t),i=Bn(a,2),l=i[0],o=i[1],f=t3(e,o,r),c=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,c),e.bufferData(e.ARRAY_BUFFER,f,e.STATIC_DRAW),o===e.FLOAT?e.vertexAttribPointer(n,l,o,!1,0,0):o===e.INT&&e.vertexAttribIPointer(n,l,o,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,null),c}function ii(e,t,n,r){var a=e3(e,n),i=Bn(a,3),l=i[0],o=i[1],f=i[2],c=t3(e,o,t*l),h=l*f,p=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,p),e.bufferData(e.ARRAY_BUFFER,t*h,e.DYNAMIC_DRAW),e.enableVertexAttribArray(r),o===e.FLOAT?e.vertexAttribPointer(r,l,o,!1,h,0):o===e.INT&&e.vertexAttribIPointer(r,l,o,h,0),e.vertexAttribDivisor(r,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var m=new Array(t),y=0;y<t;y++)m[y]=Hee(e,o,c,h,l,y);return p.dataArray=c,p.stride=h,p.size=l,p.getView=function(x){return m[x]},p.setPoint=function(x,b,w){var S=m[x];S[0]=b,S[1]=w},p.bufferSubData=function(x){e.bindBuffer(e.ARRAY_BUFFER,p),x?e.bufferSubData(e.ARRAY_BUFFER,0,c,0,x*l):e.bufferSubData(e.ARRAY_BUFFER,0,c)},p}function $ee(e,t,n){for(var r=9,a=new Float32Array(t*r),i=new Array(t),l=0;l<t;l++){var o=l*r*4;i[l]=new Float32Array(a.buffer,o,r)}var f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,a.byteLength,e.DYNAMIC_DRAW);for(var c=0;c<3;c++){var h=n+c;e.enableVertexAttribArray(h),e.vertexAttribPointer(h,3,e.FLOAT,!1,36,c*12),e.vertexAttribDivisor(h,1)}return e.bindBuffer(e.ARRAY_BUFFER,null),f.getMatrixView=function(p){return i[p]},f.setData=function(p,m){i[m].set(p,0)},f.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferSubData(e.ARRAY_BUFFER,0,a)},f}function Kee(e){var t=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,t);var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.bindFramebuffer(e.FRAMEBUFFER,null),t.setFramebufferAttachmentSizes=function(r,a){e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r,a,0,e.RGBA,e.UNSIGNED_BYTE,null)},t}var CA=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function eb(){var e=new CA(9);return CA!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function NA(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Yee(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],h=t[7],p=t[8],m=n[0],y=n[1],x=n[2],b=n[3],w=n[4],S=n[5],N=n[6],E=n[7],T=n[8];return e[0]=m*r+y*l+x*c,e[1]=m*a+y*o+x*h,e[2]=m*i+y*f+x*p,e[3]=b*r+w*l+S*c,e[4]=b*a+w*o+S*h,e[5]=b*i+w*f+S*p,e[6]=N*r+E*l+T*c,e[7]=N*a+E*o+T*h,e[8]=N*i+E*f+T*p,e}function cp(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],h=t[7],p=t[8],m=n[0],y=n[1];return e[0]=r,e[1]=a,e[2]=i,e[3]=l,e[4]=o,e[5]=f,e[6]=m*r+y*l+c,e[7]=m*a+y*o+h,e[8]=m*i+y*f+p,e}function kA(e,t,n){var r=t[0],a=t[1],i=t[2],l=t[3],o=t[4],f=t[5],c=t[6],h=t[7],p=t[8],m=Math.sin(n),y=Math.cos(n);return e[0]=y*r+m*l,e[1]=y*a+m*o,e[2]=y*i+m*f,e[3]=y*l-m*r,e[4]=y*o-m*a,e[5]=y*f-m*i,e[6]=c,e[7]=h,e[8]=p,e}function y1(e,t,n){var r=n[0],a=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=a*t[3],e[4]=a*t[4],e[5]=a*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Xee(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}var Qee=(function(){function e(t,n,r,a){Rl(this,e),this.debugID=Math.floor(Math.random()*1e4),this.r=t,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(t,n,n),this.scratch=a(t,n,this.texHeight,"scratch")}return Dl(e,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(n){var r=n.w,a=n.h,i=this.texHeight,l=this.texSize,o=i/a,f=r*o,c=a*o;return f>l&&(o=l/r,f=r*o,c=a*o),{scale:o,texW:f,texH:c}}},{key:"draw",value:function(n,r,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var l=this.texSize,o=this.texRows,f=this.texHeight,c=this.getScale(r),h=c.scale,p=c.texW,m=c.texH,y=function(E,T){if(a&&T){var R=T.context,A=E.x,D=E.row,_=A,L=f*D;R.save(),R.translate(_,L),R.scale(h,h),a(R,r),R.restore()}},x=[null,null],b=function(){y(i.freePointer,i.canvas),x[0]={x:i.freePointer.x,y:i.freePointer.row*f,w:p,h:m},x[1]={x:i.freePointer.x+p,y:i.freePointer.row*f,w:0,h:m},i.freePointer.x+=p,i.freePointer.x==l&&(i.freePointer.x=0,i.freePointer.row++)},w=function(){var E=i.scratch,T=i.canvas;E.clear(),y({x:0,row:0},E);var R=l-i.freePointer.x,A=p-R,D=f;{var _=i.freePointer.x,L=i.freePointer.row*f,M=R;T.context.drawImage(E,0,0,M,D,_,L,M,D),x[0]={x:_,y:L,w:M,h:m}}{var z=R,B=(i.freePointer.row+1)*f,H=A;T&&T.context.drawImage(E,z,0,H,D,0,B,H,D),x[1]={x:0,y:B,w:H,h:m}}i.freePointer.x=A,i.freePointer.row++},S=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+p<=l)b();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===l?(S(),b()):this.enableWrapping?w():(S(),b())}return this.keyToLocation.set(n,x),this.needsBuffer=!0,x}},{key:"getOffsets",value:function(n){return this.keyToLocation.get(n)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(n){if(this.locked)return!1;var r=this.texSize,a=this.texRows,i=this.getScale(n),l=i.texW;return this.freePointer.x+l>r?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(n){this.texture||(this.texture=Vee(n,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),Wee=(function(){function e(t,n,r,a){Rl(this,e),this.r=t,this.texSize=n,this.texRows=r,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Dl(e,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var n=this.r,r=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new Qee(n,r,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var n=this.r,r=this.texSize,a=this.texRows,i=this.createTextureCanvas,l=Math.floor(r/a);this.scratch=i(n,r,l,"scratch")}return this.scratch}},{key:"draw",value:function(n,r,a){var i=this.styleKeyToAtlas.get(n);return i||(i=this.atlases[this.atlases.length-1],(!i||!i.canFit(r))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(n,r,a),this.styleKeyToAtlas.set(n,i)),i}},{key:"getAtlas",value:function(n){return this.styleKeyToAtlas.get(n)}},{key:"hasAtlas",value:function(n){return this.styleKeyToAtlas.has(n)}},{key:"markKeyForGC",value:function(n){this.markedKeys.add(n)}},{key:"gc",value:function(){var n=this,r=this.markedKeys;if(r.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,l=null,o=Xr(this.atlases),f;try{var c=function(){var p=f.value,m=p.getKeys(),y=Zee(r,m);if(y.size===0)return a.push(p),m.forEach(function(R){return i.set(R,p)}),1;l||(l=n._createAtlas(),a.push(l));var x=Xr(m),b;try{for(x.s();!(b=x.n()).done;){var w=b.value;if(!y.has(w)){var S=p.getOffsets(w),N=Bn(S,2),E=N[0],T=N[1];l.canFit({w:E.w+T.w,h:E.h})||(l.lock(),l=n._createAtlas(),a.push(l)),p.canvas&&(n._copyTextureToNewAtlas(w,p,l),i.set(w,l))}}}catch(R){x.e(R)}finally{x.f()}p.dispose()};for(o.s();!(f=o.n()).done;)c()}catch(h){o.e(h)}finally{o.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(n,r,a){var i=r.getOffsets(n),l=Bn(i,2),o=l[0],f=l[1];if(f.w===0)a.draw(n,o,function(m){m.drawImage(r.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var c=this._getScratchCanvas();c.clear(),c.context.drawImage(r.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),c.context.drawImage(r.canvas,f.x,f.y,f.w,f.h,o.w,0,f.w,f.h);var h=o.w+f.w,p=o.h;a.draw(n,{w:h,h:p},function(m){m.drawImage(c,0,0,h,p,0,0,h,p)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function Zee(e,t){return e.intersection?e.intersection(t):new Set(jp(e).filter(function(n){return t.has(n)}))}var Jee=(function(){function e(t,n){Rl(this,e),this.r=t,this.globalOptions=n,this.atlasSize=n.webglTexSize,this.maxAtlasesPerBatch=n.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Dl(e,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(n,r){var a=this.globalOptions,i=a.webglTexSize,l=a.createTextureCanvas,o=r.texRows,f=this._cacheScratchCanvas(l),c=new Wee(this.r,i,o,f);this.collections.set(n,c)}},{key:"addRenderType",value:function(n,r){var a=r.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),l=at({type:n,atlasCollection:i},r);this.renderTypes.set(n,l)}},{key:"getRenderTypeOpts",value:function(n){return this.renderTypes.get(n)}},{key:"getAtlasCollection",value:function(n){return this.collections.get(n)}},{key:"_cacheScratchCanvas",value:function(n){var r=-1,a=-1,i=null;return function(l,o,f,c){return c?((!i||o!=r||f!=a)&&(r=o,a=f,i=n(l,o,f)),i):n(l,o,f)}}},{key:"_key",value:function(n,r){return"".concat(n,"-").concat(r)}},{key:"invalidate",value:function(n){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,l=i===void 0?!1:i,o=a.filterEle,f=o===void 0?function(){return!0}:o,c=a.filterType,h=c===void 0?function(){return!0}:c,p=!1,m=!1,y=Xr(n),x;try{for(y.s();!(x=y.n()).done;){var b=x.value;if(f(b)){var w=Xr(this.renderTypes.values()),S;try{var N=function(){var T=S.value,R=T.type;if(h(R)){var A=r.collections.get(T.collection),D=T.getKey(b),_=Array.isArray(D)?D:[D];if(l)_.forEach(function(B){return A.markKeyForGC(B)}),m=!0;else{var L=T.getID?T.getID(b):b.id(),M=r._key(R,L),z=r.typeAndIdToKey.get(M);z!==void 0&&!Uee(_,z)&&(p=!0,r.typeAndIdToKey.delete(M),z.forEach(function(B){return A.markKeyForGC(B)}))}}};for(w.s();!(S=w.n()).done;)N()}catch(E){w.e(E)}finally{w.f()}}}}catch(E){y.e(E)}finally{y.f()}return m&&(this.gc(),p=!1),p}},{key:"gc",value:function(){var n=Xr(this.collections.values()),r;try{for(n.s();!(r=n.n()).done;){var a=r.value;a.gc()}}catch(i){n.e(i)}finally{n.f()}}},{key:"getOrCreateAtlas",value:function(n,r,a,i){var l=this.renderTypes.get(r),o=this.collections.get(l.collection),f=!1,c=o.draw(i,a,function(m){l.drawClipped?(m.save(),m.beginPath(),m.rect(0,0,a.w,a.h),m.clip(),l.drawElement(m,n,a,!0,!0),m.restore()):l.drawElement(m,n,a,!0,!0),f=!0});if(f){var h=l.getID?l.getID(n):n.id(),p=this._key(r,h);this.typeAndIdToKey.has(p)?this.typeAndIdToKey.get(p).push(i):this.typeAndIdToKey.set(p,[i])}return c}},{key:"getAtlasInfo",value:function(n,r){var a=this,i=this.renderTypes.get(r),l=i.getKey(n),o=Array.isArray(l)?l:[l];return o.map(function(f){var c=i.getBoundingBox(n,f),h=a.getOrCreateAtlas(n,r,c,f),p=h.getOffsets(f),m=Bn(p,2),y=m[0],x=m[1];return{atlas:h,tex:y,tex1:y,tex2:x,bb:c}})}},{key:"getDebugInfo",value:function(){var n=[],r=Xr(this.collections),a;try{for(r.s();!(a=r.n()).done;){var i=Bn(a.value,2),l=i[0],o=i[1],f=o.getCounts(),c=f.keyCount,h=f.atlasCount;n.push({type:l,keyCount:c,atlasCount:h})}}catch(p){r.e(p)}finally{r.f()}return n}}])})(),ete=(function(){function e(t){Rl(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]}return Dl(e,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(n,r){return r})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(n){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(n):!0}},{key:"getAtlasIndexForBatch",value:function(n){var r=this.batchAtlases.indexOf(n);if(r<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(n),r=this.batchAtlases.length-1}return r}}])})(),tte=`
|
|
519
|
+
float circleSD(vec2 p, float r) {
|
|
520
|
+
return distance(vec2(0), p) - r; // signed distance
|
|
521
|
+
}
|
|
522
|
+
`,nte=`
|
|
523
|
+
float rectangleSD(vec2 p, vec2 b) {
|
|
524
|
+
vec2 d = abs(p)-b;
|
|
525
|
+
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
526
|
+
}
|
|
527
|
+
`,rte=`
|
|
528
|
+
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
529
|
+
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
530
|
+
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
531
|
+
vec2 q = abs(p) - b + cr.x;
|
|
532
|
+
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
533
|
+
}
|
|
534
|
+
`,ate=`
|
|
535
|
+
float ellipseSD(vec2 p, vec2 ab) {
|
|
536
|
+
p = abs( p ); // symmetry
|
|
537
|
+
|
|
538
|
+
// find root with Newton solver
|
|
539
|
+
vec2 q = ab*(p-ab);
|
|
540
|
+
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
541
|
+
for( int i=0; i<5; i++ ) {
|
|
542
|
+
vec2 cs = vec2(cos(w),sin(w));
|
|
543
|
+
vec2 u = ab*vec2( cs.x,cs.y);
|
|
544
|
+
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
545
|
+
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// compute final point and distance
|
|
549
|
+
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
550
|
+
|
|
551
|
+
// return signed distance
|
|
552
|
+
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
553
|
+
}
|
|
554
|
+
`,nd={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Fp={IGNORE:1,USE_BB:2},tb=0,TA=1,jA=2,nb=3,Ru=4,Iv=5,If=6,Ff=7,ite=(function(){function e(t,n,r){Rl(this,e),this.r=t,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=Bee,this.atlasManager=new Jee(t,r),this.batchManager=new ete(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(nd.SCREEN),this.pickingProgram=this._createShaderProgram(nd.PICKING),this.vao=this._createVAO()}return Dl(e,[{key:"addAtlasCollection",value:function(n,r){this.atlasManager.addAtlasCollection(n,r)}},{key:"addTextureAtlasRenderType",value:function(n,r){this.atlasManager.addRenderType(n,r)}},{key:"addSimpleShapeRenderType",value:function(n,r){this.simpleShapeOptions.set(n,r)}},{key:"invalidate",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.type,i=this.atlasManager;return a?i.invalidate(n,{filterType:function(o){return o===a},forceRedraw:!0}):i.invalidate(n)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(n){var r=this.gl,a=`#version 300 es
|
|
555
|
+
precision highp float;
|
|
556
|
+
|
|
557
|
+
uniform mat3 uPanZoomMatrix;
|
|
558
|
+
uniform int uAtlasSize;
|
|
559
|
+
|
|
560
|
+
// instanced
|
|
561
|
+
in vec2 aPosition; // a vertex from the unit square
|
|
562
|
+
|
|
563
|
+
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
564
|
+
in int aVertType; // the type of thing we are rendering
|
|
565
|
+
|
|
566
|
+
// the z-index that is output when using picking mode
|
|
567
|
+
in vec4 aIndex;
|
|
568
|
+
|
|
569
|
+
// For textures
|
|
570
|
+
in int aAtlasId; // which shader unit/atlas to use
|
|
571
|
+
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
572
|
+
|
|
573
|
+
// for edges
|
|
574
|
+
in vec4 aPointAPointB;
|
|
575
|
+
in vec4 aPointCPointD;
|
|
576
|
+
in vec2 aLineWidth; // also used for node border width
|
|
577
|
+
|
|
578
|
+
// simple shapes
|
|
579
|
+
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
580
|
+
in vec4 aColor; // also used for edges
|
|
581
|
+
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
582
|
+
|
|
583
|
+
// output values passed to the fragment shader
|
|
584
|
+
out vec2 vTexCoord;
|
|
585
|
+
out vec4 vColor;
|
|
586
|
+
out vec2 vPosition;
|
|
587
|
+
// flat values are not interpolated
|
|
588
|
+
flat out int vAtlasId;
|
|
589
|
+
flat out int vVertType;
|
|
590
|
+
flat out vec2 vTopRight;
|
|
591
|
+
flat out vec2 vBotLeft;
|
|
592
|
+
flat out vec4 vCornerRadius;
|
|
593
|
+
flat out vec4 vBorderColor;
|
|
594
|
+
flat out vec2 vBorderWidth;
|
|
595
|
+
flat out vec4 vIndex;
|
|
596
|
+
|
|
597
|
+
void main(void) {
|
|
598
|
+
int vid = gl_VertexID;
|
|
599
|
+
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
600
|
+
|
|
601
|
+
if(aVertType == `.concat(tb,`) {
|
|
602
|
+
float texX = aTex.x; // texture coordinates
|
|
603
|
+
float texY = aTex.y;
|
|
604
|
+
float texW = aTex.z;
|
|
605
|
+
float texH = aTex.w;
|
|
606
|
+
|
|
607
|
+
if(vid == 1 || vid == 2 || vid == 4) {
|
|
608
|
+
texX += texW;
|
|
609
|
+
}
|
|
610
|
+
if(vid == 2 || vid == 4 || vid == 5) {
|
|
611
|
+
texY += texH;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
float d = float(uAtlasSize);
|
|
615
|
+
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
616
|
+
|
|
617
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
618
|
+
}
|
|
619
|
+
else if(aVertType == `).concat(Ru," || aVertType == ").concat(Ff,`
|
|
620
|
+
|| aVertType == `).concat(Iv," || aVertType == ").concat(If,`) { // simple shapes
|
|
621
|
+
|
|
622
|
+
// the bounding box is needed by the fragment shader
|
|
623
|
+
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
624
|
+
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
625
|
+
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
626
|
+
|
|
627
|
+
// calculations are done in the fragment shader, just pass these along
|
|
628
|
+
vColor = aColor;
|
|
629
|
+
vCornerRadius = aCornerRadius;
|
|
630
|
+
vBorderColor = aBorderColor;
|
|
631
|
+
vBorderWidth = aLineWidth;
|
|
632
|
+
|
|
633
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
634
|
+
}
|
|
635
|
+
else if(aVertType == `).concat(TA,`) {
|
|
636
|
+
vec2 source = aPointAPointB.xy;
|
|
637
|
+
vec2 target = aPointAPointB.zw;
|
|
638
|
+
|
|
639
|
+
// adjust the geometry so that the line is centered on the edge
|
|
640
|
+
position.y = position.y - 0.5;
|
|
641
|
+
|
|
642
|
+
// stretch the unit square into a long skinny rectangle
|
|
643
|
+
vec2 xBasis = target - source;
|
|
644
|
+
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
645
|
+
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
646
|
+
|
|
647
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
648
|
+
vColor = aColor;
|
|
649
|
+
}
|
|
650
|
+
else if(aVertType == `).concat(jA,`) {
|
|
651
|
+
vec2 pointA = aPointAPointB.xy;
|
|
652
|
+
vec2 pointB = aPointAPointB.zw;
|
|
653
|
+
vec2 pointC = aPointCPointD.xy;
|
|
654
|
+
vec2 pointD = aPointCPointD.zw;
|
|
655
|
+
|
|
656
|
+
// adjust the geometry so that the line is centered on the edge
|
|
657
|
+
position.y = position.y - 0.5;
|
|
658
|
+
|
|
659
|
+
vec2 p0, p1, p2, pos;
|
|
660
|
+
if(position.x == 0.0) { // The left side of the unit square
|
|
661
|
+
p0 = pointA;
|
|
662
|
+
p1 = pointB;
|
|
663
|
+
p2 = pointC;
|
|
664
|
+
pos = position;
|
|
665
|
+
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
666
|
+
p0 = pointD;
|
|
667
|
+
p1 = pointC;
|
|
668
|
+
p2 = pointB;
|
|
669
|
+
pos = vec2(0.0, -position.y);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
vec2 p01 = p1 - p0;
|
|
673
|
+
vec2 p12 = p2 - p1;
|
|
674
|
+
vec2 p21 = p1 - p2;
|
|
675
|
+
|
|
676
|
+
// Find the normal vector.
|
|
677
|
+
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
678
|
+
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
679
|
+
|
|
680
|
+
// Find the vector perpendicular to p0 -> p1.
|
|
681
|
+
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
682
|
+
|
|
683
|
+
// Determine the bend direction.
|
|
684
|
+
float sigma = sign(dot(p01 + p21, normal));
|
|
685
|
+
float width = aLineWidth[0];
|
|
686
|
+
|
|
687
|
+
if(sign(pos.y) == -sigma) {
|
|
688
|
+
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
689
|
+
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
690
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
691
|
+
} else {
|
|
692
|
+
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
693
|
+
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
694
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
vColor = aColor;
|
|
698
|
+
}
|
|
699
|
+
else if(aVertType == `).concat(nb,` && vid < 3) {
|
|
700
|
+
// massage the first triangle into an edge arrow
|
|
701
|
+
if(vid == 0)
|
|
702
|
+
position = vec2(-0.15, -0.3);
|
|
703
|
+
if(vid == 1)
|
|
704
|
+
position = vec2( 0.0, 0.0);
|
|
705
|
+
if(vid == 2)
|
|
706
|
+
position = vec2( 0.15, -0.3);
|
|
707
|
+
|
|
708
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
709
|
+
vColor = aColor;
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
vAtlasId = aAtlasId;
|
|
716
|
+
vVertType = aVertType;
|
|
717
|
+
vIndex = aIndex;
|
|
718
|
+
}
|
|
719
|
+
`),i=this.batchManager.getIndexArray(),l=`#version 300 es
|
|
720
|
+
precision highp float;
|
|
721
|
+
|
|
722
|
+
// declare texture unit for each texture atlas in the batch
|
|
723
|
+
`.concat(i.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(`
|
|
724
|
+
`),`
|
|
725
|
+
|
|
726
|
+
uniform vec4 uBGColor;
|
|
727
|
+
uniform float uZoom;
|
|
728
|
+
|
|
729
|
+
in vec2 vTexCoord;
|
|
730
|
+
in vec4 vColor;
|
|
731
|
+
in vec2 vPosition; // model coordinates
|
|
732
|
+
|
|
733
|
+
flat in int vAtlasId;
|
|
734
|
+
flat in vec4 vIndex;
|
|
735
|
+
flat in int vVertType;
|
|
736
|
+
flat in vec2 vTopRight;
|
|
737
|
+
flat in vec2 vBotLeft;
|
|
738
|
+
flat in vec4 vCornerRadius;
|
|
739
|
+
flat in vec4 vBorderColor;
|
|
740
|
+
flat in vec2 vBorderWidth;
|
|
741
|
+
|
|
742
|
+
out vec4 outColor;
|
|
743
|
+
|
|
744
|
+
`).concat(tte,`
|
|
745
|
+
`).concat(nte,`
|
|
746
|
+
`).concat(rte,`
|
|
747
|
+
`).concat(ate,`
|
|
748
|
+
|
|
749
|
+
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
750
|
+
return vec4(
|
|
751
|
+
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
752
|
+
top.a + (bot.a * (1.0 - top.a))
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
757
|
+
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
758
|
+
// note 1.5 is an aribitrary value chosen because it looks good
|
|
759
|
+
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
void main(void) {
|
|
763
|
+
if(vVertType == `).concat(tb,`) {
|
|
764
|
+
// look up the texel from the texture unit
|
|
765
|
+
`).concat(i.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(`
|
|
766
|
+
else `),`
|
|
767
|
+
}
|
|
768
|
+
else if(vVertType == `).concat(nb,`) {
|
|
769
|
+
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
770
|
+
outColor = blend(vColor, uBGColor);
|
|
771
|
+
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
772
|
+
}
|
|
773
|
+
else if(vVertType == `).concat(Ru,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
774
|
+
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
775
|
+
}
|
|
776
|
+
else if(vVertType == `).concat(Ru," || vVertType == ").concat(Ff,`
|
|
777
|
+
|| vVertType == `).concat(Iv," || vVertType == ").concat(If,`) { // use SDF
|
|
778
|
+
|
|
779
|
+
float outerBorder = vBorderWidth[0];
|
|
780
|
+
float innerBorder = vBorderWidth[1];
|
|
781
|
+
float borderPadding = outerBorder * 2.0;
|
|
782
|
+
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
783
|
+
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
784
|
+
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
785
|
+
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
786
|
+
|
|
787
|
+
float d; // signed distance
|
|
788
|
+
if(vVertType == `).concat(Ru,`) {
|
|
789
|
+
d = rectangleSD(p, b);
|
|
790
|
+
} else if(vVertType == `).concat(Ff,` && w == h) {
|
|
791
|
+
d = circleSD(p, b.x); // faster than ellipse
|
|
792
|
+
} else if(vVertType == `).concat(Ff,`) {
|
|
793
|
+
d = ellipseSD(p, b);
|
|
794
|
+
} else {
|
|
795
|
+
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
799
|
+
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
800
|
+
if(d > 0.0) {
|
|
801
|
+
if(d > outerBorder) {
|
|
802
|
+
discard;
|
|
803
|
+
} else {
|
|
804
|
+
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
805
|
+
}
|
|
806
|
+
} else {
|
|
807
|
+
if(d > innerBorder) {
|
|
808
|
+
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
809
|
+
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
810
|
+
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
811
|
+
}
|
|
812
|
+
else {
|
|
813
|
+
vec4 outerColor;
|
|
814
|
+
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
815
|
+
outerColor = vec4(0);
|
|
816
|
+
} else if(innerBorder == 0.0) {
|
|
817
|
+
outerColor = vBorderColor;
|
|
818
|
+
} else {
|
|
819
|
+
outerColor = blend(vBorderColor, vColor);
|
|
820
|
+
}
|
|
821
|
+
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
else {
|
|
826
|
+
outColor = vColor;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
`).concat(n.picking?`if(outColor.a == 0.0) discard;
|
|
830
|
+
else outColor = vIndex;`:"",`
|
|
831
|
+
}
|
|
832
|
+
`),o=Pee(r,a,l);o.aPosition=r.getAttribLocation(o,"aPosition"),o.aIndex=r.getAttribLocation(o,"aIndex"),o.aVertType=r.getAttribLocation(o,"aVertType"),o.aTransform=r.getAttribLocation(o,"aTransform"),o.aAtlasId=r.getAttribLocation(o,"aAtlasId"),o.aTex=r.getAttribLocation(o,"aTex"),o.aPointAPointB=r.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=r.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=r.getAttribLocation(o,"aLineWidth"),o.aColor=r.getAttribLocation(o,"aColor"),o.aCornerRadius=r.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=r.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=r.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=r.getUniformLocation(o,"uAtlasSize"),o.uBGColor=r.getUniformLocation(o,"uBGColor"),o.uZoom=r.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var f=0;f<this.batchManager.getMaxAtlasesPerBatch();f++)o.uTextures.push(r.getUniformLocation(o,"uTexture".concat(f)));return o}},{key:"_createVAO",value:function(){var n=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=n.length/2;var r=this.maxInstances,a=this.gl,i=this.program,l=a.createVertexArray();return a.bindVertexArray(l),Gee(a,"vec2",i.aPosition,n),this.transformBuffer=$ee(a,r,i.aTransform),this.indexBuffer=ii(a,r,"vec4",i.aIndex),this.vertTypeBuffer=ii(a,r,"int",i.aVertType),this.atlasIdBuffer=ii(a,r,"int",i.aAtlasId),this.texBuffer=ii(a,r,"vec4",i.aTex),this.pointAPointBBuffer=ii(a,r,"vec4",i.aPointAPointB),this.pointCPointDBuffer=ii(a,r,"vec4",i.aPointCPointD),this.lineWidthBuffer=ii(a,r,"vec2",i.aLineWidth),this.colorBuffer=ii(a,r,"vec4",i.aColor),this.cornerRadiusBuffer=ii(a,r,"vec4",i.aCornerRadius),this.borderColorBuffer=ii(a,r,"vec4",i.aBorderColor),a.bindVertexArray(null),l}},{key:"buffers",get:function(){var n=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(r){return ul(r,"Buffer")}).map(function(r){return n[r]})),this._buffers}},{key:"startFrame",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nd.SCREEN;this.panZoomMatrix=n,this.renderTarget=r,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(n,r){return n.visible()?r&&r.isVisible?r.isVisible(n):!0:!1}},{key:"drawTexture",value:function(n,r,a){var i=this.atlasManager,l=this.batchManager,o=i.getRenderTypeOpts(a);if(this._isVisible(n,o)&&!(n.isEdge()&&!this._isValidEdge(n))){if(this.renderTarget.picking&&o.getTexPickingMode){var f=o.getTexPickingMode(n);if(f===Fp.IGNORE)return;if(f==Fp.USE_BB){this.drawPickingRectangle(n,r,a);return}}var c=i.getAtlasInfo(n,a),h=Xr(c),p;try{for(h.s();!(p=h.n()).done;){var m=p.value,y=m.atlas,x=m.tex1,b=m.tex2;l.canAddToCurrentBatch(y)||this.endBatch();for(var w=l.getAtlasIndexForBatch(y),S=0,N=[[x,!0],[b,!1]];S<N.length;S++){var E=Bn(N[S],2),T=E[0],R=E[1];if(T.w!=0){var A=this.instanceCount;this.vertTypeBuffer.getView(A)[0]=tb;var D=this.indexBuffer.getView(A);Au(r,D);var _=this.atlasIdBuffer.getView(A);_[0]=w;var L=this.texBuffer.getView(A);L[0]=T.x,L[1]=T.y,L[2]=T.w,L[3]=T.h;var M=this.transformBuffer.getMatrixView(A);this.setTransformMatrix(n,M,o,m,R),this.instanceCount++,R||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(z){h.e(z)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(n,r,a,i){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(a.shapeProps&&a.shapeProps.padding&&(o=n.pstyle(a.shapeProps.padding).pfValue),i){var f=i.bb,c=i.tex1,h=i.tex2,p=c.w/(c.w+h.w);l||(p=1-p);var m=this._getAdjustedBB(f,o,l,p);this._applyTransformMatrix(r,m,a,n)}else{var y=a.getBoundingBox(n),x=this._getAdjustedBB(y,o,!0,1);this._applyTransformMatrix(r,x,a,n)}}},{key:"_applyTransformMatrix",value:function(n,r,a,i){var l,o;NA(n);var f=a.getRotation?a.getRotation(i):0;if(f!==0){var c=a.getRotationPoint(i),h=c.x,p=c.y;cp(n,n,[h,p]),kA(n,n,f);var m=a.getRotationOffset(i);l=m.x+(r.xOffset||0),o=m.y+(r.yOffset||0)}else l=r.x1,o=r.y1;cp(n,n,[l,o]),y1(n,n,[r.w,r.h])}},{key:"_getAdjustedBB",value:function(n,r,a,i){var l=n.x1,o=n.y1,f=n.w,c=n.h,h=n.yOffset;r&&(l-=r,o-=r,f+=2*r,c+=2*r);var p=0,m=f*i;return a&&i<1?f=m:!a&&i<1&&(p=f-m,l+=p,f=m),{x1:l,y1:o,w:f,h:c,xOffset:p,yOffset:h}}},{key:"drawPickingRectangle",value:function(n,r,a){var i=this.atlasManager.getRenderTypeOpts(a),l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=Ru;var o=this.indexBuffer.getView(l);Au(r,o);var f=this.colorBuffer.getView(l);to([0,0,0],1,f);var c=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(n,c,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(n,r,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(n,i)){var l=i.shapeProps,o=this._getVertTypeForShape(n,l.shape);if(o===void 0||i.isSimple&&!i.isSimple(n)){this.drawTexture(n,r,a);return}var f=this.instanceCount;if(this.vertTypeBuffer.getView(f)[0]=o,o===Iv||o===If){var c=i.getBoundingBox(n),h=this._getCornerRadius(n,l.radius,c),p=this.cornerRadiusBuffer.getView(f);p[0]=h,p[1]=h,p[2]=h,p[3]=h,o===If&&(p[0]=0,p[2]=0)}var m=this.indexBuffer.getView(f);Au(r,m);var y=n.pstyle(l.color).value,x=n.pstyle(l.opacity).value,b=this.colorBuffer.getView(f);to(y,x,b);var w=this.lineWidthBuffer.getView(f);if(w[0]=0,w[1]=0,l.border){var S=n.pstyle("border-width").value;if(S>0){var N=n.pstyle("border-color").value,E=n.pstyle("border-opacity").value,T=this.borderColorBuffer.getView(f);to(N,E,T);var R=n.pstyle("border-position").value;if(R==="inside")w[0]=0,w[1]=-S;else if(R==="outside")w[0]=S,w[1]=0;else{var A=S/2;w[0]=A,w[1]=-A}}}var D=this.transformBuffer.getMatrixView(f);this.setTransformMatrix(n,D,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(n,r){var a=n.pstyle(r).value;switch(a){case"rectangle":return Ru;case"ellipse":return Ff;case"roundrectangle":case"round-rectangle":return Iv;case"bottom-round-rectangle":return If;default:return}}},{key:"_getCornerRadius",value:function(n,r,a){var i=a.w,l=a.h;if(n.pstyle(r).value==="auto")return Sl(i,l);var o=n.pstyle(r).pfValue,f=i/2,c=l/2;return Math.min(o,c,f)}},{key:"drawEdgeArrow",value:function(n,r,a){if(n.visible()){var i=n._private.rscratch,l,o,f;if(a==="source"?(l=i.arrowStartX,o=i.arrowStartY,f=i.srcArrowAngle):(l=i.arrowEndX,o=i.arrowEndY,f=i.tgtArrowAngle),!(isNaN(l)||l==null||isNaN(o)||o==null||isNaN(f)||f==null)){var c=n.pstyle(a+"-arrow-shape").value;if(c!=="none"){var h=n.pstyle(a+"-arrow-color").value,p=n.pstyle("opacity").value,m=n.pstyle("line-opacity").value,y=p*m,x=n.pstyle("width").pfValue,b=n.pstyle("arrow-scale").value,w=this.r.getArrowWidth(x,b),S=this.instanceCount,N=this.transformBuffer.getMatrixView(S);NA(N),cp(N,N,[l,o]),y1(N,N,[w,w]),kA(N,N,f),this.vertTypeBuffer.getView(S)[0]=nb;var E=this.indexBuffer.getView(S);Au(r,E);var T=this.colorBuffer.getView(S);to(h,y,T),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(n,r){if(n.visible()){var a=this._getEdgePoints(n);if(a){var i=n.pstyle("opacity").value,l=n.pstyle("line-opacity").value,o=n.pstyle("width").pfValue,f=n.pstyle("line-color").value,c=i*l;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=TA;var p=this.indexBuffer.getView(h);Au(r,p);var m=this.colorBuffer.getView(h);to(f,c,m);var y=this.lineWidthBuffer.getView(h);y[0]=o;var x=this.pointAPointBBuffer.getView(h);x[0]=a[0],x[1]=a[1],x[2]=a[2],x[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var b=0;b<a.length-2;b+=2){var w=this.instanceCount;this.vertTypeBuffer.getView(w)[0]=jA;var S=this.indexBuffer.getView(w);Au(r,S);var N=this.colorBuffer.getView(w);to(f,c,N);var E=this.lineWidthBuffer.getView(w);E[0]=o;var T=a[b-2],R=a[b-1],A=a[b],D=a[b+1],_=a[b+2],L=a[b+3],M=a[b+4],z=a[b+5];b==0&&(T=2*A-_+.001,R=2*D-L+.001),b==a.length-4&&(M=2*_-A+.001,z=2*L-D+.001);var B=this.pointAPointBBuffer.getView(w);B[0]=T,B[1]=R,B[2]=A,B[3]=D;var H=this.pointCPointDBuffer.getView(w);H[0]=_,H[1]=L,H[2]=M,H[3]=z,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(n){var r=n._private.rscratch;return!(r.badLine||r.allpts==null||isNaN(r.allpts[0]))}},{key:"_getEdgePoints",value:function(n){var r=n._private.rscratch;if(this._isValidEdge(n)){var a=r.allpts;if(a.length==4)return a;var i=this._getNumSegments(n);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(n){var r=15;return Math.min(Math.max(r,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(n,r){if(n.length==4)return n;for(var a=Array((r+1)*2),i=0;i<=r;i++)if(i==0)a[0]=n[0],a[1]=n[1];else if(i==r)a[i*2]=n[n.length-2],a[i*2+1]=n[n.length-1];else{var l=i/r;this._setCurvePoint(n,l,a,i*2)}return a}},{key:"_setCurvePoint",value:function(n,r,a,i){if(n.length<=2)a[i]=n[0],a[i+1]=n[1];else{for(var l=Array(n.length-2),o=0;o<l.length;o+=2){var f=(1-r)*n[o]+r*n[o+2],c=(1-r)*n[o+1]+r*n[o+3];l[o]=f,l[o+1]=c}return this._setCurvePoint(l,r,a,i)}}},{key:"endBatch",value:function(){var n=this.gl,r=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var l=this.renderTarget.picking?this.pickingProgram:this.program;n.useProgram(l),n.bindVertexArray(r);var o=Xr(this.buffers),f;try{for(o.s();!(f=o.n()).done;){var c=f.value;c.bufferSubData(i)}}catch(x){o.e(x)}finally{o.f()}for(var h=this.batchManager.getAtlases(),p=0;p<h.length;p++)h[p].bufferIfNeeded(n);for(var m=0;m<h.length;m++)n.activeTexture(n.TEXTURE0+m),n.bindTexture(n.TEXTURE_2D,h[m].texture),n.uniform1i(l.uTextures[m],m);n.uniform1f(l.uZoom,zee(this.r)),n.uniformMatrix3fv(l.uPanZoomMatrix,!1,this.panZoomMatrix),n.uniform1i(l.uAtlasSize,this.batchManager.getAtlasSize());var y=to(this.bgColor,1);n.uniform4fv(l.uBGColor,y),n.drawArraysInstanced(n.TRIANGLES,0,a,i),n.bindVertexArray(null),n.bindTexture(n.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:h.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var n=this.atlasManager.getDebugInfo(),r=n.reduce(function(l,o){return l+o.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(l,o){return l+o.count},0);return{atlasInfo:n,totalAtlases:r,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),n3={};n3.initWebgl=function(e,t){var n=this,r=n.data.contexts[n.WEBGL];e.bgColor=ste(n),e.webglTexSize=Math.min(e.webglTexSize,r.getParameter(r.MAX_TEXTURE_SIZE)),e.webglTexRows=Math.min(e.webglTexRows,54),e.webglTexRowsNodes=Math.min(e.webglTexRowsNodes,54),e.webglBatchSize=Math.min(e.webglBatchSize,16384),e.webglTexPerBatch=Math.min(e.webglTexPerBatch,r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)),n.webglDebug=e.webglDebug,n.webglDebugShowAtlases=e.webglDebugShowAtlases,n.pickingFrameBuffer=Kee(r),n.pickingFrameBuffer.needsDraw=!0,n.drawing=new ite(n,r,e);var a=function(p){return function(m){return n.getTextAngle(m,p)}},i=function(p){return function(m){var y=m.pstyle(p);return y&&y.value}},l=function(p){return function(m){return m.pstyle("".concat(p,"-opacity")).value>0}},o=function(p){var m=p.pstyle("text-events").strValue==="yes";return m?Fp.USE_BB:Fp.IGNORE},f=function(p){var m=p.position(),y=m.x,x=m.y,b=p.outerWidth(),w=p.outerHeight();return{w:b,h:w,x1:y-b/2,y1:x-w/2}};n.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),n.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),n.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),n.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:f,isSimple:Fee,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),n.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:f,isVisible:l("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),n.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:f,isVisible:l("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),n.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:rb(t.getLabelKey,null),getBoundingBox:ab(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:a(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:i("label")}),n.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:rb(t.getSourceLabelKey,"source"),getBoundingBox:ab(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:a("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:i("source-label")}),n.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:rb(t.getTargetLabelKey,"target"),getBoundingBox:ab(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:a("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:i("target-label")});var c=$d(function(){console.log("garbage collect flag set"),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(h,p){var m=!1;p&&p.length>0&&(m|=n.drawing.invalidate(p)),m&&c()}),lte(n)};function ste(e){var t=e.cy.container(),n=t&&t.style&&t.style.backgroundColor||"white";return RO(n)}function r3(e,t){var n=e._private.rscratch;return Gr(n,"labelWrapCachedLines",t)||[]}var rb=function(t,n){return function(r){var a=t(r),i=r3(r,n);return i.length>1?i.map(function(l,o){return"".concat(a,"_").concat(o)}):a}},ab=function(t,n){return function(r,a){var i=t(r);if(typeof a=="string"){var l=a.indexOf("_");if(l>0){var o=Number(a.substring(l+1)),f=r3(r,n),c=i.h/f.length,h=c*o,p=i.y1+h;return{x1:i.x1,w:i.w,y1:p,h:c,yOffset:h}}}return i}};function lte(e){{var t=e.render;e.render=function(i){i=i||{};var l=e.cy;e.webgl&&(l.zoom()>XL?(ote(e),t.call(e,i)):(ute(e),i3(e,i,nd.SCREEN)))}}{var n=e.matchCanvasSize;e.matchCanvasSize=function(i){n.call(e,i),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0}}e.findNearestElements=function(i,l,o,f){return pte(e,i,l)};{var r=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){r.call(e),e.pickingFrameBuffer.needsDraw=!0}}{var a=e.notify;e.notify=function(i,l){a.call(e,i,l),i==="viewport"||i==="bounds"?e.pickingFrameBuffer.needsDraw=!0:i==="background"&&e.drawing.invalidate(l,{type:"node-body"})}}}function ote(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function ute(e){var t=function(r){r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,e.canvasWidth,e.canvasHeight),r.restore()};t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}function cte(e){var t=e.canvasWidth,n=e.canvasHeight,r=sS(e),a=r.pan,i=r.zoom,l=eb();cp(l,l,[a.x,a.y]),y1(l,l,[i,i]);var o=eb();Xee(o,t,n);var f=eb();return Yee(f,o,l),f}function a3(e,t){var n=e.canvasWidth,r=e.canvasHeight,a=sS(e),i=a.pan,l=a.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(i.x,i.y),t.scale(l,l)}function fte(e,t){e.drawSelectionRectangle(t,function(n){return a3(e,n)})}function dte(e){var t=e.data.contexts[e.NODE];t.save(),a3(e,t),t.strokeStyle="rgba(0, 0, 0, 0.3)",t.beginPath(),t.moveTo(-1e3,0),t.lineTo(1e3,0),t.stroke(),t.beginPath(),t.moveTo(0,-1e3),t.lineTo(0,1e3),t.stroke(),t.restore()}function hte(e){var t=function(a,i,l){for(var o=a.atlasManager.getAtlasCollection(i),f=e.data.contexts[e.NODE],c=o.atlases,h=0;h<c.length;h++){var p=c[h],m=p.canvas;if(m){var y=m.width,x=m.height,b=y*h,w=m.height*l,S=.4;f.save(),f.scale(S,S),f.drawImage(m,b,w),f.strokeStyle="black",f.rect(b,w,y,x),f.stroke(),f.restore()}}},n=0;t(e.drawing,"node",n++),t(e.drawing,"label",n++)}function vte(e,t,n,r,a){var i,l,o,f,c=sS(e),h=c.pan,p=c.zoom;{var m=Iee(e,h,p,t,n),y=Bn(m,2),x=y[0],b=y[1],w=6;i=x-w/2,l=b-w/2,o=w,f=w}if(o===0||f===0)return[];var S=e.data.contexts[e.WEBGL];S.bindFramebuffer(S.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(S.viewport(0,0,S.canvas.width,S.canvas.height),i3(e,null,nd.PICKING),e.pickingFrameBuffer.needsDraw=!1);var N=o*f,E=new Uint8Array(N*4);S.readPixels(i,l,o,f,S.RGBA,S.UNSIGNED_BYTE,E),S.bindFramebuffer(S.FRAMEBUFFER,null);for(var T=new Set,R=0;R<N;R++){var A=E.slice(R*4,R*4+4),D=qee(A)-1;D>=0&&T.add(D)}return T}function pte(e,t,n){var r=vte(e,t,n),a=e.getCachedZSortedEles(),i,l,o=Xr(r),f;try{for(o.s();!(f=o.n()).done;){var c=f.value,h=a[c];if(!i&&h.isNode()&&(i=h),!l&&h.isEdge()&&(l=h),i&&l)break}}catch(p){o.e(p)}finally{o.f()}return[i,l].filter(Boolean)}function ib(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,"node-underlay"),r.drawNode(n,t,"node-body"),r.drawTexture(n,t,"label"),r.drawNode(n,t,"node-overlay")):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,"source"),r.drawEdgeArrow(n,t,"target"),r.drawTexture(n,t,"label"),r.drawTexture(n,t,"edge-source-label"),r.drawTexture(n,t,"edge-target-label"))}function i3(e,t,n){var r;e.webglDebug&&(r=performance.now());var a=e.drawing,i=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&fte(e,t),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var l=e.data.contexts[e.WEBGL];n.screen?(l.clearColor(0,0,0,0),l.enable(l.BLEND),l.blendFunc(l.ONE,l.ONE_MINUS_SRC_ALPHA)):l.disable(l.BLEND),l.clear(l.COLOR_BUFFER_BIT|l.DEPTH_BUFFER_BIT),l.viewport(0,0,l.canvas.width,l.canvas.height);var o=cte(e),f=e.getCachedZSortedEles();if(i=f.length,a.startFrame(o,n),n.screen){for(var c=0;c<f.nondrag.length;c++)ib(e,c,f.nondrag[c]);for(var h=0;h<f.drag.length;h++)ib(e,h,f.drag[h])}else if(n.picking)for(var p=0;p<f.length;p++)ib(e,p,f[p]);a.endFrame(),n.screen&&e.webglDebugShowAtlases&&(dte(e),hte(e)),e.data.canvasNeedsRedraw[e.NODE]=!1,e.data.canvasNeedsRedraw[e.DRAG]=!1}if(e.webglDebug){var m=performance.now(),y=!1,x=Math.ceil(m-r),b=a.getDebugInfo(),w=["".concat(i," elements"),"".concat(b.totalInstances," instances"),"".concat(b.batchCount," batches"),"".concat(b.totalAtlases," atlases"),"".concat(b.wrappedCount," wrapped textures"),"".concat(b.simpleCount," simple shapes")].join(", ");if(y)console.log("WebGL (".concat(n.name,") - time ").concat(x,"ms, ").concat(w));else{console.log("WebGL (".concat(n.name,") - frame time ").concat(x,"ms")),console.log("Totals:"),console.log(" ".concat(w)),console.log("Texture Atlases Used:");var S=b.atlasInfo,N=Xr(S),E;try{for(N.s();!(E=N.n()).done;){var T=E.value;console.log(" ".concat(T.type,": ").concat(T.keyCount," keys, ").concat(T.atlasCount," atlases"))}}catch(R){N.e(R)}finally{N.f()}console.log("")}}e.data.gc&&(console.log("Garbage Collect!"),e.data.gc=!1,a.gc())}var Ol={};Ol.drawPolygonPath=function(e,t,n,r,a,i){var l=r/2,o=a/2;e.beginPath&&e.beginPath(),e.moveTo(t+l*i[0],n+o*i[1]);for(var f=1;f<i.length/2;f++)e.lineTo(t+l*i[f*2],n+o*i[f*2+1]);e.closePath()};Ol.drawRoundPolygonPath=function(e,t,n,r,a,i,l){l.forEach(function(o){return FL(e,o)}),e.closePath()};Ol.drawRoundRectanglePath=function(e,t,n,r,a,i){var l=r/2,o=a/2,f=i==="auto"?Sl(r,a):Math.min(i,o,l);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.arcTo(t+l,n-o,t+l,n,f),e.arcTo(t+l,n+o,t,n+o,f),e.arcTo(t-l,n+o,t-l,n,f),e.arcTo(t-l,n-o,t,n-o,f),e.lineTo(t,n-o),e.closePath()};Ol.drawBottomRoundRectanglePath=function(e,t,n,r,a,i){var l=r/2,o=a/2,f=i==="auto"?Sl(r,a):i;e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.lineTo(t+l,n-o),e.lineTo(t+l,n),e.arcTo(t+l,n+o,t,n+o,f),e.arcTo(t-l,n+o,t-l,n,f),e.lineTo(t-l,n-o),e.lineTo(t,n-o),e.closePath()};Ol.drawCutRectanglePath=function(e,t,n,r,a,i,l){var o=r/2,f=a/2,c=l==="auto"?$w():l;e.beginPath&&e.beginPath(),e.moveTo(t-o+c,n-f),e.lineTo(t+o-c,n-f),e.lineTo(t+o,n-f+c),e.lineTo(t+o,n+f-c),e.lineTo(t+o-c,n+f),e.lineTo(t-o+c,n+f),e.lineTo(t-o,n+f-c),e.lineTo(t-o,n-f+c),e.closePath()};Ol.drawBarrelPath=function(e,t,n,r,a){var i=r/2,l=a/2,o=t-i,f=t+i,c=n-l,h=n+l,p=a1(r,a),m=p.widthOffset,y=p.heightOffset,x=p.ctrlPtOffsetPct*m;e.beginPath&&e.beginPath(),e.moveTo(o,c+y),e.lineTo(o,h-y),e.quadraticCurveTo(o+x,h,o+m,h),e.lineTo(f-m,h),e.quadraticCurveTo(f-x,h,f,h-y),e.lineTo(f,c+y),e.quadraticCurveTo(f-x,c,f-m,c),e.lineTo(o+m,c),e.quadraticCurveTo(o+x,c,o,c+y),e.closePath()};var AA=Math.sin(0),RA=Math.cos(0),x1={},b1={},s3=Math.PI/40;for(var Du=0*Math.PI;Du<2*Math.PI;Du+=s3)x1[Du]=Math.sin(Du),b1[Du]=Math.cos(Du);Ol.drawEllipsePath=function(e,t,n,r,a){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,a/2,0,0,2*Math.PI);else for(var i,l,o=r/2,f=a/2,c=0*Math.PI;c<2*Math.PI;c+=s3)i=t-o*x1[c]*AA+o*b1[c]*RA,l=n+f*b1[c]*AA+f*x1[c]*RA,c===0?e.moveTo(i,l):e.lineTo(i,l);e.closePath()};var Zd={};Zd.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]};Zd.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements(),r=n.boundingBox(),a=this.findContainerClientCoords(),i=e.full?Math.ceil(r.w):a[2],l=e.full?Math.ceil(r.h):a[3],o=Re(e.maxWidth)||Re(e.maxHeight),f=this.getPixelRatio(),c=1;if(e.scale!==void 0)i*=e.scale,l*=e.scale,c=e.scale;else if(o){var h=1/0,p=1/0;Re(e.maxWidth)&&(h=c*e.maxWidth/i),Re(e.maxHeight)&&(p=c*e.maxHeight/l),c=Math.min(h,p),i*=c,l*=c}o||(i*=f,l*=f,c*=f);var m=document.createElement("canvas");m.width=i,m.height=l,m.style.width=i+"px",m.style.height=l+"px";var y=m.getContext("2d");if(i>0&&l>0){y.clearRect(0,0,i,l),y.globalCompositeOperation="source-over";var x=this.getCachedZSortedEles();if(e.full)y.translate(-r.x1*c,-r.y1*c),y.scale(c,c),this.drawElements(y,x),y.scale(1/c,1/c),y.translate(r.x1*c,r.y1*c);else{var b=t.pan(),w={x:b.x*c,y:b.y*c};c*=t.zoom(),y.translate(w.x,w.y),y.scale(c,c),this.drawElements(y,x),y.scale(1/c,1/c),y.translate(-w.x,-w.y)}e.bg&&(y.globalCompositeOperation="destination-over",y.fillStyle=e.bg,y.rect(0,0,i,l),y.fill())}return m};function mte(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([r],{type:t})}function DA(e){var t=e.indexOf(",");return e.substr(t+1)}function l3(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new jc(function(a,i){try{t.toBlob(function(l){l!=null?a(l):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(l){i(l)}});case"blob":return mte(DA(r()),n);case"base64":return DA(r());case"base64uri":default:return r()}}Zd.png=function(e){return l3(e,this.bufferCanvasImage(e),"image/png")};Zd.jpg=function(e){return l3(e,this.bufferCanvasImage(e),"image/jpeg")};var o3={};o3.nodeShapeImpl=function(e,t,n,r,a,i,l,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,a,i);case"polygon":return this.drawPolygonPath(t,n,r,a,i,l);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,a,i,l,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,a,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,a,i,l,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,a,i,o);case"barrel":return this.drawBarrelPath(t,n,r,a,i)}};var gte=u3,wt=u3.prototype;wt.CANVAS_LAYERS=3;wt.SELECT_BOX=0;wt.DRAG=1;wt.NODE=2;wt.WEBGL=3;wt.CANVAS_TYPES=["2d","2d","2d","webgl2"];wt.BUFFER_COUNT=3;wt.TEXTURE_BUFFER=0;wt.MOTIONBLUR_BUFFER_NODE=1;wt.MOTIONBLUR_BUFFER_DRAG=2;function u3(e){var t=this,n=t.cy.window(),r=n.document;e.webgl&&(wt.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:new Array(wt.CANVAS_LAYERS),contexts:new Array(wt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(wt.CANVAS_LAYERS),bufferCanvases:new Array(wt.BUFFER_COUNT),bufferContexts:new Array(wt.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=r.createElement("div");var l=t.data.canvasContainer.style;t.data.canvasContainer.style[a]=i,l.position="relative",l.zIndex="0",l.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[a]=i;var f={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};fX()&&(f["-ms-touch-action"]="none",f["touch-action"]="none");for(var c=0;c<wt.CANVAS_LAYERS;c++){var h=t.data.canvases[c]=r.createElement("canvas"),p=wt.CANVAS_TYPES[c];t.data.contexts[c]=h.getContext(p),t.data.contexts[c]||dn("Could not create canvas of type "+p),Object.keys(f).forEach(function(ne){h.style[ne]=f[ne]}),h.style.position="absolute",h.setAttribute("data-id","layer"+c),h.style.zIndex=String(wt.CANVAS_LAYERS-c),t.data.canvasContainer.appendChild(h),t.data.canvasNeedsRedraw[c]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[wt.NODE].setAttribute("data-id","layer"+wt.NODE+"-node"),t.data.canvases[wt.SELECT_BOX].setAttribute("data-id","layer"+wt.SELECT_BOX+"-selectbox"),t.data.canvases[wt.DRAG].setAttribute("data-id","layer"+wt.DRAG+"-drag"),t.data.canvases[wt.WEBGL]&&t.data.canvases[wt.WEBGL].setAttribute("data-id","layer"+wt.WEBGL+"-webgl");for(var c=0;c<wt.BUFFER_COUNT;c++)t.data.bufferCanvases[c]=r.createElement("canvas"),t.data.bufferContexts[c]=t.data.bufferCanvases[c].getContext("2d"),t.data.bufferCanvases[c].style.position="absolute",t.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),t.data.bufferCanvases[c].style.zIndex=String(-c-1),t.data.bufferCanvases[c].style.visibility="hidden";t.pathsEnabled=!0;var m=Dr(),y=function(W){return{x:(W.x1+W.x2)/2,y:(W.y1+W.y2)/2}},x=function(W){return{x:-W.w/2,y:-W.h/2}},b=function(W){var J=W[0]._private,se=J.oldBackgroundTimestamp===J.backgroundTimestamp;return!se},w=function(W){return W[0]._private.nodeKey},S=function(W){return W[0]._private.labelStyleKey},N=function(W){return W[0]._private.sourceLabelStyleKey},E=function(W){return W[0]._private.targetLabelStyleKey},T=function(W,J,se,ge,Te){return t.drawElement(W,J,se,!1,!1,Te)},R=function(W,J,se,ge,Te){return t.drawElementText(W,J,se,ge,"main",Te)},A=function(W,J,se,ge,Te){return t.drawElementText(W,J,se,ge,"source",Te)},D=function(W,J,se,ge,Te){return t.drawElementText(W,J,se,ge,"target",Te)},_=function(W){return W.boundingBox(),W[0]._private.bodyBounds},L=function(W){return W.boundingBox(),W[0]._private.labelBounds.main||m},M=function(W){return W.boundingBox(),W[0]._private.labelBounds.source||m},z=function(W){return W.boundingBox(),W[0]._private.labelBounds.target||m},B=function(W,J){return J},H=function(W){return y(_(W))},G=function(W,J,se){var ge=W?W+"-":"";return{x:J.x+se.pstyle(ge+"text-margin-x").pfValue,y:J.y+se.pstyle(ge+"text-margin-y").pfValue}},U=function(W,J,se){var ge=W[0]._private.rscratch;return{x:ge[J],y:ge[se]}},I=function(W){return G("",U(W,"labelX","labelY"),W)},V=function(W){return G("source",U(W,"sourceLabelX","sourceLabelY"),W)},K=function(W){return G("target",U(W,"targetLabelX","targetLabelY"),W)},Q=function(W){return x(_(W))},F=function(W){return x(M(W))},q=function(W){return x(z(W))},X=function(W){var J=L(W),se=x(L(W));if(W.isNode()){switch(W.pstyle("text-halign").value){case"left":se.x=-J.w-(J.leftPad||0);break;case"right":se.x=-(J.rightPad||0);break}switch(W.pstyle("text-valign").value){case"top":se.y=-J.h-(J.topPad||0);break;case"bottom":se.y=-(J.botPad||0);break}}return se},P=t.data.eleTxrCache=new Xf(t,{getKey:w,doesEleInvalidateKey:b,drawElement:T,getBoundingBox:_,getRotationPoint:H,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),Z=t.data.lblTxrCache=new Xf(t,{getKey:S,drawElement:R,getBoundingBox:L,getRotationPoint:I,getRotationOffset:X,isVisible:B}),ae=t.data.slbTxrCache=new Xf(t,{getKey:N,drawElement:A,getBoundingBox:M,getRotationPoint:V,getRotationOffset:F,isVisible:B}),ie=t.data.tlbTxrCache=new Xf(t,{getKey:E,drawElement:D,getBoundingBox:z,getRotationPoint:K,getRotationOffset:q,isVisible:B}),le=t.data.lyrTxrCache=new QL(t);t.onUpdateEleCalcs(function(W,J){P.invalidateElements(J),Z.invalidateElements(J),ae.invalidateElements(J),ie.invalidateElements(J),le.invalidateElements(J);for(var se=0;se<J.length;se++){var ge=J[se]._private;ge.oldBackgroundTimestamp=ge.backgroundTimestamp}});var ye=function(W){for(var J=0;J<W.length;J++)le.enqueueElementRefinement(W[J].ele)};P.onDequeue(ye),Z.onDequeue(ye),ae.onDequeue(ye),ie.onDequeue(ye),e.webgl&&t.initWebgl(e,{getStyleKey:w,getLabelKey:S,getSourceLabelKey:N,getTargetLabelKey:E,drawElement:T,drawLabel:R,drawSourceLabel:A,drawTargetLabel:D,getElementBox:_,getLabelBox:L,getSourceLabelBox:M,getTargetLabelBox:z,getElementRotationPoint:H,getElementRotationOffset:Q,getLabelRotationPoint:I,getSourceLabelRotationPoint:V,getTargetLabelRotationPoint:K,getLabelRotationOffset:X,getSourceLabelRotationOffset:F,getTargetLabelRotationOffset:q})}wt.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[wt.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[wt.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[wt.SELECT_BOX]=t;break;case"gc":n.data.gc=!0;break}};var yte=typeof Path2D<"u";wt.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e};wt.usePaths=function(){return yte&&this.pathsEnabled};wt.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)};wt.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled};wt.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":Gn(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(e,t);else{var r=this.cy.window(),a=r.document;n=a.createElement("canvas"),n.width=e,n.height=t}return n};[WL,Ti,vs,iS,Po,_l,_r,n3,Ol,Zd,o3].forEach(function(e){at(wt,e)});var xte=[{name:"null",impl:BL},{name:"base",impl:KL},{name:"canvas",impl:gte}],bte=[{type:"layout",extensions:GJ},{type:"renderer",extensions:xte}],c3={},f3={};function d3(e,t,n){var r=n,a=function(_){zt("Can not register `"+t+"` for `"+e+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(yd.prototype[t])return a(t);yd.prototype[t]=n}else if(e==="collection"){if(cr.prototype[t])return a(t);cr.prototype[t]=n}else if(e==="layout"){for(var i=function(_){this.options=_,n.call(this,_),Mt(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},l=i.prototype=Object.create(n.prototype),o=[],f=0;f<o.length;f++){var c=o[f];l[c]=l[c]||function(){return this}}l.start&&!l.run?l.run=function(){return this.start(),this}:!l.start&&l.run&&(l.start=function(){return this.run(),this});var h=n.prototype.stop;l.stop=function(){var D=this.options;if(D&&D.animate){var _=this.animations;if(_)for(var L=0;L<_.length;L++)_[L].stop()}return h?h.call(this):this.emit("layoutstop"),this},l.destroy||(l.destroy=function(){return this}),l.cy=function(){return this._private.cy};var p=function(_){return _._private.cy},m={addEventFields:function(_,L){L.layout=_,L.cy=p(_),L.target=_},bubble:function(){return!0},parent:function(_){return p(_)}};at(l,{createEmitter:function(){return this._private.emitter=new jm(m,this),this},emitter:function(){return this._private.emitter},on:function(_,L){return this.emitter().on(_,L),this},one:function(_,L){return this.emitter().one(_,L),this},once:function(_,L){return this.emitter().one(_,L),this},removeListener:function(_,L){return this.emitter().removeListener(_,L),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(_,L){return this.emitter().emit(_,L),this}}),Bt.eventAliasesOn(l),r=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var y=h3("renderer","base"),x=y.prototype,b=n,w=n.prototype,S=function(){y.apply(this,arguments),b.apply(this,arguments)},N=S.prototype;for(var E in x){var T=x[E],R=w[E]!=null;if(R)return a(E);N[E]=T}for(var A in w)N[A]=w[A];x.clientFunctions.forEach(function(D){N[D]=N[D]||function(){dn("Renderer does not implement `renderer."+D+"()` on its prototype")}}),r=S}else if(e==="__proto__"||e==="constructor"||e==="prototype")return dn(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return DO({map:c3,keys:[e,t],value:r})}function h3(e,t){return MO({map:c3,keys:[e,t]})}function wte(e,t,n,r,a){return DO({map:f3,keys:[e,t,n,r],value:a})}function Ste(e,t,n,r){return MO({map:f3,keys:[e,t,n,r]})}var w1=function(){if(arguments.length===2)return h3.apply(null,arguments);if(arguments.length===3)return d3.apply(null,arguments);if(arguments.length===4)return Ste.apply(null,arguments);if(arguments.length===5)return wte.apply(null,arguments);dn("Invalid extension access syntax")};yd.prototype.extension=w1;bte.forEach(function(e){e.extensions.forEach(function(t){d3(e.type,t.name,t.impl)})});var Up=function(){if(!(this instanceof Up))return new Up;this.length=0},Mo=Up.prototype;Mo.instanceString=function(){return"stylesheet"};Mo.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this};Mo.css=function(e,t){var n=this.length-1;if(tt(e))this[n].properties.push({name:e,value:t});else if(Mt(e))for(var r=e,a=Object.keys(r),i=0;i<a.length;i++){var l=a[i],o=r[l];if(o!=null){var f=nr.properties[l]||nr.properties[ym(l)];if(f!=null){var c=f.name,h=o;this[n].properties.push({name:c,value:h})}}}return this};Mo.style=Mo.css;Mo.generateStyle=function(e){var t=new nr(e);return this.appendToStyle(t)};Mo.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,a=n.properties;e.selector(r);for(var i=0;i<a.length;i++){var l=a[i];e.css(l.name,l.value)}}return e};var Ete="3.33.1",_o=function(t){if(t===void 0&&(t={}),Mt(t))return new yd(t);if(tt(t))return w1.apply(w1,arguments)};_o.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(_o),e.apply(null,t),this};_o.warnings=function(e){return IO(e)};_o.version=Ete;_o.stylesheet=_o.Stylesheet=Up;const Cte=/^#{1,6}\s+/,Nte=/[*_`~]+/g,kte=/\s+/g;function Js(e){return e.replace(Cte,"").replace(Nte,"").replace(kte," ").trim()}const Un={sage:"#abcfb8",ochre:"#edbf7f",terracotta:"#ffb4a1",neutral:"#8b928c",dimNeutral:"#6e7370",onSurface:"#e5e2e1",surface:"#111111"},Tte={concept:Un.sage,component:Un.ochre,bug:Un.terracotta,tool:Un.neutral,file:Un.neutral,spore:Un.sage,session:Un.ochre,other:Un.dimNeutral},jte=Un.dimNeutral,MA=24,_A=60,Ate=12,Rte=10,Dte=8,sb=1.5,Fv=.25,lb=.7,Mte=9,_te=.7,Ote=4,Lte=.6,Pte=1e4,Bte=120,OA=.2,zte=600,Ite=6e3,Fte=150,Ute=300,Uf=50,LA=20,PA={concept:"Concept",component:"Component",bug:"Bug",tool:"Tool",file:"File",spore:"Spore",session:"Session",other:"Other"};function qte(e,t){if(t)return _A*1.2;const n=Math.min(e/Ate,1);return MA+n*(_A-MA)}function Vte(e){const t=Js(e);return t.length<=LA?t:t.slice(0,LA-1)+"…"}function BA(e){return Tte[e==null?void 0:e.toLowerCase()]??jte}function Hte({nodes:e,edges:t,onNodeSelect:n,centerId:r}){const a=j.useRef(null),i=j.useRef(null),l=j.useRef(n);l.current=n,j.useEffect(()=>{if(!a.current||e.length===0)return;const f=new Map(e.map(x=>[x.id,x])),c=new Map;for(const x of e)c.set(x.id,0);for(const x of t)c.set(x.source_id,(c.get(x.source_id)??0)+1),c.set(x.target_id,(c.get(x.target_id)??0)+1);const h=[...e.map(x=>{var S;const b=PA[(S=x.type)==null?void 0:S.toLowerCase()]??PA.other,w=x.id===r;return{data:{id:x.id,label:`${Vte(x.name)}
|
|
833
|
+
${b}`,fullLabel:x.name,type:x.type,isCenter:w,degree:c.get(x.id)??0,nodeSize:qte(c.get(x.id)??0,w)},classes:w?"center":""}}),...t.map((x,b)=>({data:{id:`edge-${b}`,source:x.source_id,target:x.target_id,label:x.label??"",weight:x.weight??1}}))],p=a.current.getBoundingClientRect();if(p.width===0||p.height===0)return;const m=_o({container:a.current,elements:h,style:[{selector:"node",style:{label:"data(label)","background-color":x=>BA(x.data("type")),"background-opacity":.9,color:Un.onSurface,"font-size":Rte,"font-family":"Inter, system-ui, sans-serif","text-valign":"bottom","text-margin-y":Dte,"text-outline-color":Un.surface,"text-outline-width":2,"text-outline-opacity":.8,"text-wrap":"wrap","text-max-width":"120px",width:"data(nodeSize)",height:"data(nodeSize)","border-width":0,"border-color":Un.sage,"border-opacity":0,"overlay-opacity":0}},{selector:"node.center",style:{"border-width":2,"border-color":Un.onSurface,"border-opacity":.4,"text-outline-color":Un.surface,"text-outline-width":3,"font-weight":"bold"}},{selector:"node:active",style:{"overlay-opacity":.08,"overlay-color":Un.sage}},{selector:"node:selected",style:{"border-width":Ote,"border-color":x=>BA(x.data("type")),"border-opacity":Lte,"background-opacity":1}},{selector:"edge",style:{width:sb,"line-color":Un.neutral,"line-opacity":Fv,"curve-style":"unbundled-bezier","control-point-distances":[40],"control-point-weights":[.5],"target-arrow-shape":"triangle","target-arrow-color":Un.neutral,"arrow-scale":_te,label:"data(label)","font-size":Mte,"font-family":"Inter, system-ui, sans-serif",color:Un.neutral,"text-opacity":0,"text-rotation":"autorotate","text-margin-y":-8,"text-outline-color":Un.surface,"text-outline-width":2,"text-outline-opacity":.7}},{selector:"edge:active",style:{"text-opacity":1,"line-opacity":lb}},{selector:"node.faded",style:{opacity:.3}},{selector:"edge.faded",style:{opacity:.1}}],layout:{name:"preset"},userZoomingEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,minZoom:.3,maxZoom:3}),y=r?m.layout({name:"cose",animate:!0,animationDuration:Ute,nodeRepulsion:()=>Ite,idealEdgeLength:()=>Fte,gravity:OA,nodeDimensionsIncludeLabels:!0,fit:!0,padding:Uf,randomize:!1}):m.layout({name:"cose",animate:!0,animationDuration:zte,nodeRepulsion:()=>Pte,idealEdgeLength:()=>Bte,gravity:OA,nodeDimensionsIncludeLabels:!0,fit:!0,padding:Uf});return y.on("layoutstop",()=>{const x=i.current;if(!x)return;const b=x.nodes(),w=x.$("node.center");if(w.length>0){const S=w.closedNeighborhood();x.fit(S,Uf*1.5),x.zoom()>1.05&&(x.zoom(1.05),x.center(w))}else{const{ele:S,value:N}=b.max(E=>E.degree(!1));N>2&&b.length>20?x.animate({center:{eles:S},zoom:1.2,duration:300,easing:"ease-out"}):x.fit(void 0,Uf)}}),y.run(),m.on("tap","node",x=>{var E;const b=x.target,w=b.data();m.elements().removeClass("faded");const S=b.closedNeighborhood();m.elements().not(S).addClass("faded"),b.connectedEdges().style({"line-opacity":lb,"text-opacity":.9,width:2});const N=f.get(w.id);(E=l.current)==null||E.call(l,N??{id:w.id,name:w.fullLabel??w.label,type:w.type})}),m.on("tap",x=>{var b;x.target===m&&(m.elements().removeClass("faded"),m.edges().style({"line-opacity":Fv,"text-opacity":0,width:sb}),(b=l.current)==null||b.call(l,null))}),m.on("mouseover","edge",x=>{x.target.style("text-opacity",1),x.target.style("line-opacity",lb)}),m.on("mouseout","edge",x=>{const b=m.$("node:selected");b.length>0&&b.connectedEdges().contains(x.target)||(x.target.style("text-opacity",0),x.target.style("line-opacity",Fv))}),i.current=m,()=>{m.destroy(),i.current=null}},[e,t,r]);const o=j.useCallback(()=>{const f=i.current;f&&(f.elements().removeClass("faded"),f.edges().style({"line-opacity":Fv,"text-opacity":0,width:sb}),f.fit(void 0,Uf))},[]);return{containerRef:a,resetView:o}}function Gte({nodes:e,edges:t,onNodeSelect:n,centerId:r,isLoading:a}){const{containerRef:i,resetView:l}=Hte({nodes:e,edges:t,onNodeSelect:n,centerId:r});return d.jsxs("div",{className:"absolute inset-0",children:[d.jsx("div",{className:"absolute inset-0 rounded-md bg-surface-container-lowest",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(139, 146, 140, 0.05) 1px, transparent 0)",backgroundSize:"40px 40px"}}),d.jsx("div",{ref:i,className:"absolute inset-0 rounded-md"}),d.jsxs("div",{className:"absolute bottom-3 left-3 z-10 flex items-center gap-3",children:[e.length>0&&d.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px] text-on-surface-variant/60 mr-1",children:[d.jsxs("span",{children:[e.length," nodes"]}),d.jsxs("span",{children:[t.length," edges"]})]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:l,className:"gap-1.5 h-7 text-[10px] px-2 bg-surface-container-high/40 backdrop-blur-sm",children:[d.jsx(Kp,{className:"h-3 w-3"}),"Reset View"]})]}),!a&&e.length===0&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No nodes to display"})})]})}const zA=400,$te={concept:"default",component:"warning",bug:"destructive",tool:"secondary",file:"secondary",spore:"default",session:"warning"},IA={concept:"bg-primary",component:"bg-secondary",bug:"bg-tertiary",tool:"bg-outline",file:"bg-outline",spore:"bg-primary",session:"bg-secondary"};function Ys({label:e,value:t}){return d.jsxs("div",{className:"flex justify-between items-baseline py-1",children:[d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:e}),d.jsx("span",{className:"font-mono text-xs text-on-surface text-right max-w-[160px] truncate",children:t})]})}function FA(e){return e.type==="session"?`/sessions/${e.id}`:e.type==="spore"?`/mycelium?tab=spores&spore=${e.id}`:null}function Kte({node:e,edges:t,nodes:n,metadata:r,markdownPreview:a,connectedSpores:i,onClose:l,onNodeSelect:o,onNavigateToSpore:f,isConnectionsLoading:c}){const h=Wa();if(!e)return null;const p=e.type.toLowerCase(),m=$te[p]??"secondary",y=IA[p]??"bg-outline",x=new Map((n??[]).map(E=>[E.id,E])),b=[];for(const E of t??[])if(E.source_id===e.id){const T=x.get(E.target_id);T&&b.push({nodeId:T.id,nodeName:T.name,nodeType:T.type,edgeLabel:E.label??"connected",direction:"outgoing",status:T.status})}else if(E.target_id===e.id){const T=x.get(E.source_id);T&&b.push({nodeId:T.id,nodeName:T.name,nodeType:T.type,edgeLabel:E.label??"connected",direction:"incoming",status:T.status})}b.sort((E,T)=>E.nodeName.localeCompare(T.nodeName));const w=a??e.content,S=w&&w.length>zA?w.slice(0,zA)+"…":w,N=e.type==="spore"?"Observation":e.type==="session"?"Summary":"Notes";return d.jsxs($e,{glass:!0,className:"absolute top-3 right-3 bottom-3 z-20 w-[320px] overflow-y-auto flex flex-col shadow-lg border border-outline-variant/15 rounded-md",children:[d.jsx("div",{className:"p-4 pb-3",children:d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[d.jsx("div",{className:`h-2 w-2 rounded-full ${y} shrink-0`}),d.jsx(xt,{variant:m,className:"text-[10px] uppercase",children:e.observation_type??e.type})]}),d.jsx("h2",{className:"font-serif text-lg text-on-surface leading-tight break-words",children:Js(e.name)}),d.jsx("div",{className:"flex flex-wrap items-center gap-3 mt-2",children:FA(e)&&d.jsxs("button",{onClick:()=>{e.type==="spore"&&f?f(e.id):h(FA(e))},className:"inline-flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-primary transition-colors group cursor-pointer",children:[d.jsxs("span",{children:["View ",e.type]}),d.jsx(Gp,{className:"h-3 w-3 group-hover:translate-x-0.5 transition-transform"})]})})]}),l&&d.jsx("button",{onClick:l,className:"shrink-0 rounded-md p-1 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors",children:d.jsx(kl,{className:"h-4 w-4"})})]})}),d.jsx("div",{className:"h-px bg-surface-container-high/50"}),d.jsxs("div",{className:"px-4 py-3 space-y-0.5",children:[d.jsx(St,{children:"Metadata"}),d.jsxs("div",{className:"mt-1.5",children:[d.jsx(Ys,{label:"Type",value:e.observation_type??e.type}),d.jsx(Ys,{label:"ID",value:e.id.slice(0,12)+"…"}),e.status&&d.jsx(Ys,{label:"Status",value:e.status}),e.created_at!=null&&d.jsx(Ys,{label:"Created",value:new Date(e.created_at).toLocaleDateString()}),e.mention_count!=null&&e.mention_count>0&&d.jsx(Ys,{label:"Mentions",value:String(e.mention_count)}),d.jsx(Ys,{label:"Connections",value:String(b.length)}),e.depth!==void 0&&d.jsx(Ys,{label:"Depth",value:String(e.depth)}),r&&Object.entries(r).map(([E,T])=>d.jsx(Ys,{label:E,value:T},E))]})]}),S&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-px bg-surface-container-high/50"}),d.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[d.jsx(St,{children:N}),d.jsx($e,{level:"lowest",className:"p-3",children:d.jsx(Rr,{content:S,className:"text-xs leading-relaxed text-on-surface-variant"})})]})]}),(b.length>0||c)&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-px bg-surface-container-high/50"}),d.jsxs("div",{className:"px-4 py-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs(St,{children:["Connections (",b.length,")"]}),c&&d.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] uppercase tracking-wider text-on-surface-variant",children:[d.jsx(jn,{className:"h-3 w-3 animate-spin"}),"Updating"]})]}),d.jsx("div",{className:"space-y-1",children:b.map((E,T)=>{const R=E.nodeType.toLowerCase(),A=IA[R]??"bg-outline";return d.jsx("button",{className:"group w-full rounded-md border border-transparent px-2 py-2 text-left transition-colors hover:border-outline-variant/10 hover:bg-surface-container-high/50",onClick:()=>{const D=x.get(E.nodeId);o==null||o(D??{id:E.nodeId,name:E.nodeName,type:E.nodeType,status:E.status},"inspector")},children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("div",{className:`mt-1 h-2 w-2 rounded-full ${A} shrink-0`}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"truncate font-sans text-xs text-on-surface transition-colors group-hover:text-primary",children:Js(E.nodeName)}),d.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-[9px] uppercase tracking-wider text-on-surface-variant/60",children:[d.jsx("span",{children:E.nodeType}),d.jsx("span",{children:"•"}),d.jsx("span",{children:E.edgeLabel})]})]}),d.jsx(Tb,{className:`mt-0.5 h-3 w-3 shrink-0 text-on-surface-variant/50 ${E.direction==="incoming"?"rotate-180":""}`})]})},`${E.nodeId}-${E.edgeLabel}-${T}`)})})]})]}),i&&i.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-px bg-surface-container-high/50"}),d.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[d.jsx(St,{children:"Connected Spores"}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(E=>d.jsx(xt,{variant:"secondary",className:"cursor-pointer text-[10px] hover:bg-surface-container-highest transition-colors",children:E.name},E.id))})]})]})]})}const Yte=15e3,Xte=3e4,lS=3e4,Qte=6e4;function Wte(e){const t=new URLSearchParams;e!=null&&e.type&&t.set("type",e.type),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/spores?${n}`:"/spores";return qt({queryKey:["spores",e],queryFn:({signal:a})=>lt(r,{signal:a}),staleTime:Yte})}function Zte(e){return qt({queryKey:["spore",e],queryFn:({signal:t})=>lt(`/spores/${e}`,{signal:t}),enabled:e!==void 0,staleTime:Xte})}function UA(e,t=1,n=!0){return qt({queryKey:["graph",e,t],queryFn:({signal:r})=>lt(`/graph/${e}?depth=${t}`,{signal:r}),enabled:n&&e!==void 0,staleTime:lS})}function Jte(e=!0){return qt({queryKey:["full-graph"],queryFn:({signal:t})=>lt("/graph",{signal:t}),enabled:e,staleTime:lS})}function ene(){return qt({queryKey:["graph-seeds"],queryFn:({signal:e})=>lt("/graph/seeds",{signal:e}),staleTime:lS})}function tne(e){const t=e?`/digest?agent_id=${encodeURIComponent(e)}`:"/digest";return qt({queryKey:["digest",e],queryFn:({signal:n})=>lt(t,{signal:n}),staleTime:Qte})}function v3(e){switch(e){case"wisdom":return"bg-primary/15 text-primary";case"discovery":return"bg-primary/15 text-primary";case"decision":return"bg-secondary/15 text-secondary";case"trade_off":return"bg-secondary/15 text-secondary";case"gotcha":return"bg-tertiary/15 text-tertiary";case"bug_fix":return"bg-tertiary/15 text-tertiary";default:return"bg-surface-container text-on-surface-variant"}}function p3(e){switch(e){case"active":return"bg-primary/15 text-primary";case"consolidated":return"bg-surface-container-high text-on-surface-variant";case"superseded":return"bg-tertiary/10 text-tertiary/70";default:return"bg-surface-container text-on-surface-variant"}}function bo(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}const nne=120,rne=1e3,ane=[tr,"gotcha","decision","discovery","trade_off","bug_fix"],ine=[tr,"active","superseded","consolidated"],sne=[{key:"type",label:"Type",options:ane.map(e=>({value:e,label:e===tr?"All types":bo(e)}))},{key:"status",label:"Status",options:ine.map(e=>({value:e,label:e===tr?"All statuses":bo(e)}))}];function lne(e){return new Date(e*rne).toLocaleDateString()}function one({spore:e,onClick:t,isSelected:n}){return d.jsx($e,{level:n?"high":"low",className:ke("p-4 cursor-pointer transition-all duration-150 hover:bg-surface-container-high hover:shadow-[inset_3px_0_0_var(--primary)] rounded-lg","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",n&&"ring-1 ring-primary/30"),onClick:t,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())},tabIndex:0,role:"button","aria-label":`${bo(e.observation_type)} spore: ${Sp(e.content,nne)}`,"aria-pressed":n,children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("span",{className:ke("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold",v3(e.observation_type)),children:bo(e.observation_type)}),d.jsx("span",{className:ke("inline-flex items-center rounded-md px-2 py-0.5 text-xs font-semibold",p3(e.status)),children:bo(e.status)}),e.importance!==null&&d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.importance.toFixed(1)})]}),d.jsx(Rr,{content:e.content,compact:!0,className:"text-on-surface line-clamp-2"})]}),d.jsxs("div",{className:"shrink-0 text-right space-y-1",children:[e.session_id&&d.jsx("div",{className:"font-mono text-xs text-on-surface-variant",children:vl(e.session_id)}),d.jsx("div",{className:"font-sans text-xs text-on-surface-variant",children:lne(e.created_at)})]})]})})}function une(){return d.jsx($e,{level:"low",className:"p-4 rounded-lg",children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsxs("div",{className:"flex-1 space-y-2",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx("div",{className:"h-5 w-16 animate-pulse rounded bg-surface-container"}),d.jsx("div",{className:"h-5 w-14 animate-pulse rounded bg-surface-container"})]}),d.jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-surface-container"})]}),d.jsxs("div",{className:"shrink-0 space-y-1",children:[d.jsx("div",{className:"h-3 w-14 animate-pulse rounded bg-surface-container"}),d.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-surface-container"})]})]})})}function cne({onSelectSpore:e,selectedSporeId:t}){const{searchInput:n,debouncedSearch:r,filterValues:a,offset:i,setOffset:l,handleSearchChange:o,handleFilterChange:f,activeFilter:c}=Fd({initialFilters:{type:tr,status:tr}}),h=c("type"),p=c("status"),{data:m,isLoading:y,isError:x,error:b}=Wte({type:h,status:p,search:r,limit:Yr,offset:i}),w=(m==null?void 0:m.spores)??[],S=(m==null?void 0:m.total)??0;return d.jsxs("div",{className:"space-y-3",children:[d.jsx(Id,{searchPlaceholder:"Search spores...",searchValue:n,onSearchChange:o,filters:sne,filterValues:a,onFilterChange:f}),x?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load spores"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:b instanceof Error?b.message:"Unknown error"})]}):d.jsx("div",{className:"space-y-2",children:y?[1,2,3,4,5].map(N=>d.jsx(une,{},N)):w.length===0?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(eI,{className:"h-8 w-8 opacity-30"}),d.jsx("span",{className:"font-sans text-sm",children:S===0&&!r&&!h&&!p?"No spores yet":"No matching spores"}),S===0&&!r&&!h&&!p&&d.jsx("span",{className:"font-sans text-xs",children:"Spores are extracted from session activity by the agent"})]}):w.map(N=>d.jsx(one,{spore:N,onClick:()=>e(N),isSelected:N.id===t},N.id))}),d.jsx(kc,{total:S,offset:i,limit:Yr,onPageChange:l})]})}const fne=12,qA=8;function dne({type:e}){return d.jsx("span",{className:ke("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold",v3(e)),children:bo(e)})}function hne({status:e}){return d.jsx("span",{className:ke("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold",p3(e)),children:bo(e)})}function qf({label:e,value:t,children:n}){return d.jsxs("div",{className:"flex items-start justify-between gap-3 py-1.5",children:[d.jsx("span",{className:"shrink-0 font-sans text-xs text-on-surface-variant",children:e}),n??d.jsx("span",{className:"font-mono text-xs text-on-surface text-right break-all",children:t})]})}function vne({id:e,onBack:t,onNavigateToSpore:n,onNavigateToGraph:r}){const a=Wa(),{data:i,isLoading:l,isError:o,error:f}=Zte(e);if(l)return d.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(jn,{className:"h-5 w-5 animate-spin"}),d.jsx("span",{className:"font-sans",children:"Loading spore..."})]});if(o||!i)return d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Spore not found"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:f instanceof Error?f.message:"Unknown error"})]});const c=(()=>{if(!i.tags)return[];if(i.tags.startsWith("["))try{return JSON.parse(i.tags)}catch{}return i.tags.split(",").map(h=>h.trim()).filter(Boolean)})();return d.jsxs("div",{className:"space-y-6",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),"Spores"]}),d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsx(dne,{type:i.observation_type}),d.jsx(hne,{status:i.status}),i.importance!==null&&d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Importance: ",d.jsx("span",{className:"text-on-surface font-medium",children:i.importance.toFixed(1)})]}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant ml-auto",children:wi(i.created_at)})]}),d.jsxs($e,{level:"low",className:"p-5",children:[d.jsx(St,{className:"mb-2",children:"Observation"}),d.jsx(Rr,{content:i.content})]}),i.context&&d.jsxs($e,{level:"low",className:"p-5",children:[d.jsx(St,{className:"mb-2",children:"Context"}),d.jsx(Rr,{content:i.context})]}),c.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.map(h=>d.jsx("span",{className:"inline-flex items-center rounded-full bg-surface-container px-2.5 py-0.5 font-sans text-xs text-on-surface-variant",children:h},h))}),(i.predecessor_id||i.successor_id)&&d.jsxs($e,{level:"low",className:"p-5 space-y-2",children:[d.jsx(St,{children:"Resolution History"}),i.predecessor_id&&d.jsxs("div",{className:"flex items-center gap-2 font-sans text-xs text-on-surface-variant",children:[d.jsx("span",{children:"Supersedes"}),d.jsxs("button",{className:"font-mono text-primary hover:underline flex items-center gap-1",onClick:()=>n==null?void 0:n(i.predecessor_id),children:[i.predecessor_id.slice(0,qA),d.jsx(Tb,{className:"h-3 w-3"})]})]}),i.successor_id&&d.jsxs("div",{className:"flex items-center gap-2 font-sans text-xs text-on-surface-variant",children:[d.jsx("span",{children:"Superseded by"}),d.jsxs("button",{className:"font-mono text-primary hover:underline flex items-center gap-1",onClick:()=>n==null?void 0:n(i.successor_id),children:[i.successor_id.slice(0,qA),d.jsx(Tb,{className:"h-3 w-3"})]})]})]}),d.jsxs($e,{glass:!0,className:"p-5",children:[d.jsx(St,{className:"mb-2",children:"Metadata"}),d.jsxs("div",{className:"text-sm",children:[d.jsx(qf,{label:"ID",value:i.id}),d.jsx(qf,{label:"Created",value:Gb(i.created_at)}),d.jsx(qf,{label:"Updated",value:Gb(i.updated_at)}),i.session_id&&d.jsx(qf,{label:"Session",children:d.jsxs("button",{className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",onClick:()=>a(`/sessions/${i.session_id}`),children:[i.session_id.slice(0,fne),d.jsx(Gp,{className:"h-3 w-3"})]})}),i.agent_id&&d.jsx(qf,{label:"Agent",value:i.agent_id})]})]})]})}const ob=200,pne={1500:"T1500 — Compact",5e3:"T5000 — Standard",1e4:"T10000 — Full"};function mne(e){return pne[e]??`T${e}`}function gne({tier:e}){const[t,n]=j.useState(!1),r=e.content.length>ob,a=r&&!t?e.content.slice(0,ob)+"…":e.content;return d.jsxs($e,{level:"low",className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[d.jsx("span",{className:"font-mono text-sm text-on-surface font-medium",children:mne(e.tier)}),d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Generated ",wi(e.generated_at)]})]}),d.jsx(Rr,{content:a}),r&&d.jsx(Ae,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-xs text-on-surface-variant",onClick:()=>n(!t),children:t?d.jsxs(d.Fragment,{children:[d.jsx(Rz,{className:"h-3 w-3"}),"Show less"]}):d.jsxs(d.Fragment,{children:[d.jsx($a,{className:"h-3 w-3"}),"Show more (",e.content.length-ob," more chars)"]})})]})}function yne(){return d.jsxs($e,{level:"low",className:"p-5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-surface-container"}),d.jsx("div",{className:"h-3 w-20 animate-pulse rounded bg-surface-container"})]}),d.jsxs("div",{className:"space-y-2 mt-3",children:[d.jsx("div",{className:"h-3 animate-pulse rounded bg-surface-container"}),d.jsx("div",{className:"h-3 w-4/5 animate-pulse rounded bg-surface-container"}),d.jsx("div",{className:"h-3 w-3/5 animate-pulse rounded bg-surface-container"})]})]})}function xne({agentId:e}){const{data:t,isLoading:n,isError:r,error:a}=tne(e),i=(t==null?void 0:t.tiers)??[];return n?d.jsx("div",{className:"space-y-4",children:[1,2,3].map(l=>d.jsx(yne,{},l))}):r?d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-destructive",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load digest"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:a instanceof Error?a.message:"Unknown error"})]}):i.length===0?d.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(Iz,{className:"h-8 w-8 opacity-30"}),d.jsx("span",{className:"font-sans text-sm",children:"No digest generated yet"}),d.jsx("span",{className:"font-sans text-xs text-center max-w-xs",children:"Run the agent with the digest-only task to synthesize your vault knowledge into context extracts."})]}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:[i.length," tier",i.length!==1?"s":""," — pre-computed context extracts at different token budgets."]}),i.map(l=>d.jsx(gne,{tier:l},l.tier))]})}const ub=new Set(["concept","component","bug","tool","file","spore","session","other"]),bne=200,VA="right-[332px]",wne=6,Sne="h-[calc(100vh-285px)]",Ene=[{id:"graph",label:"Graph"},{id:"spores",label:"Spores"},{id:"digest",label:"Digest"}],m3="tab",g3="spore",Cne=new Set(["graph","spores","digest"]);function HA(){const e=new URLSearchParams(window.location.search),t=e.get(m3),n=e.get(g3)??void 0;return{tab:n?"spores":t&&Cne.has(t)?t:"graph",sporeId:n}}function Nne(e,t){const n=new URLSearchParams;e!=="graph"&&n.set(m3,e),t&&n.set(g3,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.pushState(null,"",a)}function GA(e){if(!e)return[];const t=[];return"center"in e&&e.center&&t.push(e.center),e.nodes&&t.push(...e.nodes),t}function kne({onNavigateToSpore:e}){var le,ye;const[t,n]=j.useState("focus"),[r,a]=j.useState(null),[i,l]=j.useState(2),[o,f]=j.useState(new Set(ub)),[c,h]=j.useState(""),[p,m]=j.useState(null),[y,x]=j.useState([]),{data:b,isLoading:w}=ene(),S=t==="focus"&&r!==null,N=t==="global",{data:E,isLoading:T}=Jte(N||c.length>0),{data:R,isLoading:A}=UA(r??void 0,i,S),D=p!==null&&p.id!==r,{data:_,isLoading:L}=UA(p==null?void 0:p.id,1,D),M=t==="global"?E:R,z=t==="global"?T:w||S&&A,B=(((le=E==null?void 0:E.nodes)==null?void 0:le.length)??0)>bne;j.useEffect(()=>{if(!r&&(b!=null&&b.recommended_id)){const ne=b.seeds.find(W=>W.id===b.recommended_id)??b.seeds[0];ne&&(a(ne.id),m(ne),x([ne]))}},[r,b]),j.useEffect(()=>{var ne;t==="focus"&&r&&((ne=R==null?void 0:R.center)==null?void 0:ne.id)===r&&(m(R.center),x(W=>{if(W.length===0)return[R.center];const J=W[W.length-1];return(J==null?void 0:J.id)===R.center.id?[...W.slice(0,-1),R.center]:W}))},[r,R,t]);const H=(p==null?void 0:p.id)===r?R:_,G=(p==null?void 0:p.id)===r?A:L,U=j.useMemo(()=>GA(H),[H]),I=(H==null?void 0:H.edges)??[],V=j.useMemo(()=>GA(M),[M]);j.useMemo(()=>{const ne={};for(const W of V){const J=W.type.toLowerCase(),se=ub.has(J)?J:"other";ne[se]=(ne[se]??0)+1}return ne},[V]);const K=j.useMemo(()=>V.filter(ne=>{const W=ne.type.toLowerCase(),J=ub.has(W)?W:"other";return!!o.has(J)}),[V,o]),Q=j.useMemo(()=>{const ne=(M==null?void 0:M.edges)??[],W=new Set(K.map(J=>J.id));return ne.filter(J=>W.has(J.source_id)&&W.has(J.target_id))},[M==null?void 0:M.edges,K]);j.useCallback(ne=>{f(W=>{const J=new Set(W);return J.has(ne)?J.delete(ne):J.add(ne),J})},[]);const F=j.useCallback((ne,W="canvas")=>{if(m(ne),!!ne){if(t==="focus"){a(J=>J===ne.id?J:(x(se=>[...se,ne].slice(-3)),ne.id));return}W==="inspector"&&(a(ne.id),n("focus"))}},[t]),q=j.useCallback(()=>{n("global")},[]),X=j.useCallback(()=>{!r&&p&&(x([p]),a(p.id)),n("focus")},[r,p]),P=j.useCallback(ne=>{x(W=>{const J=W.findIndex(se=>se.id===ne.id);return J>=0?W.slice(0,J+1):W}),a(ne.id),m(ne),n("focus")},[]),Z=j.useCallback(()=>{x(ne=>{if(ne.length<=1)return ne;const W=ne.slice(0,-1),J=W[W.length-1];return J&&(a(J.id),m(J),n("focus")),W})},[]),ae=j.useMemo(()=>{const ne=(E==null?void 0:E.nodes)??[];return ne.length>0?ne:V},[E==null?void 0:E.nodes,V]),ie=c?ae.filter((ne,W,J)=>J.findIndex(se=>se.id===ne.id)===W).filter(ne=>Js(ne.name).toLowerCase().includes(c.toLowerCase())).slice(0,wne):[];return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"rounded-lg border border-outline-variant/20 bg-surface-container/72 px-4 py-3 shadow-sm",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs("div",{className:"relative min-w-[260px] flex-1 max-w-[420px]",children:[d.jsx(pc,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-on-surface-variant/60"}),d.jsx(fn,{placeholder:"Find a node or idea...",value:c,onChange:ne=>h(ne.target.value),className:"h-9 pl-9"})]}),d.jsxs("div",{className:"flex rounded-lg border border-outline-variant/10 bg-surface-container-high p-1 shadow-sm",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",className:ke("h-8 px-3 gap-1.5 transition-all",t==="global"?"bg-surface-container-lowest text-primary shadow-sm":"text-on-surface-variant hover:text-on-surface"),onClick:q,children:[d.jsx(sD,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-xs font-medium",children:"Overview"})]}),d.jsxs(Ae,{variant:"ghost",size:"sm",disabled:!r&&!p,className:ke("h-8 px-3 gap-1.5 transition-all",t==="focus"?"bg-surface-container-lowest text-primary shadow-sm":"text-on-surface-variant hover:text-on-surface",!r&&!p&&"cursor-not-allowed opacity-50"),onClick:X,children:[d.jsx(rI,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-xs font-medium",children:"Focus"})]})]}),t==="focus"&&d.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-outline-variant/10 bg-surface-container-high p-1 shadow-sm",children:[d.jsx("span",{className:"px-2 font-mono text-[10px] uppercase tracking-wider text-on-surface-variant",children:"Depth"}),[1,2,3].map(ne=>d.jsx(Ae,{variant:"ghost",size:"sm",className:ke("h-7 min-w-7 rounded-md border px-2 font-mono text-[10px] transition-all",i===ne?"border-primary/40 bg-primary/15 text-primary shadow-sm font-bold":"border-transparent text-on-surface-variant hover:border-outline-variant/20 hover:text-on-surface"),onClick:()=>l(ne),children:ne},ne))]})]}),ie.length>0&&d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 pt-1",children:[d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-on-surface-variant",children:"Jump To"}),ie.map(ne=>d.jsx("button",{type:"button",onClick:()=>F(ne,"inspector"),className:ke("max-w-[220px] truncate rounded-full border px-3 py-1 text-[11px] transition-colors",(p==null?void 0:p.id)===ne.id?"border-primary/40 bg-primary/10 text-on-surface":"border-outline-variant/20 bg-surface-container-low/50 text-on-surface-variant hover:text-on-surface"),title:Js(ne.name),children:Js(ne.name)},ne.id))]}),c&&ie.length===0&&E&&d.jsxs("div",{className:"mt-3 border-t border-outline-variant/10 pt-3 text-sm text-on-surface-variant",children:['No graph nodes matched `"',c,'"`.']}),y.length>0&&d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 border-t border-outline-variant/10 pt-3",children:[d.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-on-surface-variant",children:"Trail"}),y.length>1&&d.jsx(Ae,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-[10px]",onClick:Z,children:"Back"}),y.map(ne=>d.jsx("button",{type:"button",onClick:()=>P(ne),className:ke("max-w-[180px] truncate rounded-full border px-3 py-1 text-[11px] transition-colors",r===ne.id?"border-primary/40 bg-primary/10 text-on-surface":"border-outline-variant/20 bg-surface-container-low/50 text-on-surface-variant hover:text-on-surface"),title:Js(ne.name),children:Js(ne.name)},ne.id))]})]}),d.jsxs("div",{className:ke("relative",Sne),children:[z&&d.jsx("div",{className:"absolute inset-0 z-30 flex items-center justify-center rounded-md bg-surface-container-lowest/50 backdrop-blur-[2px] transition-opacity",children:d.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"}),d.jsxs("span",{className:"text-xs font-mono animate-pulse text-on-surface-variant",children:["Cultivating ",t," graph..."]})]})}),d.jsx("div",{className:ke("absolute inset-y-3 left-3",p?VA:"right-3"),children:d.jsx(Gte,{nodes:K,edges:Q,onNodeSelect:F,selectedNode:p,centerId:t==="focus"?r:null,isLoading:z})}),t==="global"&&B&&d.jsxs("div",{className:ke("absolute bottom-3 left-3 z-10 flex max-w-[280px] flex-col items-start gap-2 rounded-lg border border-warning/20 bg-warning-container/80 p-3 text-on-warning-container shadow-lg backdrop-blur-sm",p?VA:"right-3"),children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(z1,{className:"h-4 w-4 shrink-0 text-warning"}),d.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",children:"Overview Snapshot"})]}),d.jsxs("p",{className:"text-[11px] leading-relaxed text-on-warning-container/80",children:["This overview still contains ",(ye=E==null?void 0:E.nodes)==null?void 0:ye.length," nodes. Use Focus mode for navigation and step through connections from the drawer."]}),d.jsx(Ae,{variant:"destructive",size:"sm",className:"mt-1 h-7 w-full px-3 text-[10px]",onClick:X,children:"Return to Focus"})]}),d.jsx(Kte,{node:p,edges:I,nodes:U,onClose:()=>m(null),onNodeSelect:F,onNavigateToSpore:e,isConnectionsLoading:G})]})]})}function Tne(){const e=La(),t=HA(),[n,r]=j.useState(t.tab),[a,i]=j.useState(t.sporeId?{id:t.sporeId}:null),l=j.useRef(!1),o=j.useRef(!1);j.useEffect(()=>{if(!l.current){l.current=!0;return}if(o.current){o.current=!1;return}Nne(n,a==null?void 0:a.id)},[n,a==null?void 0:a.id]),j.useEffect(()=>{o.current=!0;const m=HA();r(m.tab),i(m.sporeId?{id:m.sporeId}:null)},[e.search,e.key]);function f(m){i(m)}function c(){i(null)}function h(m){i({id:m})}function p(m){r(m),m!=="spores"&&i(null)}return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsx(Si,{title:"Mycelium",subtitle:"Derived intelligence — spores, entity graph, and synthesized context.",tabs:Ene,activeTab:n,onTabChange:m=>p(m)}),n==="graph"&&d.jsx(kne,{onNavigateToSpore:m=>{r("spores"),i({id:m})}}),n==="spores"&&(a?d.jsx(vne,{id:a.id,onBack:c,onNavigateToSpore:h}):d.jsx(cne,{onSelectSpore:f})),n==="digest"&&d.jsx(xne,{})]})}const jne=[{value:tr,label:"All statuses"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}];function Ane({status:e}){const t=g_(e);return d.jsx("span",{className:ke("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold",t==="default"?"bg-primary-container/20 text-primary":t==="destructive"?"bg-tertiary-container/20 text-tertiary":t==="warning"?"bg-secondary-container/20 text-secondary":"bg-surface-container-high text-on-surface-variant"),children:ww(e)})}function Rne(){return d.jsx("tr",{className:"border-b border-outline-variant/20",children:[200,80,100,80,80].map((e,t)=>d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:ke("h-4 animate-pulse rounded bg-surface-container"),style:{width:e}})},t))})}function Dne({run:e,onClick:t,taskNameMap:n}){const r=e.task?n.get(e.task)??e.task:x_;return d.jsxs("tr",{className:"border-b border-outline-variant/20 last:border-0 hover:bg-surface-container-high/50 cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Agent run: ${r}, status ${e.status}`,children:[d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Rd,{className:"h-3.5 w-3.5 shrink-0 text-on-surface-variant"}),d.jsx("span",{className:"text-sm font-medium text-on-surface truncate max-w-xs",children:r})]})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(Ane,{status:e.status})}),d.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:um(e.started_at)}),d.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:om(e.started_at,e.completed_at)}),d.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:kw(e.tokens_used)}),d.jsx("td",{className:"px-4 py-3 text-xs text-on-surface-variant font-mono",children:Nw(e.cost_usd)})]})}function Mne({onSelectRun:e,onTriggerRun:t}){const{searchInput:n,debouncedSearch:r,filterValues:a,offset:i,setOffset:l,handleSearchChange:o,handleFilterChange:f,activeFilter:c}=Fd({initialFilters:{status:tr,task:tr}}),{data:h}=Sc(),p=j.useMemo(()=>{const _=new Map;for(const L of(h==null?void 0:h.tasks)??[])_.set(L.name,L.displayName);return _},[h]),m=j.useMemo(()=>{const _=[{value:tr,label:"All tasks"}];for(const L of(h==null?void 0:h.tasks)??[])_.push({value:L.name,label:L.displayName});return _},[h]),y=j.useMemo(()=>[{key:"status",label:"Status",options:jne},{key:"task",label:"Task",options:m}],[m]),x=c("status"),b=c("task"),{data:w,isLoading:S,isError:N,error:E}=m_({limit:Yr,offset:i,search:r,status:x,task:b}),T=(w==null?void 0:w.runs)??[],R=(w==null?void 0:w.total)??0,A=d.jsx(Id,{searchPlaceholder:"Search runs...",searchValue:n,onSearchChange:o,filters:y,filterValues:a,onFilterChange:f}),D=d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-outline-variant/20 bg-surface-container/50",children:[d.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Task"}),d.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Status"}),d.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Started"}),d.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Duration"}),d.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Tokens"}),d.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-on-surface-variant uppercase tracking-widest font-sans",children:"Cost"})]})});return N?d.jsxs("div",{className:"space-y-4",children:[A,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load runs"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:E instanceof Error?E.message:"Unknown error"})]})]}):d.jsxs("div",{className:"space-y-4",children:[A,S?d.jsx("div",{className:"rounded-md bg-surface-container-low overflow-hidden",children:d.jsxs("table",{className:"w-full",children:[D,d.jsx("tbody",{children:[1,2,3].map(_=>d.jsx(Rne,{},_))})]})}):T.length===0?d.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 rounded-md bg-surface-container-low text-on-surface-variant",children:[d.jsx(Rd,{className:"h-10 w-10 opacity-30"}),d.jsxs("div",{className:"text-center font-sans",children:[d.jsx("p",{className:"text-sm",children:R===0&&!r&&!x&&!b?"No agent runs yet":"No matching runs"}),R===0&&!r&&!x&&!b&&d.jsx("p",{className:"text-xs mt-1",children:"Trigger the first run to see the agent at work"})]}),R===0&&!r&&!x&&!b&&d.jsxs(Ae,{variant:"outline",size:"sm",className:"gap-2 mt-2",onClick:t,children:[d.jsx(is,{className:"h-3.5 w-3.5"}),"Run Now"]})]}):d.jsx("div",{className:"rounded-md bg-surface-container-low overflow-hidden",children:d.jsxs("table",{className:"w-full","aria-label":"Agent runs",children:[D,d.jsx("tbody",{children:T.map(_=>d.jsx(Dne,{run:_,taskNameMap:p,onClick:()=>e(_.id)},_.id))})]})}),d.jsx(kc,{total:R,offset:i,limit:Yr,onPageChange:l})]})}function _ne({text:e}){const[t,n]=j.useState(!1),r=e.length>200||e.includes(`
|
|
834
|
+
`);return d.jsxs("div",{className:"mt-1",children:[d.jsx("div",{className:!t&&r?"line-clamp-2":void 0,children:d.jsx(Rr,{content:e,className:"text-on-surface-variant [&>*]:text-on-surface-variant"})}),r&&d.jsx("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors mt-1",onClick:()=>n(!t),children:t?d.jsxs(d.Fragment,{children:[d.jsx($a,{className:"h-3 w-3"})," Show less"]}):d.jsxs(d.Fragment,{children:[d.jsx(da,{className:"h-3 w-3"})," Show more"]})})]})}function One({phases:e}){return d.jsxs("div",{className:"space-y-3",children:[d.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface",children:"Phase Execution"}),e.map((t,n)=>d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-surface-container-high font-mono text-sm font-medium text-on-surface-variant shrink-0",children:n+1}),d.jsxs($e,{level:"default",className:"flex-1 p-3",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:t.name}),d.jsx(xt,{variant:g_(t.status),children:t.status})]}),d.jsxs("div",{className:"flex gap-3 font-mono text-xs text-on-surface-variant",children:[d.jsxs("span",{children:[t.turnsUsed," turns"]}),d.jsx("span",{children:kw(t.tokensUsed)}),d.jsx("span",{children:Nw(t.costUsd)})]})]}),t.summary&&d.jsx(_ne,{text:t.summary})]})]},t.name))]})}const $A=80,Lne=1e3;function Pne(e){const t=e.toLowerCase();return t.includes("extract")||t.includes("create")||t.includes("supersed")||t.includes("update")?"default":t.includes("skip")||t.includes("no-op")?"secondary":t.includes("error")||t.includes("fail")?"destructive":"default"}function Bne(e){return e===null?"—":new Date(e*Lne).toLocaleTimeString()}function zne(e,t){return e&&Sp(e,t)||"—"}function Ine({report:e}){const[t,n]=j.useState(!1),[r,a]=j.useState(!1),i=e.details!==null&&e.details.length>0,l=e.summary.length>200||e.summary.includes(`
|
|
835
|
+
`);let o=null;if(i)try{o=JSON.parse(e.details)}catch{o=e.details}return d.jsxs($e,{level:"low",className:"p-4 space-y-2",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx(xt,{variant:Pne(e.action),children:e.action}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:!r&&l?"line-clamp-3":void 0,children:d.jsx(Rr,{content:e.summary})}),l&&d.jsx("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors mt-1",onClick:()=>a(!r),children:r?d.jsxs(d.Fragment,{children:[d.jsx($a,{className:"h-3 w-3"})," Show less"]}):d.jsxs(d.Fragment,{children:[d.jsx(da,{className:"h-3 w-3"})," Show more"]})})]}),d.jsx("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:Bne(e.created_at)})]}),i&&d.jsxs("div",{children:[d.jsxs("button",{className:"flex items-center gap-1 font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",onClick:()=>n(!t),children:[t?d.jsx($a,{className:"h-3.5 w-3.5"}):d.jsx(da,{className:"h-3.5 w-3.5"}),t?"Hide details":"Show details"]}),t&&d.jsx("pre",{className:"mt-2 rounded-md bg-surface-container-lowest p-3 font-mono text-xs overflow-auto max-h-48 text-on-surface-variant",children:typeof o=="string"?o:JSON.stringify(o,null,2)})]})]})}function Fne({turn:e}){const[t,n]=j.useState(!1);let r=null;if(e.tool_input)try{r=JSON.parse(e.tool_input)}catch{r=e.tool_input}const a=e.tool_input?zne(e.tool_input,$A):"—",i=e.tool_input!==null&&e.tool_input.length>$A;return d.jsx("div",{className:"px-4 py-2.5 hover:bg-surface-container-high/30 transition-colors border-b border-outline-variant/10 last:border-b-0",children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("span",{className:"font-mono text-xs text-on-surface-variant w-5 shrink-0 pt-0.5 text-right",children:e.turn_number}),d.jsx("span",{className:"font-mono text-xs font-medium text-on-surface shrink-0 pt-0.5 min-w-[140px]",children:e.tool_name}),d.jsxs("div",{className:"flex-1 min-w-0",children:[i?d.jsxs("button",{className:"flex items-start gap-1 text-left font-mono text-xs text-on-surface-variant hover:text-on-surface transition-colors w-full",onClick:()=>n(!t),children:[t?d.jsx($a,{className:"h-3 w-3 mt-0.5 shrink-0"}):d.jsx(da,{className:"h-3 w-3 mt-0.5 shrink-0"}),d.jsx("span",{className:t?void 0:"truncate",children:a})]}):d.jsx("span",{className:"font-mono text-xs text-on-surface-variant truncate block",children:a}),t&&r!==null&&d.jsx("pre",{className:"mt-1.5 ml-4 rounded-md bg-surface-container-lowest p-2.5 font-mono text-xs overflow-auto max-h-48 text-on-surface-variant",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})]})})}function Une({runId:e,onBack:t}){var T;const[n,r]=j.useState(!1),{data:a,isLoading:i,isError:l}=AG(e),o=(T=a==null?void 0:a.run)==null?void 0:T.status,{data:f,isLoading:c}=RG(e,o),{data:h,isLoading:p}=DG(n?e:void 0,o),{data:m}=Sc(),y=j.useMemo(()=>(m==null?void 0:m.tasks)??[],[m]);if(i)return d.jsxs("div",{className:"flex h-64 items-center justify-center gap-2 text-on-surface-variant",children:[d.jsx(jn,{className:"h-5 w-5 animate-spin"}),d.jsx("span",{className:"font-sans",children:"Loading run..."})]});if(l||!(a!=null&&a.run))return d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),"Runs"]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Run not found"})]})]});const x=a.run,b=(f==null?void 0:f.reports)??[],w=h??[];let S=null,N,E;if(x.actions_taken)try{const R=JSON.parse(x.actions_taken);R!=null&&R.phases&&Array.isArray(R.phases)&&(S=R.phases),typeof(R==null?void 0:R.model)=="string"&&(N=R.model),typeof(R==null?void 0:R.provider)=="string"&&(E=R.provider)}catch{}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),"Runs"]}),d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[d.jsx(Yt,{label:"Status",value:ww(x.status),accent:"sage"}),d.jsx(Yt,{label:"Task",value:b_(x.task,y),accent:"outline"}),d.jsx(Yt,{label:"Started",value:um(x.started_at),accent:"outline"}),d.jsx(Yt,{label:"Duration",value:om(x.started_at,x.completed_at),accent:"outline"}),d.jsx(Yt,{label:"Tokens",value:kw(x.tokens_used),accent:"ochre"}),d.jsx(Yt,{label:"Cost",value:Nw(x.cost_usd),accent:"ochre"})]}),(N||E)&&d.jsxs("div",{className:"flex items-center gap-4 px-1",children:[E&&d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Provider: ",d.jsx("span",{className:"font-mono text-on-surface",children:E})]}),N&&d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Model: ",d.jsx("span",{className:"font-mono text-on-surface",children:N})]})]}),x.error&&d.jsx("div",{className:"rounded-md bg-tertiary/10 px-3 py-2",children:d.jsx("p",{className:"font-mono text-xs text-tertiary",children:x.error})}),S&&S.length>0&&d.jsx($e,{level:"low",className:"p-4",children:d.jsx(One,{phases:S})}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Decisions",b.length>0&&d.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[b.length," ",b.length===1?"action":"actions"]})]}),c?d.jsxs("div",{className:"flex items-center gap-2 text-on-surface-variant py-4",children:[d.jsx(jn,{className:"h-4 w-4 animate-spin"}),d.jsx("span",{className:"font-sans text-sm",children:"Loading decisions..."})]}):b.length===0?d.jsx($e,{level:"low",className:"flex h-24 items-center justify-center",children:d.jsx("span",{className:"font-sans text-sm text-on-surface-variant",children:"No decisions recorded for this run"})}):d.jsx("div",{className:"space-y-2",children:b.map(R=>d.jsx(Ine,{report:R},R.id))})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("button",{className:"flex items-center gap-2 font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide hover:text-on-surface transition-colors",onClick:()=>r(!n),children:[n?d.jsx($a,{className:"h-4 w-4"}):d.jsx(da,{className:"h-4 w-4"}),"Audit Trail",d.jsx("span",{className:"normal-case font-normal text-xs",children:"(diagnostics)"})]}),n&&d.jsxs($e,{level:"low",className:ke("overflow-hidden"),children:[d.jsx("div",{className:"p-4 pb-2",children:d.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface",children:"Turn-by-turn trace"})}),d.jsx("div",{className:"p-0",children:p?d.jsxs("div",{className:"flex items-center gap-2 text-on-surface-variant p-4",children:[d.jsx(jn,{className:"h-4 w-4 animate-spin"}),d.jsx("span",{className:"font-sans text-sm",children:"Loading turns..."})]}):w.length===0?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant p-4",children:"No turns recorded."}):d.jsx("div",{children:w.map(R=>d.jsx(Fne,{turn:R},R.id))})})]})]})]})}function qne(e){return e.displayName??e.name}function Vne({open:e,onOpenChange:t,onTriggered:n}){var w;const[r,a]=j.useState(void 0),[i,l]=j.useState(""),{data:o,isLoading:f}=Sc(),{mutate:c,isPending:h,error:p}=Cw(),m=(o==null?void 0:o.tasks)??[],y=m.find(S=>S.isDefault),x=r??(y==null?void 0:y.name)??((w=m[0])==null?void 0:w.name)??"";function b(){const S={task:x||void 0,instruction:i.trim()||void 0};c(S,{onSuccess:()=>{t(!1),a(void 0),l(""),n==null||n()}})}return d.jsx(Md,{open:e,onOpenChange:t,children:d.jsxs(yc,{className:"sm:max-w-md",children:[d.jsxs(_d,{children:[d.jsx(xc,{children:"Trigger Agent Run"}),d.jsx(tm,{children:"Run the Myco agent now. It will process unprocessed sessions and update the vault."})]}),d.jsxs("div",{className:"space-y-4 py-2",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Task"}),f?d.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[d.jsx(jn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):d.jsxs(vi,{value:x,onValueChange:a,children:[d.jsx(qa,{children:d.jsx(pi,{})}),d.jsx(Va,{children:m.map(S=>d.jsxs(Kr,{value:S.name,children:[qne(S),S.isDefault&&d.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant",children:"(default)"})]},S.name))})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:["Instruction",d.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:"(optional)"})]}),d.jsx("textarea",{className:"w-full rounded-md bg-surface-container-lowest px-3 py-2 font-sans text-sm text-on-surface placeholder:text-on-surface-variant/50 focus:outline-none focus:ring-2 focus:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50 resize-none",rows:3,placeholder:"E.g. Focus on gotchas from yesterday's sessions...",value:i,onChange:S=>l(S.target.value),disabled:h})]}),p&&d.jsx("p",{className:"font-sans text-xs text-tertiary",children:p instanceof Error?p.message:"Failed to trigger run"})]}),d.jsxs(em,{children:[d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>t(!1),disabled:h,children:"Cancel"}),d.jsx(Ae,{size:"sm",className:"gap-2",onClick:b,disabled:h,children:h?d.jsxs(d.Fragment,{children:[d.jsx(jn,{className:"h-3.5 w-3.5 animate-spin"}),"Starting..."]}):d.jsxs(d.Fragment,{children:[d.jsx(is,{className:"h-3.5 w-3.5"}),"Run Now"]})})]})]})})}function Hne(e){return!e.phases||e.phases.length===0?"Single query":`${e.phases.length} phases`}function Gne(e){return e===q1?"User":"Built-in"}function $ne({task:e,onClick:t}){return d.jsxs($e,{level:"low",interactive:!0,className:ke("p-4 space-y-2 transition-all",e.isDefault&&"ring-1 ring-primary/20 shadow-[inset_0_0_12px_rgba(171,207,184,0.08)]"),onClick:t,children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface truncate",children:e.displayName}),e.isDefault&&d.jsx(tI,{className:"h-3.5 w-3.5 text-primary shrink-0 fill-primary/30"})]}),e.description&&d.jsx("p",{className:"font-sans text-xs text-on-surface-variant mt-1 line-clamp-2",children:e.description})]}),d.jsx("div",{className:"flex items-center gap-2 shrink-0",children:d.jsx(xt,{variant:y_(e.source),children:Gne(e.source)})})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-on-surface-variant",children:[d.jsx(qz,{className:"h-3 w-3"}),d.jsx("span",{className:"font-mono text-xs",children:Hne(e)})]}),e.model&&d.jsx("span",{className:"font-mono text-xs text-on-surface-variant/70 truncate max-w-[160px]",children:e.model}),e.maxTurns!==void 0&&d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant/70",children:["max ",e.maxTurns," turns"]})]})]})}function Kne({onSelect:e}){const{data:t,isLoading:n}=Sc(),r=(t==null?void 0:t.tasks)??[];return n?d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:Array.from({length:3}).map((a,i)=>d.jsx("div",{className:"h-28 rounded-md animate-pulse bg-surface-container-low"},i))}):r.length===0?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No tasks found."}):d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:r.map(a=>d.jsx($ne,{task:a,onClick:()=>e(a.name)},a.name))})}const Yne=new Set(["instruction"]),Xne={session_id:"Session ID"},Qne={session_id:"e.g. 36858a44-4ef7-4448-96e8-382e992e8ba4"};function Wne(e){const t=e.matchAll(/\{\{(\w+)\}\}/g),n=new Set;for(const r of t){const a=r[1];Yne.has(a)||n.add(a)}return[...n]}function KA(e){return Xne[e]??e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function Zne({task:e,onRunTriggered:t,onDeleted:n,onCustomized:r}){const a=Cw(),i=_G(),l=OG(),[o,f]=j.useState(!1),[c,h]=j.useState({}),[p,m]=j.useState(""),y=j.useMemo(()=>Wne(e.prompt??""),[e.prompt]),x=y.length>0;function b(){var T;const S=[];for(const R of y){const A=(T=c[R])==null?void 0:T.trim();A&&S.push(`${R}: ${A}`)}const N=p.trim();N&&S.push(N);const E=S.length>0?S.join(`
|
|
836
|
+
`):void 0;a.mutate({task:e.name,instruction:E},{onSuccess:R=>{f(!1),h({}),m(""),t==null||t(R.runId)}})}function w(S,N){h(E=>({...E,[S]:N}))}return d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ae,{size:"sm",onClick:()=>{f(!0)},children:"Run Now"}),e.source===mI&&d.jsx(Ae,{variant:"outline",size:"sm",onClick:()=>i.mutate({taskId:e.name},{onSuccess:S=>{var E;const N=(E=S==null?void 0:S.task)==null?void 0:E.name;N&&r&&r(N)}}),children:"Customize"}),e.source===q1&&d.jsx(Ae,{variant:"destructive",size:"sm",onClick:()=>{l.mutate(e.name,{onSuccess:()=>n==null?void 0:n()})},children:"Delete"}),d.jsx(Md,{open:o,onOpenChange:f,children:d.jsxs(yc,{className:"sm:max-w-md",children:[d.jsx(_d,{children:d.jsxs(xc,{children:["Run ",e.displayName]})}),d.jsxs("div",{className:"space-y-4 py-2",children:[y.map(S=>d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:KA(S)}),d.jsx(fn,{value:c[S]??"",onChange:N=>w(S,N.target.value),placeholder:Qne[S]??`Enter ${KA(S).toLowerCase()}`,className:"font-mono",autoFocus:y.indexOf(S)===0})]},S)),d.jsxs("div",{className:"space-y-1",children:[d.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:["Instruction",d.jsx("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:"(optional)"})]}),d.jsx("textarea",{className:"w-full rounded-md bg-surface-container-lowest border border-[var(--ghost-border)] px-3 py-2 font-sans text-sm text-on-surface placeholder:text-on-surface-variant/50 focus:outline-none focus:border-primary/40 resize-none",rows:2,placeholder:"Additional instructions for this run...",value:p,onChange:S=>m(S.target.value),disabled:a.isPending})]})]}),d.jsxs(em,{children:[d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>f(!1),children:"Cancel"}),d.jsxs(Ae,{size:"sm",disabled:a.isPending,onClick:b,className:"gap-2",children:[a.isPending?d.jsx(jn,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(is,{className:"h-3.5 w-3.5"}),"Run"]})]})]})})]})}const Jne=20;function ere({taskId:e,onSaved:t}){const{data:n,isLoading:r,isError:a}=LG(e),i=PG(),[l,o]=j.useState(""),[f,c]=j.useState(!1);j.useEffect(()=>{n!=null&&n.yaml&&(o(n.yaml),c(!1))},[n==null?void 0:n.yaml]);function h(x){o(x),c(!0)}function p(){i.mutate({taskId:e,yaml:l},{onSuccess:()=>{c(!1),t==null||t()}})}function m(){n!=null&&n.yaml&&(o(n.yaml),c(!1))}if(r)return d.jsx("div",{className:"h-64 animate-pulse rounded-md bg-surface-container-low"});if(a)return d.jsx("div",{className:"rounded-md bg-tertiary-container/20 p-4 font-sans text-sm text-tertiary",children:"Failed to load task YAML."});const y=(n==null?void 0:n.source)!=="user";return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Task Definition ",y&&"(read-only)"]}),!y&&d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ae,{variant:"ghost",size:"sm",onClick:m,disabled:!f,children:"Reset"}),d.jsx(Ae,{size:"sm",onClick:p,disabled:!f||i.isPending,children:i.isPending?"Saving...":"Save"})]})]}),d.jsx("textarea",{value:l,onChange:x=>h(x.target.value),readOnly:y,rows:Jne,spellCheck:!1,className:`w-full rounded-md bg-surface-container-lowest p-4 font-mono text-sm text-on-surface leading-relaxed resize-y focus:outline-none focus:ring-2 focus:ring-primary/40 ${y?"opacity-75 cursor-not-allowed":""}`}),i.isError&&d.jsx("div",{className:"rounded-md bg-tertiary-container/20 p-3 font-sans text-sm text-tertiary",children:i.error.message}),i.isSuccess&&!f&&d.jsx("div",{className:"rounded-md bg-primary-container/20 p-3 font-sans text-sm text-primary",children:"Task saved successfully."})]})}function ns({checked:e,onCheckedChange:t,disabled:n}){return d.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:n,onClick:()=>t(!e),className:`relative inline-flex h-6 w-11 shrink-0 rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 ${n?"cursor-not-allowed opacity-50":"cursor-pointer"} ${e?"bg-primary":"bg-surface-container-high"}`,children:d.jsx("span",{className:`pointer-events-none block h-5 w-5 rounded-full bg-on-surface shadow-lg ring-0 transition-transform ${e?"translate-x-5":"translate-x-0"}`})})}const tre={anthropic:"Anthropic",ollama:"Ollama",lmstudio:"LM Studio"},nre={anthropic:_z,ollama:Qz,lmstudio:aD};function oS({providerType:e,model:t,baseUrl:n,contextLength:r,modelPlaceholder:a,providers:i,isLoadingProviders:l,onProviderChange:o,onModelChange:f,onBaseUrlChange:c,onContextLengthChange:h}){const p=i.find(b=>b.type===e),m=e==="ollama"||e==="lmstudio",y=e!=="",x=(p==null?void 0:p.models)??[];return d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"grid grid-cols-3 gap-2",children:i.map(b=>{const w=nre[b.type];if(!w)return null;const S=e===b.type;return d.jsxs("button",{onClick:()=>o(b.type),className:`
|
|
837
|
+
flex flex-col items-center gap-1.5 rounded-md border px-3 py-2.5 transition-colors
|
|
838
|
+
${S?"border-primary/40 bg-primary/5 text-on-surface":"border-[var(--ghost-border)] bg-surface-container-lowest text-on-surface-variant hover:border-primary/20"}
|
|
839
|
+
`,children:[d.jsx(w,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-xs font-medium",children:tre[b.type]??b.type}),!l&&d.jsx(xt,{variant:b.available?"secondary":"destructive",className:"text-[10px] px-1.5 py-0",children:b.available?"online":"offline"})]},b.type)})}),m&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Base URL"}),d.jsx(fn,{value:n,onChange:b=>c(b.target.value),placeholder:(p==null?void 0:p.baseUrl)??""})]}),m&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Context Length"}),d.jsx(fn,{type:"number",value:r,onChange:b=>h(b.target.value),placeholder:"32768 (default)"}),d.jsx("p",{className:"font-sans text-[11px] text-on-surface-variant/70",children:"Leave blank to use the 32K default. Myco creates a Modelfile variant at this size so the model loads at the size you asked for, not its (much larger) native default."})]}),y&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),x.length>0?d.jsxs(vi,{value:t,onValueChange:f,children:[d.jsx(qa,{children:d.jsx(pi,{placeholder:a??"Select a model"})}),d.jsx(Va,{children:x.map(b=>d.jsx(Kr,{value:b,children:d.jsx("span",{className:"font-mono text-sm",children:b})},b))})]}):d.jsx(fn,{value:t,onChange:b=>f(b.target.value),placeholder:(p==null?void 0:p.available)===!1?"Provider offline":"Enter model name",disabled:(p==null?void 0:p.available)===!1})]})]})}const y3=3e4;function rre(e){return qt({queryKey:["task-config",e],queryFn:({signal:t})=>lt(`/agent/tasks/${e}/config`,{signal:t}),enabled:e!==void 0,staleTime:y3})}function x3(){return qt({queryKey:["providers"],queryFn:({signal:e})=>lt("/providers",{signal:e}),staleTime:y3})}function b3(){return fr({mutationFn:e=>Qt("/providers/test",e)})}function are(){const e=Sn();return fr({mutationFn:({taskId:t,config:n})=>mc(`/agent/tasks/${t}/config`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["task-config",n.taskId]})}})}function ire({phase:e,override:t,taskModel:n,providers:r,isLoadingProviders:a,onChange:i}){var c,h,p,m;const[l,o]=j.useState(!1),f=t.provider!==void 0||t.model!==void 0||t.maxTurns!==void 0;return d.jsxs("div",{className:"border border-[var(--ghost-border)] rounded-md",children:[d.jsxs("button",{onClick:()=>o(!l),className:"flex items-center gap-2 w-full px-3 py-2 text-left hover:bg-surface-container-low/50 transition-colors rounded-md",children:[l?d.jsx($a,{className:"h-3.5 w-3.5 text-on-surface-variant"}):d.jsx(da,{className:"h-3.5 w-3.5 text-on-surface-variant"}),d.jsx("span",{className:"font-sans text-sm text-on-surface",children:e.name}),d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant",children:["max ",t.maxTurns??e.maxTurns," turns"]}),f&&d.jsx(xt,{variant:"secondary",className:"text-[10px] ml-auto",children:"override"})]}),l&&d.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-[var(--ghost-border)]",children:[d.jsx("div",{className:"pt-3",children:d.jsx(oS,{providerType:((c=t.provider)==null?void 0:c.type)??"anthropic",model:((h=t.provider)==null?void 0:h.model)??t.model??"",baseUrl:((p=t.provider)==null?void 0:p.base_url)??"",contextLength:((m=t.provider)==null?void 0:m.context_length)!=null?String(t.provider.context_length):"",modelPlaceholder:e.model??n,providers:r,isLoadingProviders:a,onProviderChange:y=>{var b;const x=(b=r.find(w=>w.type===y))==null?void 0:b.baseUrl;i({...t,provider:{type:y,base_url:x},model:void 0})},onModelChange:y=>i({...t,provider:t.provider?{...t.provider,model:y}:void 0,model:t.provider?void 0:y}),onBaseUrlChange:y=>i({...t,provider:t.provider?{...t.provider,base_url:y}:void 0}),onContextLengthChange:y=>i({...t,provider:t.provider?{...t.provider,context_length:y?Number(y):void 0}:void 0})})}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),d.jsx(fn,{type:"number",value:t.maxTurns??"",onChange:y=>i({...t,maxTurns:y.target.value?Number(y.target.value):void 0}),placeholder:String(e.maxTurns)})]}),f&&d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>i(null),className:"text-xs text-on-surface-variant",children:"Clear Phase Override"})]})]})}const sre=["active","idle","sleep"],lre={active:"Active",idle:"Idle",sleep:"Sleep"};function ore({taskId:e,phases:t,defaults:n,schedule:r,params:a}){const{data:i,isPending:l}=x3(),{data:o}=rre(e),f=b3(),c=are(),h=o==null?void 0:o.config,[p,m]=j.useState("anthropic"),[y,x]=j.useState(""),[b,w]=j.useState(""),[S,N]=j.useState(""),[E,T]=j.useState(""),[R,A]=j.useState(""),[D,_]=j.useState({}),[L,M]=j.useState({}),[z,B]=j.useState({}),[H,G]=j.useState(!1);j.useEffect(()=>{var P,Z,ae,ie;h&&(m(((P=h.provider)==null?void 0:P.type)??"anthropic"),x(((Z=h.provider)==null?void 0:Z.model)??h.model??""),w(((ae=h.provider)==null?void 0:ae.base_url)??""),N(((ie=h.provider)==null?void 0:ie.context_length)!=null?String(h.provider.context_length):""),T(h.maxTurns!=null?String(h.maxTurns):""),A(h.timeoutSeconds!=null?String(h.timeoutSeconds):""),_(h.phases??{}),M(h.schedule??{}),B(h.params??{}),G(!1))},[h]);const U=L.enabled??(r==null?void 0:r.enabled)??!1,I=L.runIn??(r==null?void 0:r.runIn)??[],V=(i==null?void 0:i.providers)??[];function K(P){var ae;const Z=V.find(ie=>ie.type===P);m(P),x(((ae=Z==null?void 0:Z.models)==null?void 0:ae[0])??""),w((Z==null?void 0:Z.baseUrl)??""),N(""),G(!0),f.reset()}function Q(P,Z){_(ae=>{const ie={...ae};return Z===null?delete ie[P]:ie[P]=Z,ie}),G(!0)}function F(){const P=p==="ollama"||p==="lmstudio",Z={type:p,...y?{model:y}:{},...P&&b?{base_url:b}:{},...P&&S?{context_length:Number(S)}:{}},ae=r?Object.keys(L).length>0?{schedule:L}:{schedule:null}:{},ie=a&&Object.keys(z).length>0?{params:z}:{};c.mutate({taskId:e,config:{provider:Z,...E?{maxTurns:Number(E)}:{maxTurns:null},...R?{timeoutSeconds:Number(R)}:{timeoutSeconds:null},...Object.keys(D).length>0?{phases:D}:{phases:null},...ae,...ie}},{onSuccess:()=>G(!1)})}function q(){c.mutate({taskId:e,config:{provider:null,model:null,maxTurns:null,timeoutSeconds:null,phases:null,schedule:null,params:null}},{onSuccess:()=>{m("anthropic"),x(""),w(""),N(""),T(""),A(""),_({}),M({}),B({}),G(!1)}})}function X(){const Z={type:p,...(p==="ollama"||p==="lmstudio")&&b?{base_url:b}:{}};f.mutate(Z)}return d.jsxs($e,{level:"low",className:"p-4 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Task Config"}),h&&d.jsx(Ae,{variant:"ghost",size:"sm",onClick:q,className:"text-xs text-on-surface-variant",children:"Clear All Overrides"})]}),d.jsx(oS,{providerType:p,model:y,baseUrl:b,contextLength:S,modelPlaceholder:n==null?void 0:n.model,providers:V,isLoadingProviders:l,onProviderChange:K,onModelChange:P=>{x(P),G(!0)},onBaseUrlChange:P=>{w(P),G(!0)},onContextLengthChange:P=>{N(P),G(!0)}}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),d.jsx(fn,{type:"number",value:E,onChange:P=>{T(P.target.value),G(!0)},placeholder:(n==null?void 0:n.maxTurns)!=null?String(n.maxTurns):"—"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout (seconds)"}),d.jsx(fn,{type:"number",value:R,onChange:P=>{A(P.target.value),G(!0)},placeholder:(n==null?void 0:n.timeoutSeconds)!=null?String(n.timeoutSeconds):"—"})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:X,disabled:f.isPending,className:"gap-1.5 text-on-surface-variant",children:[f.isPending?d.jsx(jn,{className:"h-3.5 w-3.5 animate-spin"}):d.jsx(oI,{className:"h-3.5 w-3.5"}),"Test"]}),f.isSuccess&&d.jsx("span",{className:"flex items-center gap-1 text-xs",children:f.data.ok?d.jsxs(d.Fragment,{children:[d.jsx(vc,{className:"h-3.5 w-3.5 text-green-500"}),d.jsxs("span",{className:"text-green-500 font-mono",children:[f.data.latency_ms,"ms"]})]}):d.jsxs(d.Fragment,{children:[d.jsx(zu,{className:"h-3.5 w-3.5 text-red-400"}),d.jsx("span",{className:"text-red-400",children:f.data.error})]})}),d.jsx("div",{className:"flex-1"}),d.jsxs(Ae,{size:"sm",onClick:F,disabled:!H||c.isPending,className:"gap-1.5",children:[c.isPending&&d.jsx(jn,{className:"h-3.5 w-3.5 animate-spin"}),"Save"]})]}),r&&d.jsxs("div",{className:"space-y-3 pt-2 border-t border-[var(--ghost-border)]",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(rD,{className:"h-3.5 w-3.5 text-on-surface-variant"}),d.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Scheduling"}),d.jsx(xt,{variant:U?"secondary":"outline",className:"text-[10px] px-1.5 py-0",children:U?"active":"off"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface",children:"Auto-run"}),d.jsx("p",{className:"font-sans text-[11px] text-on-surface-variant",children:"Automatically run this task on a schedule"})]}),d.jsx(ns,{checked:U,onCheckedChange:P=>{M(Z=>({...Z,enabled:P})),G(!0)}})]}),U&&d.jsxs("div",{className:"space-y-3 pl-0.5",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Run every (seconds)"}),d.jsx(fn,{type:"number",min:10,value:L.intervalSeconds??"",onChange:P=>{const Z=P.target.value;M(ae=>({...ae,intervalSeconds:Z?Number(Z):void 0})),G(!0)},placeholder:r.intervalSeconds!=null?String(r.intervalSeconds):"300"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"font-sans text-xs text-on-surface-variant",children:"Run in states"}),d.jsx("div",{className:"flex gap-2",children:sre.map(P=>{const Z=I.includes(P);return d.jsx("button",{onClick:()=>{const ae=Z?I.filter(ie=>ie!==P):[...I,P];M(ie=>({...ie,runIn:ae.length>0?ae:void 0})),G(!0)},className:`
|
|
840
|
+
rounded-md border px-3 py-1.5 font-sans text-xs font-medium transition-colors
|
|
841
|
+
${Z?"border-primary/40 bg-primary/5 text-on-surface":"border-[var(--ghost-border)] bg-surface-container-lowest text-on-surface-variant hover:border-primary/20"}
|
|
842
|
+
`,children:lre[P]},P)})})]})]})]}),a&&Object.keys(a).length>0&&d.jsxs("div",{className:"space-y-3 pt-2 border-t border-[var(--ghost-border)]",children:[d.jsx("h3",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Parameters"}),Object.entries(a).map(([P,Z])=>{const ae=z[P],ie=ae??Z,le=P.replace(/_/g," ").replace(/\b\w/g,ye=>ye.toUpperCase());return typeof Z=="boolean"?d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"font-sans text-sm text-on-surface",children:le}),d.jsx(ns,{checked:ie,onCheckedChange:ye=>{B(ne=>({...ne,[P]:ye})),G(!0)}})]},P):d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm text-on-surface",children:le}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(fn,{type:typeof Z=="number"?"number":"text",value:ae!=null?String(ae):"",placeholder:String(Z),onChange:ye=>{const ne=typeof Z=="number"?ye.target.value===""?void 0:Number(ye.target.value):ye.target.value;B(ne===void 0?W=>{const J={...W};return delete J[P],J}:W=>({...W,[P]:ne})),G(!0)},className:"w-40 font-mono"}),d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["default: ",String(Z)]})]})]},P)})]}),t&&t.length>0&&d.jsxs("div",{className:"space-y-2 pt-2 border-t border-[var(--ghost-border)]",children:[d.jsx("h3",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:"Per-Phase Overrides"}),t.map(P=>d.jsx(ire,{phase:P,override:D[P.name]??{},taskModel:y||"claude-sonnet-4-6",providers:V,isLoadingProviders:l,onChange:Z=>Q(P.name,Z)},P.name))]})]})}const ure=3;function cre(e){var t,n,r;return{model:((t=e.execution)==null?void 0:t.model)??e.model,maxTurns:((n=e.execution)==null?void 0:n.maxTurns)??e.maxTurns,timeoutSeconds:((r=e.execution)==null?void 0:r.timeoutSeconds)??e.timeoutSeconds}}function fre(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),d.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[d.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-8 w-32 animate-pulse rounded bg-surface-container-high"})]}),d.jsx("div",{className:"rounded-md bg-surface-container-low p-4 space-y-2",children:Array.from({length:ure}).map((e,t)=>d.jsx("div",{className:"h-5 animate-pulse rounded bg-surface-container-high"},t))})]})}function dre({phase:e,index:t}){return d.jsxs($e,{level:"low",className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-surface-container-high font-mono text-xs font-semibold text-on-surface-variant shrink-0",children:t+1}),d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface",children:e.name}),!e.required&&d.jsx(xt,{variant:"secondary",children:"optional"})]}),d.jsxs("span",{className:"font-mono text-xs text-on-surface-variant shrink-0",children:["max ",e.maxTurns," turns"]})]}),e.tools.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:e.tools.map(n=>d.jsx("span",{className:"font-mono text-xs px-1.5 py-0.5 rounded-sm bg-surface-container-high text-on-surface-variant",children:n},n))}),d.jsx($e,{level:"lowest",className:"p-3 overflow-auto max-h-40",children:d.jsx(Rr,{content:e.prompt})})]})}function hre({taskId:e,onBack:t,onNavigate:n,onRunTriggered:r}){const{data:a,isPending:i,isError:l}=MG(e);if(i)return d.jsx(fre,{});if(l||!(a!=null&&a.task))return d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),"Tasks"]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Task not found"})]})]});const o=a.task,f=o.phases??[],c=cre(o);return d.jsxs("div",{className:"space-y-6",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),"Tasks"]}),d.jsxs($e,{level:"low",className:"p-4 space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[d.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[d.jsx("h1",{className:"font-serif text-lg text-on-surface",children:o.displayName}),o.description&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:o.description})]}),d.jsx(xt,{variant:y_(o.source),className:"shrink-0",children:ww(o.source??"built-in")})]}),d.jsx(Zne,{task:o,onDeleted:t,onCustomized:h=>n==null?void 0:n(h),onRunTriggered:r})]}),d.jsx(ore,{taskId:e,phases:f,defaults:{model:c.model,maxTurns:c.maxTurns,timeoutSeconds:c.timeoutSeconds},schedule:o.schedule,params:o.params}),(c.model!==void 0||c.maxTurns!==void 0||c.timeoutSeconds!==void 0)&&d.jsxs($e,{level:"low",className:"p-4 space-y-3",children:[d.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Execution Config"}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.model!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Model"}),d.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.model})]}),c.maxTurns!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Max Turns"}),d.jsx("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:c.maxTurns})]}),c.timeoutSeconds!==void 0&&d.jsxs("div",{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Timeout"}),d.jsxs("p",{className:"font-mono text-sm text-on-surface mt-0.5",children:[c.timeoutSeconds,"s"]})]})]})]}),f.length>0?d.jsxs("div",{className:"space-y-3",children:[d.jsxs("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:["Phases",d.jsxs("span",{className:"ml-2 text-on-surface normal-case font-normal",children:[f.length," ",f.length===1?"phase":"phases"]})]}),f.map((h,p)=>d.jsx(dre,{phase:h,index:p},h.name))]}):d.jsxs("div",{className:"space-y-3",children:[d.jsx("h2",{className:"font-sans text-sm font-medium text-on-surface-variant uppercase tracking-wide",children:"Prompt"}),d.jsx($e,{level:"lowest",className:"p-4 overflow-auto max-h-96",children:d.jsx(Rr,{content:o.prompt??""})})]}),d.jsx(ere,{taskId:e})]})}function w3(e,t){var n,r,a;return{summaryBatchInterval:String(((n=e.agent)==null?void 0:n.summary_batch_interval)??Ab),defaultTask:t??"",scheduledTasksEnabled:((r=e.agent)==null?void 0:r.scheduled_tasks_enabled)??!0,eventTasksEnabled:((a=e.agent)==null?void 0:a.event_tasks_enabled)??!0}}function vre(e,t,n){const r=w3(t,n);return e.summaryBatchInterval!==r.summaryBatchInterval||e.defaultTask!==r.defaultTask||e.scheduledTasksEnabled!==r.scheduledTasksEnabled||e.eventTasksEnabled!==r.eventTasksEnabled}function YA({label:e,value:t,max:n,color:r}){const a=n>0?Math.round(t/n*100):0,i=2*Math.PI*36,l=i-a/100*i;return d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsxs("div",{className:"relative h-20 w-20",children:[d.jsxs("svg",{className:"h-20 w-20 -rotate-90",viewBox:"0 0 80 80",children:[d.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:"currentColor",className:"text-surface-container/30",strokeWidth:"6"}),d.jsx("circle",{cx:"40",cy:"40",r:"36",fill:"none",stroke:r,strokeWidth:"6",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,className:"transition-all duration-700"})]}),d.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d.jsxs("span",{className:"text-sm font-semibold font-mono text-on-surface",children:[a,"%"]})})]}),d.jsx("span",{className:"text-xs text-on-surface-variant text-center font-sans",children:e})]})}function Ki({label:e,value:t}){return d.jsxs("div",{className:"flex items-center justify-between py-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant font-sans",children:e}),d.jsx("span",{className:"text-xs font-mono text-on-surface",children:t})]})}function pre({stats:e}){const t=e.embedding.total_embeddable>0?e.embedding.embedded_count:0,n=e.embedding.total_embeddable;return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("h2",{className:"text-xs font-semibold text-on-surface-variant uppercase tracking-widest flex items-center gap-2 font-sans",children:[d.jsx(kb,{className:"h-3.5 w-3.5"}),"System Health"]}),d.jsxs("div",{className:"flex justify-center gap-8 py-2",children:[d.jsx(YA,{label:"Embedding Coverage",value:t,max:n,color:"#abcfb8"}),d.jsx(YA,{label:"Queue Health",value:Math.max(0,n-e.embedding.queue_depth),max:n,color:"#edbf7f"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-0",children:[d.jsx(Ki,{label:"Sessions",value:String(e.vault.session_count)}),d.jsx(Ki,{label:"Spores",value:String(e.vault.spore_count)}),d.jsx(Ki,{label:"Entities",value:String(e.vault.entity_count)}),d.jsx(Ki,{label:"Graph edges",value:String(e.vault.edge_count)}),d.jsx(Ki,{label:"Uptime",value:bw(e.daemon.uptime_seconds)}),d.jsx(Ki,{label:"Daemon",value:`v${e.daemon.version} :${e.daemon.port}`}),e.agent.last_run_at!==null&&d.jsxs(d.Fragment,{children:[d.jsx(Ki,{label:"Last run",value:wi(e.agent.last_run_at)}),d.jsx(Ki,{label:"Total runs",value:String(e.agent.total_runs)})]}),e.digest.freshest_tier!==null&&d.jsx(Ki,{label:"Digest tier",value:`T${e.digest.freshest_tier}`})]})]})}function mre(){var T,R;const{config:e,isLoading:t,saveConfig:n,isSaving:r}=Bd(),{data:a,isLoading:i}=Yp(),{data:l,isLoading:o}=Sc(),{restart:f}=G1(),[c,h]=j.useState(null),[p,m]=j.useState(null),y=(l==null?void 0:l.tasks)??[],x=((T=y.find(A=>A.isDefault))==null?void 0:T.name)??"",b=j.useRef(!1);e&&!o&&!b.current&&(b.current=!0,c===null&&h(w3(e,x)));const w=c&&e?vre(c,e,x):!1,S=!!((R=e==null?void 0:e.agent)!=null&&R.provider),N=j.useCallback((A,D)=>{h(_=>_&&{..._,[A]:D}),m(null)},[]),E=async()=>{if(!(!c||!e)){m(null);try{const A={...e,agent:{...e.agent,summary_batch_interval:$b(c.summaryBatchInterval,Ab),scheduled_tasks_enabled:c.scheduledTasksEnabled,event_tasks_enabled:c.eventTasksEnabled}};await n(A),m({type:"success",text:"Agent settings saved. Restarting daemon..."});try{await f()}catch{m({type:"success",text:"Settings saved. Daemon restart may require manual action."})}}catch{m({type:"error",text:"Failed to save settings."})}}};return t||!e||!c?d.jsx("div",{className:"space-y-4",children:[1,2,3].map(A=>d.jsx("div",{className:"h-32 rounded-md animate-pulse bg-surface-container-low"},A))}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs($e,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(St,{children:d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(Wz,{className:"h-4 w-4 text-primary"}),"Agent Operations"]})}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Scheduled Tasks"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Intelligence, skill survey, and skill evolution run automatically on a schedule"})]}),d.jsx(ns,{checked:c.scheduledTasksEnabled,onCheckedChange:A=>N("scheduledTasksEnabled",A),disabled:!S})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Event-Driven Tasks"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Titles and summaries generated automatically after coding sessions"})]}),d.jsx(ns,{checked:c.eventTasksEnabled,onCheckedChange:A=>N("eventTasksEnabled",A),disabled:!S})]})]}),!S&&d.jsxs("p",{className:"font-sans text-xs text-on-surface-variant/70",children:["Configure an agent provider in"," ",d.jsx("a",{href:"/settings",className:"underline hover:text-on-surface transition-colors",children:"Settings"})," ","to enable agent tasks."]}),d.jsx("div",{className:"border-t border-outline-variant/20"}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Title & Summary Batch Interval"}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(fn,{type:"number",min:0,placeholder:String(Ab),value:c.summaryBatchInterval,onChange:A=>N("summaryBatchInterval",A.target.value),className:"w-32 font-mono"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"batches"})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Run the Title & Summary task every N batches to keep active sessions properly titled. Set to 0 to disable."})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"font-sans text-sm font-medium text-on-surface",children:"Default Task"}),o?d.jsxs("div",{className:"flex h-9 items-center gap-2 text-on-surface-variant font-sans text-sm",children:[d.jsx(jn,{className:"h-4 w-4 animate-spin"}),"Loading tasks..."]}):d.jsxs(vi,{value:c.defaultTask,onValueChange:A=>N("defaultTask",A),children:[d.jsx(qa,{children:d.jsx(pi,{placeholder:"Select default task"})}),d.jsx(Va,{children:y.map(A=>d.jsx(Kr,{value:A.name,children:A.displayName},A.name))})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"The task used when Run Now is clicked or no task is specified."})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[d.jsxs(Ae,{onClick:E,disabled:!w||r,size:"sm",children:[r?d.jsx(jn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Save Changes"]}),p&&d.jsx("span",{className:p.type==="success"?"font-sans text-xs text-primary":"font-sans text-xs text-tertiary",children:p.text})]})]}),i?d.jsx($e,{level:"low",className:"p-6",children:d.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-container"})}):a?d.jsx($e,{level:"low",className:"p-6",children:d.jsx(pre,{stats:a})}):null]})}const S3="tab",E3="run",C3="task",gre=new Set(["runs","tasks","config"]);function XA(){const e=new URLSearchParams(window.location.search),t=e.get(S3);return{tab:t&&gre.has(t)?t:"runs",runId:e.get(E3)??void 0,taskId:e.get(C3)??void 0}}function yre(e,t,n){const r=new URLSearchParams;e!=="runs"&&r.set(S3,e),t&&r.set(E3,t),n&&r.set(C3,n);const a=r.toString(),i=a?`${window.location.pathname}?${a}`:window.location.pathname;window.history.pushState(null,"",i)}const xre=[{id:"runs",label:"Runs"},{id:"tasks",label:"Tasks"},{id:"config",label:"Config"}];function bre(){const e=La(),t=XA(),[n,r]=j.useState(t.tab),[a,i]=j.useState(t.runId),[l,o]=j.useState(t.taskId),[f,c]=j.useState(!1),h=j.useRef(!1),p=j.useRef(!1);j.useEffect(()=>{if(!h.current){h.current=!0;return}if(p.current){p.current=!1;return}yre(n,a,l)},[n,a,l]),j.useEffect(()=>{p.current=!0;const y=XA();r(y.tab),i(y.runId),o(y.taskId)},[e.search,e.key]);const m=j.useCallback(y=>{const x=y;r(x),x!=="runs"&&i(void 0),x!=="tasks"&&o(void 0)},[]);return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsx(Si,{title:"Agent",subtitle:"Intelligence runs, task configuration, and operational settings",tabs:xre,activeTab:n,onTabChange:m,actions:n==="runs"?d.jsxs(Ae,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>c(!0),children:[d.jsx(is,{className:"h-3.5 w-3.5"}),"Run Now"]}):void 0}),n==="runs"&&(a?d.jsx(Une,{runId:a,onBack:()=>i(void 0)}):d.jsx(Mne,{onSelectRun:i,onTriggerRun:()=>c(!0)})),n==="tasks"&&(l?d.jsx(hre,{taskId:l,onBack:()=>o(void 0),onNavigate:o,onRunTriggered:y=>{o(void 0),r("runs"),y&&i(y)}}):d.jsx(Kne,{onSelect:o})),n==="config"&&d.jsx(mre,{}),d.jsx(Vne,{open:f,onOpenChange:c,onTriggered:()=>i(void 0)})]})}function N3(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/skill-candidates?${n}`:"/skill-candidates";return qt({queryKey:["skill-candidates",e],queryFn:({signal:a})=>lt(r,{signal:a})})}function wre(){const e=Sn();return fr({mutationFn:({id:t,...n})=>mc(`/skill-candidates/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-candidates"]})}})}function k3(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!==void 0&&t.set("offset",String(e.offset));const n=t.toString(),r=n?`/skill-records?${n}`:"/skill-records";return qt({queryKey:["skill-records",e],queryFn:({signal:a})=>lt(r,{signal:a})})}function Sre(e){return qt({queryKey:["skill-record",e],queryFn:({signal:t})=>lt(`/skill-records/${e}`,{signal:t}),enabled:!!e})}function Ere(){const e=Sn();return fr({mutationFn:t=>U1(`/skill-records/${encodeURIComponent(t)}`),onSuccess:()=>{e.invalidateQueries({queryKey:["skill-records"]}),e.invalidateQueries({queryKey:["skill-record"]})}})}const zn={IDENTIFIED:"identified",APPROVED:"approved",GENERATED:"generated",DISMISSED:"dismissed"},Cre=`${zn.APPROVED},${zn.GENERATED}`,Nre=[{key:"status",label:"Status",options:[{value:tr,label:"All statuses"},{value:zn.IDENTIFIED,label:"Identified"},{value:Cre,label:"Approved & generated"},{value:zn.APPROVED,label:"Awaiting generation"},{value:zn.GENERATED,label:"Generated"},{value:zn.DISMISSED,label:"Dismissed"}]}];function kre(e){const t=`${(e*100).toFixed(0)}%`;return e>=.85?{text:t,variant:"default"}:e>=.7?{text:t,variant:"secondary"}:{text:t,variant:"outline"}}function QA(e){const t=Math.floor(Date.now()/1e3)-e;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 Tre(e){switch(e){case zn.IDENTIFIED:return d.jsx(xt,{variant:"outline",children:"Identified"});case zn.APPROVED:return d.jsx(xt,{variant:"secondary",children:"Awaiting generation"});case zn.GENERATED:return d.jsx(xt,{variant:"default",children:"Generated"});case zn.DISMISSED:return d.jsx(xt,{variant:"outline",className:"opacity-50",children:"Dismissed"});default:return d.jsx(xt,{variant:"outline",children:e})}}function jre({candidate:e,onApprove:t,onDismiss:n,isApproving:r,isDismissing:a}){const i=kre(e.confidence),l=e.status===zn.IDENTIFIED||e.status===zn.APPROVED;return d.jsxs($e,{level:"low",className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h3",{className:"font-serif text-lg text-on-surface leading-tight",children:e.topic}),e.approved_at!==null&&d.jsxs("p",{className:"font-sans text-xs text-on-surface-variant mt-1",children:["Approved ",QA(e.approved_at),e.status===zn.GENERATED&&" · generated"]})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[Tre(e.status),d.jsx(xt,{variant:i.variant,children:i.text}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:QA(e.created_at)})]})]}),d.jsx(Rr,{content:e.rationale,className:"text-sm text-on-surface-variant"}),l&&d.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.status===zn.IDENTIFIED&&d.jsxs(d.Fragment,{children:[d.jsxs(Ae,{size:"sm",variant:"default",onClick:t,disabled:r,children:[d.jsx(Dd,{className:"h-3.5 w-3.5 mr-1.5"}),r?"Approving...":"Approve"]}),d.jsxs(Ae,{size:"sm",variant:"ghost",onClick:n,disabled:a,className:"text-on-surface-variant",children:[d.jsx(zu,{className:"h-3.5 w-3.5 mr-1.5"}),a?"Dismissing...":"Dismiss"]})]}),e.status===zn.APPROVED&&d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:"Awaiting generation"})]})]})}function Are(){return d.jsxs($e,{level:"low",className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsx("div",{className:"h-5 w-64 rounded bg-surface-container-high animate-pulse"}),d.jsx("div",{className:"h-5 w-20 rounded bg-surface-container-high animate-pulse"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("div",{className:"h-3 w-full rounded bg-surface-container-high animate-pulse"}),d.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-container-high animate-pulse"})]}),d.jsx("div",{className:"h-8 w-32 rounded bg-surface-container-high animate-pulse"})]})}function Rre(){const e=wre(),{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Fd({initialFilters:{status:zn.IDENTIFIED}}),c=f("status"),{data:h,isLoading:p,isError:m,error:y}=N3({status:c,limit:Yr,offset:a}),x=(h==null?void 0:h.candidates)??[],b=(h==null?void 0:h.total)??0,w=j.useMemo(()=>{if(!n)return x;const T=n.toLowerCase();return x.filter(R=>R.topic.toLowerCase().includes(T)||R.rationale.toLowerCase().includes(T))},[x,n]);function S(T){e.mutate({id:T.id,status:zn.APPROVED})}function N(T){e.mutate({id:T.id,status:zn.DISMISSED})}const E=d.jsx(Id,{searchPlaceholder:"Search candidates...",searchValue:t,onSearchChange:l,filters:Nre,filterValues:r,onFilterChange:o});return m?d.jsxs("div",{className:"space-y-3",children:[E,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load candidates"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):p?d.jsxs("div",{className:"space-y-3",children:[E,Array.from({length:3}).map((T,R)=>d.jsx(Are,{},R))]}):d.jsxs("div",{className:"space-y-3",children:[E,w.length===0?d.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant",children:[d.jsx(Hz,{className:"h-10 w-10 opacity-20"}),b===0&&!c&&!n?d.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skill candidates discovered yet"}),d.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Candidates are procedural patterns discovered from your vault knowledge. Review and approve them here, then Myco generates full skills from them."}),d.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically during idle periods and discovers candidates from session history, decisions, and gotchas."]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",d.jsxs(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"inline-flex items-center gap-1 text-primary hover:underline",children:[d.jsx(Gp,{className:"h-3 w-3"}),"Skill Survey"]})," ","from the Agent page to discover candidates on demand."]})]})]}):d.jsx("span",{className:"font-sans text-sm",children:"No matching candidates"})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:n?`${w.length} of ${b} candidate${b!==1?"s":""}`:`${b} candidate${b!==1?"s":""}`}),w.map(T=>{var R,A,D,_;return d.jsx(jre,{candidate:T,onApprove:()=>S(T),onDismiss:()=>N(T),isApproving:e.isPending&&((R=e.variables)==null?void 0:R.id)===T.id&&((A=e.variables)==null?void 0:A.status)===zn.APPROVED,isDismissing:e.isPending&&((D=e.variables)==null?void 0:D.id)===T.id&&((_=e.variables)==null?void 0:_.status)===zn.DISMISSED},T.id)})]}),d.jsx(kc,{total:n?w.length:b,offset:a,limit:Yr,onPageChange:i})]})}const Dre=5,Mre=[{key:"status",label:"Status",options:[{value:tr,label:"All statuses"},{value:"active",label:"Active"},{value:"stale",label:"Stale"},{value:"retired",label:"Retired"}]}];function _re(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function Vf({children:e,className:t}){return d.jsx("th",{className:ke("px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant",t),children:e})}function Ore(){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)]",children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-40 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-12 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-16 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-10 rounded bg-surface-container-high animate-pulse"})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"h-3 w-20 rounded bg-surface-container-high animate-pulse"})})]})}function Lre({record:e,onClick:t}){return d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] last:border-0 hover:bg-surface-container/60 cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40 hover:shadow-[inset_3px_0_0_var(--primary)]",onClick:t,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t())},tabIndex:0,role:"row","aria-label":`Skill: ${e.display_name}`,children:[d.jsxs("td",{className:"px-4 py-3",children:[d.jsx("span",{className:"font-sans text-sm font-medium text-on-surface block",children:e.display_name}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant block mt-0.5",children:e.name})]}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs(xt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["gen ",e.generation]})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(xt,{variant:_re(e.status),children:e.status})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:e.usage_count})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:um(e.updated_at)})})]})}function Pre({onSelectSkill:e}){const{searchInput:t,debouncedSearch:n,filterValues:r,offset:a,setOffset:i,handleSearchChange:l,handleFilterChange:o,activeFilter:f}=Fd({initialFilters:{status:tr}}),c=f("status"),{data:h,isLoading:p,isError:m,error:y}=k3({status:c,limit:Yr,offset:a}),x=(h==null?void 0:h.records)??[],b=(h==null?void 0:h.total)??0,w=n?x.filter(E=>E.display_name.toLowerCase().includes(n.toLowerCase())||E.name.toLowerCase().includes(n.toLowerCase())||E.description.toLowerCase().includes(n.toLowerCase())):x,S=d.jsx(Id,{searchPlaceholder:"Search skills...",searchValue:t,onSearchChange:l,filters:Mre,filterValues:r,onFilterChange:o}),N=d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-[var(--ghost-border)] bg-surface-container/50",children:[d.jsx(Vf,{children:"Name"}),d.jsx(Vf,{children:"Generation"}),d.jsx(Vf,{children:"Status"}),d.jsx(Vf,{children:"Usage"}),d.jsx(Vf,{children:"Last Evolved"})]})});return m?d.jsxs("div",{children:[S,d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary mt-4",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Failed to load skills"}),d.jsx("span",{className:"font-sans text-xs text-on-surface-variant",children:y instanceof Error?y.message:"Unknown error"})]})]}):d.jsxs("div",{children:[S,p?d.jsx($e,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full",children:[N,d.jsx("tbody",{children:Array.from({length:Dre}).map((E,T)=>d.jsx(Ore,{},T))})]})}):w.length===0?d.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant mt-4",children:[d.jsx(Az,{className:"h-10 w-10 opacity-20"}),b===0&&!n&&!c?d.jsxs("div",{className:"text-center space-y-2 max-w-md",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"No skills generated yet"}),d.jsx("p",{className:"font-sans text-xs leading-relaxed",children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in this codebase."}),d.jsxs("div",{className:"font-sans text-xs space-y-1 pt-1",children:[d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Automatic:"})," ","The"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-survey",className:"text-primary hover:underline",children:"Skill Survey"})," ","task runs automatically and discovers candidates from your vault. Approve candidates in the"," ",d.jsx(Ma,{to:"/skills?tab=candidates",className:"text-primary hover:underline",children:"Candidates tab"}),", then enable the"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","task to produce skills automatically."]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Manual:"})," ","Run"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","from the Agent page to generate a skill on demand."]})]})]}):d.jsx("span",{className:"font-sans text-sm",children:"No matching skills"})]}):d.jsx($e,{level:"low",className:"rounded-md overflow-hidden mt-4",children:d.jsxs("table",{className:"w-full","aria-label":"Skills",children:[N,d.jsx("tbody",{children:w.map(E=>d.jsx(Lre,{record:E,onClick:()=>e(E.name)},E.id))})]})}),d.jsx(kc,{total:b,offset:a,limit:Yr,onPageChange:i})]})}const Bre={created:"default",updated:"secondary",split:"warning",retired:"outline"};function zre({entry:e}){const[t,n]=j.useState(!1);return d.jsxs("div",{className:"relative pl-6",children:[d.jsx("div",{className:"absolute left-0 top-2 h-2.5 w-2.5 rounded-full border-2 border-outline-variant bg-surface-container"}),d.jsxs("button",{type:"button",className:"w-full text-left group cursor-pointer",onClick:()=>n(r=>!r),"aria-expanded":t,children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(xt,{variant:"outline",className:"font-mono text-[10px] px-1.5 py-0",children:["v",e.generation]}),d.jsx(xt,{variant:Bre[e.action]??"outline",children:e.action}),d.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant ml-auto shrink-0",children:um(e.created_at)}),d.jsx(da,{className:ke("h-3.5 w-3.5 text-on-surface-variant transition-transform duration-150",t&&"rotate-90")})]}),e.rationale&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-1 leading-relaxed",children:e.rationale})]}),t&&e.content_snapshot&&d.jsx($e,{level:"lowest",className:"mt-2 p-3 overflow-auto max-h-96",children:d.jsx("pre",{className:"font-mono text-xs text-on-surface whitespace-pre-wrap break-words",children:e.content_snapshot})})]})}function Ire({entries:e}){return e.length===0?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No evolution history."}):d.jsxs("div",{className:"relative space-y-4",children:[d.jsx("div",{className:"absolute left-[4.5px] top-2 bottom-2 w-px bg-outline-variant/30"}),e.map(t=>d.jsx(zre,{entry:t},t.id))]})}function Fre(e){return e==="active"?"default":e==="stale"?"secondary":"outline"}function Ure(e){if(!e)return 0;try{const t=JSON.parse(e);return Array.isArray(t)?t.length:0}catch{return 0}}function qre(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"h-8 w-24 animate-pulse rounded bg-surface-container-high"}),d.jsxs("div",{className:"rounded-md bg-surface-container-low p-4 space-y-3",children:[d.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-4 w-64 animate-pulse rounded bg-surface-container-high"}),d.jsx("div",{className:"h-5 w-32 animate-pulse rounded bg-surface-container-high"})]}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:Array.from({length:3}).map((e,t)=>d.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-container-high"},t))})]})}function Vre({skillName:e,onBack:t}){var m,y;const{data:n,isPending:r,isError:a}=Sre(e),i=Ere(),[l,o]=j.useState(!1);if(r)return d.jsx(qre,{});if(a||!n)return d.jsxs("div",{className:"space-y-4",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),"Skills"]}),d.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 text-tertiary",children:[d.jsx(Mr,{className:"h-5 w-5"}),d.jsx("span",{className:"font-sans text-sm",children:"Skill not found"})]})]});const f=Ure(n.source_ids),c=((y=(m=n.lineage)==null?void 0:m[0])==null?void 0:y.content_snapshot)??null,h=n.frontmatter??{},p=(c==null?void 0:c.replace(/^---\n[\s\S]*?\n---\n*/,""))??null;return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:t,className:"gap-2 text-on-surface-variant",children:[d.jsx(yi,{className:"h-4 w-4"}),"Skills"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",className:"gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10",onClick:()=>o(!0),children:[d.jsx(ss,{className:"h-4 w-4"}),"Delete"]})]}),d.jsx($e,{level:"low",className:"p-4 space-y-3",children:d.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[d.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[d.jsx("h1",{className:"font-serif text-lg text-on-surface",children:n.display_name}),n.description&&d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:n.description}),n.path&&d.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant mt-1",children:n.path}),Object.keys(h).length>0&&d.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-2",children:[h["user-invocable"]==="true"&&d.jsx(xt,{variant:"secondary",children:"user-invocable"}),h["allowed-tools"]&&d.jsxs(xt,{variant:"outline",children:["tools: ",h["allowed-tools"]]})]})]}),d.jsx(xt,{variant:Fre(n.status),className:"shrink-0",children:n.status})]})}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[d.jsx(Yt,{label:"Generation",value:`v${n.generation}`,accent:"sage"}),d.jsx(Yt,{label:"Usage",value:`${n.usage_total??n.usage_count??0}`,sublabel:"sessions",accent:"ochre"}),d.jsx(Yt,{label:"Sources",value:`${f}`,accent:"outline"})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(St,{children:"Evolution History"}),d.jsx(Ire,{entries:n.lineage??[]})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(St,{children:"Current Content"}),p?d.jsx(Rr,{content:p}):d.jsx("p",{className:"font-sans text-sm text-on-surface-variant py-4",children:"No content snapshot available."})]}),d.jsx(cm,{open:l,onOpenChange:o,title:"Delete Skill",description:"This will permanently delete the skill record, evolution history, and the SKILL.md file from disk.",icon:d.jsx(ss,{className:"h-4 w-4 text-tertiary"}),meta:n?[{label:"Name",value:n.name},{label:"Title",value:n.display_name}]:[],confirmLabel:"Delete Skill",variant:"destructive",onConfirm:()=>{i.mutate(n.name,{onSuccess:()=>{o(!1),t()}})},isPending:i.isPending})]})}const T3="tab",j3="skill",Hre=new Set(["candidates","skills"]);function WA(){const e=new URLSearchParams(window.location.search),t=e.get(T3);return{tab:t&&Hre.has(t)?t:"skills",skill:e.get(j3)??void 0}}function Gre(e,t){const n=new URLSearchParams;e!=="skills"&&n.set(T3,e),t&&n.set(j3,t);const r=n.toString(),a=r?`${window.location.pathname}?${r}`:window.location.pathname;window.history.replaceState(null,"",a)}const $re=[{id:"skills",label:"Skills"},{id:"candidates",label:"Candidates"}];function Kre(){return d.jsxs(Md,{children:[d.jsx(MF,{asChild:!0,children:d.jsx(Ae,{variant:"ghost",size:"sm",className:"text-on-surface-variant",children:d.jsx(Dz,{className:"h-4 w-4"})})}),d.jsxs(yc,{className:"max-w-lg",children:[d.jsxs(_d,{children:[d.jsx(xc,{children:"How Skills Work"}),d.jsx(tm,{children:"Skills are project-specific procedural guides generated from your vault knowledge. They teach agents how to accomplish tasks in your codebase."})]}),d.jsxs("div",{className:"space-y-4 font-sans text-sm text-on-surface-variant",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"The Pipeline"}),d.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Survey"})," — discovers candidate skills from vault knowledge (sessions, decisions, gotchas)"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Approve"})," — you review candidates and approve the ones worth generating"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Generate"})," — produces a SKILL.md file from the approved candidate's source material"]}),d.jsxs("li",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Evolve"})," — updates existing skills when new knowledge makes them stale"]})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"Scheduling"}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium text-on-surface",children:"Skill Survey"})," runs automatically during idle periods. Skill Generate and Skill Evolve are off by default — enable them in the"," ",d.jsxs(Ma,{to:"/agent?tab=tasks",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["Agent Tasks",d.jsx(Gp,{className:"h-3 w-3"})]})," ","page for fully automatic operation, or trigger them manually with Run Now."]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("h4",{className:"font-medium text-on-surface",children:"Quick Start"}),d.jsxs("ol",{className:"list-decimal pl-5 space-y-1",children:[d.jsx("li",{children:"Wait for the survey to discover candidates (or run it manually)"}),d.jsx("li",{children:"Review candidates in the Candidates tab and approve the best ones"}),d.jsxs("li",{children:["Run"," ",d.jsx(Ma,{to:"/agent?tab=tasks&task=skill-generate",className:"text-primary hover:underline",children:"Skill Generate"})," ","to produce skills from approved candidates"]})]})]})]})]})]})}function Yre(){const e=La(),t=WA(),[n,r]=j.useState(t.tab),[a,i]=j.useState(t.skill),{data:l}=N3({status:"identified"}),{data:o}=k3({status:"active"}),f=(l==null?void 0:l.total)??0,c=(o==null?void 0:o.total)??0;j.useEffect(()=>{Gre(n,a)},[n,a]),j.useEffect(()=>{const m=WA();r(m.tab),i(m.skill)},[e.search,e.key]);const h=j.useCallback(m=>{const y=m;r(y),y!=="skills"&&i(void 0)},[]),p=j.useCallback(m=>{r("skills"),i(m)},[]);return d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsx(Si,{title:"Skills",subtitle:"Discovered skill candidates and promoted skill records",tabs:$re,activeTab:n,onTabChange:h,actions:d.jsxs("div",{className:"flex items-center gap-2",children:[f>0&&d.jsxs(xt,{variant:"secondary",children:[f," pending"]}),c>0&&d.jsxs(xt,{variant:"default",children:[c," active"]}),d.jsx(Kre,{})]})}),n==="candidates"&&d.jsx(Rre,{}),n==="skills"&&!a&&d.jsx(Pre,{onSelectSkill:p}),n==="skills"&&a&&d.jsx(Vre,{skillName:a,onBack:()=>i(void 0)})]})}const Xre=new Set(["openai-compatible"]);function Qre(e,t,n){const r=e?Xre.has(e):!1;return qt({queryKey:["models",e,t,n],queryFn:({signal:i})=>{const l=new URLSearchParams({provider:e});return t&&l.set("base_url",t),l.set("type",n),lt(`/models?${l.toString()}`,{signal:i})},enabled:!!e&&(!r||!!t),staleTime:vI})}function Wre(){const[e,t]=j.useState({}),[n,r]=j.useState([]),[a,i]=j.useState([]),[l,o]=j.useState(!1),[f,c]=j.useState(!1),[h,p]=j.useState(""),[m,y]=j.useState(!1),[x,b]=j.useState(null),[w,S]=j.useState(!0);j.useEffect(()=>{lt("/config/plan-dirs").then(_=>{t(_.symbiont),r(_.custom),i(_.custom),o(_.ignore_plan_dirs_in_git),c(_.ignore_plan_dirs_in_git)}).catch(()=>{}).finally(()=>S(!1))},[]);const N=n.length!==a.length||n.some((_,L)=>_!==a[L])||l!==f,E=j.useCallback(()=>{const _=h.trim();!_||n.includes(_)||(r(L=>[...L,_]),p(""),b(null))},[h,n]),T=j.useCallback(_=>{r(L=>L.filter(M=>M!==_)),b(null)},[]),R=j.useCallback(async()=>{y(!0),b(null);try{const _=await Qt("/config/plan-dirs",{plan_dirs:n,ignore_plan_dirs_in_git:l});i(_.custom),r(_.custom),c(_.ignore_plan_dirs_in_git),o(_.ignore_plan_dirs_in_git),b({type:"success",text:"Plan directories saved."})}catch{b({type:"error",text:"Failed to save plan directories."})}finally{y(!1)}},[n,l]),A=j.useCallback(_=>{_.key==="Enter"&&E()},[E]),D=Object.entries(e);return d.jsxs($e,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-amber-500",children:[d.jsx(St,{children:"Plan Capture"}),w?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"Loading..."}):d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Agent Directories"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Directories monitored by connected agents. Managed by symbiont manifests."}),D.length===0?d.jsx("p",{className:"font-sans text-xs text-on-surface-variant italic",children:"No agent directories configured."}):d.jsx("div",{className:"space-y-3",children:D.map(([_,L])=>d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"font-sans text-xs font-medium text-on-surface-variant uppercase tracking-wide",children:_}),d.jsx("div",{className:"space-y-1",children:L.map(M=>d.jsx("div",{className:"rounded bg-surface-container px-3 py-1.5 font-mono text-xs text-on-surface-variant",children:M},M))})]},_))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-sans text-sm font-medium text-on-surface",children:"Custom Directories"}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Additional directories to watch for plan files."}),d.jsxs("div",{className:"flex items-start justify-between gap-4 rounded bg-surface-container px-3 py-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"font-sans text-xs font-medium text-on-surface",children:"Ignore Custom Plan Dirs In Git"}),d.jsxs("p",{className:"font-sans text-xs text-on-surface-variant",children:["Add repo-relative custom plan directories to the Myco-managed block in ",d.jsx("code",{children:".gitignore"}),"."]})]}),d.jsx(ns,{checked:l,onCheckedChange:o,disabled:m})]}),n.length>0&&d.jsx("div",{className:"space-y-1",children:n.map(_=>d.jsxs("div",{className:"flex items-center gap-2 rounded bg-surface-container px-3 py-1.5",children:[d.jsx("span",{className:"flex-1 font-mono text-xs text-on-surface",children:_}),d.jsx("button",{type:"button",onClick:()=>T(_),className:"font-sans text-xs text-on-surface-variant hover:text-tertiary transition-colors leading-none","aria-label":`Remove ${_}`,children:"x"})]},_))}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(fn,{placeholder:"/path/to/plans",value:h,onChange:_=>p(_.target.value),onKeyDown:A,className:"flex-1 font-mono text-xs"}),d.jsx(Ae,{type:"button",size:"sm",onClick:E,disabled:!h.trim(),children:"Add"})]})]}),N&&d.jsxs("div",{className:"flex items-center gap-4 pt-1",children:[d.jsx(Ae,{onClick:R,disabled:m,size:"sm",children:m?"Saving...":"Save"}),x&&d.jsx("span",{className:x.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:x.text})]}),!N&&(x==null?void 0:x.type)==="success"&&d.jsx("p",{className:"font-sans text-sm text-primary",children:x.text})]})]})}const Zre={banner:"Banner",summary:"Summary"};function Uv({children:e,hint:t}){return d.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&d.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function Hf({children:e}){return d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function qv({children:e}){return d.jsx("div",{className:"rounded-lg border border-outline-variant/20 bg-surface-container/40 p-4",children:e})}function Jre(){var x,b,w,S;const{config:e,saveConfig:t,isSaving:n}=Bd(),{data:r}=WF(),[a,i]=j.useState(null),[l,o]=j.useState(null);j.useEffect(()=>{var N,E,T,R;e&&!a&&i({enabled:((N=e.notifications)==null?void 0:N.enabled)??!0,system_notifications:((E=e.notifications)==null?void 0:E.system_notifications)??!1,default_mode:((T=e.notifications)==null?void 0:T.default_mode)??"summary",domains:((R=e.notifications)==null?void 0:R.domains)??{}})},[e,a]);const f=j.useCallback((N,E)=>{i(T=>T&&{...T,[N]:E}),o(null)},[]),c=j.useCallback((N,E)=>{i(T=>{if(!T)return T;const R=T.domains[N]??{enabled:!0};return{...T,domains:{...T.domains,[N]:{...R,...E}}}}),o(null)},[]),h=j.useCallback(async()=>{if(!(!a||!e)){o(null);try{await t({...e,notifications:a}),o({type:"success",text:"Notification settings saved."})}catch{o({type:"error",text:"Failed to save notification settings."})}}},[a,e,t]);if(!a||!e)return null;const p=(r==null?void 0:r.domains)??[],m=!a.enabled,y=e?a.enabled!==(((x=e.notifications)==null?void 0:x.enabled)??!0)||a.system_notifications!==(((b=e.notifications)==null?void 0:b.system_notifications)??!1)||a.default_mode!==(((w=e.notifications)==null?void 0:w.default_mode)??"summary")||JSON.stringify(a.domains)!==JSON.stringify(((S=e.notifications)==null?void 0:S.domains)??{}):!1;return d.jsxs($e,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(St,{children:"Notifications"}),d.jsxs("div",{className:"space-y-4",children:[d.jsx(qv,{children:d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx(Uv,{children:"Notifications"}),d.jsx(Hf,{children:"Turn the notification system on or off for this project."})]}),d.jsx(ns,{checked:a.enabled,onCheckedChange:N=>f("enabled",N)})]})}),d.jsxs("div",{className:m?"space-y-4 opacity-60":"space-y-4",children:[d.jsx(qv,{children:d.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_auto] md:items-start",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(Uv,{children:"Default Display"}),d.jsx(Hf,{children:"`Summary` keeps notifications in the panel only. `Banner` also shows a temporary in-app popup."})]}),d.jsxs(vi,{value:a.default_mode,onValueChange:N=>f("default_mode",N),disabled:m,children:[d.jsx(qa,{className:"w-40",children:d.jsx(pi,{})}),d.jsxs(Va,{children:[d.jsx(Kr,{value:"summary",children:"Summary"}),d.jsx(Kr,{value:"banner",children:"Banner"})]})]})]})}),d.jsx(qv,{children:d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx(Uv,{children:"Browser Notifications"}),d.jsx(Hf,{children:"Use OS/browser popups when the Myco tab is not focused. Only banner-mode notifications use this."})]}),d.jsx(ns,{checked:a.system_notifications,onCheckedChange:N=>f("system_notifications",N),disabled:m})]})}),p.length>0&&d.jsx(qv,{children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx(Uv,{children:"Per-Domain Overrides"}),d.jsx(Hf,{children:"Leave a domain on `Default` unless you want it to behave differently from the project-wide setting."})]}),d.jsx("div",{className:"space-y-2",children:p.map(N=>{const E=a.domains[N.domain]??{enabled:!0},T=E.enabled,R=E.mode??a.default_mode;return d.jsx("div",{className:"rounded-md border border-outline-variant/20 bg-surface-container-low/40 px-3 py-3",children:d.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[d.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm font-medium text-on-surface",children:N.label}),d.jsx("span",{className:"rounded-full bg-surface-container-high px-2 py-0.5 text-[11px] text-on-surface-variant",children:T?Zre[R]:"Off"})]}),d.jsx("p",{className:"text-[11px] text-on-surface-variant",children:N.types.map(A=>A.label).join(", ")})]}),d.jsxs("div",{className:"flex items-center gap-2 self-start",children:[d.jsxs(vi,{value:E.mode??"default",onValueChange:A=>c(N.domain,{mode:A==="default"?void 0:A}),disabled:m||!T,children:[d.jsx(qa,{className:"h-8 w-[120px] text-xs",children:d.jsx(pi,{})}),d.jsxs(Va,{children:[d.jsx(Kr,{value:"default",children:"Default"}),d.jsx(Kr,{value:"summary",children:"Summary"}),d.jsx(Kr,{value:"banner",children:"Banner"})]})]}),d.jsx(ns,{checked:T,onCheckedChange:A=>c(N.domain,{enabled:A}),disabled:m})]})]})},N.domain)})})]})}),m&&d.jsx(Hf,{children:"Notifications are currently disabled, so display and domain settings are inactive."})]})]}),d.jsxs("div",{className:"flex items-center gap-4 pt-2",children:[d.jsxs(Ae,{onClick:h,disabled:!y||n,size:"sm",children:[n?d.jsx(jn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Notifications"]}),l&&d.jsx("span",{className:l.type==="success"?"font-sans text-sm text-primary":"font-sans text-sm text-tertiary",children:l.text})]})]})}const eae=["debug","info","warn","error"],tae=[{value:"ollama",label:"Ollama"},{value:"openai-compatible",label:"OpenAI-compatible"}],nae=[{value:"1500",label:"1.5K — Executive briefing"},{value:"5000",label:"5K — Deep onboarding"},{value:"10000",label:"10K — Full institutional"}];function ZA(e){var t,n,r,a,i,l,o,f,c,h,p,m,y;return{daemonPort:e.daemon.port!=null?String(e.daemon.port):"",logLevel:e.daemon.log_level,logRetentionDays:String(e.daemon.log_retention_days),embeddingProvider:e.embedding.provider,embeddingModel:e.embedding.model,embeddingBaseUrl:e.embedding.base_url??"",contextDigestTier:String(((t=e.context)==null?void 0:t.digest_tier)??dD),contextPromptSearch:((n=e.context)==null?void 0:n.prompt_search)??!0,contextMaxSpores:String(((r=e.context)==null?void 0:r.prompt_max_spores)??hD),agentProviderType:((i=(a=e.agent)==null?void 0:a.provider)==null?void 0:i.type)??"",agentModel:((o=(l=e.agent)==null?void 0:l.provider)==null?void 0:o.model)??((f=e.agent)==null?void 0:f.model)??"",agentBaseUrl:((h=(c=e.agent)==null?void 0:c.provider)==null?void 0:h.base_url)??"",agentContextLength:((y=(m=(p=e.agent)==null?void 0:p.provider)==null?void 0:m.context_length)==null?void 0:y.toString())??""}}function rae(e,t){var o,f,c;const n=!!((o=t.agent)!=null&&o.provider),r=e.agentProviderType!=="",a=r?{type:e.agentProviderType,...e.agentModel?{model:e.agentModel}:{},...e.agentBaseUrl?{base_url:e.agentBaseUrl}:{},...e.agentContextLength?{context_length:Number(e.agentContextLength)}:{}}:void 0;let i=(f=t.agent)==null?void 0:f.scheduled_tasks_enabled,l=(c=t.agent)==null?void 0:c.event_tasks_enabled;return r&&!n?(i=!0,l=!0):!r&&n&&(i=!1,l=!1),{...t,agent:{...t.agent,provider:a,model:void 0,scheduled_tasks_enabled:i,event_tasks_enabled:l}}}function aae(e,t,n){switch(e){case"agent":return rae(t,n);case"embedding":return{...n,embedding:{...n.embedding,provider:t.embeddingProvider,model:t.embeddingModel,base_url:t.embeddingBaseUrl!==""?t.embeddingBaseUrl:void 0}};case"context":return{...n,context:{...n.context,digest_tier:$b(t.contextDigestTier,dD),prompt_search:t.contextPromptSearch,prompt_max_spores:$b(t.contextMaxSpores,hD)}};case"project":return{...n,daemon:{...n.daemon,port:t.daemonPort!==""?Number(t.daemonPort):null,log_level:t.logLevel,log_retention_days:Number(t.logRetentionDays)}}}}const iae={agent:["agentProviderType","agentModel","agentBaseUrl","agentContextLength"],embedding:["embeddingProvider","embeddingModel","embeddingBaseUrl"],context:["contextDigestTier","contextPromptSearch","contextMaxSpores"],project:["daemonPort","logLevel","logRetentionDays"]};function Vv(e,t,n){return iae[e].some(r=>t[r]!==n[r])}function si({children:e,hint:t}){return d.jsxs("label",{className:"font-sans text-sm font-medium text-on-surface",children:[e,t&&d.jsxs("span",{className:"ml-1 font-sans text-xs text-on-surface-variant font-normal",children:["(",t,")"]})]})}function Hv({children:e}){return d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:e})}function Gv({dirty:e,isSaving:t,showMessage:n,message:r,onSave:a}){return d.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-outline-variant/20",children:[d.jsxs(Ae,{onClick:a,disabled:!e||t,size:"sm",children:[t?d.jsx(jn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):null,"Save"]}),n&&r&&d.jsx("span",{className:r.type==="success"?"font-sans text-xs text-primary":"font-sans text-xs text-tertiary",children:r.text})]})}function sae(){const{config:e,isLoading:t,saveConfig:n,isSaving:r}=Bd(),{data:a}=Yp(),{restart:i}=G1(),{data:l,isPending:o}=x3(),f=b3(),c=j.useRef(!1),[h,p]=j.useState(null);e&&!c.current&&(c.current=!0,h===null&&p(ZA(e)));const[m,y]=j.useState(null),[x,b]=j.useState("idle"),[w,S]=j.useState(""),{data:N}=Qre((h==null?void 0:h.embeddingProvider)??null,(h==null?void 0:h.embeddingBaseUrl)||void 0,"embedding"),E=(N==null?void 0:N.models)??[];j.useEffect(()=>{var I,V;if(!h||h.agentProviderType===""||h.agentModel!=="")return;const U=(V=(I=l==null?void 0:l.providers.find(K=>K.type===h.agentProviderType))==null?void 0:I.models)==null?void 0:V[0];U&&p(K=>K&&{...K,agentModel:U})},[h,l]);const T=j.useMemo(()=>e?ZA(e):null,[e]),R=!!(h&&T&&Vv("agent",h,T)),A=!!(h&&T&&Vv("embedding",h,T)),D=!!(h&&T&&Vv("context",h,T)),_=!!(h&&T&&Vv("project",h,T)),L=j.useCallback((U,I)=>{p(V=>V&&{...V,[U]:I}),y(null)},[]),M=j.useCallback(async U=>{if(!(!h||!e)){y(null);try{await n(aae(U,h,e)),y({section:U,type:"success",text:"Saved. Restarting daemon..."});try{await i()}catch{y({section:U,type:"success",text:"Saved. Daemon restart may require manual action."})}}catch{y({section:U,type:"error",text:"Failed to save."})}}},[h,e,n,i]),z=j.useCallback(async()=>{if(h){b("testing"),S("");try{const U=new URLSearchParams({provider:h.embeddingProvider,type:"embedding"});h.embeddingBaseUrl&&U.set("base_url",h.embeddingBaseUrl);const V=(await lt(`/models?${U.toString()}`)).models.length;b("success"),S(`Connected -- ${V} model${V!==1?"s":""} available.`)}catch(U){b("error"),S(U instanceof Error?U.message:"Connection failed.")}}},[h]),B=j.useCallback(()=>{!h||!h.agentProviderType||f.mutate({type:h.agentProviderType,...h.agentBaseUrl?{base_url:h.agentBaseUrl}:{}})},[h,f]);if(t||!h||!e)return d.jsxs("div",{className:"p-6",children:[d.jsx(Si,{title:"Settings"}),d.jsx("p",{className:"font-sans text-sm text-on-surface-variant mt-2",children:"Loading..."})]});const H=(a==null?void 0:a.vault.name)??e.embedding.provider,G=(l==null?void 0:l.providers)??[];return d.jsxs("div",{className:"p-6",children:[d.jsx(Si,{title:"Settings",subtitle:"Vault configuration and daemon settings"}),d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs($e,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(St,{children:"Myco Agent"}),h.agentProviderType===""?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:"No provider configured -- data collection is active. Configure a provider to enable the intelligence pipeline."}):null,d.jsx(oS,{providerType:h.agentProviderType,model:h.agentModel,baseUrl:h.agentBaseUrl,contextLength:h.agentContextLength,providers:G,isLoadingProviders:o,onProviderChange:U=>{var V;L("agentProviderType",U);const I=G.find(K=>K.type===U);L("agentModel",((V=I==null?void 0:I.models)==null?void 0:V[0])??""),L("agentBaseUrl",(I==null?void 0:I.baseUrl)??""),L("agentContextLength",""),f.reset()},onModelChange:U=>L("agentModel",U),onBaseUrlChange:U=>{L("agentBaseUrl",U),f.reset()},onContextLengthChange:U=>L("agentContextLength",U)}),h.agentProviderType!==""&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[d.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:B,disabled:f.isPending,children:[f.isPending?d.jsx(jn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Test Connection"]}),f.isSuccess&&f.data.ok&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-primary",children:[d.jsx(kN,{className:"h-4 w-4"}),"Connected — ",f.data.latency_ms,"ms"]}),f.isSuccess&&!f.data.ok&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-tertiary",children:[d.jsx(zu,{className:"h-4 w-4"}),f.data.error??"Connection failed."]}),f.isError&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-tertiary",children:[d.jsx(zu,{className:"h-4 w-4"}),f.error.message]})]}),d.jsx(Ae,{type:"button",variant:"ghost",size:"sm",onClick:()=>{L("agentProviderType",""),L("agentModel",""),L("agentBaseUrl",""),L("agentContextLength",""),f.reset()},className:"text-xs text-on-surface-variant",children:"Clear provider"})]}),d.jsx(Gv,{dirty:R,isSaving:r,showMessage:(m==null?void 0:m.section)==="agent",message:m,onSave:()=>M("agent")})]}),d.jsxs($e,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre",children:[d.jsx(St,{children:"Embedding"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{children:"Provider"}),d.jsxs(vi,{value:h.embeddingProvider,onValueChange:U=>{L("embeddingProvider",U),b("idle"),S("")},children:[d.jsx(qa,{children:d.jsx(pi,{})}),d.jsx(Va,{children:tae.map(U=>d.jsx(Kr,{value:U.value,children:U.label},U.value))})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{children:"Model"}),E.length>0?d.jsxs(vi,{value:h.embeddingModel,onValueChange:U=>L("embeddingModel",U),children:[d.jsx(qa,{children:d.jsx(pi,{placeholder:"Select a model"})}),d.jsx(Va,{children:E.map(U=>d.jsx(Kr,{value:U,children:d.jsx("span",{className:"font-mono text-sm",children:U})},U))})]}):d.jsx(fn,{placeholder:"bge-m3",value:h.embeddingModel,onChange:U=>L("embeddingModel",U.target.value)})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{hint:"optional",children:"Base URL"}),d.jsx(fn,{type:"url",placeholder:"http://localhost:11434",value:h.embeddingBaseUrl,onChange:U=>{L("embeddingBaseUrl",U.target.value),b("idle"),S("")}})]}),d.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[d.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",onClick:z,disabled:x==="testing",children:[x==="testing"?d.jsx(jn,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Test Connection"]}),x==="success"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-primary",children:[d.jsx(kN,{className:"h-4 w-4"}),w]}),x==="error"&&d.jsxs("span",{className:"flex items-center gap-1 font-sans text-sm text-tertiary",children:[d.jsx(zu,{className:"h-4 w-4"}),w]})]})]}),d.jsx(Gv,{dirty:A,isSaving:r,showMessage:(m==null?void 0:m.section)==="embedding",message:m,onSave:()=>M("embedding")})]})]}),d.jsxs($e,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-ochre",children:[d.jsx(St,{children:"Context Injection"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{children:"Digest Tier"}),d.jsxs(vi,{value:h.contextDigestTier,onValueChange:U=>L("contextDigestTier",U),children:[d.jsx(qa,{children:d.jsx(pi,{})}),d.jsx(Va,{children:nae.map(U=>d.jsx(Kr,{value:U.value,children:U.label},U.value))})]}),d.jsx(Hv,{children:"Token budget for digest context injected at session start."})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"space-y-0.5",children:[d.jsx(si,{children:"Prompt Search"}),d.jsx(Hv,{children:"Search vault for relevant observations on each prompt."})]}),d.jsx(ns,{checked:h.contextPromptSearch,onCheckedChange:U=>L("contextPromptSearch",U)})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{children:"Max Spores per Prompt"}),d.jsx(fn,{type:"number",min:"0",max:"10",placeholder:"3",value:h.contextMaxSpores,onChange:U=>L("contextMaxSpores",U.target.value)}),d.jsx(Hv,{children:"Maximum observations injected per prompt. Lower = leaner context."})]})]}),d.jsx(Gv,{dirty:D,isSaving:r,showMessage:(m==null?void 0:m.section)==="context",message:m,onSave:()=>M("context")})]}),d.jsx(Jre,{}),d.jsx(Wre,{}),d.jsxs($e,{level:"low",className:"p-6 space-y-5 border-t-2 border-t-sage",children:[d.jsx(St,{children:"Project"}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{children:"Vault Name"}),d.jsx(fn,{value:H,readOnly:!0,disabled:!0,className:"text-on-surface-variant bg-surface-container-lowest"})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{children:"Daemon Port"}),d.jsx(fn,{type:"number",placeholder:"Auto",value:h.daemonPort,onChange:U=>L("daemonPort",U.target.value)}),d.jsx(Hv,{children:"Leave blank to use a random available port."})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{children:"Log Level"}),d.jsxs(vi,{value:h.logLevel,onValueChange:U=>L("logLevel",U),children:[d.jsx(qa,{children:d.jsx(pi,{})}),d.jsx(Va,{children:eae.map(U=>d.jsx(Kr,{value:U,children:U},U))})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx(si,{children:"Log Retention (days)"}),d.jsx(fn,{type:"number",min:1,max:365,className:"w-24",value:h.logRetentionDays,onChange:U=>L("logRetentionDays",U.target.value)})]})]}),d.jsx(Gv,{dirty:_,isSaving:r,showMessage:(m==null?void 0:m.section)==="project",message:m,onSave:()=>M("project")})]})]})]})}function lae(){return Qr({queryKey:["embedding-details"],queryFn:({signal:e})=>lt("/embedding/details",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function oae(){return Qr({queryKey:["database-details"],queryFn:({signal:e})=>lt("/database/details",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}const uae=100,JA=2e3,cae=40;function fae(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=cae}function A3(e){const[t,n]=j.useState([]),[r,a]=j.useState(void 0),[i,l]=j.useState(!0),[o,f]=j.useState(!1),c=j.useRef(null),h=j.useRef(i);h.current=i;const p=j.useRef(r);p.current=r;const{data:m}=Qr({queryKey:["logs",e],queryFn:({signal:w})=>{const S=new URLSearchParams({limit:String(uae),category:e});return p.current&&S.set("since",p.current),lt(`/logs?${S.toString()}`,{signal:w})},refetchInterval:Sr.LOGS,pollCategory:"standard"});j.useEffect(()=>{m!=null&&m.entries.length&&(n(w=>{let S;if(m.cursor_reset){const N=new Set(w.map(T=>`${T.timestamp}|${T.message}`)),E=m.entries.filter(T=>!N.has(`${T.timestamp}|${T.message}`));S=E.length?[...w,...E]:w}else S=[...w,...m.entries];return S.length>JA?S.slice(-JA):S}),a(m.cursor),h.current||f(!0))},[m]),j.useEffect(()=>{!i||!c.current||(c.current.scrollTop=c.current.scrollHeight,f(!1))},[t,i]);const y=j.useCallback(()=>{const w=c.current;w&&(fae(w)?(l(!0),f(!1)):l(!1))},[]),x=j.useCallback(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight,l(!0),f(!1))},[]);return{filteredEntries:j.useMemo(()=>{const w=pp.debug;return t.filter(S=>pp[S.level]>=w)},[t]),scrollRef:c,autoScroll:i,setAutoScroll:l,hasNewEntries:o,handleScroll:y,scrollToBottom:x}}function dae(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function hae(){const[e,t]=j.useState([]),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(null),[h,p]=j.useState(""),[m,y]=j.useState(!1);j.useEffect(()=>{lt("/backup/config").then(E=>{p(E.dir??"")}).catch(()=>{})},[]);const x=j.useCallback(async()=>{y(!0);try{await mc("/backup/config",{dir:h||null}),o({type:"success",text:h?"Backup directory updated. Restart daemon to apply.":"Backup directory reset to default. Restart daemon to apply."})}catch{o({type:"error",text:"Failed to save backup directory."})}finally{y(!1)}},[h]),b=j.useCallback(async()=>{try{const E=await lt("/backups");t(E.backups),r(!0)}catch(E){o({type:"error",text:`Failed to load backups: ${E.message}`})}},[]);!n&&!a&&(i(!0),b().finally(()=>i(!1)));async function w(){o(null),c(null);try{const E=await Qt("/backup");o({type:"success",text:`Backup created: ${E.machine_id} (${xo(E.size_bytes)})`}),await b()}catch(E){o({type:"error",text:`Backup failed: ${E.message}`})}}async function S(E){o(null),c(null);try{const T=await Qt("/restore/preview",{machine_id:E});c(T)}catch(T){o({type:"error",text:`Preview failed: ${T.message}`})}}async function N(E){o(null),c(null);try{const T=await Qt("/restore",{machine_id:E});o({type:"success",text:`Restored ${T.total_restored} records, skipped ${T.total_skipped} duplicates`})}catch(T){o({type:"error",text:`Restore failed: ${T.message}`})}}return d.jsxs($e,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Uz,{className:"h-4 w-4 text-primary"}),d.jsx(St,{children:"Backup & Restore"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:b,children:[d.jsx(gl,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]}),d.jsxs(Ae,{variant:"default",size:"sm",onClick:w,children:[d.jsx(Lz,{className:"mr-1.5 h-3.5 w-3.5"}),"Backup Now"]})]})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("label",{className:"font-sans text-xs text-on-surface-variant flex items-center gap-1.5",children:[d.jsx(Fz,{className:"h-3.5 w-3.5"}),"Backup Directory"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:h,onChange:E=>p(E.target.value),placeholder:".myco/backups",className:"flex-1 bg-surface-container text-on-surface font-mono text-sm rounded px-3 py-1.5 outline-none border border-outline-variant/15 focus:border-primary/40 placeholder:text-on-surface-variant/50"}),d.jsx(Ae,{variant:"ghost",size:"sm",onClick:x,disabled:m,children:m?"Saving...":"Save"})]}),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Override where backups are stored. Leave empty for default (.myco/backups). Supports ~ for home directory. Useful for network shares or git-tracked directories."})]}),l&&d.jsx("p",{className:ke("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),e.length>0?d.jsx("div",{className:"space-y-2",children:e.map(E=>d.jsxs("div",{className:ke("flex items-center justify-between rounded-md px-4 py-3","bg-surface-container-lowest transition-colors"),children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("span",{className:"font-mono text-sm text-on-surface truncate",children:E.machine_id}),d.jsx(xt,{variant:"secondary",children:xo(E.size_bytes)}),d.jsx("span",{className:"text-xs text-on-surface-variant",children:dae(E.modified_at)})]}),d.jsxs("div",{className:"flex gap-2 flex-shrink-0 ml-3",children:[d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>S(E.machine_id),children:"Preview"}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:()=>N(E.machine_id),children:[d.jsx(iI,{className:"mr-1.5 h-3.5 w-3.5"}),"Restore"]})]})]},E.machine_id))}):n?d.jsx("p",{className:"font-sans text-sm text-on-surface-variant",children:'No backups yet. Click "Backup Now" to create one.'}):null,f&&d.jsxs($e,{level:"lowest",className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(St,{children:"Restore Preview"}),d.jsx(xt,{variant:"outline",children:f.machine_id})]}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Restore preview",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"New"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Existing"})]})}),d.jsx("tbody",{children:f.tables.map((E,T)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",T%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2 pr-4",children:E.table}),d.jsx("td",{className:"py-2 pr-4 text-right",children:E.new>0?d.jsx("span",{className:"text-primary",children:E.new}):0}),d.jsx("td",{className:"py-2 text-right text-on-surface-variant",children:E.existing})]},E.table))})]})}),d.jsxs("div",{className:"flex gap-4 font-sans text-sm text-on-surface-variant",children:[d.jsxs("span",{children:["New: ",d.jsx("strong",{className:"text-primary",children:f.total_new})]}),d.jsxs("span",{children:["Existing: ",d.jsx("strong",{children:f.total_existing})]})]})]})]})}const $v=500,eR=6e4;function vae(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"}function pae(e,t){return e<=0?null:e===1&&t?t:`${e} packages`}function mae(){var E;const{data:e}=pD(),t=yI(),n=xI(),r=bI(),[a,i]=j.useState("idle"),[l,o]=j.useState(null);j.useEffect(()=>{if(!(e!=null&&e.restarting)||a!=="idle")return;i("restarting");const T=Date.now()+eR;let R=!1;const A=async()=>{if(!(R||Date.now()>T)){try{if((await fetch("/health")).ok){window.location.reload();return}}catch{}R||setTimeout(A,$v)}},D=setTimeout(A,$v);return()=>{R=!0,clearTimeout(D)}},[e==null?void 0:e.restarting,a]);const f=j.useCallback(async()=>{i("applying"),o(null);try{await n.mutateAsync(),i("restarting");const T=Date.now()+eR;await new Promise((R,A)=>{const D=async()=>{if(Date.now()>T){A(new Error("timeout"));return}try{if((await fetch("/health")).ok){R();return}}catch{}setTimeout(D,$v)};setTimeout(D,$v)}),window.location.reload()}catch(T){i("error");const R=T.message==="timeout"?"Daemon did not restart within the expected time. Check the terminal.":T.message;o(R)}},[n]),c=j.useCallback(()=>{t.mutate()},[t]),h=j.useCallback(T=>{r.mutate(T)},[r]);if(!e)return null;const p=t.isPending,m=a==="applying"||a==="restarting",y=e.update_available===!0,x=e.channel??"stable",b=(e.packages??[]).filter(T=>T.installed),w=b.filter(T=>T.update_available),S=w.length,N=pae(S,((E=w[0])==null?void 0:E.latest_version)??void 0);return e.exempt?d.jsxs($e,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Jz,{className:"h-4 w-4 text-primary"}),d.jsx(St,{children:"Updates"})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:["Updates are disabled in development mode."," ",d.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version})]})]}):d.jsxs($e,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(jb,{className:ke("h-4 w-4",y?"text-secondary":"text-primary")}),d.jsx(St,{children:"Updates"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-xs text-outline",children:e.running_version}),y&&N&&d.jsx(xt,{variant:"warning",children:N})]})]}),d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[y?d.jsx(Ae,{variant:"default",size:"sm",onClick:f,disabled:m,children:m?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),a==="restarting"?"Restarting…":"Updating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(jb,{className:"mr-1.5 h-3.5 w-3.5"}),S>1?`Update ${S} Packages & Restart`:"Update & Restart"]})}):d.jsxs("div",{className:"flex items-center gap-1.5 text-primary",children:[d.jsx(vc,{className:"h-4 w-4"}),d.jsx("span",{className:"font-sans text-sm",children:"Up to date"})]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:c,disabled:p||m,children:[d.jsx(gl,{className:ke("mr-1.5 h-3.5 w-3.5",p&&"animate-spin")}),"Check Now"]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("div",{className:"flex items-center gap-1",children:gI.map(T=>d.jsx(Ae,{variant:x===T?"default":"ghost",className:"text-xs capitalize h-6 px-2",onClick:()=>h(T),disabled:r.isPending||m,children:T},T))}),d.jsxs("span",{className:"font-sans text-xs text-on-surface-variant",children:["Checked: ",vae(e.last_check)]})]}),b.length>0&&d.jsxs("div",{className:"space-y-2",children:[b.map(T=>d.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-outline/20 px-3 py-2",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"font-sans text-sm text-on-surface",children:T.display_name}),d.jsxs("div",{className:"font-mono text-xs text-on-surface-variant",children:[T.installed_version??"not installed",T.update_available&&T.latest_version?` → ${T.latest_version}`:""]})]}),d.jsx(xt,{variant:T.update_available?"warning":"secondary",children:T.update_available?"Update available":"Installed"})]},T.id)),d.jsx("p",{className:"font-sans text-xs text-on-surface-variant",children:"Installed Myco packages update together from this machine-level updater."})]}),(a==="error"||e.error)&&d.jsxs("div",{className:"flex items-start gap-2 text-tertiary",children:[d.jsx(Mr,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),d.jsx("span",{className:"font-sans text-sm",children:l??e.error})]})]})}function gae(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0");return n+":"+r+":"+a}function R3({entry:e}){return d.jsxs("tr",{className:"hover:bg-surface-container-high/30 transition-colors",children:[d.jsx("td",{className:"whitespace-nowrap py-1.5 pl-4 pr-3 text-on-surface-variant/60 align-top w-[68px]",children:gae(e.timestamp)}),d.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[20px]",children:d.jsx("div",{className:ke("h-2 w-2 rounded-full mt-1",V1(e.level))})}),d.jsx("td",{className:"whitespace-nowrap py-1.5 pr-3 align-top w-[54px]",children:d.jsx(xt,{variant:vD(e.level),className:"px-1.5 py-0 text-[10px] uppercase",children:e.level})}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface align-top break-words",children:e.message})]})}const yae=["sessions","spores","plans","artifacts","skill_records"],xae="embedding",bae="database",wae=15,Sae="insufficient_disk_space",qp=20,Eae=[{id:"embedding",label:"Embedding"},{id:"database",label:"Database"},{id:"system",label:"System"}],Cae=new Set(["embedding","database","system"]),D3="tab";function Nae(){const t=new URLSearchParams(window.location.search).get(D3);return t&&Cae.has(t)?t:"embedding"}function kae(e){const t=new URLSearchParams;e!=="embedding"&&t.set(D3,e);const n=t.toString(),r=n?`${window.location.pathname}?${n}`:window.location.pathname;window.history.replaceState(null,"",r)}function Tae(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"processing":"idle":"unavailable"}function jae(e){return e.provider.available?Object.values(e.pending).some(n=>n>0)?"bg-secondary":"bg-primary":"bg-tertiary"}function Aae(e){if(e<=0)return"now";const t=Math.floor(e/1e3);if(t<60)return t+"s";const n=Math.floor(t/60);return n<60?n+"m":Math.floor(n/60)+"h"}function Rae({data:e}){return d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Embedding namespace breakdown",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Namespace"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Embedded"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Pending"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Stale"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Total"})]})}),d.jsx("tbody",{children:yae.map((t,n)=>{const r=e.by_namespace[t],a=(r==null?void 0:r.embedded)??0,i=(r==null?void 0:r.stale)??0,l=e.pending[t]??0,o=a+l;return d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",n%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2.5 pr-4",children:t}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:a}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:l>0?d.jsx("span",{className:"text-secondary",children:l}):l}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:i>0?d.jsx("span",{className:"text-tertiary",children:i}):i}),d.jsx("td",{className:"py-2.5 text-right",children:o})]},t)})})]})})}function Dae({tables:e}){const t=[...e].sort((n,r)=>r.rows-n.rows);return d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-sm","aria-label":"Database table breakdown",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Rows"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-xs uppercase tracking-widest text-right",scope:"col",children:"Indexes"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-xs uppercase tracking-widest",scope:"col",children:"Type"})]})}),d.jsx("tbody",{children:t.map((n,r)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",r%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-2.5 pr-4",children:n.name}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:n.rows.toLocaleString()}),d.jsx("td",{className:"py-2.5 pr-4 text-right",children:n.index_count}),d.jsx("td",{className:"py-2.5",children:n.is_fts?d.jsx(xt,{variant:"outline",className:"px-1.5 py-0 text-[10px] uppercase",children:"FTS5"}):d.jsx("span",{className:"text-on-surface-variant/60",children:"btree"})})]},n.name))})]})})}function Mae({indexes:e}){const[t,n]=j.useState(!1),r=e.filter(i=>i.type==="btree").length,a=e.filter(i=>i.type==="auto").length;return d.jsxs($e,{level:"low",className:"p-6 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(St,{children:"Indexes"}),d.jsx("button",{type:"button",onClick:()=>n(i=>!i),className:"font-sans text-xs text-on-surface-variant hover:text-on-surface transition-colors",children:t?"Hide":"Show all "+e.length})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:[r," btree ",r===1?"index":"indexes",a>0&&d.jsxs(d.Fragment,{children:[" · ",a," auto-",a===1?"index":"indexes"]})]}),t&&d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full font-mono text-xs","aria-label":"All database indexes",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"text-left text-on-surface-variant",children:[d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Name"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Table"}),d.jsx("th",{className:"pb-2 pr-4 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"Type"}),d.jsx("th",{className:"pb-2 font-sans font-medium text-[10px] uppercase tracking-widest",scope:"col",children:"SQL"})]})}),d.jsx("tbody",{children:e.map((i,l)=>d.jsxs("tr",{className:ke("transition-colors hover:bg-surface-container-high/50",l%2===1?"bg-surface-container-low/30":""),children:[d.jsx("td",{className:"py-1.5 pr-4",children:i.name}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface-variant",children:i.table}),d.jsx("td",{className:"py-1.5 pr-4 text-on-surface-variant uppercase",children:i.type}),d.jsx("td",{className:"py-1.5 text-on-surface-variant/70 truncate max-w-[300px]",title:i.sql??"",children:i.sql??"—"})]},i.name))})]})})]})}function _ae({details:e,onActionResult:t}){const{config:n,saveConfig:r,isSaving:a}=Bd(),i=Sn(),[l,o]=j.useState(!1);if(!n)return null;const f=n.maintenance.auto_optimize,c=n.maintenance.auto_optimize_interval_hours,h=e.last_optimize_at?new Date(e.last_optimize_at).getTime():null,p=h!==null?h+c*lo*1e3-Date.now():0;async function m(x){try{await r({...n,maintenance:{...n.maintenance,...x}})}catch(b){t({type:"error",text:"Config save failed: "+b.message})}}async function y(){o(!0);try{const x=await Qt("/database/optimize"),b=x.actions_failed.length;t({type:b>0?"error":"success",text:"Optimize complete: "+x.actions_completed.length+" steps, "+b+" failed ("+x.duration_ms+"ms)"}),i.invalidateQueries({queryKey:["database-details"]})}catch(x){t({type:"error",text:"Error: "+x.message})}finally{o(!1)}}return d.jsxs($e,{level:"low",className:"p-6 space-y-4",children:[d.jsx(St,{children:"Scheduled Maintenance"}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 font-sans text-sm",children:[d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:f,disabled:a,onChange:x=>m({auto_optimize:x.target.checked}),className:"h-4 w-4 accent-primary"}),d.jsx("span",{className:"text-on-surface",children:"Auto-optimize"})]}),d.jsx("span",{className:"text-on-surface-variant",children:"every"}),d.jsxs("select",{value:c,disabled:!f||a,onChange:x=>m({auto_optimize_interval_hours:Number(x.target.value)}),className:"rounded-md border border-outline bg-surface-container px-2 py-1 text-on-surface text-sm",children:[d.jsx("option",{value:6,children:"6 hours"}),d.jsx("option",{value:12,children:"12 hours"}),d.jsx("option",{value:24,children:"24 hours"}),d.jsx("option",{value:72,children:"3 days"}),d.jsx("option",{value:168,children:"7 days"}),d.jsx("option",{value:720,children:"30 days"})]})]}),d.jsxs("p",{className:"font-sans text-sm text-on-surface-variant",children:["Last run: ",e.last_optimize_at?lm(e.last_optimize_at):"never",f&&h!==null&&d.jsxs(d.Fragment,{children:[" · Next: ",Aae(p)]})]}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:y,disabled:l,children:[d.jsx(is,{className:"mr-2 h-4 w-4"}),l?"Running...":"Run now"]})]})}function Oae({onActionResult:e}){const t=Sn(),[n,r]=j.useState(!1);async function a(){r(!0);try{const o=await Qt("/database/integrity-check");o.status==="ok"?e({type:"success",text:"Integrity check OK ("+o.duration_ms+"ms)"}):e({type:"error",text:"Integrity issues: "+o.issues.length+" problems, "+o.fk_violations+" FK violations"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}async function i(){if(confirm("VACUUM rebuilds the entire DB file and may take a while. Continue?")){r(!0);try{const o=await Qt("/database/vacuum");e({type:"success",text:"Vacuum complete: freed "+xo(o.freed_bytes)+" in "+o.duration_ms+"ms"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){if(o instanceof fD){const f=o.body;if((f==null?void 0:f.error)===Sae){e({type:"error",text:"Insufficient disk: need "+xo(f.required_bytes??0)+", have "+xo(f.free_bytes??0)});return}}e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}}async function l(){if(confirm("REINDEX rebuilds all indexes. Continue?")){r(!0);try{const o=await Qt("/database/reindex");e({type:"success",text:"Reindex complete ("+o.duration_ms+"ms)"}),t.invalidateQueries({queryKey:["database-details"]})}catch(o){e({type:"error",text:"Error: "+o.message})}finally{r(!1)}}}return d.jsxs($e,{level:"low",className:"p-6 space-y-3",children:[d.jsx(St,{children:"Actions"}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:a,disabled:n,children:[d.jsx(gl,{className:"mr-2 h-4 w-4"}),"Integrity check"]}),d.jsxs(Ae,{variant:"destructive",size:"sm",onClick:i,disabled:n,children:[d.jsx(ss,{className:"mr-2 h-4 w-4"}),"Vacuum"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:l,disabled:n,children:[d.jsx(Kp,{className:"mr-2 h-4 w-4"}),"Reindex"]})]})]})}function Lae({data:e}){const t=Sn(),[n,r]=j.useState(null),[a,i]=j.useState([]);j.useEffect(()=>{i(E=>{const T=[...E,e.total];return T.length>qp?T.slice(-qp):T})},[e]);const{filteredEntries:l,scrollRef:o,autoScroll:f,setAutoScroll:c,hasNewEntries:h,handleScroll:p,scrollToBottom:m}=A3(xae);async function y(){r(null);try{const E=await Qt("/embedding/reembed-stale");r({type:"success",text:`Re-embedded ${E.reembedded} stale vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(E){r({type:"error",text:`Error: ${E.message}`})}}async function x(){if(confirm("This will re-embed all vectors. Continue?")){r(null);try{const E=await Qt("/embedding/rebuild");r({type:"success",text:`Rebuild queued: ${E.queued} vectors to re-embed`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(E){r({type:"error",text:`Error: ${E.message}`})}}}async function b(){r(null);try{const E=await Qt("/embedding/clean-orphans");r({type:"success",text:`Cleaned ${E.orphans_cleaned} orphan vectors`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(E){r({type:"error",text:`Error: ${E.message}`})}}async function w(){r(null);try{const E=await Qt("/embedding/reconcile");r({type:"success",text:`Reconcile complete: ${E.embedded} embedded, ${E.orphans_cleaned} orphans cleaned (${E.duration_ms}ms)`}),t.invalidateQueries({queryKey:["embedding-details"]})}catch(E){r({type:"error",text:`Error: ${E.message}`})}}const S=Object.values(e.pending).reduce((E,T)=>E+T,0),N=Object.values(e.by_namespace).reduce((E,T)=>E+T.stale,0);return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(aD,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"Provider"}),d.jsx("span",{className:"font-mono text-on-surface",children:e.provider.name})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Model"}),d.jsx("span",{className:"font-mono text-xs text-on-surface truncate max-w-[200px]",title:e.provider.model,children:e.provider.model})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:ke("h-2 w-2 rounded-full",jae(e))}),d.jsx("span",{className:"text-on-surface-variant capitalize",children:Tae(e)})]})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[d.jsx(Yt,{label:"Total Vectors",value:String(e.total),sparklineData:a,accent:"sage"}),d.jsx(Yt,{label:"Pending",value:String(S),accent:S>0?"ochre":"outline"}),d.jsx(Yt,{label:"Stale",value:String(N),accent:N>0?"terracotta":"outline"})]}),d.jsxs($e,{level:"low",className:"p-6 space-y-4",children:[d.jsx(St,{children:"Namespace Breakdown"}),d.jsx(Rae,{data:e})]}),d.jsxs($e,{level:"low",className:"p-6 space-y-3",children:[d.jsx(St,{children:"Actions"}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:y,children:[d.jsx(gl,{className:"mr-2 h-4 w-4"}),"Re-embed stale"]}),d.jsxs(Ae,{variant:"ghost",size:"sm",onClick:b,children:[d.jsx(ss,{className:"mr-2 h-4 w-4"}),"Clean orphans"]}),d.jsxs(Ae,{variant:"secondary",size:"sm",onClick:w,children:[d.jsx(is,{className:"mr-2 h-4 w-4"}),"Force reconcile"]}),d.jsxs(Ae,{variant:"destructive",size:"sm",onClick:x,children:[d.jsx(Kp,{className:"mr-2 h-4 w-4"}),"Rebuild all"]})]}),n&&d.jsx("p",{className:ke("font-sans text-sm",n.type==="success"?"text-primary":"text-tertiary"),children:n.text})]}),d.jsxs($e,{level:"low",className:"flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[d.jsx(St,{children:"Activity Log"}),d.jsxs(Ae,{size:"sm",variant:f?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{f?c(!1):m()},title:f?"Pause auto-scroll":"Resume auto-scroll",children:[f?d.jsx(I1,{className:"h-3 w-3"}):d.jsx(is,{className:"h-3 w-3"}),f?"Pause":"Resume"]})]}),d.jsxs("div",{className:"relative flex-1 p-0",children:[d.jsx("div",{ref:o,onScroll:p,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:l.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No embedding log entries"}):d.jsx("table",{className:"w-full border-collapse","aria-label":"Embedding activity log",children:d.jsx("tbody",{children:l.map((E,T)=>d.jsx(R3,{entry:E},`${E.timestamp}-${T}`))})})}),h&&!f&&d.jsxs("button",{type:"button",onClick:m,className:ke("absolute bottom-4 left-1/2 -translate-x-1/2","flex items-center gap-1.5 rounded-full","bg-surface-container-high px-3 py-1.5 text-xs font-medium shadow-ambient","text-on-surface-variant transition-colors hover:text-on-surface"),children:[d.jsx(nD,{className:"h-3 w-3"}),"New entries below"]})]})]})]})}function Pae(){return d.jsxs("div",{className:"space-y-6",children:[d.jsx(mae,{}),d.jsx(hae,{})]})}function Bae(){const{data:e,isLoading:t,isError:n,error:r}=oae(),[a,i]=j.useState([]),[l,o]=j.useState(null);j.useEffect(()=>{e&&i(S=>{const N=[...S,e.file.size_bytes];return N.length>qp?N.slice(-qp):N})},[e]);const{filteredEntries:f,scrollRef:c,autoScroll:h,setAutoScroll:p,hasNewEntries:m,handleScroll:y,scrollToBottom:x}=A3(bae);if(t)return d.jsx("div",{className:"text-on-surface-variant",children:"Loading database details..."});if(n)return d.jsxs("div",{className:"text-tertiary",children:["Error: ",r.message]});if(!e)return null;const b=e.file.fragmentation_pct.toFixed(1)+"%",w=e.file.fragmentation_pct>wae?"ochre":"outline";return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-4 font-sans text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Oz,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"Database"}),d.jsx("span",{className:"font-mono text-on-surface",children:"myco.db"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Schema"}),d.jsxs("span",{className:"font-mono text-on-surface",children:["v",e.schema.version]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-on-surface-variant",children:"Journal"}),d.jsx("span",{className:"font-mono text-on-surface uppercase",children:e.schema.journal_mode})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"}),d.jsx("span",{className:"text-on-surface-variant",children:"healthy"})]})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[d.jsx(Yt,{label:"Database Size",value:xo(e.file.size_bytes),sparklineData:a,accent:"sage"}),d.jsx(Yt,{label:"Fragmentation",value:b,accent:w}),d.jsx(Yt,{label:"WAL Size",value:xo(e.file.wal_size_bytes),accent:"outline"})]}),d.jsxs($e,{level:"low",className:"p-6 space-y-4",children:[d.jsx(St,{children:"Schema Breakdown"}),d.jsx(Dae,{tables:e.tables})]}),d.jsx(Mae,{indexes:e.indexes}),d.jsx(_ae,{details:e,onActionResult:o}),d.jsx(Oae,{onActionResult:o}),l&&d.jsx("p",{className:ke("font-sans text-sm",l.type==="success"?"text-primary":"text-tertiary"),children:l.text}),d.jsxs($e,{level:"low",className:"flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[d.jsx(St,{children:"Activity Log"}),d.jsxs(Ae,{size:"sm",variant:h?"default":"ghost",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>{h?p(!1):x()},title:h?"Pause auto-scroll":"Resume auto-scroll",children:[h?d.jsx(I1,{className:"h-3 w-3"}):d.jsx(is,{className:"h-3 w-3"}),h?"Pause":"Resume"]})]}),d.jsxs("div",{className:"relative flex-1 p-0",children:[d.jsx("div",{ref:c,onScroll:y,className:"h-64 overflow-y-auto font-mono text-xs bg-surface-container-lowest",children:f.length===0?d.jsx("div",{className:"flex h-32 items-center justify-center font-sans text-on-surface-variant",children:"No database log entries"}):d.jsx("table",{className:"w-full border-collapse","aria-label":"Database activity log",children:d.jsx("tbody",{children:f.map((S,N)=>d.jsx(R3,{entry:S},S.timestamp+"-"+N))})})}),m&&!h&&d.jsxs("button",{type:"button",onClick:x,className:ke("absolute bottom-4 left-1/2 -translate-x-1/2","flex items-center gap-1.5 rounded-full","bg-surface-container-high px-3 py-1.5 text-xs font-medium shadow-ambient","text-on-surface-variant transition-colors hover:text-on-surface"),children:[d.jsx(nD,{className:"h-3 w-3"}),"New entries below"]})]})]})]})}const zae={embedding:"Embedding health, maintenance actions, and activity log",database:"Schema inspection, maintenance actions, and scheduled optimization",system:"Software updates and backup management"};function Iae(){const{data:e,isLoading:t,isError:n,error:r}=lae(),[a,i]=j.useState(Nae),l=j.useCallback(o=>{const f=o;i(f),kae(f)},[]);return d.jsx(xw,{isLoading:t,error:n?r instanceof Error?r:new Error("Unable to reach daemon"):null,loadingText:"Loading operations...",children:e&&d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"px-6 pt-6",children:d.jsx(Si,{title:"Operations",subtitle:zae[a],tabs:Eae,activeTab:a,onTabChange:l})}),d.jsx("div",{className:"flex-1 overflow-auto",children:d.jsxs("div",{className:"px-6 pb-6",children:[a==="embedding"&&d.jsx(Lae,{data:e}),a==="database"&&d.jsx(Bae,{}),a==="system"&&d.jsx(Pae,{})]})})]})})}function Fae(){return Qr({queryKey:["team-status"],queryFn:({signal:e})=>lt("/team/status",{signal:e}),refetchInterval:Sr.STATS,pollCategory:"standard"})}function Mu({label:e,value:t,mono:n=!0}){const[r,a]=j.useState(!1),i=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},[t]);return d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),d.jsxs("div",{className:"flex items-center gap-2 group",children:[d.jsx("span",{className:`text-sm text-on-surface break-all ${n?"font-mono":""}`,children:t}),d.jsx("button",{type:"button",onClick:i,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:r?d.jsx(Dd,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(B1,{className:"h-3.5 w-3.5"})})]})]})}function tR({label:e,value:t}){const[n,r]=j.useState(!1),[a,i]=j.useState(!1),l=j.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[t]),o=`${t.slice(0,8)}${"*".repeat(Math.max(0,t.length-12))}${t.slice(-4)}`;return d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:e}),d.jsxs("div",{className:"flex items-center gap-2 group",children:[d.jsx("span",{className:"text-sm text-on-surface font-mono break-all",children:n?t:o}),d.jsx("button",{type:"button",onClick:()=>r(!n),className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface transition-opacity",title:n?"Hide":"Reveal",children:n?d.jsx(Pz,{className:"h-3.5 w-3.5"}):d.jsx(Bz,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 p-1 rounded text-on-surface-variant hover:text-on-surface opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy to clipboard",children:a?d.jsx(Dd,{className:"h-3.5 w-3.5 text-primary"}):d.jsx(B1,{className:"h-3.5 w-3.5"})})]})]})}function Uae({onConnected:e}){const[t,n]=j.useState(""),[r,a]=j.useState(""),[i,l]=j.useState(null),[o,f]=j.useState(!1),c=async h=>{h.preventDefault(),l(null),f(!0);try{await Qt("/team/connect",{url:t,api_key:r}),e()}catch(p){l(p instanceof Error?p.message:"Connection failed")}finally{f(!1)}};return d.jsxs($e,{level:"low",ghostBorder:!0,className:"p-6",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[d.jsx(lI,{className:"h-4 w-4 text-on-surface-variant"}),d.jsx(St,{children:"Connect to team"})]}),d.jsx("p",{className:"text-sm text-on-surface-variant mb-4",children:"Enter the URL and API key for your team's Cloudflare Worker to enable cross-machine knowledge sharing."}),d.jsxs("form",{onSubmit:c,className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"Worker URL"}),d.jsx(fn,{type:"url",placeholder:"https://myco-team.your-account.workers.dev",value:t,onChange:h=>n(h.target.value),required:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-on-surface-variant mb-1",children:"API Key"}),d.jsx(fn,{type:"password",placeholder:"your-api-key",value:r,onChange:h=>a(h.target.value),required:!0})]}),i&&d.jsx("p",{className:"text-sm text-tertiary",children:i}),d.jsx(Ae,{type:"submit",size:"sm",disabled:o||!t||!r,children:o?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Connecting..."]}):"Connect"})]})]})}function qae({status:e}){const t=Sn(),[n,r]=j.useState(!1),[a,i]=j.useState(!1),[l,o]=j.useState(null),[f,c]=j.useState(!1),[h,p]=j.useState(null),[m,y]=j.useState(!1),[x,b]=j.useState(null),[w,S]=j.useState(!1),[N,E]=j.useState(!1),[T,R]=j.useState(!1),A=async()=>{r(!0);try{await Qt("/team/disconnect"),t.invalidateQueries({queryKey:["team-status"]})}finally{r(!1)}},D=j.useCallback(async()=>{i(!0),o(null);try{const M=await Qt("/team/backfill");o(M.enqueued>0?`Enqueued ${M.enqueued} records for sync. They'll push on the next flush cycle.`:"All records are already synced or enqueued."),t.invalidateQueries({queryKey:["team-status"]})}catch{o("Backfill failed.")}finally{i(!1)}},[t]),_=j.useCallback(async()=>{c(!0),p(null);try{const M=await Qt("/team/upgrade-worker");M.success?(p(`Worker updated to v${M.version}`),t.invalidateQueries({queryKey:["team-status"]})):p(M.error??"Upgrade failed")}catch(M){p(M instanceof Error?M.message:"Upgrade failed")}finally{c(!1)}},[t]),L=j.useCallback(async()=>{y(!0),b(null);try{const M=await Qt("/team/retry-failed");b(M.retried>0?`Re-queued ${M.retried} record${M.retried>1?"s":""} for sync.`:"No failed records to retry."),t.invalidateQueries({queryKey:["team-status"]})}catch{b("Retry failed.")}finally{y(!1)}},[t]);return d.jsxs("div",{className:"space-y-4",children:[e.worker_update_available&&d.jsxs($e,{level:"low",ghostBorder:!0,className:"p-4 border-l-2 border-l-ochre",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(jb,{className:"h-5 w-5 text-ochre flex-shrink-0"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface",children:"Worker update available"}),d.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Deployed: v",e.deployed_worker_version??"?"," — Local team package: v",e.local_team_package_version??"?"]})]})]}),d.jsx(Ae,{variant:"default",size:"sm",onClick:_,disabled:f,children:f?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Deploying..."]}):"Update Worker"})]}),h&&d.jsx("p",{className:"text-xs text-on-surface-variant mt-2",children:h})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[d.jsx(Yt,{label:"Status",value:e.healthy?"Connected":"Unhealthy",accent:e.healthy?"sage":"terracotta"}),d.jsx(Yt,{label:"Pending sync",value:String(e.pending_sync_count),accent:e.dead_letter_count>0?"terracotta":"outline",sublabel:e.dead_letter_count>0?`${e.dead_letter_count} failed`:void 0,href:"/logs?component=team-sync"}),d.jsx(Yt,{label:"Protocol",value:`v${e.sync_protocol_version}`,accent:"outline"}),d.jsx(Yt,{label:"Schema",value:`v${e.schema_version}`,accent:"outline"})]}),d.jsxs($e,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(St,{children:"Team Credentials"}),d.jsx(xt,{variant:e.healthy?"default":"destructive",children:e.healthy?"healthy":"unhealthy"})]}),d.jsx("p",{className:"text-xs text-on-surface-variant",children:"Share these with teammates so they can connect from the Team page."}),d.jsxs("div",{className:"space-y-3",children:[e.worker_url&&d.jsx(Mu,{label:"Worker URL",value:e.worker_url}),e.api_key&&d.jsx(tR,{label:"API Key",value:e.api_key})]})]}),e.mcp_token&&e.mcp_endpoint&&d.jsxs($e,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(St,{children:"Cloud MCP Endpoint"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>S(!w),className:"text-xs text-on-surface-variant hover:text-on-surface transition-colors",children:w?"Hide snippet":"Config snippet"}),d.jsx("button",{onClick:()=>E(!0),className:"text-xs text-on-surface-variant hover:text-terracotta-text transition-colors",children:"Rotate token"})]})]}),d.jsx("p",{className:"text-xs text-on-surface-variant",children:"Configure cloud agents with this endpoint to access project team intelligence."}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(Mu,{label:"MCP URL",value:e.mcp_endpoint}),d.jsx(tR,{label:"MCP Access Token",value:e.mcp_token})]}),w&&(()=>{const M=JSON.stringify({mcp_servers:[{type:"url",url:e.mcp_endpoint,name:"myco",authorization_token:e.mcp_token}]},null,2);return d.jsxs("div",{className:"relative",children:[d.jsx("pre",{className:"text-xs bg-surface-container p-3 rounded-lg overflow-x-auto text-on-surface-variant",children:M}),d.jsx("button",{onClick:()=>navigator.clipboard.writeText(M),className:"absolute top-2 right-2 p-1 rounded hover:bg-surface-container-high transition-colors",children:d.jsx(B1,{className:"h-3.5 w-3.5 text-on-surface-variant"})})]})})()]}),d.jsxs($e,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[d.jsx(St,{children:"This Node"}),d.jsxs("div",{className:"grid gap-3",children:[d.jsx(Mu,{label:"Machine ID",value:e.machine_id}),d.jsx(Mu,{label:"Package Version",value:e.package_version})]}),e.health_error&&d.jsx("p",{className:"text-sm text-tertiary mt-2",children:e.health_error})]}),d.jsxs($e,{level:"low",ghostBorder:!0,className:"p-5 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(St,{children:"Collective"}),d.jsx(xt,{variant:e.collective_connected?"default":"outline",children:e.collective_connected?"connected":"not connected"})]}),e.collective_connected?d.jsxs("div",{className:"space-y-3",children:[e.collective_url&&d.jsx(Mu,{label:"Collective URL",value:e.collective_url}),e.collective_project_id&&d.jsx(Mu,{label:"Project ID",value:e.collective_project_id}),d.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:"Last settings sync"}),d.jsx("p",{className:"text-sm text-on-surface",children:e.collective_last_settings_sync?new Date(e.collective_last_settings_sync*1e3).toLocaleString():"Never"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:"Last heartbeat"}),d.jsx("p",{className:"text-sm text-on-surface",children:e.collective_last_heartbeat?new Date(e.collective_last_heartbeat*1e3).toLocaleString():"Never"})]})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:"Capabilities"}),d.jsx("div",{className:"flex flex-wrap gap-2",children:e.collective_capabilities.map(M=>d.jsx(xt,{variant:"outline",children:M},M))})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-xs text-on-surface-variant",children:"Effective overrides"}),d.jsx("pre",{className:"text-xs bg-surface-container p-3 rounded-lg overflow-x-auto text-on-surface-variant",children:JSON.stringify(e.collective_settings,null,2)})]})]}):d.jsx("p",{className:"text-sm text-on-surface-variant",children:"This team worker is not currently connected to a Myco Collective."})]}),d.jsxs($e,{level:"low",ghostBorder:!0,className:"p-5 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(St,{children:"Sync"}),d.jsx(Ae,{variant:"default",size:"sm",onClick:D,disabled:a,children:a?d.jsxs(d.Fragment,{children:[d.jsx(gl,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Syncing..."]}):"Sync All"})]}),d.jsx("p",{className:"text-xs text-on-surface-variant",children:"Push all unsynced local knowledge to the team store. Records sync automatically on new writes, but historical data needs a one-time backfill."}),l&&d.jsx("p",{className:"text-sm text-primary",children:l}),e.dead_letter_count>0&&d.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-outline-variant/10",children:[d.jsxs("p",{className:"text-xs text-on-surface-variant",children:[d.jsxs("span",{className:"text-tertiary font-medium",children:[e.dead_letter_count," failed"]})," record",e.dead_letter_count>1?"s":""," — exceeded max retries."," ",d.jsx("a",{href:"/logs?component=team-sync&level=error",className:"underline hover:text-on-surface",children:"View logs"})]}),d.jsx(Ae,{variant:"outline",size:"sm",onClick:L,disabled:m,children:m?"Retrying...":"Retry Failed"})]}),x&&d.jsx("p",{className:"text-xs text-primary",children:x})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Ae,{variant:"outline",size:"sm",onClick:A,disabled:n,children:n?"Disconnecting...":"Disconnect"})}),d.jsx(cm,{open:N,onOpenChange:E,title:"Rotate MCP Access Token",description:"This will invalidate the current MCP token. Any cloud agents using it will lose access until reconfigured with the new token.",confirmLabel:"Rotate Token",variant:"destructive",isPending:T,onConfirm:async()=>{R(!0);try{await Qt("/team/rotate-mcp-token"),t.invalidateQueries({queryKey:["team-status"]}),E(!1)}catch{}finally{R(!1)}}})]})}function Vae(){const{data:e,isLoading:t}=Fae(),n=Sn();if(t)return d.jsx(xw,{isLoading:!0,error:null,children:d.jsx("span",{})});const r=(e==null?void 0:e.enabled)&&(e==null?void 0:e.worker_url);return d.jsxs("div",{className:"p-6 max-w-4xl",children:[d.jsx(Si,{title:"Team",subtitle:"Share knowledge across machines with team sync"}),r&&e?d.jsx(qae,{status:e}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs($e,{level:"low",ghostBorder:!0,className:"p-6 space-y-4",children:[d.jsx(St,{children:"Getting Started"}),d.jsx("p",{className:"text-sm text-on-surface-variant",children:"Team sync lets multiple machines share captured knowledge through a Cloudflare Worker. One team member provisions the infrastructure, then shares the connection details."}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"1. Install Wrangler"}),d.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"npm install -g wrangler && wrangler login"})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"2. Provision the team"}),d.jsx("code",{className:"block font-mono text-xs bg-surface-container rounded px-3 py-2 text-on-surface-variant",children:"myco team init"}),d.jsx("p",{className:"text-xs text-on-surface-variant mt-1",children:"Creates a D1 database, Vectorize index, and deploys the sync worker. Outputs a Worker URL and API key to share with teammates."})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-on-surface mb-1",children:"3. Connect"}),d.jsxs("p",{className:"text-xs text-on-surface-variant",children:["Paste the Worker URL and API key below, or if you ran ",d.jsx("code",{className:"font-mono",children:"myco team init"}),", you're already connected."]})]})]})]}),d.jsx(Uae,{onConnected:()=>n.invalidateQueries({queryKey:["team-status"]})})]})]})}const Hae=[{value:"15m",label:"15m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"},{value:"30d",label:"30d"}];function Gae({mode:e,onModeChange:t,searchValue:n,onSearchChange:r,onSearchSubmit:a,activeLevel:i,onLevelChange:l,components:o,activeComponents:f,onComponentToggle:c,onComponentsClear:h,timeRange:p,onTimeRangeChange:m,totalResults:y,paused:x=!1,onPausedToggle:b}){return d.jsxs($e,{level:"default",className:"rounded-md p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"flex items-center rounded-md bg-surface-container-low",children:[d.jsxs(Ae,{size:"sm",variant:e==="live"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-r-none",onClick:()=>t("live"),children:[d.jsx(lD,{className:"h-3 w-3"}),"Live"]}),d.jsxs(Ae,{size:"sm",variant:e==="search"?"default":"ghost",className:"h-7 gap-1.5 px-2.5 text-xs rounded-l-none",onClick:()=>t("search"),children:[d.jsx(pc,{className:"h-3 w-3"}),"Search"]})]}),e==="live"&&b&&d.jsxs(Ae,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 px-2.5 text-xs",onClick:b,"aria-label":x?"Resume log stream":"Pause log stream",title:x?"Resume":"Pause",children:[x?d.jsx(is,{className:"h-3 w-3"}):d.jsx(I1,{className:"h-3 w-3"}),x?"Resume":"Pause"]}),e==="search"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-5 w-px bg-outline-variant/30"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(rD,{className:"h-3 w-3 text-on-surface-variant/50"}),Hae.map(w=>d.jsx(Ae,{size:"sm",variant:p===w.value?"default":"ghost",className:"h-6 px-1.5 text-[10px]",onClick:()=>m(w.value),children:w.label},w.value))]})]}),d.jsx("form",{className:"ml-auto flex items-center gap-1.5",onSubmit:w=>{w.preventDefault(),a()},children:d.jsx(fn,{className:"h-7 w-56 text-xs",placeholder:e==="search"?"Search logs...":"Filter messages...",value:n,onChange:w=>r(w.target.value),"aria-label":"Search log messages"})}),e==="search"&&y!==void 0&&d.jsxs("span",{className:"text-[10px] font-mono text-on-surface-variant/50 tabular-nums whitespace-nowrap",children:[y.toLocaleString()," results"]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex items-center gap-1",children:pI.map(w=>d.jsxs(Ae,{size:"sm",variant:i===w?"default":"ghost",className:"h-6 px-2 text-[10px] capitalize gap-1.5",onClick:()=>l(w),children:[d.jsx("div",{className:ke("h-1.5 w-1.5 rounded-full",V1(w))}),w]},w))}),o.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"h-4 w-px bg-outline-variant/20"}),d.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[o.map(w=>d.jsx(Ae,{size:"sm",variant:f.has(w)?"default":"ghost",className:"h-5 px-1.5 text-[10px]",onClick:()=>c(w),children:w},w)),f.size>0&&d.jsx(Ae,{size:"sm",variant:"ghost",className:"h-5 px-1.5 text-[10px] text-on-surface-variant",onClick:h,children:"clear"})]})]})]})]})}const $ae={debug:"border-l-outline/30",info:"border-l-primary/50",warn:"border-l-secondary/70",error:"border-l-tertiary/80"},Kae={context:"text-primary/70",hooks:"text-on-surface-variant/70",agent:"text-secondary/80",daemon:"text-on-surface-variant/60",capture:"text-primary/60",processor:"text-on-surface-variant/70",lifecycle:"text-primary/50",embedding:"text-on-surface-variant/60",power:"text-on-surface-variant/50",server:"text-on-surface-variant/60"};function Yae(e,t){if(t)return lm(e);const n=new Date(e),r=String(n.getHours()).padStart(2,"0"),a=String(n.getMinutes()).padStart(2,"0"),i=String(n.getSeconds()).padStart(2,"0");return`${r}:${a}:${i}`}const Xae=40,Qae=60;function Xs(e){return typeof e=="string"&&e.length>0?e:null}const Wae=[{pick:e=>Xs(e.tool_name)},{pick:e=>Xs(e.type)},{pick:e=>Xs(e.agent_type)},{pick:e=>Xs(e.task_subject),format:e=>Sp(e,Xae)},{pick:e=>Xs(e.filename)},{pick:e=>Xs(e.source_path)??Xs(e.path),format:tG},{pick:e=>Xs(e.error),format:e=>Sp(e,Qae)},{pick:e=>typeof e.pid=="number"?`pid ${e.pid}`:null}];function Zae(e){if(!e)return"";for(const{pick:t,format:n}of Wae){const r=t(e);if(r)return n?n(r):r}return""}function Jae({entries:e,selectedId:t,onSelect:n,autoScroll:r=!1,relativeTime:a=!1,compact:i=!0}){const l=j.useRef(null);return j.useEffect(()=>{!r||!l.current||(l.current.scrollTop=l.current.scrollHeight)},[e,r]),d.jsx("div",{ref:l,className:"flex-1 overflow-y-auto bg-surface-container-lowest font-mono text-xs",children:e.length===0?d.jsx("div",{className:"flex h-full min-h-[200px] items-center justify-center text-on-surface-variant/50 font-sans text-sm",children:"No log entries"}):d.jsxs("table",{className:"w-full border-collapse","aria-label":"Log entries",children:[d.jsx("thead",{className:"sticky top-0 z-10 bg-surface-container-lowest/95 backdrop-blur supports-[backdrop-filter]:bg-surface-container-lowest/80",children:d.jsxs("tr",{className:"border-b border-outline-variant/10 text-[10px] uppercase tracking-[0.16em] text-on-surface-variant/50",children:[d.jsx("th",{className:"w-[68px] px-3 py-2 text-left font-medium",children:"Time"}),d.jsx("th",{className:"w-[12px] px-0 py-2","aria-hidden":"true"}),d.jsx("th",{className:"w-[48px] px-0 py-2 text-left font-medium",children:"Level"}),d.jsx("th",{className:"w-[90px] px-0 py-2 text-left font-medium",children:"Area"}),d.jsx("th",{className:"w-[72px] px-0 py-2 text-left font-medium",children:"Session"}),d.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Message"})]})}),d.jsx("tbody",{children:e.map(o=>d.jsx(eie,{entry:o,selected:o.id===t,onSelect:n,relativeTime:a,compact:i},o.id))})]})})}const eie=j.memo(function({entry:t,selected:n,onSelect:r,relativeTime:a,compact:i}){const l=i?"py-0.5":"py-1.5",o=vl(t.session_id),f=Zae(t.data);return d.jsxs("tr",{className:ke("cursor-pointer transition-colors border-l-2",$ae[t.level],n?"bg-primary/10":"hover:bg-surface-container-high/30"),onClick:()=>r(t),children:[d.jsx("td",{className:ke("whitespace-nowrap pl-3 pr-2 text-on-surface-variant/50 align-top w-[68px] tabular-nums",l),children:Yae(t.timestamp,a)}),d.jsx("td",{className:ke("whitespace-nowrap pr-1 align-top w-[12px]",l),children:d.jsx("div",{className:ke("h-1.5 w-1.5 rounded-full mt-1",V1(t.level))})}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[48px]",l),children:d.jsx(xt,{variant:vD(t.level),className:"px-1 py-0 text-[9px] uppercase",children:t.level})}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[90px] truncate max-w-[90px]",l,Kae[t.component]??"text-on-surface-variant/60"),children:t.component}),d.jsx("td",{className:ke("whitespace-nowrap pr-2 align-top w-[72px] tabular-nums text-on-surface-variant/40",l),title:t.session_id??"",children:o}),d.jsxs("td",{className:ke("pr-3 text-on-surface align-top break-words",l),children:[d.jsx("span",{children:t.message}),f&&d.jsxs("span",{className:"ml-2 text-on-surface-variant/50",children:["· ",f]})]})]})});function tie({value:e}){const t=String(e),n=t.slice(0,8);return d.jsxs(Ma,{to:`/sessions/${t}`,className:"font-mono text-primary hover:underline",children:[n,"..."]})}function nie({value:e}){return Array.isArray(e)?d.jsx("span",{className:"flex flex-wrap gap-1",children:e.map((t,n)=>d.jsx(xt,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:String(t)},n))}):d.jsx("span",{children:String(e)})}function rie({value:e}){return Array.isArray(e)?d.jsx("span",{className:"flex gap-1",children:e.map((t,n)=>d.jsx(xt,{variant:"outline",className:"text-[10px] px-1.5 py-0 tabular-nums",children:String(t)},n))}):d.jsx("span",{children:String(e)})}function aie({value:e}){return d.jsx("span",{className:"rounded bg-tertiary/10 px-2 py-0.5 text-tertiary font-mono text-[11px]",children:String(e)})}function nR({value:e}){return d.jsx("pre",{className:"max-h-32 overflow-auto rounded bg-surface-container-lowest px-2 py-1 text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:String(e)})}function iie({value:e}){const t=new Date(String(e)),r=new Date().getTime()-t.getTime(),a=Math.floor(r/6e4),i=Math.floor(a/60),l=Math.floor(i/24);let o;return a<1?o="just now":a<60?o=`${a}m ago`:i<24?o=`${i}h ago`:o=`${l}d ago`,d.jsx("span",{className:"tabular-nums",title:t.toISOString(),children:o})}function sie({value:e}){return typeof e=="object"&&e!==null?d.jsx("pre",{className:"text-[11px] font-mono text-on-surface-variant whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):d.jsx("span",{children:String(e)})}const lie={session_id:tie,spore_titles:nie,scores:rie,error:aie,preview:nR,generated_at:iie,text:nR},oie=new Set(["id","timestamp","level","kind","component","message"]);function rR(e,t){const n=lie[e]??sie;return d.jsx(n,{value:t})}function uie(e){return oie.has(e)}function cie(e){return e?Object.entries(e).filter(([t])=>!uie(t)):[]}const fie={debug:"text-on-surface-variant/60",info:"text-primary",warn:"text-secondary",error:"text-tertiary"};function die({entry:e,resolved:t,onClose:n}){const r=cie(e.data);return d.jsxs("div",{className:"flex h-full flex-col bg-surface-container-low",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/10",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(xt,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-mono",children:e.kind}),d.jsx("span",{className:ke("text-xs font-medium",fie[e.level]),children:e.level.toUpperCase()})]}),d.jsx(Ae,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:n,"aria-label":"Close detail panel",children:d.jsx(kl,{className:"h-3.5 w-3.5"})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-4",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Timestamp"}),d.jsx("div",{className:"font-mono text-xs tabular-nums",children:new Date(e.timestamp).toLocaleString()})]}),d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Message"}),d.jsx("div",{className:"text-sm text-on-surface leading-relaxed",children:e.message})]}),e.session_id&&d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-0.5",children:"Session"}),d.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[rR("session_id",e.session_id),!!(t!=null&&t.session_title)&&d.jsx("span",{className:"text-on-surface-variant/70",children:String(t.session_title)})]})]}),r.length>0&&d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] uppercase tracking-wider text-on-surface-variant/50 mb-1.5",children:"Metadata"}),d.jsx("div",{className:"space-y-2",children:r.map(([a,i])=>d.jsxs("div",{children:[d.jsx("div",{className:"text-[10px] text-on-surface-variant/40 mb-0.5",children:a}),d.jsx("div",{className:"text-xs",children:rR(a,i)})]},a))})]})]}),d.jsx("div",{className:"px-4 py-2 border-t border-outline-variant/10",children:d.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/40 tabular-nums",children:["id: ",e.id]})})]})}const aR=5e3;function hie(e=!1){const[t,n]=j.useState([]),r=j.useRef(null),{data:a,refetch:i}=qt({queryKey:["logs-stream"],queryFn:({signal:f})=>{const c=r.current===null?"/logs/stream":`/logs/stream?since=${r.current}`;return lt(c,{signal:f})},refetchInterval:e?!1:Sr.LOGS}),l=j.useRef(e);j.useEffect(()=>{l.current&&!e&&i(),l.current=e},[e,i]),j.useEffect(()=>{if(!(a!=null&&a.entries.length)){a&&r.current===null&&(r.current=a.cursor);return}r.current=a.cursor,n(f=>{const c=[...f,...a.entries];return c.length>aR?c.slice(-aR):c})},[a]);const o=j.useCallback(()=>{n([]),r.current=null},[]);return{entries:t,clear:o}}function vie(e,t){const n=new URLSearchParams;return e.q&&n.set("q",e.q),e.level&&n.set("level",e.level),e.component&&n.set("component",e.component),e.kind&&n.set("kind",e.kind),e.session_id&&n.set("session_id",e.session_id),e.from&&n.set("from",e.from),e.to&&n.set("to",e.to),e.page&&n.set("page",String(e.page)),e.page_size&&n.set("page_size",String(e.page_size)),qt({queryKey:["logs-search",Object.fromEntries(n)],queryFn:({signal:r})=>lt(`/logs/search?${n.toString()}`,{signal:r}),enabled:t})}function pie(e){return qt({queryKey:["log-detail",e],queryFn:({signal:t})=>lt(`/logs/${e}`,{signal:t}),enabled:e!==null})}function mie(e){const t=Date.now(),n={"15m":15*6e4,"1h":60*6e4,"6h":360*6e4,"24h":1440*6e4,"7d":10080*6e4,"30d":720*60*6e4};return new Date(t-(n[e]??1440*6e4)).toISOString()}function gie(){const e=j.useMemo(()=>{var P;const K=new URLSearchParams(window.location.search),Q=((P=K.get("component"))==null?void 0:P.split(",").filter(Boolean))??[],F=K.get("level"),q=K.get("q")??"",X=Q.length>0||!!F||!!q;return{components:Q,level:F,q,hasFilters:X}},[]),[t,n]=j.useState(e.hasFilters?"search":"live"),[r,a]=j.useState(e.q),[i,l]=j.useState(e.q),[o,f]=j.useState(e.level??"debug"),[c,h]=j.useState(new Set(e.components)),[p,m]=j.useState("24h"),[y,x]=j.useState(1),[b,w]=j.useState(null),[S,N]=j.useState(!1),{entries:E,clear:T}=hie(S),R=j.useMemo(()=>({q:i||void 0,level:o!=="debug"?o:void 0,component:c.size>0?Array.from(c).join(","):void 0,from:mie(p),page:y,page_size:Yr}),[i,o,c,p,y]),{data:A}=vie(R,t==="search"),{data:D}=pie((b==null?void 0:b.id)??null),[_,L]=j.useState(e.components);j.useEffect(()=>{const K=t==="live"?E:(A==null?void 0:A.entries)??[];L(Q=>{const F=new Set(Q);let q=!1;for(const X of K)F.has(X.component)||(F.add(X.component),q=!0);return q?Array.from(F).sort():Q})},[E,A,t]);const M=j.useMemo(()=>{const K=pp[o]??0,Q=r.trim().toLowerCase();return E.filter(F=>!((pp[F.level]??0)<K||c.size>0&&!c.has(F.component)||Q&&!F.message.toLowerCase().includes(Q)))},[E,o,c,r]),z=t==="live"?M:(A==null?void 0:A.entries)??[],B=j.useCallback(K=>{n(K),w(null),K==="live"&&(T(),N(!1))},[T]),H=j.useCallback(()=>{l(r),x(1)},[r]),G=j.useCallback(K=>{w(Q=>(Q==null?void 0:Q.id)===K.id?null:K)},[]),U=j.useCallback(K=>{h(Q=>{const F=new Set(Q);return F.has(K)?F.delete(K):F.add(K),F}),x(1)},[]),I=j.useCallback(K=>{f(K),x(1)},[]),V=b!==null;return d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"px-6 pt-6",children:d.jsx(Si,{title:"Logs",subtitle:"Daemon log explorer"})}),d.jsx("div",{className:"px-6 mb-3",children:d.jsx(Gae,{mode:t,onModeChange:B,searchValue:r,onSearchChange:a,onSearchSubmit:H,activeLevel:o,onLevelChange:I,components:_,activeComponents:c,onComponentToggle:U,onComponentsClear:()=>{h(new Set),x(1)},timeRange:p,onTimeRangeChange:K=>{m(K),x(1)},totalResults:t==="search"?A==null?void 0:A.total:void 0,paused:S,onPausedToggle:()=>N(K=>!K)})}),d.jsxs("div",{className:"flex flex-1 overflow-hidden mx-6 mb-6 rounded-lg border border-outline-variant/10",children:[d.jsxs("div",{className:ke("flex flex-col",V?"w-3/5":"w-full"),children:[d.jsx(Jae,{entries:z,selectedId:(b==null?void 0:b.id)??null,onSelect:G,autoScroll:t==="live"&&!S,relativeTime:t==="live",compact:!0}),t==="search"&&A&&d.jsx("div",{className:"border-t border-outline-variant/10 px-3 py-2 bg-surface-container-low",children:d.jsx(kc,{total:A.total,offset:(y-1)*Yr,limit:Yr,onPageChange:K=>x(Math.floor(K/Yr)+1)})})]}),V&&b&&d.jsx("div",{className:"w-2/5 border-l border-outline-variant/10",children:d.jsx(die,{entry:b,resolved:D==null?void 0:D.resolved,onClose:()=>w(null)})})]})]})}function yie(){return d.jsx(MB,{children:d.jsxs(Na,{element:d.jsx(J7,{}),children:[d.jsx(Na,{path:"/",element:d.jsx(WG,{})}),d.jsx(Na,{path:"/sessions",element:d.jsx(rT,{})}),d.jsx(Na,{path:"/sessions/:id",element:d.jsx(rT,{})}),d.jsx(Na,{path:"/mycelium",element:d.jsx(Tne,{})}),d.jsx(Na,{path:"/agent",element:d.jsx(bre,{})}),d.jsx(Na,{path:"/skills",element:d.jsx(Yre,{})}),d.jsx(Na,{path:"/settings",element:d.jsx(sae,{})}),d.jsx(Na,{path:"/operations",element:d.jsx(Iae,{})}),d.jsx(Na,{path:"/team",element:d.jsx(Vae,{})}),d.jsx(Na,{path:"/logs",element:d.jsx(gie,{})})]})})}const xie=new xP({defaultOptions:{queries:{staleTime:hI}}});Y4.createRoot(document.getElementById("root")).render(d.jsx(Xi.StrictMode,{children:d.jsx(vz,{children:d.jsx(bz,{children:d.jsx(Cz,{children:d.jsx(bP,{client:xie,children:d.jsx(nz,{children:d.jsx(yie,{})})})})})})}));
|