@sulala/agent-os 0.1.31 → 0.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dashboard-dist/assets/index-Bv_g9PCc.js +128 -0
- package/dashboard-dist/assets/index-DX4XitXH.css +1 -0
- package/dashboard-dist/index.html +2 -2
- package/dist/cli.js +10 -6
- package/dist/index.js +10 -6
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
function O4(e,n){for(var r=0;r<n.length;r++){const i=n[r];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function r(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=r(s);fetch(s.href,l)}})();function mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xg={exports:{}},uu={};var KS;function z4(){if(KS)return uu;KS=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(i,s,l){var u=null;if(l!==void 0&&(u=""+l),s.key!==void 0&&(u=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:i,key:u,ref:s!==void 0?s:null,props:l}}return uu.Fragment=n,uu.jsx=r,uu.jsxs=r,uu}var WS;function P4(){return WS||(WS=1,xg.exports=z4()),xg.exports}var f=P4(),bg={exports:{}},Ye={};var ZS;function L4(){if(ZS)return Ye;ZS=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(F){return F===null||typeof F!="object"?null:(F=v&&F[v]||F["@@iterator"],typeof F=="function"?F:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,k={};function j(F,G,L){this.props=F,this.context=G,this.refs=k,this.updater=L||_}j.prototype.isReactComponent={},j.prototype.setState=function(F,G){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,G,"setState")},j.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function E(){}E.prototype=j.prototype;function N(F,G,L){this.props=F,this.context=G,this.refs=k,this.updater=L||_}var M=N.prototype=new E;M.constructor=N,C(M,j.prototype),M.isPureReactComponent=!0;var R=Array.isArray;function z(){}var P={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function $(F,G,L){var ee=L.ref;return{$$typeof:e,type:F,key:G,ref:ee!==void 0?ee:null,props:L}}function U(F,G){return $(F.type,G,F.props)}function X(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function K(F){var G={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(L){return G[L]})}var ae=/\/+/g;function B(F,G){return typeof F=="object"&&F!==null&&F.key!=null?K(""+F.key):G.toString(36)}function Z(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(z,z):(F.status="pending",F.then(function(G){F.status==="pending"&&(F.status="fulfilled",F.value=G)},function(G){F.status==="pending"&&(F.status="rejected",F.reason=G)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function O(F,G,L,ee,ce){var Y=typeof F;(Y==="undefined"||Y==="boolean")&&(F=null);var Q=!1;if(F===null)Q=!0;else switch(Y){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(F.$$typeof){case e:case n:Q=!0;break;case g:return Q=F._init,O(Q(F._payload),G,L,ee,ce)}}if(Q)return ce=ce(F),Q=ee===""?"."+B(F,0):ee,R(ce)?(L="",Q!=null&&(L=Q.replace(ae,"$&/")+"/"),O(ce,G,L,"",function(we){return we})):ce!=null&&(X(ce)&&(ce=U(ce,L+(ce.key==null||F&&F.key===ce.key?"":(""+ce.key).replace(ae,"$&/")+"/")+Q)),G.push(ce)),1;Q=0;var re=ee===""?".":ee+":";if(R(F))for(var fe=0;fe<F.length;fe++)ee=F[fe],Y=re+B(ee,fe),Q+=O(ee,G,L,Y,ce);else if(fe=x(F),typeof fe=="function")for(F=fe.call(F),fe=0;!(ee=F.next()).done;)ee=ee.value,Y=re+B(ee,fe++),Q+=O(ee,G,L,Y,ce);else if(Y==="object"){if(typeof F.then=="function")return O(Z(F),G,L,ee,ce);throw G=String(F),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Q}function q(F,G,L){if(F==null)return F;var ee=[],ce=0;return O(F,ee,"","",function(Y){return G.call(L,Y,ce++)}),ee}function I(F){if(F._status===-1){var G=F._result;G=G(),G.then(function(L){(F._status===0||F._status===-1)&&(F._status=1,F._result=L)},function(L){(F._status===0||F._status===-1)&&(F._status=2,F._result=L)}),F._status===-1&&(F._status=0,F._result=G)}if(F._status===1)return F._result.default;throw F._result}var H=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},A={map:q,forEach:function(F,G,L){q(F,function(){G.apply(this,arguments)},L)},count:function(F){var G=0;return q(F,function(){G++}),G},toArray:function(F){return q(F,function(G){return G})||[]},only:function(F){if(!X(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return Ye.Activity=y,Ye.Children=A,Ye.Component=j,Ye.Fragment=r,Ye.Profiler=s,Ye.PureComponent=N,Ye.StrictMode=i,Ye.Suspense=h,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(F){return P.H.useMemoCache(F)}},Ye.cache=function(F){return function(){return F.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(F,G,L){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var ee=C({},F.props),ce=F.key;if(G!=null)for(Y in G.key!==void 0&&(ce=""+G.key),G)!D.call(G,Y)||Y==="key"||Y==="__self"||Y==="__source"||Y==="ref"&&G.ref===void 0||(ee[Y]=G[Y]);var Y=arguments.length-2;if(Y===1)ee.children=L;else if(1<Y){for(var Q=Array(Y),re=0;re<Y;re++)Q[re]=arguments[re+2];ee.children=Q}return $(F.type,ce,ee)},Ye.createContext=function(F){return F={$$typeof:u,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:l,_context:F},F},Ye.createElement=function(F,G,L){var ee,ce={},Y=null;if(G!=null)for(ee in G.key!==void 0&&(Y=""+G.key),G)D.call(G,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ce[ee]=G[ee]);var Q=arguments.length-2;if(Q===1)ce.children=L;else if(1<Q){for(var re=Array(Q),fe=0;fe<Q;fe++)re[fe]=arguments[fe+2];ce.children=re}if(F&&F.defaultProps)for(ee in Q=F.defaultProps,Q)ce[ee]===void 0&&(ce[ee]=Q[ee]);return $(F,Y,ce)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(F){return{$$typeof:d,render:F}},Ye.isValidElement=X,Ye.lazy=function(F){return{$$typeof:g,_payload:{_status:-1,_result:F},_init:I}},Ye.memo=function(F,G){return{$$typeof:p,type:F,compare:G===void 0?null:G}},Ye.startTransition=function(F){var G=P.T,L={};P.T=L;try{var ee=F(),ce=P.S;ce!==null&&ce(L,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(z,H)}catch(Y){H(Y)}finally{G!==null&&L.types!==null&&(G.types=L.types),P.T=G}},Ye.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ye.use=function(F){return P.H.use(F)},Ye.useActionState=function(F,G,L){return P.H.useActionState(F,G,L)},Ye.useCallback=function(F,G){return P.H.useCallback(F,G)},Ye.useContext=function(F){return P.H.useContext(F)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(F,G){return P.H.useDeferredValue(F,G)},Ye.useEffect=function(F,G){return P.H.useEffect(F,G)},Ye.useEffectEvent=function(F){return P.H.useEffectEvent(F)},Ye.useId=function(){return P.H.useId()},Ye.useImperativeHandle=function(F,G,L){return P.H.useImperativeHandle(F,G,L)},Ye.useInsertionEffect=function(F,G){return P.H.useInsertionEffect(F,G)},Ye.useLayoutEffect=function(F,G){return P.H.useLayoutEffect(F,G)},Ye.useMemo=function(F,G){return P.H.useMemo(F,G)},Ye.useOptimistic=function(F,G){return P.H.useOptimistic(F,G)},Ye.useReducer=function(F,G,L){return P.H.useReducer(F,G,L)},Ye.useRef=function(F){return P.H.useRef(F)},Ye.useState=function(F){return P.H.useState(F)},Ye.useSyncExternalStore=function(F,G,L){return P.H.useSyncExternalStore(F,G,L)},Ye.useTransition=function(){return P.H.useTransition()},Ye.version="19.2.4",Ye}var QS;function wh(){return QS||(QS=1,bg.exports=L4()),bg.exports}var S=wh();const Xn=mc(S),Sk=O4({__proto__:null,default:Xn},[S]);var wg={exports:{}},cu={},Sg={exports:{}},_g={};var JS;function I4(){return JS||(JS=1,(function(e){function n(O,q){var I=O.length;O.push(q);e:for(;0<I;){var H=I-1>>>1,A=O[H];if(0<s(A,q))O[H]=q,O[I]=A,I=H;else break e}}function r(O){return O.length===0?null:O[0]}function i(O){if(O.length===0)return null;var q=O[0],I=O.pop();if(I!==q){O[0]=I;e:for(var H=0,A=O.length,F=A>>>1;H<F;){var G=2*(H+1)-1,L=O[G],ee=G+1,ce=O[ee];if(0>s(L,I))ee<A&&0>s(ce,L)?(O[H]=ce,O[ee]=I,H=ee):(O[H]=L,O[G]=I,H=G);else if(ee<A&&0>s(ce,I))O[H]=ce,O[ee]=I,H=ee;else break e}}return q}function s(O,q){var I=O.sortIndex-q.sortIndex;return I!==0?I:O.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],p=[],g=1,y=null,v=3,x=!1,_=!1,C=!1,k=!1,j=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function M(O){for(var q=r(p);q!==null;){if(q.callback===null)i(p);else if(q.startTime<=O)i(p),q.sortIndex=q.expirationTime,n(h,q);else break;q=r(p)}}function R(O){if(C=!1,M(O),!_)if(r(h)!==null)_=!0,z||(z=!0,K());else{var q=r(p);q!==null&&Z(R,q.startTime-O)}}var z=!1,P=-1,D=5,$=-1;function U(){return k?!0:!(e.unstable_now()-$<D)}function X(){if(k=!1,z){var O=e.unstable_now();$=O;var q=!0;try{e:{_=!1,C&&(C=!1,E(P),P=-1),x=!0;var I=v;try{t:{for(M(O),y=r(h);y!==null&&!(y.expirationTime>O&&U());){var H=y.callback;if(typeof H=="function"){y.callback=null,v=y.priorityLevel;var A=H(y.expirationTime<=O);if(O=e.unstable_now(),typeof A=="function"){y.callback=A,M(O),q=!0;break t}y===r(h)&&i(h),M(O)}else i(h);y=r(h)}if(y!==null)q=!0;else{var F=r(p);F!==null&&Z(R,F.startTime-O),q=!1}}break e}finally{y=null,v=I,x=!1}q=void 0}}finally{q?K():z=!1}}}var K;if(typeof N=="function")K=function(){N(X)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,B=ae.port2;ae.port1.onmessage=X,K=function(){B.postMessage(null)}}else K=function(){j(X,0)};function Z(O,q){P=j(function(){O(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var q=3;break;default:q=v}var I=v;v=q;try{return O()}finally{v=I}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(O,q){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var I=v;v=O;try{return q()}finally{v=I}},e.unstable_scheduleCallback=function(O,q,I){var H=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?H+I:H):I=H,O){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=I+A,O={id:g++,callback:q,priorityLevel:O,startTime:I,expirationTime:A,sortIndex:-1},I>H?(O.sortIndex=I,n(p,O),r(h)===null&&O===r(p)&&(C?(E(P),P=-1):C=!0,Z(R,I-H))):(O.sortIndex=A,n(h,O),_||x||(_=!0,z||(z=!0,K()))),O},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(O){var q=v;return function(){var I=v;v=q;try{return O.apply(this,arguments)}finally{v=I}}}})(_g)),_g}var e_;function V4(){return e_||(e_=1,Sg.exports=I4()),Sg.exports}var Cg={exports:{}},En={};var t_;function F4(){if(t_)return En;t_=1;var e=wh();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(h,p,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:y==null?null:""+y,children:h,containerInfo:p,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return En.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,En.createPortal=function(h,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return l(h,p,null,g)},En.flushSync=function(h){var p=u.T,g=i.p;try{if(u.T=null,i.p=2,h)return h()}finally{u.T=p,i.p=g,i.d.f()}},En.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(h,p))},En.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},En.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var g=p.as,y=d(g,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?i.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:x}):g==="script"&&i.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},En.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=d(p.as,p.crossOrigin);i.d.M(h,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(h)},En.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,y=d(g,p.crossOrigin);i.d.L(h,g,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},En.preloadModule=function(h,p){if(typeof h=="string")if(p){var g=d(p.as,p.crossOrigin);i.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(h)},En.requestFormReset=function(h){i.d.r(h)},En.unstable_batchedUpdates=function(h,p){return h(p)},En.useFormState=function(h,p,g){return u.H.useFormState(h,p,g)},En.useFormStatus=function(){return u.H.useHostTransitionStatus()},En.version="19.2.4",En}var n_;function _k(){if(n_)return Cg.exports;n_=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(n){console.error(n)}}return e(),Cg.exports=F4(),Cg.exports}var r_;function U4(){if(r_)return cu;r_=1;var e=V4(),n=wh(),r=_k();function i(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var o=a,c=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(c=o.return),a=o.return;while(a)}return o.tag===3?c:null}function u(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function d(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function h(a){if(l(a)!==a)throw Error(i(188))}function p(a){var o=a.alternate;if(!o){if(o=l(a),o===null)throw Error(i(188));return o!==a?null:a}for(var c=a,m=o;;){var b=c.return;if(b===null)break;var w=b.alternate;if(w===null){if(m=b.return,m!==null){c=m;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===c)return h(b),a;if(w===m)return h(b),o;w=w.sibling}throw Error(i(188))}if(c.return!==m.return)c=b,m=w;else{for(var T=!1,V=b.child;V;){if(V===c){T=!0,c=b,m=w;break}if(V===m){T=!0,m=b,c=w;break}V=V.sibling}if(!T){for(V=w.child;V;){if(V===c){T=!0,c=w,m=b;break}if(V===m){T=!0,m=w,c=b;break}V=V.sibling}if(!T)throw Error(i(189))}}if(c.alternate!==m)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?a:o}function g(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=g(a),o!==null)return o;a=a.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function K(a){return a===null||typeof a!="object"?null:(a=X&&a[X]||a["@@iterator"],typeof a=="function"?a:null)}var ae=Symbol.for("react.client.reference");function B(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ae?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case C:return"Fragment";case j:return"Profiler";case k:return"StrictMode";case R:return"Suspense";case z:return"SuspenseList";case $:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case _:return"Portal";case N:return a.displayName||"Context";case E:return(a._context.displayName||"Context")+".Consumer";case M:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case P:return o=a.displayName||null,o!==null?o:B(a.type)||"Memo";case D:o=a._payload,a=a._init;try{return B(a(o))}catch{}}return null}var Z=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},H=[],A=-1;function F(a){return{current:a}}function G(a){0>A||(a.current=H[A],H[A]=null,A--)}function L(a,o){A++,H[A]=a.current,a.current=o}var ee=F(null),ce=F(null),Y=F(null),Q=F(null);function re(a,o){switch(L(Y,o),L(ce,a),L(ee,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?vS(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=vS(o),a=xS(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}G(ee),L(ee,a)}function fe(){G(ee),G(ce),G(Y)}function we(a){a.memoizedState!==null&&L(Q,a);var o=ee.current,c=xS(o,a.type);o!==c&&(L(ce,a),L(ee,c))}function ke(a){ce.current===a&&(G(ee),G(ce)),Q.current===a&&(G(Q),au._currentValue=I)}var Ie,et;function lt(a){if(Ie===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Ie=o&&o[1]||"",et=-1<c.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ie+a+et}var cn=!1;function yt(a,o){if(!a||cn)return"";cn=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(o){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(de){var ue=de}Reflect.construct(a,[],xe)}else{try{xe.call()}catch(de){ue=de}a.call(xe.prototype)}}else{try{throw Error()}catch(de){ue=de}(xe=a())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(de){if(de&&ue&&typeof de.stack=="string")return[de.stack,ue.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=m.DetermineComponentFrameRoot(),T=w[0],V=w[1];if(T&&V){var J=T.split(`
|
|
4
|
+
`),le=V.split(`
|
|
5
|
+
`);for(b=m=0;m<J.length&&!J[m].includes("DetermineComponentFrameRoot");)m++;for(;b<le.length&&!le[b].includes("DetermineComponentFrameRoot");)b++;if(m===J.length||b===le.length)for(m=J.length-1,b=le.length-1;1<=m&&0<=b&&J[m]!==le[b];)b--;for(;1<=m&&0<=b;m--,b--)if(J[m]!==le[b]){if(m!==1||b!==1)do if(m--,b--,0>b||J[m]!==le[b]){var ge=`
|
|
6
|
+
`+J[m].replace(" at new "," at ");return a.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",a.displayName)),ge}while(1<=m&&0<=b);break}}}finally{cn=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?lt(c):""}function me(a,o){switch(a.tag){case 26:case 27:case 5:return lt(a.type);case 16:return lt("Lazy");case 13:return a.child!==o&&o!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return yt(a.type,!1);case 11:return yt(a.type.render,!1);case 1:return yt(a.type,!0);case 31:return lt("Activity");default:return""}}function Le(a){try{var o="",c=null;do o+=me(a,c),c=a,a=a.return;while(a);return o}catch(m){return`
|
|
7
|
+
Error generating stack: `+m.message+`
|
|
8
|
+
`+m.stack}}var ut=Object.prototype.hasOwnProperty,Zt=e.unstable_scheduleCallback,Ut=e.unstable_cancelCallback,Cn=e.unstable_shouldYield,nn=e.unstable_requestPaint,wt=e.unstable_now,mn=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,W=e.unstable_LowPriority,ve=e.unstable_IdlePriority,st=e.log,jt=e.unstable_setDisableYieldValue,kt=null,Tt=null;function jn(a){if(typeof st=="function"&&jt(a),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(kt,a)}catch{}}var pt=Math.clz32?Math.clz32:_i,kn=Math.log,rn=Math.LN2;function _i(a){return a>>>=0,a===0?32:31-(kn(a)/rn|0)|0}var On=256,Qa=262144,Gs=4194304;function Ci(a){var o=a&42;if(o!==0)return o;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function qs(a,o,c){var m=a.pendingLanes;if(m===0)return 0;var b=0,w=a.suspendedLanes,T=a.pingedLanes;a=a.warmLanes;var V=m&134217727;return V!==0?(m=V&~w,m!==0?b=Ci(m):(T&=V,T!==0?b=Ci(T):c||(c=V&~a,c!==0&&(b=Ci(c))))):(V=m&~w,V!==0?b=Ci(V):T!==0?b=Ci(T):c||(c=m&~a,c!==0&&(b=Ci(c)))),b===0?0:o!==0&&o!==b&&(o&w)===0&&(w=b&-b,c=o&-o,w>=c||w===32&&(c&4194048)!==0)?o:b}function Ja(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function cp(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Lc(){var a=Gs;return Gs<<=1,(Gs&62914560)===0&&(Gs=4194304),a}function vl(a){for(var o=[],c=0;31>c;c++)o.push(a);return o}function oa(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function xl(a,o,c,m,b,w){var T=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var V=a.entanglements,J=a.expirationTimes,le=a.hiddenUpdates;for(c=T&~c;0<c;){var ge=31-pt(c),xe=1<<ge;V[ge]=0,J[ge]=-1;var ue=le[ge];if(ue!==null)for(le[ge]=null,ge=0;ge<ue.length;ge++){var de=ue[ge];de!==null&&(de.lane&=-536870913)}c&=~xe}m!==0&&se(a,m,0),w!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=w&~(T&~o))}function se(a,o,c){a.pendingLanes|=o,a.suspendedLanes&=~o;var m=31-pt(o);a.entangledLanes|=o,a.entanglements[m]=a.entanglements[m]|1073741824|c&261930}function _e(a,o){var c=a.entangledLanes|=o;for(a=a.entanglements;c;){var m=31-pt(c),b=1<<m;b&o|a[m]&o&&(a[m]|=o),c&=~b}}function tt(a,o){var c=o&-o;return c=(c&42)!==0?1:mt(c),(c&(a.suspendedLanes|o))!==0?0:c}function mt(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Qt(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Fn(){var a=q.p;return a!==0?a:(a=window.event,a===void 0?32:BS(a.type))}function zn(a,o){var c=q.p;try{return q.p=a,o()}finally{q.p=c}}var Lt=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Lt,dn="__reactProps$"+Lt,ni="__reactContainer$"+Lt,la="__reactEvents$"+Lt,_D="__reactListeners$"+Lt,CD="__reactHandles$"+Lt,ab="__reactResources$"+Lt,bl="__reactMarker$"+Lt;function dp(a){delete a[Mt],delete a[dn],delete a[la],delete a[_D],delete a[CD]}function Ys(a){var o=a[Mt];if(o)return o;for(var c=a.parentNode;c;){if(o=c[ni]||c[Mt]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(a=kS(a);a!==null;){if(c=a[Mt])return c;a=kS(a)}return o}a=c,c=a.parentNode}return null}function Xs(a){if(a=a[Mt]||a[ni]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function wl(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(i(33))}function Ks(a){var o=a[ab];return o||(o=a[ab]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function gn(a){a[bl]=!0}var sb=new Set,ob={};function es(a,o){Ws(a,o),Ws(a+"Capture",o)}function Ws(a,o){for(ob[a]=o,a=0;a<o.length;a++)sb.add(o[a])}var jD=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]*$"),lb={},ub={};function kD(a){return ut.call(ub,a)?!0:ut.call(lb,a)?!1:jD.test(a)?ub[a]=!0:(lb[a]=!0,!1)}function Ic(a,o,c){if(kD(o))if(c===null)a.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var m=o.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+c)}}function Vc(a,o,c){if(c===null)a.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+c)}}function ji(a,o,c,m){if(m===null)a.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(o,c,""+m)}}function gr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function cb(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function ED(a,o,c){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,w=m.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(T){c=""+T,w.call(this,T)}}),Object.defineProperty(a,o,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(T){c=""+T},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function fp(a){if(!a._valueTracker){var o=cb(a)?"checked":"value";a._valueTracker=ED(a,o,""+a[o])}}function db(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var c=o.getValue(),m="";return a&&(m=cb(a)?a.checked?"true":"false":a.value),a=m,a!==c?(o.setValue(a),!0):!1}function Fc(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var ND=/[\n"\\]/g;function yr(a){return a.replace(ND,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function hp(a,o,c,m,b,w,T,V){a.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?a.type=T:a.removeAttribute("type"),o!=null?T==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+gr(o)):a.value!==""+gr(o)&&(a.value=""+gr(o)):T!=="submit"&&T!=="reset"||a.removeAttribute("value"),o!=null?pp(a,T,gr(o)):c!=null?pp(a,T,gr(c)):m!=null&&a.removeAttribute("value"),b==null&&w!=null&&(a.defaultChecked=!!w),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?a.name=""+gr(V):a.removeAttribute("name")}function fb(a,o,c,m,b,w,T,V){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.type=w),o!=null||c!=null){if(!(w!=="submit"&&w!=="reset"||o!=null)){fp(a);return}c=c!=null?""+gr(c):"",o=o!=null?""+gr(o):c,V||o===a.value||(a.value=o),a.defaultValue=o}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=V?a.checked:!!m,a.defaultChecked=!!m,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(a.name=T),fp(a)}function pp(a,o,c){o==="number"&&Fc(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function Zs(a,o,c,m){if(a=a.options,o){o={};for(var b=0;b<c.length;b++)o["$"+c[b]]=!0;for(c=0;c<a.length;c++)b=o.hasOwnProperty("$"+a[c].value),a[c].selected!==b&&(a[c].selected=b),b&&m&&(a[c].defaultSelected=!0)}else{for(c=""+gr(c),o=null,b=0;b<a.length;b++){if(a[b].value===c){a[b].selected=!0,m&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function hb(a,o,c){if(o!=null&&(o=""+gr(o),o!==a.value&&(a.value=o),c==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=c!=null?""+gr(c):""}function pb(a,o,c,m){if(o==null){if(m!=null){if(c!=null)throw Error(i(92));if(Z(m)){if(1<m.length)throw Error(i(93));m=m[0]}c=m}c==null&&(c=""),o=c}c=gr(o),a.defaultValue=c,m=a.textContent,m===c&&m!==""&&m!==null&&(a.value=m),fp(a)}function Qs(a,o){if(o){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=o;return}}a.textContent=o}var TD=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 mb(a,o,c){var m=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":m?a.setProperty(o,c):typeof c!="number"||c===0||TD.has(o)?o==="float"?a.cssFloat=c:a[o]=(""+c).trim():a[o]=c+"px"}function gb(a,o,c){if(o!=null&&typeof o!="object")throw Error(i(62));if(a=a.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||o!=null&&o.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var b in o)m=o[b],o.hasOwnProperty(b)&&c[b]!==m&&mb(a,b,m)}else for(var w in o)o.hasOwnProperty(w)&&mb(a,w,o[w])}function mp(a){if(a.indexOf("-")===-1)return!1;switch(a){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 AD=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"]]),RD=/^[\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 Uc(a){return RD.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function ki(){}var gp=null;function yp(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Js=null,eo=null;function yb(a){var o=Xs(a);if(o&&(a=o.stateNode)){var c=a[dn]||null;e:switch(a=o.stateNode,o.type){case"input":if(hp(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+yr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var m=c[o];if(m!==a&&m.form===a.form){var b=m[dn]||null;if(!b)throw Error(i(90));hp(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<c.length;o++)m=c[o],m.form===a.form&&db(m)}break e;case"textarea":hb(a,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Zs(a,!!c.multiple,o,!1)}}}var vp=!1;function vb(a,o,c){if(vp)return a(o,c);vp=!0;try{var m=a(o);return m}finally{if(vp=!1,(Js!==null||eo!==null)&&(Nd(),Js&&(o=Js,a=eo,eo=Js=null,yb(o),a)))for(o=0;o<a.length;o++)yb(a[o])}}function Sl(a,o){var c=a.stateNode;if(c===null)return null;var m=c[dn]||null;if(m===null)return null;c=m[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(i(231,o,typeof c));return c}var Ei=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xp=!1;if(Ei)try{var _l={};Object.defineProperty(_l,"passive",{get:function(){xp=!0}}),window.addEventListener("test",_l,_l),window.removeEventListener("test",_l,_l)}catch{xp=!1}var ua=null,bp=null,Bc=null;function xb(){if(Bc)return Bc;var a,o=bp,c=o.length,m,b="value"in ua?ua.value:ua.textContent,w=b.length;for(a=0;a<c&&o[a]===b[a];a++);var T=c-a;for(m=1;m<=T&&o[c-m]===b[w-m];m++);return Bc=b.slice(a,1<m?1-m:void 0)}function $c(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function Hc(){return!0}function bb(){return!1}function Un(a){function o(c,m,b,w,T){this._reactName=c,this._targetInst=b,this.type=m,this.nativeEvent=w,this.target=T,this.currentTarget=null;for(var V in a)a.hasOwnProperty(V)&&(c=a[V],this[V]=c?c(w):w[V]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Hc:bb,this.isPropagationStopped=bb,this}return y(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Hc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Hc)},persist:function(){},isPersistent:Hc}),o}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gc=Un(ts),Cl=y({},ts,{view:0,detail:0}),MD=Un(Cl),wp,Sp,jl,qc=y({},Cl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cp,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==jl&&(jl&&a.type==="mousemove"?(wp=a.screenX-jl.screenX,Sp=a.screenY-jl.screenY):Sp=wp=0,jl=a),wp)},movementY:function(a){return"movementY"in a?a.movementY:Sp}}),wb=Un(qc),DD=y({},qc,{dataTransfer:0}),OD=Un(DD),zD=y({},Cl,{relatedTarget:0}),_p=Un(zD),PD=y({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),LD=Un(PD),ID=y({},ts,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),VD=Un(ID),FD=y({},ts,{data:0}),Sb=Un(FD),UD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BD={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"},$D={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HD(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=$D[a])?!!o[a]:!1}function Cp(){return HD}var GD=y({},Cl,{key:function(a){if(a.key){var o=UD[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=$c(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?BD[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cp,charCode:function(a){return a.type==="keypress"?$c(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?$c(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),qD=Un(GD),YD=y({},qc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_b=Un(YD),XD=y({},Cl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cp}),KD=Un(XD),WD=y({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),ZD=Un(WD),QD=y({},qc,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),JD=Un(QD),eO=y({},ts,{newState:0,oldState:0}),tO=Un(eO),nO=[9,13,27,32],jp=Ei&&"CompositionEvent"in window,kl=null;Ei&&"documentMode"in document&&(kl=document.documentMode);var rO=Ei&&"TextEvent"in window&&!kl,Cb=Ei&&(!jp||kl&&8<kl&&11>=kl),jb=" ",kb=!1;function Eb(a,o){switch(a){case"keyup":return nO.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var to=!1;function iO(a,o){switch(a){case"compositionend":return Nb(o);case"keypress":return o.which!==32?null:(kb=!0,jb);case"textInput":return a=o.data,a===jb&&kb?null:a;default:return null}}function aO(a,o){if(to)return a==="compositionend"||!jp&&Eb(a,o)?(a=xb(),Bc=bp=ua=null,to=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Cb&&o.locale!=="ko"?null:o.data;default:return null}}var sO={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 Tb(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!sO[a.type]:o==="textarea"}function Ab(a,o,c,m){Js?eo?eo.push(m):eo=[m]:Js=m,o=zd(o,"onChange"),0<o.length&&(c=new Gc("onChange","change",null,c,m),a.push({event:c,listeners:o}))}var El=null,Nl=null;function oO(a){fS(a,0)}function Yc(a){var o=wl(a);if(db(o))return a}function Rb(a,o){if(a==="change")return o}var Mb=!1;if(Ei){var kp;if(Ei){var Ep="oninput"in document;if(!Ep){var Db=document.createElement("div");Db.setAttribute("oninput","return;"),Ep=typeof Db.oninput=="function"}kp=Ep}else kp=!1;Mb=kp&&(!document.documentMode||9<document.documentMode)}function Ob(){El&&(El.detachEvent("onpropertychange",zb),Nl=El=null)}function zb(a){if(a.propertyName==="value"&&Yc(Nl)){var o=[];Ab(o,Nl,a,yp(a)),vb(oO,o)}}function lO(a,o,c){a==="focusin"?(Ob(),El=o,Nl=c,El.attachEvent("onpropertychange",zb)):a==="focusout"&&Ob()}function uO(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Yc(Nl)}function cO(a,o){if(a==="click")return Yc(o)}function dO(a,o){if(a==="input"||a==="change")return Yc(o)}function fO(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var er=typeof Object.is=="function"?Object.is:fO;function Tl(a,o){if(er(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var c=Object.keys(a),m=Object.keys(o);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var b=c[m];if(!ut.call(o,b)||!er(a[b],o[b]))return!1}return!0}function Pb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Lb(a,o){var c=Pb(a);a=0;for(var m;c;){if(c.nodeType===3){if(m=a+c.textContent.length,a<=o&&m>=o)return{node:c,offset:o-a};a=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Pb(c)}}function Ib(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?Ib(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function Vb(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Fc(a.document);o instanceof a.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)a=o.contentWindow;else break;o=Fc(a.document)}return o}function Np(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var hO=Ei&&"documentMode"in document&&11>=document.documentMode,no=null,Tp=null,Al=null,Ap=!1;function Fb(a,o,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Ap||no==null||no!==Fc(m)||(m=no,"selectionStart"in m&&Np(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Al&&Tl(Al,m)||(Al=m,m=zd(Tp,"onSelect"),0<m.length&&(o=new Gc("onSelect","select",null,o,c),a.push({event:o,listeners:m}),o.target=no)))}function ns(a,o){var c={};return c[a.toLowerCase()]=o.toLowerCase(),c["Webkit"+a]="webkit"+o,c["Moz"+a]="moz"+o,c}var ro={animationend:ns("Animation","AnimationEnd"),animationiteration:ns("Animation","AnimationIteration"),animationstart:ns("Animation","AnimationStart"),transitionrun:ns("Transition","TransitionRun"),transitionstart:ns("Transition","TransitionStart"),transitioncancel:ns("Transition","TransitionCancel"),transitionend:ns("Transition","TransitionEnd")},Rp={},Ub={};Ei&&(Ub=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function rs(a){if(Rp[a])return Rp[a];if(!ro[a])return a;var o=ro[a],c;for(c in o)if(o.hasOwnProperty(c)&&c in Ub)return Rp[a]=o[c];return a}var Bb=rs("animationend"),$b=rs("animationiteration"),Hb=rs("animationstart"),pO=rs("transitionrun"),mO=rs("transitionstart"),gO=rs("transitioncancel"),Gb=rs("transitionend"),qb=new Map,Mp="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(" ");Mp.push("scrollEnd");function Lr(a,o){qb.set(a,o),es(o,[a])}var Xc=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},vr=[],io=0,Dp=0;function Kc(){for(var a=io,o=Dp=io=0;o<a;){var c=vr[o];vr[o++]=null;var m=vr[o];vr[o++]=null;var b=vr[o];vr[o++]=null;var w=vr[o];if(vr[o++]=null,m!==null&&b!==null){var T=m.pending;T===null?b.next=b:(b.next=T.next,T.next=b),m.pending=b}w!==0&&Yb(c,b,w)}}function Wc(a,o,c,m){vr[io++]=a,vr[io++]=o,vr[io++]=c,vr[io++]=m,Dp|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Op(a,o,c,m){return Wc(a,o,c,m),Zc(a)}function is(a,o){return Wc(a,null,null,o),Zc(a)}function Yb(a,o,c){a.lanes|=c;var m=a.alternate;m!==null&&(m.lanes|=c);for(var b=!1,w=a.return;w!==null;)w.childLanes|=c,m=w.alternate,m!==null&&(m.childLanes|=c),w.tag===22&&(a=w.stateNode,a===null||a._visibility&1||(b=!0)),a=w,w=w.return;return a.tag===3?(w=a.stateNode,b&&o!==null&&(b=31-pt(c),a=w.hiddenUpdates,m=a[b],m===null?a[b]=[o]:m.push(o),o.lane=c|536870912),w):null}function Zc(a){if(50<Ql)throw Ql=0,$m=null,Error(i(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var ao={};function yO(a,o,c,m){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tr(a,o,c,m){return new yO(a,o,c,m)}function zp(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ni(a,o){var c=a.alternate;return c===null?(c=tr(a.tag,o,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=o,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,o=a.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function Xb(a,o){a.flags&=65011714;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,o=c.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Qc(a,o,c,m,b,w){var T=0;if(m=a,typeof a=="function")zp(a)&&(T=1);else if(typeof a=="string")T=S4(a,c,ee.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case $:return a=tr(31,c,o,b),a.elementType=$,a.lanes=w,a;case C:return as(c.children,b,w,o);case k:T=8,b|=24;break;case j:return a=tr(12,c,o,b|2),a.elementType=j,a.lanes=w,a;case R:return a=tr(13,c,o,b),a.elementType=R,a.lanes=w,a;case z:return a=tr(19,c,o,b),a.elementType=z,a.lanes=w,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:T=10;break e;case E:T=9;break e;case M:T=11;break e;case P:T=14;break e;case D:T=16,m=null;break e}T=29,c=Error(i(130,a===null?"null":typeof a,"")),m=null}return o=tr(T,c,o,b),o.elementType=a,o.type=m,o.lanes=w,o}function as(a,o,c,m){return a=tr(7,a,m,o),a.lanes=c,a}function Pp(a,o,c){return a=tr(6,a,null,o),a.lanes=c,a}function Kb(a){var o=tr(18,null,null,0);return o.stateNode=a,o}function Lp(a,o,c){return o=tr(4,a.children!==null?a.children:[],a.key,o),o.lanes=c,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var Wb=new WeakMap;function xr(a,o){if(typeof a=="object"&&a!==null){var c=Wb.get(a);return c!==void 0?c:(o={value:a,source:o,stack:Le(o)},Wb.set(a,o),o)}return{value:a,source:o,stack:Le(o)}}var so=[],oo=0,Jc=null,Rl=0,br=[],wr=0,ca=null,ri=1,ii="";function Ti(a,o){so[oo++]=Rl,so[oo++]=Jc,Jc=a,Rl=o}function Zb(a,o,c){br[wr++]=ri,br[wr++]=ii,br[wr++]=ca,ca=a;var m=ri;a=ii;var b=32-pt(m)-1;m&=~(1<<b),c+=1;var w=32-pt(o)+b;if(30<w){var T=b-b%5;w=(m&(1<<T)-1).toString(32),m>>=T,b-=T,ri=1<<32-pt(o)+b|c<<b|m,ii=w+a}else ri=1<<w|c<<b|m,ii=a}function Ip(a){a.return!==null&&(Ti(a,1),Zb(a,1,0))}function Vp(a){for(;a===Jc;)Jc=so[--oo],so[oo]=null,Rl=so[--oo],so[oo]=null;for(;a===ca;)ca=br[--wr],br[wr]=null,ii=br[--wr],br[wr]=null,ri=br[--wr],br[wr]=null}function Qb(a,o){br[wr++]=ri,br[wr++]=ii,br[wr++]=ca,ri=o.id,ii=o.overflow,ca=a}var vn=null,Dt=null,ot=!1,da=null,Sr=!1,Fp=Error(i(519));function fa(a){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ml(xr(o,a)),Fp}function Jb(a){var o=a.stateNode,c=a.type,m=a.memoizedProps;switch(o[Mt]=a,o[dn]=m,c){case"dialog":rt("cancel",o),rt("close",o);break;case"iframe":case"object":case"embed":rt("load",o);break;case"video":case"audio":for(c=0;c<eu.length;c++)rt(eu[c],o);break;case"source":rt("error",o);break;case"img":case"image":case"link":rt("error",o),rt("load",o);break;case"details":rt("toggle",o);break;case"input":rt("invalid",o),fb(o,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":rt("invalid",o);break;case"textarea":rt("invalid",o),pb(o,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||m.suppressHydrationWarning===!0||gS(o.textContent,c)?(m.popover!=null&&(rt("beforetoggle",o),rt("toggle",o)),m.onScroll!=null&&rt("scroll",o),m.onScrollEnd!=null&&rt("scrollend",o),m.onClick!=null&&(o.onclick=ki),o=!0):o=!1,o||fa(a,!0)}function e1(a){for(vn=a.return;vn;)switch(vn.tag){case 5:case 31:case 13:Sr=!1;return;case 27:case 3:Sr=!0;return;default:vn=vn.return}}function lo(a){if(a!==vn)return!1;if(!ot)return e1(a),ot=!0,!1;var o=a.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||ig(a.type,a.memoizedProps)),c=!c),c&&Dt&&fa(a),e1(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Dt=jS(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Dt=jS(a)}else o===27?(o=Dt,ka(a.type)?(a=ug,ug=null,Dt=a):Dt=o):Dt=vn?Cr(a.stateNode.nextSibling):null;return!0}function ss(){Dt=vn=null,ot=!1}function Up(){var a=da;return a!==null&&(Gn===null?Gn=a:Gn.push.apply(Gn,a),da=null),a}function Ml(a){da===null?da=[a]:da.push(a)}var Bp=F(null),os=null,Ai=null;function ha(a,o,c){L(Bp,o._currentValue),o._currentValue=c}function Ri(a){a._currentValue=Bp.current,G(Bp)}function $p(a,o,c){for(;a!==null;){var m=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,m!==null&&(m.childLanes|=o)):m!==null&&(m.childLanes&o)!==o&&(m.childLanes|=o),a===c)break;a=a.return}}function Hp(a,o,c,m){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var w=b.dependencies;if(w!==null){var T=b.child;w=w.firstContext;e:for(;w!==null;){var V=w;w=b;for(var J=0;J<o.length;J++)if(V.context===o[J]){w.lanes|=c,V=w.alternate,V!==null&&(V.lanes|=c),$p(w.return,c,a),m||(T=null);break e}w=V.next}}else if(b.tag===18){if(T=b.return,T===null)throw Error(i(341));T.lanes|=c,w=T.alternate,w!==null&&(w.lanes|=c),$p(T,c,a),T=null}else T=b.child;if(T!==null)T.return=b;else for(T=b;T!==null;){if(T===a){T=null;break}if(b=T.sibling,b!==null){b.return=T.return,T=b;break}T=T.return}b=T}}function uo(a,o,c,m){a=null;for(var b=o,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var T=b.alternate;if(T===null)throw Error(i(387));if(T=T.memoizedProps,T!==null){var V=b.type;er(b.pendingProps.value,T.value)||(a!==null?a.push(V):a=[V])}}else if(b===Q.current){if(T=b.alternate,T===null)throw Error(i(387));T.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(au):a=[au])}b=b.return}a!==null&&Hp(o,a,c,m),o.flags|=262144}function ed(a){for(a=a.firstContext;a!==null;){if(!er(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function ls(a){os=a,Ai=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function xn(a){return t1(os,a)}function td(a,o){return os===null&&ls(a),t1(a,o)}function t1(a,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Ai===null){if(a===null)throw Error(i(308));Ai=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Ai=Ai.next=o;return c}var vO=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(c,m){a.push(m)}};this.abort=function(){o.aborted=!0,a.forEach(function(c){return c()})}},xO=e.unstable_scheduleCallback,bO=e.unstable_NormalPriority,an={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gp(){return{controller:new vO,data:new Map,refCount:0}}function Dl(a){a.refCount--,a.refCount===0&&xO(bO,function(){a.controller.abort()})}var Ol=null,qp=0,co=0,fo=null;function wO(a,o){if(Ol===null){var c=Ol=[];qp=0,co=Km(),fo={status:"pending",value:void 0,then:function(m){c.push(m)}}}return qp++,o.then(n1,n1),o}function n1(){if(--qp===0&&Ol!==null){fo!==null&&(fo.status="fulfilled");var a=Ol;Ol=null,co=0,fo=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function SO(a,o){var c=[],m={status:"pending",value:null,reason:null,then:function(b){c.push(b)}};return a.then(function(){m.status="fulfilled",m.value=o;for(var b=0;b<c.length;b++)(0,c[b])(o)},function(b){for(m.status="rejected",m.reason=b,b=0;b<c.length;b++)(0,c[b])(void 0)}),m}var r1=O.S;O.S=function(a,o){Fw=wt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&wO(a,o),r1!==null&&r1(a,o)};var us=F(null);function Yp(){var a=us.current;return a!==null?a:Et.pooledCache}function nd(a,o){o===null?L(us,us.current):L(us,o.pool)}function i1(){var a=Yp();return a===null?null:{parent:an._currentValue,pool:a}}var ho=Error(i(460)),Xp=Error(i(474)),rd=Error(i(542)),id={then:function(){}};function a1(a){return a=a.status,a==="fulfilled"||a==="rejected"}function s1(a,o,c){switch(c=a[c],c===void 0?a.push(o):c!==o&&(o.then(ki,ki),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,l1(a),a;default:if(typeof o.status=="string")o.then(ki,ki);else{if(a=Et,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=o,a.status="pending",a.then(function(m){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=m}},function(m){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=m}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,l1(a),a}throw ds=o,ho}}function cs(a){try{var o=a._init;return o(a._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(ds=c,ho):c}}var ds=null;function o1(){if(ds===null)throw Error(i(459));var a=ds;return ds=null,a}function l1(a){if(a===ho||a===rd)throw Error(i(483))}var po=null,zl=0;function ad(a){var o=zl;return zl+=1,po===null&&(po=[]),s1(po,a,o)}function Pl(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function sd(a,o){throw o.$$typeof===v?Error(i(525)):(a=Object.prototype.toString.call(o),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function u1(a){function o(ie,te){if(a){var oe=ie.deletions;oe===null?(ie.deletions=[te],ie.flags|=16):oe.push(te)}}function c(ie,te){if(!a)return null;for(;te!==null;)o(ie,te),te=te.sibling;return null}function m(ie){for(var te=new Map;ie!==null;)ie.key!==null?te.set(ie.key,ie):te.set(ie.index,ie),ie=ie.sibling;return te}function b(ie,te){return ie=Ni(ie,te),ie.index=0,ie.sibling=null,ie}function w(ie,te,oe){return ie.index=oe,a?(oe=ie.alternate,oe!==null?(oe=oe.index,oe<te?(ie.flags|=67108866,te):oe):(ie.flags|=67108866,te)):(ie.flags|=1048576,te)}function T(ie){return a&&ie.alternate===null&&(ie.flags|=67108866),ie}function V(ie,te,oe,ye){return te===null||te.tag!==6?(te=Pp(oe,ie.mode,ye),te.return=ie,te):(te=b(te,oe),te.return=ie,te)}function J(ie,te,oe,ye){var Pe=oe.type;return Pe===C?ge(ie,te,oe.props.children,ye,oe.key):te!==null&&(te.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===D&&cs(Pe)===te.type)?(te=b(te,oe.props),Pl(te,oe),te.return=ie,te):(te=Qc(oe.type,oe.key,oe.props,null,ie.mode,ye),Pl(te,oe),te.return=ie,te)}function le(ie,te,oe,ye){return te===null||te.tag!==4||te.stateNode.containerInfo!==oe.containerInfo||te.stateNode.implementation!==oe.implementation?(te=Lp(oe,ie.mode,ye),te.return=ie,te):(te=b(te,oe.children||[]),te.return=ie,te)}function ge(ie,te,oe,ye,Pe){return te===null||te.tag!==7?(te=as(oe,ie.mode,ye,Pe),te.return=ie,te):(te=b(te,oe),te.return=ie,te)}function xe(ie,te,oe){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Pp(""+te,ie.mode,oe),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return oe=Qc(te.type,te.key,te.props,null,ie.mode,oe),Pl(oe,te),oe.return=ie,oe;case _:return te=Lp(te,ie.mode,oe),te.return=ie,te;case D:return te=cs(te),xe(ie,te,oe)}if(Z(te)||K(te))return te=as(te,ie.mode,oe,null),te.return=ie,te;if(typeof te.then=="function")return xe(ie,ad(te),oe);if(te.$$typeof===N)return xe(ie,td(ie,te),oe);sd(ie,te)}return null}function ue(ie,te,oe,ye){var Pe=te!==null?te.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Pe!==null?null:V(ie,te,""+oe,ye);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return oe.key===Pe?J(ie,te,oe,ye):null;case _:return oe.key===Pe?le(ie,te,oe,ye):null;case D:return oe=cs(oe),ue(ie,te,oe,ye)}if(Z(oe)||K(oe))return Pe!==null?null:ge(ie,te,oe,ye,null);if(typeof oe.then=="function")return ue(ie,te,ad(oe),ye);if(oe.$$typeof===N)return ue(ie,te,td(ie,oe),ye);sd(ie,oe)}return null}function de(ie,te,oe,ye,Pe){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ie=ie.get(oe)||null,V(te,ie,""+ye,Pe);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case x:return ie=ie.get(ye.key===null?oe:ye.key)||null,J(te,ie,ye,Pe);case _:return ie=ie.get(ye.key===null?oe:ye.key)||null,le(te,ie,ye,Pe);case D:return ye=cs(ye),de(ie,te,oe,ye,Pe)}if(Z(ye)||K(ye))return ie=ie.get(oe)||null,ge(te,ie,ye,Pe,null);if(typeof ye.then=="function")return de(ie,te,oe,ad(ye),Pe);if(ye.$$typeof===N)return de(ie,te,oe,td(te,ye),Pe);sd(te,ye)}return null}function Te(ie,te,oe,ye){for(var Pe=null,ct=null,De=te,We=te=0,at=null;De!==null&&We<oe.length;We++){De.index>We?(at=De,De=null):at=De.sibling;var dt=ue(ie,De,oe[We],ye);if(dt===null){De===null&&(De=at);break}a&&De&&dt.alternate===null&&o(ie,De),te=w(dt,te,We),ct===null?Pe=dt:ct.sibling=dt,ct=dt,De=at}if(We===oe.length)return c(ie,De),ot&&Ti(ie,We),Pe;if(De===null){for(;We<oe.length;We++)De=xe(ie,oe[We],ye),De!==null&&(te=w(De,te,We),ct===null?Pe=De:ct.sibling=De,ct=De);return ot&&Ti(ie,We),Pe}for(De=m(De);We<oe.length;We++)at=de(De,ie,We,oe[We],ye),at!==null&&(a&&at.alternate!==null&&De.delete(at.key===null?We:at.key),te=w(at,te,We),ct===null?Pe=at:ct.sibling=at,ct=at);return a&&De.forEach(function(Ra){return o(ie,Ra)}),ot&&Ti(ie,We),Pe}function Ve(ie,te,oe,ye){if(oe==null)throw Error(i(151));for(var Pe=null,ct=null,De=te,We=te=0,at=null,dt=oe.next();De!==null&&!dt.done;We++,dt=oe.next()){De.index>We?(at=De,De=null):at=De.sibling;var Ra=ue(ie,De,dt.value,ye);if(Ra===null){De===null&&(De=at);break}a&&De&&Ra.alternate===null&&o(ie,De),te=w(Ra,te,We),ct===null?Pe=Ra:ct.sibling=Ra,ct=Ra,De=at}if(dt.done)return c(ie,De),ot&&Ti(ie,We),Pe;if(De===null){for(;!dt.done;We++,dt=oe.next())dt=xe(ie,dt.value,ye),dt!==null&&(te=w(dt,te,We),ct===null?Pe=dt:ct.sibling=dt,ct=dt);return ot&&Ti(ie,We),Pe}for(De=m(De);!dt.done;We++,dt=oe.next())dt=de(De,ie,We,dt.value,ye),dt!==null&&(a&&dt.alternate!==null&&De.delete(dt.key===null?We:dt.key),te=w(dt,te,We),ct===null?Pe=dt:ct.sibling=dt,ct=dt);return a&&De.forEach(function(D4){return o(ie,D4)}),ot&&Ti(ie,We),Pe}function Ct(ie,te,oe,ye){if(typeof oe=="object"&&oe!==null&&oe.type===C&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:e:{for(var Pe=oe.key;te!==null;){if(te.key===Pe){if(Pe=oe.type,Pe===C){if(te.tag===7){c(ie,te.sibling),ye=b(te,oe.props.children),ye.return=ie,ie=ye;break e}}else if(te.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===D&&cs(Pe)===te.type){c(ie,te.sibling),ye=b(te,oe.props),Pl(ye,oe),ye.return=ie,ie=ye;break e}c(ie,te);break}else o(ie,te);te=te.sibling}oe.type===C?(ye=as(oe.props.children,ie.mode,ye,oe.key),ye.return=ie,ie=ye):(ye=Qc(oe.type,oe.key,oe.props,null,ie.mode,ye),Pl(ye,oe),ye.return=ie,ie=ye)}return T(ie);case _:e:{for(Pe=oe.key;te!==null;){if(te.key===Pe)if(te.tag===4&&te.stateNode.containerInfo===oe.containerInfo&&te.stateNode.implementation===oe.implementation){c(ie,te.sibling),ye=b(te,oe.children||[]),ye.return=ie,ie=ye;break e}else{c(ie,te);break}else o(ie,te);te=te.sibling}ye=Lp(oe,ie.mode,ye),ye.return=ie,ie=ye}return T(ie);case D:return oe=cs(oe),Ct(ie,te,oe,ye)}if(Z(oe))return Te(ie,te,oe,ye);if(K(oe)){if(Pe=K(oe),typeof Pe!="function")throw Error(i(150));return oe=Pe.call(oe),Ve(ie,te,oe,ye)}if(typeof oe.then=="function")return Ct(ie,te,ad(oe),ye);if(oe.$$typeof===N)return Ct(ie,te,td(ie,oe),ye);sd(ie,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,te!==null&&te.tag===6?(c(ie,te.sibling),ye=b(te,oe),ye.return=ie,ie=ye):(c(ie,te),ye=Pp(oe,ie.mode,ye),ye.return=ie,ie=ye),T(ie)):c(ie,te)}return function(ie,te,oe,ye){try{zl=0;var Pe=Ct(ie,te,oe,ye);return po=null,Pe}catch(De){if(De===ho||De===rd)throw De;var ct=tr(29,De,null,ie.mode);return ct.lanes=ye,ct.return=ie,ct}}}var fs=u1(!0),c1=u1(!1),pa=!1;function Kp(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wp(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ma(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ga(a,o,c){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(ft&2)!==0){var b=m.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),m.pending=o,o=Zc(a),Yb(a,null,c),o}return Wc(a,m,o,c),Zc(a)}function Ll(a,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var m=o.lanes;m&=a.pendingLanes,c|=m,o.lanes=c,_e(a,c)}}function Zp(a,o){var c=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var b=null,w=null;if(c=c.firstBaseUpdate,c!==null){do{var T={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};w===null?b=w=T:w=w.next=T,c=c.next}while(c!==null);w===null?b=w=o:w=w.next=o}else b=w=o;c={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:m.shared,callbacks:m.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=o:a.next=o,c.lastBaseUpdate=o}var Qp=!1;function Il(){if(Qp){var a=fo;if(a!==null)throw a}}function Vl(a,o,c,m){Qp=!1;var b=a.updateQueue;pa=!1;var w=b.firstBaseUpdate,T=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var J=V,le=J.next;J.next=null,T===null?w=le:T.next=le,T=J;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,V=ge.lastBaseUpdate,V!==T&&(V===null?ge.firstBaseUpdate=le:V.next=le,ge.lastBaseUpdate=J))}if(w!==null){var xe=b.baseState;T=0,ge=le=J=null,V=w;do{var ue=V.lane&-536870913,de=ue!==V.lane;if(de?(it&ue)===ue:(m&ue)===ue){ue!==0&&ue===co&&(Qp=!0),ge!==null&&(ge=ge.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var Te=a,Ve=V;ue=o;var Ct=c;switch(Ve.tag){case 1:if(Te=Ve.payload,typeof Te=="function"){xe=Te.call(Ct,xe,ue);break e}xe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ve.payload,ue=typeof Te=="function"?Te.call(Ct,xe,ue):Te,ue==null)break e;xe=y({},xe,ue);break e;case 2:pa=!0}}ue=V.callback,ue!==null&&(a.flags|=64,de&&(a.flags|=8192),de=b.callbacks,de===null?b.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:V.tag,payload:V.payload,callback:V.callback,next:null},ge===null?(le=ge=de,J=xe):ge=ge.next=de,T|=ue;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;de=V,V=de.next,de.next=null,b.lastBaseUpdate=de,b.shared.pending=null}}while(!0);ge===null&&(J=xe),b.baseState=J,b.firstBaseUpdate=le,b.lastBaseUpdate=ge,w===null&&(b.shared.lanes=0),wa|=T,a.lanes=T,a.memoizedState=xe}}function d1(a,o){if(typeof a!="function")throw Error(i(191,a));a.call(o)}function f1(a,o){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)d1(c[a],o)}var mo=F(null),od=F(0);function h1(a,o){a=Fi,L(od,a),L(mo,o),Fi=a|o.baseLanes}function Jp(){L(od,Fi),L(mo,mo.current)}function em(){Fi=od.current,G(mo),G(od)}var nr=F(null),_r=null;function ya(a){var o=a.alternate;L(Jt,Jt.current&1),L(nr,a),_r===null&&(o===null||mo.current!==null||o.memoizedState!==null)&&(_r=a)}function tm(a){L(Jt,Jt.current),L(nr,a),_r===null&&(_r=a)}function p1(a){a.tag===22?(L(Jt,Jt.current),L(nr,a),_r===null&&(_r=a)):va()}function va(){L(Jt,Jt.current),L(nr,nr.current)}function rr(a){G(nr),_r===a&&(_r=null),G(Jt)}var Jt=F(0);function ld(a){for(var o=a;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||og(c)||lg(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Mi=0,Ke=null,St=null,sn=null,ud=!1,go=!1,hs=!1,cd=0,Fl=0,yo=null,_O=0;function $t(){throw Error(i(321))}function nm(a,o){if(o===null)return!1;for(var c=0;c<o.length&&c<a.length;c++)if(!er(a[c],o[c]))return!1;return!0}function rm(a,o,c,m,b,w){return Mi=w,Ke=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,O.H=a===null||a.memoizedState===null?Z1:vm,hs=!1,w=c(m,b),hs=!1,go&&(w=g1(o,c,m,b)),m1(a),w}function m1(a){O.H=$l;var o=St!==null&&St.next!==null;if(Mi=0,sn=St=Ke=null,ud=!1,Fl=0,yo=null,o)throw Error(i(300));a===null||on||(a=a.dependencies,a!==null&&ed(a)&&(on=!0))}function g1(a,o,c,m){Ke=a;var b=0;do{if(go&&(yo=null),Fl=0,go=!1,25<=b)throw Error(i(301));if(b+=1,sn=St=null,a.updateQueue!=null){var w=a.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}O.H=Q1,w=o(c,m)}while(go);return w}function CO(){var a=O.H,o=a.useState()[0];return o=typeof o.then=="function"?Ul(o):o,a=a.useState()[0],(St!==null?St.memoizedState:null)!==a&&(Ke.flags|=1024),o}function im(){var a=cd!==0;return cd=0,a}function am(a,o,c){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~c}function sm(a){if(ud){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}ud=!1}Mi=0,sn=St=Ke=null,go=!1,Fl=cd=0,yo=null}function Pn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sn===null?Ke.memoizedState=sn=a:sn=sn.next=a,sn}function en(){if(St===null){var a=Ke.alternate;a=a!==null?a.memoizedState:null}else a=St.next;var o=sn===null?Ke.memoizedState:sn.next;if(o!==null)sn=o,St=a;else{if(a===null)throw Ke.alternate===null?Error(i(467)):Error(i(310));St=a,a={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},sn===null?Ke.memoizedState=sn=a:sn=sn.next=a}return sn}function dd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ul(a){var o=Fl;return Fl+=1,yo===null&&(yo=[]),a=s1(yo,a,o),o=Ke,(sn===null?o.memoizedState:sn.next)===null&&(o=o.alternate,O.H=o===null||o.memoizedState===null?Z1:vm),a}function fd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Ul(a);if(a.$$typeof===N)return xn(a)}throw Error(i(438,String(a)))}function om(a){var o=null,c=Ke.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var m=Ke.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(o={data:m.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=dd(),Ke.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(a),m=0;m<a;m++)c[m]=U;return o.index++,c}function Di(a,o){return typeof o=="function"?o(a):o}function hd(a){var o=en();return lm(o,St,a)}function lm(a,o,c){var m=a.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=c;var b=a.baseQueue,w=m.pending;if(w!==null){if(b!==null){var T=b.next;b.next=w.next,w.next=T}o.baseQueue=b=w,m.pending=null}if(w=a.baseState,b===null)a.memoizedState=w;else{o=b.next;var V=T=null,J=null,le=o,ge=!1;do{var xe=le.lane&-536870913;if(xe!==le.lane?(it&xe)===xe:(Mi&xe)===xe){var ue=le.revertLane;if(ue===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),xe===co&&(ge=!0);else if((Mi&ue)===ue){le=le.next,ue===co&&(ge=!0);continue}else xe={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},J===null?(V=J=xe,T=w):J=J.next=xe,Ke.lanes|=ue,wa|=ue;xe=le.action,hs&&c(w,xe),w=le.hasEagerState?le.eagerState:c(w,xe)}else ue={lane:xe,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},J===null?(V=J=ue,T=w):J=J.next=ue,Ke.lanes|=xe,wa|=xe;le=le.next}while(le!==null&&le!==o);if(J===null?T=w:J.next=V,!er(w,a.memoizedState)&&(on=!0,ge&&(c=fo,c!==null)))throw c;a.memoizedState=w,a.baseState=T,a.baseQueue=J,m.lastRenderedState=w}return b===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function um(a){var o=en(),c=o.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=a;var m=c.dispatch,b=c.pending,w=o.memoizedState;if(b!==null){c.pending=null;var T=b=b.next;do w=a(w,T.action),T=T.next;while(T!==b);er(w,o.memoizedState)||(on=!0),o.memoizedState=w,o.baseQueue===null&&(o.baseState=w),c.lastRenderedState=w}return[w,m]}function y1(a,o,c){var m=Ke,b=en(),w=ot;if(w){if(c===void 0)throw Error(i(407));c=c()}else c=o();var T=!er((St||b).memoizedState,c);if(T&&(b.memoizedState=c,on=!0),b=b.queue,fm(b1.bind(null,m,b,a),[a]),b.getSnapshot!==o||T||sn!==null&&sn.memoizedState.tag&1){if(m.flags|=2048,vo(9,{destroy:void 0},x1.bind(null,m,b,c,o),null),Et===null)throw Error(i(349));w||(Mi&127)!==0||v1(m,o,c)}return c}function v1(a,o,c){a.flags|=16384,a={getSnapshot:o,value:c},o=Ke.updateQueue,o===null?(o=dd(),Ke.updateQueue=o,o.stores=[a]):(c=o.stores,c===null?o.stores=[a]:c.push(a))}function x1(a,o,c,m){o.value=c,o.getSnapshot=m,w1(o)&&S1(a)}function b1(a,o,c){return c(function(){w1(o)&&S1(a)})}function w1(a){var o=a.getSnapshot;a=a.value;try{var c=o();return!er(a,c)}catch{return!0}}function S1(a){var o=is(a,2);o!==null&&qn(o,a,2)}function cm(a){var o=Pn();if(typeof a=="function"){var c=a;if(a=c(),hs){jn(!0);try{c()}finally{jn(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:a},o}function _1(a,o,c,m){return a.baseState=c,lm(a,St,typeof m=="function"?m:Di)}function jO(a,o,c,m,b){if(gd(a))throw Error(i(485));if(a=o.action,a!==null){var w={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){w.listeners.push(T)}};O.T!==null?c(!0):w.isTransition=!1,m(w),c=o.pending,c===null?(w.next=o.pending=w,C1(o,w)):(w.next=c.next,o.pending=c.next=w)}}function C1(a,o){var c=o.action,m=o.payload,b=a.state;if(o.isTransition){var w=O.T,T={};O.T=T;try{var V=c(b,m),J=O.S;J!==null&&J(T,V),j1(a,o,V)}catch(le){dm(a,o,le)}finally{w!==null&&T.types!==null&&(w.types=T.types),O.T=w}}else try{w=c(b,m),j1(a,o,w)}catch(le){dm(a,o,le)}}function j1(a,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){k1(a,o,m)},function(m){return dm(a,o,m)}):k1(a,o,c)}function k1(a,o,c){o.status="fulfilled",o.value=c,E1(o),a.state=c,o=a.pending,o!==null&&(c=o.next,c===o?a.pending=null:(c=c.next,o.next=c,C1(a,c)))}function dm(a,o,c){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do o.status="rejected",o.reason=c,E1(o),o=o.next;while(o!==m)}a.action=null}function E1(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function N1(a,o){return o}function T1(a,o){if(ot){var c=Et.formState;if(c!==null){e:{var m=Ke;if(ot){if(Dt){t:{for(var b=Dt,w=Sr;b.nodeType!==8;){if(!w){b=null;break t}if(b=Cr(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){Dt=Cr(b.nextSibling),m=b.data==="F!";break e}}fa(m)}m=!1}m&&(o=c[0])}}return c=Pn(),c.memoizedState=c.baseState=o,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:N1,lastRenderedState:o},c.queue=m,c=X1.bind(null,Ke,m),m.dispatch=c,m=cm(!1),w=ym.bind(null,Ke,!1,m.queue),m=Pn(),b={state:o,dispatch:null,action:a,pending:null},m.queue=b,c=jO.bind(null,Ke,b,w,c),b.dispatch=c,m.memoizedState=a,[o,c,!1]}function A1(a){var o=en();return R1(o,St,a)}function R1(a,o,c){if(o=lm(a,o,N1)[0],a=hd(Di)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var m=Ul(o)}catch(T){throw T===ho?rd:T}else m=o;o=en();var b=o.queue,w=b.dispatch;return c!==o.memoizedState&&(Ke.flags|=2048,vo(9,{destroy:void 0},kO.bind(null,b,c),null)),[m,w,a]}function kO(a,o){a.action=o}function M1(a){var o=en(),c=St;if(c!==null)return R1(o,c,a);en(),o=o.memoizedState,c=en();var m=c.queue.dispatch;return c.memoizedState=a,[o,m,!1]}function vo(a,o,c,m){return a={tag:a,create:c,deps:m,inst:o,next:null},o=Ke.updateQueue,o===null&&(o=dd(),Ke.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=a.next=a:(m=c.next,c.next=a,a.next=m,o.lastEffect=a),a}function D1(){return en().memoizedState}function pd(a,o,c,m){var b=Pn();Ke.flags|=a,b.memoizedState=vo(1|o,{destroy:void 0},c,m===void 0?null:m)}function md(a,o,c,m){var b=en();m=m===void 0?null:m;var w=b.memoizedState.inst;St!==null&&m!==null&&nm(m,St.memoizedState.deps)?b.memoizedState=vo(o,w,c,m):(Ke.flags|=a,b.memoizedState=vo(1|o,w,c,m))}function O1(a,o){pd(8390656,8,a,o)}function fm(a,o){md(2048,8,a,o)}function EO(a){Ke.flags|=4;var o=Ke.updateQueue;if(o===null)o=dd(),Ke.updateQueue=o,o.events=[a];else{var c=o.events;c===null?o.events=[a]:c.push(a)}}function z1(a){var o=en().memoizedState;return EO({ref:o,nextImpl:a}),function(){if((ft&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function P1(a,o){return md(4,2,a,o)}function L1(a,o){return md(4,4,a,o)}function I1(a,o){if(typeof o=="function"){a=a();var c=o(a);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function V1(a,o,c){c=c!=null?c.concat([a]):null,md(4,4,I1.bind(null,o,a),c)}function hm(){}function F1(a,o){var c=en();o=o===void 0?null:o;var m=c.memoizedState;return o!==null&&nm(o,m[1])?m[0]:(c.memoizedState=[a,o],a)}function U1(a,o){var c=en();o=o===void 0?null:o;var m=c.memoizedState;if(o!==null&&nm(o,m[1]))return m[0];if(m=a(),hs){jn(!0);try{a()}finally{jn(!1)}}return c.memoizedState=[m,o],m}function pm(a,o,c){return c===void 0||(Mi&1073741824)!==0&&(it&261930)===0?a.memoizedState=o:(a.memoizedState=c,a=Bw(),Ke.lanes|=a,wa|=a,c)}function B1(a,o,c,m){return er(c,o)?c:mo.current!==null?(a=pm(a,c,m),er(a,o)||(on=!0),a):(Mi&42)===0||(Mi&1073741824)!==0&&(it&261930)===0?(on=!0,a.memoizedState=c):(a=Bw(),Ke.lanes|=a,wa|=a,o)}function $1(a,o,c,m,b){var w=q.p;q.p=w!==0&&8>w?w:8;var T=O.T,V={};O.T=V,ym(a,!1,o,c);try{var J=b(),le=O.S;if(le!==null&&le(V,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ge=SO(J,m);Bl(a,o,ge,sr(a))}else Bl(a,o,m,sr(a))}catch(xe){Bl(a,o,{then:function(){},status:"rejected",reason:xe},sr())}finally{q.p=w,T!==null&&V.types!==null&&(T.types=V.types),O.T=T}}function NO(){}function mm(a,o,c,m){if(a.tag!==5)throw Error(i(476));var b=H1(a).queue;$1(a,b,o,I,c===null?NO:function(){return G1(a),c(m)})}function H1(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:I},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:c},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function G1(a){var o=H1(a);o.next===null&&(o=a.alternate.memoizedState),Bl(a,o.next.queue,{},sr())}function gm(){return xn(au)}function q1(){return en().memoizedState}function Y1(){return en().memoizedState}function TO(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var c=sr();a=ma(c);var m=ga(o,a,c);m!==null&&(qn(m,o,c),Ll(m,o,c)),o={cache:Gp()},a.payload=o;return}o=o.return}}function AO(a,o,c){var m=sr();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},gd(a)?K1(o,c):(c=Op(a,o,c,m),c!==null&&(qn(c,a,m),W1(c,o,m)))}function X1(a,o,c){var m=sr();Bl(a,o,c,m)}function Bl(a,o,c,m){var b={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(gd(a))K1(o,b);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=o.lastRenderedReducer,w!==null))try{var T=o.lastRenderedState,V=w(T,c);if(b.hasEagerState=!0,b.eagerState=V,er(V,T))return Wc(a,o,b,0),Et===null&&Kc(),!1}catch{}if(c=Op(a,o,b,m),c!==null)return qn(c,a,m),W1(c,o,m),!0}return!1}function ym(a,o,c,m){if(m={lane:2,revertLane:Km(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},gd(a)){if(o)throw Error(i(479))}else o=Op(a,c,m,2),o!==null&&qn(o,a,2)}function gd(a){var o=a.alternate;return a===Ke||o!==null&&o===Ke}function K1(a,o){go=ud=!0;var c=a.pending;c===null?o.next=o:(o.next=c.next,c.next=o),a.pending=o}function W1(a,o,c){if((c&4194048)!==0){var m=o.lanes;m&=a.pendingLanes,c|=m,o.lanes=c,_e(a,c)}}var $l={readContext:xn,use:fd,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};$l.useEffectEvent=$t;var Z1={readContext:xn,use:fd,useCallback:function(a,o){return Pn().memoizedState=[a,o===void 0?null:o],a},useContext:xn,useEffect:O1,useImperativeHandle:function(a,o,c){c=c!=null?c.concat([a]):null,pd(4194308,4,I1.bind(null,o,a),c)},useLayoutEffect:function(a,o){return pd(4194308,4,a,o)},useInsertionEffect:function(a,o){pd(4,2,a,o)},useMemo:function(a,o){var c=Pn();o=o===void 0?null:o;var m=a();if(hs){jn(!0);try{a()}finally{jn(!1)}}return c.memoizedState=[m,o],m},useReducer:function(a,o,c){var m=Pn();if(c!==void 0){var b=c(o);if(hs){jn(!0);try{c(o)}finally{jn(!1)}}}else b=o;return m.memoizedState=m.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},m.queue=a,a=a.dispatch=AO.bind(null,Ke,a),[m.memoizedState,a]},useRef:function(a){var o=Pn();return a={current:a},o.memoizedState=a},useState:function(a){a=cm(a);var o=a.queue,c=X1.bind(null,Ke,o);return o.dispatch=c,[a.memoizedState,c]},useDebugValue:hm,useDeferredValue:function(a,o){var c=Pn();return pm(c,a,o)},useTransition:function(){var a=cm(!1);return a=$1.bind(null,Ke,a.queue,!0,!1),Pn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,c){var m=Ke,b=Pn();if(ot){if(c===void 0)throw Error(i(407));c=c()}else{if(c=o(),Et===null)throw Error(i(349));(it&127)!==0||v1(m,o,c)}b.memoizedState=c;var w={value:c,getSnapshot:o};return b.queue=w,O1(b1.bind(null,m,w,a),[a]),m.flags|=2048,vo(9,{destroy:void 0},x1.bind(null,m,w,c,o),null),c},useId:function(){var a=Pn(),o=Et.identifierPrefix;if(ot){var c=ii,m=ri;c=(m&~(1<<32-pt(m)-1)).toString(32)+c,o="_"+o+"R_"+c,c=cd++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=_O++,o="_"+o+"r_"+c.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:gm,useFormState:T1,useActionState:T1,useOptimistic:function(a){var o=Pn();o.memoizedState=o.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=ym.bind(null,Ke,!0,c),c.dispatch=o,[a,o]},useMemoCache:om,useCacheRefresh:function(){return Pn().memoizedState=TO.bind(null,Ke)},useEffectEvent:function(a){var o=Pn(),c={impl:a};return o.memoizedState=c,function(){if((ft&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},vm={readContext:xn,use:fd,useCallback:F1,useContext:xn,useEffect:fm,useImperativeHandle:V1,useInsertionEffect:P1,useLayoutEffect:L1,useMemo:U1,useReducer:hd,useRef:D1,useState:function(){return hd(Di)},useDebugValue:hm,useDeferredValue:function(a,o){var c=en();return B1(c,St.memoizedState,a,o)},useTransition:function(){var a=hd(Di)[0],o=en().memoizedState;return[typeof a=="boolean"?a:Ul(a),o]},useSyncExternalStore:y1,useId:q1,useHostTransitionStatus:gm,useFormState:A1,useActionState:A1,useOptimistic:function(a,o){var c=en();return _1(c,St,a,o)},useMemoCache:om,useCacheRefresh:Y1};vm.useEffectEvent=z1;var Q1={readContext:xn,use:fd,useCallback:F1,useContext:xn,useEffect:fm,useImperativeHandle:V1,useInsertionEffect:P1,useLayoutEffect:L1,useMemo:U1,useReducer:um,useRef:D1,useState:function(){return um(Di)},useDebugValue:hm,useDeferredValue:function(a,o){var c=en();return St===null?pm(c,a,o):B1(c,St.memoizedState,a,o)},useTransition:function(){var a=um(Di)[0],o=en().memoizedState;return[typeof a=="boolean"?a:Ul(a),o]},useSyncExternalStore:y1,useId:q1,useHostTransitionStatus:gm,useFormState:M1,useActionState:M1,useOptimistic:function(a,o){var c=en();return St!==null?_1(c,St,a,o):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:om,useCacheRefresh:Y1};Q1.useEffectEvent=z1;function xm(a,o,c,m){o=a.memoizedState,c=c(m,o),c=c==null?o:y({},o,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var bm={enqueueSetState:function(a,o,c){a=a._reactInternals;var m=sr(),b=ma(m);b.payload=o,c!=null&&(b.callback=c),o=ga(a,b,m),o!==null&&(qn(o,a,m),Ll(o,a,m))},enqueueReplaceState:function(a,o,c){a=a._reactInternals;var m=sr(),b=ma(m);b.tag=1,b.payload=o,c!=null&&(b.callback=c),o=ga(a,b,m),o!==null&&(qn(o,a,m),Ll(o,a,m))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var c=sr(),m=ma(c);m.tag=2,o!=null&&(m.callback=o),o=ga(a,m,c),o!==null&&(qn(o,a,c),Ll(o,a,c))}};function J1(a,o,c,m,b,w,T){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,w,T):o.prototype&&o.prototype.isPureReactComponent?!Tl(c,m)||!Tl(b,w):!0}function ew(a,o,c,m){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,m),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,m),o.state!==a&&bm.enqueueReplaceState(o,o.state,null)}function ps(a,o){var c=o;if("ref"in o){c={};for(var m in o)m!=="ref"&&(c[m]=o[m])}if(a=a.defaultProps){c===o&&(c=y({},c));for(var b in a)c[b]===void 0&&(c[b]=a[b])}return c}function tw(a){Xc(a)}function nw(a){console.error(a)}function rw(a){Xc(a)}function yd(a,o){try{var c=a.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(m){setTimeout(function(){throw m})}}function iw(a,o,c){try{var m=a.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function wm(a,o,c){return c=ma(c),c.tag=3,c.payload={element:null},c.callback=function(){yd(a,o)},c}function aw(a){return a=ma(a),a.tag=3,a}function sw(a,o,c,m){var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var w=m.value;a.payload=function(){return b(w)},a.callback=function(){iw(o,c,m)}}var T=c.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(a.callback=function(){iw(o,c,m),typeof b!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var V=m.stack;this.componentDidCatch(m.value,{componentStack:V!==null?V:""})})}function RO(a,o,c,m,b){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(o=c.alternate,o!==null&&uo(o,c,b,!0),c=nr.current,c!==null){switch(c.tag){case 31:case 13:return _r===null?Td():c.alternate===null&&Ht===0&&(Ht=3),c.flags&=-257,c.flags|=65536,c.lanes=b,m===id?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([m]):o.add(m),qm(a,m,b)),!1;case 22:return c.flags|=65536,m===id?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([m]):c.add(m)),qm(a,m,b)),!1}throw Error(i(435,c.tag))}return qm(a,m,b),Td(),!1}if(ot)return o=nr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,m!==Fp&&(a=Error(i(422),{cause:m}),Ml(xr(a,c)))):(m!==Fp&&(o=Error(i(423),{cause:m}),Ml(xr(o,c))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,m=xr(m,c),b=wm(a.stateNode,m,b),Zp(a,b),Ht!==4&&(Ht=2)),!1;var w=Error(i(520),{cause:m});if(w=xr(w,c),Zl===null?Zl=[w]:Zl.push(w),Ht!==4&&(Ht=2),o===null)return!0;m=xr(m,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,a=b&-b,c.lanes|=a,a=wm(c.stateNode,m,a),Zp(c,a),!1;case 1:if(o=c.type,w=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Sa===null||!Sa.has(w))))return c.flags|=65536,b&=-b,c.lanes|=b,b=aw(b),sw(b,a,c,m),Zp(c,b),!1}c=c.return}while(c!==null);return!1}var Sm=Error(i(461)),on=!1;function bn(a,o,c,m){o.child=a===null?c1(o,null,c,m):fs(o,a.child,c,m)}function ow(a,o,c,m,b){c=c.render;var w=o.ref;if("ref"in m){var T={};for(var V in m)V!=="ref"&&(T[V]=m[V])}else T=m;return ls(o),m=rm(a,o,c,T,w,b),V=im(),a!==null&&!on?(am(a,o,b),Oi(a,o,b)):(ot&&V&&Ip(o),o.flags|=1,bn(a,o,m,b),o.child)}function lw(a,o,c,m,b){if(a===null){var w=c.type;return typeof w=="function"&&!zp(w)&&w.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=w,uw(a,o,w,m,b)):(a=Qc(c.type,null,m,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(w=a.child,!Am(a,b)){var T=w.memoizedProps;if(c=c.compare,c=c!==null?c:Tl,c(T,m)&&a.ref===o.ref)return Oi(a,o,b)}return o.flags|=1,a=Ni(w,m),a.ref=o.ref,a.return=o,o.child=a}function uw(a,o,c,m,b){if(a!==null){var w=a.memoizedProps;if(Tl(w,m)&&a.ref===o.ref)if(on=!1,o.pendingProps=m=w,Am(a,b))(a.flags&131072)!==0&&(on=!0);else return o.lanes=a.lanes,Oi(a,o,b)}return _m(a,o,c,m,b)}function cw(a,o,c,m){var b=m.children,w=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((o.flags&128)!==0){if(w=w!==null?w.baseLanes|c:c,a!==null){for(m=o.child=a.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~w}else m=0,o.child=null;return dw(a,o,w,c,m)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&nd(o,w!==null?w.cachePool:null),w!==null?h1(o,w):Jp(),p1(o);else return m=o.lanes=536870912,dw(a,o,w!==null?w.baseLanes|c:c,c,m)}else w!==null?(nd(o,w.cachePool),h1(o,w),va(),o.memoizedState=null):(a!==null&&nd(o,null),Jp(),va());return bn(a,o,b,c),o.child}function Hl(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function dw(a,o,c,m,b){var w=Yp();return w=w===null?null:{parent:an._currentValue,pool:w},o.memoizedState={baseLanes:c,cachePool:w},a!==null&&nd(o,null),Jp(),p1(o),a!==null&&uo(a,o,m,!0),o.childLanes=b,null}function vd(a,o){return o=bd({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function fw(a,o,c){return fs(o,a.child,null,c),a=vd(o,o.pendingProps),a.flags|=2,rr(o),o.memoizedState=null,a}function MO(a,o,c){var m=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(ot){if(m.mode==="hidden")return a=vd(o,m),o.lanes=536870912,Hl(null,a);if(tm(o),(a=Dt)?(a=CS(a,Sr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ca!==null?{id:ri,overflow:ii}:null,retryLane:536870912,hydrationErrors:null},c=Kb(a),c.return=o,o.child=c,vn=o,Dt=null)):a=null,a===null)throw fa(o);return o.lanes=536870912,null}return vd(o,m)}var w=a.memoizedState;if(w!==null){var T=w.dehydrated;if(tm(o),b)if(o.flags&256)o.flags&=-257,o=fw(a,o,c);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(i(558));else if(on||uo(a,o,c,!1),b=(c&a.childLanes)!==0,on||b){if(m=Et,m!==null&&(T=tt(m,c),T!==0&&T!==w.retryLane))throw w.retryLane=T,is(a,T),qn(m,a,T),Sm;Td(),o=fw(a,o,c)}else a=w.treeContext,Dt=Cr(T.nextSibling),vn=o,ot=!0,da=null,Sr=!1,a!==null&&Qb(o,a),o=vd(o,m),o.flags|=4096;return o}return a=Ni(a.child,{mode:m.mode,children:m.children}),a.ref=o.ref,o.child=a,a.return=o,a}function xd(a,o){var c=o.ref;if(c===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(a===null||a.ref!==c)&&(o.flags|=4194816)}}function _m(a,o,c,m,b){return ls(o),c=rm(a,o,c,m,void 0,b),m=im(),a!==null&&!on?(am(a,o,b),Oi(a,o,b)):(ot&&m&&Ip(o),o.flags|=1,bn(a,o,c,b),o.child)}function hw(a,o,c,m,b,w){return ls(o),o.updateQueue=null,c=g1(o,m,c,b),m1(a),m=im(),a!==null&&!on?(am(a,o,w),Oi(a,o,w)):(ot&&m&&Ip(o),o.flags|=1,bn(a,o,c,w),o.child)}function pw(a,o,c,m,b){if(ls(o),o.stateNode===null){var w=ao,T=c.contextType;typeof T=="object"&&T!==null&&(w=xn(T)),w=new c(m,w),o.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=bm,o.stateNode=w,w._reactInternals=o,w=o.stateNode,w.props=m,w.state=o.memoizedState,w.refs={},Kp(o),T=c.contextType,w.context=typeof T=="object"&&T!==null?xn(T):ao,w.state=o.memoizedState,T=c.getDerivedStateFromProps,typeof T=="function"&&(xm(o,c,T,m),w.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(T=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),T!==w.state&&bm.enqueueReplaceState(w,w.state,null),Vl(o,m,w,b),Il(),w.state=o.memoizedState),typeof w.componentDidMount=="function"&&(o.flags|=4194308),m=!0}else if(a===null){w=o.stateNode;var V=o.memoizedProps,J=ps(c,V);w.props=J;var le=w.context,ge=c.contextType;T=ao,typeof ge=="object"&&ge!==null&&(T=xn(ge));var xe=c.getDerivedStateFromProps;ge=typeof xe=="function"||typeof w.getSnapshotBeforeUpdate=="function",V=o.pendingProps!==V,ge||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(V||le!==T)&&ew(o,w,m,T),pa=!1;var ue=o.memoizedState;w.state=ue,Vl(o,m,w,b),Il(),le=o.memoizedState,V||ue!==le||pa?(typeof xe=="function"&&(xm(o,c,xe,m),le=o.memoizedState),(J=pa||J1(o,c,J,m,ue,le,T))?(ge||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(o.flags|=4194308)):(typeof w.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=m,o.memoizedState=le),w.props=m,w.state=le,w.context=T,m=J):(typeof w.componentDidMount=="function"&&(o.flags|=4194308),m=!1)}else{w=o.stateNode,Wp(a,o),T=o.memoizedProps,ge=ps(c,T),w.props=ge,xe=o.pendingProps,ue=w.context,le=c.contextType,J=ao,typeof le=="object"&&le!==null&&(J=xn(le)),V=c.getDerivedStateFromProps,(le=typeof V=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==xe||ue!==J)&&ew(o,w,m,J),pa=!1,ue=o.memoizedState,w.state=ue,Vl(o,m,w,b),Il();var de=o.memoizedState;T!==xe||ue!==de||pa||a!==null&&a.dependencies!==null&&ed(a.dependencies)?(typeof V=="function"&&(xm(o,c,V,m),de=o.memoizedState),(ge=pa||J1(o,c,ge,m,ue,de,J)||a!==null&&a.dependencies!==null&&ed(a.dependencies))?(le||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(m,de,J),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(m,de,J)),typeof w.componentDidUpdate=="function"&&(o.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof w.componentDidUpdate!="function"||T===a.memoizedProps&&ue===a.memoizedState||(o.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===a.memoizedProps&&ue===a.memoizedState||(o.flags|=1024),o.memoizedProps=m,o.memoizedState=de),w.props=m,w.state=de,w.context=J,m=ge):(typeof w.componentDidUpdate!="function"||T===a.memoizedProps&&ue===a.memoizedState||(o.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===a.memoizedProps&&ue===a.memoizedState||(o.flags|=1024),m=!1)}return w=m,xd(a,o),m=(o.flags&128)!==0,w||m?(w=o.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:w.render(),o.flags|=1,a!==null&&m?(o.child=fs(o,a.child,null,b),o.child=fs(o,null,c,b)):bn(a,o,c,b),o.memoizedState=w.state,a=o.child):a=Oi(a,o,b),a}function mw(a,o,c,m){return ss(),o.flags|=256,bn(a,o,c,m),o.child}var Cm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jm(a){return{baseLanes:a,cachePool:i1()}}function km(a,o,c){return a=a!==null?a.childLanes&~c:0,o&&(a|=ar),a}function gw(a,o,c){var m=o.pendingProps,b=!1,w=(o.flags&128)!==0,T;if((T=w)||(T=a!==null&&a.memoizedState===null?!1:(Jt.current&2)!==0),T&&(b=!0,o.flags&=-129),T=(o.flags&32)!==0,o.flags&=-33,a===null){if(ot){if(b?ya(o):va(),(a=Dt)?(a=CS(a,Sr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ca!==null?{id:ri,overflow:ii}:null,retryLane:536870912,hydrationErrors:null},c=Kb(a),c.return=o,o.child=c,vn=o,Dt=null)):a=null,a===null)throw fa(o);return lg(a)?o.lanes=32:o.lanes=536870912,null}var V=m.children;return m=m.fallback,b?(va(),b=o.mode,V=bd({mode:"hidden",children:V},b),m=as(m,b,c,null),V.return=o,m.return=o,V.sibling=m,o.child=V,m=o.child,m.memoizedState=jm(c),m.childLanes=km(a,T,c),o.memoizedState=Cm,Hl(null,m)):(ya(o),Em(o,V))}var J=a.memoizedState;if(J!==null&&(V=J.dehydrated,V!==null)){if(w)o.flags&256?(ya(o),o.flags&=-257,o=Nm(a,o,c)):o.memoizedState!==null?(va(),o.child=a.child,o.flags|=128,o=null):(va(),V=m.fallback,b=o.mode,m=bd({mode:"visible",children:m.children},b),V=as(V,b,c,null),V.flags|=2,m.return=o,V.return=o,m.sibling=V,o.child=m,fs(o,a.child,null,c),m=o.child,m.memoizedState=jm(c),m.childLanes=km(a,T,c),o.memoizedState=Cm,o=Hl(null,m));else if(ya(o),lg(V)){if(T=V.nextSibling&&V.nextSibling.dataset,T)var le=T.dgst;T=le,m=Error(i(419)),m.stack="",m.digest=T,Ml({value:m,source:null,stack:null}),o=Nm(a,o,c)}else if(on||uo(a,o,c,!1),T=(c&a.childLanes)!==0,on||T){if(T=Et,T!==null&&(m=tt(T,c),m!==0&&m!==J.retryLane))throw J.retryLane=m,is(a,m),qn(T,a,m),Sm;og(V)||Td(),o=Nm(a,o,c)}else og(V)?(o.flags|=192,o.child=a.child,o=null):(a=J.treeContext,Dt=Cr(V.nextSibling),vn=o,ot=!0,da=null,Sr=!1,a!==null&&Qb(o,a),o=Em(o,m.children),o.flags|=4096);return o}return b?(va(),V=m.fallback,b=o.mode,J=a.child,le=J.sibling,m=Ni(J,{mode:"hidden",children:m.children}),m.subtreeFlags=J.subtreeFlags&65011712,le!==null?V=Ni(le,V):(V=as(V,b,c,null),V.flags|=2),V.return=o,m.return=o,m.sibling=V,o.child=m,Hl(null,m),m=o.child,V=a.child.memoizedState,V===null?V=jm(c):(b=V.cachePool,b!==null?(J=an._currentValue,b=b.parent!==J?{parent:J,pool:J}:b):b=i1(),V={baseLanes:V.baseLanes|c,cachePool:b}),m.memoizedState=V,m.childLanes=km(a,T,c),o.memoizedState=Cm,Hl(a.child,m)):(ya(o),c=a.child,a=c.sibling,c=Ni(c,{mode:"visible",children:m.children}),c.return=o,c.sibling=null,a!==null&&(T=o.deletions,T===null?(o.deletions=[a],o.flags|=16):T.push(a)),o.child=c,o.memoizedState=null,c)}function Em(a,o){return o=bd({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function bd(a,o){return a=tr(22,a,null,o),a.lanes=0,a}function Nm(a,o,c){return fs(o,a.child,null,c),a=Em(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function yw(a,o,c){a.lanes|=o;var m=a.alternate;m!==null&&(m.lanes|=o),$p(a.return,o,c)}function Tm(a,o,c,m,b,w){var T=a.memoizedState;T===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:b,treeForkCount:w}:(T.isBackwards=o,T.rendering=null,T.renderingStartTime=0,T.last=m,T.tail=c,T.tailMode=b,T.treeForkCount=w)}function vw(a,o,c){var m=o.pendingProps,b=m.revealOrder,w=m.tail;m=m.children;var T=Jt.current,V=(T&2)!==0;if(V?(T=T&1|2,o.flags|=128):T&=1,L(Jt,T),bn(a,o,m,c),m=ot?Rl:0,!V&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&yw(a,c,o);else if(a.tag===19)yw(a,c,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(c=o.child,b=null;c!==null;)a=c.alternate,a!==null&&ld(a)===null&&(b=c),c=c.sibling;c=b,c===null?(b=o.child,o.child=null):(b=c.sibling,c.sibling=null),Tm(o,!1,b,c,w,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&ld(a)===null){o.child=b;break}a=b.sibling,b.sibling=c,c=b,b=a}Tm(o,!0,c,null,w,m);break;case"together":Tm(o,!1,null,null,void 0,m);break;default:o.memoizedState=null}return o.child}function Oi(a,o,c){if(a!==null&&(o.dependencies=a.dependencies),wa|=o.lanes,(c&o.childLanes)===0)if(a!==null){if(uo(a,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(i(153));if(o.child!==null){for(a=o.child,c=Ni(a,a.pendingProps),o.child=c,c.return=o;a.sibling!==null;)a=a.sibling,c=c.sibling=Ni(a,a.pendingProps),c.return=o;c.sibling=null}return o.child}function Am(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&ed(a)))}function DO(a,o,c){switch(o.tag){case 3:re(o,o.stateNode.containerInfo),ha(o,an,a.memoizedState.cache),ss();break;case 27:case 5:we(o);break;case 4:re(o,o.stateNode.containerInfo);break;case 10:ha(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,tm(o),null;break;case 13:var m=o.memoizedState;if(m!==null)return m.dehydrated!==null?(ya(o),o.flags|=128,null):(c&o.child.childLanes)!==0?gw(a,o,c):(ya(o),a=Oi(a,o,c),a!==null?a.sibling:null);ya(o);break;case 19:var b=(a.flags&128)!==0;if(m=(c&o.childLanes)!==0,m||(uo(a,o,c,!1),m=(c&o.childLanes)!==0),b){if(m)return vw(a,o,c);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),L(Jt,Jt.current),m)break;return null;case 22:return o.lanes=0,cw(a,o,c,o.pendingProps);case 24:ha(o,an,a.memoizedState.cache)}return Oi(a,o,c)}function xw(a,o,c){if(a!==null)if(a.memoizedProps!==o.pendingProps)on=!0;else{if(!Am(a,c)&&(o.flags&128)===0)return on=!1,DO(a,o,c);on=(a.flags&131072)!==0}else on=!1,ot&&(o.flags&1048576)!==0&&Zb(o,Rl,o.index);switch(o.lanes=0,o.tag){case 16:e:{var m=o.pendingProps;if(a=cs(o.elementType),o.type=a,typeof a=="function")zp(a)?(m=ps(a,m),o.tag=1,o=pw(null,o,a,m,c)):(o.tag=0,o=_m(null,o,a,m,c));else{if(a!=null){var b=a.$$typeof;if(b===M){o.tag=11,o=ow(null,o,a,m,c);break e}else if(b===P){o.tag=14,o=lw(null,o,a,m,c);break e}}throw o=B(a)||a,Error(i(306,o,""))}}return o;case 0:return _m(a,o,o.type,o.pendingProps,c);case 1:return m=o.type,b=ps(m,o.pendingProps),pw(a,o,m,b,c);case 3:e:{if(re(o,o.stateNode.containerInfo),a===null)throw Error(i(387));m=o.pendingProps;var w=o.memoizedState;b=w.element,Wp(a,o),Vl(o,m,null,c);var T=o.memoizedState;if(m=T.cache,ha(o,an,m),m!==w.cache&&Hp(o,[an],c,!0),Il(),m=T.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:T.cache},o.updateQueue.baseState=w,o.memoizedState=w,o.flags&256){o=mw(a,o,m,c);break e}else if(m!==b){b=xr(Error(i(424)),o),Ml(b),o=mw(a,o,m,c);break e}else for(a=o.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,Dt=Cr(a.firstChild),vn=o,ot=!0,da=null,Sr=!0,c=c1(o,null,m,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(ss(),m===b){o=Oi(a,o,c);break e}bn(a,o,m,c)}o=o.child}return o;case 26:return xd(a,o),a===null?(c=AS(o.type,null,o.pendingProps,null))?o.memoizedState=c:ot||(c=o.type,a=o.pendingProps,m=Pd(Y.current).createElement(c),m[Mt]=o,m[dn]=a,wn(m,c,a),gn(m),o.stateNode=m):o.memoizedState=AS(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return we(o),a===null&&ot&&(m=o.stateNode=ES(o.type,o.pendingProps,Y.current),vn=o,Sr=!0,b=Dt,ka(o.type)?(ug=b,Dt=Cr(m.firstChild)):Dt=b),bn(a,o,o.pendingProps.children,c),xd(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&ot&&((b=m=Dt)&&(m=u4(m,o.type,o.pendingProps,Sr),m!==null?(o.stateNode=m,vn=o,Dt=Cr(m.firstChild),Sr=!1,b=!0):b=!1),b||fa(o)),we(o),b=o.type,w=o.pendingProps,T=a!==null?a.memoizedProps:null,m=w.children,ig(b,w)?m=null:T!==null&&ig(b,T)&&(o.flags|=32),o.memoizedState!==null&&(b=rm(a,o,CO,null,null,c),au._currentValue=b),xd(a,o),bn(a,o,m,c),o.child;case 6:return a===null&&ot&&((a=c=Dt)&&(c=c4(c,o.pendingProps,Sr),c!==null?(o.stateNode=c,vn=o,Dt=null,a=!0):a=!1),a||fa(o)),null;case 13:return gw(a,o,c);case 4:return re(o,o.stateNode.containerInfo),m=o.pendingProps,a===null?o.child=fs(o,null,m,c):bn(a,o,m,c),o.child;case 11:return ow(a,o,o.type,o.pendingProps,c);case 7:return bn(a,o,o.pendingProps,c),o.child;case 8:return bn(a,o,o.pendingProps.children,c),o.child;case 12:return bn(a,o,o.pendingProps.children,c),o.child;case 10:return m=o.pendingProps,ha(o,o.type,m.value),bn(a,o,m.children,c),o.child;case 9:return b=o.type._context,m=o.pendingProps.children,ls(o),b=xn(b),m=m(b),o.flags|=1,bn(a,o,m,c),o.child;case 14:return lw(a,o,o.type,o.pendingProps,c);case 15:return uw(a,o,o.type,o.pendingProps,c);case 19:return vw(a,o,c);case 31:return MO(a,o,c);case 22:return cw(a,o,c,o.pendingProps);case 24:return ls(o),m=xn(an),a===null?(b=Yp(),b===null&&(b=Et,w=Gp(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=c),b=w),o.memoizedState={parent:m,cache:b},Kp(o),ha(o,an,b)):((a.lanes&c)!==0&&(Wp(a,o),Vl(o,null,null,c),Il()),b=a.memoizedState,w=o.memoizedState,b.parent!==m?(b={parent:m,cache:m},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),ha(o,an,m)):(m=w.cache,ha(o,an,m),m!==b.cache&&Hp(o,[an],c,!0))),bn(a,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function zi(a){a.flags|=4}function Rm(a,o,c,m,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(qw())a.flags|=8192;else throw ds=id,Xp}else a.flags&=-16777217}function bw(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!zS(o))if(qw())a.flags|=8192;else throw ds=id,Xp}function wd(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?Lc():536870912,a.lanes|=o,So|=o)}function Gl(a,o){if(!ot)switch(a.tailMode){case"hidden":o=a.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Ot(a){var o=a.alternate!==null&&a.alternate.child===a.child,c=0,m=0;if(o)for(var b=a.child;b!==null;)c|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)c|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=m,a.childLanes=c,o}function OO(a,o,c){var m=o.pendingProps;switch(Vp(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(o),null;case 1:return Ot(o),null;case 3:return c=o.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),o.memoizedState.cache!==m&&(o.flags|=2048),Ri(an),fe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(lo(o)?zi(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Up())),Ot(o),null;case 26:var b=o.type,w=o.memoizedState;return a===null?(zi(o),w!==null?(Ot(o),bw(o,w)):(Ot(o),Rm(o,b,null,m,c))):w?w!==a.memoizedState?(zi(o),Ot(o),bw(o,w)):(Ot(o),o.flags&=-16777217):(a=a.memoizedProps,a!==m&&zi(o),Ot(o),Rm(o,b,a,m,c)),null;case 27:if(ke(o),c=Y.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==m&&zi(o);else{if(!m){if(o.stateNode===null)throw Error(i(166));return Ot(o),null}a=ee.current,lo(o)?Jb(o):(a=ES(b,m,c),o.stateNode=a,zi(o))}return Ot(o),null;case 5:if(ke(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==m&&zi(o);else{if(!m){if(o.stateNode===null)throw Error(i(166));return Ot(o),null}if(w=ee.current,lo(o))Jb(o);else{var T=Pd(Y.current);switch(w){case 1:w=T.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=T.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=T.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=T.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=T.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof m.is=="string"?T.createElement("select",{is:m.is}):T.createElement("select"),m.multiple?w.multiple=!0:m.size&&(w.size=m.size);break;default:w=typeof m.is=="string"?T.createElement(b,{is:m.is}):T.createElement(b)}}w[Mt]=o,w[dn]=m;e:for(T=o.child;T!==null;){if(T.tag===5||T.tag===6)w.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===o)break e;for(;T.sibling===null;){if(T.return===null||T.return===o)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}o.stateNode=w;e:switch(wn(w,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&zi(o)}}return Ot(o),Rm(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,c),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==m&&zi(o);else{if(typeof m!="string"&&o.stateNode===null)throw Error(i(166));if(a=Y.current,lo(o)){if(a=o.stateNode,c=o.memoizedProps,m=null,b=vn,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}a[Mt]=o,a=!!(a.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||gS(a.nodeValue,c)),a||fa(o,!0)}else a=Pd(a).createTextNode(m),a[Mt]=o,o.stateNode=a}return Ot(o),null;case 31:if(c=o.memoizedState,a===null||a.memoizedState!==null){if(m=lo(o),c!==null){if(a===null){if(!m)throw Error(i(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[Mt]=o}else ss(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ot(o),a=!1}else c=Up(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return o.flags&256?(rr(o),o):(rr(o),null);if((o.flags&128)!==0)throw Error(i(558))}return Ot(o),null;case 13:if(m=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=lo(o),m!==null&&m.dehydrated!==null){if(a===null){if(!b)throw Error(i(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(i(317));b[Mt]=o}else ss(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ot(o),b=!1}else b=Up(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(rr(o),o):(rr(o),null)}return rr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=m!==null,a=a!==null&&a.memoizedState!==null,c&&(m=o.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),w=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(w=m.memoizedState.cachePool.pool),w!==b&&(m.flags|=2048)),c!==a&&c&&(o.child.flags|=8192),wd(o,o.updateQueue),Ot(o),null);case 4:return fe(),a===null&&Jm(o.stateNode.containerInfo),Ot(o),null;case 10:return Ri(o.type),Ot(o),null;case 19:if(G(Jt),m=o.memoizedState,m===null)return Ot(o),null;if(b=(o.flags&128)!==0,w=m.rendering,w===null)if(b)Gl(m,!1);else{if(Ht!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(w=ld(a),w!==null){for(o.flags|=128,Gl(m,!1),a=w.updateQueue,o.updateQueue=a,wd(o,a),o.subtreeFlags=0,a=c,c=o.child;c!==null;)Xb(c,a),c=c.sibling;return L(Jt,Jt.current&1|2),ot&&Ti(o,m.treeForkCount),o.child}a=a.sibling}m.tail!==null&&wt()>kd&&(o.flags|=128,b=!0,Gl(m,!1),o.lanes=4194304)}else{if(!b)if(a=ld(w),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,wd(o,a),Gl(m,!0),m.tail===null&&m.tailMode==="hidden"&&!w.alternate&&!ot)return Ot(o),null}else 2*wt()-m.renderingStartTime>kd&&c!==536870912&&(o.flags|=128,b=!0,Gl(m,!1),o.lanes=4194304);m.isBackwards?(w.sibling=o.child,o.child=w):(a=m.last,a!==null?a.sibling=w:o.child=w,m.last=w)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=wt(),a.sibling=null,c=Jt.current,L(Jt,b?c&1|2:c&1),ot&&Ti(o,m.treeForkCount),a):(Ot(o),null);case 22:case 23:return rr(o),em(),m=o.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(o.flags|=8192):m&&(o.flags|=8192),m?(c&536870912)!==0&&(o.flags&128)===0&&(Ot(o),o.subtreeFlags&6&&(o.flags|=8192)):Ot(o),c=o.updateQueue,c!==null&&wd(o,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==c&&(o.flags|=2048),a!==null&&G(us),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),Ri(an),Ot(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function zO(a,o){switch(Vp(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Ri(an),fe(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return ke(o),null;case 31:if(o.memoizedState!==null){if(rr(o),o.alternate===null)throw Error(i(340));ss()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(rr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(i(340));ss()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return G(Jt),null;case 4:return fe(),null;case 10:return Ri(o.type),null;case 22:case 23:return rr(o),em(),a!==null&&G(us),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return Ri(an),null;case 25:return null;default:return null}}function ww(a,o){switch(Vp(o),o.tag){case 3:Ri(an),fe();break;case 26:case 27:case 5:ke(o);break;case 4:fe();break;case 31:o.memoizedState!==null&&rr(o);break;case 13:rr(o);break;case 19:G(Jt);break;case 10:Ri(o.type);break;case 22:case 23:rr(o),em(),a!==null&&G(us);break;case 24:Ri(an)}}function ql(a,o){try{var c=o.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var b=m.next;c=b;do{if((c.tag&a)===a){m=void 0;var w=c.create,T=c.inst;m=w(),T.destroy=m}c=c.next}while(c!==b)}}catch(V){xt(o,o.return,V)}}function xa(a,o,c){try{var m=o.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var w=b.next;m=w;do{if((m.tag&a)===a){var T=m.inst,V=T.destroy;if(V!==void 0){T.destroy=void 0,b=o;var J=c,le=V;try{le()}catch(ge){xt(b,J,ge)}}}m=m.next}while(m!==w)}}catch(ge){xt(o,o.return,ge)}}function Sw(a){var o=a.updateQueue;if(o!==null){var c=a.stateNode;try{f1(o,c)}catch(m){xt(a,a.return,m)}}}function _w(a,o,c){c.props=ps(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(m){xt(a,o,m)}}function Yl(a,o){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof c=="function"?a.refCleanup=c(m):c.current=m}}catch(b){xt(a,o,b)}}function ai(a,o){var c=a.ref,m=a.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(b){xt(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(b){xt(a,o,b)}else c.current=null}function Cw(a){var o=a.type,c=a.memoizedProps,m=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(b){xt(a,a.return,b)}}function Mm(a,o,c){try{var m=a.stateNode;r4(m,a.type,c,o),m[dn]=o}catch(b){xt(a,a.return,b)}}function jw(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&ka(a.type)||a.tag===4}function Dm(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||jw(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&ka(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Om(a,o,c){var m=a.tag;if(m===5||m===6)a=a.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(a),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=ki));else if(m!==4&&(m===27&&ka(a.type)&&(c=a.stateNode,o=null),a=a.child,a!==null))for(Om(a,o,c),a=a.sibling;a!==null;)Om(a,o,c),a=a.sibling}function Sd(a,o,c){var m=a.tag;if(m===5||m===6)a=a.stateNode,o?c.insertBefore(a,o):c.appendChild(a);else if(m!==4&&(m===27&&ka(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(Sd(a,o,c),a=a.sibling;a!==null;)Sd(a,o,c),a=a.sibling}function kw(a){var o=a.stateNode,c=a.memoizedProps;try{for(var m=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);wn(o,m,c),o[Mt]=a,o[dn]=c}catch(w){xt(a,a.return,w)}}var Pi=!1,ln=!1,zm=!1,Ew=typeof WeakSet=="function"?WeakSet:Set,yn=null;function PO(a,o){if(a=a.containerInfo,ng=$d,a=Vb(a),Np(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var b=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{c.nodeType,w.nodeType}catch{c=null;break e}var T=0,V=-1,J=-1,le=0,ge=0,xe=a,ue=null;t:for(;;){for(var de;xe!==c||b!==0&&xe.nodeType!==3||(V=T+b),xe!==w||m!==0&&xe.nodeType!==3||(J=T+m),xe.nodeType===3&&(T+=xe.nodeValue.length),(de=xe.firstChild)!==null;)ue=xe,xe=de;for(;;){if(xe===a)break t;if(ue===c&&++le===b&&(V=T),ue===w&&++ge===m&&(J=T),(de=xe.nextSibling)!==null)break;xe=ue,ue=xe.parentNode}xe=de}c=V===-1||J===-1?null:{start:V,end:J}}else c=null}c=c||{start:0,end:0}}else c=null;for(rg={focusedElem:a,selectionRange:c},$d=!1,yn=o;yn!==null;)if(o=yn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,yn=a;else for(;yn!==null;){switch(o=yn,w=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(c=0;c<a.length;c++)b=a[c],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&w!==null){a=void 0,c=o,b=w.memoizedProps,w=w.memoizedState,m=c.stateNode;try{var Te=ps(c.type,b);a=m.getSnapshotBeforeUpdate(Te,w),m.__reactInternalSnapshotBeforeUpdate=a}catch(Ve){xt(c,c.return,Ve)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,c=a.nodeType,c===9)sg(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":sg(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=o.sibling,a!==null){a.return=o.return,yn=a;break}yn=o.return}}function Nw(a,o,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:Ii(a,c),m&4&&ql(5,c);break;case 1:if(Ii(a,c),m&4)if(a=c.stateNode,o===null)try{a.componentDidMount()}catch(T){xt(c,c.return,T)}else{var b=ps(c.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(T){xt(c,c.return,T)}}m&64&&Sw(c),m&512&&Yl(c,c.return);break;case 3:if(Ii(a,c),m&64&&(a=c.updateQueue,a!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{f1(a,o)}catch(T){xt(c,c.return,T)}}break;case 27:o===null&&m&4&&kw(c);case 26:case 5:Ii(a,c),o===null&&m&4&&Cw(c),m&512&&Yl(c,c.return);break;case 12:Ii(a,c);break;case 31:Ii(a,c),m&4&&Rw(a,c);break;case 13:Ii(a,c),m&4&&Mw(a,c),m&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=GO.bind(null,c),d4(a,c))));break;case 22:if(m=c.memoizedState!==null||Pi,!m){o=o!==null&&o.memoizedState!==null||ln,b=Pi;var w=ln;Pi=m,(ln=o)&&!w?Vi(a,c,(c.subtreeFlags&8772)!==0):Ii(a,c),Pi=b,ln=w}break;case 30:break;default:Ii(a,c)}}function Tw(a){var o=a.alternate;o!==null&&(a.alternate=null,Tw(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&dp(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var It=null,Bn=!1;function Li(a,o,c){for(c=c.child;c!==null;)Aw(a,o,c),c=c.sibling}function Aw(a,o,c){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(kt,c)}catch{}switch(c.tag){case 26:ln||ai(c,o),Li(a,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:ln||ai(c,o);var m=It,b=Bn;ka(c.type)&&(It=c.stateNode,Bn=!1),Li(a,o,c),nu(c.stateNode),It=m,Bn=b;break;case 5:ln||ai(c,o);case 6:if(m=It,b=Bn,It=null,Li(a,o,c),It=m,Bn=b,It!==null)if(Bn)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(c.stateNode)}catch(w){xt(c,o,w)}else try{It.removeChild(c.stateNode)}catch(w){xt(c,o,w)}break;case 18:It!==null&&(Bn?(a=It,SS(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),Ao(a)):SS(It,c.stateNode));break;case 4:m=It,b=Bn,It=c.stateNode.containerInfo,Bn=!0,Li(a,o,c),It=m,Bn=b;break;case 0:case 11:case 14:case 15:xa(2,c,o),ln||xa(4,c,o),Li(a,o,c);break;case 1:ln||(ai(c,o),m=c.stateNode,typeof m.componentWillUnmount=="function"&&_w(c,o,m)),Li(a,o,c);break;case 21:Li(a,o,c);break;case 22:ln=(m=ln)||c.memoizedState!==null,Li(a,o,c),ln=m;break;default:Li(a,o,c)}}function Rw(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Ao(a)}catch(c){xt(o,o.return,c)}}}function Mw(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Ao(a)}catch(c){xt(o,o.return,c)}}function LO(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new Ew),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new Ew),o;default:throw Error(i(435,a.tag))}}function _d(a,o){var c=LO(a);o.forEach(function(m){if(!c.has(m)){c.add(m);var b=qO.bind(null,a,m);m.then(b,b)}})}function $n(a,o){var c=o.deletions;if(c!==null)for(var m=0;m<c.length;m++){var b=c[m],w=a,T=o,V=T;e:for(;V!==null;){switch(V.tag){case 27:if(ka(V.type)){It=V.stateNode,Bn=!1;break e}break;case 5:It=V.stateNode,Bn=!1;break e;case 3:case 4:It=V.stateNode.containerInfo,Bn=!0;break e}V=V.return}if(It===null)throw Error(i(160));Aw(w,T,b),It=null,Bn=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Dw(o,a),o=o.sibling}var Ir=null;function Dw(a,o){var c=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:$n(o,a),Hn(a),m&4&&(xa(3,a,a.return),ql(3,a),xa(5,a,a.return));break;case 1:$n(o,a),Hn(a),m&512&&(ln||c===null||ai(c,c.return)),m&64&&Pi&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var b=Ir;if($n(o,a),Hn(a),m&512&&(ln||c===null||ai(c,c.return)),m&4){var w=c!==null?c.memoizedState:null;if(m=a.memoizedState,c===null)if(m===null)if(a.stateNode===null){e:{m=a.type,c=a.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":w=b.getElementsByTagName("title")[0],(!w||w[bl]||w[Mt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(m),b.head.insertBefore(w,b.querySelector("head > title"))),wn(w,m,c),w[Mt]=a,gn(w),m=w;break e;case"link":var T=DS("link","href",b).get(m+(c.href||""));if(T){for(var V=0;V<T.length;V++)if(w=T[V],w.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&w.getAttribute("rel")===(c.rel==null?null:c.rel)&&w.getAttribute("title")===(c.title==null?null:c.title)&&w.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){T.splice(V,1);break t}}w=b.createElement(m),wn(w,m,c),b.head.appendChild(w);break;case"meta":if(T=DS("meta","content",b).get(m+(c.content||""))){for(V=0;V<T.length;V++)if(w=T[V],w.getAttribute("content")===(c.content==null?null:""+c.content)&&w.getAttribute("name")===(c.name==null?null:c.name)&&w.getAttribute("property")===(c.property==null?null:c.property)&&w.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&w.getAttribute("charset")===(c.charSet==null?null:c.charSet)){T.splice(V,1);break t}}w=b.createElement(m),wn(w,m,c),b.head.appendChild(w);break;default:throw Error(i(468,m))}w[Mt]=a,gn(w),m=w}a.stateNode=m}else OS(b,a.type,a.stateNode);else a.stateNode=MS(b,m,a.memoizedProps);else w!==m?(w===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):w.count--,m===null?OS(b,a.type,a.stateNode):MS(b,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Mm(a,a.memoizedProps,c.memoizedProps)}break;case 27:$n(o,a),Hn(a),m&512&&(ln||c===null||ai(c,c.return)),c!==null&&m&4&&Mm(a,a.memoizedProps,c.memoizedProps);break;case 5:if($n(o,a),Hn(a),m&512&&(ln||c===null||ai(c,c.return)),a.flags&32){b=a.stateNode;try{Qs(b,"")}catch(Te){xt(a,a.return,Te)}}m&4&&a.stateNode!=null&&(b=a.memoizedProps,Mm(a,b,c!==null?c.memoizedProps:b)),m&1024&&(zm=!0);break;case 6:if($n(o,a),Hn(a),m&4){if(a.stateNode===null)throw Error(i(162));m=a.memoizedProps,c=a.stateNode;try{c.nodeValue=m}catch(Te){xt(a,a.return,Te)}}break;case 3:if(Vd=null,b=Ir,Ir=Ld(o.containerInfo),$n(o,a),Ir=b,Hn(a),m&4&&c!==null&&c.memoizedState.isDehydrated)try{Ao(o.containerInfo)}catch(Te){xt(a,a.return,Te)}zm&&(zm=!1,Ow(a));break;case 4:m=Ir,Ir=Ld(a.stateNode.containerInfo),$n(o,a),Hn(a),Ir=m;break;case 12:$n(o,a),Hn(a);break;case 31:$n(o,a),Hn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,_d(a,m)));break;case 13:$n(o,a),Hn(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(jd=wt()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,_d(a,m)));break;case 22:b=a.memoizedState!==null;var J=c!==null&&c.memoizedState!==null,le=Pi,ge=ln;if(Pi=le||b,ln=ge||J,$n(o,a),ln=ge,Pi=le,Hn(a),m&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(c===null||J||Pi||ln||ms(a)),c=null,o=a;;){if(o.tag===5||o.tag===26){if(c===null){J=c=o;try{if(w=J.stateNode,b)T=w.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{V=J.stateNode;var xe=J.memoizedProps.style,ue=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;V.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Te){xt(J,J.return,Te)}}}else if(o.tag===6){if(c===null){J=o;try{J.stateNode.nodeValue=b?"":J.memoizedProps}catch(Te){xt(J,J.return,Te)}}}else if(o.tag===18){if(c===null){J=o;try{var de=J.stateNode;b?_S(de,!0):_S(J.stateNode,!1)}catch(Te){xt(J,J.return,Te)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}m&4&&(m=a.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,_d(a,c))));break;case 19:$n(o,a),Hn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,_d(a,m)));break;case 30:break;case 21:break;default:$n(o,a),Hn(a)}}function Hn(a){var o=a.flags;if(o&2){try{for(var c,m=a.return;m!==null;){if(jw(m)){c=m;break}m=m.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var b=c.stateNode,w=Dm(a);Sd(a,w,b);break;case 5:var T=c.stateNode;c.flags&32&&(Qs(T,""),c.flags&=-33);var V=Dm(a);Sd(a,V,T);break;case 3:case 4:var J=c.stateNode.containerInfo,le=Dm(a);Om(a,le,J);break;default:throw Error(i(161))}}catch(ge){xt(a,a.return,ge)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function Ow(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;Ow(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function Ii(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Nw(a,o.alternate,o),o=o.sibling}function ms(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:xa(4,o,o.return),ms(o);break;case 1:ai(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&_w(o,o.return,c),ms(o);break;case 27:nu(o.stateNode);case 26:case 5:ai(o,o.return),ms(o);break;case 22:o.memoizedState===null&&ms(o);break;case 30:ms(o);break;default:ms(o)}a=a.sibling}}function Vi(a,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var m=o.alternate,b=a,w=o,T=w.flags;switch(w.tag){case 0:case 11:case 15:Vi(b,w,c),ql(4,w);break;case 1:if(Vi(b,w,c),m=w,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(le){xt(m,m.return,le)}if(m=w,b=m.updateQueue,b!==null){var V=m.stateNode;try{var J=b.shared.hiddenCallbacks;if(J!==null)for(b.shared.hiddenCallbacks=null,b=0;b<J.length;b++)d1(J[b],V)}catch(le){xt(m,m.return,le)}}c&&T&64&&Sw(w),Yl(w,w.return);break;case 27:kw(w);case 26:case 5:Vi(b,w,c),c&&m===null&&T&4&&Cw(w),Yl(w,w.return);break;case 12:Vi(b,w,c);break;case 31:Vi(b,w,c),c&&T&4&&Rw(b,w);break;case 13:Vi(b,w,c),c&&T&4&&Mw(b,w);break;case 22:w.memoizedState===null&&Vi(b,w,c),Yl(w,w.return);break;case 30:break;default:Vi(b,w,c)}o=o.sibling}}function Pm(a,o){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Dl(c))}function Lm(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Dl(a))}function Vr(a,o,c,m){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)zw(a,o,c,m),o=o.sibling}function zw(a,o,c,m){var b=o.flags;switch(o.tag){case 0:case 11:case 15:Vr(a,o,c,m),b&2048&&ql(9,o);break;case 1:Vr(a,o,c,m);break;case 3:Vr(a,o,c,m),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Dl(a)));break;case 12:if(b&2048){Vr(a,o,c,m),a=o.stateNode;try{var w=o.memoizedProps,T=w.id,V=w.onPostCommit;typeof V=="function"&&V(T,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(J){xt(o,o.return,J)}}else Vr(a,o,c,m);break;case 31:Vr(a,o,c,m);break;case 13:Vr(a,o,c,m);break;case 23:break;case 22:w=o.stateNode,T=o.alternate,o.memoizedState!==null?w._visibility&2?Vr(a,o,c,m):Xl(a,o):w._visibility&2?Vr(a,o,c,m):(w._visibility|=2,xo(a,o,c,m,(o.subtreeFlags&10256)!==0||!1)),b&2048&&Pm(T,o);break;case 24:Vr(a,o,c,m),b&2048&&Lm(o.alternate,o);break;default:Vr(a,o,c,m)}}function xo(a,o,c,m,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var w=a,T=o,V=c,J=m,le=T.flags;switch(T.tag){case 0:case 11:case 15:xo(w,T,V,J,b),ql(8,T);break;case 23:break;case 22:var ge=T.stateNode;T.memoizedState!==null?ge._visibility&2?xo(w,T,V,J,b):Xl(w,T):(ge._visibility|=2,xo(w,T,V,J,b)),b&&le&2048&&Pm(T.alternate,T);break;case 24:xo(w,T,V,J,b),b&&le&2048&&Lm(T.alternate,T);break;default:xo(w,T,V,J,b)}o=o.sibling}}function Xl(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=a,m=o,b=m.flags;switch(m.tag){case 22:Xl(c,m),b&2048&&Pm(m.alternate,m);break;case 24:Xl(c,m),b&2048&&Lm(m.alternate,m);break;default:Xl(c,m)}o=o.sibling}}var Kl=8192;function bo(a,o,c){if(a.subtreeFlags&Kl)for(a=a.child;a!==null;)Pw(a,o,c),a=a.sibling}function Pw(a,o,c){switch(a.tag){case 26:bo(a,o,c),a.flags&Kl&&a.memoizedState!==null&&_4(c,Ir,a.memoizedState,a.memoizedProps);break;case 5:bo(a,o,c);break;case 3:case 4:var m=Ir;Ir=Ld(a.stateNode.containerInfo),bo(a,o,c),Ir=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Kl,Kl=16777216,bo(a,o,c),Kl=m):bo(a,o,c));break;default:bo(a,o,c)}}function Lw(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function Wl(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var m=o[c];yn=m,Vw(m,a)}Lw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Iw(a),a=a.sibling}function Iw(a){switch(a.tag){case 0:case 11:case 15:Wl(a),a.flags&2048&&xa(9,a,a.return);break;case 3:Wl(a);break;case 12:Wl(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,Cd(a)):Wl(a);break;default:Wl(a)}}function Cd(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var m=o[c];yn=m,Vw(m,a)}Lw(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:xa(8,o,o.return),Cd(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Cd(o));break;default:Cd(o)}a=a.sibling}}function Vw(a,o){for(;yn!==null;){var c=yn;switch(c.tag){case 0:case 11:case 15:xa(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Dl(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,yn=m;else e:for(c=a;yn!==null;){m=yn;var b=m.sibling,w=m.return;if(Tw(m),m===c){yn=null;break e}if(b!==null){b.return=w,yn=b;break e}yn=w}}}var IO={getCacheForType:function(a){var o=xn(an),c=o.data.get(a);return c===void 0&&(c=a(),o.data.set(a,c)),c},cacheSignal:function(){return xn(an).controller.signal}},VO=typeof WeakMap=="function"?WeakMap:Map,ft=0,Et=null,nt=null,it=0,vt=0,ir=null,ba=!1,wo=!1,Im=!1,Fi=0,Ht=0,wa=0,gs=0,Vm=0,ar=0,So=0,Zl=null,Gn=null,Fm=!1,jd=0,Fw=0,kd=1/0,Ed=null,Sa=null,fn=0,_a=null,_o=null,Ui=0,Um=0,Bm=null,Uw=null,Ql=0,$m=null;function sr(){return(ft&2)!==0&&it!==0?it&-it:O.T!==null?Km():Fn()}function Bw(){if(ar===0)if((it&536870912)===0||ot){var a=Qa;Qa<<=1,(Qa&3932160)===0&&(Qa=262144),ar=a}else ar=536870912;return a=nr.current,a!==null&&(a.flags|=32),ar}function qn(a,o,c){(a===Et&&(vt===2||vt===9)||a.cancelPendingCommit!==null)&&(Co(a,0),Ca(a,it,ar,!1)),oa(a,c),((ft&2)===0||a!==Et)&&(a===Et&&((ft&2)===0&&(gs|=c),Ht===4&&Ca(a,it,ar,!1)),si(a))}function $w(a,o,c){if((ft&6)!==0)throw Error(i(327));var m=!c&&(o&127)===0&&(o&a.expiredLanes)===0||Ja(a,o),b=m?BO(a,o):Gm(a,o,!0),w=m;do{if(b===0){wo&&!m&&Ca(a,o,0,!1);break}else{if(c=a.current.alternate,w&&!FO(c)){b=Gm(a,o,!1),w=!1;continue}if(b===2){if(w=o,a.errorRecoveryDisabledLanes&w)var T=0;else T=a.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){o=T;e:{var V=a;b=Zl;var J=V.current.memoizedState.isDehydrated;if(J&&(Co(V,T).flags|=256),T=Gm(V,T,!1),T!==2){if(Im&&!J){V.errorRecoveryDisabledLanes|=w,gs|=w,b=4;break e}w=Gn,Gn=b,w!==null&&(Gn===null?Gn=w:Gn.push.apply(Gn,w))}b=T}if(w=!1,b!==2)continue}}if(b===1){Co(a,0),Ca(a,o,0,!0);break}e:{switch(m=a,w=b,w){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:Ca(m,o,ar,!ba);break e;case 2:Gn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(b=jd+300-wt(),10<b)){if(Ca(m,o,ar,!ba),qs(m,0,!0)!==0)break e;Ui=o,m.timeoutHandle=bS(Hw.bind(null,m,c,Gn,Ed,Fm,o,ar,gs,So,ba,w,"Throttled",-0,0),b);break e}Hw(m,c,Gn,Ed,Fm,o,ar,gs,So,ba,w,null,-0,0)}}break}while(!0);si(a)}function Hw(a,o,c,m,b,w,T,V,J,le,ge,xe,ue,de){if(a.timeoutHandle=-1,xe=o.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ki},Pw(o,w,xe);var Te=(w&62914560)===w?jd-wt():(w&4194048)===w?Fw-wt():0;if(Te=C4(xe,Te),Te!==null){Ui=w,a.cancelPendingCommit=Te(Qw.bind(null,a,o,w,c,m,b,T,V,J,ge,xe,null,ue,de)),Ca(a,w,T,!le);return}}Qw(a,o,w,c,m,b,T,V,J)}function FO(a){for(var o=a;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var b=c[m],w=b.getSnapshot;b=b.value;try{if(!er(w(),b))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ca(a,o,c,m){o&=~Vm,o&=~gs,a.suspendedLanes|=o,a.pingedLanes&=~o,m&&(a.warmLanes|=o),m=a.expirationTimes;for(var b=o;0<b;){var w=31-pt(b),T=1<<w;m[w]=-1,b&=~T}c!==0&&se(a,c,o)}function Nd(){return(ft&6)===0?(Jl(0),!1):!0}function Hm(){if(nt!==null){if(vt===0)var a=nt.return;else a=nt,Ai=os=null,sm(a),po=null,zl=0,a=nt;for(;a!==null;)ww(a.alternate,a),a=a.return;nt=null}}function Co(a,o){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,s4(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),Ui=0,Hm(),Et=a,nt=c=Ni(a.current,null),it=o,vt=0,ir=null,ba=!1,wo=Ja(a,o),Im=!1,So=ar=Vm=gs=wa=Ht=0,Gn=Zl=null,Fm=!1,(o&8)!==0&&(o|=o&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=o;0<m;){var b=31-pt(m),w=1<<b;o|=a[b],m&=~w}return Fi=o,Kc(),c}function Gw(a,o){Ke=null,O.H=$l,o===ho||o===rd?(o=o1(),vt=3):o===Xp?(o=o1(),vt=4):vt=o===Sm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ir=o,nt===null&&(Ht=1,yd(a,xr(o,a.current)))}function qw(){var a=nr.current;return a===null?!0:(it&4194048)===it?_r===null:(it&62914560)===it||(it&536870912)!==0?a===_r:!1}function Yw(){var a=O.H;return O.H=$l,a===null?$l:a}function Xw(){var a=O.A;return O.A=IO,a}function Td(){Ht=4,ba||(it&4194048)!==it&&nr.current!==null||(wo=!0),(wa&134217727)===0&&(gs&134217727)===0||Et===null||Ca(Et,it,ar,!1)}function Gm(a,o,c){var m=ft;ft|=2;var b=Yw(),w=Xw();(Et!==a||it!==o)&&(Ed=null,Co(a,o)),o=!1;var T=Ht;e:do try{if(vt!==0&&nt!==null){var V=nt,J=ir;switch(vt){case 8:Hm(),T=6;break e;case 3:case 2:case 9:case 6:nr.current===null&&(o=!0);var le=vt;if(vt=0,ir=null,jo(a,V,J,le),c&&wo){T=0;break e}break;default:le=vt,vt=0,ir=null,jo(a,V,J,le)}}UO(),T=Ht;break}catch(ge){Gw(a,ge)}while(!0);return o&&a.shellSuspendCounter++,Ai=os=null,ft=m,O.H=b,O.A=w,nt===null&&(Et=null,it=0,Kc()),T}function UO(){for(;nt!==null;)Kw(nt)}function BO(a,o){var c=ft;ft|=2;var m=Yw(),b=Xw();Et!==a||it!==o?(Ed=null,kd=wt()+500,Co(a,o)):wo=Ja(a,o);e:do try{if(vt!==0&&nt!==null){o=nt;var w=ir;t:switch(vt){case 1:vt=0,ir=null,jo(a,o,w,1);break;case 2:case 9:if(a1(w)){vt=0,ir=null,Ww(o);break}o=function(){vt!==2&&vt!==9||Et!==a||(vt=7),si(a)},w.then(o,o);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:a1(w)?(vt=0,ir=null,Ww(o)):(vt=0,ir=null,jo(a,o,w,7));break;case 5:var T=null;switch(nt.tag){case 26:T=nt.memoizedState;case 5:case 27:var V=nt;if(T?zS(T):V.stateNode.complete){vt=0,ir=null;var J=V.sibling;if(J!==null)nt=J;else{var le=V.return;le!==null?(nt=le,Ad(le)):nt=null}break t}}vt=0,ir=null,jo(a,o,w,5);break;case 6:vt=0,ir=null,jo(a,o,w,6);break;case 8:Hm(),Ht=6;break e;default:throw Error(i(462))}}$O();break}catch(ge){Gw(a,ge)}while(!0);return Ai=os=null,O.H=m,O.A=b,ft=c,nt!==null?0:(Et=null,it=0,Kc(),Ht)}function $O(){for(;nt!==null&&!Cn();)Kw(nt)}function Kw(a){var o=xw(a.alternate,a,Fi);a.memoizedProps=a.pendingProps,o===null?Ad(a):nt=o}function Ww(a){var o=a,c=o.alternate;switch(o.tag){case 15:case 0:o=hw(c,o,o.pendingProps,o.type,void 0,it);break;case 11:o=hw(c,o,o.pendingProps,o.type.render,o.ref,it);break;case 5:sm(o);default:ww(c,o),o=nt=Xb(o,Fi),o=xw(c,o,Fi)}a.memoizedProps=a.pendingProps,o===null?Ad(a):nt=o}function jo(a,o,c,m){Ai=os=null,sm(o),po=null,zl=0;var b=o.return;try{if(RO(a,b,o,c,it)){Ht=1,yd(a,xr(c,a.current)),nt=null;return}}catch(w){if(b!==null)throw nt=b,w;Ht=1,yd(a,xr(c,a.current)),nt=null;return}o.flags&32768?(ot||m===1?a=!0:wo||(it&536870912)!==0?a=!1:(ba=a=!0,(m===2||m===9||m===3||m===6)&&(m=nr.current,m!==null&&m.tag===13&&(m.flags|=16384))),Zw(o,a)):Ad(o)}function Ad(a){var o=a;do{if((o.flags&32768)!==0){Zw(o,ba);return}a=o.return;var c=OO(o.alternate,o,Fi);if(c!==null){nt=c;return}if(o=o.sibling,o!==null){nt=o;return}nt=o=a}while(o!==null);Ht===0&&(Ht=5)}function Zw(a,o){do{var c=zO(a.alternate,a);if(c!==null){c.flags&=32767,nt=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(a=a.sibling,a!==null)){nt=a;return}nt=a=c}while(a!==null);Ht=6,nt=null}function Qw(a,o,c,m,b,w,T,V,J){a.cancelPendingCommit=null;do Rd();while(fn!==0);if((ft&6)!==0)throw Error(i(327));if(o!==null){if(o===a.current)throw Error(i(177));if(w=o.lanes|o.childLanes,w|=Dp,xl(a,c,w,T,V,J),a===Et&&(nt=Et=null,it=0),_o=o,_a=a,Ui=c,Um=w,Bm=b,Uw=m,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,YO(Oe,function(){return rS(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||m){m=O.T,O.T=null,b=q.p,q.p=2,T=ft,ft|=4;try{PO(a,o,c)}finally{ft=T,q.p=b,O.T=m}}fn=1,Jw(),eS(),tS()}}function Jw(){if(fn===1){fn=0;var a=_a,o=_o,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=O.T,O.T=null;var m=q.p;q.p=2;var b=ft;ft|=4;try{Dw(o,a);var w=rg,T=Vb(a.containerInfo),V=w.focusedElem,J=w.selectionRange;if(T!==V&&V&&V.ownerDocument&&Ib(V.ownerDocument.documentElement,V)){if(J!==null&&Np(V)){var le=J.start,ge=J.end;if(ge===void 0&&(ge=le),"selectionStart"in V)V.selectionStart=le,V.selectionEnd=Math.min(ge,V.value.length);else{var xe=V.ownerDocument||document,ue=xe&&xe.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),Te=V.textContent.length,Ve=Math.min(J.start,Te),Ct=J.end===void 0?Ve:Math.min(J.end,Te);!de.extend&&Ve>Ct&&(T=Ct,Ct=Ve,Ve=T);var ie=Lb(V,Ve),te=Lb(V,Ct);if(ie&&te&&(de.rangeCount!==1||de.anchorNode!==ie.node||de.anchorOffset!==ie.offset||de.focusNode!==te.node||de.focusOffset!==te.offset)){var oe=xe.createRange();oe.setStart(ie.node,ie.offset),de.removeAllRanges(),Ve>Ct?(de.addRange(oe),de.extend(te.node,te.offset)):(oe.setEnd(te.node,te.offset),de.addRange(oe))}}}}for(xe=[],de=V;de=de.parentNode;)de.nodeType===1&&xe.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<xe.length;V++){var ye=xe[V];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}$d=!!ng,rg=ng=null}finally{ft=b,q.p=m,O.T=c}}a.current=o,fn=2}}function eS(){if(fn===2){fn=0;var a=_a,o=_o,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=O.T,O.T=null;var m=q.p;q.p=2;var b=ft;ft|=4;try{Nw(a,o.alternate,o)}finally{ft=b,q.p=m,O.T=c}}fn=3}}function tS(){if(fn===4||fn===3){fn=0,nn();var a=_a,o=_o,c=Ui,m=Uw;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?fn=5:(fn=0,_o=_a=null,nS(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Sa=null),Qt(c),o=o.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(kt,o,void 0,(o.current.flags&128)===128)}catch{}if(m!==null){o=O.T,b=q.p,q.p=2,O.T=null;try{for(var w=a.onRecoverableError,T=0;T<m.length;T++){var V=m[T];w(V.value,{componentStack:V.stack})}}finally{O.T=o,q.p=b}}(Ui&3)!==0&&Rd(),si(a),b=a.pendingLanes,(c&261930)!==0&&(b&42)!==0?a===$m?Ql++:(Ql=0,$m=a):Ql=0,Jl(0)}}function nS(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Dl(o)))}function Rd(){return Jw(),eS(),tS(),rS()}function rS(){if(fn!==5)return!1;var a=_a,o=Um;Um=0;var c=Qt(Ui),m=O.T,b=q.p;try{q.p=32>c?32:c,O.T=null,c=Bm,Bm=null;var w=_a,T=Ui;if(fn=0,_o=_a=null,Ui=0,(ft&6)!==0)throw Error(i(331));var V=ft;if(ft|=4,Iw(w.current),zw(w,w.current,T,c),ft=V,Jl(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(kt,w)}catch{}return!0}finally{q.p=b,O.T=m,nS(a,o)}}function iS(a,o,c){o=xr(c,o),o=wm(a.stateNode,o,2),a=ga(a,o,2),a!==null&&(oa(a,2),si(a))}function xt(a,o,c){if(a.tag===3)iS(a,a,c);else for(;o!==null;){if(o.tag===3){iS(o,a,c);break}else if(o.tag===1){var m=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Sa===null||!Sa.has(m))){a=xr(c,a),c=aw(2),m=ga(o,c,2),m!==null&&(sw(c,m,o,a),oa(m,2),si(m));break}}o=o.return}}function qm(a,o,c){var m=a.pingCache;if(m===null){m=a.pingCache=new VO;var b=new Set;m.set(o,b)}else b=m.get(o),b===void 0&&(b=new Set,m.set(o,b));b.has(c)||(Im=!0,b.add(c),a=HO.bind(null,a,o,c),o.then(a,a))}function HO(a,o,c){var m=a.pingCache;m!==null&&m.delete(o),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Et===a&&(it&c)===c&&(Ht===4||Ht===3&&(it&62914560)===it&&300>wt()-jd?(ft&2)===0&&Co(a,0):Vm|=c,So===it&&(So=0)),si(a)}function aS(a,o){o===0&&(o=Lc()),a=is(a,o),a!==null&&(oa(a,o),si(a))}function GO(a){var o=a.memoizedState,c=0;o!==null&&(c=o.retryLane),aS(a,c)}function qO(a,o){var c=0;switch(a.tag){case 31:case 13:var m=a.stateNode,b=a.memoizedState;b!==null&&(c=b.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(i(314))}m!==null&&m.delete(o),aS(a,c)}function YO(a,o){return Zt(a,o)}var Md=null,ko=null,Ym=!1,Dd=!1,Xm=!1,ja=0;function si(a){a!==ko&&a.next===null&&(ko===null?Md=ko=a:ko=ko.next=a),Dd=!0,Ym||(Ym=!0,KO())}function Jl(a,o){if(!Xm&&Dd){Xm=!0;do for(var c=!1,m=Md;m!==null;){if(a!==0){var b=m.pendingLanes;if(b===0)var w=0;else{var T=m.suspendedLanes,V=m.pingedLanes;w=(1<<31-pt(42|a)+1)-1,w&=b&~(T&~V),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(c=!0,uS(m,w))}else w=it,w=qs(m,m===Et?w:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(w&3)===0||Ja(m,w)||(c=!0,uS(m,w));m=m.next}while(c);Xm=!1}}function XO(){sS()}function sS(){Dd=Ym=!1;var a=0;ja!==0&&a4()&&(a=ja);for(var o=wt(),c=null,m=Md;m!==null;){var b=m.next,w=oS(m,o);w===0?(m.next=null,c===null?Md=b:c.next=b,b===null&&(ko=c)):(c=m,(a!==0||(w&3)!==0)&&(Dd=!0)),m=b}fn!==0&&fn!==5||Jl(a),ja!==0&&(ja=0)}function oS(a,o){for(var c=a.suspendedLanes,m=a.pingedLanes,b=a.expirationTimes,w=a.pendingLanes&-62914561;0<w;){var T=31-pt(w),V=1<<T,J=b[T];J===-1?((V&c)===0||(V&m)!==0)&&(b[T]=cp(V,o)):J<=o&&(a.expiredLanes|=V),w&=~V}if(o=Et,c=it,c=qs(a,a===o?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,c===0||a===o&&(vt===2||vt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Ut(m),a.callbackNode=null,a.callbackPriority=0;if((c&3)===0||Ja(a,c)){if(o=c&-c,o===a.callbackPriority)return o;switch(m!==null&&Ut(m),Qt(c)){case 2:case 8:c=Se;break;case 32:c=Oe;break;case 268435456:c=ve;break;default:c=Oe}return m=lS.bind(null,a),c=Zt(c,m),a.callbackPriority=o,a.callbackNode=c,o}return m!==null&&m!==null&&Ut(m),a.callbackPriority=2,a.callbackNode=null,2}function lS(a,o){if(fn!==0&&fn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(Rd()&&a.callbackNode!==c)return null;var m=it;return m=qs(a,a===Et?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:($w(a,m,o),oS(a,wt()),a.callbackNode!=null&&a.callbackNode===c?lS.bind(null,a):null)}function uS(a,o){if(Rd())return null;$w(a,o,!0)}function KO(){o4(function(){(ft&6)!==0?Zt(he,XO):sS()})}function Km(){if(ja===0){var a=co;a===0&&(a=On,On<<=1,(On&261888)===0&&(On=256)),ja=a}return ja}function cS(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Uc(""+a)}function dS(a,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,a.id&&c.setAttribute("form",a.id),o.parentNode.insertBefore(c,o),a=new FormData(a),c.parentNode.removeChild(c),a}function WO(a,o,c,m,b){if(o==="submit"&&c&&c.stateNode===b){var w=cS((b[dn]||null).action),T=m.submitter;T&&(o=(o=T[dn]||null)?cS(o.formAction):T.getAttribute("formAction"),o!==null&&(w=o,T=null));var V=new Gc("action","action",null,m,b);a.push({event:V,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(ja!==0){var J=T?dS(b,T):new FormData(b);mm(c,{pending:!0,data:J,method:b.method,action:w},null,J)}}else typeof w=="function"&&(V.preventDefault(),J=T?dS(b,T):new FormData(b),mm(c,{pending:!0,data:J,method:b.method,action:w},w,J))},currentTarget:b}]})}}for(var Wm=0;Wm<Mp.length;Wm++){var Zm=Mp[Wm],ZO=Zm.toLowerCase(),QO=Zm[0].toUpperCase()+Zm.slice(1);Lr(ZO,"on"+QO)}Lr(Bb,"onAnimationEnd"),Lr($b,"onAnimationIteration"),Lr(Hb,"onAnimationStart"),Lr("dblclick","onDoubleClick"),Lr("focusin","onFocus"),Lr("focusout","onBlur"),Lr(pO,"onTransitionRun"),Lr(mO,"onTransitionStart"),Lr(gO,"onTransitionCancel"),Lr(Gb,"onTransitionEnd"),Ws("onMouseEnter",["mouseout","mouseover"]),Ws("onMouseLeave",["mouseout","mouseover"]),Ws("onPointerEnter",["pointerout","pointerover"]),Ws("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eu="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(" "),JO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eu));function fS(a,o){o=(o&4)!==0;for(var c=0;c<a.length;c++){var m=a[c],b=m.event;m=m.listeners;e:{var w=void 0;if(o)for(var T=m.length-1;0<=T;T--){var V=m[T],J=V.instance,le=V.currentTarget;if(V=V.listener,J!==w&&b.isPropagationStopped())break e;w=V,b.currentTarget=le;try{w(b)}catch(ge){Xc(ge)}b.currentTarget=null,w=J}else for(T=0;T<m.length;T++){if(V=m[T],J=V.instance,le=V.currentTarget,V=V.listener,J!==w&&b.isPropagationStopped())break e;w=V,b.currentTarget=le;try{w(b)}catch(ge){Xc(ge)}b.currentTarget=null,w=J}}}}function rt(a,o){var c=o[la];c===void 0&&(c=o[la]=new Set);var m=a+"__bubble";c.has(m)||(hS(o,a,2,!1),c.add(m))}function Qm(a,o,c){var m=0;o&&(m|=4),hS(c,a,m,o)}var Od="_reactListening"+Math.random().toString(36).slice(2);function Jm(a){if(!a[Od]){a[Od]=!0,sb.forEach(function(c){c!=="selectionchange"&&(JO.has(c)||Qm(c,!1,a),Qm(c,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[Od]||(o[Od]=!0,Qm("selectionchange",!1,o))}}function hS(a,o,c,m){switch(BS(o)){case 2:var b=E4;break;case 8:b=N4;break;default:b=pg}c=b.bind(null,o,c,a),b=void 0,!xp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),m?b!==void 0?a.addEventListener(o,c,{capture:!0,passive:b}):a.addEventListener(o,c,!0):b!==void 0?a.addEventListener(o,c,{passive:b}):a.addEventListener(o,c,!1)}function eg(a,o,c,m,b){var w=m;if((o&1)===0&&(o&2)===0&&m!==null)e:for(;;){if(m===null)return;var T=m.tag;if(T===3||T===4){var V=m.stateNode.containerInfo;if(V===b)break;if(T===4)for(T=m.return;T!==null;){var J=T.tag;if((J===3||J===4)&&T.stateNode.containerInfo===b)return;T=T.return}for(;V!==null;){if(T=Ys(V),T===null)return;if(J=T.tag,J===5||J===6||J===26||J===27){m=w=T;continue e}V=V.parentNode}}m=m.return}vb(function(){var le=w,ge=yp(c),xe=[];e:{var ue=qb.get(a);if(ue!==void 0){var de=Gc,Te=a;switch(a){case"keypress":if($c(c)===0)break e;case"keydown":case"keyup":de=qD;break;case"focusin":Te="focus",de=_p;break;case"focusout":Te="blur",de=_p;break;case"beforeblur":case"afterblur":de=_p;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=wb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=OD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=KD;break;case Bb:case $b:case Hb:de=LD;break;case Gb:de=ZD;break;case"scroll":case"scrollend":de=MD;break;case"wheel":de=JD;break;case"copy":case"cut":case"paste":de=VD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=_b;break;case"toggle":case"beforetoggle":de=tO}var Ve=(o&4)!==0,Ct=!Ve&&(a==="scroll"||a==="scrollend"),ie=Ve?ue!==null?ue+"Capture":null:ue;Ve=[];for(var te=le,oe;te!==null;){var ye=te;if(oe=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||oe===null||ie===null||(ye=Sl(te,ie),ye!=null&&Ve.push(tu(te,ye,oe))),Ct)break;te=te.return}0<Ve.length&&(ue=new de(ue,Te,null,c,ge),xe.push({event:ue,listeners:Ve}))}}if((o&7)===0){e:{if(ue=a==="mouseover"||a==="pointerover",de=a==="mouseout"||a==="pointerout",ue&&c!==gp&&(Te=c.relatedTarget||c.fromElement)&&(Ys(Te)||Te[ni]))break e;if((de||ue)&&(ue=ge.window===ge?ge:(ue=ge.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?(Te=c.relatedTarget||c.toElement,de=le,Te=Te?Ys(Te):null,Te!==null&&(Ct=l(Te),Ve=Te.tag,Te!==Ct||Ve!==5&&Ve!==27&&Ve!==6)&&(Te=null)):(de=null,Te=le),de!==Te)){if(Ve=wb,ye="onMouseLeave",ie="onMouseEnter",te="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=_b,ye="onPointerLeave",ie="onPointerEnter",te="pointer"),Ct=de==null?ue:wl(de),oe=Te==null?ue:wl(Te),ue=new Ve(ye,te+"leave",de,c,ge),ue.target=Ct,ue.relatedTarget=oe,ye=null,Ys(ge)===le&&(Ve=new Ve(ie,te+"enter",Te,c,ge),Ve.target=oe,Ve.relatedTarget=Ct,ye=Ve),Ct=ye,de&&Te)t:{for(Ve=e4,ie=de,te=Te,oe=0,ye=ie;ye;ye=Ve(ye))oe++;ye=0;for(var Pe=te;Pe;Pe=Ve(Pe))ye++;for(;0<oe-ye;)ie=Ve(ie),oe--;for(;0<ye-oe;)te=Ve(te),ye--;for(;oe--;){if(ie===te||te!==null&&ie===te.alternate){Ve=ie;break t}ie=Ve(ie),te=Ve(te)}Ve=null}else Ve=null;de!==null&&pS(xe,ue,de,Ve,!1),Te!==null&&Ct!==null&&pS(xe,Ct,Te,Ve,!0)}}e:{if(ue=le?wl(le):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var ct=Rb;else if(Tb(ue))if(Mb)ct=dO;else{ct=uO;var De=lO}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?le&&mp(le.elementType)&&(ct=Rb):ct=cO;if(ct&&(ct=ct(a,le))){Ab(xe,ct,c,ge);break e}De&&De(a,ue,le),a==="focusout"&&le&&ue.type==="number"&&le.memoizedProps.value!=null&&pp(ue,"number",ue.value)}switch(De=le?wl(le):window,a){case"focusin":(Tb(De)||De.contentEditable==="true")&&(no=De,Tp=le,Al=null);break;case"focusout":Al=Tp=no=null;break;case"mousedown":Ap=!0;break;case"contextmenu":case"mouseup":case"dragend":Ap=!1,Fb(xe,c,ge);break;case"selectionchange":if(hO)break;case"keydown":case"keyup":Fb(xe,c,ge)}var We;if(jp)e:{switch(a){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else to?Eb(a,c)&&(at="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(at="onCompositionStart");at&&(Cb&&c.locale!=="ko"&&(to||at!=="onCompositionStart"?at==="onCompositionEnd"&&to&&(We=xb()):(ua=ge,bp="value"in ua?ua.value:ua.textContent,to=!0)),De=zd(le,at),0<De.length&&(at=new Sb(at,a,null,c,ge),xe.push({event:at,listeners:De}),We?at.data=We:(We=Nb(c),We!==null&&(at.data=We)))),(We=rO?iO(a,c):aO(a,c))&&(at=zd(le,"onBeforeInput"),0<at.length&&(De=new Sb("onBeforeInput","beforeinput",null,c,ge),xe.push({event:De,listeners:at}),De.data=We)),WO(xe,a,le,c,ge)}fS(xe,o)})}function tu(a,o,c){return{instance:a,listener:o,currentTarget:c}}function zd(a,o){for(var c=o+"Capture",m=[];a!==null;){var b=a,w=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||w===null||(b=Sl(a,c),b!=null&&m.unshift(tu(a,b,w)),b=Sl(a,o),b!=null&&m.push(tu(a,b,w))),a.tag===3)return m;a=a.return}return[]}function e4(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function pS(a,o,c,m,b){for(var w=o._reactName,T=[];c!==null&&c!==m;){var V=c,J=V.alternate,le=V.stateNode;if(V=V.tag,J!==null&&J===m)break;V!==5&&V!==26&&V!==27||le===null||(J=le,b?(le=Sl(c,w),le!=null&&T.unshift(tu(c,le,J))):b||(le=Sl(c,w),le!=null&&T.push(tu(c,le,J)))),c=c.return}T.length!==0&&a.push({event:o,listeners:T})}var t4=/\r\n?/g,n4=/\u0000|\uFFFD/g;function mS(a){return(typeof a=="string"?a:""+a).replace(t4,`
|
|
9
|
+
`).replace(n4,"")}function gS(a,o){return o=mS(o),mS(a)===o}function _t(a,o,c,m,b,w){switch(c){case"children":typeof m=="string"?o==="body"||o==="textarea"&&m===""||Qs(a,m):(typeof m=="number"||typeof m=="bigint")&&o!=="body"&&Qs(a,""+m);break;case"className":Vc(a,"class",m);break;case"tabIndex":Vc(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Vc(a,c,m);break;case"style":gb(a,m,w);break;case"data":if(o!=="object"){Vc(a,"data",m);break}case"src":case"href":if(m===""&&(o!=="a"||c!=="href")){a.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(c);break}m=Uc(""+m),a.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(c,"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 w=="function"&&(c==="formAction"?(o!=="input"&&_t(a,o,"name",b.name,b,null),_t(a,o,"formEncType",b.formEncType,b,null),_t(a,o,"formMethod",b.formMethod,b,null),_t(a,o,"formTarget",b.formTarget,b,null)):(_t(a,o,"encType",b.encType,b,null),_t(a,o,"method",b.method,b,null),_t(a,o,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(c);break}m=Uc(""+m),a.setAttribute(c,m);break;case"onClick":m!=null&&(a.onclick=ki);break;case"onScroll":m!=null&&rt("scroll",a);break;case"onScrollEnd":m!=null&&rt("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(c=m.__html,c!=null){if(b.children!=null)throw Error(i(60));a.innerHTML=c}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}c=Uc(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,""+m):a.removeAttribute(c);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":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":m===!0?a.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,m):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(c,m):a.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(c):a.setAttribute(c,m);break;case"popover":rt("beforetoggle",a),rt("toggle",a),Ic(a,"popover",m);break;case"xlinkActuate":ji(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":ji(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":ji(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":ji(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":ji(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":ji(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":ji(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":ji(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":ji(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Ic(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=AD.get(c)||c,Ic(a,c,m))}}function tg(a,o,c,m,b,w){switch(c){case"style":gb(a,m,w);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(c=m.__html,c!=null){if(b.children!=null)throw Error(i(60));a.innerHTML=c}}break;case"children":typeof m=="string"?Qs(a,m):(typeof m=="number"||typeof m=="bigint")&&Qs(a,""+m);break;case"onScroll":m!=null&&rt("scroll",a);break;case"onScrollEnd":m!=null&&rt("scrollend",a);break;case"onClick":m!=null&&(a.onclick=ki);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ob.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(b=c.endsWith("Capture"),o=c.slice(2,b?c.length-7:void 0),w=a[dn]||null,w=w!=null?w[c]:null,typeof w=="function"&&a.removeEventListener(o,w,b),typeof m=="function")){typeof w!="function"&&w!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(o,m,b);break e}c in a?a[c]=m:m===!0?a.setAttribute(c,""):Ic(a,c,m)}}}function wn(a,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",a),rt("load",a);var m=!1,b=!1,w;for(w in c)if(c.hasOwnProperty(w)){var T=c[w];if(T!=null)switch(w){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:_t(a,o,w,T,c,null)}}b&&_t(a,o,"srcSet",c.srcSet,c,null),m&&_t(a,o,"src",c.src,c,null);return;case"input":rt("invalid",a);var V=w=T=b=null,J=null,le=null;for(m in c)if(c.hasOwnProperty(m)){var ge=c[m];if(ge!=null)switch(m){case"name":b=ge;break;case"type":T=ge;break;case"checked":J=ge;break;case"defaultChecked":le=ge;break;case"value":w=ge;break;case"defaultValue":V=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(i(137,o));break;default:_t(a,o,m,ge,c,null)}}fb(a,w,V,J,le,T,b,!1);return;case"select":rt("invalid",a),m=T=w=null;for(b in c)if(c.hasOwnProperty(b)&&(V=c[b],V!=null))switch(b){case"value":w=V;break;case"defaultValue":T=V;break;case"multiple":m=V;default:_t(a,o,b,V,c,null)}o=w,c=T,a.multiple=!!m,o!=null?Zs(a,!!m,o,!1):c!=null&&Zs(a,!!m,c,!0);return;case"textarea":rt("invalid",a),w=b=m=null;for(T in c)if(c.hasOwnProperty(T)&&(V=c[T],V!=null))switch(T){case"value":m=V;break;case"defaultValue":b=V;break;case"children":w=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(91));break;default:_t(a,o,T,V,c,null)}pb(a,m,b,w);return;case"option":for(J in c)c.hasOwnProperty(J)&&(m=c[J],m!=null)&&(J==="selected"?a.selected=m&&typeof m!="function"&&typeof m!="symbol":_t(a,o,J,m,c,null));return;case"dialog":rt("beforetoggle",a),rt("toggle",a),rt("cancel",a),rt("close",a);break;case"iframe":case"object":rt("load",a);break;case"video":case"audio":for(m=0;m<eu.length;m++)rt(eu[m],a);break;case"image":rt("error",a),rt("load",a);break;case"details":rt("toggle",a);break;case"embed":case"source":case"link":rt("error",a),rt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in c)if(c.hasOwnProperty(le)&&(m=c[le],m!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:_t(a,o,le,m,c,null)}return;default:if(mp(o)){for(ge in c)c.hasOwnProperty(ge)&&(m=c[ge],m!==void 0&&tg(a,o,ge,m,c,void 0));return}}for(V in c)c.hasOwnProperty(V)&&(m=c[V],m!=null&&_t(a,o,V,m,c,null))}function r4(a,o,c,m){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,w=null,T=null,V=null,J=null,le=null,ge=null;for(de in c){var xe=c[de];if(c.hasOwnProperty(de)&&xe!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":J=xe;default:m.hasOwnProperty(de)||_t(a,o,de,null,m,xe)}}for(var ue in m){var de=m[ue];if(xe=c[ue],m.hasOwnProperty(ue)&&(de!=null||xe!=null))switch(ue){case"type":w=de;break;case"name":b=de;break;case"checked":le=de;break;case"defaultChecked":ge=de;break;case"value":T=de;break;case"defaultValue":V=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,o));break;default:de!==xe&&_t(a,o,ue,de,m,xe)}}hp(a,T,V,J,le,ge,w,b);return;case"select":de=T=V=ue=null;for(w in c)if(J=c[w],c.hasOwnProperty(w)&&J!=null)switch(w){case"value":break;case"multiple":de=J;default:m.hasOwnProperty(w)||_t(a,o,w,null,m,J)}for(b in m)if(w=m[b],J=c[b],m.hasOwnProperty(b)&&(w!=null||J!=null))switch(b){case"value":ue=w;break;case"defaultValue":V=w;break;case"multiple":T=w;default:w!==J&&_t(a,o,b,w,m,J)}o=V,c=T,m=de,ue!=null?Zs(a,!!c,ue,!1):!!m!=!!c&&(o!=null?Zs(a,!!c,o,!0):Zs(a,!!c,c?[]:"",!1));return;case"textarea":de=ue=null;for(V in c)if(b=c[V],c.hasOwnProperty(V)&&b!=null&&!m.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:_t(a,o,V,null,m,b)}for(T in m)if(b=m[T],w=c[T],m.hasOwnProperty(T)&&(b!=null||w!=null))switch(T){case"value":ue=b;break;case"defaultValue":de=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(i(91));break;default:b!==w&&_t(a,o,T,b,m,w)}hb(a,ue,de);return;case"option":for(var Te in c)ue=c[Te],c.hasOwnProperty(Te)&&ue!=null&&!m.hasOwnProperty(Te)&&(Te==="selected"?a.selected=!1:_t(a,o,Te,null,m,ue));for(J in m)ue=m[J],de=c[J],m.hasOwnProperty(J)&&ue!==de&&(ue!=null||de!=null)&&(J==="selected"?a.selected=ue&&typeof ue!="function"&&typeof ue!="symbol":_t(a,o,J,ue,m,de));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 Ve in c)ue=c[Ve],c.hasOwnProperty(Ve)&&ue!=null&&!m.hasOwnProperty(Ve)&&_t(a,o,Ve,null,m,ue);for(le in m)if(ue=m[le],de=c[le],m.hasOwnProperty(le)&&ue!==de&&(ue!=null||de!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,o));break;default:_t(a,o,le,ue,m,de)}return;default:if(mp(o)){for(var Ct in c)ue=c[Ct],c.hasOwnProperty(Ct)&&ue!==void 0&&!m.hasOwnProperty(Ct)&&tg(a,o,Ct,void 0,m,ue);for(ge in m)ue=m[ge],de=c[ge],!m.hasOwnProperty(ge)||ue===de||ue===void 0&&de===void 0||tg(a,o,ge,ue,m,de);return}}for(var ie in c)ue=c[ie],c.hasOwnProperty(ie)&&ue!=null&&!m.hasOwnProperty(ie)&&_t(a,o,ie,null,m,ue);for(xe in m)ue=m[xe],de=c[xe],!m.hasOwnProperty(xe)||ue===de||ue==null&&de==null||_t(a,o,xe,ue,m,de)}function yS(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i4(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var b=c[m],w=b.transferSize,T=b.initiatorType,V=b.duration;if(w&&V&&yS(T)){for(T=0,V=b.responseEnd,m+=1;m<c.length;m++){var J=c[m],le=J.startTime;if(le>V)break;var ge=J.transferSize,xe=J.initiatorType;ge&&yS(xe)&&(J=J.responseEnd,T+=ge*(J<V?1:(V-le)/(J-le)))}if(--m,o+=8*(w+T)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var ng=null,rg=null;function Pd(a){return a.nodeType===9?a:a.ownerDocument}function vS(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xS(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function ig(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var ag=null;function a4(){var a=window.event;return a&&a.type==="popstate"?a===ag?!1:(ag=a,!0):(ag=null,!1)}var bS=typeof setTimeout=="function"?setTimeout:void 0,s4=typeof clearTimeout=="function"?clearTimeout:void 0,wS=typeof Promise=="function"?Promise:void 0,o4=typeof queueMicrotask=="function"?queueMicrotask:typeof wS<"u"?function(a){return wS.resolve(null).then(a).catch(l4)}:bS;function l4(a){setTimeout(function(){throw a})}function ka(a){return a==="head"}function SS(a,o){var c=o,m=0;do{var b=c.nextSibling;if(a.removeChild(c),b&&b.nodeType===8)if(c=b.data,c==="/$"||c==="/&"){if(m===0){a.removeChild(b),Ao(o);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")nu(a.ownerDocument.documentElement);else if(c==="head"){c=a.ownerDocument.head,nu(c);for(var w=c.firstChild;w;){var T=w.nextSibling,V=w.nodeName;w[bl]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&w.rel.toLowerCase()==="stylesheet"||c.removeChild(w),w=T}}else c==="body"&&nu(a.ownerDocument.body);c=b}while(c);Ao(o)}function _S(a,o){var c=a;a=0;do{var m=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(a===0)break;a--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||a++;c=m}while(c)}function sg(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":sg(c),dp(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function u4(a,o,c,m){for(;a.nodeType===1;){var b=c;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[bl])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(w=a.getAttribute("rel"),w==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(w!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(w=a.getAttribute("src"),(w!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&w&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var w=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===w)return a}else return a;if(a=Cr(a.nextSibling),a===null)break}return null}function c4(a,o,c){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=Cr(a.nextSibling),a===null))return null;return a}function CS(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Cr(a.nextSibling),a===null))return null;return a}function og(a){return a.data==="$?"||a.data==="$~"}function lg(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function d4(a,o){var c=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||c.readyState!=="loading")o();else{var m=function(){o(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Cr(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var ug=null;function jS(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var c=a.data;if(c==="/$"||c==="/&"){if(o===0)return Cr(a.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}a=a.nextSibling}return null}function kS(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return a;o--}else c!=="/$"&&c!=="/&"||o++}a=a.previousSibling}return null}function ES(a,o,c){switch(o=Pd(c),a){case"html":if(a=o.documentElement,!a)throw Error(i(452));return a;case"head":if(a=o.head,!a)throw Error(i(453));return a;case"body":if(a=o.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function nu(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);dp(a)}var jr=new Map,NS=new Set;function Ld(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Bi=q.d;q.d={f:f4,r:h4,D:p4,C:m4,L:g4,m:y4,X:x4,S:v4,M:b4};function f4(){var a=Bi.f(),o=Nd();return a||o}function h4(a){var o=Xs(a);o!==null&&o.tag===5&&o.type==="form"?G1(o):Bi.r(a)}var Eo=typeof document>"u"?null:document;function TS(a,o,c){var m=Eo;if(m&&typeof o=="string"&&o){var b=yr(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof c=="string"&&(b+='[crossorigin="'+c+'"]'),NS.has(b)||(NS.add(b),a={rel:a,crossOrigin:c,href:o},m.querySelector(b)===null&&(o=m.createElement("link"),wn(o,"link",a),gn(o),m.head.appendChild(o)))}}function p4(a){Bi.D(a),TS("dns-prefetch",a,null)}function m4(a,o){Bi.C(a,o),TS("preconnect",a,o)}function g4(a,o,c){Bi.L(a,o,c);var m=Eo;if(m&&a&&o){var b='link[rel="preload"][as="'+yr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(b+='[imagesrcset="'+yr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(b+='[imagesizes="'+yr(c.imageSizes)+'"]')):b+='[href="'+yr(a)+'"]';var w=b;switch(o){case"style":w=No(a);break;case"script":w=To(a)}jr.has(w)||(a=y({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:a,as:o},c),jr.set(w,a),m.querySelector(b)!==null||o==="style"&&m.querySelector(ru(w))||o==="script"&&m.querySelector(iu(w))||(o=m.createElement("link"),wn(o,"link",a),gn(o),m.head.appendChild(o)))}}function y4(a,o){Bi.m(a,o);var c=Eo;if(c&&a){var m=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+yr(m)+'"][href="'+yr(a)+'"]',w=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=To(a)}if(!jr.has(w)&&(a=y({rel:"modulepreload",href:a},o),jr.set(w,a),c.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(iu(w)))return}m=c.createElement("link"),wn(m,"link",a),gn(m),c.head.appendChild(m)}}}function v4(a,o,c){Bi.S(a,o,c);var m=Eo;if(m&&a){var b=Ks(m).hoistableStyles,w=No(a);o=o||"default";var T=b.get(w);if(!T){var V={loading:0,preload:null};if(T=m.querySelector(ru(w)))V.loading=5;else{a=y({rel:"stylesheet",href:a,"data-precedence":o},c),(c=jr.get(w))&&cg(a,c);var J=T=m.createElement("link");gn(J),wn(J,"link",a),J._p=new Promise(function(le,ge){J.onload=le,J.onerror=ge}),J.addEventListener("load",function(){V.loading|=1}),J.addEventListener("error",function(){V.loading|=2}),V.loading|=4,Id(T,o,m)}T={type:"stylesheet",instance:T,count:1,state:V},b.set(w,T)}}}function x4(a,o){Bi.X(a,o);var c=Eo;if(c&&a){var m=Ks(c).hoistableScripts,b=To(a),w=m.get(b);w||(w=c.querySelector(iu(b)),w||(a=y({src:a,async:!0},o),(o=jr.get(b))&&dg(a,o),w=c.createElement("script"),gn(w),wn(w,"link",a),c.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(b,w))}}function b4(a,o){Bi.M(a,o);var c=Eo;if(c&&a){var m=Ks(c).hoistableScripts,b=To(a),w=m.get(b);w||(w=c.querySelector(iu(b)),w||(a=y({src:a,async:!0,type:"module"},o),(o=jr.get(b))&&dg(a,o),w=c.createElement("script"),gn(w),wn(w,"link",a),c.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(b,w))}}function AS(a,o,c,m){var b=(b=Y.current)?Ld(b):null;if(!b)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=No(c.href),c=Ks(b).hoistableStyles,m=c.get(o),m||(m={type:"style",instance:null,count:0,state:null},c.set(o,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=No(c.href);var w=Ks(b).hoistableStyles,T=w.get(a);if(T||(b=b.ownerDocument||b,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(a,T),(w=b.querySelector(ru(a)))&&!w._p&&(T.instance=w,T.state.loading=5),jr.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},jr.set(a,c),w||w4(b,a,c,T.state))),o&&m===null)throw Error(i(528,""));return T}if(o&&m!==null)throw Error(i(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=To(c),c=Ks(b).hoistableScripts,m=c.get(o),m||(m={type:"script",instance:null,count:0,state:null},c.set(o,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function No(a){return'href="'+yr(a)+'"'}function ru(a){return'link[rel="stylesheet"]['+a+"]"}function RS(a){return y({},a,{"data-precedence":a.precedence,precedence:null})}function w4(a,o,c,m){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?m.loading=1:(o=a.createElement("link"),m.preload=o,o.addEventListener("load",function(){return m.loading|=1}),o.addEventListener("error",function(){return m.loading|=2}),wn(o,"link",c),gn(o),a.head.appendChild(o))}function To(a){return'[src="'+yr(a)+'"]'}function iu(a){return"script[async]"+a}function MS(a,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var m=a.querySelector('style[data-href~="'+yr(c.href)+'"]');if(m)return o.instance=m,gn(m),m;var b=y({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),gn(m),wn(m,"style",b),Id(m,c.precedence,a),o.instance=m;case"stylesheet":b=No(c.href);var w=a.querySelector(ru(b));if(w)return o.state.loading|=4,o.instance=w,gn(w),w;m=RS(c),(b=jr.get(b))&&cg(m,b),w=(a.ownerDocument||a).createElement("link"),gn(w);var T=w;return T._p=new Promise(function(V,J){T.onload=V,T.onerror=J}),wn(w,"link",m),o.state.loading|=4,Id(w,c.precedence,a),o.instance=w;case"script":return w=To(c.src),(b=a.querySelector(iu(w)))?(o.instance=b,gn(b),b):(m=c,(b=jr.get(w))&&(m=y({},c),dg(m,b)),a=a.ownerDocument||a,b=a.createElement("script"),gn(b),wn(b,"link",m),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(m=o.instance,o.state.loading|=4,Id(m,c.precedence,a));return o.instance}function Id(a,o,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,w=b,T=0;T<m.length;T++){var V=m[T];if(V.dataset.precedence===o)w=V;else if(w!==b)break}w?w.parentNode.insertBefore(a,w.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(a,o.firstChild))}function cg(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function dg(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Vd=null;function DS(a,o,c){if(Vd===null){var m=new Map,b=Vd=new Map;b.set(c,m)}else b=Vd,m=b.get(c),m||(m=new Map,b.set(c,m));if(m.has(a))return m;for(m.set(a,null),c=c.getElementsByTagName(a),b=0;b<c.length;b++){var w=c[b];if(!(w[bl]||w[Mt]||a==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var T=w.getAttribute(o)||"";T=a+T;var V=m.get(T);V?V.push(w):m.set(T,[w])}}return m}function OS(a,o,c){a=a.ownerDocument||a,a.head.insertBefore(c,o==="title"?a.querySelector("head > title"):null)}function S4(a,o,c){if(c===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(a=o.disabled,typeof o.precedence=="string"&&a==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function zS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function _4(a,o,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var b=No(m.href),w=o.querySelector(ru(b));if(w){o=w._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Fd.bind(a),o.then(a,a)),c.state.loading|=4,c.instance=w,gn(w);return}w=o.ownerDocument||o,m=RS(m),(b=jr.get(b))&&cg(m,b),w=w.createElement("link"),gn(w);var T=w;T._p=new Promise(function(V,J){T.onload=V,T.onerror=J}),wn(w,"link",m),c.instance=w}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(a.count++,c=Fd.bind(a),o.addEventListener("load",c),o.addEventListener("error",c))}}var fg=0;function C4(a,o){return a.stylesheets&&a.count===0&&Bd(a,a.stylesheets),0<a.count||0<a.imgCount?function(c){var m=setTimeout(function(){if(a.stylesheets&&Bd(a,a.stylesheets),a.unsuspend){var w=a.unsuspend;a.unsuspend=null,w()}},6e4+o);0<a.imgBytes&&fg===0&&(fg=62500*i4());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Bd(a,a.stylesheets),a.unsuspend)){var w=a.unsuspend;a.unsuspend=null,w()}},(a.imgBytes>fg?50:800)+o);return a.unsuspend=c,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Fd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bd(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ud=null;function Bd(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ud=new Map,o.forEach(j4,a),Ud=null,Fd.call(a))}function j4(a,o){if(!(o.state.loading&4)){var c=Ud.get(a);if(c)var m=c.get(null);else{c=new Map,Ud.set(a,c);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var T=b[w];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(c.set(T.dataset.precedence,T),m=T)}m&&c.set(null,m)}b=o.instance,T=b.getAttribute("data-precedence"),w=c.get(T)||m,w===m&&c.set(null,b),c.set(T,b),this.count++,m=Fd.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),w?w.parentNode.insertBefore(b,w.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var au={$$typeof:N,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function k4(a,o,c,m,b,w,T,V,J){this.tag=1,this.containerInfo=a,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=vl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vl(0),this.hiddenUpdates=vl(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function PS(a,o,c,m,b,w,T,V,J,le,ge,xe){return a=new k4(a,o,c,T,J,le,ge,xe,V),o=1,w===!0&&(o|=24),w=tr(3,null,null,o),a.current=w,w.stateNode=a,o=Gp(),o.refCount++,a.pooledCache=o,o.refCount++,w.memoizedState={element:m,isDehydrated:c,cache:o},Kp(w),a}function LS(a){return a?(a=ao,a):ao}function IS(a,o,c,m,b,w){b=LS(b),m.context===null?m.context=b:m.pendingContext=b,m=ma(o),m.payload={element:c},w=w===void 0?null:w,w!==null&&(m.callback=w),c=ga(a,m,o),c!==null&&(qn(c,a,o),Ll(c,a,o))}function VS(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<o?c:o}}function hg(a,o){VS(a,o),(a=a.alternate)&&VS(a,o)}function FS(a){if(a.tag===13||a.tag===31){var o=is(a,67108864);o!==null&&qn(o,a,67108864),hg(a,67108864)}}function US(a){if(a.tag===13||a.tag===31){var o=sr();o=mt(o);var c=is(a,o);c!==null&&qn(c,a,o),hg(a,o)}}var $d=!0;function E4(a,o,c,m){var b=O.T;O.T=null;var w=q.p;try{q.p=2,pg(a,o,c,m)}finally{q.p=w,O.T=b}}function N4(a,o,c,m){var b=O.T;O.T=null;var w=q.p;try{q.p=8,pg(a,o,c,m)}finally{q.p=w,O.T=b}}function pg(a,o,c,m){if($d){var b=mg(m);if(b===null)eg(a,o,m,Hd,c),$S(a,m);else if(A4(b,a,o,c,m))m.stopPropagation();else if($S(a,m),o&4&&-1<T4.indexOf(a)){for(;b!==null;){var w=Xs(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var T=Ci(w.pendingLanes);if(T!==0){var V=w;for(V.pendingLanes|=2,V.entangledLanes|=2;T;){var J=1<<31-pt(T);V.entanglements[1]|=J,T&=~J}si(w),(ft&6)===0&&(kd=wt()+500,Jl(0))}}break;case 31:case 13:V=is(w,2),V!==null&&qn(V,w,2),Nd(),hg(w,2)}if(w=mg(m),w===null&&eg(a,o,m,Hd,c),w===b)break;b=w}b!==null&&m.stopPropagation()}else eg(a,o,m,null,c)}}function mg(a){return a=yp(a),gg(a)}var Hd=null;function gg(a){if(Hd=null,a=Ys(a),a!==null){var o=l(a);if(o===null)a=null;else{var c=o.tag;if(c===13){if(a=u(o),a!==null)return a;a=null}else if(c===31){if(a=d(o),a!==null)return a;a=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Hd=a,null}function BS(a){switch(a){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(mn()){case he:return 2;case Se:return 8;case Oe:case W:return 32;case ve:return 268435456;default:return 32}default:return 32}}var yg=!1,Ea=null,Na=null,Ta=null,su=new Map,ou=new Map,Aa=[],T4="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 $S(a,o){switch(a){case"focusin":case"focusout":Ea=null;break;case"dragenter":case"dragleave":Na=null;break;case"mouseover":case"mouseout":Ta=null;break;case"pointerover":case"pointerout":su.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ou.delete(o.pointerId)}}function lu(a,o,c,m,b,w){return a===null||a.nativeEvent!==w?(a={blockedOn:o,domEventName:c,eventSystemFlags:m,nativeEvent:w,targetContainers:[b]},o!==null&&(o=Xs(o),o!==null&&FS(o)),a):(a.eventSystemFlags|=m,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function A4(a,o,c,m,b){switch(o){case"focusin":return Ea=lu(Ea,a,o,c,m,b),!0;case"dragenter":return Na=lu(Na,a,o,c,m,b),!0;case"mouseover":return Ta=lu(Ta,a,o,c,m,b),!0;case"pointerover":var w=b.pointerId;return su.set(w,lu(su.get(w)||null,a,o,c,m,b)),!0;case"gotpointercapture":return w=b.pointerId,ou.set(w,lu(ou.get(w)||null,a,o,c,m,b)),!0}return!1}function HS(a){var o=Ys(a.target);if(o!==null){var c=l(o);if(c!==null){if(o=c.tag,o===13){if(o=u(c),o!==null){a.blockedOn=o,zn(a.priority,function(){US(c)});return}}else if(o===31){if(o=d(c),o!==null){a.blockedOn=o,zn(a.priority,function(){US(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Gd(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var c=mg(a.nativeEvent);if(c===null){c=a.nativeEvent;var m=new c.constructor(c.type,c);gp=m,c.target.dispatchEvent(m),gp=null}else return o=Xs(c),o!==null&&FS(o),a.blockedOn=c,!1;o.shift()}return!0}function GS(a,o,c){Gd(a)&&c.delete(o)}function R4(){yg=!1,Ea!==null&&Gd(Ea)&&(Ea=null),Na!==null&&Gd(Na)&&(Na=null),Ta!==null&&Gd(Ta)&&(Ta=null),su.forEach(GS),ou.forEach(GS)}function qd(a,o){a.blockedOn===o&&(a.blockedOn=null,yg||(yg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,R4)))}var Yd=null;function qS(a){Yd!==a&&(Yd=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Yd===a&&(Yd=null);for(var o=0;o<a.length;o+=3){var c=a[o],m=a[o+1],b=a[o+2];if(typeof m!="function"){if(gg(m||c)===null)continue;break}var w=Xs(c);w!==null&&(a.splice(o,3),o-=3,mm(w,{pending:!0,data:b,method:c.method,action:m},m,b))}}))}function Ao(a){function o(J){return qd(J,a)}Ea!==null&&qd(Ea,a),Na!==null&&qd(Na,a),Ta!==null&&qd(Ta,a),su.forEach(o),ou.forEach(o);for(var c=0;c<Aa.length;c++){var m=Aa[c];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Aa.length&&(c=Aa[0],c.blockedOn===null);)HS(c),c.blockedOn===null&&Aa.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var b=c[m],w=c[m+1],T=b[dn]||null;if(typeof w=="function")T||qS(c);else if(T){var V=null;if(w&&w.hasAttribute("formAction")){if(b=w,T=w[dn]||null)V=T.formAction;else if(gg(b)!==null)continue}else V=T.action;typeof V=="function"?c[m+1]=V:(c.splice(m,3),m-=3),qS(c)}}}function YS(){function a(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(T){return b=T})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function vg(a){this._internalRoot=a}Xd.prototype.render=vg.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(i(409));var c=o.current,m=sr();IS(c,m,a,o,null,null)},Xd.prototype.unmount=vg.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;IS(a.current,2,null,a,null,null),Nd(),o[ni]=null}};function Xd(a){this._internalRoot=a}Xd.prototype.unstable_scheduleHydration=function(a){if(a){var o=Fn();a={blockedOn:null,target:a,priority:o};for(var c=0;c<Aa.length&&o!==0&&o<Aa[c].priority;c++);Aa.splice(c,0,a),c===0&&HS(a)}};var XS=n.version;if(XS!=="19.2.4")throw Error(i(527,XS,"19.2.4"));q.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=p(o),a=a!==null?g(a):null,a=a===null?null:a.stateNode,a};var M4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kd.isDisabled&&Kd.supportsFiber)try{kt=Kd.inject(M4),Tt=Kd}catch{}}return cu.createRoot=function(a,o){if(!s(a))throw Error(i(299));var c=!1,m="",b=tw,w=nw,T=rw;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(T=o.onRecoverableError)),o=PS(a,1,!1,null,null,c,m,null,b,w,T,YS),a[ni]=o.current,Jm(a),new vg(o)},cu.hydrateRoot=function(a,o,c){if(!s(a))throw Error(i(299));var m=!1,b="",w=tw,T=nw,V=rw,J=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(T=c.onCaughtError),c.onRecoverableError!==void 0&&(V=c.onRecoverableError),c.formState!==void 0&&(J=c.formState)),o=PS(a,1,!0,o,c??null,m,b,J,w,T,V,YS),o.context=LS(null),c=o.current,m=sr(),m=mt(m),b=ma(m),b.callback=null,ga(c,b,m),c=m,o.current.lanes=c,oa(o,c),si(o),a[ni]=o.current,Jm(a),new Xd(o)},cu.version="19.2.4",cu}var i_;function B4(){if(i_)return wg.exports;i_=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(n){console.error(n)}}return e(),wg.exports=U4(),wg.exports}var $4=B4();function Ck(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(n=0;n<s;n++)e[n]&&(r=Ck(e[n]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function jk(){for(var e,n,r=0,i="",s=arguments.length;r<s;r++)(e=arguments[r])&&(n=Ck(e))&&(i&&(i+=" "),i+=n);return i}const a_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,s_=jk,Sh=(e,n)=>r=>{var i;if(n?.variants==null)return s_(e,r?.class,r?.className);const{variants:s,defaultVariants:l}=n,u=Object.keys(s).map(p=>{const g=r?.[p],y=l?.[p];if(g===null)return null;const v=a_(g)||a_(y);return s[p][v]}),d=r&&Object.entries(r).reduce((p,g)=>{let[y,v]=g;return v===void 0||(p[y]=v),p},{}),h=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((p,g)=>{let{class:y,className:v,...x}=g;return Object.entries(x).every(_=>{let[C,k]=_;return Array.isArray(k)?k.includes({...l,...d}[C]):{...l,...d}[C]===k})?[...p,y,v]:p},[]);return s_(e,u,h,r?.class,r?.className)};var gc=_k();const H4=mc(gc);function o_(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function _h(...e){return n=>{let r=!1;const i=e.map(s=>{const l=o_(s,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let s=0;s<i.length;s++){const l=i[s];typeof l=="function"?l():o_(e[s],null)}}}}function bt(...e){return S.useCallback(_h(...e),e)}function Ms(e){const n=G4(e),r=S.forwardRef((i,s)=>{const{children:l,...u}=i,d=S.Children.toArray(l),h=d.find(Y4);if(h){const p=h.props.children,g=d.map(y=>y===h?S.Children.count(p)>1?S.Children.only(null):S.isValidElement(p)?p.props.children:null:y);return f.jsx(n,{...u,ref:s,children:S.isValidElement(p)?S.cloneElement(p,void 0,g):null})}return f.jsx(n,{...u,ref:s,children:l})});return r.displayName=`${e}.Slot`,r}var Ch=Ms("Slot");function G4(e){const n=S.forwardRef((r,i)=>{const{children:s,...l}=r;if(S.isValidElement(s)){const u=K4(s),d=X4(l,s.props);return s.type!==S.Fragment&&(d.ref=i?_h(i,u):u),S.cloneElement(s,d)}return S.Children.count(s)>1?S.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var kk=Symbol("radix.slottable");function q4(e){const n=({children:r})=>f.jsx(f.Fragment,{children:r});return n.displayName=`${e}.Slottable`,n.__radixId=kk,n}function Y4(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kk}function X4(e,n){const r={...n};for(const i in n){const s=e[i],l=n[i];/^on[A-Z]/.test(i)?s&&l?r[i]=(...d)=>{const h=l(...d);return s(...d),h}:s&&(r[i]=s):i==="style"?r[i]={...s,...l}:i==="className"&&(r[i]=[s,l].filter(Boolean).join(" "))}return{...e,...r}}function K4(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var W4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=W4.reduce((e,n)=>{const r=Ms(`Primitive.${n}`),i=S.forwardRef((s,l)=>{const{asChild:u,...d}=s,h=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(h,{...d,ref:l})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Ek(e,n){e&&gc.flushSync(()=>e.dispatchEvent(n))}var Nk=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"}),Z4="VisuallyHidden",Tk=S.forwardRef((e,n)=>f.jsx(Xe.span,{...e,ref:n,style:{...Nk,...e.style}}));Tk.displayName=Z4;var Q4=Tk;function J4(e,n){const r=S.createContext(n),i=l=>{const{children:u,...d}=l,h=S.useMemo(()=>d,Object.values(d));return f.jsx(r.Provider,{value:h,children:u})};i.displayName=e+"Provider";function s(l){const u=S.useContext(r);if(u)return u;if(n!==void 0)return n;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[i,s]}function bi(e,n=[]){let r=[];function i(l,u){const d=S.createContext(u),h=r.length;r=[...r,u];const p=y=>{const{scope:v,children:x,..._}=y,C=v?.[e]?.[h]||d,k=S.useMemo(()=>_,Object.values(_));return f.jsx(C.Provider,{value:k,children:x})};p.displayName=l+"Provider";function g(y,v){const x=v?.[e]?.[h]||d,_=S.useContext(x);if(_)return _;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${l}\``)}return[p,g]}const s=()=>{const l=r.map(u=>S.createContext(u));return function(d){const h=d?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return s.scopeName=e,[i,e3(s,...n)]}function e3(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const u=i.reduce((d,{useScope:h,scopeName:p})=>{const y=h(l)[`__scope${p}`];return{...d,...y}},{});return S.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return r.scopeName=n.scopeName,r}function tx(e){const n=e+"CollectionProvider",[r,i]=bi(n),[s,l]=r(n,{collectionRef:{current:null},itemMap:new Map}),u=C=>{const{scope:k,children:j}=C,E=Xn.useRef(null),N=Xn.useRef(new Map).current;return f.jsx(s,{scope:k,itemMap:N,collectionRef:E,children:j})};u.displayName=n;const d=e+"CollectionSlot",h=Ms(d),p=Xn.forwardRef((C,k)=>{const{scope:j,children:E}=C,N=l(d,j),M=bt(k,N.collectionRef);return f.jsx(h,{ref:M,children:E})});p.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=Ms(g),x=Xn.forwardRef((C,k)=>{const{scope:j,children:E,...N}=C,M=Xn.useRef(null),R=bt(k,M),z=l(g,j);return Xn.useEffect(()=>(z.itemMap.set(M,{ref:M,...N}),()=>{z.itemMap.delete(M)})),f.jsx(v,{[y]:"",ref:R,children:E})});x.displayName=g;function _(C){const k=l(e+"CollectionConsumer",C);return Xn.useCallback(()=>{const E=k.collectionRef.current;if(!E)return[];const N=Array.from(E.querySelectorAll(`[${y}]`));return Array.from(k.itemMap.values()).sort((z,P)=>N.indexOf(z.ref.current)-N.indexOf(P.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:u,Slot:p,ItemSlot:x},_,i]}function Ae(e,n,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e?.(s),r===!1||!s.defaultPrevented)return n?.(s)}}var pn=globalThis?.document?S.useLayoutEffect:()=>{},t3=Sk[" useInsertionEffect ".trim().toString()]||pn;function Ds({prop:e,defaultProp:n,onChange:r=()=>{},caller:i}){const[s,l,u]=n3({defaultProp:n,onChange:r}),d=e!==void 0,h=d?e:s;{const g=S.useRef(e!==void 0);S.useEffect(()=>{const y=g.current;y!==d&&console.warn(`${i} is changing from ${y?"controlled":"uncontrolled"} to ${d?"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.`),g.current=d},[d,i])}const p=S.useCallback(g=>{if(d){const y=r3(g)?g(e):g;y!==e&&u.current?.(y)}else l(g)},[d,e,l,u]);return[h,p]}function n3({defaultProp:e,onChange:n}){const[r,i]=S.useState(e),s=S.useRef(r),l=S.useRef(n);return t3(()=>{l.current=n},[n]),S.useEffect(()=>{s.current!==r&&(l.current?.(r),s.current=r)},[r,s]),[r,i,l]}function r3(e){return typeof e=="function"}function i3(e,n){return S.useReducer((r,i)=>n[r][i]??r,e)}var Jr=e=>{const{present:n,children:r}=e,i=a3(n),s=typeof r=="function"?r({present:i.isPresent}):S.Children.only(r),l=bt(i.ref,s3(s));return typeof r=="function"||i.isPresent?S.cloneElement(s,{ref:l}):null};Jr.displayName="Presence";function a3(e){const[n,r]=S.useState(),i=S.useRef(null),s=S.useRef(e),l=S.useRef("none"),u=e?"mounted":"unmounted",[d,h]=i3(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const p=Wd(i.current);l.current=d==="mounted"?p:"none"},[d]),pn(()=>{const p=i.current,g=s.current;if(g!==e){const v=l.current,x=Wd(p);e?h("MOUNT"):x==="none"||p?.display==="none"?h("UNMOUNT"):h(g&&v!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),pn(()=>{if(n){let p;const g=n.ownerDocument.defaultView??window,y=x=>{const C=Wd(i.current).includes(CSS.escape(x.animationName));if(x.target===n&&C&&(h("ANIMATION_END"),!s.current)){const k=n.style.animationFillMode;n.style.animationFillMode="forwards",p=g.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=k)})}},v=x=>{x.target===n&&(l.current=Wd(i.current))};return n.addEventListener("animationstart",v),n.addEventListener("animationcancel",y),n.addEventListener("animationend",y),()=>{g.clearTimeout(p),n.removeEventListener("animationstart",v),n.removeEventListener("animationcancel",y),n.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[n,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:S.useCallback(p=>{i.current=p?getComputedStyle(p):null,r(p)},[])}}function Wd(e){return e?.animationName||"none"}function s3(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var o3=Sk[" useId ".trim().toString()]||(()=>{}),l3=0;function Xr(e){const[n,r]=S.useState(o3());return pn(()=>{r(i=>i??String(l3++))},[e]),e||(n?`radix-${n}`:"")}var u3=S.createContext(void 0);function jh(e){const n=S.useContext(u3);return e||n||"ltr"}function Wr(e){const n=S.useRef(e);return S.useEffect(()=>{n.current=e}),S.useMemo(()=>(...r)=>n.current?.(...r),[])}function c3(e,n=globalThis?.document){const r=Wr(e);S.useEffect(()=>{const i=s=>{s.key==="Escape"&&r(s)};return n.addEventListener("keydown",i,{capture:!0}),()=>n.removeEventListener("keydown",i,{capture:!0})},[r,n])}var d3="DismissableLayer",Dy="dismissableLayer.update",f3="dismissableLayer.pointerDownOutside",h3="dismissableLayer.focusOutside",l_,Ak=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yc=S.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...h}=e,p=S.useContext(Ak),[g,y]=S.useState(null),v=g?.ownerDocument??globalThis?.document,[,x]=S.useState({}),_=bt(n,P=>y(P)),C=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),j=C.indexOf(k),E=g?C.indexOf(g):-1,N=p.layersWithOutsidePointerEventsDisabled.size>0,M=E>=j,R=g3(P=>{const D=P.target,$=[...p.branches].some(U=>U.contains(D));!M||$||(s?.(P),u?.(P),P.defaultPrevented||d?.())},v),z=y3(P=>{const D=P.target;[...p.branches].some(U=>U.contains(D))||(l?.(P),u?.(P),P.defaultPrevented||d?.())},v);return c3(P=>{E===p.layers.size-1&&(i?.(P),!P.defaultPrevented&&d&&(P.preventDefault(),d()))},v),S.useEffect(()=>{if(g)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(l_=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),u_(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=l_)}},[g,v,r,p]),S.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),u_())},[g,p]),S.useEffect(()=>{const P=()=>x({});return document.addEventListener(Dy,P),()=>document.removeEventListener(Dy,P)},[]),f.jsx(Xe.div,{...h,ref:_,style:{pointerEvents:N?M?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,z.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,R.onPointerDownCapture)})});yc.displayName=d3;var p3="DismissableLayerBranch",m3=S.forwardRef((e,n)=>{const r=S.useContext(Ak),i=S.useRef(null),s=bt(n,i);return S.useEffect(()=>{const l=i.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),f.jsx(Xe.div,{...e,ref:s})});m3.displayName=p3;function g3(e,n=globalThis?.document){const r=Wr(e),i=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const l=d=>{if(d.target&&!i.current){let h=function(){Rk(f3,r,p,{discrete:!0})};const p={originalEvent:d};d.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=h,n.addEventListener("click",s.current,{once:!0})):h()}else n.removeEventListener("click",s.current);i.current=!1},u=window.setTimeout(()=>{n.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",l),n.removeEventListener("click",s.current)}},[n,r]),{onPointerDownCapture:()=>i.current=!0}}function y3(e,n=globalThis?.document){const r=Wr(e),i=S.useRef(!1);return S.useEffect(()=>{const s=l=>{l.target&&!i.current&&Rk(h3,r,{originalEvent:l},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function u_(){const e=new CustomEvent(Dy);document.dispatchEvent(e)}function Rk(e,n,r,{discrete:i}){const s=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&s.addEventListener(e,n,{once:!0}),i?Ek(s,l):s.dispatchEvent(l)}var jg="focusScope.autoFocusOnMount",kg="focusScope.autoFocusOnUnmount",c_={bubbles:!1,cancelable:!0},v3="FocusScope",kh=S.forwardRef((e,n)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...u}=e,[d,h]=S.useState(null),p=Wr(s),g=Wr(l),y=S.useRef(null),v=bt(n,C=>h(C)),x=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(i){let C=function(N){if(x.paused||!d)return;const M=N.target;d.contains(M)?y.current=M:La(y.current,{select:!0})},k=function(N){if(x.paused||!d)return;const M=N.relatedTarget;M!==null&&(d.contains(M)||La(y.current,{select:!0}))},j=function(N){if(document.activeElement===document.body)for(const R of N)R.removedNodes.length>0&&La(d)};document.addEventListener("focusin",C),document.addEventListener("focusout",k);const E=new MutationObserver(j);return d&&E.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",k),E.disconnect()}}},[i,d,x.paused]),S.useEffect(()=>{if(d){f_.add(x);const C=document.activeElement;if(!d.contains(C)){const j=new CustomEvent(jg,c_);d.addEventListener(jg,p),d.dispatchEvent(j),j.defaultPrevented||(x3(C3(Mk(d)),{select:!0}),document.activeElement===C&&La(d))}return()=>{d.removeEventListener(jg,p),setTimeout(()=>{const j=new CustomEvent(kg,c_);d.addEventListener(kg,g),d.dispatchEvent(j),j.defaultPrevented||La(C??document.body,{select:!0}),d.removeEventListener(kg,g),f_.remove(x)},0)}}},[d,p,g,x]);const _=S.useCallback(C=>{if(!r&&!i||x.paused)return;const k=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,j=document.activeElement;if(k&&j){const E=C.currentTarget,[N,M]=b3(E);N&&M?!C.shiftKey&&j===M?(C.preventDefault(),r&&La(N,{select:!0})):C.shiftKey&&j===N&&(C.preventDefault(),r&&La(M,{select:!0})):j===E&&C.preventDefault()}},[r,i,x.paused]);return f.jsx(Xe.div,{tabIndex:-1,...u,ref:v,onKeyDown:_})});kh.displayName=v3;function x3(e,{select:n=!1}={}){const r=document.activeElement;for(const i of e)if(La(i,{select:n}),document.activeElement!==r)return}function b3(e){const n=Mk(e),r=d_(n,e),i=d_(n.reverse(),e);return[r,i]}function Mk(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function d_(e,n){for(const r of e)if(!w3(r,{upTo:n}))return r}function w3(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function S3(e){return e instanceof HTMLInputElement&&"select"in e}function La(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&S3(e)&&n&&e.select()}}var f_=_3();function _3(){let e=[];return{add(n){const r=e[0];n!==r&&r?.pause(),e=h_(e,n),e.unshift(n)},remove(n){e=h_(e,n),e[0]?.resume()}}}function h_(e,n){const r=[...e],i=r.indexOf(n);return i!==-1&&r.splice(i,1),r}function C3(e){return e.filter(n=>n.tagName!=="A")}var j3="Portal",vc=S.forwardRef((e,n)=>{const{container:r,...i}=e,[s,l]=S.useState(!1);pn(()=>l(!0),[]);const u=r||s&&globalThis?.document?.body;return u?H4.createPortal(f.jsx(Xe.div,{...i,ref:n}),u):null});vc.displayName=j3;var Eg=0;function nx(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??p_()),document.body.insertAdjacentElement("beforeend",e[1]??p_()),Eg++,()=>{Eg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Eg--}},[])}function p_(){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 ci=function(){return ci=Object.assign||function(n){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(n[l]=r[l])}return n},ci.apply(this,arguments)};function Dk(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r}function k3(e,n,r){if(r||arguments.length===2)for(var i=0,s=n.length,l;i<s;i++)(l||!(i in n))&&(l||(l=Array.prototype.slice.call(n,0,i)),l[i]=n[i]);return e.concat(l||Array.prototype.slice.call(n))}var Ef="right-scroll-bar-position",Nf="width-before-scroll-bar",E3="with-scroll-bars-hidden",N3="--removed-body-scroll-bar-size";function Ng(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function T3(e,n){var r=S.useState(function(){return{value:e,callback:n,facade:{get current(){return r.value},set current(i){var s=r.value;s!==i&&(r.value=i,r.callback(i,s))}}}})[0];return r.callback=n,r.facade}var A3=typeof window<"u"?S.useLayoutEffect:S.useEffect,m_=new WeakMap;function R3(e,n){var r=T3(null,function(i){return e.forEach(function(s){return Ng(s,i)})});return A3(function(){var i=m_.get(r);if(i){var s=new Set(i),l=new Set(e),u=r.current;s.forEach(function(d){l.has(d)||Ng(d,null)}),l.forEach(function(d){s.has(d)||Ng(d,u)})}m_.set(r,e)},[e]),r}function M3(e){return e}function D3(e,n){n===void 0&&(n=M3);var r=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(l){var u=n(l,i);return r.push(u),function(){r=r.filter(function(d){return d!==u})}},assignSyncMedium:function(l){for(i=!0;r.length;){var u=r;r=[],u.forEach(l)}r={push:function(d){return l(d)},filter:function(){return r}}},assignMedium:function(l){i=!0;var u=[];if(r.length){var d=r;r=[],d.forEach(l),u=r}var h=function(){var g=u;u=[],g.forEach(l)},p=function(){return Promise.resolve().then(h)};p(),r={push:function(g){u.push(g),p()},filter:function(g){return u=u.filter(g),r}}}};return s}function O3(e){e===void 0&&(e={});var n=D3(null);return n.options=ci({async:!0,ssr:!1},e),n}var Ok=function(e){var n=e.sideCar,r=Dk(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=n.read();if(!i)throw new Error("Sidecar medium not found");return S.createElement(i,ci({},r))};Ok.isSideCarExport=!0;function z3(e,n){return e.useMedium(n),Ok}var zk=O3(),Tg=function(){},Eh=S.forwardRef(function(e,n){var r=S.useRef(null),i=S.useState({onScrollCapture:Tg,onWheelCapture:Tg,onTouchMoveCapture:Tg}),s=i[0],l=i[1],u=e.forwardProps,d=e.children,h=e.className,p=e.removeScrollBar,g=e.enabled,y=e.shards,v=e.sideCar,x=e.noRelative,_=e.noIsolation,C=e.inert,k=e.allowPinchZoom,j=e.as,E=j===void 0?"div":j,N=e.gapMode,M=Dk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=v,z=R3([r,n]),P=ci(ci({},M),s);return S.createElement(S.Fragment,null,g&&S.createElement(R,{sideCar:zk,removeScrollBar:p,shards:y,noRelative:x,noIsolation:_,inert:C,setCallbacks:l,allowPinchZoom:!!k,lockRef:r,gapMode:N}),u?S.cloneElement(S.Children.only(d),ci(ci({},P),{ref:z})):S.createElement(E,ci({},P,{className:h,ref:z}),d))});Eh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Eh.classNames={fullWidth:Nf,zeroRight:Ef};var P3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function L3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=P3();return n&&e.setAttribute("nonce",n),e}function I3(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function V3(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var F3=function(){var e=0,n=null;return{add:function(r){e==0&&(n=L3())&&(I3(n,r),V3(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},U3=function(){var e=F3();return function(n,r){S.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&r])}},Pk=function(){var e=U3(),n=function(r){var i=r.styles,s=r.dynamic;return e(i,s),null};return n},B3={left:0,top:0,right:0,gap:0},Ag=function(e){return parseInt(e||"",10)||0},$3=function(e){var n=window.getComputedStyle(document.body),r=n[e==="padding"?"paddingLeft":"marginLeft"],i=n[e==="padding"?"paddingTop":"marginTop"],s=n[e==="padding"?"paddingRight":"marginRight"];return[Ag(r),Ag(i),Ag(s)]},H3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return B3;var n=$3(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,i-r+n[2]-n[0])}},G3=Pk(),Go="data-scroll-locked",q3=function(e,n,r,i){var s=e.left,l=e.top,u=e.right,d=e.gap;return r===void 0&&(r="margin"),`
|
|
10
|
+
.`.concat(E3,` {
|
|
11
|
+
overflow: hidden `).concat(i,`;
|
|
12
|
+
padding-right: `).concat(d,"px ").concat(i,`;
|
|
13
|
+
}
|
|
14
|
+
body[`).concat(Go,`] {
|
|
15
|
+
overflow: hidden `).concat(i,`;
|
|
16
|
+
overscroll-behavior: contain;
|
|
17
|
+
`).concat([n&&"position: relative ".concat(i,";"),r==="margin"&&`
|
|
18
|
+
padding-left: `.concat(s,`px;
|
|
19
|
+
padding-top: `).concat(l,`px;
|
|
20
|
+
padding-right: `).concat(u,`px;
|
|
21
|
+
margin-left:0;
|
|
22
|
+
margin-top:0;
|
|
23
|
+
margin-right: `).concat(d,"px ").concat(i,`;
|
|
24
|
+
`),r==="padding"&&"padding-right: ".concat(d,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(Ef,` {
|
|
28
|
+
right: `).concat(d,"px ").concat(i,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(Nf,` {
|
|
32
|
+
margin-right: `).concat(d,"px ").concat(i,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(Ef," .").concat(Ef,` {
|
|
36
|
+
right: 0 `).concat(i,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(Nf," .").concat(Nf,` {
|
|
40
|
+
margin-right: 0 `).concat(i,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body[`).concat(Go,`] {
|
|
44
|
+
`).concat(N3,": ").concat(d,`px;
|
|
45
|
+
}
|
|
46
|
+
`)},g_=function(){var e=parseInt(document.body.getAttribute(Go)||"0",10);return isFinite(e)?e:0},Y3=function(){S.useEffect(function(){return document.body.setAttribute(Go,(g_()+1).toString()),function(){var e=g_()-1;e<=0?document.body.removeAttribute(Go):document.body.setAttribute(Go,e.toString())}},[])},X3=function(e){var n=e.noRelative,r=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;Y3();var l=S.useMemo(function(){return H3(s)},[s]);return S.createElement(G3,{styles:q3(l,!n,s,r?"":"!important")})},Oy=!1;if(typeof window<"u")try{var Zd=Object.defineProperty({},"passive",{get:function(){return Oy=!0,!0}});window.addEventListener("test",Zd,Zd),window.removeEventListener("test",Zd,Zd)}catch{Oy=!1}var Ro=Oy?{passive:!1}:!1,K3=function(e){return e.tagName==="TEXTAREA"},Lk=function(e,n){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[n]!=="hidden"&&!(r.overflowY===r.overflowX&&!K3(e)&&r[n]==="visible")},W3=function(e){return Lk(e,"overflowY")},Z3=function(e){return Lk(e,"overflowX")},y_=function(e,n){var r=n.ownerDocument,i=n;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=Ik(e,i);if(s){var l=Vk(e,i),u=l[1],d=l[2];if(u>d)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},Q3=function(e){var n=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[n,r,i]},J3=function(e){var n=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[n,r,i]},Ik=function(e,n){return e==="v"?W3(n):Z3(n)},Vk=function(e,n){return e==="v"?Q3(n):J3(n)},ez=function(e,n){return e==="h"&&n==="rtl"?-1:1},tz=function(e,n,r,i,s){var l=ez(e,window.getComputedStyle(n).direction),u=l*i,d=r.target,h=n.contains(d),p=!1,g=u>0,y=0,v=0;do{if(!d)break;var x=Vk(e,d),_=x[0],C=x[1],k=x[2],j=C-k-l*_;(_||j)&&Ik(e,d)&&(y+=j,v+=_);var E=d.parentNode;d=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!h&&d!==document.body||h&&(n.contains(d)||n===d));return(g&&Math.abs(y)<1||!g&&Math.abs(v)<1)&&(p=!0),p},Qd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},v_=function(e){return[e.deltaX,e.deltaY]},x_=function(e){return e&&"current"in e?e.current:e},nz=function(e,n){return e[0]===n[0]&&e[1]===n[1]},rz=function(e){return`
|
|
47
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
+
`)},iz=0,Mo=[];function az(e){var n=S.useRef([]),r=S.useRef([0,0]),i=S.useRef(),s=S.useState(iz++)[0],l=S.useState(Pk)[0],u=S.useRef(e);S.useEffect(function(){u.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=k3([e.lockRef.current],(e.shards||[]).map(x_),!0).filter(Boolean);return C.forEach(function(k){return k.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=S.useCallback(function(C,k){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!u.current.allowPinchZoom;var j=Qd(C),E=r.current,N="deltaX"in C?C.deltaX:E[0]-j[0],M="deltaY"in C?C.deltaY:E[1]-j[1],R,z=C.target,P=Math.abs(N)>Math.abs(M)?"h":"v";if("touches"in C&&P==="h"&&z.type==="range")return!1;var D=window.getSelection(),$=D&&D.anchorNode,U=$?$===z||$.contains(z):!1;if(U)return!1;var X=y_(P,z);if(!X)return!0;if(X?R=P:(R=P==="v"?"h":"v",X=y_(P,z)),!X)return!1;if(!i.current&&"changedTouches"in C&&(N||M)&&(i.current=R),!R)return!0;var K=i.current||R;return tz(K,k,C,K==="h"?N:M)},[]),h=S.useCallback(function(C){var k=C;if(!(!Mo.length||Mo[Mo.length-1]!==l)){var j="deltaY"in k?v_(k):Qd(k),E=n.current.filter(function(R){return R.name===k.type&&(R.target===k.target||k.target===R.shadowParent)&&nz(R.delta,j)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var N=(u.current.shards||[]).map(x_).filter(Boolean).filter(function(R){return R.contains(k.target)}),M=N.length>0?d(k,N[0]):!u.current.noIsolation;M&&k.cancelable&&k.preventDefault()}}},[]),p=S.useCallback(function(C,k,j,E){var N={name:C,delta:k,target:j,should:E,shadowParent:sz(j)};n.current.push(N),setTimeout(function(){n.current=n.current.filter(function(M){return M!==N})},1)},[]),g=S.useCallback(function(C){r.current=Qd(C),i.current=void 0},[]),y=S.useCallback(function(C){p(C.type,v_(C),C.target,d(C,e.lockRef.current))},[]),v=S.useCallback(function(C){p(C.type,Qd(C),C.target,d(C,e.lockRef.current))},[]);S.useEffect(function(){return Mo.push(l),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:v}),document.addEventListener("wheel",h,Ro),document.addEventListener("touchmove",h,Ro),document.addEventListener("touchstart",g,Ro),function(){Mo=Mo.filter(function(C){return C!==l}),document.removeEventListener("wheel",h,Ro),document.removeEventListener("touchmove",h,Ro),document.removeEventListener("touchstart",g,Ro)}},[]);var x=e.removeScrollBar,_=e.inert;return S.createElement(S.Fragment,null,_?S.createElement(l,{styles:rz(s)}):null,x?S.createElement(X3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sz(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const oz=z3(zk,az);var Nh=S.forwardRef(function(e,n){return S.createElement(Eh,ci({},e,{ref:n,sideCar:oz}))});Nh.classNames=Eh.classNames;var lz=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Do=new WeakMap,Jd=new WeakMap,ef={},Rg=0,Fk=function(e){return e&&(e.host||Fk(e.parentNode))},uz=function(e,n){return n.map(function(r){if(e.contains(r))return r;var i=Fk(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},cz=function(e,n,r,i){var s=uz(n,Array.isArray(e)?e:[e]);ef[r]||(ef[r]=new WeakMap);var l=ef[r],u=[],d=new Set,h=new Set(s),p=function(y){!y||d.has(y)||(d.add(y),p(y.parentNode))};s.forEach(p);var g=function(y){!y||h.has(y)||Array.prototype.forEach.call(y.children,function(v){if(d.has(v))g(v);else try{var x=v.getAttribute(i),_=x!==null&&x!=="false",C=(Do.get(v)||0)+1,k=(l.get(v)||0)+1;Do.set(v,C),l.set(v,k),u.push(v),C===1&&_&&Jd.set(v,!0),k===1&&v.setAttribute(r,"true"),_||v.setAttribute(i,"true")}catch(j){console.error("aria-hidden: cannot operate on ",v,j)}})};return g(n),d.clear(),Rg++,function(){u.forEach(function(y){var v=Do.get(y)-1,x=l.get(y)-1;Do.set(y,v),l.set(y,x),v||(Jd.has(y)||y.removeAttribute(i),Jd.delete(y)),x||y.removeAttribute(r)}),Rg--,Rg||(Do=new WeakMap,Do=new WeakMap,Jd=new WeakMap,ef={})}},rx=function(e,n,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=lz(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),cz(i,s,r,"aria-hidden")):function(){return null}},Th="Dialog",[Uk]=bi(Th),[dz,ei]=Uk(Th),Bk=e=>{const{__scopeDialog:n,children:r,open:i,defaultOpen:s,onOpenChange:l,modal:u=!0}=e,d=S.useRef(null),h=S.useRef(null),[p,g]=Ds({prop:i,defaultProp:s??!1,onChange:l,caller:Th});return f.jsx(dz,{scope:n,triggerRef:d,contentRef:h,contentId:Xr(),titleId:Xr(),descriptionId:Xr(),open:p,onOpenChange:g,onOpenToggle:S.useCallback(()=>g(y=>!y),[g]),modal:u,children:r})};Bk.displayName=Th;var $k="DialogTrigger",fz=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=ei($k,r),l=bt(n,s.triggerRef);return f.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sx(s.open),...i,ref:l,onClick:Ae(e.onClick,s.onOpenToggle)})});fz.displayName=$k;var ix="DialogPortal",[hz,Hk]=Uk(ix,{forceMount:void 0}),Gk=e=>{const{__scopeDialog:n,forceMount:r,children:i,container:s}=e,l=ei(ix,n);return f.jsx(hz,{scope:n,forceMount:r,children:S.Children.map(i,u=>f.jsx(Jr,{present:r||l.open,children:f.jsx(vc,{asChild:!0,container:s,children:u})}))})};Gk.displayName=ix;var Vf="DialogOverlay",qk=S.forwardRef((e,n)=>{const r=Hk(Vf,e.__scopeDialog),{forceMount:i=r.forceMount,...s}=e,l=ei(Vf,e.__scopeDialog);return l.modal?f.jsx(Jr,{present:i||l.open,children:f.jsx(mz,{...s,ref:n})}):null});qk.displayName=Vf;var pz=Ms("DialogOverlay.RemoveScroll"),mz=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=ei(Vf,r);return f.jsx(Nh,{as:pz,allowPinchZoom:!0,shards:[s.contentRef],children:f.jsx(Xe.div,{"data-state":sx(s.open),...i,ref:n,style:{pointerEvents:"auto",...i.style}})})}),Os="DialogContent",Yk=S.forwardRef((e,n)=>{const r=Hk(Os,e.__scopeDialog),{forceMount:i=r.forceMount,...s}=e,l=ei(Os,e.__scopeDialog);return f.jsx(Jr,{present:i||l.open,children:l.modal?f.jsx(gz,{...s,ref:n}):f.jsx(yz,{...s,ref:n})})});Yk.displayName=Os;var gz=S.forwardRef((e,n)=>{const r=ei(Os,e.__scopeDialog),i=S.useRef(null),s=bt(n,r.contentRef,i);return S.useEffect(()=>{const l=i.current;if(l)return rx(l)},[]),f.jsx(Xk,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,l=>l.preventDefault())})}),yz=S.forwardRef((e,n)=>{const r=ei(Os,e.__scopeDialog),i=S.useRef(!1),s=S.useRef(!1);return f.jsx(Xk,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(i.current||r.triggerRef.current?.focus(),l.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(i.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=l.target;r.triggerRef.current?.contains(u)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),Xk=S.forwardRef((e,n)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,...u}=e,d=ei(Os,r),h=S.useRef(null),p=bt(n,h);return nx(),f.jsxs(f.Fragment,{children:[f.jsx(kh,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:l,children:f.jsx(yc,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":sx(d.open),...u,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(vz,{titleId:d.titleId}),f.jsx(bz,{contentRef:h,descriptionId:d.descriptionId})]})]})}),ax="DialogTitle",Kk=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=ei(ax,r);return f.jsx(Xe.h2,{id:s.titleId,...i,ref:n})});Kk.displayName=ax;var Wk="DialogDescription",Zk=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=ei(Wk,r);return f.jsx(Xe.p,{id:s.descriptionId,...i,ref:n})});Zk.displayName=Wk;var Qk="DialogClose",Jk=S.forwardRef((e,n)=>{const{__scopeDialog:r,...i}=e,s=ei(Qk,r);return f.jsx(Xe.button,{type:"button",...i,ref:n,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});Jk.displayName=Qk;function sx(e){return e?"open":"closed"}var eE="DialogTitleWarning",[_ne,tE]=J4(eE,{contentName:Os,titleName:ax,docsSlug:"dialog"}),vz=({titleId:e})=>{const n=tE(eE),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
+
|
|
51
|
+
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
+
|
|
53
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},xz="DialogDescriptionWarning",bz=({contentRef:e,descriptionId:n})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tE(xz).contentName}}.`;return S.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");n&&s&&(document.getElementById(n)||console.warn(i))},[i,e,n]),null},wz=Bk,Sz=Gk,_z=qk,Cz=Yk,jz=Kk,kz=Zk,Ez=Jk,Mg={exports:{}},Dg={};var b_;function Nz(){if(b_)return Dg;b_=1;var e=wh();function n(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var r=typeof Object.is=="function"?Object.is:n,i=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(y,v){var x=v(),_=i({inst:{value:x,getSnapshot:v}}),C=_[0].inst,k=_[1];return l(function(){C.value=x,C.getSnapshot=v,h(C)&&k({inst:C})},[y,x,v]),s(function(){return h(C)&&k({inst:C}),y(function(){h(C)&&k({inst:C})})},[y]),u(x),x}function h(y){var v=y.getSnapshot;y=y.value;try{var x=v();return!r(y,x)}catch{return!0}}function p(y,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return Dg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Dg}var w_;function Tz(){return w_||(w_=1,Mg.exports=Nz()),Mg.exports}var Az=Tz();function Rz(){return Az.useSyncExternalStore(Mz,()=>!0,()=>!1)}function Mz(){return()=>{}}var ox="Avatar",[Dz]=bi(ox),[Oz,nE]=Dz(ox),rE=S.forwardRef((e,n)=>{const{__scopeAvatar:r,...i}=e,[s,l]=S.useState("idle");return f.jsx(Oz,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:l,children:f.jsx(Xe.span,{...i,ref:n})})});rE.displayName=ox;var iE="AvatarImage",aE=S.forwardRef((e,n)=>{const{__scopeAvatar:r,src:i,onLoadingStatusChange:s=()=>{},...l}=e,u=nE(iE,r),d=zz(i,l),h=Wr(p=>{s(p),u.onImageLoadingStatusChange(p)});return pn(()=>{d!=="idle"&&h(d)},[d,h]),d==="loaded"?f.jsx(Xe.img,{...l,ref:n,src:i}):null});aE.displayName=iE;var sE="AvatarFallback",oE=S.forwardRef((e,n)=>{const{__scopeAvatar:r,delayMs:i,...s}=e,l=nE(sE,r),[u,d]=S.useState(i===void 0);return S.useEffect(()=>{if(i!==void 0){const h=window.setTimeout(()=>d(!0),i);return()=>window.clearTimeout(h)}},[i]),u&&l.imageLoadingStatus!=="loaded"?f.jsx(Xe.span,{...s,ref:n}):null});oE.displayName=sE;function S_(e,n){return e?n?(e.src!==n&&(e.src=n),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function zz(e,{referrerPolicy:n,crossOrigin:r}){const i=Rz(),s=S.useRef(null),l=i?(s.current||(s.current=new window.Image),s.current):null,[u,d]=S.useState(()=>S_(l,e));return pn(()=>{d(S_(l,e))},[l,e]),pn(()=>{const h=y=>()=>{d(y)};if(!l)return;const p=h("loaded"),g=h("error");return l.addEventListener("load",p),l.addEventListener("error",g),n&&(l.referrerPolicy=n),typeof r=="string"&&(l.crossOrigin=r),()=>{l.removeEventListener("load",p),l.removeEventListener("error",g)}},[l,r,n]),u}var Pz=rE,Lz=aE,Iz=oE;function Vz(e){const n=S.useRef({value:e,previous:e});return S.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function Fz(e){const[n,r]=S.useState(void 0);return pn(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let u,d;if("borderBoxSize"in l){const h=l.borderBoxSize,p=Array.isArray(h)?h[0]:h;u=p.inlineSize,d=p.blockSize}else u=e.offsetWidth,d=e.offsetHeight;r({width:u,height:d})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),n}const Uz=["top","right","bottom","left"],Ba=Math.min,ur=Math.max,Ff=Math.round,tf=Math.floor,pi=e=>({x:e,y:e}),Bz={left:"right",right:"left",bottom:"top",top:"bottom"};function zy(e,n,r){return ur(e,Ba(n,r))}function na(e,n){return typeof e=="function"?e(n):e}function ra(e){return e.split("-")[0]}function ul(e){return e.split("-")[1]}function lx(e){return e==="x"?"y":"x"}function ux(e){return e==="y"?"height":"width"}function fi(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function cx(e){return lx(fi(e))}function $z(e,n,r){r===void 0&&(r=!1);const i=ul(e),s=cx(e),l=ux(s);let u=s==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(u=Uf(u)),[u,Uf(u)]}function Hz(e){const n=Uf(e);return[Py(e),n,Py(n)]}function Py(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const __=["left","right"],C_=["right","left"],Gz=["top","bottom"],qz=["bottom","top"];function Yz(e,n,r){switch(e){case"top":case"bottom":return r?n?C_:__:n?__:C_;case"left":case"right":return n?Gz:qz;default:return[]}}function Xz(e,n,r,i){const s=ul(e);let l=Yz(ra(e),r==="start",i);return s&&(l=l.map(u=>u+"-"+s),n&&(l=l.concat(l.map(Py)))),l}function Uf(e){const n=ra(e);return Bz[n]+e.slice(n.length)}function Kz(e){return{top:0,right:0,bottom:0,left:0,...e}}function lE(e){return typeof e!="number"?Kz(e):{top:e,right:e,bottom:e,left:e}}function Bf(e){const{x:n,y:r,width:i,height:s}=e;return{width:i,height:s,top:r,left:n,right:n+i,bottom:r+s,x:n,y:r}}function j_(e,n,r){let{reference:i,floating:s}=e;const l=fi(n),u=cx(n),d=ux(u),h=ra(n),p=l==="y",g=i.x+i.width/2-s.width/2,y=i.y+i.height/2-s.height/2,v=i[d]/2-s[d]/2;let x;switch(h){case"top":x={x:g,y:i.y-s.height};break;case"bottom":x={x:g,y:i.y+i.height};break;case"right":x={x:i.x+i.width,y};break;case"left":x={x:i.x-s.width,y};break;default:x={x:i.x,y:i.y}}switch(ul(n)){case"start":x[u]-=v*(r&&p?-1:1);break;case"end":x[u]+=v*(r&&p?-1:1);break}return x}async function Wz(e,n){var r;n===void 0&&(n={});const{x:i,y:s,platform:l,rects:u,elements:d,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:v=!1,padding:x=0}=na(n,e),_=lE(x),k=d[v?y==="floating"?"reference":"floating":y],j=Bf(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(k)))==null||r?k:k.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:g,strategy:h})),E=y==="floating"?{x:i,y:s,width:u.floating.width,height:u.floating.height}:u.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),M=await(l.isElement==null?void 0:l.isElement(N))?await(l.getScale==null?void 0:l.getScale(N))||{x:1,y:1}:{x:1,y:1},R=Bf(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:N,strategy:h}):E);return{top:(j.top-R.top+_.top)/M.y,bottom:(R.bottom-j.bottom+_.bottom)/M.y,left:(j.left-R.left+_.left)/M.x,right:(R.right-j.right+_.right)/M.x}}const Zz=50,Qz=async(e,n,r)=>{const{placement:i="bottom",strategy:s="absolute",middleware:l=[],platform:u}=r,d=u.detectOverflow?u:{...u,detectOverflow:Wz},h=await(u.isRTL==null?void 0:u.isRTL(n));let p=await u.getElementRects({reference:e,floating:n,strategy:s}),{x:g,y}=j_(p,i,h),v=i,x=0;const _={};for(let C=0;C<l.length;C++){const k=l[C];if(!k)continue;const{name:j,fn:E}=k,{x:N,y:M,data:R,reset:z}=await E({x:g,y,initialPlacement:i,placement:v,strategy:s,middlewareData:_,rects:p,platform:d,elements:{reference:e,floating:n}});g=N??g,y=M??y,_[j]={..._[j],...R},z&&x<Zz&&(x++,typeof z=="object"&&(z.placement&&(v=z.placement),z.rects&&(p=z.rects===!0?await u.getElementRects({reference:e,floating:n,strategy:s}):z.rects),{x:g,y}=j_(p,v,h)),C=-1)}return{x:g,y,placement:v,strategy:s,middlewareData:_}},Jz=e=>({name:"arrow",options:e,async fn(n){const{x:r,y:i,placement:s,rects:l,platform:u,elements:d,middlewareData:h}=n,{element:p,padding:g=0}=na(e,n)||{};if(p==null)return{};const y=lE(g),v={x:r,y:i},x=cx(s),_=ux(x),C=await u.getDimensions(p),k=x==="y",j=k?"top":"left",E=k?"bottom":"right",N=k?"clientHeight":"clientWidth",M=l.reference[_]+l.reference[x]-v[x]-l.floating[_],R=v[x]-l.reference[x],z=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let P=z?z[N]:0;(!P||!await(u.isElement==null?void 0:u.isElement(z)))&&(P=d.floating[N]||l.floating[_]);const D=M/2-R/2,$=P/2-C[_]/2-1,U=Ba(y[j],$),X=Ba(y[E],$),K=U,ae=P-C[_]-X,B=P/2-C[_]/2+D,Z=zy(K,B,ae),O=!h.arrow&&ul(s)!=null&&B!==Z&&l.reference[_]/2-(B<K?U:X)-C[_]/2<0,q=O?B<K?B-K:B-ae:0;return{[x]:v[x]+q,data:{[x]:Z,centerOffset:B-Z-q,...O&&{alignmentOffset:q}},reset:O}}}),e5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var r,i;const{placement:s,middlewareData:l,rects:u,initialPlacement:d,platform:h,elements:p}=n,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:C=!0,...k}=na(e,n);if((r=l.arrow)!=null&&r.alignmentOffset)return{};const j=ra(s),E=fi(d),N=ra(d)===d,M=await(h.isRTL==null?void 0:h.isRTL(p.floating)),R=v||(N||!C?[Uf(d)]:Hz(d)),z=_!=="none";!v&&z&&R.push(...Xz(d,C,_,M));const P=[d,...R],D=await h.detectOverflow(n,k),$=[];let U=((i=l.flip)==null?void 0:i.overflows)||[];if(g&&$.push(D[j]),y){const B=$z(s,u,M);$.push(D[B[0]],D[B[1]])}if(U=[...U,{placement:s,overflows:$}],!$.every(B=>B<=0)){var X,K;const B=(((X=l.flip)==null?void 0:X.index)||0)+1,Z=P[B];if(Z&&(!(y==="alignment"?E!==fi(Z):!1)||U.every(I=>fi(I.placement)===E?I.overflows[0]>0:!0)))return{data:{index:B,overflows:U},reset:{placement:Z}};let O=(K=U.filter(q=>q.overflows[0]<=0).sort((q,I)=>q.overflows[1]-I.overflows[1])[0])==null?void 0:K.placement;if(!O)switch(x){case"bestFit":{var ae;const q=(ae=U.filter(I=>{if(z){const H=fi(I.placement);return H===E||H==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(H=>H>0).reduce((H,A)=>H+A,0)]).sort((I,H)=>I[1]-H[1])[0])==null?void 0:ae[0];q&&(O=q);break}case"initialPlacement":O=d;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function k_(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function E_(e){return Uz.some(n=>e[n]>=0)}const t5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:r,platform:i}=n,{strategy:s="referenceHidden",...l}=na(e,n);switch(s){case"referenceHidden":{const u=await i.detectOverflow(n,{...l,elementContext:"reference"}),d=k_(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:E_(d)}}}case"escaped":{const u=await i.detectOverflow(n,{...l,altBoundary:!0}),d=k_(u,r.floating);return{data:{escapedOffsets:d,escaped:E_(d)}}}default:return{}}}}},uE=new Set(["left","top"]);async function n5(e,n){const{placement:r,platform:i,elements:s}=e,l=await(i.isRTL==null?void 0:i.isRTL(s.floating)),u=ra(r),d=ul(r),h=fi(r)==="y",p=uE.has(u)?-1:1,g=l&&h?-1:1,y=na(n,e);let{mainAxis:v,crossAxis:x,alignmentAxis:_}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return d&&typeof _=="number"&&(x=d==="end"?_*-1:_),h?{x:x*g,y:v*p}:{x:v*p,y:x*g}}const r5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,i;const{x:s,y:l,placement:u,middlewareData:d}=n,h=await n5(n,e);return u===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:s+h.x,y:l+h.y,data:{...h,placement:u}}}}},i5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:i,placement:s,platform:l}=n,{mainAxis:u=!0,crossAxis:d=!1,limiter:h={fn:j=>{let{x:E,y:N}=j;return{x:E,y:N}}},...p}=na(e,n),g={x:r,y:i},y=await l.detectOverflow(n,p),v=fi(ra(s)),x=lx(v);let _=g[x],C=g[v];if(u){const j=x==="y"?"top":"left",E=x==="y"?"bottom":"right",N=_+y[j],M=_-y[E];_=zy(N,_,M)}if(d){const j=v==="y"?"top":"left",E=v==="y"?"bottom":"right",N=C+y[j],M=C-y[E];C=zy(N,C,M)}const k=h.fn({...n,[x]:_,[v]:C});return{...k,data:{x:k.x-r,y:k.y-i,enabled:{[x]:u,[v]:d}}}}}},a5=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:r,y:i,placement:s,rects:l,middlewareData:u}=n,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=na(e,n),g={x:r,y:i},y=fi(s),v=lx(y);let x=g[v],_=g[y];const C=na(d,n),k=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const N=v==="y"?"height":"width",M=l.reference[v]-l.floating[N]+k.mainAxis,R=l.reference[v]+l.reference[N]-k.mainAxis;x<M?x=M:x>R&&(x=R)}if(p){var j,E;const N=v==="y"?"width":"height",M=uE.has(ra(s)),R=l.reference[y]-l.floating[N]+(M&&((j=u.offset)==null?void 0:j[y])||0)+(M?0:k.crossAxis),z=l.reference[y]+l.reference[N]+(M?0:((E=u.offset)==null?void 0:E[y])||0)-(M?k.crossAxis:0);_<R?_=R:_>z&&(_=z)}return{[v]:x,[y]:_}}}},s5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var r,i;const{placement:s,rects:l,platform:u,elements:d}=n,{apply:h=()=>{},...p}=na(e,n),g=await u.detectOverflow(n,p),y=ra(s),v=ul(s),x=fi(s)==="y",{width:_,height:C}=l.floating;let k,j;y==="top"||y==="bottom"?(k=y,j=v===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(j=y,k=v==="end"?"top":"bottom");const E=C-g.top-g.bottom,N=_-g.left-g.right,M=Ba(C-g[k],E),R=Ba(_-g[j],N),z=!n.middlewareData.shift;let P=M,D=R;if((r=n.middlewareData.shift)!=null&&r.enabled.x&&(D=N),(i=n.middlewareData.shift)!=null&&i.enabled.y&&(P=E),z&&!v){const U=ur(g.left,0),X=ur(g.right,0),K=ur(g.top,0),ae=ur(g.bottom,0);x?D=_-2*(U!==0||X!==0?U+X:ur(g.left,g.right)):P=C-2*(K!==0||ae!==0?K+ae:ur(g.top,g.bottom))}await h({...n,availableWidth:D,availableHeight:P});const $=await u.getDimensions(d.floating);return _!==$.width||C!==$.height?{reset:{rects:!0}}:{}}}};function Ah(){return typeof window<"u"}function cl(e){return cE(e)?(e.nodeName||"").toLowerCase():"#document"}function dr(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function wi(e){var n;return(n=(cE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function cE(e){return Ah()?e instanceof Node||e instanceof dr(e).Node:!1}function Zr(e){return Ah()?e instanceof Element||e instanceof dr(e).Element:!1}function sa(e){return Ah()?e instanceof HTMLElement||e instanceof dr(e).HTMLElement:!1}function N_(e){return!Ah()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dr(e).ShadowRoot}function xc(e){const{overflow:n,overflowX:r,overflowY:i,display:s}=Qr(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&s!=="inline"&&s!=="contents"}function o5(e){return/^(table|td|th)$/.test(cl(e))}function Rh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const l5=/transform|translate|scale|rotate|perspective|filter/,u5=/paint|layout|strict|content/,ys=e=>!!e&&e!=="none";let Og;function dx(e){const n=Zr(e)?Qr(e):e;return ys(n.transform)||ys(n.translate)||ys(n.scale)||ys(n.rotate)||ys(n.perspective)||!fx()&&(ys(n.backdropFilter)||ys(n.filter))||l5.test(n.willChange||"")||u5.test(n.contain||"")}function c5(e){let n=$a(e);for(;sa(n)&&!Jo(n);){if(dx(n))return n;if(Rh(n))return null;n=$a(n)}return null}function fx(){return Og==null&&(Og=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Og}function Jo(e){return/^(html|body|#document)$/.test(cl(e))}function Qr(e){return dr(e).getComputedStyle(e)}function Mh(e){return Zr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $a(e){if(cl(e)==="html")return e;const n=e.assignedSlot||e.parentNode||N_(e)&&e.host||wi(e);return N_(n)?n.host:n}function dE(e){const n=$a(e);return Jo(n)?e.ownerDocument?e.ownerDocument.body:e.body:sa(n)&&xc(n)?n:dE(n)}function Qu(e,n,r){var i;n===void 0&&(n=[]),r===void 0&&(r=!0);const s=dE(e),l=s===((i=e.ownerDocument)==null?void 0:i.body),u=dr(s);if(l){const d=Ly(u);return n.concat(u,u.visualViewport||[],xc(s)?s:[],d&&r?Qu(d):[])}else return n.concat(s,Qu(s,[],r))}function Ly(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fE(e){const n=Qr(e);let r=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const s=sa(e),l=s?e.offsetWidth:r,u=s?e.offsetHeight:i,d=Ff(r)!==l||Ff(i)!==u;return d&&(r=l,i=u),{width:r,height:i,$:d}}function hx(e){return Zr(e)?e:e.contextElement}function qo(e){const n=hx(e);if(!sa(n))return pi(1);const r=n.getBoundingClientRect(),{width:i,height:s,$:l}=fE(n);let u=(l?Ff(r.width):r.width)/i,d=(l?Ff(r.height):r.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const d5=pi(0);function hE(e){const n=dr(e);return!fx()||!n.visualViewport?d5:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function f5(e,n,r){return n===void 0&&(n=!1),!r||n&&r!==dr(e)?!1:n}function zs(e,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),l=hx(e);let u=pi(1);n&&(i?Zr(i)&&(u=qo(i)):u=qo(e));const d=f5(l,r,i)?hE(l):pi(0);let h=(s.left+d.x)/u.x,p=(s.top+d.y)/u.y,g=s.width/u.x,y=s.height/u.y;if(l){const v=dr(l),x=i&&Zr(i)?dr(i):i;let _=v,C=Ly(_);for(;C&&i&&x!==_;){const k=qo(C),j=C.getBoundingClientRect(),E=Qr(C),N=j.left+(C.clientLeft+parseFloat(E.paddingLeft))*k.x,M=j.top+(C.clientTop+parseFloat(E.paddingTop))*k.y;h*=k.x,p*=k.y,g*=k.x,y*=k.y,h+=N,p+=M,_=dr(C),C=Ly(_)}}return Bf({width:g,height:y,x:h,y:p})}function Dh(e,n){const r=Mh(e).scrollLeft;return n?n.left+r:zs(wi(e)).left+r}function pE(e,n){const r=e.getBoundingClientRect(),i=r.left+n.scrollLeft-Dh(e,r),s=r.top+n.scrollTop;return{x:i,y:s}}function h5(e){let{elements:n,rect:r,offsetParent:i,strategy:s}=e;const l=s==="fixed",u=wi(i),d=n?Rh(n.floating):!1;if(i===u||d&&l)return r;let h={scrollLeft:0,scrollTop:0},p=pi(1);const g=pi(0),y=sa(i);if((y||!y&&!l)&&((cl(i)!=="body"||xc(u))&&(h=Mh(i)),y)){const x=zs(i);p=qo(i),g.x=x.x+i.clientLeft,g.y=x.y+i.clientTop}const v=u&&!y&&!l?pE(u,h):pi(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-h.scrollLeft*p.x+g.x+v.x,y:r.y*p.y-h.scrollTop*p.y+g.y+v.y}}function p5(e){return Array.from(e.getClientRects())}function m5(e){const n=wi(e),r=Mh(e),i=e.ownerDocument.body,s=ur(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),l=ur(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let u=-r.scrollLeft+Dh(e);const d=-r.scrollTop;return Qr(i).direction==="rtl"&&(u+=ur(n.clientWidth,i.clientWidth)-s),{width:s,height:l,x:u,y:d}}const T_=25;function g5(e,n){const r=dr(e),i=wi(e),s=r.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,h=0;if(s){l=s.width,u=s.height;const g=fx();(!g||g&&n==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}const p=Dh(i);if(p<=0){const g=i.ownerDocument,y=g.body,v=getComputedStyle(y),x=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,_=Math.abs(i.clientWidth-y.clientWidth-x);_<=T_&&(l-=_)}else p<=T_&&(l+=p);return{width:l,height:u,x:d,y:h}}function y5(e,n){const r=zs(e,!0,n==="fixed"),i=r.top+e.clientTop,s=r.left+e.clientLeft,l=sa(e)?qo(e):pi(1),u=e.clientWidth*l.x,d=e.clientHeight*l.y,h=s*l.x,p=i*l.y;return{width:u,height:d,x:h,y:p}}function A_(e,n,r){let i;if(n==="viewport")i=g5(e,r);else if(n==="document")i=m5(wi(e));else if(Zr(n))i=y5(n,r);else{const s=hE(e);i={x:n.x-s.x,y:n.y-s.y,width:n.width,height:n.height}}return Bf(i)}function mE(e,n){const r=$a(e);return r===n||!Zr(r)||Jo(r)?!1:Qr(r).position==="fixed"||mE(r,n)}function v5(e,n){const r=n.get(e);if(r)return r;let i=Qu(e,[],!1).filter(d=>Zr(d)&&cl(d)!=="body"),s=null;const l=Qr(e).position==="fixed";let u=l?$a(e):e;for(;Zr(u)&&!Jo(u);){const d=Qr(u),h=dx(u);!h&&d.position==="fixed"&&(s=null),(l?!h&&!s:!h&&d.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||xc(u)&&!h&&mE(e,u))?i=i.filter(g=>g!==u):s=d,u=$a(u)}return n.set(e,i),i}function x5(e){let{element:n,boundary:r,rootBoundary:i,strategy:s}=e;const u=[...r==="clippingAncestors"?Rh(n)?[]:v5(n,this._c):[].concat(r),i],d=A_(n,u[0],s);let h=d.top,p=d.right,g=d.bottom,y=d.left;for(let v=1;v<u.length;v++){const x=A_(n,u[v],s);h=ur(x.top,h),p=Ba(x.right,p),g=Ba(x.bottom,g),y=ur(x.left,y)}return{width:p-y,height:g-h,x:y,y:h}}function b5(e){const{width:n,height:r}=fE(e);return{width:n,height:r}}function w5(e,n,r){const i=sa(n),s=wi(n),l=r==="fixed",u=zs(e,!0,l,n);let d={scrollLeft:0,scrollTop:0};const h=pi(0);function p(){h.x=Dh(s)}if(i||!i&&!l)if((cl(n)!=="body"||xc(s))&&(d=Mh(n)),i){const x=zs(n,!0,l,n);h.x=x.x+n.clientLeft,h.y=x.y+n.clientTop}else s&&p();l&&!i&&s&&p();const g=s&&!i&&!l?pE(s,d):pi(0),y=u.left+d.scrollLeft-h.x-g.x,v=u.top+d.scrollTop-h.y-g.y;return{x:y,y:v,width:u.width,height:u.height}}function zg(e){return Qr(e).position==="static"}function R_(e,n){if(!sa(e)||Qr(e).position==="fixed")return null;if(n)return n(e);let r=e.offsetParent;return wi(e)===r&&(r=r.ownerDocument.body),r}function gE(e,n){const r=dr(e);if(Rh(e))return r;if(!sa(e)){let s=$a(e);for(;s&&!Jo(s);){if(Zr(s)&&!zg(s))return s;s=$a(s)}return r}let i=R_(e,n);for(;i&&o5(i)&&zg(i);)i=R_(i,n);return i&&Jo(i)&&zg(i)&&!dx(i)?r:i||c5(e)||r}const S5=async function(e){const n=this.getOffsetParent||gE,r=this.getDimensions,i=await r(e.floating);return{reference:w5(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function _5(e){return Qr(e).direction==="rtl"}const C5={convertOffsetParentRelativeRectToViewportRelativeRect:h5,getDocumentElement:wi,getClippingRect:x5,getOffsetParent:gE,getElementRects:S5,getClientRects:p5,getDimensions:b5,getScale:qo,isElement:Zr,isRTL:_5};function yE(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function j5(e,n){let r=null,i;const s=wi(e);function l(){var d;clearTimeout(i),(d=r)==null||d.disconnect(),r=null}function u(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),l();const p=e.getBoundingClientRect(),{left:g,top:y,width:v,height:x}=p;if(d||n(),!v||!x)return;const _=tf(y),C=tf(s.clientWidth-(g+v)),k=tf(s.clientHeight-(y+x)),j=tf(g),N={rootMargin:-_+"px "+-C+"px "+-k+"px "+-j+"px",threshold:ur(0,Ba(1,h))||1};let M=!0;function R(z){const P=z[0].intersectionRatio;if(P!==h){if(!M)return u();P?u(!1,P):i=setTimeout(()=>{u(!1,1e-7)},1e3)}P===1&&!yE(p,e.getBoundingClientRect())&&u(),M=!1}try{r=new IntersectionObserver(R,{...N,root:s.ownerDocument})}catch{r=new IntersectionObserver(R,N)}r.observe(e)}return u(!0),l}function k5(e,n,r,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,p=hx(e),g=s||l?[...p?Qu(p):[],...n?Qu(n):[]]:[];g.forEach(j=>{s&&j.addEventListener("scroll",r,{passive:!0}),l&&j.addEventListener("resize",r)});const y=p&&d?j5(p,r):null;let v=-1,x=null;u&&(x=new ResizeObserver(j=>{let[E]=j;E&&E.target===p&&x&&n&&(x.unobserve(n),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(n)})),r()}),p&&!h&&x.observe(p),n&&x.observe(n));let _,C=h?zs(e):null;h&&k();function k(){const j=zs(e);C&&!yE(C,j)&&r(),C=j,_=requestAnimationFrame(k)}return r(),()=>{var j;g.forEach(E=>{s&&E.removeEventListener("scroll",r),l&&E.removeEventListener("resize",r)}),y?.(),(j=x)==null||j.disconnect(),x=null,h&&cancelAnimationFrame(_)}}const E5=r5,N5=i5,T5=e5,A5=s5,R5=t5,M_=Jz,M5=a5,D5=(e,n,r)=>{const i=new Map,s={platform:C5,...r},l={...s.platform,_c:i};return Qz(e,n,{...s,platform:l})};var O5=typeof document<"u",z5=function(){},Tf=O5?S.useLayoutEffect:z5;function $f(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let r,i,s;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==n.length)return!1;for(i=r;i--!==0;)if(!$f(e[i],n[i]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){const l=s[i];if(!(l==="_owner"&&e.$$typeof)&&!$f(e[l],n[l]))return!1}return!0}return e!==e&&n!==n}function vE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function D_(e,n){const r=vE(e);return Math.round(n*r)/r}function Pg(e){const n=S.useRef(e);return Tf(()=>{n.current=e}),n}function P5(e){e===void 0&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:s,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:h,open:p}=e,[g,y]=S.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[v,x]=S.useState(i);$f(v,i)||x(i);const[_,C]=S.useState(null),[k,j]=S.useState(null),E=S.useCallback(I=>{I!==z.current&&(z.current=I,C(I))},[]),N=S.useCallback(I=>{I!==P.current&&(P.current=I,j(I))},[]),M=l||_,R=u||k,z=S.useRef(null),P=S.useRef(null),D=S.useRef(g),$=h!=null,U=Pg(h),X=Pg(s),K=Pg(p),ae=S.useCallback(()=>{if(!z.current||!P.current)return;const I={placement:n,strategy:r,middleware:v};X.current&&(I.platform=X.current),D5(z.current,P.current,I).then(H=>{const A={...H,isPositioned:K.current!==!1};B.current&&!$f(D.current,A)&&(D.current=A,gc.flushSync(()=>{y(A)}))})},[v,n,r,X,K]);Tf(()=>{p===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,y(I=>({...I,isPositioned:!1})))},[p]);const B=S.useRef(!1);Tf(()=>(B.current=!0,()=>{B.current=!1}),[]),Tf(()=>{if(M&&(z.current=M),R&&(P.current=R),M&&R){if(U.current)return U.current(M,R,ae);ae()}},[M,R,ae,U,$]);const Z=S.useMemo(()=>({reference:z,floating:P,setReference:E,setFloating:N}),[E,N]),O=S.useMemo(()=>({reference:M,floating:R}),[M,R]),q=S.useMemo(()=>{const I={position:r,left:0,top:0};if(!O.floating)return I;const H=D_(O.floating,g.x),A=D_(O.floating,g.y);return d?{...I,transform:"translate("+H+"px, "+A+"px)",...vE(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:H,top:A}},[r,d,O.floating,g.x,g.y]);return S.useMemo(()=>({...g,update:ae,refs:Z,elements:O,floatingStyles:q}),[g,ae,Z,O,q])}const L5=e=>{function n(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:s}=typeof e=="function"?e(r):e;return i&&n(i)?i.current!=null?M_({element:i.current,padding:s}).fn(r):{}:i?M_({element:i,padding:s}).fn(r):{}}}},I5=(e,n)=>{const r=E5(e);return{name:r.name,fn:r.fn,options:[e,n]}},V5=(e,n)=>{const r=N5(e);return{name:r.name,fn:r.fn,options:[e,n]}},F5=(e,n)=>({fn:M5(e).fn,options:[e,n]}),U5=(e,n)=>{const r=T5(e);return{name:r.name,fn:r.fn,options:[e,n]}},B5=(e,n)=>{const r=A5(e);return{name:r.name,fn:r.fn,options:[e,n]}},$5=(e,n)=>{const r=R5(e);return{name:r.name,fn:r.fn,options:[e,n]}},H5=(e,n)=>{const r=L5(e);return{name:r.name,fn:r.fn,options:[e,n]}};var G5="Arrow",xE=S.forwardRef((e,n)=>{const{children:r,width:i=10,height:s=5,...l}=e;return f.jsx(Xe.svg,{...l,ref:n,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});xE.displayName=G5;var q5=xE,px="Popper",[bE,dl]=bi(px),[Y5,wE]=bE(px),SE=e=>{const{__scopePopper:n,children:r}=e,[i,s]=S.useState(null);return f.jsx(Y5,{scope:n,anchor:i,onAnchorChange:s,children:r})};SE.displayName=px;var _E="PopperAnchor",CE=S.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:i,...s}=e,l=wE(_E,r),u=S.useRef(null),d=bt(n,u),h=S.useRef(null);return S.useEffect(()=>{const p=h.current;h.current=i?.current||u.current,p!==h.current&&l.onAnchorChange(h.current)}),i?null:f.jsx(Xe.div,{...s,ref:d})});CE.displayName=_E;var mx="PopperContent",[X5,K5]=bE(mx),jE=S.forwardRef((e,n)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:l="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:v=!1,updatePositionStrategy:x="optimized",onPlaced:_,...C}=e,k=wE(mx,r),[j,E]=S.useState(null),N=bt(n,Q=>E(Q)),[M,R]=S.useState(null),z=Fz(M),P=z?.width??0,D=z?.height??0,$=i+(l!=="center"?"-"+l:""),U=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},X=Array.isArray(p)?p:[p],K=X.length>0,ae={padding:U,boundary:X.filter(Z5),altBoundary:K},{refs:B,floatingStyles:Z,placement:O,isPositioned:q,middlewareData:I}=P5({strategy:"fixed",placement:$,whileElementsMounted:(...Q)=>k5(...Q,{animationFrame:x==="always"}),elements:{reference:k.anchor},middleware:[I5({mainAxis:s+D,alignmentAxis:u}),h&&V5({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?F5():void 0,...ae}),h&&U5({...ae}),B5({...ae,apply:({elements:Q,rects:re,availableWidth:fe,availableHeight:we})=>{const{width:ke,height:Ie}=re.reference,et=Q.floating.style;et.setProperty("--radix-popper-available-width",`${fe}px`),et.setProperty("--radix-popper-available-height",`${we}px`),et.setProperty("--radix-popper-anchor-width",`${ke}px`),et.setProperty("--radix-popper-anchor-height",`${Ie}px`)}}),M&&H5({element:M,padding:d}),Q5({arrowWidth:P,arrowHeight:D}),v&&$5({strategy:"referenceHidden",...ae})]}),[H,A]=NE(O),F=Wr(_);pn(()=>{q&&F?.()},[q,F]);const G=I.arrow?.x,L=I.arrow?.y,ee=I.arrow?.centerOffset!==0,[ce,Y]=S.useState();return pn(()=>{j&&Y(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:q?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(X5,{scope:r,placedSide:H,onArrowChange:R,arrowX:G,arrowY:L,shouldHideArrow:ee,children:f.jsx(Xe.div,{"data-side":H,"data-align":A,...C,ref:N,style:{...C.style,animation:q?void 0:"none"}})})})});jE.displayName=mx;var kE="PopperArrow",W5={top:"bottom",right:"left",bottom:"top",left:"right"},EE=S.forwardRef(function(n,r){const{__scopePopper:i,...s}=n,l=K5(kE,i),u=W5[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(q5,{...s,ref:r,style:{...s.style,display:"block"}})})});EE.displayName=kE;function Z5(e){return e!==null}var Q5=e=>({name:"transformOrigin",options:e,fn(n){const{placement:r,rects:i,middlewareData:s}=n,u=s.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[p,g]=NE(r),y={start:"0%",center:"50%",end:"100%"}[g],v=(s.arrow?.x??0)+d/2,x=(s.arrow?.y??0)+h/2;let _="",C="";return p==="bottom"?(_=u?y:`${v}px`,C=`${-h}px`):p==="top"?(_=u?y:`${v}px`,C=`${i.floating.height+h}px`):p==="right"?(_=`${-h}px`,C=u?y:`${x}px`):p==="left"&&(_=`${i.floating.width+h}px`,C=u?y:`${x}px`),{data:{x:_,y:C}}}});function NE(e){const[n,r="center"]=e.split("-");return[n,r]}var gx=SE,yx=CE,vx=jE,xx=EE,Lg="rovingFocusGroup.onEntryFocus",J5={bubbles:!1,cancelable:!0},bc="RovingFocusGroup",[Iy,TE,eP]=tx(bc),[tP,Oh]=bi(bc,[eP]),[nP,rP]=tP(bc),AE=S.forwardRef((e,n)=>f.jsx(Iy.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Iy.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(iP,{...e,ref:n})})}));AE.displayName=bc;var iP=S.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:s=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...y}=e,v=S.useRef(null),x=bt(n,v),_=jh(l),[C,k]=Ds({prop:u,defaultProp:d??null,onChange:h,caller:bc}),[j,E]=S.useState(!1),N=Wr(p),M=TE(r),R=S.useRef(!1),[z,P]=S.useState(0);return S.useEffect(()=>{const D=v.current;if(D)return D.addEventListener(Lg,N),()=>D.removeEventListener(Lg,N)},[N]),f.jsx(nP,{scope:r,orientation:i,dir:_,loop:s,currentTabStopId:C,onItemFocus:S.useCallback(D=>k(D),[k]),onItemShiftTab:S.useCallback(()=>E(!0),[]),onFocusableItemAdd:S.useCallback(()=>P(D=>D+1),[]),onFocusableItemRemove:S.useCallback(()=>P(D=>D-1),[]),children:f.jsx(Xe.div,{tabIndex:j||z===0?-1:0,"data-orientation":i,...y,ref:x,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{R.current=!0}),onFocus:Ae(e.onFocus,D=>{const $=!R.current;if(D.target===D.currentTarget&&$&&!j){const U=new CustomEvent(Lg,J5);if(D.currentTarget.dispatchEvent(U),!U.defaultPrevented){const X=M().filter(O=>O.focusable),K=X.find(O=>O.active),ae=X.find(O=>O.id===C),Z=[K,ae,...X].filter(Boolean).map(O=>O.ref.current);DE(Z,g)}}R.current=!1}),onBlur:Ae(e.onBlur,()=>E(!1))})})}),RE="RovingFocusGroupItem",ME=S.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:s=!1,tabStopId:l,children:u,...d}=e,h=Xr(),p=l||h,g=rP(RE,r),y=g.currentTabStopId===p,v=TE(r),{onFocusableItemAdd:x,onFocusableItemRemove:_,currentTabStopId:C}=g;return S.useEffect(()=>{if(i)return x(),()=>_()},[i,x,_]),f.jsx(Iy.ItemSlot,{scope:r,id:p,focusable:i,active:s,children:f.jsx(Xe.span,{tabIndex:y?0:-1,"data-orientation":g.orientation,...d,ref:n,onMouseDown:Ae(e.onMouseDown,k=>{i?g.onItemFocus(p):k.preventDefault()}),onFocus:Ae(e.onFocus,()=>g.onItemFocus(p)),onKeyDown:Ae(e.onKeyDown,k=>{if(k.key==="Tab"&&k.shiftKey){g.onItemShiftTab();return}if(k.target!==k.currentTarget)return;const j=oP(k,g.orientation,g.dir);if(j!==void 0){if(k.metaKey||k.ctrlKey||k.altKey||k.shiftKey)return;k.preventDefault();let N=v().filter(M=>M.focusable).map(M=>M.ref.current);if(j==="last")N.reverse();else if(j==="prev"||j==="next"){j==="prev"&&N.reverse();const M=N.indexOf(k.currentTarget);N=g.loop?lP(N,M+1):N.slice(M+1)}setTimeout(()=>DE(N))}}),children:typeof u=="function"?u({isCurrentTabStop:y,hasTabStop:C!=null}):u})})});ME.displayName=RE;var aP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sP(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function oP(e,n,r){const i=sP(e.key,r);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return aP[i]}function DE(e,n=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:n}),document.activeElement!==r))return}function lP(e,n){return e.map((r,i)=>e[(n+i)%e.length])}var OE=AE,zE=ME,Vy=["Enter"," "],uP=["ArrowDown","PageUp","Home"],PE=["ArrowUp","PageDown","End"],cP=[...uP,...PE],dP={ltr:[...Vy,"ArrowRight"],rtl:[...Vy,"ArrowLeft"]},fP={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wc="Menu",[Ju,hP,pP]=tx(wc),[Fs,LE]=bi(wc,[pP,dl,Oh]),zh=dl(),IE=Oh(),[mP,Us]=Fs(wc),[gP,Sc]=Fs(wc),VE=e=>{const{__scopeMenu:n,open:r=!1,children:i,dir:s,onOpenChange:l,modal:u=!0}=e,d=zh(n),[h,p]=S.useState(null),g=S.useRef(!1),y=Wr(l),v=jh(s);return S.useEffect(()=>{const x=()=>{g.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>g.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),f.jsx(gx,{...d,children:f.jsx(mP,{scope:n,open:r,onOpenChange:y,content:h,onContentChange:p,children:f.jsx(gP,{scope:n,onClose:S.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:g,dir:v,modal:u,children:i})})})};VE.displayName=wc;var yP="MenuAnchor",bx=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e,s=zh(r);return f.jsx(yx,{...s,...i,ref:n})});bx.displayName=yP;var wx="MenuPortal",[vP,FE]=Fs(wx,{forceMount:void 0}),UE=e=>{const{__scopeMenu:n,forceMount:r,children:i,container:s}=e,l=Us(wx,n);return f.jsx(vP,{scope:n,forceMount:r,children:f.jsx(Jr,{present:r||l.open,children:f.jsx(vc,{asChild:!0,container:s,children:i})})})};UE.displayName=wx;var Pr="MenuContent",[xP,Sx]=Fs(Pr),BE=S.forwardRef((e,n)=>{const r=FE(Pr,e.__scopeMenu),{forceMount:i=r.forceMount,...s}=e,l=Us(Pr,e.__scopeMenu),u=Sc(Pr,e.__scopeMenu);return f.jsx(Ju.Provider,{scope:e.__scopeMenu,children:f.jsx(Jr,{present:i||l.open,children:f.jsx(Ju.Slot,{scope:e.__scopeMenu,children:u.modal?f.jsx(bP,{...s,ref:n}):f.jsx(wP,{...s,ref:n})})})})}),bP=S.forwardRef((e,n)=>{const r=Us(Pr,e.__scopeMenu),i=S.useRef(null),s=bt(n,i);return S.useEffect(()=>{const l=i.current;if(l)return rx(l)},[]),f.jsx(_x,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),wP=S.forwardRef((e,n)=>{const r=Us(Pr,e.__scopeMenu);return f.jsx(_x,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),SP=Ms("MenuContent.ScrollLock"),_x=S.forwardRef((e,n)=>{const{__scopeMenu:r,loop:i=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:x,disableOutsideScroll:_,...C}=e,k=Us(Pr,r),j=Sc(Pr,r),E=zh(r),N=IE(r),M=hP(r),[R,z]=S.useState(null),P=S.useRef(null),D=bt(n,P,k.onContentChange),$=S.useRef(0),U=S.useRef(""),X=S.useRef(0),K=S.useRef(null),ae=S.useRef("right"),B=S.useRef(0),Z=_?Nh:S.Fragment,O=_?{as:SP,allowPinchZoom:!0}:void 0,q=H=>{const A=U.current+H,F=M().filter(Q=>!Q.disabled),G=document.activeElement,L=F.find(Q=>Q.ref.current===G)?.textValue,ee=F.map(Q=>Q.textValue),ce=OP(ee,A,L),Y=F.find(Q=>Q.textValue===ce)?.ref.current;(function Q(re){U.current=re,window.clearTimeout($.current),re!==""&&($.current=window.setTimeout(()=>Q(""),1e3))})(A),Y&&setTimeout(()=>Y.focus())};S.useEffect(()=>()=>window.clearTimeout($.current),[]),nx();const I=S.useCallback(H=>ae.current===K.current?.side&&PP(H,K.current?.area),[]);return f.jsx(xP,{scope:r,searchRef:U,onItemEnter:S.useCallback(H=>{I(H)&&H.preventDefault()},[I]),onItemLeave:S.useCallback(H=>{I(H)||(P.current?.focus(),z(null))},[I]),onTriggerLeave:S.useCallback(H=>{I(H)&&H.preventDefault()},[I]),pointerGraceTimerRef:X,onPointerGraceIntentChange:S.useCallback(H=>{K.current=H},[]),children:f.jsx(Z,{...O,children:f.jsx(kh,{asChild:!0,trapped:s,onMountAutoFocus:Ae(l,H=>{H.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:f.jsx(yc,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:x,children:f.jsx(OE,{asChild:!0,...N,dir:j.dir,orientation:"vertical",loop:i,currentTabStopId:R,onCurrentTabStopIdChange:z,onEntryFocus:Ae(h,H=>{j.isUsingKeyboardRef.current||H.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(vx,{role:"menu","aria-orientation":"vertical","data-state":iN(k.open),"data-radix-menu-content":"",dir:j.dir,...E,...C,ref:D,style:{outline:"none",...C.style},onKeyDown:Ae(C.onKeyDown,H=>{const F=H.target.closest("[data-radix-menu-content]")===H.currentTarget,G=H.ctrlKey||H.altKey||H.metaKey,L=H.key.length===1;F&&(H.key==="Tab"&&H.preventDefault(),!G&&L&&q(H.key));const ee=P.current;if(H.target!==ee||!cP.includes(H.key))return;H.preventDefault();const Y=M().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);PE.includes(H.key)&&Y.reverse(),MP(Y)}),onBlur:Ae(e.onBlur,H=>{H.currentTarget.contains(H.target)||(window.clearTimeout($.current),U.current="")}),onPointerMove:Ae(e.onPointerMove,ec(H=>{const A=H.target,F=B.current!==H.clientX;if(H.currentTarget.contains(A)&&F){const G=H.clientX>B.current?"right":"left";ae.current=G,B.current=H.clientX}}))})})})})})})});BE.displayName=Pr;var _P="MenuGroup",Cx=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Xe.div,{role:"group",...i,ref:n})});Cx.displayName=_P;var CP="MenuLabel",$E=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Xe.div,{...i,ref:n})});$E.displayName=CP;var Hf="MenuItem",O_="menu.itemSelect",Ph=S.forwardRef((e,n)=>{const{disabled:r=!1,onSelect:i,...s}=e,l=S.useRef(null),u=Sc(Hf,e.__scopeMenu),d=Sx(Hf,e.__scopeMenu),h=bt(n,l),p=S.useRef(!1),g=()=>{const y=l.current;if(!r&&y){const v=new CustomEvent(O_,{bubbles:!0,cancelable:!0});y.addEventListener(O_,x=>i?.(x),{once:!0}),Ek(y,v),v.defaultPrevented?p.current=!1:u.onClose()}};return f.jsx(HE,{...s,ref:h,disabled:r,onClick:Ae(e.onClick,g),onPointerDown:y=>{e.onPointerDown?.(y),p.current=!0},onPointerUp:Ae(e.onPointerUp,y=>{p.current||y.currentTarget?.click()}),onKeyDown:Ae(e.onKeyDown,y=>{const v=d.searchRef.current!=="";r||v&&y.key===" "||Vy.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});Ph.displayName=Hf;var HE=S.forwardRef((e,n)=>{const{__scopeMenu:r,disabled:i=!1,textValue:s,...l}=e,u=Sx(Hf,r),d=IE(r),h=S.useRef(null),p=bt(n,h),[g,y]=S.useState(!1),[v,x]=S.useState("");return S.useEffect(()=>{const _=h.current;_&&x((_.textContent??"").trim())},[l.children]),f.jsx(Ju.ItemSlot,{scope:r,disabled:i,textValue:s??v,children:f.jsx(zE,{asChild:!0,...d,focusable:!i,children:f.jsx(Xe.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:p,onPointerMove:Ae(e.onPointerMove,ec(_=>{i?u.onItemLeave(_):(u.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,ec(_=>u.onItemLeave(_))),onFocus:Ae(e.onFocus,()=>y(!0)),onBlur:Ae(e.onBlur,()=>y(!1))})})})}),jP="MenuCheckboxItem",GE=S.forwardRef((e,n)=>{const{checked:r=!1,onCheckedChange:i,...s}=e;return f.jsx(WE,{scope:e.__scopeMenu,checked:r,children:f.jsx(Ph,{role:"menuitemcheckbox","aria-checked":Gf(r)?"mixed":r,...s,ref:n,"data-state":kx(r),onSelect:Ae(s.onSelect,()=>i?.(Gf(r)?!0:!r),{checkForDefaultPrevented:!1})})})});GE.displayName=jP;var qE="MenuRadioGroup",[kP,EP]=Fs(qE,{value:void 0,onValueChange:()=>{}}),YE=S.forwardRef((e,n)=>{const{value:r,onValueChange:i,...s}=e,l=Wr(i);return f.jsx(kP,{scope:e.__scopeMenu,value:r,onValueChange:l,children:f.jsx(Cx,{...s,ref:n})})});YE.displayName=qE;var XE="MenuRadioItem",KE=S.forwardRef((e,n)=>{const{value:r,...i}=e,s=EP(XE,e.__scopeMenu),l=r===s.value;return f.jsx(WE,{scope:e.__scopeMenu,checked:l,children:f.jsx(Ph,{role:"menuitemradio","aria-checked":l,...i,ref:n,"data-state":kx(l),onSelect:Ae(i.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});KE.displayName=XE;var jx="MenuItemIndicator",[WE,NP]=Fs(jx,{checked:!1}),ZE=S.forwardRef((e,n)=>{const{__scopeMenu:r,forceMount:i,...s}=e,l=NP(jx,r);return f.jsx(Jr,{present:i||Gf(l.checked)||l.checked===!0,children:f.jsx(Xe.span,{...s,ref:n,"data-state":kx(l.checked)})})});ZE.displayName=jx;var TP="MenuSeparator",QE=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...i,ref:n})});QE.displayName=TP;var AP="MenuArrow",JE=S.forwardRef((e,n)=>{const{__scopeMenu:r,...i}=e,s=zh(r);return f.jsx(xx,{...s,...i,ref:n})});JE.displayName=AP;var RP="MenuSub",[Cne,eN]=Fs(RP),Nu="MenuSubTrigger",tN=S.forwardRef((e,n)=>{const r=Us(Nu,e.__scopeMenu),i=Sc(Nu,e.__scopeMenu),s=eN(Nu,e.__scopeMenu),l=Sx(Nu,e.__scopeMenu),u=S.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:h}=l,p={__scopeMenu:e.__scopeMenu},g=S.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return S.useEffect(()=>g,[g]),S.useEffect(()=>{const y=d.current;return()=>{window.clearTimeout(y),h(null)}},[d,h]),f.jsx(bx,{asChild:!0,...p,children:f.jsx(HE,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":iN(r.open),...e,ref:_h(n,s.onTriggerChange),onClick:y=>{e.onClick?.(y),!(e.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,ec(y=>{l.onItemEnter(y),!y.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:Ae(e.onPointerLeave,ec(y=>{g();const v=r.content?.getBoundingClientRect();if(v){const x=r.content?.dataset.side,_=x==="right",C=_?-5:5,k=v[_?"left":"right"],j=v[_?"right":"left"];l.onPointerGraceIntentChange({area:[{x:y.clientX+C,y:y.clientY},{x:k,y:v.top},{x:j,y:v.top},{x:j,y:v.bottom},{x:k,y:v.bottom}],side:x}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(y),y.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,y=>{const v=l.searchRef.current!=="";e.disabled||v&&y.key===" "||dP[i.dir].includes(y.key)&&(r.onOpenChange(!0),r.content?.focus(),y.preventDefault())})})})});tN.displayName=Nu;var nN="MenuSubContent",rN=S.forwardRef((e,n)=>{const r=FE(Pr,e.__scopeMenu),{forceMount:i=r.forceMount,...s}=e,l=Us(Pr,e.__scopeMenu),u=Sc(Pr,e.__scopeMenu),d=eN(nN,e.__scopeMenu),h=S.useRef(null),p=bt(n,h);return f.jsx(Ju.Provider,{scope:e.__scopeMenu,children:f.jsx(Jr,{present:i||l.open,children:f.jsx(Ju.Slot,{scope:e.__scopeMenu,children:f.jsx(_x,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{u.isUsingKeyboardRef.current&&h.current?.focus(),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,g=>{g.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,g=>{u.onClose(),g.preventDefault()}),onKeyDown:Ae(e.onKeyDown,g=>{const y=g.currentTarget.contains(g.target),v=fP[u.dir].includes(g.key);y&&v&&(l.onOpenChange(!1),d.trigger?.focus(),g.preventDefault())})})})})})});rN.displayName=nN;function iN(e){return e?"open":"closed"}function Gf(e){return e==="indeterminate"}function kx(e){return Gf(e)?"indeterminate":e?"checked":"unchecked"}function MP(e){const n=document.activeElement;for(const r of e)if(r===n||(r.focus(),document.activeElement!==n))return}function DP(e,n){return e.map((r,i)=>e[(n+i)%e.length])}function OP(e,n,r){const s=n.length>1&&Array.from(n).every(p=>p===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let u=DP(e,Math.max(l,0));s.length===1&&(u=u.filter(p=>p!==r));const h=u.find(p=>p.toLowerCase().startsWith(s.toLowerCase()));return h!==r?h:void 0}function zP(e,n){const{x:r,y:i}=e;let s=!1;for(let l=0,u=n.length-1;l<n.length;u=l++){const d=n[l],h=n[u],p=d.x,g=d.y,y=h.x,v=h.y;g>i!=v>i&&r<(y-p)*(i-g)/(v-g)+p&&(s=!s)}return s}function PP(e,n){if(!n)return!1;const r={x:e.clientX,y:e.clientY};return zP(r,n)}function ec(e){return n=>n.pointerType==="mouse"?e(n):void 0}var LP=VE,IP=bx,VP=UE,FP=BE,UP=Cx,BP=$E,$P=Ph,HP=GE,GP=YE,qP=KE,YP=ZE,XP=QE,KP=JE,WP=tN,ZP=rN,Lh="DropdownMenu",[QP]=bi(Lh,[LE]),In=LE(),[JP,aN]=QP(Lh),sN=e=>{const{__scopeDropdownMenu:n,children:r,dir:i,open:s,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,h=In(n),p=S.useRef(null),[g,y]=Ds({prop:s,defaultProp:l??!1,onChange:u,caller:Lh});return f.jsx(JP,{scope:n,triggerId:Xr(),triggerRef:p,contentId:Xr(),open:g,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(v=>!v),[y]),modal:d,children:f.jsx(LP,{...h,open:g,onOpenChange:y,dir:i,modal:d,children:r})})};sN.displayName=Lh;var oN="DropdownMenuTrigger",lN=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,disabled:i=!1,...s}=e,l=aN(oN,r),u=In(r);return f.jsx(IP,{asChild:!0,...u,children:f.jsx(Xe.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...s,ref:_h(n,l.triggerRef),onPointerDown:Ae(e.onPointerDown,d=>{!i&&d.button===0&&d.ctrlKey===!1&&(l.onOpenToggle(),l.open||d.preventDefault())}),onKeyDown:Ae(e.onKeyDown,d=>{i||(["Enter"," "].includes(d.key)&&l.onOpenToggle(),d.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});lN.displayName=oN;var eL="DropdownMenuPortal",uN=e=>{const{__scopeDropdownMenu:n,...r}=e,i=In(n);return f.jsx(VP,{...i,...r})};uN.displayName=eL;var cN="DropdownMenuContent",dN=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=aN(cN,r),l=In(r),u=S.useRef(!1);return f.jsx(FP,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...i,ref:n,onCloseAutoFocus:Ae(e.onCloseAutoFocus,d=>{u.current||s.triggerRef.current?.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,d=>{const h=d.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,g=h.button===2||p;(!s.modal||g)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});dN.displayName=cN;var tL="DropdownMenuGroup",nL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(UP,{...s,...i,ref:n})});nL.displayName=tL;var rL="DropdownMenuLabel",iL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(BP,{...s,...i,ref:n})});iL.displayName=rL;var aL="DropdownMenuItem",fN=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx($P,{...s,...i,ref:n})});fN.displayName=aL;var sL="DropdownMenuCheckboxItem",oL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(HP,{...s,...i,ref:n})});oL.displayName=sL;var lL="DropdownMenuRadioGroup",uL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(GP,{...s,...i,ref:n})});uL.displayName=lL;var cL="DropdownMenuRadioItem",dL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(qP,{...s,...i,ref:n})});dL.displayName=cL;var fL="DropdownMenuItemIndicator",hL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(YP,{...s,...i,ref:n})});hL.displayName=fL;var pL="DropdownMenuSeparator",hN=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(XP,{...s,...i,ref:n})});hN.displayName=pL;var mL="DropdownMenuArrow",gL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(KP,{...s,...i,ref:n})});gL.displayName=mL;var yL="DropdownMenuSubTrigger",vL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(WP,{...s,...i,ref:n})});vL.displayName=yL;var xL="DropdownMenuSubContent",bL=S.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...i}=e,s=In(r);return f.jsx(ZP,{...s,...i,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bL.displayName=xL;var wL=sN,SL=lN,_L=uN,CL=dN,jL=fN,kL=hN,EL="Label",pN=S.forwardRef((e,n)=>f.jsx(Xe.label,{...e,ref:n,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));pN.displayName=EL;var NL=pN;function z_(e,[n,r]){return Math.min(r,Math.max(n,e))}var TL=[" ","Enter","ArrowUp","ArrowDown"],AL=[" ","Enter"],Ps="Select",[Ih,Vh,RL]=tx(Ps),[fl]=bi(Ps,[RL,dl]),Fh=dl(),[ML,Ya]=fl(Ps),[DL,OL]=fl(Ps),mN=e=>{const{__scopeSelect:n,children:r,open:i,defaultOpen:s,onOpenChange:l,value:u,defaultValue:d,onValueChange:h,dir:p,name:g,autoComplete:y,disabled:v,required:x,form:_}=e,C=Fh(n),[k,j]=S.useState(null),[E,N]=S.useState(null),[M,R]=S.useState(!1),z=jh(p),[P,D]=Ds({prop:i,defaultProp:s??!1,onChange:l,caller:Ps}),[$,U]=Ds({prop:u,defaultProp:d,onChange:h,caller:Ps}),X=S.useRef(null),K=k?_||!!k.closest("form"):!0,[ae,B]=S.useState(new Set),Z=Array.from(ae).map(O=>O.props.value).join(";");return f.jsx(gx,{...C,children:f.jsxs(ML,{required:x,scope:n,trigger:k,onTriggerChange:j,valueNode:E,onValueNodeChange:N,valueNodeHasChildren:M,onValueNodeHasChildrenChange:R,contentId:Xr(),value:$,onValueChange:U,open:P,onOpenChange:D,dir:z,triggerPointerDownPosRef:X,disabled:v,children:[f.jsx(Ih.Provider,{scope:n,children:f.jsx(DL,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(O=>{B(q=>new Set(q).add(O))},[]),onNativeOptionRemove:S.useCallback(O=>{B(q=>{const I=new Set(q);return I.delete(O),I})},[]),children:r})}),K?f.jsxs(LN,{"aria-hidden":!0,required:x,tabIndex:-1,name:g,autoComplete:y,value:$,onChange:O=>U(O.target.value),disabled:v,form:_,children:[$===void 0?f.jsx("option",{value:""}):null,Array.from(ae)]},Z):null]})})};mN.displayName=Ps;var gN="SelectTrigger",yN=S.forwardRef((e,n)=>{const{__scopeSelect:r,disabled:i=!1,...s}=e,l=Fh(r),u=Ya(gN,r),d=u.disabled||i,h=bt(n,u.onTriggerChange),p=Vh(r),g=S.useRef("touch"),[y,v,x]=VN(C=>{const k=p().filter(N=>!N.disabled),j=k.find(N=>N.value===u.value),E=FN(k,C,j);E!==void 0&&u.onValueChange(E.value)}),_=C=>{d||(u.onOpenChange(!0),x()),C&&(u.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return f.jsx(yx,{asChild:!0,...l,children:f.jsx(Xe.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":IN(u.value)?"":void 0,...s,ref:h,onClick:Ae(s.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&_(C)}),onPointerDown:Ae(s.onPointerDown,C=>{g.current=C.pointerType;const k=C.target;k.hasPointerCapture(C.pointerId)&&k.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(_(C),C.preventDefault())}),onKeyDown:Ae(s.onKeyDown,C=>{const k=y.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&v(C.key),!(k&&C.key===" ")&&TL.includes(C.key)&&(_(),C.preventDefault())})})})});yN.displayName=gN;var vN="SelectValue",xN=S.forwardRef((e,n)=>{const{__scopeSelect:r,className:i,style:s,children:l,placeholder:u="",...d}=e,h=Ya(vN,r),{onValueNodeHasChildrenChange:p}=h,g=l!==void 0,y=bt(n,h.onValueNodeChange);return pn(()=>{p(g)},[p,g]),f.jsx(Xe.span,{...d,ref:y,style:{pointerEvents:"none"},children:IN(h.value)?f.jsx(f.Fragment,{children:u}):l})});xN.displayName=vN;var zL="SelectIcon",bN=S.forwardRef((e,n)=>{const{__scopeSelect:r,children:i,...s}=e;return f.jsx(Xe.span,{"aria-hidden":!0,...s,ref:n,children:i||"▼"})});bN.displayName=zL;var PL="SelectPortal",wN=e=>f.jsx(vc,{asChild:!0,...e});wN.displayName=PL;var Ls="SelectContent",SN=S.forwardRef((e,n)=>{const r=Ya(Ls,e.__scopeSelect),[i,s]=S.useState();if(pn(()=>{s(new DocumentFragment)},[]),!r.open){const l=i;return l?gc.createPortal(f.jsx(_N,{scope:e.__scopeSelect,children:f.jsx(Ih.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),l):null}return f.jsx(CN,{...e,ref:n})});SN.displayName=Ls;var Ur=10,[_N,Xa]=fl(Ls),LL="SelectContentImpl",IL=Ms("SelectContent.RemoveScroll"),CN=S.forwardRef((e,n)=>{const{__scopeSelect:r,position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:u,side:d,sideOffset:h,align:p,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:x,sticky:_,hideWhenDetached:C,avoidCollisions:k,...j}=e,E=Ya(Ls,r),[N,M]=S.useState(null),[R,z]=S.useState(null),P=bt(n,Q=>M(Q)),[D,$]=S.useState(null),[U,X]=S.useState(null),K=Vh(r),[ae,B]=S.useState(!1),Z=S.useRef(!1);S.useEffect(()=>{if(N)return rx(N)},[N]),nx();const O=S.useCallback(Q=>{const[re,...fe]=K().map(Ie=>Ie.ref.current),[we]=fe.slice(-1),ke=document.activeElement;for(const Ie of Q)if(Ie===ke||(Ie?.scrollIntoView({block:"nearest"}),Ie===re&&R&&(R.scrollTop=0),Ie===we&&R&&(R.scrollTop=R.scrollHeight),Ie?.focus(),document.activeElement!==ke))return},[K,R]),q=S.useCallback(()=>O([D,N]),[O,D,N]);S.useEffect(()=>{ae&&q()},[ae,q]);const{onOpenChange:I,triggerPointerDownPosRef:H}=E;S.useEffect(()=>{if(N){let Q={x:0,y:0};const re=we=>{Q={x:Math.abs(Math.round(we.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(we.pageY)-(H.current?.y??0))}},fe=we=>{Q.x<=10&&Q.y<=10?we.preventDefault():N.contains(we.target)||I(!1),document.removeEventListener("pointermove",re),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",fe,{capture:!0})}}},[N,I,H]),S.useEffect(()=>{const Q=()=>I(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[I]);const[A,F]=VN(Q=>{const re=K().filter(ke=>!ke.disabled),fe=re.find(ke=>ke.ref.current===document.activeElement),we=FN(re,Q,fe);we&&setTimeout(()=>we.ref.current.focus())}),G=S.useCallback((Q,re,fe)=>{const we=!Z.current&&!fe;(E.value!==void 0&&E.value===re||we)&&($(Q),we&&(Z.current=!0))},[E.value]),L=S.useCallback(()=>N?.focus(),[N]),ee=S.useCallback((Q,re,fe)=>{const we=!Z.current&&!fe;(E.value!==void 0&&E.value===re||we)&&X(Q)},[E.value]),ce=i==="popper"?Fy:jN,Y=ce===Fy?{side:d,sideOffset:h,align:p,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:x,sticky:_,hideWhenDetached:C,avoidCollisions:k}:{};return f.jsx(_N,{scope:r,content:N,viewport:R,onViewportChange:z,itemRefCallback:G,selectedItem:D,onItemLeave:L,itemTextRefCallback:ee,focusSelectedItem:q,selectedItemText:U,position:i,isPositioned:ae,searchRef:A,children:f.jsx(Nh,{as:IL,allowPinchZoom:!0,children:f.jsx(kh,{asChild:!0,trapped:E.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ae(s,Q=>{E.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:f.jsx(yc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:f.jsx(ce,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:Q=>Q.preventDefault(),...j,...Y,onPlaced:()=>B(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ae(j.onKeyDown,Q=>{const re=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!re&&Q.key.length===1&&F(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let we=K().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(we=we.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const ke=Q.target,Ie=we.indexOf(ke);we=we.slice(Ie+1)}setTimeout(()=>O(we)),Q.preventDefault()}})})})})})})});CN.displayName=LL;var VL="SelectItemAlignedPosition",jN=S.forwardRef((e,n)=>{const{__scopeSelect:r,onPlaced:i,...s}=e,l=Ya(Ls,r),u=Xa(Ls,r),[d,h]=S.useState(null),[p,g]=S.useState(null),y=bt(n,P=>g(P)),v=Vh(r),x=S.useRef(!1),_=S.useRef(!0),{viewport:C,selectedItem:k,selectedItemText:j,focusSelectedItem:E}=u,N=S.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&p&&C&&k&&j){const P=l.trigger.getBoundingClientRect(),D=p.getBoundingClientRect(),$=l.valueNode.getBoundingClientRect(),U=j.getBoundingClientRect();if(l.dir!=="rtl"){const ke=U.left-D.left,Ie=$.left-ke,et=P.left-Ie,lt=P.width+et,cn=Math.max(lt,D.width),yt=window.innerWidth-Ur,me=z_(Ie,[Ur,Math.max(Ur,yt-cn)]);d.style.minWidth=lt+"px",d.style.left=me+"px"}else{const ke=D.right-U.right,Ie=window.innerWidth-$.right-ke,et=window.innerWidth-P.right-Ie,lt=P.width+et,cn=Math.max(lt,D.width),yt=window.innerWidth-Ur,me=z_(Ie,[Ur,Math.max(Ur,yt-cn)]);d.style.minWidth=lt+"px",d.style.right=me+"px"}const X=v(),K=window.innerHeight-Ur*2,ae=C.scrollHeight,B=window.getComputedStyle(p),Z=parseInt(B.borderTopWidth,10),O=parseInt(B.paddingTop,10),q=parseInt(B.borderBottomWidth,10),I=parseInt(B.paddingBottom,10),H=Z+O+ae+I+q,A=Math.min(k.offsetHeight*5,H),F=window.getComputedStyle(C),G=parseInt(F.paddingTop,10),L=parseInt(F.paddingBottom,10),ee=P.top+P.height/2-Ur,ce=K-ee,Y=k.offsetHeight/2,Q=k.offsetTop+Y,re=Z+O+Q,fe=H-re;if(re<=ee){const ke=X.length>0&&k===X[X.length-1].ref.current;d.style.bottom="0px";const Ie=p.clientHeight-C.offsetTop-C.offsetHeight,et=Math.max(ce,Y+(ke?L:0)+Ie+q),lt=re+et;d.style.height=lt+"px"}else{const ke=X.length>0&&k===X[0].ref.current;d.style.top="0px";const et=Math.max(ee,Z+C.offsetTop+(ke?G:0)+Y)+fe;d.style.height=et+"px",C.scrollTop=re-ee+C.offsetTop}d.style.margin=`${Ur}px 0`,d.style.minHeight=A+"px",d.style.maxHeight=K+"px",i?.(),requestAnimationFrame(()=>x.current=!0)}},[v,l.trigger,l.valueNode,d,p,C,k,j,l.dir,i]);pn(()=>N(),[N]);const[M,R]=S.useState();pn(()=>{p&&R(window.getComputedStyle(p).zIndex)},[p]);const z=S.useCallback(P=>{P&&_.current===!0&&(N(),E?.(),_.current=!1)},[N,E]);return f.jsx(UL,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:x,onScrollButtonChange:z,children:f.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:f.jsx(Xe.div,{...s,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});jN.displayName=VL;var FL="SelectPopperPosition",Fy=S.forwardRef((e,n)=>{const{__scopeSelect:r,align:i="start",collisionPadding:s=Ur,...l}=e,u=Fh(r);return f.jsx(vx,{...u,...l,ref:n,align:i,collisionPadding:s,style:{boxSizing:"border-box",...l.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)"}})});Fy.displayName=FL;var[UL,Ex]=fl(Ls,{}),Uy="SelectViewport",kN=S.forwardRef((e,n)=>{const{__scopeSelect:r,nonce:i,...s}=e,l=Xa(Uy,r),u=Ex(Uy,r),d=bt(n,l.onViewportChange),h=S.useRef(0);return f.jsxs(f.Fragment,{children:[f.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:i}),f.jsx(Ih.Slot,{scope:r,children:f.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ae(s.onScroll,p=>{const g=p.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:v}=u;if(v?.current&&y){const x=Math.abs(h.current-g.scrollTop);if(x>0){const _=window.innerHeight-Ur*2,C=parseFloat(y.style.minHeight),k=parseFloat(y.style.height),j=Math.max(C,k);if(j<_){const E=j+x,N=Math.min(_,E),M=E-N;y.style.height=N+"px",y.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,y.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})});kN.displayName=Uy;var EN="SelectGroup",[BL,$L]=fl(EN),HL=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,s=Xr();return f.jsx(BL,{scope:r,id:s,children:f.jsx(Xe.div,{role:"group","aria-labelledby":s,...i,ref:n})})});HL.displayName=EN;var NN="SelectLabel",GL=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,s=$L(NN,r);return f.jsx(Xe.div,{id:s.id,...i,ref:n})});GL.displayName=NN;var qf="SelectItem",[qL,TN]=fl(qf),AN=S.forwardRef((e,n)=>{const{__scopeSelect:r,value:i,disabled:s=!1,textValue:l,...u}=e,d=Ya(qf,r),h=Xa(qf,r),p=d.value===i,[g,y]=S.useState(l??""),[v,x]=S.useState(!1),_=bt(n,E=>h.itemRefCallback?.(E,i,s)),C=Xr(),k=S.useRef("touch"),j=()=>{s||(d.onValueChange(i),d.onOpenChange(!1))};if(i==="")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 f.jsx(qL,{scope:r,value:i,disabled:s,textId:C,isSelected:p,onItemTextChange:S.useCallback(E=>{y(N=>N||(E?.textContent??"").trim())},[]),children:f.jsx(Ih.ItemSlot,{scope:r,value:i,disabled:s,textValue:g,children:f.jsx(Xe.div,{role:"option","aria-labelledby":C,"data-highlighted":v?"":void 0,"aria-selected":p&&v,"data-state":p?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...u,ref:_,onFocus:Ae(u.onFocus,()=>x(!0)),onBlur:Ae(u.onBlur,()=>x(!1)),onClick:Ae(u.onClick,()=>{k.current!=="mouse"&&j()}),onPointerUp:Ae(u.onPointerUp,()=>{k.current==="mouse"&&j()}),onPointerDown:Ae(u.onPointerDown,E=>{k.current=E.pointerType}),onPointerMove:Ae(u.onPointerMove,E=>{k.current=E.pointerType,s?h.onItemLeave?.():k.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(u.onPointerLeave,E=>{E.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:Ae(u.onKeyDown,E=>{h.searchRef?.current!==""&&E.key===" "||(AL.includes(E.key)&&j(),E.key===" "&&E.preventDefault())})})})})});AN.displayName=qf;var Tu="SelectItemText",RN=S.forwardRef((e,n)=>{const{__scopeSelect:r,className:i,style:s,...l}=e,u=Ya(Tu,r),d=Xa(Tu,r),h=TN(Tu,r),p=OL(Tu,r),[g,y]=S.useState(null),v=bt(n,j=>y(j),h.onItemTextChange,j=>d.itemTextRefCallback?.(j,h.value,h.disabled)),x=g?.textContent,_=S.useMemo(()=>f.jsx("option",{value:h.value,disabled:h.disabled,children:x},h.value),[h.disabled,h.value,x]),{onNativeOptionAdd:C,onNativeOptionRemove:k}=p;return pn(()=>(C(_),()=>k(_)),[C,k,_]),f.jsxs(f.Fragment,{children:[f.jsx(Xe.span,{id:h.textId,...l,ref:v}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren?gc.createPortal(l.children,u.valueNode):null]})});RN.displayName=Tu;var MN="SelectItemIndicator",DN=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e;return TN(MN,r).isSelected?f.jsx(Xe.span,{"aria-hidden":!0,...i,ref:n}):null});DN.displayName=MN;var By="SelectScrollUpButton",ON=S.forwardRef((e,n)=>{const r=Xa(By,e.__scopeSelect),i=Ex(By,e.__scopeSelect),[s,l]=S.useState(!1),u=bt(n,i.onScrollButtonChange);return pn(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=h.scrollTop>0;l(p)};const h=r.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),s?f.jsx(PN,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=r;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});ON.displayName=By;var $y="SelectScrollDownButton",zN=S.forwardRef((e,n)=>{const r=Xa($y,e.__scopeSelect),i=Ex($y,e.__scopeSelect),[s,l]=S.useState(!1),u=bt(n,i.onScrollButtonChange);return pn(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=h.scrollHeight-h.clientHeight,g=Math.ceil(h.scrollTop)<p;l(g)};const h=r.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),s?f.jsx(PN,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=r;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});zN.displayName=$y;var PN=S.forwardRef((e,n)=>{const{__scopeSelect:r,onAutoScroll:i,...s}=e,l=Xa("SelectScrollButton",r),u=S.useRef(null),d=Vh(r),h=S.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return S.useEffect(()=>()=>h(),[h]),pn(()=>{d().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),f.jsx(Xe.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Ae(s.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(i,50))}),onPointerMove:Ae(s.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(i,50))}),onPointerLeave:Ae(s.onPointerLeave,()=>{h()})})}),YL="SelectSeparator",XL=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e;return f.jsx(Xe.div,{"aria-hidden":!0,...i,ref:n})});XL.displayName=YL;var Hy="SelectArrow",KL=S.forwardRef((e,n)=>{const{__scopeSelect:r,...i}=e,s=Fh(r),l=Ya(Hy,r),u=Xa(Hy,r);return l.open&&u.position==="popper"?f.jsx(xx,{...s,...i,ref:n}):null});KL.displayName=Hy;var WL="SelectBubbleInput",LN=S.forwardRef(({__scopeSelect:e,value:n,...r},i)=>{const s=S.useRef(null),l=bt(i,s),u=Vz(n);return S.useEffect(()=>{const d=s.current;if(!d)return;const h=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(h,"value").set;if(u!==n&&g){const y=new Event("change",{bubbles:!0});g.call(d,n),d.dispatchEvent(y)}},[u,n]),f.jsx(Xe.select,{...r,style:{...Nk,...r.style},ref:l,defaultValue:n})});LN.displayName=WL;function IN(e){return e===""||e===void 0}function VN(e){const n=Wr(e),r=S.useRef(""),i=S.useRef(0),s=S.useCallback(u=>{const d=r.current+u;n(d),(function h(p){r.current=p,window.clearTimeout(i.current),p!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(d)},[n]),l=S.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,s,l]}function FN(e,n,r){const s=n.length>1&&Array.from(n).every(p=>p===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let u=ZL(e,Math.max(l,0));s.length===1&&(u=u.filter(p=>p!==r));const h=u.find(p=>p.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==r?h:void 0}function ZL(e,n){return e.map((r,i)=>e[(n+i)%e.length])}var QL=mN,JL=yN,e6=xN,t6=bN,n6=wN,r6=SN,i6=kN,a6=AN,s6=RN,o6=DN,l6=ON,u6=zN,c6="Separator",P_="horizontal",d6=["horizontal","vertical"],UN=S.forwardRef((e,n)=>{const{decorative:r,orientation:i=P_,...s}=e,l=f6(i)?i:P_,d=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return f.jsx(Xe.div,{"data-orientation":l,...d,...s,ref:n})});UN.displayName=c6;function f6(e){return d6.includes(e)}var h6=UN,Uh="Tabs",[p6]=bi(Uh,[Oh]),BN=Oh(),[m6,Nx]=p6(Uh),$N=S.forwardRef((e,n)=>{const{__scopeTabs:r,value:i,onValueChange:s,defaultValue:l,orientation:u="horizontal",dir:d,activationMode:h="automatic",...p}=e,g=jh(d),[y,v]=Ds({prop:i,onChange:s,defaultProp:l??"",caller:Uh});return f.jsx(m6,{scope:r,baseId:Xr(),value:y,onValueChange:v,orientation:u,dir:g,activationMode:h,children:f.jsx(Xe.div,{dir:g,"data-orientation":u,...p,ref:n})})});$N.displayName=Uh;var HN="TabsList",GN=S.forwardRef((e,n)=>{const{__scopeTabs:r,loop:i=!0,...s}=e,l=Nx(HN,r),u=BN(r);return f.jsx(OE,{asChild:!0,...u,orientation:l.orientation,dir:l.dir,loop:i,children:f.jsx(Xe.div,{role:"tablist","aria-orientation":l.orientation,...s,ref:n})})});GN.displayName=HN;var qN="TabsTrigger",YN=S.forwardRef((e,n)=>{const{__scopeTabs:r,value:i,disabled:s=!1,...l}=e,u=Nx(qN,r),d=BN(r),h=WN(u.baseId,i),p=ZN(u.baseId,i),g=i===u.value;return f.jsx(zE,{asChild:!0,...d,focusable:!s,active:g,children:f.jsx(Xe.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":p,"data-state":g?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:h,...l,ref:n,onMouseDown:Ae(e.onMouseDown,y=>{!s&&y.button===0&&y.ctrlKey===!1?u.onValueChange(i):y.preventDefault()}),onKeyDown:Ae(e.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&u.onValueChange(i)}),onFocus:Ae(e.onFocus,()=>{const y=u.activationMode!=="manual";!g&&!s&&y&&u.onValueChange(i)})})})});YN.displayName=qN;var XN="TabsContent",KN=S.forwardRef((e,n)=>{const{__scopeTabs:r,value:i,forceMount:s,children:l,...u}=e,d=Nx(XN,r),h=WN(d.baseId,i),p=ZN(d.baseId,i),g=i===d.value,y=S.useRef(g);return S.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),f.jsx(Jr,{present:s||g,children:({present:v})=>f.jsx(Xe.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":h,hidden:!v,id:p,tabIndex:0,...u,ref:n,style:{...e.style,animationDuration:y.current?"0s":void 0},children:v&&l})})});KN.displayName=XN;function WN(e,n){return`${e}-trigger-${n}`}function ZN(e,n){return`${e}-content-${n}`}var g6=$N,y6=GN,v6=YN,x6=KN,[Bh]=bi("Tooltip",[dl]),$h=dl(),QN="TooltipProvider",b6=700,Gy="tooltip.open",[w6,Tx]=Bh(QN),JN=e=>{const{__scopeTooltip:n,delayDuration:r=b6,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:l}=e,u=S.useRef(!0),d=S.useRef(!1),h=S.useRef(0);return S.useEffect(()=>{const p=h.current;return()=>window.clearTimeout(p)},[]),f.jsx(w6,{scope:n,isOpenDelayedRef:u,delayDuration:r,onOpen:S.useCallback(()=>{window.clearTimeout(h.current),u.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>u.current=!0,i)},[i]),isPointerInTransitRef:d,onPointerInTransitChange:S.useCallback(p=>{d.current=p},[]),disableHoverableContent:s,children:l})};JN.displayName=QN;var tc="Tooltip",[S6,_c]=Bh(tc),eT=e=>{const{__scopeTooltip:n,children:r,open:i,defaultOpen:s,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=e,h=Tx(tc,e.__scopeTooltip),p=$h(n),[g,y]=S.useState(null),v=Xr(),x=S.useRef(0),_=u??h.disableHoverableContent,C=d??h.delayDuration,k=S.useRef(!1),[j,E]=Ds({prop:i,defaultProp:s??!1,onChange:P=>{P?(h.onOpen(),document.dispatchEvent(new CustomEvent(Gy))):h.onClose(),l?.(P)},caller:tc}),N=S.useMemo(()=>j?k.current?"delayed-open":"instant-open":"closed",[j]),M=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,k.current=!1,E(!0)},[E]),R=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,E(!1)},[E]),z=S.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{k.current=!0,E(!0),x.current=0},C)},[C,E]);return S.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),f.jsx(gx,{...p,children:f.jsx(S6,{scope:n,contentId:v,open:j,stateAttribute:N,trigger:g,onTriggerChange:y,onTriggerEnter:S.useCallback(()=>{h.isOpenDelayedRef.current?z():M()},[h.isOpenDelayedRef,z,M]),onTriggerLeave:S.useCallback(()=>{_?R():(window.clearTimeout(x.current),x.current=0)},[R,_]),onOpen:M,onClose:R,disableHoverableContent:_,children:r})})};eT.displayName=tc;var qy="TooltipTrigger",tT=S.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,s=_c(qy,r),l=Tx(qy,r),u=$h(r),d=S.useRef(null),h=bt(n,d,s.onTriggerChange),p=S.useRef(!1),g=S.useRef(!1),y=S.useCallback(()=>p.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),f.jsx(yx,{asChild:!0,...u,children:f.jsx(Xe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:h,onPointerMove:Ae(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{s.open&&s.onClose(),p.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:Ae(e.onFocus,()=>{p.current||s.onOpen()}),onBlur:Ae(e.onBlur,s.onClose),onClick:Ae(e.onClick,s.onClose)})})});tT.displayName=qy;var Ax="TooltipPortal",[_6,C6]=Bh(Ax,{forceMount:void 0}),nT=e=>{const{__scopeTooltip:n,forceMount:r,children:i,container:s}=e,l=_c(Ax,n);return f.jsx(_6,{scope:n,forceMount:r,children:f.jsx(Jr,{present:r||l.open,children:f.jsx(vc,{asChild:!0,container:s,children:i})})})};nT.displayName=Ax;var el="TooltipContent",rT=S.forwardRef((e,n)=>{const r=C6(el,e.__scopeTooltip),{forceMount:i=r.forceMount,side:s="top",...l}=e,u=_c(el,e.__scopeTooltip);return f.jsx(Jr,{present:i||u.open,children:u.disableHoverableContent?f.jsx(iT,{side:s,...l,ref:n}):f.jsx(j6,{side:s,...l,ref:n})})}),j6=S.forwardRef((e,n)=>{const r=_c(el,e.__scopeTooltip),i=Tx(el,e.__scopeTooltip),s=S.useRef(null),l=bt(n,s),[u,d]=S.useState(null),{trigger:h,onClose:p}=r,g=s.current,{onPointerInTransitChange:y}=i,v=S.useCallback(()=>{d(null),y(!1)},[y]),x=S.useCallback((_,C)=>{const k=_.currentTarget,j={x:_.clientX,y:_.clientY},E=T6(j,k.getBoundingClientRect()),N=A6(j,E),M=R6(C.getBoundingClientRect()),R=D6([...N,...M]);d(R),y(!0)},[y]);return S.useEffect(()=>()=>v(),[v]),S.useEffect(()=>{if(h&&g){const _=k=>x(k,g),C=k=>x(k,h);return h.addEventListener("pointerleave",_),g.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",_),g.removeEventListener("pointerleave",C)}}},[h,g,x,v]),S.useEffect(()=>{if(u){const _=C=>{const k=C.target,j={x:C.clientX,y:C.clientY},E=h?.contains(k)||g?.contains(k),N=!M6(j,u);E?v():N&&(v(),p())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[h,g,u,p,v]),f.jsx(iT,{...e,ref:l})}),[k6,E6]=Bh(tc,{isInside:!1}),N6=q4("TooltipContent"),iT=S.forwardRef((e,n)=>{const{__scopeTooltip:r,children:i,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,h=_c(el,r),p=$h(r),{onClose:g}=h;return S.useEffect(()=>(document.addEventListener(Gy,g),()=>document.removeEventListener(Gy,g)),[g]),S.useEffect(()=>{if(h.trigger){const y=v=>{v.target?.contains(h.trigger)&&g()};return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[h.trigger,g]),f.jsx(yc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:y=>y.preventDefault(),onDismiss:g,children:f.jsxs(vx,{"data-state":h.stateAttribute,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(N6,{children:i}),f.jsx(k6,{scope:r,isInside:!0,children:f.jsx(Q4,{id:h.contentId,role:"tooltip",children:s||i})})]})})});rT.displayName=el;var aT="TooltipArrow",sT=S.forwardRef((e,n)=>{const{__scopeTooltip:r,...i}=e,s=$h(r);return E6(aT,r).isInside?null:f.jsx(xx,{...s,...i,ref:n})});sT.displayName=aT;function T6(e,n){const r=Math.abs(n.top-e.y),i=Math.abs(n.bottom-e.y),s=Math.abs(n.right-e.x),l=Math.abs(n.left-e.x);switch(Math.min(r,i,s,l)){case l:return"left";case s:return"right";case r:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function A6(e,n,r=5){const i=[];switch(n){case"top":i.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":i.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":i.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":i.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return i}function R6(e){const{top:n,right:r,bottom:i,left:s}=e;return[{x:s,y:n},{x:r,y:n},{x:r,y:i},{x:s,y:i}]}function M6(e,n){const{x:r,y:i}=e;let s=!1;for(let l=0,u=n.length-1;l<n.length;u=l++){const d=n[l],h=n[u],p=d.x,g=d.y,y=h.x,v=h.y;g>i!=v>i&&r<(y-p)*(i-g)/(v-g)+p&&(s=!s)}return s}function D6(e){const n=e.slice();return n.sort((r,i)=>r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0),O6(n)}function O6(e){if(e.length<=1)return e.slice();const n=[];for(let i=0;i<e.length;i++){const s=e[i];for(;n.length>=2;){const l=n[n.length-1],u=n[n.length-2];if((l.x-u.x)*(s.y-u.y)>=(l.y-u.y)*(s.x-u.x))n.pop();else break}n.push(s)}n.pop();const r=[];for(let i=e.length-1;i>=0;i--){const s=e[i];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(s.y-u.y)>=(l.y-u.y)*(s.x-u.x))r.pop();else break}r.push(s)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var z6=JN,P6=eT,L6=tT,I6=nT,V6=rT,F6=sT;const Ig=768;function U6(){const[e,n]=S.useState(void 0);return S.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Ig-1}px)`),i=()=>{n(window.innerWidth<Ig)};return r.addEventListener("change",i),n(window.innerWidth<Ig),()=>r.removeEventListener("change",i)},[]),!!e}const B6=(e,n)=>{const r=new Array(e.length+n.length);for(let i=0;i<e.length;i++)r[i]=e[i];for(let i=0;i<n.length;i++)r[e.length+i]=n[i];return r},$6=(e,n)=>({classGroupId:e,validator:n}),oT=(e=new Map,n=null,r)=>({nextPart:e,validators:n,classGroupId:r}),Yf="-",L_=[],H6="arbitrary..",G6=e=>{const n=Y6(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return q6(u);const d=u.split(Yf),h=d[0]===""&&d.length>1?1:0;return lT(d,h,n)},getConflictingClassGroupIds:(u,d)=>{if(d){const h=i[u],p=r[u];return h?p?B6(p,h):h:p||L_}return r[u]||L_}}},lT=(e,n,r)=>{if(e.length-n===0)return r.classGroupId;const s=e[n],l=r.nextPart.get(s);if(l){const p=lT(e,n+1,l);if(p)return p}const u=r.validators;if(u===null)return;const d=n===0?e.join(Yf):e.slice(n).join(Yf),h=u.length;for(let p=0;p<h;p++){const g=u[p];if(g.validator(d))return g.classGroupId}},q6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),r=n.indexOf(":"),i=n.slice(0,r);return i?H6+i:void 0})(),Y6=e=>{const{theme:n,classGroups:r}=e;return X6(r,n)},X6=(e,n)=>{const r=oT();for(const i in e){const s=e[i];Rx(s,r,i,n)}return r},Rx=(e,n,r,i)=>{const s=e.length;for(let l=0;l<s;l++){const u=e[l];K6(u,n,r,i)}},K6=(e,n,r,i)=>{if(typeof e=="string"){W6(e,n,r);return}if(typeof e=="function"){Z6(e,n,r,i);return}Q6(e,n,r,i)},W6=(e,n,r)=>{const i=e===""?n:uT(n,e);i.classGroupId=r},Z6=(e,n,r,i)=>{if(J6(e)){Rx(e(i),n,r,i);return}n.validators===null&&(n.validators=[]),n.validators.push($6(r,e))},Q6=(e,n,r,i)=>{const s=Object.entries(e),l=s.length;for(let u=0;u<l;u++){const[d,h]=s[u];Rx(h,uT(n,d),r,i)}},uT=(e,n)=>{let r=e;const i=n.split(Yf),s=i.length;for(let l=0;l<s;l++){const u=i[l];let d=r.nextPart.get(u);d||(d=oT(),r.nextPart.set(u,d)),r=d}return r},J6=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,eI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,r=Object.create(null),i=Object.create(null);const s=(l,u)=>{r[l]=u,n++,n>e&&(n=0,i=r,r=Object.create(null))};return{get(l){let u=r[l];if(u!==void 0)return u;if((u=i[l])!==void 0)return s(l,u),u},set(l,u){l in r?r[l]=u:s(l,u)}}},Yy="!",I_=":",tI=[],V_=(e,n,r,i,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:r,maybePostfixModifierPosition:i,isExternal:s}),nI=e=>{const{prefix:n,experimentalParseClassName:r}=e;let i=s=>{const l=[];let u=0,d=0,h=0,p;const g=s.length;for(let C=0;C<g;C++){const k=s[C];if(u===0&&d===0){if(k===I_){l.push(s.slice(h,C)),h=C+1;continue}if(k==="/"){p=C;continue}}k==="["?u++:k==="]"?u--:k==="("?d++:k===")"&&d--}const y=l.length===0?s:s.slice(h);let v=y,x=!1;y.endsWith(Yy)?(v=y.slice(0,-1),x=!0):y.startsWith(Yy)&&(v=y.slice(1),x=!0);const _=p&&p>h?p-h:void 0;return V_(l,x,v,_)};if(n){const s=n+I_,l=i;i=u=>u.startsWith(s)?l(u.slice(s.length)):V_(tI,!1,u,void 0,!0)}if(r){const s=i;i=l=>r({className:l,parseClassName:s})}return i},rI=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{n.set(r,1e6+i)}),r=>{const i=[];let s=[];for(let l=0;l<r.length;l++){const u=r[l],d=u[0]==="[",h=n.has(u);d||h?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(u)):s.push(u)}return s.length>0&&(s.sort(),i.push(...s)),i}},iI=e=>({cache:eI(e.cacheSize),parseClassName:nI(e),sortModifiers:rI(e),...G6(e)}),aI=/\s+/,sI=(e,n)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:l}=n,u=[],d=e.trim().split(aI);let h="";for(let p=d.length-1;p>=0;p-=1){const g=d[p],{isExternal:y,modifiers:v,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:C}=r(g);if(y){h=g+(h.length>0?" "+h:h);continue}let k=!!C,j=i(k?_.substring(0,C):_);if(!j){if(!k){h=g+(h.length>0?" "+h:h);continue}if(j=i(_),!j){h=g+(h.length>0?" "+h:h);continue}k=!1}const E=v.length===0?"":v.length===1?v[0]:l(v).join(":"),N=x?E+Yy:E,M=N+j;if(u.indexOf(M)>-1)continue;u.push(M);const R=s(j,k);for(let z=0;z<R.length;++z){const P=R[z];u.push(N+P)}h=g+(h.length>0?" "+h:h)}return h},oI=(...e)=>{let n=0,r,i,s="";for(;n<e.length;)(r=e[n++])&&(i=cT(r))&&(s&&(s+=" "),s+=i);return s},cT=e=>{if(typeof e=="string")return e;let n,r="";for(let i=0;i<e.length;i++)e[i]&&(n=cT(e[i]))&&(r&&(r+=" "),r+=n);return r},lI=(e,...n)=>{let r,i,s,l;const u=h=>{const p=n.reduce((g,y)=>y(g),e());return r=iI(p),i=r.cache.get,s=r.cache.set,l=d,d(h)},d=h=>{const p=i(h);if(p)return p;const g=sI(h,r);return s(h,g),g};return l=u,(...h)=>l(oI(...h))},uI=[],hn=e=>{const n=r=>r[e]||uI;return n.isThemeGetter=!0,n},dT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,dI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fI=/\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$/,hI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ma=e=>cI.test(e),Je=e=>!!e&&!Number.isNaN(Number(e)),Da=e=>!!e&&Number.isInteger(Number(e)),Vg=e=>e.endsWith("%")&&Je(e.slice(0,-1)),$i=e=>dI.test(e),hT=()=>!0,gI=e=>fI.test(e)&&!hI.test(e),Mx=()=>!1,yI=e=>pI.test(e),vI=e=>mI.test(e),xI=e=>!Re(e)&&!Me(e),bI=e=>Ka(e,gT,Mx),Re=e=>dT.test(e),vs=e=>Ka(e,yT,gI),F_=e=>Ka(e,NI,Je),wI=e=>Ka(e,xT,hT),SI=e=>Ka(e,vT,Mx),U_=e=>Ka(e,pT,Mx),_I=e=>Ka(e,mT,vI),nf=e=>Ka(e,bT,yI),Me=e=>fT.test(e),du=e=>Bs(e,yT),CI=e=>Bs(e,vT),B_=e=>Bs(e,pT),jI=e=>Bs(e,gT),kI=e=>Bs(e,mT),rf=e=>Bs(e,bT,!0),EI=e=>Bs(e,xT,!0),Ka=(e,n,r)=>{const i=dT.exec(e);return i?i[1]?n(i[1]):r(i[2]):!1},Bs=(e,n,r=!1)=>{const i=fT.exec(e);return i?i[1]?n(i[1]):r:!1},pT=e=>e==="position"||e==="percentage",mT=e=>e==="image"||e==="url",gT=e=>e==="length"||e==="size"||e==="bg-size",yT=e=>e==="length",NI=e=>e==="number",vT=e=>e==="family-name",xT=e=>e==="number"||e==="weight",bT=e=>e==="shadow",TI=()=>{const e=hn("color"),n=hn("font"),r=hn("text"),i=hn("font-weight"),s=hn("tracking"),l=hn("leading"),u=hn("breakpoint"),d=hn("container"),h=hn("spacing"),p=hn("radius"),g=hn("shadow"),y=hn("inset-shadow"),v=hn("text-shadow"),x=hn("drop-shadow"),_=hn("blur"),C=hn("perspective"),k=hn("aspect"),j=hn("ease"),E=hn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...M(),Me,Re],z=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],D=()=>[Me,Re,h],$=()=>[Ma,"full","auto",...D()],U=()=>[Da,"none","subgrid",Me,Re],X=()=>["auto",{span:["full",Da,Me,Re]},Da,Me,Re],K=()=>[Da,"auto",Me,Re],ae=()=>["auto","min","max","fr",Me,Re],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...D()],q=()=>[Ma,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],I=()=>[Ma,"screen","full","dvw","lvw","svw","min","max","fit",...D()],H=()=>[Ma,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],A=()=>[e,Me,Re],F=()=>[...M(),B_,U_,{position:[Me,Re]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",jI,bI,{size:[Me,Re]}],ee=()=>[Vg,du,vs],ce=()=>["","none","full",p,Me,Re],Y=()=>["",Je,du,vs],Q=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Je,Vg,B_,U_],we=()=>["","none",_,Me,Re],ke=()=>["none",Je,Me,Re],Ie=()=>["none",Je,Me,Re],et=()=>[Je,Me,Re],lt=()=>[Ma,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$i],breakpoint:[$i],color:[hT],container:[$i],"drop-shadow":[$i],ease:["in","out","in-out"],font:[xI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$i],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$i],shadow:[$i],spacing:["px",Je],text:[$i],"text-shadow":[$i],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ma,Re,Me,k]}],container:["container"],columns:[{columns:[Je,Re,Me,d]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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"],sr:["sr-only","not-sr-only"],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:R()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Da,"auto",Me,Re]}],basis:[{basis:[Ma,"full","auto",d,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Je,Ma,"auto","initial","none",Re]}],grow:[{grow:["",Je,Me,Re]}],shrink:[{shrink:["",Je,Me,Re]}],order:[{order:[Da,"first","last","none",Me,Re]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[d,"screen",...q()]}],"min-w":[{"min-w":[d,"screen","none",...q()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",r,du,vs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,EI,wI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vg,Re]}],"font-family":[{font:[CI,SI,n]}],"font-features":[{"font-features":[Re]}],"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:[s,Me,Re]}],"line-clamp":[{"line-clamp":[Je,"none",Me,F_]}],leading:[{leading:[l,...D()]}],"list-image":[{"list-image":["none",Me,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Je,"from-font","auto",Me,vs]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Je,"auto",Me,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Da,Me,Re],radial:["",Me,Re],conic:[Da,Me,Re]},kI,_I]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-bs":[{"border-bs":Y()}],"border-w-be":[{"border-be":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"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-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":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:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Je,Me,Re]}],"outline-w":[{outline:["",Je,du,vs]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",g,rf,nf]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",y,rf,nf]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Je,vs]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",v,rf,nf]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Je,Me,Re]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Je]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Me,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[Je]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Re]}],filter:[{filter:["","none",Me,Re]}],blur:[{blur:we()}],brightness:[{brightness:[Je,Me,Re]}],contrast:[{contrast:[Je,Me,Re]}],"drop-shadow":[{"drop-shadow":["","none",x,rf,nf]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Je,Me,Re]}],"hue-rotate":[{"hue-rotate":[Je,Me,Re]}],invert:[{invert:["",Je,Me,Re]}],saturate:[{saturate:[Je,Me,Re]}],sepia:[{sepia:["",Je,Me,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Re]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[Je,Me,Re]}],"backdrop-contrast":[{"backdrop-contrast":[Je,Me,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Je,Me,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Je,Me,Re]}],"backdrop-invert":[{"backdrop-invert":["",Je,Me,Re]}],"backdrop-opacity":[{"backdrop-opacity":[Je,Me,Re]}],"backdrop-saturate":[{"backdrop-saturate":[Je,Me,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",Je,Me,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Je,"initial",Me,Re]}],ease:[{ease:["linear","initial",j,Me,Re]}],delay:[{delay:[Je,Me,Re]}],animate:[{animate:["none",E,Me,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Me,Re]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:Ie()}],"scale-x":[{"scale-x":Ie()}],"scale-y":[{"scale-y":Ie()}],"scale-z":[{"scale-z":Ie()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[Me,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:lt()}],"translate-x":[{"translate-x":lt()}],"translate-y":[{"translate-y":lt()}],"translate-z":[{"translate-z":lt()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Me,Re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Me,Re]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Je,du,vs,F_]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},AI=lI(TI);function Ee(...e){return AI(jk(e))}const RI=Sh("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function be({className:e,variant:n="default",size:r="default",asChild:i=!1,...s}){const l=i?Ch:"button";return f.jsx(l,{"data-slot":"button","data-variant":n,"data-size":r,className:Ee(RI({variant:n,size:r,className:e})),...s})}function Ue({className:e,type:n,...r}){return f.jsx("input",{type:n,"data-slot":"input",className:Ee("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...r})}function MI({className:e,orientation:n="horizontal",decorative:r=!0,...i}){return f.jsx(h6,{"data-slot":"separator",decorative:r,orientation:n,className:Ee("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...i})}const wT=(...e)=>e.filter((n,r,i)=>!!n&&n.trim()!==""&&i.indexOf(n)===r).join(" ").trim();const DI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const OI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,i)=>i?i.toUpperCase():r.toLowerCase());const $_=e=>{const n=OI(e);return n.charAt(0).toUpperCase()+n.slice(1)};var zI={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"};const PI=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const LI=S.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:u,...d},h)=>S.createElement("svg",{ref:h,...zI,width:n,height:n,stroke:e,strokeWidth:i?Number(r)*24/Number(n):r,className:wT("lucide",s),...!l&&!PI(d)&&{"aria-hidden":"true"},...d},[...u.map(([p,g])=>S.createElement(p,g)),...Array.isArray(l)?l:[l]]));const $e=(e,n)=>{const r=S.forwardRef(({className:i,...s},l)=>S.createElement(LI,{ref:l,iconNode:n,className:wT(`lucide-${DI($_(e))}`,`lucide-${e}`,i),...s}));return r.displayName=$_(e),r};const II=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],H_=$e("arrow-right",II);const VI=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],FI=$e("arrow-up-right",VI);const UI=[["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"}]],tl=$e("bot",UI);const BI=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Dx=$e("brain",BI);const $I=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],ST=$e("calendar-clock",$I);const HI=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Xy=$e("calendar",HI);const GI=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qI=$e("check",GI);const YI=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],hl=$e("chevron-down",YI);const XI=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Xf=$e("chevron-left",XI);const KI=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zn=$e("chevron-right",KI);const WI=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ZI=$e("chevron-up",WI);const QI=[["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"}]],G_=$e("circle-arrow-up",QI);const JI=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_T=$e("circle-play",JI);const e8=[["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"}]],CT=$e("copy",e8);const t8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],n8=$e("download",t8);const r8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],jT=$e("ellipsis-vertical",r8);const i8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],a8=$e("ellipsis",i8);const s8=[["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"}]],kT=$e("external-link",s8);const o8=[["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"}]],l8=$e("eye-off",o8);const u8=[["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"}]],c8=$e("eye",u8);const d8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],f8=$e("file-text",d8);const h8=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],nc=$e("git-branch",h8);const p8=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],m8=$e("github",p8);const g8=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],y8=$e("grip-vertical",g8);const v8=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],x8=$e("key",v8);const b8=[["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"}]],w8=$e("layout-dashboard",b8);const S8=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],_8=$e("list-todo",S8);const C8=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],ET=$e("lock",C8);const j8=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Hh=$e("message-circle",j8);const k8=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],E8=$e("moon",k8);const N8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Ox=$e("panel-left",N8);const T8=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Kf=$e("pause",T8);const A8=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Gh=$e("pencil",A8);const R8=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Yo=$e("play",R8);const M8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ky=$e("plus",M8);const D8=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],O8=$e("puzzle",D8);const z8=[["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"}]],P8=$e("scroll-text",z8);const L8=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wy=$e("search",L8);const I8=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],V8=$e("send",I8);const F8=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],U8=$e("settings-2",F8);const B8=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$8=$e("settings",B8);const H8=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],NT=$e("sparkles",H8);const G8=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],q8=$e("store",G8);const Y8=[["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"}]],X8=$e("sun",Y8);const K8=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Xo=$e("trash-2",K8);const W8=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],TT=$e("user",W8);const Z8=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Q8=$e("wrench",Z8);const J8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Is=$e("x",J8);function zx({...e}){return f.jsx(wz,{"data-slot":"sheet",...e})}function e9({...e}){return f.jsx(Sz,{"data-slot":"sheet-portal",...e})}function t9({className:e,...n}){return f.jsx(_z,{"data-slot":"sheet-overlay",className:Ee("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...n})}function Px({className:e,children:n,side:r="right",showCloseButton:i=!0,...s}){return f.jsxs(e9,{children:[f.jsx(t9,{}),f.jsxs(Cz,{"data-slot":"sheet-content","data-side":r,className:Ee("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",e),...s,children:[n,i&&f.jsx(Ez,{"data-slot":"sheet-close",asChild:!0,children:f.jsxs(be,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[f.jsx(Is,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Lx({className:e,...n}){return f.jsx("div",{"data-slot":"sheet-header",className:Ee("flex flex-col gap-0.5 p-4",e),...n})}function Ix({className:e,...n}){return f.jsx(jz,{"data-slot":"sheet-title",className:Ee("text-base font-medium text-foreground",e),...n})}function AT({className:e,...n}){return f.jsx(kz,{"data-slot":"sheet-description",className:Ee("text-sm text-muted-foreground",e),...n})}function n9({delayDuration:e=0,...n}){return f.jsx(z6,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function r9({...e}){return f.jsx(P6,{"data-slot":"tooltip",...e})}function i9({...e}){return f.jsx(L6,{"data-slot":"tooltip-trigger",...e})}function a9({className:e,sideOffset:n=0,children:r,...i}){return f.jsx(I6,{children:f.jsxs(V6,{"data-slot":"tooltip-content",sideOffset:n,className:Ee("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...i,children:[r,f.jsx(F6,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const s9="sidebar_state",o9=3600*24*7,l9="16rem",u9="18rem",c9="3rem",d9="b",RT=S.createContext(null);function Vx(){const e=S.useContext(RT);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function f9({defaultOpen:e=!0,open:n,onOpenChange:r,className:i,style:s,children:l,...u}){const d=U6(),[h,p]=S.useState(!1),[g,y]=S.useState(e),v=n??g,x=S.useCallback(j=>{const E=typeof j=="function"?j(v):j;r?r(E):y(E),document.cookie=`${s9}=${E}; path=/; max-age=${o9}`},[r,v]),_=S.useCallback(()=>d?p(j=>!j):x(j=>!j),[d,x,p]);S.useEffect(()=>{const j=E=>{E.key===d9&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),_())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[_]);const C=v?"expanded":"collapsed",k=S.useMemo(()=>({state:C,open:v,setOpen:x,isMobile:d,openMobile:h,setOpenMobile:p,toggleSidebar:_}),[C,v,x,d,h,p,_]);return f.jsx(RT.Provider,{value:k,children:f.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":l9,"--sidebar-width-icon":c9,...s},className:Ee("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",i),...u,children:l})})}function h9({side:e="left",variant:n="sidebar",collapsible:r="offcanvas",className:i,children:s,dir:l,...u}){const{isMobile:d,state:h,openMobile:p,setOpenMobile:g}=Vx();return r==="none"?f.jsx("div",{"data-slot":"sidebar",className:Ee("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",i),...u,children:s}):d?f.jsx(zx,{open:p,onOpenChange:g,...u,children:f.jsxs(Px,{dir:l,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":u9},side:e,children:[f.jsxs(Lx,{className:"sr-only",children:[f.jsx(Ix,{children:"Sidebar"}),f.jsx(AT,{children:"Displays the mobile sidebar."})]}),f.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):f.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?r:"","data-variant":n,"data-side":e,"data-slot":"sidebar",children:[f.jsx("div",{"data-slot":"sidebar-gap",className:Ee("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),f.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:Ee("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...u,children:f.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:s})})]})}function p9({className:e,onClick:n,...r}){const{toggleSidebar:i}=Vx();return f.jsxs(be,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Ee(e),onClick:s=>{n?.(s),i()},...r,children:[f.jsx(Ox,{}),f.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function m9({className:e,...n}){return f.jsx("main",{"data-slot":"sidebar-inset",className:Ee("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...n})}function g9({className:e,...n}){return f.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Ee("flex flex-col gap-2 p-2",e),...n})}function y9({className:e,...n}){return f.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Ee("flex flex-col gap-2 p-2",e),...n})}function v9({className:e,...n}){return f.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Ee("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n})}function q_({className:e,...n}){return f.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Ee("relative flex w-full min-w-0 flex-col p-2",e),...n})}function x9({className:e,asChild:n=!1,...r}){const i=n?Ch:"div";return f.jsx(i,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:Ee("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",e),...r})}function Y_({className:e,...n}){return f.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:Ee("w-full text-sm",e),...n})}function af({className:e,...n}){return f.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Ee("flex w-full min-w-0 flex-col gap-0",e),...n})}function sf({className:e,...n}){return f.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Ee("group/menu-item relative",e),...n})}const b9=Sh("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function of({asChild:e=!1,isActive:n=!1,variant:r="default",size:i="default",tooltip:s,className:l,...u}){const d=e?Ch:"button",{isMobile:h,state:p}=Vx(),g=f.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":n,className:Ee(b9({variant:r,size:i}),l),...u});return s?(typeof s=="string"&&(s={children:s}),f.jsxs(r9,{children:[f.jsx(i9,{asChild:!0,children:g}),f.jsx(a9,{side:"right",align:"center",hidden:p!=="collapsed"||h,...s})]})):g}const w9=[{id:"agents",title:"Agents",icon:f.jsx(tl,{className:"size-4"})},{id:"chat",title:"Chat",icon:f.jsx(Hh,{className:"size-4"})},{id:"graphs",title:"Graphs",icon:f.jsx(nc,{className:"size-4"})},{id:"schedules",title:"Schedules",icon:f.jsx(ST,{className:"size-4"})},{id:"memory",title:"Memory",icon:f.jsx(Dx,{className:"size-4"})}],S9=[{id:"skills",title:"Skills",icon:f.jsx(O8,{className:"size-4"})}];function _9({activePage:e,onNavigate:n,...r}){return f.jsxs(h9,{collapsible:"offcanvas",...r,children:[f.jsx(g9,{children:f.jsx(af,{children:f.jsx(sf,{children:f.jsx(of,{asChild:!0,className:"data-[slot=sidebar-menu-button]:p-1.5!",children:f.jsxs("button",{type:"button",onClick:()=>n("agents"),className:"flex items-center gap-2",children:[f.jsxs("span",{className:"relative flex size-8 shrink-0 items-center justify-center",children:[f.jsx("img",{src:"/logo_dark.png",alt:"",className:"size-6 dark:hidden"}),f.jsx("img",{src:"/logo_white.png",alt:"",className:"hidden size-6 dark:block"})]}),f.jsx("span",{className:"text-base font-semibold",children:"Sulala Agent"})]})})})})}),f.jsxs(v9,{children:[f.jsx(q_,{children:f.jsx(Y_,{children:f.jsx(af,{children:w9.map(i=>f.jsx(sf,{children:f.jsxs(of,{tooltip:i.title,isActive:e===i.id,onClick:()=>n(i.id),children:[i.icon,f.jsx("span",{children:i.title})]})},i.id))})})}),f.jsxs(q_,{children:[f.jsx(x9,{children:"Skills"}),f.jsx(Y_,{children:f.jsx(af,{children:S9.map(i=>f.jsx(sf,{children:f.jsxs(of,{tooltip:i.title,isActive:e===i.id,onClick:()=>n(i.id),children:[i.icon,f.jsx("span",{children:i.title})]})},i.id))})})]})]}),f.jsx(y9,{children:f.jsx(af,{children:f.jsx(sf,{children:f.jsxs(of,{tooltip:"Settings",isActive:e==="settings",onClick:()=>n("settings"),children:[f.jsx(U8,{className:"size-4"}),f.jsx("span",{children:"Settings"})]})})})})]})}const MT="(prefers-color-scheme: dark)",C9=["dark","light","system"],DT=S.createContext(void 0);function X_(e){return e===null?!1:C9.includes(e)}function K_(){return window.matchMedia(MT).matches?"dark":"light"}function j9(){const e=document.createElement("style");return e.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.remove()})})}}function k9(e){return e instanceof HTMLElement?!!(e.isContentEditable||e.closest("input, textarea, select, [contenteditable='true']")):!1}function E9({children:e,defaultTheme:n="system",storageKey:r="theme",disableTransitionOnChange:i=!0,...s}){const[l,u]=S.useState(()=>{const g=localStorage.getItem(r);return X_(g)?g:n}),d=S.useCallback(g=>{localStorage.setItem(r,g),u(g)},[r]),h=S.useCallback(g=>{const y=document.documentElement,v=g==="system"?K_():g,x=i?j9():null;y.classList.remove("light","dark"),y.classList.add(v),x&&x()},[i]);S.useEffect(()=>{if(h(l),l!=="system")return;const g=window.matchMedia(MT),y=()=>{h("system")};return g.addEventListener("change",y),()=>{g.removeEventListener("change",y)}},[l,h]),S.useEffect(()=>{const g=y=>{y.repeat||y.metaKey||y.ctrlKey||y.altKey||k9(y.target)||y.key.toLowerCase()==="d"&&u(v=>{const x=v==="dark"?"light":v==="light"?"dark":K_()==="dark"?"light":"dark";return localStorage.setItem(r,x),x})};return window.addEventListener("keydown",g),()=>{window.removeEventListener("keydown",g)}},[r]),S.useEffect(()=>{const g=y=>{if(y.storageArea===localStorage&&y.key===r){if(X_(y.newValue)){u(y.newValue);return}u(n)}};return window.addEventListener("storage",g),()=>{window.removeEventListener("storage",g)}},[n,r]);const p=S.useMemo(()=>({theme:l,setTheme:d}),[l,d]);return f.jsx(DT.Provider,{...s,value:p,children:e})}const N9=()=>{const e=S.useContext(DT);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},T9="https://github.com/Sulala-ai/sulala";function A9({activePage:e,onNavigate:n,children:r}){const{theme:i,setTheme:s}=N9(),l=i==="dark"||i==="system"&&typeof document<"u"&&document.documentElement.classList.contains("dark");return f.jsxs(f9,{children:[f.jsx(_9,{activePage:e,onNavigate:n}),f.jsxs(m9,{children:[f.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[f.jsx(p9,{className:"-ml-1"}),f.jsx(MI,{orientation:"vertical",className:"h-5"}),f.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Sulala Agent"}),f.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[f.jsx("a",{href:T9,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center rounded-md p-2 text-muted-foreground hover:bg-muted hover:text-foreground","aria-label":"GitHub repository",children:f.jsx(m8,{className:"size-4"})}),f.jsx(be,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>s(l?"light":"dark"),"aria-label":l?"Switch to light mode":"Switch to dark mode",children:l?f.jsx(X8,{className:"size-4"}):f.jsx(E8,{className:"size-4"})})]})]}),r]})]})}const Dr="",Zy="agent_os_dashboard_token";function qh(){return sessionStorage.getItem(Zy)}function Wf(e){e===null?sessionStorage.removeItem(Zy):sessionStorage.setItem(Zy,e)}const Qy="dashboard:unauthorized";function $r(){const e=qh();return e?{Authorization:`Bearer ${e}`}:{}}function Hr(e){e.status===401&&(Wf(null),window.dispatchEvent(new CustomEvent(Qy)))}function Fx(e,n){const r=`${Dr}/api/agents/${encodeURIComponent(e)}/workspace/${encodeURIComponent(n)}`,i=qh();return i?`${r}?token=${encodeURIComponent(i)}`:r}async function R9(e,n){const r=Fx(e,n),i=await fetch(r,{headers:$r()});if(Hr(i),i.status===404)return"";if(!i.ok)throw new Error(`Failed to load ${n}: ${i.status}`);return i.text()}async function M9(e,n,r){const i=Fx(e,n),s=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json",...$r()},body:JSON.stringify({content:r})});if(Hr(s),!s.ok){const l=await s.text();throw new Error(l||`Failed to save ${n}: ${s.status}`)}}function D9(){const e=Dr.replace(/^http/,"ws")+"/api/events",n=qh();return n?`${e}?token=${encodeURIComponent(n)}`:e}async function O9(){return(await fetch(`${Dr}/api/agents`,{headers:{"Content-Type":"application/json"}})).status===401}async function z9(){const e=await fetch(`${Dr}/api/bootstrap/dashboard-token`,{headers:{"Content-Type":"application/json"}});if(e.status===403||!e.ok)return null;const n=await e.json();return typeof n.token=="string"?n.token:null}async function W_(){const n=await(await fetch(`${Dr}/api/bootstrap/workspace-status`,{headers:{"Content-Type":"application/json"}})).json();return{ready:!!n.ready,error:n.error}}async function P9(){const e=await fetch(`${Dr}/api/bootstrap/setup-workspace`,{method:"POST",headers:{"Content-Type":"application/json"}});return e.ok?{ok:!0,installed:(await e.json()).installed}:{ok:!1,error:await e.text()}}async function Be(e,n){const r=await fetch(`${Dr}${e}`,{...n,headers:{"Content-Type":"application/json",...$r(),...n?.headers}});if(Hr(r),!r.ok){if((r.headers.get("content-type")??"").includes("application/json"))try{const s=await r.json(),l=typeof s=="object"&&s!==null&&"error"in s&&typeof s.error=="string"?s.error:`API ${r.status}`,u=new Error(l);throw u.status=r.status,u.data=s,u}catch{}throw new Error(`API ${r.status}: ${await r.text()}`)}return r.json()}const pe={async getAgents(){return Be("/api/agents")},getWorkspaceFileContent:R9,putWorkspaceFile:M9,async updateAgent(e,n){return Be(`/api/agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(n)})},async installSystemAgents(){return Be("/api/agents/install-system",{method:"POST"})},async installSystemSkills(){return Be("/api/skills/install-system",{method:"POST"})},async deleteAgent(e){const n=await fetch(`${Dr}/api/agents/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"Content-Type":"application/json",...$r()}});if(Hr(n),!n.ok){const r=await n.text();let i=`API ${n.status}: ${r}`;try{const s=JSON.parse(r);typeof s.error=="string"&&(i=s.error)}catch{}throw new Error(i)}return n.json()},async createAgent(e){return Be("/api/agents",{method:"POST",body:JSON.stringify(e)})},async suggestAgent(e){return Be("/api/agents/suggest",{method:"POST",body:JSON.stringify({prompt:e.trim()})})},async runAgent(e,n,r){return Be("/api/agents/run",{method:"POST",body:JSON.stringify({agent_id:e,task:n,conversation_id:r?.conversation_id})})},async uploadAgentFile(e,n){const r=new FormData;r.append("file",n);const i=await fetch(`${Dr}/api/agents/${encodeURIComponent(e)}/upload`,{method:"POST",headers:$r(),body:r});if(Hr(i),!i.ok){const s=await i.text();throw new Error(`Upload failed: ${i.status} ${s}`)}return i.json()},async runAgentStream(e,n,r){const i=await fetch(`${Dr}/api/agents/run/stream`,{method:"POST",headers:{"Content-Type":"application/json",...$r()},body:JSON.stringify({agent_id:e,task:n,conversation_id:r.conversation_id??void 0,attachment_paths:r.attachment_paths??void 0}),signal:r.signal});if(Hr(i),!i.ok){const h=await i.text();throw new Error(`API ${i.status}: ${h}`)}const s=i.body?.getReader();if(!s)throw new Error("No response body");const l=new TextDecoder;let u="",d="";try{for(;;){const{done:h,value:p}=await s.read();if(h)break;u+=l.decode(p,{stream:!0});const g=u.split(`
|
|
54
|
+
`);u=g.pop()??"";for(const y of g){if(y.startsWith("event: ")){d=y.slice(7).trim();continue}if(y.startsWith("data: ")&&d){const v=y.slice(6);try{const x=JSON.parse(v);d==="assistant"&&typeof x.delta=="string"?r.onDelta?.(x.delta):d==="tool_call"?r.onToolCall?.(String(x.name??""),x.result,typeof x.error=="string"?x.error:void 0):d==="done"?r.onDone?.({finalContent:String(x.finalContent??""),turnCount:Number(x.turnCount??0),usage:x.usage,model:typeof x.model=="string"?x.model:void 0,steps:Array.isArray(x.steps)?x.steps:void 0}):d==="error"&&typeof x.message=="string"&&r.onError?.(x.message)}catch{}d=""}}}}finally{s.releaseLock()}},async updateConversationTitle(e,n){return Be(`/api/conversations/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({title:n})})},async getTasks(e){const n=new URLSearchParams;e?.agent_id&&n.set("agent_id",e.agent_id),e?.graph_id&&n.set("graph_id",e.graph_id),e?.status&&n.set("status",e.status),e?.limit&&n.set("limit",String(e.limit));const r=n.toString();return Be(`/api/tasks${r?`?${r}`:""}`)},async getTaskById(e){return Be(`/api/tasks?id=${encodeURIComponent(e)}`)},async enqueueTask(e,n){return Be("/api/tasks",{method:"POST",body:JSON.stringify({agent_id:e,task:n})})},async enqueueGraphTask(e,n){return Be("/api/tasks",{method:"POST",body:JSON.stringify({graph_id:e,task:n})})},async getLogs(){return Be("/api/logs")},async saveConversationMessage(e){if(!e.graph_id&&!e.agent_id)throw new Error("agent_id or graph_id is required");return Be("/api/conversations",{method:"POST",body:JSON.stringify(e)})},async getConversationMessages(e){const n=new URLSearchParams;n.set("conversation_id",e.conversation_id),e.limit&&n.set("limit",String(e.limit));const r=n.toString();return Be(`/api/conversations?${r}`)},async getConversations(e){const n=new URLSearchParams;e.agent_id&&n.set("agent_id",e.agent_id),e.graph_id&&n.set("graph_id",e.graph_id),e.limit&&n.set("limit",String(e.limit));const r=n.toString();if(!e.agent_id&&!e.graph_id)throw new Error("agent_id or graph_id is required");return Be(`/api/conversations?${r}`)},async getTelegramStatus(){return Be("/api/channels/telegram/status")},async setTelegramWebhook(e){return Be("/api/channels/telegram/set-webhook",{method:"POST",body:JSON.stringify({base_url:e})})},async getSlackStatus(){return Be("/api/channels/slack/status")},async getDiscordStatus(){return Be("/api/channels/discord/status")},async getSignalStatus(){return Be("/api/channels/signal/status")},async getViberStatus(){return Be("/api/channels/viber/status")},async setViberWebhook(e){return Be("/api/channels/viber/set-webhook",{method:"POST",body:JSON.stringify({base_url:e})})},async getDoc(e){return Be(`/api/docs/${e}`)},async searchMemory(e){const n=new URLSearchParams;return e.q&&n.set("q",e.q),e.agent_id&&n.set("agent_id",e.agent_id),e.user_id&&n.set("user_id",e.user_id),e.limit!=null&&n.set("limit",String(e.limit)),e.semantic&&n.set("semantic","1"),Be(`/api/memory/search?${n.toString()}`)},async writeMemory(e){return Be("/api/memory/write",{method:"POST",body:JSON.stringify(e)})},async deleteMemory(e){return Be(`/api/memory/${e}`,{method:"DELETE"})},async getSettings(){return Be("/api/settings")},async saveSettings(e){return Be("/api/settings",{method:"PUT",body:JSON.stringify(e)})},async getMcpServers(){return Be("/api/mcp/servers")},async saveMcpServers(e){return Be("/api/mcp/servers",{method:"PUT",body:JSON.stringify({servers:e})})},async deleteMcpServer(e){const n=await fetch(`${Dr}/api/mcp/servers/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"Content-Type":"application/json",...$r()}});if(Hr(n),!n.ok)throw new Error(`API ${n.status}: ${await n.text()}`);return n.json()},async testMcpServer(e){return Be("/api/mcp/servers/test",{method:"POST",body:JSON.stringify(e)})},async regenerateDashboardToken(){return Be("/api/settings/dashboard-token/regenerate",{method:"POST"})},async getGraphs(){return Be("/api/graphs")},async getGraph(e){return Be(`/api/graphs/${encodeURIComponent(e)}`)},async saveGraph(e){return Be(`/api/graphs/${encodeURIComponent(e.id)}`,{method:"PUT",body:JSON.stringify(e)})},async deleteGraph(e){return Be(`/api/graphs/${encodeURIComponent(e)}`,{method:"DELETE"})},async runGraph(e,n){return Be("/api/graphs/run",{method:"POST",body:JSON.stringify({graph_id:e,input:n})})},async runGraphStream(e,n,r){const i=await fetch(`${Dr}/api/graphs/run/stream`,{method:"POST",headers:{"Content-Type":"application/json",...$r()},body:JSON.stringify({graph_id:e,input:n}),signal:r.signal});if(Hr(i),!i.ok){const h=await i.text();throw new Error(`API ${i.status}: ${h}`)}const s=i.body?.getReader();if(!s)throw new Error("No response body");const l=new TextDecoder;let u="",d="";try{for(;;){const{done:h,value:p}=await s.read();if(h)break;u+=l.decode(p,{stream:!0});const g=u.split(`
|
|
55
|
+
`);u=g.pop()??"";for(const y of g){if(y.startsWith("event: ")){d=y.slice(7).trim();continue}if(y.startsWith("data: ")&&d){try{const v=JSON.parse(y.slice(6));d==="node_done"?r.onNodeDone?.({node_id:String(v.node_id??""),agent_id:String(v.agent_id??""),success:!!v.success,output:String(v.output??""),error:typeof v.error=="string"?v.error:void 0}):d==="done"?r.onDone?.({success:!!v.success,output:String(v.output??""),node_results:Array.isArray(v.node_results)?v.node_results:[]}):d==="error"&&typeof v.message=="string"&&r.onError?.(v.message)}catch{}d=""}}}}finally{s.releaseLock()}},async getSkills(){return Be("/api/skills")},async getSkillMarketplace(){return Be("/api/skills/marketplace")},async getStoreRegistry(){return Be("/api/skills/store-registry")},async installSkill(e){return Be("/api/skills/install",{method:"POST",body:JSON.stringify(e)})},async uploadSkill(e){const n=new FormData;n.set("file",e);const i=await fetch("/api/skills/upload",{method:"POST",headers:$r(),body:n});if(Hr(i),!i.ok)throw new Error(`Upload failed: ${await i.text()}`);return i.json()},async uploadSkillMd(e,n){const r=new FormData;r.set("file",e),n?.trim()&&r.set("id",n.trim());const s=await fetch("/api/skills/upload-skill-md",{method:"POST",headers:$r(),body:r});if(Hr(s),!s.ok)throw new Error(`Upload failed: ${await s.text()}`);return s.json()},async getSkillConfig(e){return Be(`/api/skills/${encodeURIComponent(e)}/config`)},async getSkillConfigSchema(e){const r=await fetch(`/api/skills/${encodeURIComponent(e)}/config/schema`,{headers:$r()});if(Hr(r),r.status===404)return null;if(!r.ok)throw new Error(`API ${r.status}: ${await r.text()}`);return r.json()},async getSkillSetup(e){return Be(`/api/skills/${encodeURIComponent(e)}/setup`)},async saveSkillConfig(e,n){return Be(`/api/skills/${encodeURIComponent(e)}/config`,{method:"PUT",body:JSON.stringify(n)})},async uninstallSkill(e){return Be(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE"})},async summarizeConversation(e){return Be("/api/conversations/summarize",{method:"POST",body:JSON.stringify({conversation_id:e})})},async getMemoryGraph(e){const n=new URLSearchParams;e.q&&n.set("q",e.q),e.agent_id&&n.set("agent_id",e.agent_id),e.user_id&&n.set("user_id",e.user_id),e.limit!=null&&n.set("limit",String(e.limit));const r=n.toString();return Be(`/api/memory/graph${r?`?${r}`:""}`)}},OT=S.createContext(null);function L9({children:e,onNavigate:n}){const[r,i]=S.useState(null),s=S.useCallback(u=>{i(u),n("chat")},[n]),l=S.useCallback(()=>i(null),[]);return f.jsx(OT.Provider,{value:{openChatWithAgent:s,preselectedAgentId:r,clearPreselectedAgent:l},children:e})}function Ux(){const e=S.useContext(OT);return e||{openChatWithAgent:()=>{},preselectedAgentId:null,clearPreselectedAgent:()=>{}}}function Ne({className:e,...n}){return f.jsx(NL,{"data-slot":"label",className:Ee("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function Es({className:e,size:n="default",...r}){return f.jsx(Pz,{"data-slot":"avatar","data-size":n,className:Ee("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...r})}function nl({className:e,...n}){return f.jsx(Lz,{"data-slot":"avatar-image",className:Ee("aspect-square size-full rounded-full object-cover",e),...n})}function Cs({className:e,...n}){return f.jsx(Iz,{"data-slot":"avatar-fallback",className:Ee("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...n})}function I9(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const V9=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,F9=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,U9={};function Z_(e,n){return(U9.jsx?F9:V9).test(e)}const B9=/[ \t\n\f\r]/g;function $9(e){return typeof e=="object"?e.type==="text"?Q_(e.value):!1:Q_(e)}function Q_(e){return e.replace(B9,"")===""}class Cc{constructor(n,r,i){this.normal=r,this.property=n,i&&(this.space=i)}}Cc.prototype.normal={};Cc.prototype.property={};Cc.prototype.space=void 0;function zT(e,n){const r={},i={};for(const s of e)Object.assign(r,s.property),Object.assign(i,s.normal);return new Cc(r,i,n)}function Jy(e){return e.toLowerCase()}class Qn{constructor(n,r){this.attribute=r,this.property=n}}Qn.prototype.attribute="";Qn.prototype.booleanish=!1;Qn.prototype.boolean=!1;Qn.prototype.commaOrSpaceSeparated=!1;Qn.prototype.commaSeparated=!1;Qn.prototype.defined=!1;Qn.prototype.mustUseProperty=!1;Qn.prototype.number=!1;Qn.prototype.overloadedBoolean=!1;Qn.prototype.property="";Qn.prototype.spaceSeparated=!1;Qn.prototype.space=void 0;let H9=0;const Ze=$s(),un=$s(),ev=$s(),Ce=$s(),At=$s(),Ko=$s(),or=$s();function $s(){return 2**++H9}const tv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:un,commaOrSpaceSeparated:or,commaSeparated:Ko,number:Ce,overloadedBoolean:ev,spaceSeparated:At},Symbol.toStringTag,{value:"Module"})),Fg=Object.keys(tv);class Bx extends Qn{constructor(n,r,i,s){let l=-1;if(super(n,r),J_(this,"space",s),typeof i=="number")for(;++l<Fg.length;){const u=Fg[l];J_(this,Fg[l],(i&tv[u])===tv[u])}}}Bx.prototype.defined=!0;function J_(e,n,r){r&&(e[n]=r)}function pl(e){const n={},r={};for(const[i,s]of Object.entries(e.properties)){const l=new Bx(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),n[i]=l,r[Jy(i)]=i,r[Jy(l.attribute)]=i}return new Cc(n,r,e.space)}const PT=pl({properties:{ariaActiveDescendant:null,ariaAtomic:un,ariaAutoComplete:null,ariaBusy:un,ariaChecked:un,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:At,ariaCurrent:null,ariaDescribedBy:At,ariaDetails:null,ariaDisabled:un,ariaDropEffect:At,ariaErrorMessage:null,ariaExpanded:un,ariaFlowTo:At,ariaGrabbed:un,ariaHasPopup:null,ariaHidden:un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:At,ariaLevel:Ce,ariaLive:null,ariaModal:un,ariaMultiLine:un,ariaMultiSelectable:un,ariaOrientation:null,ariaOwns:At,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:un,ariaReadOnly:un,ariaRelevant:null,ariaRequired:un,ariaRoleDescription:At,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:un,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function LT(e,n){return n in e?e[n]:n}function IT(e,n){return LT(e,n.toLowerCase())}const G9=pl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ko,acceptCharset:At,accessKey:At,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:At,autoFocus:Ze,autoPlay:Ze,blocking:At,capture:null,charSet:null,checked:Ze,cite:null,className:At,cols:Ce,colSpan:null,content:null,contentEditable:un,controls:Ze,controlsList:At,coords:Ce|Ko,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:ev,draggable:un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:At,height:Ce,hidden:ev,high:Ce,href:null,hrefLang:null,htmlFor:At,httpEquiv:At,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:At,itemRef:At,itemScope:Ze,itemType:At,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,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:Ze,optimum:Ce,pattern:null,ping:At,placeholder:null,playsInline:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:At,required:Ze,reversed:Ze,rows:Ce,rowSpan:Ce,sandbox:At,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ze,useMap:null,value:un,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:At,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:un,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:IT}),q9=pl({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:or,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:At,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:Ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ko,g2:Ko,glyphName:Ko,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:or,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:At,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:or,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:or,rev:or,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:or,requiredFeatures:or,requiredFonts:or,requiredFormats:or,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:or,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:or,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:or,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:LT}),VT=pl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),FT=pl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:IT}),UT=pl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Y9={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"},X9=/[A-Z]/g,eC=/-[a-z]/g,K9=/^data[-\w.:]+$/i;function W9(e,n){const r=Jy(n);let i=n,s=Qn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&K9.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(eC,Q9);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!eC.test(l)){let u=l.replace(X9,Z9);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}s=Bx}return new s(i,n)}function Z9(e){return"-"+e.toLowerCase()}function Q9(e){return e.charAt(1).toUpperCase()}const J9=zT([PT,G9,VT,FT,UT],"html"),$x=zT([PT,q9,VT,FT,UT],"svg");function eV(e){return e.join(" ").trim()}var Oo={},Ug,tC;function tV(){if(tC)return Ug;tC=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
|
|
56
|
+
`,p="/",g="*",y="",v="comment",x="declaration";function _(k,j){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];j=j||{};var E=1,N=1;function M(B){var Z=B.match(n);Z&&(E+=Z.length);var O=B.lastIndexOf(h);N=~O?B.length-O:N+B.length}function R(){var B={line:E,column:N};return function(Z){return Z.position=new z(B),$(),Z}}function z(B){this.start=B,this.end={line:E,column:N},this.source=j.source}z.prototype.content=k;function P(B){var Z=new Error(j.source+":"+E+":"+N+": "+B);if(Z.reason=B,Z.filename=j.source,Z.line=E,Z.column=N,Z.source=k,!j.silent)throw Z}function D(B){var Z=B.exec(k);if(Z){var O=Z[0];return M(O),k=k.slice(O.length),Z}}function $(){D(r)}function U(B){var Z;for(B=B||[];Z=X();)Z!==!1&&B.push(Z);return B}function X(){var B=R();if(!(p!=k.charAt(0)||g!=k.charAt(1))){for(var Z=2;y!=k.charAt(Z)&&(g!=k.charAt(Z)||p!=k.charAt(Z+1));)++Z;if(Z+=2,y===k.charAt(Z-1))return P("End of comment missing");var O=k.slice(2,Z-2);return N+=2,M(O),k=k.slice(Z),N+=2,B({type:v,comment:O})}}function K(){var B=R(),Z=D(i);if(Z){if(X(),!D(s))return P("property missing ':'");var O=D(l),q=B({type:x,property:C(Z[0].replace(e,y)),value:O?C(O[0].replace(e,y)):y});return D(u),q}}function ae(){var B=[];U(B);for(var Z;Z=K();)Z!==!1&&(B.push(Z),U(B));return B}return $(),ae()}function C(k){return k?k.replace(d,y):y}return Ug=_,Ug}var nC;function nV(){if(nC)return Oo;nC=1;var e=Oo&&Oo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.default=r;const n=e(tV());function r(i,s){let l=null;if(!i||typeof i!="string")return l;const u=(0,n.default)(i),d=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:g}=h;d?s(p,g,h):g&&(l=l||{},l[p]=g)}),l}return Oo}var fu={},rC;function rV(){if(rC)return fu;rC=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(p){return!p||r.test(p)||e.test(p)},u=function(p,g){return g.toUpperCase()},d=function(p,g){return"".concat(g,"-")},h=function(p,g){return g===void 0&&(g={}),l(p)?p:(p=p.toLowerCase(),g.reactCompat?p=p.replace(s,d):p=p.replace(i,d),p.replace(n,u))};return fu.camelCase=h,fu}var hu,iC;function iV(){if(iC)return hu;iC=1;var e=hu&&hu.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(nV()),r=rV();function i(s,l){var u={};return!s||typeof s!="string"||(0,n.default)(s,function(d,h){d&&h&&(u[(0,r.camelCase)(d,l)]=h)}),u}return i.default=i,hu=i,hu}var aV=iV();const sV=mc(aV),BT=$T("end"),Hx=$T("start");function $T(e){return n;function n(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function oV(e){const n=Hx(e),r=BT(e);if(n&&r)return{start:n,end:r}}function Uu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?aC(e.position):"start"in e||"end"in e?aC(e):"line"in e||"column"in e?nv(e):""}function nv(e){return sC(e&&e.line)+":"+sC(e&&e.column)}function aC(e){return nv(e&&e.start)+"-"+nv(e&&e.end)}function sC(e){return e&&typeof e=="number"?e:1}class Dn extends Error{constructor(n,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let s="",l={},u=!1;if(r&&("line"in r&&"column"in r?l={place:r}:"start"in r&&"end"in r?l={place:r}:"type"in r?l={ancestors:[r],place:r.position}:l={...r}),typeof n=="string"?s=n:!l.cause&&n&&(u=!0,s=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof i=="string"){const h=i.indexOf(":");h===-1?l.ruleId=i:(l.source=i.slice(0,h),l.ruleId=i.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const d=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=Uu(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dn.prototype.file="";Dn.prototype.name="";Dn.prototype.reason="";Dn.prototype.message="";Dn.prototype.stack="";Dn.prototype.column=void 0;Dn.prototype.line=void 0;Dn.prototype.ancestors=void 0;Dn.prototype.cause=void 0;Dn.prototype.fatal=void 0;Dn.prototype.place=void 0;Dn.prototype.ruleId=void 0;Dn.prototype.source=void 0;const Gx={}.hasOwnProperty,lV=new Map,uV=/[A-Z]/g,cV=new Set(["table","tbody","thead","tfoot","tr"]),dV=new Set(["td","th"]),HT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fV(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=n.filePath||void 0;let i;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=bV(r,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=xV(r,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:i,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?$x:J9,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=GT(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function GT(e,n,r){if(n.type==="element")return hV(e,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return pV(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return gV(e,n,r);if(n.type==="mdxjsEsm")return mV(e,n);if(n.type==="root")return yV(e,n,r);if(n.type==="text")return vV(e,n)}function hV(e,n,r){const i=e.schema;let s=i;n.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=$x,e.schema=s),e.ancestors.push(n);const l=YT(e,n.tagName,!1),u=wV(e,n);let d=Yx(e,n);return cV.has(n.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!$9(h):!0})),qT(e,u,l,n),qx(u,d),e.ancestors.pop(),e.schema=i,e.create(n,l,u,r)}function pV(e,n){if(n.data&&n.data.estree&&e.evaluater){const i=n.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}rc(e,n.position)}function mV(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);rc(e,n.position)}function gV(e,n,r){const i=e.schema;let s=i;n.name==="svg"&&i.space==="html"&&(s=$x,e.schema=s),e.ancestors.push(n);const l=n.name===null?e.Fragment:YT(e,n.name,!0),u=SV(e,n),d=Yx(e,n);return qT(e,u,l,n),qx(u,d),e.ancestors.pop(),e.schema=i,e.create(n,l,u,r)}function yV(e,n,r){const i={};return qx(i,Yx(e,n)),e.create(n,e.Fragment,i,r)}function vV(e,n){return n.value}function qT(e,n,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(n.node=i)}function qx(e,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(e.children=r)}}function xV(e,n,r){return i;function i(s,l,u,d){const p=Array.isArray(u.children)?r:n;return d?p(l,u,d):p(l,u)}}function bV(e,n){return r;function r(i,s,l,u){const d=Array.isArray(l.children),h=Hx(i);return n(s,l,u,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function wV(e,n){const r={};let i,s;for(s in n.properties)if(s!=="children"&&Gx.call(n.properties,s)){const l=_V(e,s,n.properties[s]);if(l){const[u,d]=l;e.tableCellAlignToStyle&&u==="align"&&typeof d=="string"&&dV.has(n.tagName)?i=d:r[u]=d}}if(i){const l=r.style||(r.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function SV(e,n){const r={};for(const i of n.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];l.type;const u=l.expression;u.type;const d=u.properties[0];d.type,Object.assign(r,e.evaluater.evaluateExpression(d.argument))}else rc(e,n.position);else{const s=i.name;let l;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const d=i.value.data.estree.body[0];d.type,l=e.evaluater.evaluateExpression(d.expression)}else rc(e,n.position);else l=i.value===null?!0:i.value;r[s]=l}return r}function Yx(e,n){const r=[];let i=-1;const s=e.passKeys?new Map:lV;for(;++i<n.children.length;){const l=n.children[i];let u;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const p=s.get(h)||0;u=h+"-"+p,s.set(h,p+1)}}const d=GT(e,l,u);d!==void 0&&r.push(d)}return r}function _V(e,n,r){const i=W9(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?I9(r):eV(r)),i.property==="style"){let s=typeof r=="object"?r:CV(e,String(r));return e.stylePropertyNameCase==="css"&&(s=jV(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?Y9[i.property]||i.property:i.attribute,r]}}function CV(e,n){try{return sV(n,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,s=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=HT+"#cannot-parse-style-attribute",s}}function YT(e,n,r){let i;if(!r)i={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let l=-1,u;for(;++l<s.length;){const d=Z_(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};u=u?{type:"MemberExpression",object:u,property:d,computed:!!(l&&d.type==="Literal"),optional:!1}:d}i=u}else i=Z_(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(i.type==="Literal"){const s=i.value;return Gx.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);rc(e)}function rc(e,n){const r=new Dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=HT+"#cannot-handle-mdx-estrees-without-createevaluater",r}function jV(e){const n={};let r;for(r in e)Gx.call(e,r)&&(n[kV(r)]=e[r]);return n}function kV(e){let n=e.replace(uV,EV);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function EV(e){return"-"+e.toLowerCase()}const Bg={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"]},NV={};function TV(e,n){const r=NV,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,s=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return XT(e,i,s)}function XT(e,n,r){if(AV(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return oC(e.children,n,r)}return Array.isArray(e)?oC(e,n,r):""}function oC(e,n,r){const i=[];let s=-1;for(;++s<e.length;)i[s]=XT(e[s],n,r);return i.join("")}function AV(e){return!!(e&&typeof e=="object")}const lC=document.createElement("i");function Xx(e){const n="&"+e+";";lC.innerHTML=n;const r=lC.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===n?!1:r}function vi(e,n,r,i){const s=e.length;let l=0,u;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,r=r>0?r:0,i.length<1e4)u=Array.from(i),u.unshift(n,r),e.splice(...u);else for(r&&e.splice(n,r);l<i.length;)u=i.slice(l,l+1e4),u.unshift(n,0),e.splice(...u),l+=1e4,n+=1e4}function Mr(e,n){return e.length>0?(vi(e,e.length,0,n),e):n}const uC={}.hasOwnProperty;function RV(e){const n={};let r=-1;for(;++r<e.length;)MV(n,e[r]);return n}function MV(e,n){let r;for(r in n){const s=(uC.call(e,r)?e[r]:void 0)||(e[r]={}),l=n[r];let u;if(l)for(u in l){uC.call(s,u)||(s[u]=[]);const d=l[u];DV(s[u],Array.isArray(d)?d:d?[d]:[])}}}function DV(e,n){let r=-1;const i=[];for(;++r<n.length;)(n[r].add==="after"?e:i).push(n[r]);vi(e,0,0,i)}function KT(e,n){const r=Number.parseInt(e,n);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Wo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const di=Wa(/[A-Za-z]/),cr=Wa(/[\dA-Za-z]/),OV=Wa(/[#-'*+\--9=?A-Z^-~]/);function rv(e){return e!==null&&(e<32||e===127)}const iv=Wa(/\d/),zV=Wa(/[\dA-Fa-f]/),PV=Wa(/[!-/:-@[-`{-~]/);function qe(e){return e!==null&&e<-2}function Wn(e){return e!==null&&(e<0||e===32)}function ht(e){return e===-2||e===-1||e===32}const LV=Wa(new RegExp("\\p{P}|\\p{S}","u")),IV=Wa(/\s/);function Wa(e){return n;function n(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ml(e){const n=[];let r=-1,i=0,s=0;for(;++r<e.length;){const l=e.charCodeAt(r);let u="";if(l===37&&cr(e.charCodeAt(r+1))&&cr(e.charCodeAt(r+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const d=e.charCodeAt(r+1);l<56320&&d>56319&&d<57344?(u=String.fromCharCode(l,d),s=1):u="�"}else u=String.fromCharCode(l);u&&(n.push(e.slice(i,r),encodeURIComponent(u)),i=r+s+1,u=""),s&&(r+=s,s=0)}return n.join("")+e.slice(i)}function Rt(e,n,r,i){const s=i?i-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(h){return ht(h)?(e.enter(r),d(h)):n(h)}function d(h){return ht(h)&&l++<s?(e.consume(h),d):(e.exit(r),n(h))}}const VV={tokenize:FV};function FV(e){const n=e.attempt(this.parser.constructs.contentInitial,i,s);let r;return n;function i(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Rt(e,n,"linePrefix")}function s(d){return e.enter("paragraph"),l(d)}function l(d){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(d)}function u(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return qe(d)?(e.consume(d),e.exit("chunkText"),l):(e.consume(d),u)}}const UV={tokenize:BV},cC={tokenize:$V};function BV(e){const n=this,r=[];let i=0,s,l,u;return d;function d(N){if(i<r.length){const M=r[i];return n.containerState=M[1],e.attempt(M[0].continuation,h,p)(N)}return p(N)}function h(N){if(i++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&E();const M=n.events.length;let R=M,z;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){z=n.events[R][1].end;break}j(i);let P=M;for(;P<n.events.length;)n.events[P][1].end={...z},P++;return vi(n.events,R+1,0,n.events.slice(M)),n.events.length=P,p(N)}return d(N)}function p(N){if(i===r.length){if(!s)return v(N);if(s.currentConstruct&&s.currentConstruct.concrete)return _(N);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(cC,g,y)(N)}function g(N){return s&&E(),j(i),v(N)}function y(N){return n.parser.lazy[n.now().line]=i!==r.length,u=n.now().offset,_(N)}function v(N){return n.containerState={},e.attempt(cC,x,_)(N)}function x(N){return i++,r.push([n.currentConstruct,n.containerState]),v(N)}function _(N){if(N===null){s&&E(),j(0),e.consume(N);return}return s=s||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),C(N)}function C(N){if(N===null){k(e.exit("chunkFlow"),!0),j(0),e.consume(N);return}return qe(N)?(e.consume(N),k(e.exit("chunkFlow")),i=0,n.interrupt=void 0,d):(e.consume(N),C)}function k(N,M){const R=n.sliceStream(N);if(M&&R.push(null),N.previous=l,l&&(l.next=N),l=N,s.defineSkip(N.start),s.write(R),n.parser.lazy[N.start.line]){let z=s.events.length;for(;z--;)if(s.events[z][1].start.offset<u&&(!s.events[z][1].end||s.events[z][1].end.offset>u))return;const P=n.events.length;let D=P,$,U;for(;D--;)if(n.events[D][0]==="exit"&&n.events[D][1].type==="chunkFlow"){if($){U=n.events[D][1].end;break}$=!0}for(j(i),z=P;z<n.events.length;)n.events[z][1].end={...U},z++;vi(n.events,D+1,0,n.events.slice(P)),n.events.length=z}}function j(N){let M=r.length;for(;M-- >N;){const R=r[M];n.containerState=R[1],R[0].exit.call(n,e)}r.length=N}function E(){s.write([null]),l=void 0,s=void 0,n.containerState._closeFlow=void 0}}function $V(e,n,r){return Rt(e,e.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function dC(e){if(e===null||Wn(e)||IV(e))return 1;if(LV(e))return 2}function Kx(e,n,r){const i=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!i.includes(l)&&(n=l(n,r),i.push(l))}return n}const av={name:"attention",resolveAll:HV,tokenize:GV};function HV(e,n){let r=-1,i,s,l,u,d,h,p,g;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(i=r;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&n.sliceSerialize(e[i][1]).charCodeAt(0)===n.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const y={...e[i][1].end},v={...e[r][1].start};fC(y,-h),fC(v,h),u={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[i][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},l={type:h>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...d.end}},e[i][1].end={...u.start},e[r][1].start={...d.end},p=[],e[i][1].end.offset-e[i][1].start.offset&&(p=Mr(p,[["enter",e[i][1],n],["exit",e[i][1],n]])),p=Mr(p,[["enter",s,n],["enter",u,n],["exit",u,n],["enter",l,n]]),p=Mr(p,Kx(n.parser.constructs.insideSpan.null,e.slice(i+1,r),n)),p=Mr(p,[["exit",l,n],["enter",d,n],["exit",d,n],["exit",s,n]]),e[r][1].end.offset-e[r][1].start.offset?(g=2,p=Mr(p,[["enter",e[r][1],n],["exit",e[r][1],n]])):g=0,vi(e,i-1,r-i+3,p),r=i+p.length-g-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function GV(e,n){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,s=dC(i);let l;return u;function u(h){return l=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===l)return e.consume(h),d;const p=e.exit("attentionSequence"),g=dC(h),y=!g||g===2&&s||r.includes(h),v=!s||s===2&&g||r.includes(i);return p._open=!!(l===42?y:y&&(s||!v)),p._close=!!(l===42?v:v&&(g||!y)),n(h)}}function fC(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const qV={name:"autolink",tokenize:YV};function YV(e,n,r){let i=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(x){return di(x)?(e.consume(x),u):x===64?r(x):p(x)}function u(x){return x===43||x===45||x===46||cr(x)?(i=1,d(x)):p(x)}function d(x){return x===58?(e.consume(x),i=0,h):(x===43||x===45||x===46||cr(x))&&i++<32?(e.consume(x),d):(i=0,p(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),n):x===null||x===32||x===60||rv(x)?r(x):(e.consume(x),h)}function p(x){return x===64?(e.consume(x),g):OV(x)?(e.consume(x),p):r(x)}function g(x){return cr(x)?y(x):r(x)}function y(x){return x===46?(e.consume(x),i=0,g):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),n):v(x)}function v(x){if((x===45||cr(x))&&i++<63){const _=x===45?v:y;return e.consume(x),_}return r(x)}}const Yh={partial:!0,tokenize:XV};function XV(e,n,r){return i;function i(l){return ht(l)?Rt(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||qe(l)?n(l):r(l)}}const WT={continuation:{tokenize:WV},exit:ZV,name:"blockQuote",tokenize:KV};function KV(e,n,r){const i=this;return s;function s(u){if(u===62){const d=i.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return r(u)}function l(u){return ht(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function WV(e,n,r){const i=this;return s;function s(u){return ht(u)?Rt(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(WT,n,r)(u)}}function ZV(e){e.exit("blockQuote")}const ZT={name:"characterEscape",tokenize:QV};function QV(e,n,r){return i;function i(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return PV(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):r(l)}}const QT={name:"characterReference",tokenize:JV};function JV(e,n,r){const i=this;let s=0,l,u;return d;function d(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),l=31,u=cr,g(y))}function p(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=zV,g):(e.enter("characterReferenceValue"),l=7,u=iv,g(y))}function g(y){if(y===59&&s){const v=e.exit("characterReferenceValue");return u===cr&&!Xx(i.sliceSerialize(v))?r(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(y)&&s++<l?(e.consume(y),g):r(y)}}const hC={partial:!0,tokenize:tF},pC={concrete:!0,name:"codeFenced",tokenize:eF};function eF(e,n,r){const i=this,s={partial:!0,tokenize:R};let l=0,u=0,d;return h;function h(z){return p(z)}function p(z){const P=i.events[i.events.length-1];return l=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,d=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(z)}function g(z){return z===d?(u++,e.consume(z),g):u<3?r(z):(e.exit("codeFencedFenceSequence"),ht(z)?Rt(e,y,"whitespace")(z):y(z))}function y(z){return z===null||qe(z)?(e.exit("codeFencedFence"),i.interrupt?n(z):e.check(hC,C,M)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(z))}function v(z){return z===null||qe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(z)):ht(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Rt(e,x,"whitespace")(z)):z===96&&z===d?r(z):(e.consume(z),v)}function x(z){return z===null||qe(z)?y(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(z))}function _(z){return z===null||qe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(z)):z===96&&z===d?r(z):(e.consume(z),_)}function C(z){return e.attempt(s,M,k)(z)}function k(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),j}function j(z){return l>0&&ht(z)?Rt(e,E,"linePrefix",l+1)(z):E(z)}function E(z){return z===null||qe(z)?e.check(hC,C,M)(z):(e.enter("codeFlowValue"),N(z))}function N(z){return z===null||qe(z)?(e.exit("codeFlowValue"),E(z)):(e.consume(z),N)}function M(z){return e.exit("codeFenced"),n(z)}function R(z,P,D){let $=0;return U;function U(Z){return z.enter("lineEnding"),z.consume(Z),z.exit("lineEnding"),X}function X(Z){return z.enter("codeFencedFence"),ht(Z)?Rt(z,K,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):K(Z)}function K(Z){return Z===d?(z.enter("codeFencedFenceSequence"),ae(Z)):D(Z)}function ae(Z){return Z===d?($++,z.consume(Z),ae):$>=u?(z.exit("codeFencedFenceSequence"),ht(Z)?Rt(z,B,"whitespace")(Z):B(Z)):D(Z)}function B(Z){return Z===null||qe(Z)?(z.exit("codeFencedFence"),P(Z)):D(Z)}}}function tF(e,n,r){const i=this;return s;function s(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return i.parser.lazy[i.now().line]?r(u):n(u)}}const $g={name:"codeIndented",tokenize:rF},nF={partial:!0,tokenize:iF};function rF(e,n,r){const i=this;return s;function s(p){return e.enter("codeIndented"),Rt(e,l,"linePrefix",5)(p)}function l(p){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(p):r(p)}function u(p){return p===null?h(p):qe(p)?e.attempt(nF,u,h)(p):(e.enter("codeFlowValue"),d(p))}function d(p){return p===null||qe(p)?(e.exit("codeFlowValue"),u(p)):(e.consume(p),d)}function h(p){return e.exit("codeIndented"),n(p)}}function iF(e,n,r){const i=this;return s;function s(u){return i.parser.lazy[i.now().line]?r(u):qe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):Rt(e,l,"linePrefix",5)(u)}function l(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(u):qe(u)?s(u):r(u)}}const aF={name:"codeText",previous:oF,resolve:sF,tokenize:lF};function sF(e){let n=e.length-4,r=3,i,s;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(i=r;++i<n;)if(e[i][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(i=r-1,n++;++i<=n;)s===void 0?i!==n&&e[i][1].type!=="lineEnding"&&(s=i):(i===n||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),n-=i-s-2,i=s+2),s=void 0);return e}function oF(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function lF(e,n,r){let i=0,s,l;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),d(y)}function d(y){return y===96?(e.consume(y),i++,d):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?r(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(l=e.enter("codeTextSequence"),s=0,g(y)):qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),p(y))}function p(y){return y===null||y===32||y===96||qe(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),p)}function g(y){return y===96?(e.consume(y),s++,g):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),n(y)):(l.type="codeTextData",p(y))}}class uF{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(n,i):n>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(n,r,i){const s=r||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&pu(this.left,i),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),pu(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),pu(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const r=this.left.splice(n,Number.POSITIVE_INFINITY);pu(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);pu(this.left,r.reverse())}}}function pu(e,n){let r=0;if(n.length<1e4)e.push(...n);else for(;r<n.length;)e.push(...n.slice(r,r+1e4)),r+=1e4}function JT(e){const n={};let r=-1,i,s,l,u,d,h,p;const g=new uF(e);for(;++r<g.length;){for(;r in n;)r=n[r];if(i=g.get(r),r&&i[1].type==="chunkFlow"&&g.get(r-1)[1].type==="listItemPrefix"&&(h=i[1]._tokenizer.events,l=0,l<h.length&&h[l][1].type==="lineEndingBlank"&&(l+=2),l<h.length&&h[l][1].type==="content"))for(;++l<h.length&&h[l][1].type!=="content";)h[l][1].type==="chunkText"&&(h[l][1]._isInFirstContentOfListItem=!0,l++);if(i[0]==="enter")i[1].contentType&&(Object.assign(n,cF(g,r)),r=n[r],p=!0);else if(i[1]._container){for(l=r,s=void 0;l--;)if(u=g.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(i[1].end={...g.get(s)[1].start},d=g.slice(s,r),d.unshift(i),g.splice(s,r-s+1,d))}}return vi(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!p}function cF(e,n){const r=e.get(n)[1],i=e.get(n)[2];let s=n-1;const l=[];let u=r._tokenizer;u||(u=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const d=u.events,h=[],p={};let g,y,v=-1,x=r,_=0,C=0;const k=[C];for(;x;){for(;e.get(++s)[1]!==x;);l.push(s),x._tokenizer||(g=i.sliceStream(x),x.next||g.push(null),y&&u.defineSkip(x.start),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=x,x=x.next}for(x=r;++v<d.length;)d[v][0]==="exit"&&d[v-1][0]==="enter"&&d[v][1].type===d[v-1][1].type&&d[v][1].start.line!==d[v][1].end.line&&(C=v+1,k.push(C),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(u.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),v=k.length;v--;){const j=d.slice(k[v],k[v+1]),E=l.pop();h.push([E,E+j.length-1]),e.splice(E,2,j)}for(h.reverse(),v=-1;++v<h.length;)p[_+h[v][0]]=_+h[v][1],_+=h[v][1]-h[v][0]-1;return p}const dF={resolve:hF,tokenize:pF},fF={partial:!0,tokenize:mF};function hF(e){return JT(e),e}function pF(e,n){let r;return i;function i(d){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?l(d):qe(d)?e.check(fF,u,l)(d):(e.consume(d),s)}function l(d){return e.exit("chunkContent"),e.exit("content"),n(d)}function u(d){return e.consume(d),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,s}}function mF(e,n,r){const i=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Rt(e,l,"linePrefix")}function l(u){if(u===null||qe(u))return r(u);const d=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(u):e.interrupt(i.parser.constructs.flow,r,n)(u)}}function eA(e,n,r,i,s,l,u,d,h){const p=h||Number.POSITIVE_INFINITY;let g=0;return y;function y(j){return j===60?(e.enter(i),e.enter(s),e.enter(l),e.consume(j),e.exit(l),v):j===null||j===32||j===41||rv(j)?r(j):(e.enter(i),e.enter(u),e.enter(d),e.enter("chunkString",{contentType:"string"}),C(j))}function v(j){return j===62?(e.enter(l),e.consume(j),e.exit(l),e.exit(s),e.exit(i),n):(e.enter(d),e.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===62?(e.exit("chunkString"),e.exit(d),v(j)):j===null||j===60||qe(j)?r(j):(e.consume(j),j===92?_:x)}function _(j){return j===60||j===62||j===92?(e.consume(j),x):x(j)}function C(j){return!g&&(j===null||j===41||Wn(j))?(e.exit("chunkString"),e.exit(d),e.exit(u),e.exit(i),n(j)):g<p&&j===40?(e.consume(j),g++,C):j===41?(e.consume(j),g--,C):j===null||j===32||j===40||rv(j)?r(j):(e.consume(j),j===92?k:C)}function k(j){return j===40||j===41||j===92?(e.consume(j),C):C(j)}}function tA(e,n,r,i,s,l){const u=this;let d=0,h;return p;function p(x){return e.enter(i),e.enter(s),e.consume(x),e.exit(s),e.enter(l),g}function g(x){return d>999||x===null||x===91||x===93&&!h||x===94&&!d&&"_hiddenFootnoteSupport"in u.parser.constructs?r(x):x===93?(e.exit(l),e.enter(s),e.consume(x),e.exit(s),e.exit(i),n):qe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||qe(x)||d++>999?(e.exit("chunkString"),g(x)):(e.consume(x),h||(h=!ht(x)),x===92?v:y)}function v(x){return x===91||x===92||x===93?(e.consume(x),d++,y):y(x)}}function nA(e,n,r,i,s,l){let u;return d;function d(v){return v===34||v===39||v===40?(e.enter(i),e.enter(s),e.consume(v),e.exit(s),u=v===40?41:v,h):r(v)}function h(v){return v===u?(e.enter(s),e.consume(v),e.exit(s),e.exit(i),n):(e.enter(l),p(v))}function p(v){return v===u?(e.exit(l),h(u)):v===null?r(v):qe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Rt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===u||v===null||qe(v)?(e.exit("chunkString"),p(v)):(e.consume(v),v===92?y:g)}function y(v){return v===u||v===92?(e.consume(v),g):g(v)}}function Bu(e,n){let r;return i;function i(s){return qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,i):ht(s)?Rt(e,i,r?"linePrefix":"lineSuffix")(s):n(s)}}const gF={name:"definition",tokenize:vF},yF={partial:!0,tokenize:xF};function vF(e,n,r){const i=this;let s;return l;function l(x){return e.enter("definition"),u(x)}function u(x){return tA.call(i,e,d,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function d(x){return s=Wo(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):r(x)}function h(x){return Wn(x)?Bu(e,p)(x):p(x)}function p(x){return eA(e,g,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(yF,y,y)(x)}function y(x){return ht(x)?Rt(e,v,"whitespace")(x):v(x)}function v(x){return x===null||qe(x)?(e.exit("definition"),i.parser.defined.push(s),n(x)):r(x)}}function xF(e,n,r){return i;function i(d){return Wn(d)?Bu(e,s)(d):r(d)}function s(d){return nA(e,l,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return ht(d)?Rt(e,u,"whitespace")(d):u(d)}function u(d){return d===null||qe(d)?n(d):r(d)}}const bF={name:"hardBreakEscape",tokenize:wF};function wF(e,n,r){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return qe(l)?(e.exit("hardBreakEscape"),n(l)):r(l)}}const SF={name:"headingAtx",resolve:_F,tokenize:CF};function _F(e,n){let r=e.length-2,i=3,s,l;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},l={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},vi(e,i,r-i+1,[["enter",s,n],["enter",l,n],["exit",l,n],["exit",s,n]])),e}function CF(e,n,r){let i=0;return s;function s(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&i++<6?(e.consume(g),u):g===null||Wn(g)?(e.exit("atxHeadingSequence"),d(g)):r(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||qe(g)?(e.exit("atxHeading"),n(g)):ht(g)?Rt(e,d,"whitespace")(g):(e.enter("atxHeadingText"),p(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),d(g))}function p(g){return g===null||g===35||Wn(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),p)}}const jF=["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"],mC=["pre","script","style","textarea"],kF={concrete:!0,name:"htmlFlow",resolveTo:TF,tokenize:AF},EF={partial:!0,tokenize:MF},NF={partial:!0,tokenize:RF};function TF(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function AF(e,n,r){const i=this;let s,l,u,d,h;return p;function p(L){return g(L)}function g(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),y}function y(L){return L===33?(e.consume(L),v):L===47?(e.consume(L),l=!0,C):L===63?(e.consume(L),s=3,i.interrupt?n:A):di(L)?(e.consume(L),u=String.fromCharCode(L),k):r(L)}function v(L){return L===45?(e.consume(L),s=2,x):L===91?(e.consume(L),s=5,d=0,_):di(L)?(e.consume(L),s=4,i.interrupt?n:A):r(L)}function x(L){return L===45?(e.consume(L),i.interrupt?n:A):r(L)}function _(L){const ee="CDATA[";return L===ee.charCodeAt(d++)?(e.consume(L),d===ee.length?i.interrupt?n:K:_):r(L)}function C(L){return di(L)?(e.consume(L),u=String.fromCharCode(L),k):r(L)}function k(L){if(L===null||L===47||L===62||Wn(L)){const ee=L===47,ce=u.toLowerCase();return!ee&&!l&&mC.includes(ce)?(s=1,i.interrupt?n(L):K(L)):jF.includes(u.toLowerCase())?(s=6,ee?(e.consume(L),j):i.interrupt?n(L):K(L)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(L):l?E(L):N(L))}return L===45||cr(L)?(e.consume(L),u+=String.fromCharCode(L),k):r(L)}function j(L){return L===62?(e.consume(L),i.interrupt?n:K):r(L)}function E(L){return ht(L)?(e.consume(L),E):U(L)}function N(L){return L===47?(e.consume(L),U):L===58||L===95||di(L)?(e.consume(L),M):ht(L)?(e.consume(L),N):U(L)}function M(L){return L===45||L===46||L===58||L===95||cr(L)?(e.consume(L),M):R(L)}function R(L){return L===61?(e.consume(L),z):ht(L)?(e.consume(L),R):N(L)}function z(L){return L===null||L===60||L===61||L===62||L===96?r(L):L===34||L===39?(e.consume(L),h=L,P):ht(L)?(e.consume(L),z):D(L)}function P(L){return L===h?(e.consume(L),h=null,$):L===null||qe(L)?r(L):(e.consume(L),P)}function D(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Wn(L)?R(L):(e.consume(L),D)}function $(L){return L===47||L===62||ht(L)?N(L):r(L)}function U(L){return L===62?(e.consume(L),X):r(L)}function X(L){return L===null||qe(L)?K(L):ht(L)?(e.consume(L),X):r(L)}function K(L){return L===45&&s===2?(e.consume(L),O):L===60&&s===1?(e.consume(L),q):L===62&&s===4?(e.consume(L),F):L===63&&s===3?(e.consume(L),A):L===93&&s===5?(e.consume(L),H):qe(L)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(EF,G,ae)(L)):L===null||qe(L)?(e.exit("htmlFlowData"),ae(L)):(e.consume(L),K)}function ae(L){return e.check(NF,B,G)(L)}function B(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Z}function Z(L){return L===null||qe(L)?ae(L):(e.enter("htmlFlowData"),K(L))}function O(L){return L===45?(e.consume(L),A):K(L)}function q(L){return L===47?(e.consume(L),u="",I):K(L)}function I(L){if(L===62){const ee=u.toLowerCase();return mC.includes(ee)?(e.consume(L),F):K(L)}return di(L)&&u.length<8?(e.consume(L),u+=String.fromCharCode(L),I):K(L)}function H(L){return L===93?(e.consume(L),A):K(L)}function A(L){return L===62?(e.consume(L),F):L===45&&s===2?(e.consume(L),A):K(L)}function F(L){return L===null||qe(L)?(e.exit("htmlFlowData"),G(L)):(e.consume(L),F)}function G(L){return e.exit("htmlFlow"),n(L)}}function RF(e,n,r){const i=this;return s;function s(u){return qe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):r(u)}function l(u){return i.parser.lazy[i.now().line]?r(u):n(u)}}function MF(e,n,r){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Yh,n,r)}}const DF={name:"htmlText",tokenize:OF};function OF(e,n,r){const i=this;let s,l,u;return d;function d(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),p):A===47?(e.consume(A),R):A===63?(e.consume(A),N):di(A)?(e.consume(A),D):r(A)}function p(A){return A===45?(e.consume(A),g):A===91?(e.consume(A),l=0,_):di(A)?(e.consume(A),E):r(A)}function g(A){return A===45?(e.consume(A),x):r(A)}function y(A){return A===null?r(A):A===45?(e.consume(A),v):qe(A)?(u=y,q(A)):(e.consume(A),y)}function v(A){return A===45?(e.consume(A),x):y(A)}function x(A){return A===62?O(A):A===45?v(A):y(A)}function _(A){const F="CDATA[";return A===F.charCodeAt(l++)?(e.consume(A),l===F.length?C:_):r(A)}function C(A){return A===null?r(A):A===93?(e.consume(A),k):qe(A)?(u=C,q(A)):(e.consume(A),C)}function k(A){return A===93?(e.consume(A),j):C(A)}function j(A){return A===62?O(A):A===93?(e.consume(A),j):C(A)}function E(A){return A===null||A===62?O(A):qe(A)?(u=E,q(A)):(e.consume(A),E)}function N(A){return A===null?r(A):A===63?(e.consume(A),M):qe(A)?(u=N,q(A)):(e.consume(A),N)}function M(A){return A===62?O(A):N(A)}function R(A){return di(A)?(e.consume(A),z):r(A)}function z(A){return A===45||cr(A)?(e.consume(A),z):P(A)}function P(A){return qe(A)?(u=P,q(A)):ht(A)?(e.consume(A),P):O(A)}function D(A){return A===45||cr(A)?(e.consume(A),D):A===47||A===62||Wn(A)?$(A):r(A)}function $(A){return A===47?(e.consume(A),O):A===58||A===95||di(A)?(e.consume(A),U):qe(A)?(u=$,q(A)):ht(A)?(e.consume(A),$):O(A)}function U(A){return A===45||A===46||A===58||A===95||cr(A)?(e.consume(A),U):X(A)}function X(A){return A===61?(e.consume(A),K):qe(A)?(u=X,q(A)):ht(A)?(e.consume(A),X):$(A)}function K(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),s=A,ae):qe(A)?(u=K,q(A)):ht(A)?(e.consume(A),K):(e.consume(A),B)}function ae(A){return A===s?(e.consume(A),s=void 0,Z):A===null?r(A):qe(A)?(u=ae,q(A)):(e.consume(A),ae)}function B(A){return A===null||A===34||A===39||A===60||A===61||A===96?r(A):A===47||A===62||Wn(A)?$(A):(e.consume(A),B)}function Z(A){return A===47||A===62||Wn(A)?$(A):r(A)}function O(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),n):r(A)}function q(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),I}function I(A){return ht(A)?Rt(e,H,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):H(A)}function H(A){return e.enter("htmlTextData"),u(A)}}const Wx={name:"labelEnd",resolveAll:IF,resolveTo:VF,tokenize:FF},zF={tokenize:UF},PF={tokenize:BF},LF={tokenize:$F};function IF(e){let n=-1;const r=[];for(;++n<e.length;){const i=e[n][1];if(r.push(e[n]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",n+=s}}return e.length!==r.length&&vi(e,0,e.length,r),e}function VF(e,n){let r=e.length,i=0,s,l,u,d;for(;r--;)if(s=e[r][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[r][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=r,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(u=r);const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[l+i+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",h,n],["enter",p,n]],d=Mr(d,e.slice(l+1,l+i+3)),d=Mr(d,[["enter",g,n]]),d=Mr(d,Kx(n.parser.constructs.insideSpan.null,e.slice(l+i+4,u-3),n)),d=Mr(d,[["exit",g,n],e[u-2],e[u-1],["exit",p,n]]),d=Mr(d,e.slice(u+1)),d=Mr(d,[["exit",h,n]]),vi(e,l,e.length,d),e}function FF(e,n,r){const i=this;let s=i.events.length,l,u;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){l=i.events[s][1];break}return d;function d(v){return l?l._inactive?y(v):(u=i.parser.defined.includes(Wo(i.sliceSerialize({start:l.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):r(v)}function h(v){return v===40?e.attempt(zF,g,u?g:y)(v):v===91?e.attempt(PF,g,u?p:y)(v):u?g(v):y(v)}function p(v){return e.attempt(LF,g,y)(v)}function g(v){return n(v)}function y(v){return l._balanced=!0,r(v)}}function UF(e,n,r){return i;function i(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),s}function s(y){return Wn(y)?Bu(e,l)(y):l(y)}function l(y){return y===41?g(y):eA(e,u,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return Wn(y)?Bu(e,h)(y):g(y)}function d(y){return r(y)}function h(y){return y===34||y===39||y===40?nA(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function p(y){return Wn(y)?Bu(e,g)(y):g(y)}function g(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),n):r(y)}}function BF(e,n,r){const i=this;return s;function s(d){return tA.call(i,e,l,u,"reference","referenceMarker","referenceString")(d)}function l(d){return i.parser.defined.includes(Wo(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?n(d):r(d)}function u(d){return r(d)}}function $F(e,n,r){return i;function i(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):r(l)}}const HF={name:"labelStartImage",resolveAll:Wx.resolveAll,tokenize:GF};function GF(e,n,r){const i=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),l}function l(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),u):r(d)}function u(d){return d===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(d):n(d)}}const qF={name:"labelStartLink",resolveAll:Wx.resolveAll,tokenize:YF};function YF(e,n,r){const i=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(u):n(u)}}const Hg={name:"lineEnding",tokenize:XF};function XF(e,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Rt(e,n,"linePrefix")}}const Af={name:"thematicBreak",tokenize:KF};function KF(e,n,r){let i=0,s;return l;function l(p){return e.enter("thematicBreak"),u(p)}function u(p){return s=p,d(p)}function d(p){return p===s?(e.enter("thematicBreakSequence"),h(p)):i>=3&&(p===null||qe(p))?(e.exit("thematicBreak"),n(p)):r(p)}function h(p){return p===s?(e.consume(p),i++,h):(e.exit("thematicBreakSequence"),ht(p)?Rt(e,d,"whitespace")(p):d(p))}}const Yn={continuation:{tokenize:JF},exit:tU,name:"list",tokenize:QF},WF={partial:!0,tokenize:nU},ZF={partial:!0,tokenize:eU};function QF(e,n,r){const i=this,s=i.events[i.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return d;function d(x){const _=i.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!i.containerState.marker||x===i.containerState.marker:iv(x)){if(i.containerState.type||(i.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Af,r,p)(x):p(x);if(!i.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return r(x)}function h(x){return iv(x)&&++u<10?(e.consume(x),h):(!i.interrupt||u<2)&&(i.containerState.marker?x===i.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),p(x)):r(x)}function p(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||x,e.check(Yh,i.interrupt?r:g,e.attempt(WF,v,y))}function g(x){return i.containerState.initialBlankLine=!0,l++,v(x)}function y(x){return ht(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),v):r(x)}function v(x){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(x)}}function JF(e,n,r){const i=this;return i.containerState._closeFlow=void 0,e.check(Yh,s,l);function s(d){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Rt(e,n,"listItemIndent",i.containerState.size+1)(d)}function l(d){return i.containerState.furtherBlankLines||!ht(d)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(d)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(ZF,n,u)(d))}function u(d){return i.containerState._closeFlow=!0,i.interrupt=void 0,Rt(e,e.attempt(Yn,n,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function eU(e,n,r){const i=this;return Rt(e,s,"listItemIndent",i.containerState.size+1);function s(l){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?n(l):r(l)}}function tU(e){e.exit(this.containerState.type)}function nU(e,n,r){const i=this;return Rt(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const u=i.events[i.events.length-1];return!ht(l)&&u&&u[1].type==="listItemPrefixWhitespace"?n(l):r(l)}}const gC={name:"setextUnderline",resolveTo:rU,tokenize:iU};function rU(e,n){let r=e.length,i,s,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&e.splice(r,1),!l&&e[r][1].type==="definition"&&(l=r);const u={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",u,n]),e.splice(l+1,0,["exit",e[i][1],n]),e[i][1].end={...e[l][1].end}):e[i][1]=u,e.push(["exit",u,n]),e}function iU(e,n,r){const i=this;let s;return l;function l(p){let g=i.events.length,y;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){y=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||y)?(e.enter("setextHeadingLine"),s=p,u(p)):r(p)}function u(p){return e.enter("setextHeadingLineSequence"),d(p)}function d(p){return p===s?(e.consume(p),d):(e.exit("setextHeadingLineSequence"),ht(p)?Rt(e,h,"lineSuffix")(p):h(p))}function h(p){return p===null||qe(p)?(e.exit("setextHeadingLine"),n(p)):r(p)}}const aU={tokenize:sU};function sU(e){const n=this,r=e.attempt(Yh,i,e.attempt(this.parser.constructs.flowInitial,s,Rt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(dF,s)),"linePrefix")));return r;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,r}}const oU={resolveAll:iA()},lU=rA("string"),uU=rA("text");function rA(e){return{resolveAll:iA(e==="text"?cU:void 0),tokenize:n};function n(r){const i=this,s=this.parser.constructs[e],l=r.attempt(s,u,d);return u;function u(g){return p(g)?l(g):d(g)}function d(g){if(g===null){r.consume(g);return}return r.enter("data"),r.consume(g),h}function h(g){return p(g)?(r.exit("data"),l(g)):(r.consume(g),h)}function p(g){if(g===null)return!0;const y=s[g];let v=-1;if(y)for(;++v<y.length;){const x=y[v];if(!x.previous||x.previous.call(i,i.previous))return!0}return!1}}}function iA(e){return n;function n(r,i){let s=-1,l;for(;++s<=r.length;)l===void 0?r[s]&&r[s][1].type==="data"&&(l=s,s++):(!r[s]||r[s][1].type!=="data")&&(s!==l+2&&(r[l][1].end=r[s-1][1].end,r.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(r,i):r}}function cU(e,n){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],s=n.sliceStream(i);let l=s.length,u=-1,d=0,h;for(;l--;){const p=s[l];if(typeof p=="string"){for(u=p.length;p.charCodeAt(u-1)===32;)d++,u--;if(u)break;u=-1}else if(p===-2)h=!0,d++;else if(p!==-1){l++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(d=0),d){const p={type:r===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:i.start._bufferIndex+u,_index:i.start._index+l,line:i.end.line,column:i.end.column-d,offset:i.end.offset-d},end:{...i.end}};i.end={...p.start},i.start.offset===i.end.offset?Object.assign(i,p):(e.splice(r,0,["enter",p,n],["exit",p,n]),r+=2)}r++}return e}const dU={42:Yn,43:Yn,45:Yn,48:Yn,49:Yn,50:Yn,51:Yn,52:Yn,53:Yn,54:Yn,55:Yn,56:Yn,57:Yn,62:WT},fU={91:gF},hU={[-2]:$g,[-1]:$g,32:$g},pU={35:SF,42:Af,45:[gC,Af],60:kF,61:gC,95:Af,96:pC,126:pC},mU={38:QT,92:ZT},gU={[-5]:Hg,[-4]:Hg,[-3]:Hg,33:HF,38:QT,42:av,60:[qV,DF],91:qF,92:[bF,ZT],93:Wx,95:av,96:aF},yU={null:[av,oU]},vU={null:[42,95]},xU={null:[]},bU=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:vU,contentInitial:fU,disable:xU,document:dU,flow:pU,flowInitial:hU,insideSpan:yU,string:mU,text:gU},Symbol.toStringTag,{value:"Module"}));function wU(e,n,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const s={},l=[];let u=[],d=[];const h={attempt:P(R),check:P(z),consume:E,enter:N,exit:M,interrupt:P(z,{interrupt:!0})},p={code:null,containerState:{},defineSkip:C,events:[],now:_,parser:e,previous:null,sliceSerialize:v,sliceStream:x,write:y};let g=n.tokenize.call(p,h);return n.resolveAll&&l.push(n),p;function y(X){return u=Mr(u,X),k(),u[u.length-1]!==null?[]:(D(n,0),p.events=Kx(l,p.events,p),p.events)}function v(X,K){return _U(x(X),K)}function x(X){return SU(u,X)}function _(){const{_bufferIndex:X,_index:K,line:ae,column:B,offset:Z}=i;return{_bufferIndex:X,_index:K,line:ae,column:B,offset:Z}}function C(X){s[X.line]=X.column,U()}function k(){let X;for(;i._index<u.length;){const K=u[i._index];if(typeof K=="string")for(X=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===X&&i._bufferIndex<K.length;)j(K.charCodeAt(i._bufferIndex));else j(K)}}function j(X){g=g(X)}function E(X){qe(X)?(i.line++,i.column=1,i.offset+=X===-3?2:1,U()):X!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),p.previous=X}function N(X,K){const ae=K||{};return ae.type=X,ae.start=_(),p.events.push(["enter",ae,p]),d.push(ae),ae}function M(X){const K=d.pop();return K.end=_(),p.events.push(["exit",K,p]),K}function R(X,K){D(X,K.from)}function z(X,K){K.restore()}function P(X,K){return ae;function ae(B,Z,O){let q,I,H,A;return Array.isArray(B)?G(B):"tokenize"in B?G([B]):F(B);function F(Y){return Q;function Q(re){const fe=re!==null&&Y[re],we=re!==null&&Y.null,ke=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(we)?we:we?[we]:[]];return G(ke)(re)}}function G(Y){return q=Y,I=0,Y.length===0?O:L(Y[I])}function L(Y){return Q;function Q(re){return A=$(),H=Y,Y.partial||(p.currentConstruct=Y),Y.name&&p.parser.constructs.disable.null.includes(Y.name)?ce():Y.tokenize.call(K?Object.assign(Object.create(p),K):p,h,ee,ce)(re)}}function ee(Y){return X(H,A),Z}function ce(Y){return A.restore(),++I<q.length?L(q[I]):O}}}function D(X,K){X.resolveAll&&!l.includes(X)&&l.push(X),X.resolve&&vi(p.events,K,p.events.length-K,X.resolve(p.events.slice(K),p)),X.resolveTo&&(p.events=X.resolveTo(p.events,p))}function $(){const X=_(),K=p.previous,ae=p.currentConstruct,B=p.events.length,Z=Array.from(d);return{from:B,restore:O};function O(){i=X,p.previous=K,p.currentConstruct=ae,p.events.length=B,d=Z,U()}}function U(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function SU(e,n){const r=n.start._index,i=n.start._bufferIndex,s=n.end._index,l=n.end._bufferIndex;let u;if(r===s)u=[e[r].slice(i,l)];else{if(u=e.slice(r,s),i>-1){const d=u[0];typeof d=="string"?u[0]=d.slice(i):u.shift()}l>0&&u.push(e[s].slice(0,l))}return u}function _U(e,n){let r=-1;const i=[];let s;for(;++r<e.length;){const l=e[r];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=`
|
|
57
|
+
`;break}case-3:{u=`\r
|
|
58
|
+
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&s)continue;u=" ";break}default:u=String.fromCharCode(l)}s=l===-2,i.push(u)}return i.join("")}function CU(e){const i={constructs:RV([bU,...(e||{}).extensions||[]]),content:s(VV),defined:[],document:s(UV),flow:s(aU),lazy:{},string:s(lU),text:s(uU)};return i;function s(l){return u;function u(d){return wU(i,l,d)}}}function jU(e){for(;!JT(e););return e}const yC=/[\0\t\n\r]/g;function kU(){let e=1,n="",r=!0,i;return s;function s(l,u,d){const h=[];let p,g,y,v,x;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),y=0,n="",r&&(l.charCodeAt(0)===65279&&y++,r=void 0);y<l.length;){if(yC.lastIndex=y,p=yC.exec(l),v=p&&p.index!==void 0?p.index:l.length,x=l.charCodeAt(v),!p){n=l.slice(y);break}if(x===10&&y===v&&i)h.push(-3),i=void 0;else switch(i&&(h.push(-5),i=void 0),y<v&&(h.push(l.slice(y,v)),e+=v-y),x){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:i=!0,e=1}y=v+1}return d&&(i&&h.push(-5),n&&h.push(n),h.push(null)),h}}const EU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function NU(e){return e.replace(EU,TU)}function TU(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){const s=r.charCodeAt(1),l=s===120||s===88;return KT(r.slice(l?2:1),l?16:10)}return Xx(r)||e}const aA={}.hasOwnProperty;function AU(e,n,r){return n&&typeof n=="object"&&(r=n,n=void 0),RU(r)(jU(CU(r).document().write(kU()(e,n,!0))))}function RU(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ut),autolinkProtocol:$,autolinkEmail:$,atxHeading:l(cn),blockQuote:l(we),characterEscape:$,characterReference:$,codeFenced:l(ke),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(ke,u),codeText:l(Ie,u),codeTextData:$,data:$,codeFlowValue:$,definition:l(et),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(lt),hardBreakEscape:l(yt),hardBreakTrailing:l(yt),htmlFlow:l(me,u),htmlFlowData:$,htmlText:l(me,u),htmlTextData:$,image:l(Le),label:u,link:l(ut),listItem:l(Ut),listItemValue:v,listOrdered:l(Zt,y),listUnordered:l(Zt),paragraph:l(Cn),reference:L,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(cn),strong:l(nn),thematicBreak:l(mn)},exit:{atxHeading:h(),atxHeadingSequence:R,autolink:h(),autolinkEmail:fe,autolinkProtocol:re,blockQuote:h(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:Y,characterReference:Q,codeFenced:h(k),codeFencedFence:C,codeFencedFenceInfo:x,codeFencedFenceMeta:_,codeFlowValue:U,codeIndented:h(j),codeText:h(Z),codeTextData:U,data:U,definition:h(),definitionDestinationString:M,definitionLabelString:E,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(K),hardBreakTrailing:h(K),htmlFlow:h(ae),htmlFlowData:U,htmlText:h(B),htmlTextData:U,image:h(q),label:H,labelText:I,lineEnding:X,link:h(O),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ee,resourceDestinationString:A,resourceTitleString:F,resource:G,setextHeading:h(D),setextHeadingLineSequence:P,setextHeadingText:z,strong:h(),thematicBreak:h()}};sA(n,(e||{}).mdastExtensions||[]);const r={};return i;function i(he){let Se={type:"root",children:[]};const Oe={stack:[Se],tokenStack:[],config:n,enter:d,exit:p,buffer:u,resume:g,data:r},W=[];let ve=-1;for(;++ve<he.length;)if(he[ve][1].type==="listOrdered"||he[ve][1].type==="listUnordered")if(he[ve][0]==="enter")W.push(ve);else{const st=W.pop();ve=s(he,st,ve)}for(ve=-1;++ve<he.length;){const st=n[he[ve][0]];aA.call(st,he[ve][1].type)&&st[he[ve][1].type].call(Object.assign({sliceSerialize:he[ve][2].sliceSerialize},Oe),he[ve][1])}if(Oe.tokenStack.length>0){const st=Oe.tokenStack[Oe.tokenStack.length-1];(st[1]||vC).call(Oe,void 0,st[0])}for(Se.position={start:Oa(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Oa(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},ve=-1;++ve<n.transforms.length;)Se=n.transforms[ve](Se)||Se;return Se}function s(he,Se,Oe){let W=Se-1,ve=-1,st=!1,jt,kt,Tt,jn;for(;++W<=Oe;){const pt=he[W];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?ve++:ve--,jn=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(jt&&!jn&&!ve&&!Tt&&(Tt=W),jn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:jn=void 0}if(!ve&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||ve===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(jt){let kn=W;for(kt=void 0;kn--;){const rn=he[kn];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;kt&&(he[kt][1].type="lineEndingBlank",st=!0),rn[1].type="lineEnding",kt=kn}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}Tt&&(!kt||Tt<kt)&&(jt._spread=!0),jt.end=Object.assign({},kt?he[kt][1].start:pt[1].end),he.splice(kt||W,0,["exit",jt,pt[2]]),W++,Oe++}if(pt[1].type==="listItemPrefix"){const kn={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};jt=kn,he.splice(W,0,["enter",kn,pt[2]]),W++,Oe++,Tt=void 0,jn=!0}}}return he[Se][1]._spread=st,Oe}function l(he,Se){return Oe;function Oe(W){d.call(this,he(W),W),Se&&Se.call(this,W)}}function u(){this.stack.push({type:"fragment",children:[]})}function d(he,Se,Oe){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Se,Oe||void 0]),he.position={start:Oa(Se.start),end:void 0}}function h(he){return Se;function Se(Oe){he&&he.call(this,Oe),p.call(this,Oe)}}function p(he,Se){const Oe=this.stack.pop(),W=this.tokenStack.pop();if(W)W[0].type!==he.type&&(Se?Se.call(this,he,W[0]):(W[1]||vC).call(this,he,W[0]));else throw new Error("Cannot close `"+he.type+"` ("+Uu({start:he.start,end:he.end})+"): it’s not open");Oe.position.end=Oa(he.end)}function g(){return TV(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(he){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function x(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=he}function _(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=he}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/(\r?\n|\r)$/g,"")}function E(he){const Se=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=Se,Oe.identifier=Wo(this.sliceSerialize(he)).toLowerCase()}function N(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function M(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function R(he){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Oe=this.sliceSerialize(he).length;Se.depth=Oe}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function P(he){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function $(he){const Oe=this.stack[this.stack.length-1].children;let W=Oe[Oe.length-1];(!W||W.type!=="text")&&(W=wt(),W.position={start:Oa(he.start),end:void 0},Oe.push(W)),this.stack.push(W)}function U(he){const Se=this.stack.pop();Se.value+=this.sliceSerialize(he),Se.position.end=Oa(he.end)}function X(he){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=Se.children[Se.children.length-1];Oe.position.end=Oa(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(Se.type)&&($.call(this,he),U.call(this,he))}function K(){this.data.atHardBreak=!0}function ae(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function B(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function Z(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function O(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function q(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function I(he){const Se=this.sliceSerialize(he),Oe=this.stack[this.stack.length-2];Oe.label=NU(Se),Oe.identifier=Wo(Se).toLowerCase()}function H(){const he=this.stack[this.stack.length-1],Se=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const W=he.children;Oe.children=W}else Oe.alt=Se}function A(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function F(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function G(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ee(he){const Se=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=Se,Oe.identifier=Wo(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function ce(he){this.data.characterReferenceType=he.type}function Y(he){const Se=this.sliceSerialize(he),Oe=this.data.characterReferenceType;let W;Oe?(W=KT(Se,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):W=Xx(Se);const ve=this.stack[this.stack.length-1];ve.value+=W}function Q(he){const Se=this.stack.pop();Se.position.end=Oa(he.end)}function re(he){U.call(this,he);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(he)}function fe(he){U.call(this,he);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(he)}function we(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function Ie(){return{type:"inlineCode",value:""}}function et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function lt(){return{type:"emphasis",children:[]}}function cn(){return{type:"heading",depth:0,children:[]}}function yt(){return{type:"break"}}function me(){return{type:"html",value:""}}function Le(){return{type:"image",title:null,url:"",alt:null}}function ut(){return{type:"link",title:null,url:"",children:[]}}function Zt(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ut(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Cn(){return{type:"paragraph",children:[]}}function nn(){return{type:"strong",children:[]}}function wt(){return{type:"text",value:""}}function mn(){return{type:"thematicBreak"}}}function Oa(e){return{line:e.line,column:e.column,offset:e.offset}}function sA(e,n){let r=-1;for(;++r<n.length;){const i=n[r];Array.isArray(i)?sA(e,i):MU(e,i)}}function MU(e,n){let r;for(r in n)if(aA.call(n,r))switch(r){case"canContainEols":{const i=n[r];i&&e[r].push(...i);break}case"transforms":{const i=n[r];i&&e[r].push(...i);break}case"enter":case"exit":{const i=n[r];i&&Object.assign(e[r],i);break}}}function vC(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Uu({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Uu({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Uu({start:n.start,end:n.end})+") is still open")}function DU(e){const n=this;n.parser=r;function r(i){return AU(i,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function OU(e,n){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,r),e.applyData(n,r)}function zU(e,n){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,r),[e.applyData(n,r),{type:"text",value:`
|
|
59
|
+
`}]}function PU(e,n){const r=n.value?n.value+`
|
|
60
|
+
`:"",i={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(i.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function LU(e,n){const r={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function IU(e,n){const r={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function VU(e,n){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(n.identifier).toUpperCase(),s=ml(i.toLowerCase()),l=e.footnoteOrder.indexOf(i);let u,d=e.footnoteCounts.get(i);d===void 0?(d=0,e.footnoteOrder.push(i),u=e.footnoteOrder.length):u=l+1,d+=1,e.footnoteCounts.set(i,d);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+s,id:r+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,h);const p={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(n,p),e.applyData(n,p)}function FU(e,n){const r={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function UU(e,n){if(e.options.allowDangerousHtml){const r={type:"raw",value:n.value};return e.patch(n,r),e.applyData(n,r)}}function oA(e,n){const r=n.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+i}];const s=e.all(n),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const u=s[s.length-1];return u&&u.type==="text"?u.value+=i:s.push({type:"text",value:i}),s}function BU(e,n){const r=String(n.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return oA(e,n);const s={src:ml(i.url||""),alt:n.alt};i.title!==null&&i.title!==void 0&&(s.title=i.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,l),e.applyData(n,l)}function $U(e,n){const r={src:ml(n.url)};n.alt!==null&&n.alt!==void 0&&(r.alt=n.alt),n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,i),e.applyData(n,i)}function HU(e,n){const r={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(n,i),e.applyData(n,i)}function GU(e,n){const r=String(n.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return oA(e,n);const s={href:ml(i.url||"")};i.title!==null&&i.title!==void 0&&(s.title=i.title);const l={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function qU(e,n){const r={href:ml(n.url)};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function YU(e,n,r){const i=e.all(n),s=r?XU(r):lA(n),l={},u=[];if(typeof n.checked=="boolean"){const g=i[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},i.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let d=-1;for(;++d<i.length;){const g=i[d];(s||d!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
|
61
|
+
`}),g.type==="element"&&g.tagName==="p"&&!s?u.push(...g.children):u.push(g)}const h=i[i.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
62
|
+
`});const p={type:"element",tagName:"li",properties:l,children:u};return e.patch(n,p),e.applyData(n,p)}function XU(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const r=e.children;let i=-1;for(;!n&&++i<r.length;)n=lA(r[i])}return n}function lA(e){const n=e.spread;return n??e.children.length>1}function KU(e,n){const r={},i=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(r.start=n.start);++s<i.length;){const u=i[s];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const l={type:"element",tagName:n.ordered?"ol":"ul",properties:r,children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function WU(e,n){const r={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function ZU(e,n){const r={type:"root",children:e.wrap(e.all(n))};return e.patch(n,r),e.applyData(n,r)}function QU(e,n){const r={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function JU(e,n){const r=e.all(n),i=r.shift(),s=[];if(i){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(n.children[0],u),s.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},d=Hx(n.children[1]),h=BT(n.children[n.children.length-1]);d&&h&&(u.position={start:d,end:h}),s.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,l),e.applyData(n,l)}function eB(e,n,r){const i=r?r.children:void 0,l=(i?i.indexOf(n):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,d=u?u.length:n.children.length;let h=-1;const p=[];for(;++h<d;){const y=n.children[h],v={},x=u?u[h]:void 0;x&&(v.align=x);let _={type:"element",tagName:l,properties:v,children:[]};y&&(_.children=e.all(y),e.patch(y,_),_=e.applyData(y,_)),p.push(_)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,g),e.applyData(n,g)}function tB(e,n){const r={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}const xC=9,bC=32;function nB(e){const n=String(e),r=/\r?\n|\r/g;let i=r.exec(n),s=0;const l=[];for(;i;)l.push(wC(n.slice(s,i.index),s>0,!0),i[0]),s=i.index+i[0].length,i=r.exec(n);return l.push(wC(n.slice(s),s>0,!1)),l.join("")}function wC(e,n,r){let i=0,s=e.length;if(n){let l=e.codePointAt(i);for(;l===xC||l===bC;)i++,l=e.codePointAt(i)}if(r){let l=e.codePointAt(s-1);for(;l===xC||l===bC;)s--,l=e.codePointAt(s-1)}return s>i?e.slice(i,s):""}function rB(e,n){const r={type:"text",value:nB(String(n.value))};return e.patch(n,r),e.applyData(n,r)}function iB(e,n){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,r),e.applyData(n,r)}const aB={blockquote:OU,break:zU,code:PU,delete:LU,emphasis:IU,footnoteReference:VU,heading:FU,html:UU,imageReference:BU,image:$U,inlineCode:HU,linkReference:GU,link:qU,listItem:YU,list:KU,paragraph:WU,root:ZU,strong:QU,table:JU,tableCell:tB,tableRow:eB,text:rB,thematicBreak:iB,toml:lf,yaml:lf,definition:lf,footnoteDefinition:lf};function lf(){}const uA=-1,Xh=0,$u=1,Zf=2,Zx=3,Qx=4,Jx=5,e0=6,cA=7,dA=8,SC=typeof self=="object"?self:globalThis,sB=(e,n)=>{const r=(s,l)=>(e.set(l,s),s),i=s=>{if(e.has(s))return e.get(s);const[l,u]=n[s];switch(l){case Xh:case uA:return r(u,s);case $u:{const d=r([],s);for(const h of u)d.push(i(h));return d}case Zf:{const d=r({},s);for(const[h,p]of u)d[i(h)]=i(p);return d}case Zx:return r(new Date(u),s);case Qx:{const{source:d,flags:h}=u;return r(new RegExp(d,h),s)}case Jx:{const d=r(new Map,s);for(const[h,p]of u)d.set(i(h),i(p));return d}case e0:{const d=r(new Set,s);for(const h of u)d.add(i(h));return d}case cA:{const{name:d,message:h}=u;return r(new SC[d](h),s)}case dA:return r(BigInt(u),s);case"BigInt":return r(Object(BigInt(u)),s);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:d}=new Uint8Array(u);return r(new DataView(d),u)}}return r(new SC[l](u),s)};return i},_C=e=>sB(new Map,e)(0),zo="",{toString:oB}={},{keys:lB}=Object,mu=e=>{const n=typeof e;if(n!=="object"||!e)return[Xh,n];const r=oB.call(e).slice(8,-1);switch(r){case"Array":return[$u,zo];case"Object":return[Zf,zo];case"Date":return[Zx,zo];case"RegExp":return[Qx,zo];case"Map":return[Jx,zo];case"Set":return[e0,zo];case"DataView":return[$u,r]}return r.includes("Array")?[$u,r]:r.includes("Error")?[cA,r]:[Zf,r]},uf=([e,n])=>e===Xh&&(n==="function"||n==="symbol"),uB=(e,n,r,i)=>{const s=(u,d)=>{const h=i.push(u)-1;return r.set(d,h),h},l=u=>{if(r.has(u))return r.get(u);let[d,h]=mu(u);switch(d){case Xh:{let g=u;switch(h){case"bigint":d=dA,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([uA],u)}return s([d,g],u)}case $u:{if(h){let v=u;return h==="DataView"?v=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(u)),s([h,[...v]],u)}const g=[],y=s([d,g],u);for(const v of u)g.push(l(v));return y}case Zf:{if(h)switch(h){case"BigInt":return s([h,u.toString()],u);case"Boolean":case"Number":case"String":return s([h,u.valueOf()],u)}if(n&&"toJSON"in u)return l(u.toJSON());const g=[],y=s([d,g],u);for(const v of lB(u))(e||!uf(mu(u[v])))&&g.push([l(v),l(u[v])]);return y}case Zx:return s([d,u.toISOString()],u);case Qx:{const{source:g,flags:y}=u;return s([d,{source:g,flags:y}],u)}case Jx:{const g=[],y=s([d,g],u);for(const[v,x]of u)(e||!(uf(mu(v))||uf(mu(x))))&&g.push([l(v),l(x)]);return y}case e0:{const g=[],y=s([d,g],u);for(const v of u)(e||!uf(mu(v)))&&g.push(l(v));return y}}const{message:p}=u;return s([d,{name:h,message:p}],u)};return l},CC=(e,{json:n,lossy:r}={})=>{const i=[];return uB(!(n||r),!!n,new Map,i)(e),i},Qf=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?_C(CC(e,n)):structuredClone(e):(e,n)=>_C(CC(e,n));function cB(e,n){const r=[{type:"text",value:"↩"}];return n>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),r}function dB(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function fB(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||cB,i=e.options.footnoteBackLabel||dB,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[h]);if(!p)continue;const g=e.all(p),y=String(p.identifier).toUpperCase(),v=ml(y.toLowerCase());let x=0;const _=[],C=e.footnoteCounts.get(y);for(;C!==void 0&&++x<=C;){_.length>0&&_.push({type:"text",value:" "});let E=typeof r=="string"?r:r(h,x);typeof E=="string"&&(E={type:"text",value:E}),_.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+v+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(h,x),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const k=g[g.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const E=k.children[k.children.length-1];E&&E.type==="text"?E.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(..._)}else g.push(..._);const j={type:"element",tagName:"li",properties:{id:n+"fn-"+v},children:e.wrap(g,!0)};e.patch(p,j),d.push(j)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Qf(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
63
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
64
|
+
`}]}}const fA=(function(e){if(e==null)return gB;if(typeof e=="function")return Kh(e);if(typeof e=="object")return Array.isArray(e)?hB(e):pB(e);if(typeof e=="string")return mB(e);throw new Error("Expected function, string, or object as test")});function hB(e){const n=[];let r=-1;for(;++r<e.length;)n[r]=fA(e[r]);return Kh(i);function i(...s){let l=-1;for(;++l<n.length;)if(n[l].apply(this,s))return!0;return!1}}function pB(e){const n=e;return Kh(r);function r(i){const s=i;let l;for(l in e)if(s[l]!==n[l])return!1;return!0}}function mB(e){return Kh(n);function n(r){return r&&r.type===e}}function Kh(e){return n;function n(r,i,s){return!!(yB(r)&&e.call(this,r,typeof i=="number"?i:void 0,s||void 0))}}function gB(){return!0}function yB(e){return e!==null&&typeof e=="object"&&"type"in e}const hA=[],vB=!0,jC=!1,xB="skip";function bB(e,n,r,i){let s;typeof n=="function"&&typeof r!="function"?(i=r,r=n):s=n;const l=fA(s),u=i?-1:1;d(e,void 0,[])();function d(h,p,g){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const x=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(x?"<"+x+">":""))+")"})}return v;function v(){let x=hA,_,C,k;if((!n||l(h,p,g[g.length-1]||void 0))&&(x=wB(r(h,g)),x[0]===jC))return x;if("children"in h&&h.children){const j=h;if(j.children&&x[0]!==xB)for(C=(i?j.children.length:-1)+u,k=g.concat(j);C>-1&&C<j.children.length;){const E=j.children[C];if(_=d(E,C,k)(),_[0]===jC)return _;C=typeof _[1]=="number"?_[1]:C+u}}return x}}}function wB(e){return Array.isArray(e)?e:typeof e=="number"?[vB,e]:e==null?hA:[e]}function pA(e,n,r,i){let s,l,u;typeof n=="function"&&typeof r!="function"?(l=void 0,u=n,s=r):(l=n,u=r,s=i),bB(e,l,d,s);function d(h,p){const g=p[p.length-1],y=g?g.children.indexOf(h):void 0;return u(h,y,g)}}const sv={}.hasOwnProperty,SB={};function _B(e,n){const r=n||SB,i=new Map,s=new Map,l=new Map,u={...aB,...r.handlers},d={all:p,applyData:jB,definitionById:i,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:u,one:h,options:r,patch:CB,wrap:EB};return pA(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?i:s,v=String(g.identifier).toUpperCase();y.has(v)||y.set(v,g)}}),d;function h(g,y){const v=g.type,x=d.handlers[v];if(sv.call(d.handlers,v)&&x)return x(d,g,y);if(d.options.passThrough&&d.options.passThrough.includes(v)){if("children"in g){const{children:C,...k}=g,j=Qf(k);return j.children=d.all(g),j}return Qf(g)}return(d.options.unknownHandler||kB)(d,g,y)}function p(g){const y=[];if("children"in g){const v=g.children;let x=-1;for(;++x<v.length;){const _=d.one(v[x],g);if(_){if(x&&v[x-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=kC(_.value)),!Array.isArray(_)&&_.type==="element")){const C=_.children[0];C&&C.type==="text"&&(C.value=kC(C.value))}Array.isArray(_)?y.push(..._):y.push(_)}}}return y}}function CB(e,n){e.position&&(n.position=oV(e))}function jB(e,n){let r=n;if(e&&e.data){const i=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof i=="string")if(r.type==="element")r.tagName=i;else{const u="children"in r?r.children:[r];r={type:"element",tagName:i,properties:{},children:u}}r.type==="element"&&l&&Object.assign(r.properties,Qf(l)),"children"in r&&r.children&&s!==null&&s!==void 0&&(r.children=s)}return r}function kB(e,n){const r=n.data||{},i="value"in n&&!(sv.call(r,"hProperties")||sv.call(r,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function EB(e,n){const r=[];let i=-1;for(n&&r.push({type:"text",value:`
|
|
65
|
+
`});++i<e.length;)i&&r.push({type:"text",value:`
|
|
66
|
+
`}),r.push(e[i]);return n&&e.length>0&&r.push({type:"text",value:`
|
|
67
|
+
`}),r}function kC(e){let n=0,r=e.charCodeAt(n);for(;r===9||r===32;)n++,r=e.charCodeAt(n);return e.slice(n)}function EC(e,n){const r=_B(e,n),i=r.one(e,void 0),s=fB(r),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
|
|
68
|
+
`},s),l}function NB(e,n){return e&&"run"in e?async function(r,i){const s=EC(r,{file:i,...n});await e.run(s,i)}:function(r,i){return EC(r,{file:i,...e||n})}}function NC(e){if(e)throw e}var Gg,TC;function TB(){if(TC)return Gg;TC=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(p){return typeof Array.isArray=="function"?Array.isArray(p):n.call(p)==="[object Array]"},l=function(p){if(!p||n.call(p)!=="[object Object]")return!1;var g=e.call(p,"constructor"),y=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!g&&!y)return!1;var v;for(v in p);return typeof v>"u"||e.call(p,v)},u=function(p,g){r&&g.name==="__proto__"?r(p,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):p[g.name]=g.newValue},d=function(p,g){if(g==="__proto__")if(e.call(p,g)){if(i)return i(p,g).value}else return;return p[g]};return Gg=function h(){var p,g,y,v,x,_,C=arguments[0],k=1,j=arguments.length,E=!1;for(typeof C=="boolean"&&(E=C,C=arguments[1]||{},k=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});k<j;++k)if(p=arguments[k],p!=null)for(g in p)y=d(C,g),v=d(p,g),C!==v&&(E&&v&&(l(v)||(x=s(v)))?(x?(x=!1,_=y&&s(y)?y:[]):_=y&&l(y)?y:{},u(C,{name:g,newValue:h(E,_,v)})):typeof v<"u"&&u(C,{name:g,newValue:v}));return C},Gg}var AB=TB();const qg=mc(AB);function ov(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function RB(){const e=[],n={run:r,use:i};return n;function r(...s){let l=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);d(null,...s);function d(h,...p){const g=e[++l];let y=-1;if(h){u(h);return}for(;++y<s.length;)(p[y]===null||p[y]===void 0)&&(p[y]=s[y]);s=p,g?MB(g,d)(...p):u(null,...p)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),n}}function MB(e,n){let r;return i;function i(...u){const d=e.length>u.length;let h;d&&u.push(s);try{h=e.apply(this,u)}catch(p){const g=p;if(d&&r)throw g;return s(g)}d||(h&&h.then&&typeof h.then=="function"?h.then(l,s):h instanceof Error?s(h):l(h))}function s(u,...d){r||(r=!0,n(u,...d))}function l(u){s(null,u)}}const oi={basename:DB,dirname:OB,extname:zB,join:PB,sep:"/"};function DB(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');jc(e);let r=0,i=-1,s=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){r=s+1;break}}else i<0&&(l=!0,i=s+1);return i<0?"":e.slice(r,i)}if(n===e)return"";let u=-1,d=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){r=s+1;break}}else u<0&&(l=!0,u=s+1),d>-1&&(e.codePointAt(s)===n.codePointAt(d--)?d<0&&(i=s):(d=-1,i=u));return r===i?i=u:i<0&&(i=e.length),e.slice(r,i)}function OB(e){if(jc(e),e.length===0)return".";let n=-1,r=e.length,i;for(;--r;)if(e.codePointAt(r)===47){if(i){n=r;break}}else i||(i=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function zB(e){jc(e);let n=e.length,r=-1,i=0,s=-1,l=0,u;for(;n--;){const d=e.codePointAt(n);if(d===47){if(u){i=n+1;break}continue}r<0&&(u=!0,r=n+1),d===46?s<0?s=n:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||r<0||l===0||l===1&&s===r-1&&s===i+1?"":e.slice(s,r)}function PB(...e){let n=-1,r;for(;++n<e.length;)jc(e[n]),e[n]&&(r=r===void 0?e[n]:r+"/"+e[n]);return r===void 0?".":LB(r)}function LB(e){jc(e);const n=e.codePointAt(0)===47;let r=IB(e,!n);return r.length===0&&!n&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),n?"/"+r:r}function IB(e,n){let r="",i=0,s=-1,l=0,u=-1,d,h;for(;++u<=e.length;){if(u<e.length)d=e.codePointAt(u);else{if(d===47)break;d=47}if(d===47){if(!(s===u-1||l===1))if(s!==u-1&&l===2){if(r.length<2||i!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",i=0):(r=r.slice(0,h),i=r.length-1-r.lastIndexOf("/")),s=u,l=0;continue}}else if(r.length>0){r="",i=0,s=u,l=0;continue}}n&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+e.slice(s+1,u):r=e.slice(s+1,u),i=u-s-1;s=u,l=0}else d===46&&l>-1?l++:l=-1}return r}function jc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const VB={cwd:FB};function FB(){return"/"}function lv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function UB(e){if(typeof e=="string")e=new URL(e);else if(!lv(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return BB(e)}function BB(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const n=e.pathname;let r=-1;for(;++r<n.length;)if(n.codePointAt(r)===37&&n.codePointAt(r+1)===50){const i=n.codePointAt(r+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const Yg=["history","path","basename","stem","extname","dirname"];class mA{constructor(n){let r;n?lv(n)?r={path:n}:typeof n=="string"||$B(n)?r={value:n}:r=n:r={},this.cwd="cwd"in r?"":VB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Yg.length;){const l=Yg[i];l in r&&r[l]!==void 0&&r[l]!==null&&(this[l]=l==="history"?[...r[l]]:r[l])}let s;for(s in r)Yg.includes(s)||(this[s]=r[s])}get basename(){return typeof this.path=="string"?oi.basename(this.path):void 0}set basename(n){Kg(n,"basename"),Xg(n,"basename"),this.path=oi.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?oi.dirname(this.path):void 0}set dirname(n){AC(this.basename,"dirname"),this.path=oi.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?oi.extname(this.path):void 0}set extname(n){if(Xg(n,"extname"),AC(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=oi.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){lv(n)&&(n=UB(n)),Kg(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?oi.basename(this.path,this.extname):void 0}set stem(n){Kg(n,"stem"),Xg(n,"stem"),this.path=oi.join(this.dirname||"",n+(this.extname||""))}fail(n,r,i){const s=this.message(n,r,i);throw s.fatal=!0,s}info(n,r,i){const s=this.message(n,r,i);return s.fatal=void 0,s}message(n,r,i){const s=new Dn(n,r,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Xg(e,n){if(e&&e.includes(oi.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+oi.sep+"`")}function Kg(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function AC(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function $B(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HB=(function(e){const i=this.constructor.prototype,s=i[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,i),l}),GB={}.hasOwnProperty;class t0 extends HB{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=RB()}copy(){const n=new t0;let r=-1;for(;++r<this.attachers.length;){const i=this.attachers[r];n.use(...i)}return n.data(qg(!0,{},this.namespace)),n}data(n,r){return typeof n=="string"?arguments.length===2?(Qg("data",this.frozen),this.namespace[n]=r,this):GB.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Qg("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=r.call(n,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const r=cf(n),i=this.parser||this.Parser;return Wg("parse",i),i(String(r),r)}process(n,r){const i=this;return this.freeze(),Wg("process",this.parser||this.Parser),Zg("process",this.compiler||this.Compiler),r?s(void 0,r):new Promise(s);function s(l,u){const d=cf(n),h=i.parse(d);i.run(h,d,function(g,y,v){if(g||!y||!v)return p(g);const x=y,_=i.stringify(x,v);XB(_)?v.value=_:v.result=_,p(g,v)});function p(g,y){g||!y?u(g):l?l(y):r(void 0,y)}}}processSync(n){let r=!1,i;return this.freeze(),Wg("processSync",this.parser||this.Parser),Zg("processSync",this.compiler||this.Compiler),this.process(n,s),MC("processSync","process",r),i;function s(l,u){r=!0,NC(l),i=u}}run(n,r,i){RC(n),this.freeze();const s=this.transformers;return!i&&typeof r=="function"&&(i=r,r=void 0),i?l(void 0,i):new Promise(l);function l(u,d){const h=cf(r);s.run(n,h,p);function p(g,y,v){const x=y||n;g?d(g):u?u(x):i(void 0,x,v)}}}runSync(n,r){let i=!1,s;return this.run(n,r,l),MC("runSync","run",i),s;function l(u,d){NC(u),s=d,i=!0}}stringify(n,r){this.freeze();const i=cf(r),s=this.compiler||this.Compiler;return Zg("stringify",s),RC(n),s(n,i)}use(n,...r){const i=this.attachers,s=this.namespace;if(Qg("use",this.frozen),n!=null)if(typeof n=="function")h(n,r);else if(typeof n=="object")Array.isArray(n)?d(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function l(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[g,...y]=p;h(g,y)}else u(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function u(p){if(!("plugins"in p)&&!("settings"in p))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");d(p.plugins),p.settings&&(s.settings=qg(!0,s.settings,p.settings))}function d(p){let g=-1;if(p!=null)if(Array.isArray(p))for(;++g<p.length;){const y=p[g];l(y)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,g){let y=-1,v=-1;for(;++y<i.length;)if(i[y][0]===p){v=y;break}if(v===-1)i.push([p,...g]);else if(g.length>0){let[x,..._]=g;const C=i[v][1];ov(C)&&ov(x)&&(x=qg(!0,C,x)),i[v]=[p,x,..._]}}}}const qB=new t0().freeze();function Wg(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zg(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qg(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RC(e){if(!ov(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function MC(e,n,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function cf(e){return YB(e)?e:new mA(e)}function YB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function XB(e){return typeof e=="string"||KB(e)}function KB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const WB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",DC=[],OC={allowDangerousHtml:!0},ZB=/^(https?|ircs?|mailto|xmpp)$/i,QB=[{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 JB(e){const n=e$(e),r=t$(e);return n$(n.runSync(n.parse(r),r),e)}function e$(e){const n=e.rehypePlugins||DC,r=e.remarkPlugins||DC,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...OC}:OC;return qB().use(DU).use(r).use(NB,i).use(n)}function t$(e){const n=e.children||"",r=new mA;return typeof n=="string"&&(r.value=n),r}function n$(e,n){const r=n.allowedElements,i=n.allowElement,s=n.components,l=n.disallowedElements,u=n.skipHtml,d=n.unwrapDisallowed,h=n.urlTransform||r$;for(const g of QB)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+WB+g.id,void 0);return pA(e,p),fV(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function p(g,y,v){if(g.type==="raw"&&v&&typeof y=="number")return u?v.children.splice(y,1):v.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let x;for(x in Bg)if(Object.hasOwn(Bg,x)&&Object.hasOwn(g.properties,x)){const _=g.properties[x],C=Bg[x];(C===null||C.includes(g.tagName))&&(g.properties[x]=h(String(_||""),x,g))}}if(g.type==="element"){let x=r?!r.includes(g.tagName):l?l.includes(g.tagName):!1;if(!x&&i&&typeof y=="number"&&(x=!i(g,y,v)),x&&v&&typeof y=="number")return d&&g.children?v.children.splice(y,1,...g.children):v.children.splice(y,1),y}}}function r$(e){const n=e.indexOf(":"),r=e.indexOf("?"),i=e.indexOf("#"),s=e.indexOf("/");return n===-1||s!==-1&&n>s||r!==-1&&n>r||i!==-1&&n>i||ZB.test(e.slice(0,n))?e:""}const i$="text-primary underline underline-offset-2 hover:opacity-80",a$="break-words [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2 [&_a:hover]:opacity-80 [&_img]:max-w-full [&_img]:rounded [&_pre]:overflow-x-auto [&_pre]:rounded [&_pre]:bg-muted [&_pre]:p-2 [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_ul]:list-disc [&_ul]:pl-4 [&_ol]:list-decimal [&_ol]:pl-4 [&_p]:my-1 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0";function Wh({content:e,className:n=""}){return f.jsx("div",{className:`${a$} ${n}`,children:f.jsx(JB,{components:{a:({href:r,children:i})=>f.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:i$,children:i}),img:({src:r,alt:i})=>f.jsx("img",{src:r,alt:i??"",className:"max-w-full rounded",loading:"lazy"})},children:e})})}function s$(){const[e,n]=S.useState({x:0,y:0});return S.useEffect(()=>{const r=i=>{n({x:i.clientX,y:i.clientY})};return window.addEventListener("mousemove",r),()=>{window.removeEventListener("mousemove",r)}},[]),e}function o$(e){let n=e.replace("#","");n.length===3&&(n=n.split("").map(u=>u+u).join(""));const r=parseInt(n,16),i=r>>16&255,s=r>>8&255,l=r&255;return[i,s,l]}const gA=({className:e,quantity:n=80,staticity:r=60,ease:i=40,size:s=.4,refresh:l=!1,color:u,vx:d=0,vy:h=0,...p})=>{const g=S.useRef(null),y=S.useRef(null),v=S.useRef(null),x=S.useRef([]),_=s$(),C=S.useRef({x:0,y:0}),k=S.useRef({w:0,h:0}),j=typeof window<"u"?window.devicePixelRatio:1,E=S.useRef(null),N=S.useRef(null),M=S.useRef(()=>{}),R=S.useRef(()=>{}),z=S.useRef(()=>{});S.useEffect(()=>{g.current&&(v.current=g.current.getContext("2d")),M.current(),z.current();const I=()=>{N.current!=null&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>{M.current()},200)};return window.addEventListener("resize",I),()=>{E.current!=null&&window.cancelAnimationFrame(E.current),N.current!=null&&window.clearTimeout(N.current),window.removeEventListener("resize",I)}},[u]),S.useEffect(()=>{R.current()},[_.x,_.y]),S.useEffect(()=>{M.current()},[l]);const P=()=>{$(),Z()},D=()=>{if(g.current){const I=g.current.getBoundingClientRect(),{w:H,h:A}=k.current,F=_.x-I.left-H/2,G=_.y-I.top-A/2;F<H/2&&F>-H/2&&G<A/2&&G>-A/2&&(C.current.x=F,C.current.y=G)}},$=()=>{if(y.current&&g.current&&v.current){k.current.w=y.current.offsetWidth,k.current.h=y.current.offsetHeight,g.current.width=k.current.w*j,g.current.height=k.current.h*j,g.current.style.width=`${k.current.w}px`,g.current.style.height=`${k.current.h}px`,v.current.setTransform(j,0,0,j,0,0),x.current=[];for(let I=0;I<n;I++){const H=X();ae(H)}}},U=u??(typeof window<"u"&&document.documentElement.classList.contains("dark")?"#ffffff":"#000000"),X=()=>{const I=Math.floor(Math.random()*k.current.w),H=Math.floor(Math.random()*k.current.h),A=0,F=0,G=Math.floor(Math.random()*2)+s,L=0,ee=parseFloat((Math.random()*.6+.1).toFixed(1)),ce=(Math.random()-.5)*.1,Y=(Math.random()-.5)*.1,Q=.1+Math.random()*4;return{x:I,y:H,translateX:A,translateY:F,size:G,alpha:L,targetAlpha:ee,dx:ce,dy:Y,magnetism:Q}},K=o$(U),ae=(I,H=!1)=>{if(v.current){const{x:A,y:F,translateX:G,translateY:L,size:ee,alpha:ce}=I;v.current.save(),v.current.translate(G,L),v.current.beginPath(),v.current.arc(A,F,ee,0,2*Math.PI),v.current.fillStyle=`rgba(${K.join(", ")}, ${ce})`,v.current.fill(),v.current.restore(),H||x.current.push(I)}},B=()=>{v.current&&v.current.clearRect(0,0,k.current.w,k.current.h)},Z=()=>{B();for(let I=0;I<n;I++){const H=X();ae(H)}},O=(I,H,A,F,G)=>{const L=(I-H)*(G-F)/(A-H)+F;return L>0?L:0},q=()=>{B(),x.current.forEach((I,H)=>{const F=[I.x+I.translateX-I.size,k.current.w-I.x-I.translateX-I.size,I.y+I.translateY-I.size,k.current.h-I.y-I.translateY-I.size].reduce((L,ee)=>Math.min(L,ee)),G=parseFloat(O(F,0,20,0,1).toFixed(2));if(G>1?(I.alpha+=.02,I.alpha>I.targetAlpha&&(I.alpha=I.targetAlpha)):I.alpha=I.targetAlpha*G,I.x+=I.dx+d,I.y+=I.dy+h,I.translateX+=(C.current.x/(r/I.magnetism)-I.translateX)/i,I.translateY+=(C.current.y/(r/I.magnetism)-I.translateY)/i,ae(I,!0),I.x<-I.size||I.x>k.current.w+I.size||I.y<-I.size||I.y>k.current.h+I.size){x.current.splice(H,1);const L=X();ae(L)}}),E.current=window.requestAnimationFrame(z.current)};return M.current=P,R.current=D,z.current=q,f.jsx("div",{className:Ee("pointer-events-none",e),ref:y,"aria-hidden":"true",...p,children:f.jsx("canvas",{ref:g,className:"size-full"})})},yA=({shimmerColor:e,shimmerSize:n="0.001em",shimmerDuration:r="10s",borderRadius:i="999px",background:s="rgba(0, 0, 0, 0.4)",className:l,children:u,...d})=>{const h=e??(typeof window<"u"&&document.documentElement.classList.contains("dark")?"#ffffff":"#000000");return f.jsxs("div",{style:{"--spread":"90deg","--shimmer-color":h,"--radius":i,"--speed":r,"--cut":n,"--bg":s},className:Ee("group relative z-0 flex items-center justify-center overflow-hidden [border-radius:var(--radius)] border border-white/10",l),...d,children:[f.jsx("div",{className:"pointer-events-none -z-30 blur-[2px] @container-[size] absolute inset-0 overflow-visible",children:f.jsx("div",{className:"animate-shimmer-slide absolute inset-0 aspect-[1] h-[100cqh] rounded-none [mask:none]",children:f.jsx("div",{className:"animate-spin-around absolute -inset-full w-auto [translate:0_0] rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))]"})})}),f.jsx("div",{className:"absolute inset-0 size-full rounded-full px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f] group-hover:shadow-[inset_0_-6px_10px_#ffffff3f] group-active:shadow-[inset_0_-10px_10px_#ffffff3f]"}),f.jsx("div",{className:"absolute inset-(--cut) -z-20 [border-radius:var(--radius)] [background:var(--bg)]"}),f.jsx("div",{className:"relative z-10",children:u})]})},l$="agent1.jpg";function zC(e){return`/media/${e||l$}`}function u$(e){if(!e)return"";const n=new Date(e),r=new Date;return n.toDateString()===r.toDateString()?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}const PC=[{pattern:/gpt-5/i,inputPer1M:1.25,outputPer1M:10},{pattern:/gpt-4\.1|gpt-4.1/i,inputPer1M:2,outputPer1M:8},{pattern:/gpt-4o/i,inputPer1M:2.5,outputPer1M:10},{pattern:/o3/i,inputPer1M:2,outputPer1M:8},{pattern:/claude-sonnet/i,inputPer1M:3,outputPer1M:15},{pattern:/claude-haiku/i,inputPer1M:.8,outputPer1M:4},{pattern:/claude-opus/i,inputPer1M:15,outputPer1M:75},{pattern:/gemini-1\.5-pro|gemini-1.5-pro/i,inputPer1M:1.25,outputPer1M:5},{pattern:/gemini-2\.0-flash|gemini-2.0-flash/i,inputPer1M:.1,outputPer1M:.4},{pattern:/gemini.*flash/i,inputPer1M:.15,outputPer1M:.6},{pattern:/deepseek/i,inputPer1M:.55,outputPer1M:2.19},{pattern:/mistral.*large/i,inputPer1M:2,outputPer1M:6},{pattern:/grok/i,inputPer1M:3,outputPer1M:15}],c$=2.5,d$=10;function f$(e,n){const r=PC.find(s=>s.pattern.test(n??""))?.inputPer1M??c$,i=PC.find(s=>s.pattern.test(n??""))?.outputPer1M??d$;return e.input_tokens/1e6*r+e.output_tokens/1e6*i}function LC(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function h$(){const{preselectedAgentId:e,clearPreselectedAgent:n}=Ux(),[r,i]=S.useState([]),[s,l]=S.useState(!0),[u,d]=S.useState(null),[h,p]=S.useState(""),[g,y]=S.useState(null),[v,x]=S.useState([]),[_,C]=S.useState([]),[k,j]=S.useState(""),[E,N]=S.useState(null),[M,R]=S.useState(!1),[z,P]=S.useState(!0),[D,$]=S.useState(null),[U,X]=S.useState(""),[K,ae]=S.useState(!1),B=S.useRef(null),Z=S.useRef(null);S.useEffect(()=>{const I=window.localStorage.getItem("agent-os-chat-conversation-id");I&&(y(I),pe.getConversationMessages({conversation_id:I,limit:100}).then(H=>{const A=H.messages.filter(F=>F.role==="user"||F.role==="assistant").map(F=>{const G=F.content,L=typeof G=="string"?G:typeof G?.text=="string"?G.text:JSON.stringify(G),ee=typeof G=="object"&&G!==null&&Array.isArray(G.steps)?G.steps:void 0,ce=typeof G=="object"&&G!==null&&typeof G.timestamp=="string"?G.timestamp:void 0,Y=typeof G=="object"&&G!==null&&G.usage&&typeof G.usage.input_tokens=="number"&&typeof G.usage.output_tokens=="number"?G.usage:void 0,Q=typeof G=="object"&&G!==null&&typeof G.model=="string"?G.model:void 0;return{role:F.role,content:L,steps:ee,timestamp:ce,usage:Y,model:Q}});A.length&&C(A)}).catch(()=>{})),pe.getAgents().then(H=>{i(H.agents);const A=H.agents.map(F=>F.id);if(e&&A.includes(e))p(e),n();else if(H.agents.length&&!h){const F=window.localStorage.getItem("agent-os-chat-agent-id"),G=F&&A.includes(F)?F:A.includes("manager_agent")?"manager_agent":H.agents[0].id;p(G)}}).catch(H=>d(H.message)).finally(()=>l(!1))},[e,n]),S.useEffect(()=>{h&&pe.getConversations({agent_id:h,limit:50}).then(I=>x(I.conversations)).catch(()=>x([]))},[h]),S.useEffect(()=>{B.current?.scrollIntoView({behavior:"smooth"})},[_]);async function O(I){I.preventDefault();const H=k.trim();if(!h||!H||M)return;j(""),N(null);const A=E?`${H}
|
|
69
|
+
[Attached: ${E.name}]`:H;C(G=>[...G,{role:"user",content:A,timestamp:new Date().toISOString()}]),R(!0);const F=new AbortController;Z.current=F;try{const G=await pe.saveConversationMessage({conversation_id:g??void 0,agent_id:h,role:"user",content:{text:A}});!g&&G.conversation_id&&(y(G.conversation_id),ae(!1),window.localStorage.setItem("agent-os-chat-conversation-id",G.conversation_id));const L=G.conversation_id??g??void 0;C(Y=>[...Y,{role:"assistant",content:""}]);let ee;if(E){const{path:Y}=await pe.uploadAgentFile(h,E);ee=[Y]}await pe.runAgentStream(h,H,{attachment_paths:ee,conversation_id:L,signal:F.signal,onDelta(Y){C(Q=>{const re=[...Q],fe=re[re.length-1];return fe?.role==="assistant"&&(re[re.length-1]={...fe,content:fe.content+Y}),re})},onDone(Y){const Q=new Date().toISOString();C(we=>{const ke=[...we],Ie=ke[ke.length-1];return Ie?.role==="assistant"&&(ke[ke.length-1]={...Ie,content:Y.finalContent||Ie.content,steps:Y.steps,timestamp:Q,usage:Y.usage,model:Y.model}),ke});const fe={text:Y.finalContent,timestamp:Q};Y.steps?.length&&(fe.steps=Y.steps),Y.usage&&(fe.usage=Y.usage),Y.model&&(fe.model=Y.model),pe.saveConversationMessage({conversation_id:L,agent_id:h,role:"assistant",content:fe}).catch(()=>{}),pe.getConversations({agent_id:h,limit:50}).then(we=>x(we.conversations)).catch(()=>{})},onError(Y){C(Q=>{const re=[...Q],fe=re[re.length-1];return fe?.role==="assistant"&&(re[re.length-1]={...fe,content:`Error: ${Y}`,timestamp:new Date().toISOString()}),re})}});const ce=_.length+2;if(L&&!K&&ce>=20)try{const Y=await pe.summarizeConversation(L);C(Q=>[...Q,{role:"assistant",content:`Summary: ${Y.summary}`}]),ae(!0)}catch{}}catch(G){const L=G instanceof Error&&G.name==="AbortError",ee=L?null:`Error: ${G instanceof Error?G.message:String(G)}`;C(ce=>{const Y=[...ce],Q=Y[Y.length-1];if(Q?.role==="assistant"&&!Q.timestamp){const re=L?Q.content||"Stopped":ee??Q.content;return Y[Y.length-1]={...Q,content:re,timestamp:new Date().toISOString()},Y}return ee?[...ce,{role:"assistant",content:ee,timestamp:new Date().toISOString()}]:Y})}finally{Z.current=null,R(!1)}}function q(){Z.current?.abort()}return s?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading agents…"}):u?f.jsxs("div",{className:"p-4 text-destructive",children:["Failed to load agents: ",u]}):f.jsxs("div",{className:"flex h-[calc(100vh-3rem)]",children:[!z&&f.jsx("div",{className:"flex shrink-0 flex-col border-r bg-muted/30",children:f.jsx(be,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-none",title:"Show conversations",onClick:()=>P(!0),children:f.jsx(Ox,{className:"size-5"})})}),z&&f.jsxs("div",{className:"flex w-64 flex-col border-r",children:[f.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[f.jsx("span",{className:"text-xs font-semibold uppercase text-muted-foreground",children:"Conversations"}),f.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",title:"Hide sidebar",onClick:()=>P(!1),children:f.jsx(Xf,{className:"size-4"})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto",children:v.length===0?f.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"No conversations yet."}):f.jsx("ul",{className:"space-y-0.5 p-2",children:v.map(I=>{const H=I.id===g,A=D===I.id,F=I.title&&I.title.trim().length>0?I.title:"Untitled conversation";return f.jsx("li",{className:"group/list flex items-center gap-0.5 rounded-md",children:A?f.jsx(Ue,{value:U,onChange:G=>X(G.target.value),onBlur:async()=>{const G=U.trim().slice(0,200)||"Untitled conversation";$(null);try{await pe.updateConversationTitle(I.id,G),pe.getConversations({agent_id:h,limit:50}).then(L=>x(L.conversations)).catch(()=>{})}catch{}},onKeyDown:G=>{G.key==="Enter"&&G.target.blur()},className:"h-7 flex-1 text-xs",autoFocus:!0}):f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-1 text-left text-xs "+(H?"bg-primary/10 font-medium":"hover:bg-muted"),onClick:async()=>{y(I.id),window.localStorage.setItem("agent-os-chat-conversation-id",I.id);try{const L=(await pe.getConversationMessages({conversation_id:I.id,limit:100})).messages.filter(ee=>ee.role==="user"||ee.role==="assistant").map(ee=>{const ce=ee.content,Y=typeof ce=="string"?ce:typeof ce?.text=="string"?ce.text:JSON.stringify(ce),Q=typeof ce=="object"&&ce!==null&&Array.isArray(ce.steps)?ce.steps:void 0,re=typeof ce=="object"&&ce!==null&&typeof ce.timestamp=="string"?ce.timestamp:void 0,fe=typeof ce=="object"&&ce!==null&&ce.usage&&typeof ce.usage.input_tokens=="number"&&typeof ce.usage.output_tokens=="number"?ce.usage:void 0,we=typeof ce=="object"&&ce!==null&&typeof ce.model=="string"?ce.model:void 0;return{role:ee.role,content:Y,steps:Q,timestamp:re,usage:fe,model:we}});C(L)}catch{}},children:[f.jsx("div",{className:"truncate",children:F}),f.jsx("div",{className:"text-[10px] text-muted-foreground",children:new Date(I.created_at).toLocaleString()})]}),f.jsx(be,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 opacity-0 group-hover/list:opacity-100",title:"Rename",onClick:G=>{G.stopPropagation(),$(I.id),X(F)},children:f.jsx(Gh,{className:"size-3"})})]})},I.id)})})})]}),f.jsxs("div",{className:"relative flex flex-1 flex-col",children:[f.jsx("div",{className:"shrink-0 border-b p-4 relative z-10",children:f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Ne,{htmlFor:"chat-agent",className:"text-sm font-medium",children:"Agent"}),f.jsx("select",{id:"chat-agent",className:"flex h-9 min-w-[200px] rounded-lg border border-input bg-transparent px-3 py-1 text-sm",value:h,onChange:I=>{const H=I.target.value;p(H),H&&window.localStorage.setItem("agent-os-chat-agent-id",H)},children:r.map(I=>f.jsx("option",{value:I.id,children:I.name},I.id))}),h&&f.jsxs("span",{className:"text-sm text-muted-foreground","aria-hidden":!0,children:["Chatting with ",f.jsx("strong",{className:"text-foreground",children:r.find(I=>I.id===h)?.name??h})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(be,{variant:"outline",size:"sm",disabled:!g,onClick:async()=>{if(g)try{const I=await pe.summarizeConversation(g);C(H=>[...H,{role:"assistant",content:`Summary: ${I.summary}`}])}catch(I){C(H=>[...H,{role:"assistant",content:`Error summarizing: ${I instanceof Error?I.message:String(I)}`}])}},children:"Summarize"}),f.jsx(be,{variant:"outline",size:"sm",onClick:()=>{y(null),C([]),ae(!1),window.localStorage.removeItem("agent-os-chat-conversation-id")},children:"New conversation"})]})]})}),h&&f.jsx("div",{className:"pointer-events-none absolute inset-0 z-0 flex items-center justify-center",children:f.jsxs("div",{className:"flex h-[420px] w-full max-w-2xl flex-col items-center justify-center overflow-hidden rounded-2xl bg-gradient-to-b from-background via-background/80 to-background",children:[f.jsx(gA,{className:"absolute inset-0"}),_.length===0&&f.jsxs("div",{className:"relative flex flex-col items-center text-center gap-4",children:[f.jsx(yA,{className:"p-1.5",children:f.jsxs(Es,{className:"size-20 rounded-full bg-background/80 backdrop-blur",children:[f.jsx(nl,{src:zC(r.find(I=>I.id===h)?.avatar),alt:""}),f.jsx(Cs,{className:"bg-muted text-muted-foreground",children:f.jsx(tl,{className:"size-8"})})]})}),f.jsxs("p",{className:"max-w-xs text-sm text-muted-foreground",children:["Hi, I'm ",r.find(I=>I.id===h)?.name??h,", your AI assistant. Send a message to start a conversation."]})]})]})}),f.jsx("div",{className:"relative z-10 flex-1 overflow-y-auto p-4",children:f.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[_.map((I,H)=>{const A=M&&H===_.length-1&&I.role==="assistant"&&!I.timestamp,F=I.role==="user",G=v.find(ee=>ee.id===g)?.agent_id??h,L=r.find(ee=>ee.id===G);return f.jsxs("div",{className:`flex gap-2 ${F?"flex-row-reverse":""} max-w-[95%] ${F?"ml-auto":"mr-auto"}`,children:[f.jsx(Es,{className:"size-8 shrink-0 rounded-full border border-border",children:F?f.jsx(Cs,{className:"bg-primary text-primary-foreground",children:f.jsx(TT,{className:"size-4"})}):f.jsxs(f.Fragment,{children:[f.jsx(nl,{src:zC(L?.avatar),alt:""}),f.jsx(Cs,{className:"bg-muted text-muted-foreground",children:f.jsx(tl,{className:"size-4"})})]})}),f.jsxs("div",{className:`flex min-w-0 flex-1 flex-col ${F?"items-end":"items-start"}`,children:[I.role==="assistant"&&L&&f.jsx("span",{className:"mb-0.5 text-xs font-medium text-muted-foreground",children:L.name}),f.jsxs("div",{className:F?"w-fit max-w-full sm:max-w-[72ch] rounded-2xl rounded-tr-sm bg-primary px-4 py-2 text-sm text-primary-foreground":"w-fit max-w-full sm:max-w-[72ch] rounded-2xl rounded-tl-sm border bg-muted/50 px-4 py-2 text-sm",children:[F?f.jsxs("div",{className:"whitespace-pre-wrap break-words",children:[I.content,A&&f.jsx("span",{className:"animate-pulse",children:"▌"})]}):f.jsxs("div",{className:"whitespace-pre-wrap break-words",children:[f.jsx(Wh,{content:I.content}),A&&f.jsx("span",{className:"animate-pulse",children:"▌"})]}),I.role==="assistant"&&I.steps&&I.steps.length>0&&f.jsxs("details",{className:"group mt-2 border-t border-border/50 pt-2",children:[f.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground [&::-webkit-details-marker]:hidden",children:[f.jsx(Zn,{className:"size-3 shrink-0 transition-transform group-open:rotate-90"}),f.jsx(Q8,{className:"size-3 shrink-0"}),f.jsxs("span",{children:["Tool calls (",I.steps.length,")"]})]}),f.jsx("ul",{className:"mt-2 space-y-2 pl-4",children:I.steps.map((ee,ce)=>{const Y=ee.tool==="exec"&&ee.result!=null&&typeof ee.result=="object"?ee.result:null,Q=Y?.outputFile,re=Q&&/\.(png|jpe?g|gif|webp|svg)$/i.test(Q);return f.jsxs("li",{className:"rounded border border-border/50 bg-muted/30 p-2 text-xs",children:[f.jsx("div",{className:"font-medium text-foreground",children:ee.tool}),ee.args!=null&&f.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words text-muted-foreground",children:typeof ee.args=="string"?ee.args:JSON.stringify(ee.args,null,2)}),ee.error!=null&&f.jsx("div",{className:"mt-1 text-destructive",children:ee.error}),re&&h&&Y?.ok&&f.jsx("div",{className:"mt-2",children:f.jsx("img",{src:Fx(h,Q),alt:Q,className:"max-h-48 rounded border border-border object-contain",loading:"lazy"})}),ee.result!=null&&ee.error==null&&f.jsx("pre",{className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words text-muted-foreground",children:typeof ee.result=="string"?ee.result:JSON.stringify(ee.result,null,2)})]},ce)})})]})]}),f.jsxs("div",{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-0 text-[10px] text-muted-foreground ${F?"justify-end":""}`,children:[I.timestamp&&f.jsx("span",{children:u$(I.timestamp)}),I.role==="assistant"&&I.timestamp&&I.usage&&f.jsx("span",{"aria-hidden":!0,children:"·"}),I.role==="assistant"&&I.usage&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[LC(I.usage.input_tokens)," in · ",LC(I.usage.output_tokens)," out"]}),f.jsxs("span",{children:["~$",f$(I.usage,I.model).toFixed(4)]})]})]})]})]},H)}),f.jsx("div",{ref:B})]})}),f.jsx("div",{className:"shrink-0 border-t p-4",children:f.jsxs("form",{onSubmit:O,className:"mx-auto flex max-w-2xl flex-col gap-2",children:[f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{placeholder:"Message…",value:k,onChange:I=>j(I.target.value),disabled:M,className:"flex-1"}),f.jsxs("label",{className:"flex cursor-pointer items-center gap-1 rounded-lg border border-input bg-transparent px-3 py-2 text-sm hover:bg-muted/50",children:[f.jsx("input",{type:"file",className:"sr-only",onChange:I=>N(I.target.files?.[0]??null),accept:"video/*,audio/*,image/*,.mp4,.mov,.webm"}),f.jsx("span",{className:"shrink-0 text-muted-foreground",children:"📎"}),f.jsx("span",{className:"truncate max-w-[120px]",children:E?E.name:"Attach"})]}),M?f.jsx(be,{type:"button",variant:"outline",onClick:q,children:"Stop"}):f.jsx(be,{type:"submit",disabled:!k.trim(),children:"Send"})]}),E&&f.jsx("p",{className:"text-xs text-muted-foreground",children:"File will be uploaded to the agent workspace and the path shared with the agent (e.g. for YouTube upload)."})]})})]})]})}function qt({className:e,size:n="default",...r}){return f.jsx("div",{"data-slot":"card","data-size":n,className:Ee("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...r})}function Yt({className:e,...n}){return f.jsx("div",{"data-slot":"card-header",className:Ee("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",e),...n})}function Xt({className:e,...n}){return f.jsx("div",{"data-slot":"card-title",className:Ee("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...n})}function Kt({className:e,...n}){return f.jsx("div",{"data-slot":"card-description",className:Ee("text-sm text-muted-foreground",e),...n})}function Wt({className:e,...n}){return f.jsx("div",{"data-slot":"card-content",className:Ee("px-4 group-data-[size=sm]/card:px-3",e),...n})}function p$(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let uv=1;class m${constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var r;const{message:i,...s}=n,l=typeof n?.id=="number"||((r=n.id)==null?void 0:r.length)>0?n.id:uv++,u=this.toasts.find(h=>h.id===l),d=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...n,id:l,title:i}),{...h,...n,id:l,dismissible:d,title:i}):h):this.addToast({title:i,...s,dismissible:d,id:l}),l},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:n,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),n),this.message=(n,r)=>this.create({...r,message:n}),this.error=(n,r)=>this.create({...r,message:n,type:"error"}),this.success=(n,r)=>this.create({...r,type:"success",message:n}),this.info=(n,r)=>this.create({...r,type:"info",message:n}),this.warning=(n,r)=>this.create({...r,type:"warning",message:n}),this.loading=(n,r)=>this.create({...r,type:"loading",message:n}),this.promise=(n,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:n,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let l=i!==void 0,u;const d=s.then(async p=>{if(u=["resolve",p],Xn.isValidElement(p))l=!1,this.create({id:i,type:"default",message:p});else if(y$(p)&&!p.ok){l=!1;const y=typeof r.error=="function"?await r.error(`HTTP error! status: ${p.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${p.status}`):r.description,_=typeof y=="object"&&!Xn.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:v,..._})}else if(p instanceof Error){l=!1;const y=typeof r.error=="function"?await r.error(p):r.error,v=typeof r.description=="function"?await r.description(p):r.description,_=typeof y=="object"&&!Xn.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:v,..._})}else if(r.success!==void 0){l=!1;const y=typeof r.success=="function"?await r.success(p):r.success,v=typeof r.description=="function"?await r.description(p):r.description,_=typeof y=="object"&&!Xn.isValidElement(y)?y:{message:y};this.create({id:i,type:"success",description:v,..._})}}).catch(async p=>{if(u=["reject",p],r.error!==void 0){l=!1;const g=typeof r.error=="function"?await r.error(p):r.error,y=typeof r.description=="function"?await r.description(p):r.description,x=typeof g=="object"&&!Xn.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:y,...x})}}).finally(()=>{l&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),h=()=>new Promise((p,g)=>d.then(()=>u[0]==="reject"?g(u[1]):p(u[1])).catch(g));return typeof i!="string"&&typeof i!="number"?{unwrap:h}:Object.assign(i,{unwrap:h})},this.custom=(n,r)=>{const i=r?.id||uv++;return this.create({jsx:n(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ar=new m$,g$=(e,n)=>{const r=n?.id||uv++;return Ar.addToast({title:e,...n,id:r}),r},y$=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",v$=g$,x$=()=>Ar.toasts,b$=()=>Ar.getActiveToasts(),Qe=Object.assign(v$,{success:Ar.success,info:Ar.info,warning:Ar.warning,error:Ar.error,custom:Ar.custom,message:Ar.message,promise:Ar.promise,dismiss:Ar.dismiss,loading:Ar.loading},{getHistory:x$,getToasts:b$});p$("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const vA=S.createContext(null);function w$({children:e,onNavigate:n}){const[r,i]=S.useState(null),[s,l]=S.useState(null),u=S.useCallback((h,p)=>{i(h),l(p?.trim()??null),n("graph-chat")},[n]),d=S.useCallback(()=>{i(null),l(null)},[]);return f.jsx(vA.Provider,{value:{openGraphChat:u,graphChatGraphId:r,graphChatInitialInput:s,clearGraphChat:d},children:e})}function xA(){const e=S.useContext(vA);return e||{openGraphChat:()=>{},graphChatGraphId:null,graphChatInitialInput:null,clearGraphChat:()=>{}}}const n0=[{value:"",label:"Not scheduled"},{value:"*/5 * * * *",label:"Every 5 min"},{value:"*/10 * * * *",label:"Every 10 min"},{value:"0 * * * *",label:"Every hour"},{value:"0 7 * * *",label:"Daily at 7:00"},{value:"0 9 * * *",label:"Daily at 9:00"},{value:"0 18 * * *",label:"Daily at 18:00"},{value:"0 18 * * 1-5",label:"Weekdays at 18:00"}],Vo="__custom__";function df(e){const n=(e??"").trim();if(!n)return"";const r=n0.find(i=>i.value===n);return r?r.value:Vo}function bA(e){if(!e||!e.trim())return"Not scheduled";const n=e.trim(),r=n0.find(i=>i.value===n);return r?r.label:/^0 \d+ \* \* \*$/.test(n)?`Daily at ${n.split(" ")[1]}:00`:n}function wA({open:e,onOpenChange:n,schedule:r,scheduleInput:i,onSave:s,title:l="Schedule",saveLabel:u="Save"}){const[d,h]=S.useState(()=>df(r)),[p,g]=S.useState(()=>df(r)===Vo?(r??"").trim():""),[y,v]=S.useState(()=>(i??"").trim()),[x,_]=S.useState(!1),[C,k]=S.useState(null);S.useEffect(()=>{if(e){const N=(r??"").trim();h(df(r)),g(df(r)===Vo?N:""),v((i??"").trim()),k(null)}},[e,r,i]);const j=d===Vo?p.trim():d;async function E(){_(!0),k(null);try{await s({schedule:j||null,schedule_input:y.trim()||null,schedule_enabled:!0}),n(!1)}catch(N){k(N instanceof Error?N.message:String(N))}finally{_(!1)}}return e?f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"schedule-dialog-title",children:[f.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>n(!1),"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 w-full max-w-md rounded-lg border bg-background p-4 shadow-lg",children:[f.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[f.jsx("h2",{id:"schedule-dialog-title",className:"text-lg font-semibold",children:l}),f.jsx(be,{variant:"ghost",size:"icon",onClick:()=>n(!1),"aria-label":"Close",children:f.jsx(Is,{className:"h-4 w-4"})})]}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{className:"text-sm",children:"When to run"}),f.jsxs("select",{className:"flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm",value:d,onChange:N=>h(N.target.value),children:[n0.map(N=>f.jsx("option",{value:N.value,children:N.label},N.value||"none")),f.jsx("option",{value:Vo,children:"Advanced (cron expression)"})]})]}),d===Vo&&f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{className:"text-sm",children:"Cron expression"}),f.jsx(Ue,{placeholder:"e.g. 0 9 * * * (min hour day month weekday)",value:p,onChange:N=>g(N.target.value),className:"font-mono text-sm"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Examples: 0 9 * * * = daily 9:00, */15 * * * * = every 15 min"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{className:"text-sm",children:"Scheduled task (optional)"}),f.jsx(Ue,{placeholder:"e.g. Summarize my calendar and top tasks",value:y,onChange:N=>v(N.target.value),className:"text-sm"})]}),C&&f.jsx("p",{className:"text-sm text-destructive",children:C}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx(be,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),f.jsx(be,{disabled:x,onClick:E,children:x?"Saving…":u})]})]})]})]}):null}function r0({...e}){return f.jsx(wL,{"data-slot":"dropdown-menu",...e})}function i0({...e}){return f.jsx(SL,{"data-slot":"dropdown-menu-trigger",...e})}function a0({className:e,align:n="start",sideOffset:r=4,...i}){return f.jsx(_L,{children:f.jsx(CL,{"data-slot":"dropdown-menu-content",sideOffset:r,align:n,className:Ee("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...i})})}function Rn({className:e,inset:n,variant:r="default",...i}){return f.jsx(jL,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":r,className:Ee("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...i})}function Jf({className:e,...n}){return f.jsx(kL,{"data-slot":"dropdown-menu-separator",className:Ee("-mx-1 my-1 h-px bg-border",e),...n})}function Au({...e}){return f.jsx(QL,{"data-slot":"select",...e})}function Ru({...e}){return f.jsx(e6,{"data-slot":"select-value",...e})}function Mu({className:e,size:n="default",children:r,...i}){return f.jsxs(JL,{"data-slot":"select-trigger","data-size":n,className:Ee("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i,children:[r,f.jsx(t6,{asChild:!0,children:f.jsx(hl,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Du({className:e,children:n,position:r="item-aligned",align:i="center",...s}){return f.jsx(n6,{children:f.jsxs(r6,{"data-slot":"select-content","data-align-trigger":r==="item-aligned",className:Ee("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",r==="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:r,align:i,...s,children:[f.jsx(S$,{}),f.jsx(i6,{"data-position":r,className:Ee("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",r==="popper"&&""),children:n}),f.jsx(_$,{})]})})}function Wi({className:e,children:n,...r}){return f.jsxs(a6,{"data-slot":"select-item",className:Ee("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[f.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:f.jsx(o6,{children:f.jsx(qI,{className:"pointer-events-none"})})}),f.jsx(s6,{children:n})]})}function S$({className:e,...n}){return f.jsx(l6,{"data-slot":"select-scroll-up-button",className:Ee("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:f.jsx(ZI,{})})}function _$({className:e,...n}){return f.jsx(u6,{"data-slot":"select-scroll-down-button",className:Ee("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:f.jsx(hl,{})})}const ff={id:"",nodes:[],edges:[]};function C$(){return{id:"",nodes:[],edges:[]}}const IC=["agent1.jpg","agent2.jpg","agent3.jpg","agent4.jpg"],j$="agent1.jpg";function k$(e){let n=0;for(let r=0;r<e.length;r++)n+=e.charCodeAt(r);return`/media/${IC[Math.abs(n)%IC.length]}`}function E$(e,n){return`/media/${n.find(i=>i.id===e)?.avatar||j$}`}function N$(){const{openGraphChat:e}=xA(),[n,r]=S.useState(!1),[i,s]=S.useState([]),[l,u]=S.useState([]),[d,h]=S.useState(!0),[p,g]=S.useState(null),[y,v]=S.useState(ff),[x,_]=S.useState(""),[C,k]=S.useState(""),[j,E]=S.useState(null),[N,M]=S.useState({}),[R,z]=S.useState(null),[P,D]=S.useState(null);function $(){pe.getGraphs().then(Y=>s(Y.graphs)).catch(()=>{})}S.useEffect(()=>{pe.getGraphs().then(Y=>s(Y.graphs)).catch(Y=>g(Y.message)).finally(()=>h(!1)),pe.getAgents().then(Y=>u(Y.agents)).catch(()=>u([]))},[]),S.useEffect(()=>{if(i.length===0)return;let Y=!1;return Promise.all(i.map(Q=>pe.getGraph(Q.id))).then(Q=>{if(Y)return;const re={};i.forEach((fe,we)=>{re[fe.id]=Q[we]}),M(fe=>({...fe,...re}))}).catch(()=>{}),()=>{Y=!0}},[i]),S.useEffect(()=>{if(!x){v(ff),E(null);return}E(null),pe.getGraph(x).then(Y=>{const Q=Y.nodes.map((re,fe)=>re.x!=null&&re.y!=null?re:{...re,x:24+fe%4*220,y:24+Math.floor(fe/4)*140});v({...Y,nodes:Q})}).catch(()=>{E("Failed to load graph"),v(ff)})},[x]);const[U,X]=S.useState(null),[K,ae]=S.useState(null);function B(){const Y=`node_${y.nodes.length+1}`,Q=l[0]?.id??"",re=y.nodes.length,fe=24+re%4*220,we=24+Math.floor(re/4)*140;v(ke=>({...ke,nodes:[...ke.nodes,{id:Y,agent:Q,x:fe,y:we}]}))}function Z(Y){v(Q=>({...Q,nodes:Q.nodes.filter(re=>re.id!==Y),edges:Q.edges.filter(re=>re.from!==Y&&re.to!==Y)}))}function O(Y,Q){v(re=>({...re,nodes:re.nodes.map((fe,we)=>we===Y?{...fe,...Q}:fe)}))}function q(){const Y=y.nodes[0]?.id??"",Q=y.nodes[1]?.id??Y;Y&&Q&&v(re=>({...re,edges:[...re.edges,{from:Y,to:Q}]}))}function I(Y){v(Q=>({...Q,edges:Q.edges.filter((re,fe)=>fe!==Y)}))}function H(Y,Q){v(re=>({...re,edges:re.edges.map((fe,we)=>we===Y?{...fe,...Q}:fe)}))}function A(Y,Q){const re=Y.x??24+Q%4*220,fe=Y.y??24+Math.floor(Q/4)*140;return{x:re,y:fe}}S.useEffect(()=>{if(U===null||!K)return;const Y=re=>{const fe=re.clientX-K.clientX,we=re.clientY-K.clientY;v(ke=>({...ke,nodes:ke.nodes.map((Ie,et)=>et===U?{...Ie,x:K.nodeX+fe,y:K.nodeY+we}:Ie)}))},Q=()=>{X(null),ae(null)};return window.addEventListener("pointermove",Y,{passive:!0}),window.addEventListener("pointerup",Q),window.addEventListener("pointercancel",Q),()=>{window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",Q),window.removeEventListener("pointercancel",Q)}},[U,K]);async function F(){const Y=(x||C.trim()).trim();if(!Y){E("Graph ID required");return}E(null);const Q={...y,id:Y,schedule:y.schedule?.trim()||void 0,schedule_input:y.schedule_input?.trim()||void 0,schedule_enabled:y.schedule_enabled!==!1};if(!Q.nodes.length){E("Add at least one node");return}try{await pe.saveGraph(Q),Qe.success("Graph saved"),v(Q),_(Y),k(""),M(re=>({...re,[Y]:Q})),$(),r(!1)}catch(re){E(re instanceof Error?re.message:String(re))}}function G(){_(""),k(""),v(C$()),E(null)}function L(Y){e(Y)}function ee(Y){_(Y),r(!0)}function ce(){G(),r(!0)}return d?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading graphs…"}):p&&i.length===0?f.jsxs("div",{className:"p-4 text-destructive",children:["Failed to load graphs: ",p]}):f.jsxs("div",{className:"space-y-6 p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Graphs"}),f.jsx("p",{className:"text-muted-foreground",children:"Run workflows or edit graphs: add agent nodes, connect them, then run."}),f.jsxs("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:["A graph is a pipeline of agents: each ",f.jsx("strong",{children:"node"})," is an agent; ",f.jsx("strong",{children:"edges"})," define the order (from → to). You provide one input; it is passed to the first node(s) with no incoming edges. Each node runs and its output can feed the next. The final output is from the last node in the chain."]}),f.jsxs("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:[f.jsx("strong",{children:"Tip:"})," Use at least different AI providers for different agents in a graph for better performance and to avoid API rate limits, since graphs make many calls."]})]}),f.jsx(be,{onClick:ce,children:"New graph"})]}),i.length===0&&f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"No graphs yet"}),f.jsx(Kt,{children:"Create your first graph to run a multi-step workflow."})]}),f.jsx(Wt,{children:f.jsx(be,{onClick:ce,children:"Create your first graph"})})]}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Your graphs"}),f.jsx(Kt,{children:"Run or edit a graph. Stored in ~/.agent-os/graphs/ (or AGENT_OS_GRAPHS_DIR)."})]}),f.jsx(Wt,{children:i.length===0?f.jsx("p",{className:"text-sm text-muted-foreground",children:"No graphs yet. Use New graph to create one."}):f.jsx("ul",{className:"space-y-2",children:i.map(Y=>f.jsxs("li",{className:"flex flex-col gap-2 rounded-lg border px-3 py-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"flex -space-x-2",children:(N[Y.id]?.nodes??[]).length>0?N[Y.id].nodes.slice(0,4).map(Q=>f.jsx(Es,{className:"size-8 shrink-0 border-2 border-background ring-1 ring-border",children:f.jsx(nl,{src:E$(Q.agent,l),alt:""})},Q.id)):f.jsx(Es,{className:"size-8 shrink-0 border-2 border-background",children:f.jsx(nl,{src:k$(Y.id),alt:""})})}),f.jsx("span",{className:"font-mono text-sm",children:Y.id}),(N[Y.id]?.schedule_input??"")&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:['Scheduled: "',N[Y.id]?.schedule_input,'"']})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:"text-xs text-muted-foreground",children:[f.jsx(Xy,{className:"mr-0.5 inline size-3"}),bA(N[Y.id]?.schedule??void 0),(N[Y.id]?.schedule??"")&&N[Y.id]?.schedule_enabled===!1&&f.jsx("span",{className:"ml-1 text-muted-foreground/80",children:"(paused)"})]}),f.jsxs(r0,{children:[f.jsx(i0,{asChild:!0,children:f.jsxs(be,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",children:[f.jsx(jT,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Actions"})]})}),f.jsxs(a0,{align:"end",children:[f.jsxs(Rn,{onClick:()=>L(Y.id),children:[f.jsx(Yo,{className:"mr-2 size-4"}),"Chat"]}),f.jsxs(Rn,{onClick:()=>ee(Y.id),children:[f.jsx(Gh,{className:"mr-2 size-4"}),"Edit graph"]}),f.jsx(Jf,{}),f.jsxs(Rn,{onClick:()=>z(Y.id),children:[f.jsx(Xy,{className:"mr-2 size-4"}),"Edit schedule"]}),(N[Y.id]?.schedule??"")&&f.jsx(Rn,{onClick:async()=>{try{const Q=await pe.getGraph(Y.id),re=Q.schedule_enabled===!1;await pe.saveGraph({...Q,schedule_enabled:re}),M(fe=>({...fe,[Y.id]:{...Q,schedule_enabled:re}})),Qe.success(re?"Schedule resumed":"Schedule paused")}catch(Q){Qe.error(Q instanceof Error?Q.message:String(Q))}},children:N[Y.id]?.schedule_enabled===!1?f.jsxs(f.Fragment,{children:[f.jsx(Yo,{className:"mr-2 size-4"})," Resume schedule"]}):f.jsxs(f.Fragment,{children:[f.jsx(Kf,{className:"mr-2 size-4"})," Pause schedule"]})}),(N[Y.id]?.schedule??"")&&f.jsx(Rn,{disabled:P!==null,onClick:async()=>{if(!P){D(Y.id);try{await pe.enqueueGraphTask(Y.id,(N[Y.id]?.schedule_input??"").trim()||"Scheduled run"),Qe.success("Job queued")}catch(Q){Qe.error(Q instanceof Error?Q.message:String(Q))}finally{D(null)}}},children:P===Y.id?"Queuing…":"Run now"}),f.jsx(Jf,{}),f.jsxs(Rn,{className:"text-destructive focus:text-destructive",onClick:async()=>{if(confirm(`Delete graph "${Y.id}"? This cannot be undone.`))try{await pe.deleteGraph(Y.id),x===Y.id&&(r(!1),_(""),v(ff)),M(Q=>{const re={...Q};return delete re[Y.id],re}),$(),Qe.success("Graph deleted")}catch(Q){Qe.error(Q instanceof Error?Q.message:String(Q))}},children:[f.jsx(Xo,{className:"mr-2 size-4"}),"Delete graph"]})]})]})]})]},Y.id))})})]}),R&&N[R]&&f.jsx(wA,{open:!0,onOpenChange:Y=>!Y&&z(null),schedule:N[R].schedule,scheduleInput:N[R].schedule_input,title:"Edit schedule",onSave:async Y=>{const re={...await pe.getGraph(R),schedule:Y.schedule??void 0,schedule_input:Y.schedule_input??void 0,schedule_enabled:!0};await pe.saveGraph(re),M(fe=>({...fe,[R]:re})),Qe.success("Schedule saved. Restart server for cron to take effect.")}}),n&&f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[f.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>r(!1),"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 flex max-h-[90vh] w-full max-w-4xl flex-col overflow-hidden rounded-xl border bg-background shadow-xl",children:[f.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-5 py-4",children:[f.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:x?"Edit graph":"New graph"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs(Au,{value:x||"__new__",onValueChange:Y=>_(Y==="__new__"?"":Y),children:[f.jsx(Mu,{className:"h-10 min-w-[200px] text-sm",children:f.jsx(Ru,{placeholder:"Select graph…"})}),f.jsxs(Du,{children:[f.jsx(Wi,{value:"__new__",children:"New graph…"}),i.map(Y=>f.jsx(Wi,{value:Y.id,children:Y.id},Y.id))]})]}),!x&&f.jsx(Ue,{placeholder:"Graph ID (e.g. my_pipeline)",value:C,onChange:Y=>k(Y.target.value),className:"h-10 w-48 text-sm"}),f.jsx(be,{type:"button",variant:"outline",size:"default",className:"h-10",onClick:G,children:"New graph"}),f.jsx(be,{type:"button",size:"default",className:"h-10",onClick:F,disabled:!y.nodes.length,children:"Save"}),x&&f.jsxs(be,{type:"button",variant:"outline",size:"default",className:"h-10",onClick:()=>{r(!1),L(x)},children:[f.jsx(Yo,{className:"mr-1.5 size-4"}),"Run"]}),f.jsx(be,{variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0",onClick:()=>r(!1),"aria-label":"Close",children:f.jsx(Is,{className:"size-5"})})]})]}),j&&f.jsx("div",{className:"shrink-0 border-b border-destructive/20 bg-destructive/10 px-5 py-2 text-sm text-destructive",children:j}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5",children:f.jsxs("div",{className:"space-y-6",children:[f.jsxs("section",{children:[f.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[f.jsx(Ne,{className:"text-sm font-medium",children:"Graph canvas"}),f.jsxs(be,{type:"button",variant:"outline",size:"default",className:"h-9",onClick:B,children:[f.jsx(Ky,{className:"mr-2 size-4"}),"Add node"]})]}),f.jsx("div",{className:"relative min-h-[380px] rounded-xl border bg-muted/20",style:{minWidth:"100%"},children:y.nodes.map((Y,Q)=>{const{x:re,y:fe}=A(Y,Q),we=U===Q;return f.jsxs("div",{className:"absolute flex w-56 flex-col rounded-lg border bg-background shadow-sm",style:{left:re,top:fe,zIndex:we?50:10},children:[f.jsxs("div",{className:"flex cursor-grab items-center gap-2 border-b bg-muted/30 px-3 py-2 rounded-t-lg active:cursor-grabbing",onPointerDown:ke=>{if(ke.button!==0)return;const Ie=A(Y,Q);X(Q),ae({clientX:ke.clientX,clientY:ke.clientY,nodeX:Ie.x,nodeY:Ie.y}),ke.target.setPointerCapture?.(ke.pointerId)},children:[f.jsx(y8,{className:"size-4 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"truncate text-xs font-medium text-muted-foreground",children:"Node"})]}),f.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx(Ne,{className:"text-xs",children:"ID"}),f.jsx(Ue,{placeholder:"Node id",value:Y.id,onChange:ke=>O(Q,{id:ke.target.value}),className:"h-9 font-mono text-sm"})]}),f.jsxs("div",{className:"space-y-1",children:[f.jsx(Ne,{className:"text-xs",children:"Agent"}),f.jsxs(Au,{value:Y.agent,onValueChange:ke=>O(Q,{agent:ke}),children:[f.jsx(Mu,{className:"h-9 w-full text-sm",children:f.jsx(Ru,{placeholder:"Agent"})}),f.jsx(Du,{children:l.map(ke=>f.jsx(Wi,{value:ke.id,children:ke.name},ke.id))})]})]}),f.jsxs(be,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-full justify-start text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>Z(Y.id),children:[f.jsx(Xo,{className:"mr-2 size-4"}),"Remove node"]})]})]},Y.id)})}),f.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Drag nodes by the top bar to reposition them."})]}),f.jsxs("section",{className:"rounded-lg border bg-muted/10 p-4",children:[f.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[f.jsx(Ne,{className:"text-sm font-medium",children:"Edges (from → to)"}),f.jsxs(be,{type:"button",variant:"outline",size:"default",className:"h-9",onClick:q,disabled:y.nodes.length<2,children:[f.jsx(Ky,{className:"mr-2 size-4"}),"Add edge"]})]}),f.jsx("ul",{className:"space-y-3",children:y.edges.map((Y,Q)=>f.jsxs("li",{className:"flex items-center gap-3 rounded-lg border bg-background p-3",children:[f.jsxs(Au,{value:Y.from,onValueChange:re=>H(Q,{from:re}),children:[f.jsx(Mu,{className:"h-10 min-w-[140px] text-sm",children:f.jsx(Ru,{placeholder:"From"})}),f.jsx(Du,{children:y.nodes.map(re=>f.jsx(Wi,{value:re.id,children:re.id},re.id))})]}),f.jsx(H_,{className:"size-5 shrink-0 text-muted-foreground"}),f.jsxs(Au,{value:Y.to,onValueChange:re=>H(Q,{to:re}),children:[f.jsx(Mu,{className:"h-10 min-w-[140px] text-sm",children:f.jsx(Ru,{placeholder:"To"})}),f.jsx(Du,{children:y.nodes.map(re=>f.jsx(Wi,{value:re.id,children:re.id},re.id))})]}),f.jsx(be,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>I(Q),"aria-label":"Remove edge",children:f.jsx(Xo,{className:"size-4"})})]},Q))})]}),f.jsxs("section",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{className:"text-sm font-medium",children:"Schedule (cron, optional)"}),f.jsx(Ue,{placeholder:"e.g. 0 9 * * *",value:y.schedule??"",onChange:Y=>v(Q=>({...Q,schedule:Y.target.value||void 0})),className:"h-10 font-mono text-sm"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{className:"text-sm font-medium",children:"Scheduled input (optional)"}),f.jsx(Ue,{placeholder:"Task when schedule runs",value:y.schedule_input??"",onChange:Y=>v(Q=>({...Q,schedule_input:Y.target.value||void 0})),className:"h-10 text-sm"})]})]}),y.nodes.length>0&&f.jsxs("div",{className:"rounded-lg border bg-muted/20 p-4",children:[f.jsx("div",{className:"mb-2 text-sm font-medium text-muted-foreground",children:"Flow preview"}),f.jsx("div",{className:"flex flex-wrap items-center gap-2",children:y.nodes.map((Y,Q)=>f.jsxs("span",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"rounded-md bg-primary/15 px-2.5 py-1 font-mono text-sm",children:Y.id}),f.jsxs("span",{className:"text-muted-foreground text-sm",children:["(",l.find(re=>re.id===Y.agent)?.name??Y.agent,")"]}),Q<y.nodes.length-1&&f.jsx(H_,{className:"size-4 text-muted-foreground"})]},Y.id))})]})]})})]})]})]})}const T$="agent1.jpg";function VC(e){return`/media/${e||T$}`}function FC(e){if(!e||typeof e!="object")return{ok:!1};const n=e;if(n.gated!==!0)return{ok:!1};if(typeof n.reason!="string"||typeof n.template!="string")return{ok:!1};const r=Array.isArray(n.suggestions)?n.suggestions.filter(s=>s&&typeof s=="object").map(s=>{const l=s;return{id:typeof l.id=="string"?l.id:"",title:typeof l.title=="string"?l.title:"",prompt:typeof l.prompt=="string"?l.prompt:""}}).filter(s=>s.id&&s.title&&s.prompt):void 0,i=Array.isArray(n.questions)?n.questions.filter(s=>s&&typeof s=="object").map(s=>{const l=s;return{id:typeof l.id=="string"?l.id:"",prompt:typeof l.prompt=="string"?l.prompt:"",example:typeof l.example=="string"?l.example:void 0}}).filter(s=>s.id&&s.prompt):void 0;return{ok:!0,reason:n.reason,template:n.template,suggestions:r,questions:i}}function A$(e){if(!e)return"";const n=new Date(e),r=new Date;return n.toDateString()===r.toDateString()?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):n.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function R$({graphId:e,initialInput:n,onBack:r}){const[i,s]=S.useState([]),[l,u]=S.useState(""),[d,h]=S.useState(!1),[p,g]=S.useState([]),[y,v]=S.useState([]),[x,_]=S.useState([]),[C,k]=S.useState(null),[j,E]=S.useState(!0),[N,M]=S.useState(null),[R,z]=S.useState(""),P=S.useRef(null),D=S.useRef(!1),$=S.useRef(null),U=S.useRef(!1);S.useEffect(()=>{pe.getAgents().then(O=>g(O.agents)).catch(()=>g([]))},[]),S.useEffect(()=>{e&&(pe.getConversations({graph_id:e,limit:50}).then(O=>_(O.conversations)).catch(()=>_([])),pe.getGraph(e).then(O=>{const q=Array.from(new Set(O.nodes.map(I=>I.agent).filter(I=>typeof I=="string"&&I.length>0)));v(q)}).catch(()=>v([])))},[e]),S.useEffect(()=>{P.current?.scrollIntoView({behavior:"smooth"})},[i]),S.useEffect(()=>()=>{$.current&&clearInterval($.current),$.current=null},[]);function X(O,q){const I=new Date().toISOString(),H=O.result?.output??(O.result?.error?`Error: ${O.result.error}`:"(no output)"),A=O.result?.node_results?.length?O.result.node_results:void 0;s(F=>{const G=[...F],L=G[G.length-1];return L?.role==="assistant"&&(G[G.length-1]={...L,content:H,steps:A,timestamp:I}),G}),q?pe.saveConversationMessage({graph_id:e,conversation_id:q,role:"assistant",content:{text:H,steps:A,timestamp:I}}).catch(()=>{}):pe.saveConversationMessage({graph_id:e,role:"user",content:{text:O.input}}).then(F=>{pe.saveConversationMessage({graph_id:e,conversation_id:F.conversation_id,role:"assistant",content:{text:H,steps:A,timestamp:I}}).catch(()=>{})}).catch(()=>{}),pe.getConversations({graph_id:e,limit:50}).then(F=>_(F.conversations)).catch(()=>{})}function K(O,q){$.current&&clearInterval($.current);const I=setInterval(async()=>{if(U.current){clearInterval(I),$.current=null,h(!1);return}try{const{task:H}=await pe.getTaskById(O);if(H.status==="completed"||H.status==="failed"){clearInterval(I),$.current=null,X(H,q),h(!1);return}}catch{}},1500);$.current=I}async function ae(O){if(!O.trim())return;const q=new Date().toISOString();u(""),h(!0),U.current=!1;let I=C;try{const H=await pe.saveConversationMessage({graph_id:e,conversation_id:C??void 0,role:"user",content:{text:O.trim()}});I=H.conversation_id,C||(k(H.conversation_id),pe.getConversations({graph_id:e,limit:50}).then(A=>_(A.conversations)).catch(()=>{}))}catch{}s(H=>[...H,{role:"user",content:O.trim(),timestamp:q}]),s(H=>[...H,{role:"assistant",content:"Running…"}]);try{const{task:H}=await pe.enqueueGraphTask(e,O.trim());K(H.id,I)}catch(H){const A=H,F=A&&typeof A=="object"&&"data"in A?A.data:void 0,G=FC(F);s(L=>{const ee=[...L],ce=ee[ee.length-1];if(ce?.role==="assistant")if(G.ok){const Y=G.reason,Q=G.template,re=G.suggestions,fe=G.questions;ee[ee.length-1]={...ce,content:`**Prompt needs structure**
|
|
70
|
+
|
|
71
|
+
${Y}
|
|
72
|
+
|
|
73
|
+
Fill this template and resend:`,gate:{reason:Y,template:Q,suggestions:re,questions:fe},timestamp:new Date().toISOString()}}else ee[ee.length-1]={...ce,content:`Error: ${H instanceof Error?H.message:String(H)}`,timestamp:new Date().toISOString()};return ee}),h(!1)}}function B(){U.current=!0,$.current&&(clearInterval($.current),$.current=null),h(!1),s(O=>{const q=[...O],I=q[q.length-1];return I?.role==="assistant"&&!I.timestamp&&(q[q.length-1]={...I,content:I.content||"Running in background. Return to this page to see the result."}),q})}S.useEffect(()=>{if(!e||D.current)return;const O=n?.trim();pe.getTasks({graph_id:e,limit:10}).then(({tasks:q})=>{const I=[...q].reverse().find(F=>F.status==="running"||F.status==="queued");if(I&&I.graph_id===e){D.current=!0,s([{role:"user",content:I.input,timestamp:I.created_at},{role:"assistant",content:"Running…"}]),h(!0),U.current=!1,K(I.id,null);return}if(!O)return;D.current=!0;const H=new Date().toISOString();s([{role:"user",content:O,timestamp:H},{role:"assistant",content:"Running…"}]),h(!0),U.current=!1;let A=null;pe.saveConversationMessage({graph_id:e,role:"user",content:{text:O}}).then(F=>{A=F.conversation_id,k(F.conversation_id),pe.getConversations({graph_id:e,limit:50}).then(G=>_(G.conversations)).catch(()=>{})}).catch(()=>{}),pe.enqueueGraphTask(e,O).then(({task:F})=>K(F.id,A)).catch(F=>{const G=F,L=G&&typeof G=="object"&&"data"in G?G.data:void 0,ee=FC(L);s(ce=>{const Y=[...ce],Q=Y[Y.length-1];if(Q?.role==="assistant")if(ee.ok){const re=ee.reason,fe=ee.template,we=ee.suggestions,ke=ee.questions;Y[Y.length-1]={...Q,content:`**Prompt needs structure**
|
|
74
|
+
|
|
75
|
+
${re}
|
|
76
|
+
|
|
77
|
+
Fill this template and resend:`,gate:{reason:re,template:fe,suggestions:we,questions:ke},timestamp:new Date().toISOString()}}else Y[Y.length-1]={...Q,content:`Error: ${F instanceof Error?F.message:String(F)}`,timestamp:new Date().toISOString()};return Y}),h(!1)})}).catch(()=>{})},[e,n]);async function Z(O){O.preventDefault();const q=l.trim();!q||d||await ae(q)}return e?f.jsxs("div",{className:"flex h-[calc(100vh-3rem)]",children:[!j&&f.jsx("div",{className:"flex shrink-0 flex-col border-r bg-muted/30",children:f.jsx(be,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-none",title:"Show conversations",onClick:()=>E(!0),children:f.jsx(Ox,{className:"size-5"})})}),j&&f.jsxs("div",{className:"flex w-64 flex-col border-r",children:[f.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[f.jsx("span",{className:"text-xs font-semibold uppercase text-muted-foreground",children:"Conversations"}),f.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",title:"Hide sidebar",onClick:()=>E(!1),children:f.jsx(Xf,{className:"size-4"})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto",children:x.length===0?f.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"No conversations yet."}):f.jsx("ul",{className:"space-y-0.5 p-2",children:x.map(O=>{const q=O.id===C,I=N===O.id,H=O.title&&O.title.trim().length>0?O.title:"Untitled conversation";return f.jsx("li",{className:"group/list flex items-center gap-0.5 rounded-md",children:I?f.jsx(Ue,{value:R,onChange:A=>z(A.target.value),onBlur:async()=>{const A=R.trim().slice(0,200)||"Untitled conversation";M(null);try{await pe.updateConversationTitle(O.id,A),pe.getConversations({graph_id:e,limit:50}).then(F=>_(F.conversations)).catch(()=>{})}catch{}},onKeyDown:A=>{A.key==="Enter"&&A.target.blur()},className:"h-7 flex-1 text-xs",autoFocus:!0}):f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-1 text-left text-xs "+(q?"bg-primary/10 font-medium":"hover:bg-muted"),onClick:async()=>{k(O.id);try{const F=(await pe.getConversationMessages({conversation_id:O.id,limit:100})).messages.filter(G=>G.role==="user"||G.role==="assistant").map(G=>{const L=G.content,ee=typeof L=="string"?L:typeof L?.text=="string"?L.text:JSON.stringify(L??""),ce=typeof L=="object"&&L!==null&&Array.isArray(L.steps)?L.steps:void 0,Y=typeof L=="object"&&L!==null&&typeof L.timestamp=="string"?L.timestamp:void 0;return{role:G.role,content:ee,steps:ce,timestamp:Y}});s(F)}catch{}},children:[f.jsx("div",{className:"truncate",children:H}),f.jsx("div",{className:"text-[10px] text-muted-foreground",children:new Date(O.created_at).toLocaleString()})]}),f.jsx(be,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 opacity-0 group-hover/list:opacity-100",title:"Rename",onClick:A=>{A.stopPropagation(),M(O.id),z(H)},children:f.jsx(Gh,{className:"size-3"})})]})},O.id)})})})]}),f.jsxs("div",{className:"relative flex flex-1 flex-col",children:[f.jsxs("div",{className:"shrink-0 flex items-center justify-between gap-2 border-b px-4 py-2 relative z-10",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(be,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Back to Graphs",children:f.jsx(Xf,{className:"h-4 w-4"})}),f.jsx("span",{className:"font-mono text-sm font-medium",children:e}),f.jsx("span",{className:"text-muted-foreground text-xs",children:"Graph chat"})]}),f.jsx(be,{variant:"outline",size:"sm",onClick:()=>{k(null),s([])},children:"New conversation"})]}),f.jsx("div",{className:"pointer-events-none absolute inset-0 z-0 flex items-center justify-center",children:f.jsxs("div",{className:"flex h-[360px] w-full max-w-2xl flex-col items-center justify-center overflow-hidden rounded-2xl bg-gradient-to-b from-background via-background/80 to-background",children:[f.jsx(gA,{className:"absolute inset-0"}),i.length===0&&!n&&f.jsxs("div",{className:"relative flex flex-col items-center text-center gap-4 px-6",children:[f.jsx("div",{className:"flex flex-wrap justify-center gap-4",children:(y.length?p.filter(O=>y.includes(O.id)):p).slice(0,4).map(O=>f.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[f.jsx(yA,{className:"p-1.5 rounded-full",children:f.jsxs(Es,{className:"size-12 rounded-full bg-background/80 backdrop-blur",children:[f.jsx(nl,{src:VC(O.avatar),alt:O.name}),f.jsx(Cs,{className:"bg-muted text-muted-foreground",children:f.jsx(tl,{className:"size-5"})})]})}),f.jsx("span",{className:"text-xs font-medium text-foreground/90 max-w-[80px] truncate text-center",title:O.name,children:O.name})]},O.id))}),f.jsx("p",{className:"max-w-md text-sm text-muted-foreground",children:"Send a message to run the graph. Each message is sent as input to the first node(s)."})]})]})}),f.jsx("div",{className:"relative z-10 flex-1 overflow-y-auto p-4",children:f.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[i.map((O,q)=>{const I=d&&q===i.length-1&&O.role==="assistant"&&!O.timestamp,H=O.role==="user";return f.jsxs("div",{className:`flex gap-2 ${H?"flex-row-reverse":""} max-w-[95%] ${H?"ml-auto":"mr-auto"}`,children:[f.jsx(Es,{className:"size-8 shrink-0 rounded-full border border-border",children:H?f.jsx(Cs,{className:"bg-primary text-primary-foreground",children:f.jsx(TT,{className:"size-4"})}):f.jsx(Cs,{className:"bg-muted text-muted-foreground",children:f.jsx(nc,{className:"size-4"})})}),f.jsxs("div",{className:`flex min-w-0 flex-1 flex-col ${H?"items-end":"items-start"}`,children:[f.jsxs("div",{className:H?"w-fit max-w-full sm:max-w-[72ch] rounded-2xl rounded-tr-sm bg-primary px-4 py-2 text-sm text-primary-foreground":"w-fit max-w-full sm:max-w-[72ch] rounded-2xl rounded-tl-sm border bg-muted/50 px-4 py-2 text-sm",children:[H?f.jsxs("div",{className:"whitespace-pre-wrap break-words",children:[O.content,I&&f.jsx("span",{className:"animate-pulse",children:"▌"})]}):f.jsxs("div",{className:"whitespace-pre-wrap break-words",children:[f.jsx(Wh,{content:O.content}),I&&f.jsx("span",{className:"animate-pulse",children:"▌"})]}),O.role==="assistant"&&O.gate&&f.jsxs("div",{className:"mt-3 rounded-lg border border-border/60 bg-background/60 p-3",children:[f.jsx("div",{className:"text-xs font-semibold text-muted-foreground",children:"Structured prompt template"}),O.gate.suggestions&&O.gate.suggestions.length>0&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:O.gate.suggestions.map(A=>f.jsx(be,{type:"button",variant:"secondary",size:"sm",onClick:()=>{u(A.prompt),U.current=!0,h(!1)},title:A.prompt,children:A.title},A.id))}),f.jsx("pre",{className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/40 p-2 text-xs text-foreground/90",children:O.gate.template}),O.gate.questions&&O.gate.questions.length>0&&f.jsx("div",{className:"mt-2 space-y-1 text-xs text-muted-foreground",children:O.gate.questions.map(A=>f.jsxs("div",{children:[f.jsx("span",{className:"font-medium text-foreground/80",children:A.prompt}),A.example?f.jsxs("span",{className:"ml-1 text-muted-foreground",children:["Example: ",A.example]}):null]},A.id))}),f.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[f.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{u(O.gate?.template??""),U.current=!0,h(!1)},children:"Use template"}),f.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:async()=>{try{await navigator.clipboard.writeText(O.gate?.template??"")}catch{}},children:"Copy"})]})]}),O.role==="assistant"&&O.steps&&O.steps.length>0&&f.jsxs("details",{className:"group mt-2 border-t border-border/50 pt-2",children:[f.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground [&::-webkit-details-marker]:hidden",children:[f.jsx(Zn,{className:"size-3 shrink-0 transition-transform group-open:rotate-90"}),f.jsx(nc,{className:"size-3 shrink-0"}),f.jsxs("span",{children:["Steps (",O.steps.length,")"]})]}),f.jsx("ul",{className:"mt-2 space-y-2 pl-4",children:O.steps.map((A,F)=>{const G=p.find(ee=>ee.id===A.agent_id),L=G?.name??A.agent_id;return f.jsxs("li",{className:"flex gap-2 rounded border border-border/50 bg-muted/30 p-2 text-xs",children:[f.jsx("div",{className:"flex shrink-0 items-start pt-0.5",children:f.jsxs(Es,{className:"size-6 rounded-full border border-border",children:[f.jsx(nl,{src:VC(G?.avatar),alt:L}),f.jsx(Cs,{className:"bg-muted text-muted-foreground",children:f.jsx(tl,{className:"size-3"})})]})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("div",{className:"min-w-0 font-medium text-foreground",title:L,children:L}),f.jsx("span",{className:"min-w-0 truncate text-[10px] text-muted-foreground",title:A.node_id,children:A.node_id})]}),A.error!=null&&f.jsx("div",{className:"mt-1 text-destructive",children:A.error}),A.output!=null&&A.error==null&&f.jsx("pre",{className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words text-muted-foreground",children:A.output||"(no output)"})]})]},F)})})]})]}),f.jsx("div",{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-0 text-[10px] text-muted-foreground ${H?"justify-end":""}`,children:O.timestamp&&f.jsx("span",{children:A$(O.timestamp)})})]})]},q)}),f.jsx("div",{ref:P})]})}),f.jsx("div",{className:"shrink-0 border-t p-4",children:f.jsxs("form",{onSubmit:Z,className:"mx-auto flex max-w-2xl gap-2",children:[f.jsx(Ue,{placeholder:"Message (input for the graph)…",value:l,onChange:O=>u(O.target.value),disabled:d,className:"flex-1"}),d?f.jsx(be,{type:"button",variant:"outline",onClick:B,children:"Stop"}):f.jsx(be,{type:"submit",disabled:!l.trim(),children:"Send"})]})})]})]}):f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-8 text-muted-foreground",children:[f.jsx("p",{children:"No graph selected."}),f.jsx(be,{variant:"outline",onClick:r,children:"Back to Graphs"})]})}const Po=[{id:"openai",label:"OpenAI",hint:"GPT-4, GPT-4o, coding, multimodal. Set OPENAI_API_KEY."},{id:"anthropic",label:"Anthropic",hint:"Claude, long context, tool use. Set ANTHROPIC_API_KEY."},{id:"google",label:"Google (Gemini)",hint:"Gemini 2.5, multimodal. Set GOOGLE_GENERATIVE_AI_API_KEY or Vertex."},{id:"openrouter",label:"OpenRouter",hint:"One API for 400+ models. Set OPENROUTER_API_KEY."},{id:"custom",label:"Custom",hint:"Enter any model id (e.g. for another backend)."}],SA=[{id:"gpt-4o-mini",label:"GPT-4o mini (fast, affordable)"},{id:"gpt-4o",label:"GPT-4o"},{id:"gpt-4-turbo",label:"GPT-4 Turbo"},{id:"gpt-4.1",label:"GPT-4.1"},{id:"gpt-4.1-mini",label:"GPT-4.1 mini"},{id:"gpt-3.5-turbo",label:"GPT-3.5 Turbo"}],_A=[{id:"anthropic/claude-sonnet-4.6",label:"Claude Sonnet 4.6"},{id:"anthropic/claude-opus-4.6",label:"Claude Opus 4.6"},{id:"anthropic/claude-haiku-4.5",label:"Claude Haiku 4.5"}],CA=[{id:"google/gemini-2.5-flash",label:"Gemini 2.5 Flash"},{id:"google/gemini-2.5-pro",label:"Gemini 2.5 Pro"},{id:"google/gemini-2.0-flash",label:"Gemini 2.0 Flash"},{id:"google/gemini-1.5-pro",label:"Gemini 1.5 Pro"},{id:"google/gemini-1.5-flash",label:"Gemini 1.5 Flash"}],jA=[{id:"openai/gpt-4o-mini",label:"OpenAI · GPT-4o mini"},{id:"openai/gpt-4o",label:"OpenAI · GPT-4o"},{id:"anthropic/claude-sonnet-4.6",label:"Anthropic · Claude Sonnet 4.6"},{id:"anthropic/claude-opus-4.6",label:"Anthropic · Claude Opus 4.6"},{id:"anthropic/claude-3.5-sonnet",label:"Anthropic · Claude 3.5 Sonnet"},{id:"google/gemini-2.5-flash",label:"Google · Gemini 2.5 Flash"},{id:"google/gemini-2.5-pro",label:"Google · Gemini 2.5 Pro"}];function hf(e){switch(e){case"openai":return SA;case"anthropic":return _A;case"google":return CA;case"openrouter":return jA;default:return[]}}function M$(e){const n=e.trim();return n.includes("/")?n.startsWith("anthropic/")?UC(n):n:/^gemini-[a-z0-9.-]+$/i.test(n)?`google/${n}`:/^claude-[a-z0-9.-]+$/i.test(n)?UC(`anthropic/${n.replace(/\./g,"-")}`):n}function UC(e){return{"anthropic/claude-3-5-sonnet-20241022":"anthropic/claude-sonnet-4.6","anthropic/claude-3-5-sonnet-20240620":"anthropic/claude-sonnet-4.6","anthropic/claude-3-5-haiku-20241022":"anthropic/claude-haiku-4.5","anthropic/claude-3-opus-20240229":"anthropic/claude-opus-4.6","anthropic/claude-3-sonnet-20240229":"anthropic/claude-sonnet-4.6","anthropic/claude-3-haiku-20240307":"anthropic/claude-haiku-4.5","anthropic/claude-3.5-sonnet":"anthropic/claude-sonnet-4.6","anthropic/claude-3-5-sonnet":"anthropic/claude-sonnet-4.6","anthropic/claude-3-opus":"anthropic/claude-opus-4.6","anthropic/claude-3-sonnet":"anthropic/claude-sonnet-4.6","anthropic/claude-3-haiku":"anthropic/claude-haiku-4.5","anthropic/claude-3.5-haiku":"anthropic/claude-haiku-4.5"}[e]??e}function D$(e){const n=e.trim();return n?n.includes("/")?"openrouter":SA.some(r=>r.id===n)?"openai":_A.some(r=>r.id===n)?"anthropic":CA.some(r=>r.id===n)||/^gemini-[a-z0-9.-]+$/i.test(n)?"google":/^claude-[a-z0-9.-]+$/i.test(n)?"anthropic":jA.some(r=>r.id===n)?"openrouter":"custom":"openai"}const kA="agent1.jpg",O$="/media/avatars.json";function z$(e){return e?`/media/${e}`:`/media/${kA}`}function BC({onNavigate:e}={}){const{openChatWithAgent:n}=Ux(),[r,i]=S.useState([]),[s,l]=S.useState(!0),[u,d]=S.useState(null),[h,p]=S.useState(null),[g,y]=S.useState(null),[v,x]=S.useState(!1),[_,C]=S.useState(null),[k,j]=S.useState(null),[E,N]=S.useState(!1),[M,R]=S.useState(!1),[z,P]=S.useState("describe"),[D,$]=S.useState([]),[U,X]=S.useState({id:"",name:"",model:"gpt-4o-mini"}),[K,ae]=S.useState("openai"),[B,Z]=S.useState(!1),[O,q]=S.useState(null),[I,H]=S.useState(""),[A,F]=S.useState(!1),[G,L]=S.useState(null),[ee,ce]=S.useState(null),[Y,Q]=S.useState("openai"),[re,fe]=S.useState({name:"",description:"",model:"gpt-4o-mini",personality:"",skills:[],schedule:"",schedule_input:""}),[we,ke]=S.useState(!1),[Ie,et]=S.useState(null),[lt,cn]=S.useState([kA]),[yt,me]=S.useState("identity"),[Le,ut]=S.useState(""),[Zt,Ut]=S.useState(!1),[Cn,nn]=S.useState(!1),[wt,mn]=S.useState(null),he=D.filter(W=>W.id!=="memory");S.useEffect(()=>{fetch(O$).then(W=>W.ok?W.json():null).then(W=>{Array.isArray(W)&&W.length>0&&cn(W.filter(ve=>typeof ve=="string"))}).catch(()=>{})},[]);function Se(){return pe.getAgents().then(W=>{i(W.agents);const ve=W.error;d(ve??null)}).catch(W=>d(W.message))}S.useEffect(()=>{Se().finally(()=>l(!1))},[]),S.useEffect(()=>{(M||ee)&&pe.getSkills().then(W=>$(W.skills)).catch(()=>$([]))},[M,ee]);const Oe={identity:"IDENTITY.md",user:"USER.md",tools:"TOOLS.md",playbook:"SYSTEM.md"};return S.useEffect(()=>{ee&&(Ut(!0),mn(null),pe.getWorkspaceFileContent(ee,Oe[yt]).then(ut).catch(W=>{mn(W instanceof Error?W.message:String(W)),ut("")}).finally(()=>Ut(!1)))},[ee,yt]),s?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading agents…"}):u?f.jsxs("div",{className:"p-4 text-destructive",children:["Failed to load agents: ",u]}):f.jsxs("div",{className:"space-y-8 p-6 max-w-4xl mx-auto",children:[f.jsxs("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Agents"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Create and manage agents. Use Chat to run an agent with a task."})]}),f.jsx(be,{className:"shrink-0 mt-2 sm:mt-0",onClick:()=>{R(!0),P("describe"),X({id:"",name:"",model:"gpt-4o-mini"}),q(null),L(null)},children:"Add agent"})]}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Your agents"}),f.jsx(Kt,{children:r.length===0?"No agents yet. Install from system or add your own.":`${r.length} agent${r.length===1?"":"s"}. Edit schedule to run on a schedule.`})]}),f.jsx(Wt,{children:r.length===0?f.jsxs("div",{className:"py-6 space-y-4",children:[f.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Install default agents from the system, or create a custom one."}),f.jsxs("div",{className:"flex flex-wrap gap-3 justify-center",children:[f.jsx(be,{disabled:E,onClick:async()=>{N(!0);try{const{installed:W}=await pe.installSystemAgents();await Se(),Qe.success(W>0?`Installed ${W} agent${W===1?"":"s"} from system.`:"No new agents to install (already present).")}catch(W){Qe.error(W instanceof Error?W.message:"Failed to install from system")}finally{N(!1)}},children:E?"Installing…":"Install from system"}),f.jsx(be,{variant:"outline",onClick:()=>{R(!0),P("describe"),X({id:"",name:"",model:"gpt-4o-mini"}),q(null),L(null)},children:"Add agent"})]})]}):f.jsx("ul",{className:"space-y-3",children:r.map(W=>f.jsxs("li",{className:"flex flex-col gap-2 rounded-lg border border-border/80 bg-card p-4 transition-colors hover:border-border",children:[f.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs("div",{className:"relative shrink-0",children:[f.jsx("img",{src:z$(W.avatar),alt:"",className:"h-12 w-12 rounded-full object-cover border border-border"}),f.jsx(be,{type:"button",size:"sm",variant:"secondary",className:"absolute -bottom-1 -right-1 h-6 w-6 rounded-full p-0 text-xs",title:"Change avatar",disabled:v,onClick:()=>y(ve=>ve===W.id?null:W.id),children:"✎"})]}),f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:W.name}),f.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:[W.id," · ",W.model]})]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsxs("span",{className:"text-sm text-muted-foreground",children:["Schedule: ",bA(W.schedule??void 0),W.schedule&&W.schedule_enabled===!1&&f.jsx("span",{className:"ml-1 text-muted-foreground/80",children:"(paused)"})]}),f.jsxs(r0,{children:[f.jsx(i0,{asChild:!0,children:f.jsxs(be,{size:"sm",variant:"ghost",className:"h-8 w-8 p-0",children:[f.jsx(jT,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Actions"})]})}),f.jsxs(a0,{align:"end",children:[f.jsxs(Rn,{onClick:()=>n(W.id),children:[f.jsx(Hh,{className:"size-4"}),"Chat"]}),e&&f.jsxs(Rn,{onClick:()=>{try{sessionStorage.setItem("memoryFilterAgentId",W.id)}catch{}e("memory")},children:[f.jsx(Dx,{className:"size-4"}),"Manage memory"]}),f.jsxs(Rn,{onClick:()=>{ce(W.id);const ve=W.model??"gpt-4o-mini",st=M$(ve);fe({name:W.name??"",description:W.description??"",model:st,personality:W.personality??"",skills:W.skills??[],avatar:W.avatar??void 0,schedule:W.schedule??"",schedule_input:W.schedule_input??""}),Q(D$(ve)),et(null)},children:[f.jsx(Gh,{className:"size-4"}),"Edit agent"]}),f.jsx(Jf,{}),f.jsxs(Rn,{onClick:()=>{p(W.id)},children:[f.jsx(Xy,{className:"size-4"}),"Edit schedule"]}),W.schedule&&f.jsx(Rn,{onClick:async()=>{try{await pe.updateAgent(W.id,{schedule_enabled:W.schedule_enabled===!1}),await Se(),Qe.success(W.schedule_enabled===!1?"Schedule resumed":"Schedule paused")}catch(ve){Qe.error(ve instanceof Error?ve.message:"Failed to update")}},children:W.schedule_enabled===!1?f.jsxs(f.Fragment,{children:[f.jsx(Yo,{className:"size-4"}),"Resume schedule"]}):f.jsxs(f.Fragment,{children:[f.jsx(Kf,{className:"size-4"}),"Pause schedule"]})}),f.jsxs(Rn,{disabled:k===W.id,onClick:async()=>{j(W.id);try{await pe.enqueueTask(W.id,(W.schedule_input??"").trim()||"Scheduled run"),Qe.success("Job queued")}catch(ve){Qe.error(ve instanceof Error?ve.message:"Failed to run job")}finally{j(null)}},children:[f.jsx(_T,{className:"size-4"}),k===W.id?"Running…":"Run job now"]}),f.jsx(Jf,{}),f.jsxs(Rn,{variant:"destructive",disabled:_===W.id,onClick:async()=>{if(!confirm(`Delete agent "${W.name}"? This cannot be undone.`))return;C(W.id);const ve=W.id;try{await pe.deleteAgent(ve),i(st=>st.filter(jt=>jt.id!==ve)),Qe.success("Agent deleted")}catch(st){Qe.error(st instanceof Error?st.message:"Failed to delete agent")}finally{C(null)}},children:[f.jsx(Xo,{className:"size-4"}),_===W.id?"Deleting…":"Delete"]})]})]})]})]}),W.description&&f.jsx("span",{className:"text-sm text-muted-foreground",children:W.description}),(W.schedule_input??"")&&f.jsxs("p",{className:"text-xs text-muted-foreground",children:['Scheduled task: "',W.schedule_input,'"']}),g===W.id&&f.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 rounded-lg border bg-muted/30 p-3",children:[f.jsx("span",{className:"text-xs text-muted-foreground w-full",children:"Choose avatar"}),lt.map(ve=>f.jsx("button",{type:"button",onClick:async()=>{x(!0);try{await pe.updateAgent(W.id,{avatar:ve}),y(null),await Se()}finally{x(!1)}},className:"h-12 w-12 rounded-full overflow-hidden border-2 border-transparent hover:border-primary focus:border-primary focus:outline-none",title:ve,children:f.jsx("img",{src:`/media/${ve}`,alt:"",className:"h-full w-full object-cover"})},ve)),f.jsx(be,{size:"sm",variant:"ghost",onClick:()=>y(null),children:"Cancel"})]})]},W.id))})})]}),h&&(()=>{const W=r.find(ve=>ve.id===h);return W?f.jsx(wA,{open:!0,onOpenChange:ve=>!ve&&p(null),schedule:W.schedule,scheduleInput:W.schedule_input,title:"Edit schedule",onSave:async ve=>{await pe.updateAgent(h,{schedule:ve.schedule,schedule_input:ve.schedule_input}),await Se()}}):null})(),M&&f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"create-agent-title",children:[f.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>{R(!1),q(null),L(null)}}),f.jsxs("div",{className:"relative z-10 w-full max-w-lg max-h-[90vh] overflow-y-auto rounded-lg border bg-card p-6 shadow-lg",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[f.jsx("h2",{id:"create-agent-title",className:"text-lg font-semibold",children:"Create agent"}),f.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>{R(!1),q(null),L(null)},"aria-label":"Close",children:f.jsx(Is,{className:"h-4 w-4"})})]}),f.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Describe what you want, or add an agent manually by choosing skills."}),f.jsx("div",{className:"space-y-4",children:z==="describe"?f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsx(Ne,{children:"Describe your agent (optional)"}),f.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:'e.g. "News reporter that gives me daily trending news every day at 9 am"'}),f.jsx("textarea",{className:"flex min-h-[80px] w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm",placeholder:"Describe the agent you want…",value:I,onChange:W=>H(W.target.value),rows:3}),f.jsx("div",{className:"mt-2 flex gap-2",children:f.jsx(be,{variant:"default",disabled:A||!I.trim(),onClick:async()=>{F(!0),L(null);try{const{suggestion:W}=await pe.suggestAgent(I);X({id:W.id,name:W.name,model:"gpt-4o-mini",description:W.description||void 0,skills:W.skills?.length?W.skills:void 0,schedule:W.schedule||void 0,schedule_input:W.schedule_input||void 0}),ae("openai"),P("form"),H("")}catch(W){L(W instanceof Error?W.message:String(W))}finally{F(!1)}},children:A?"Analyzing…":"Suggest"})}),G&&f.jsx("p",{className:"mt-1 text-sm text-destructive",children:G})]}),f.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:f.jsx("span",{children:"or"})}),f.jsx(be,{variant:"outline",onClick:()=>P("form"),children:"New agent (choose yourself)"})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[f.jsxs("div",{children:[f.jsx(Ne,{children:"Id (unique)"}),f.jsx(Ue,{placeholder:"e.g. my_assistant (letters, numbers, _ - .)",value:U.id,onChange:W=>X(ve=>({...ve,id:W.target.value.trim().toLowerCase().replace(/\s+/g,"_").replace(/[^a-z0-9_.-]/g,"_")}))})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Name"}),f.jsx(Ue,{placeholder:"e.g. My Assistant",value:U.name,onChange:W=>X(ve=>({...ve,name:W.target.value}))})]})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"AI provider"}),f.jsx("select",{value:K,onChange:W=>{const ve=W.target.value;if(ae(ve),ve!=="custom"){const st=hf(ve);X(jt=>({...jt,model:st[0]?.id??jt.model}))}},className:"mt-1 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:Po.map(W=>f.jsx("option",{value:W.id,children:W.label},W.id))}),Po.find(W=>W.id===K)?.hint&&f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Po.find(W=>W.id===K)?.hint})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Model"}),K==="custom"?f.jsx(Ue,{placeholder:"e.g. gpt-4o-mini or openai/gpt-4o",value:U.model,onChange:W=>X(ve=>({...ve,model:W.target.value})),className:"mt-1"}):f.jsx("select",{value:U.model,onChange:W=>X(ve=>({...ve,model:W.target.value})),className:"mt-1 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:hf(K).map(W=>f.jsx("option",{value:W.id,children:W.label},W.id))})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Description (optional)"}),f.jsx(Ue,{placeholder:"What this agent does",value:U.description??"",onChange:W=>X(ve=>({...ve,description:W.target.value||void 0}))})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Personality (optional)"}),f.jsx(Ue,{placeholder:"e.g. Friendly, supportive",value:U.personality??"",onChange:W=>X(ve=>({...ve,personality:W.target.value||void 0}))})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Avatar (optional)"}),f.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Pick one or leave blank for a random avatar."}),f.jsx("div",{className:"flex flex-wrap gap-2",children:lt.map(W=>f.jsx("button",{type:"button",onClick:()=>X(ve=>({...ve,avatar:ve.avatar===W?void 0:W})),className:`h-10 w-10 rounded-full overflow-hidden border-2 focus:outline-none ${U.avatar===W?"border-primary ring-1 ring-primary":"border-transparent hover:border-muted-foreground"}`,title:W,children:f.jsx("img",{src:`/media/${W}`,alt:"",className:"h-full w-full object-cover"})},W))})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Skills (optional)"}),f.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Pick installed skills. Each skill adds its own tools to the agent. Memory is included for all agents."}),f.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-muted-foreground",children:[f.jsx("button",{type:"button",className:"underline hover:text-primary",onClick:()=>{const W=he.map(ve=>ve.id);X(ve=>({...ve,skills:W.length?W:void 0}))},children:"Select all skills"}),f.jsx("span",{children:"·"}),f.jsx("button",{type:"button",className:"underline hover:text-primary",onClick:()=>{X(W=>({...W,skills:void 0}))},children:"Clear"})]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[he.map(W=>f.jsxs("label",{className:"flex items-center gap-1.5 text-sm",children:[f.jsx("input",{type:"checkbox",checked:(U.skills??[]).includes(W.id),onChange:ve=>{const st=ve.target.checked?[...U.skills??[],W.id]:(U.skills??[]).filter(jt=>jt!==W.id);X(jt=>({...jt,skills:st.length?st:void 0}))},className:"rounded border-input"}),W.name]},W.id)),he.length===0&&f.jsx("span",{className:"text-sm text-muted-foreground",children:"No optional skills installed."})]})]}),f.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[f.jsxs("div",{children:[f.jsx(Ne,{children:"Schedule (optional)"}),f.jsx(Ue,{placeholder:"e.g. 0 9 * * * (daily 9am)",value:U.schedule??"",onChange:W=>X(ve=>({...ve,schedule:W.target.value||void 0})),className:"font-mono text-sm"})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Scheduled task (optional)"}),f.jsx(Ue,{placeholder:"Task to run on schedule",value:U.schedule_input??"",onChange:W=>X(ve=>({...ve,schedule_input:W.target.value||void 0}))})]})]}),O&&f.jsx("p",{className:"text-sm text-destructive",children:O}),f.jsxs("div",{className:"flex gap-2 pt-2",children:[f.jsx(be,{disabled:B||!U.id||!U.name||!U.model,onClick:async()=>{Z(!0),q(null);try{await pe.createAgent(U),R(!1),X({id:"",name:"",model:"gpt-4o-mini"}),ae("openai"),await Se()}catch(W){q(W instanceof Error?W.message:String(W))}finally{Z(!1)}},children:B?"Creating…":"Create"}),f.jsx(be,{variant:"secondary",onClick:()=>{R(!1),q(null),L(null)},children:"Cancel"})]})]})})]})]}),ee&&f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"edit-agent-title",children:[f.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>{ce(null),et(null)}}),f.jsxs("div",{className:"relative z-10 w-full max-w-lg max-h-[90vh] overflow-y-auto rounded-lg border bg-card p-6 shadow-lg",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[f.jsx("h2",{id:"edit-agent-title",className:"text-lg font-semibold",children:"Edit agent"}),f.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>{ce(null),et(null)},"aria-label":"Close",children:f.jsx(Is,{className:"h-4 w-4"})})]}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(Ne,{children:"Id (read-only)"}),f.jsx(Ue,{value:ee,readOnly:!0,className:"mt-1 bg-muted font-mono text-sm"})]}),f.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[f.jsxs("div",{children:[f.jsx(Ne,{children:"Name"}),f.jsx(Ue,{value:re.name,onChange:W=>fe(ve=>({...ve,name:W.target.value})),placeholder:"e.g. My Assistant"})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"AI provider"}),f.jsx("select",{value:Y,onChange:W=>{const ve=W.target.value;if(Q(ve),ve!=="custom"){const st=hf(ve);fe(jt=>({...jt,model:st[0]?.id??jt.model}))}},className:"mt-1 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:Po.map(W=>f.jsx("option",{value:W.id,children:W.label},W.id))}),Po.find(W=>W.id===Y)?.hint&&f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Po.find(W=>W.id===Y)?.hint})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Model"}),Y==="custom"?f.jsx(Ue,{value:re.model,onChange:W=>fe(ve=>({...ve,model:W.target.value})),placeholder:"e.g. gpt-4o-mini",className:"mt-1"}):f.jsx("select",{value:re.model,onChange:W=>fe(ve=>({...ve,model:W.target.value})),className:"mt-1 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:hf(Y).map(W=>f.jsx("option",{value:W.id,children:W.label},W.id))})]})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Description (optional)"}),f.jsx(Ue,{value:re.description,onChange:W=>fe(ve=>({...ve,description:W.target.value})),placeholder:"What this agent does"})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Personality (optional)"}),f.jsx(Ue,{value:re.personality,onChange:W=>fe(ve=>({...ve,personality:W.target.value})),placeholder:"e.g. Friendly, supportive"})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Avatar (optional)"}),f.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:lt.map(W=>f.jsx("button",{type:"button",onClick:()=>fe(ve=>({...ve,avatar:ve.avatar===W?void 0:W})),className:`h-10 w-10 rounded-full overflow-hidden border-2 focus:outline-none ${re.avatar===W?"border-primary ring-1 ring-primary":"border-transparent hover:border-muted-foreground"}`,title:W,children:f.jsx("img",{src:`/media/${W}`,alt:"",className:"h-full w-full object-cover"})},W))})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Skills (optional)"}),f.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Pick installed skills. Memory is included for all agents."}),f.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-muted-foreground",children:[f.jsx("button",{type:"button",className:"underline hover:text-primary",onClick:()=>{const W=he.map(ve=>ve.id);fe(ve=>({...ve,skills:W}))},children:"Select all skills"}),f.jsx("span",{children:"·"}),f.jsx("button",{type:"button",className:"underline hover:text-primary",onClick:()=>{fe(W=>({...W,skills:[]}))},children:"Clear"})]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[he.map(W=>f.jsxs("label",{className:"flex items-center gap-1.5 text-sm",children:[f.jsx("input",{type:"checkbox",checked:(re.skills??[]).includes(W.id),onChange:ve=>{const st=ve.target.checked?[...re.skills??[],W.id]:(re.skills??[]).filter(jt=>jt!==W.id);fe(jt=>({...jt,skills:st}))},className:"rounded border-input"}),W.name]},W.id)),he.length===0&&f.jsx("span",{className:"text-sm text-muted-foreground",children:"No optional skills installed."})]})]}),f.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[f.jsxs("div",{children:[f.jsx(Ne,{children:"Schedule (optional)"}),f.jsx(Ue,{placeholder:"e.g. 0 9 * * * (daily 9am)",value:re.schedule,onChange:W=>fe(ve=>({...ve,schedule:W.target.value})),className:"font-mono text-sm"})]}),f.jsxs("div",{children:[f.jsx(Ne,{children:"Scheduled task (optional)"}),f.jsx(Ue,{placeholder:"Task to run on schedule",value:re.schedule_input,onChange:W=>fe(ve=>({...ve,schedule_input:W.target.value}))})]})]}),f.jsxs("div",{className:"border-t pt-4 mt-4 space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[f.jsx(f8,{className:"h-4 w-4"}),"Workspace prompt (Identity, User, Tools, Playbook)"]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"These files are used in the agent's system prompt. Edit below; they are stored in the agent's workspace."}),f.jsx("div",{className:"flex flex-wrap gap-1",children:["identity","user","tools","playbook"].map(W=>f.jsx(be,{type:"button",variant:yt===W?"secondary":"ghost",size:"sm",onClick:()=>me(W),children:W==="identity"?"Identity":W==="user"?"User":W==="tools"?"Tools":"Playbook"},W))}),Zt?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"}):f.jsxs(f.Fragment,{children:[f.jsx("textarea",{className:"flex min-h-[140px] w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm font-mono",value:Le,onChange:W=>ut(W.target.value),placeholder:`${Oe[yt]} content…`,spellCheck:!1,rows:8}),wt&&f.jsx("p",{className:"text-sm text-destructive",children:wt}),f.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:Cn,onClick:async()=>{nn(!0),mn(null);try{await pe.putWorkspaceFile(ee,Oe[yt],Le),Qe.success(`Saved ${Oe[yt]}`)}catch(W){mn(W instanceof Error?W.message:String(W))}finally{nn(!1)}},children:Cn?"Saving…":`Save ${Oe[yt]}`})]})]}),Ie&&f.jsx("p",{className:"text-sm text-destructive",children:Ie}),f.jsxs("div",{className:"flex gap-2 pt-2",children:[f.jsx(be,{disabled:we||!re.name.trim()||!re.model.trim(),onClick:async()=>{ke(!0),et(null);try{await pe.updateAgent(ee,{name:re.name.trim()||null,description:re.description.trim()||null,model:re.model.trim()||null,personality:re.personality.trim()||null,skills:re.skills.length?re.skills:null,avatar:re.avatar??null,schedule:re.schedule.trim()||null,schedule_input:re.schedule_input.trim()||null}),ce(null),await Se(),Qe.success("Agent updated")}catch(W){et(W instanceof Error?W.message:String(W))}finally{ke(!1)}},children:we?"Saving…":"Save"}),f.jsx(be,{variant:"secondary",onClick:()=>{ce(null),et(null)},children:"Cancel"})]})]})]})]})]})}function Ua(e,n){return typeof e=="function"?e(n):e}function hr(e,n){return r=>{n.setState(i=>({...i,[e]:Ua(r,i[e])}))}}function Zh(e){return e instanceof Function}function P$(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function L$(e,n){const r=[],i=s=>{s.forEach(l=>{r.push(l);const u=n(l);u!=null&&u.length&&i(u)})};return i(e),r}function He(e,n,r){let i=[],s;return l=>{let u;r.key&&r.debug&&(u=Date.now());const d=e(l);if(!(d.length!==i.length||d.some((g,y)=>i[y]!==g)))return s;i=d;let p;if(r.key&&r.debug&&(p=Date.now()),s=n(...d),r==null||r.onChange==null||r.onChange(s),r.key&&r.debug&&r!=null&&r.debug()){const g=Math.round((Date.now()-u)*100)/100,y=Math.round((Date.now()-p)*100)/100,v=y/16,x=(_,C)=>{for(_=String(_);_.length<C;)_=" "+_;return _};console.info(`%c⏱ ${x(y,5)} /${x(g,5)} ms`,`
|
|
78
|
+
font-size: .6rem;
|
|
79
|
+
font-weight: bold;
|
|
80
|
+
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,r?.key)}return s}}function Ge(e,n,r,i){return{debug:()=>{var s;return(s=e?.debugAll)!=null?s:e[n]},key:!1,onChange:i}}function I$(e,n,r,i){const s=()=>{var u;return(u=l.getValue())!=null?u:e.options.renderFallbackValue},l={id:`${n.id}_${r.id}`,row:n,column:r,getValue:()=>n.getValue(i),renderValue:s,getContext:He(()=>[e,r,n,l],(u,d,h,p)=>({table:u,column:d,row:h,cell:p,getValue:p.getValue,renderValue:p.renderValue}),Ge(e.options,"debugCells"))};return e._features.forEach(u=>{u.createCell==null||u.createCell(l,r,n,e)},{}),l}function V$(e,n,r,i){var s,l;const d={...e._getDefaultColumnDef(),...n},h=d.accessorKey;let p=(s=(l=d.id)!=null?l:h?typeof String.prototype.replaceAll=="function"?h.replaceAll(".","_"):h.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,g;if(d.accessorFn?g=d.accessorFn:h&&(h.includes(".")?g=v=>{let x=v;for(const C of h.split(".")){var _;x=(_=x)==null?void 0:_[C]}return x}:g=v=>v[d.accessorKey]),!p)throw new Error;let y={id:`${String(p)}`,accessorFn:g,parent:i,depth:r,columnDef:d,columns:[],getFlatColumns:He(()=>[!0],()=>{var v;return[y,...(v=y.columns)==null?void 0:v.flatMap(x=>x.getFlatColumns())]},Ge(e.options,"debugColumns")),getLeafColumns:He(()=>[e._getOrderColumnsFn()],v=>{var x;if((x=y.columns)!=null&&x.length){let _=y.columns.flatMap(C=>C.getLeafColumns());return v(_)}return[y]},Ge(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(y,e);return y}const Nn="debugHeaders";function $C(e,n,r){var i;let l={id:(i=r.id)!=null?i:n.id,column:n,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const u=[],d=h=>{h.subHeaders&&h.subHeaders.length&&h.subHeaders.map(d),u.push(h)};return d(l),u},getContext:()=>({table:e,header:l,column:n})};return e._features.forEach(u=>{u.createHeader==null||u.createHeader(l,e)}),l}const F$={createTable:e=>{e.getHeaderGroups=He(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i,s)=>{var l,u;const d=(l=i?.map(y=>r.find(v=>v.id===y)).filter(Boolean))!=null?l:[],h=(u=s?.map(y=>r.find(v=>v.id===y)).filter(Boolean))!=null?u:[],p=r.filter(y=>!(i!=null&&i.includes(y.id))&&!(s!=null&&s.includes(y.id)));return pf(n,[...d,...p,...h],e)},Ge(e.options,Nn)),e.getCenterHeaderGroups=He(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i,s)=>(r=r.filter(l=>!(i!=null&&i.includes(l.id))&&!(s!=null&&s.includes(l.id))),pf(n,r,e,"center")),Ge(e.options,Nn)),e.getLeftHeaderGroups=He(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,r,i)=>{var s;const l=(s=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?s:[];return pf(n,l,e,"left")},Ge(e.options,Nn)),e.getRightHeaderGroups=He(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,r,i)=>{var s;const l=(s=i?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?s:[];return pf(n,l,e,"right")},Ge(e.options,Nn)),e.getFooterGroups=He(()=>[e.getHeaderGroups()],n=>[...n].reverse(),Ge(e.options,Nn)),e.getLeftFooterGroups=He(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),Ge(e.options,Nn)),e.getCenterFooterGroups=He(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),Ge(e.options,Nn)),e.getRightFooterGroups=He(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),Ge(e.options,Nn)),e.getFlatHeaders=He(()=>[e.getHeaderGroups()],n=>n.map(r=>r.headers).flat(),Ge(e.options,Nn)),e.getLeftFlatHeaders=He(()=>[e.getLeftHeaderGroups()],n=>n.map(r=>r.headers).flat(),Ge(e.options,Nn)),e.getCenterFlatHeaders=He(()=>[e.getCenterHeaderGroups()],n=>n.map(r=>r.headers).flat(),Ge(e.options,Nn)),e.getRightFlatHeaders=He(()=>[e.getRightHeaderGroups()],n=>n.map(r=>r.headers).flat(),Ge(e.options,Nn)),e.getCenterLeafHeaders=He(()=>[e.getCenterFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),Ge(e.options,Nn)),e.getLeftLeafHeaders=He(()=>[e.getLeftFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),Ge(e.options,Nn)),e.getRightLeafHeaders=He(()=>[e.getRightFlatHeaders()],n=>n.filter(r=>{var i;return!((i=r.subHeaders)!=null&&i.length)}),Ge(e.options,Nn)),e.getLeafHeaders=He(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,r,i)=>{var s,l,u,d,h,p;return[...(s=(l=n[0])==null?void 0:l.headers)!=null?s:[],...(u=(d=r[0])==null?void 0:d.headers)!=null?u:[],...(h=(p=i[0])==null?void 0:p.headers)!=null?h:[]].map(g=>g.getLeafHeaders()).flat()},Ge(e.options,Nn))}};function pf(e,n,r,i){var s,l;let u=0;const d=function(v,x){x===void 0&&(x=1),u=Math.max(u,x),v.filter(_=>_.getIsVisible()).forEach(_=>{var C;(C=_.columns)!=null&&C.length&&d(_.columns,x+1)},0)};d(e);let h=[];const p=(v,x)=>{const _={depth:x,id:[i,`${x}`].filter(Boolean).join("_"),headers:[]},C=[];v.forEach(k=>{const j=[...C].reverse()[0],E=k.column.depth===_.depth;let N,M=!1;if(E&&k.column.parent?N=k.column.parent:(N=k.column,M=!0),j&&j?.column===N)j.subHeaders.push(k);else{const R=$C(r,N,{id:[i,x,N.id,k?.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${C.filter(z=>z.column===N).length}`:void 0,depth:x,index:C.length});R.subHeaders.push(k),C.push(R)}_.headers.push(k),k.headerGroup=_}),h.push(_),x>0&&p(C,x-1)},g=n.map((v,x)=>$C(r,v,{depth:u,index:x}));p(g,u-1),h.reverse();const y=v=>v.filter(_=>_.column.getIsVisible()).map(_=>{let C=0,k=0,j=[0];_.subHeaders&&_.subHeaders.length?(j=[],y(_.subHeaders).forEach(N=>{let{colSpan:M,rowSpan:R}=N;C+=M,j.push(R)})):C=1;const E=Math.min(...j);return k=k+E,_.colSpan=C,_.rowSpan=k,{colSpan:C,rowSpan:k}});return y((s=(l=h[0])==null?void 0:l.headers)!=null?s:[]),h}const U$=(e,n,r,i,s,l,u)=>{let d={id:n,index:i,original:r,depth:s,parentId:u,_valuesCache:{},_uniqueValuesCache:{},getValue:h=>{if(d._valuesCache.hasOwnProperty(h))return d._valuesCache[h];const p=e.getColumn(h);if(p!=null&&p.accessorFn)return d._valuesCache[h]=p.accessorFn(d.original,i),d._valuesCache[h]},getUniqueValues:h=>{if(d._uniqueValuesCache.hasOwnProperty(h))return d._uniqueValuesCache[h];const p=e.getColumn(h);if(p!=null&&p.accessorFn)return p.columnDef.getUniqueValues?(d._uniqueValuesCache[h]=p.columnDef.getUniqueValues(d.original,i),d._uniqueValuesCache[h]):(d._uniqueValuesCache[h]=[d.getValue(h)],d._uniqueValuesCache[h])},renderValue:h=>{var p;return(p=d.getValue(h))!=null?p:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>L$(d.subRows,h=>h.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let h=[],p=d;for(;;){const g=p.getParentRow();if(!g)break;h.push(g),p=g}return h.reverse()},getAllCells:He(()=>[e.getAllLeafColumns()],h=>h.map(p=>I$(e,d,p,p.id)),Ge(e.options,"debugRows")),_getAllCellsByColumnId:He(()=>[d.getAllCells()],h=>h.reduce((p,g)=>(p[g.column.id]=g,p),{}),Ge(e.options,"debugRows"))};for(let h=0;h<e._features.length;h++){const p=e._features[h];p==null||p.createRow==null||p.createRow(d,e)}return d},B$={createColumn:(e,n)=>{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},EA=(e,n,r)=>{var i,s;const l=r==null||(i=r.toString())==null?void 0:i.toLowerCase();return!!(!((s=e.getValue(n))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};EA.autoRemove=e=>Kr(e);const NA=(e,n,r)=>{var i;return!!(!((i=e.getValue(n))==null||(i=i.toString())==null)&&i.includes(r))};NA.autoRemove=e=>Kr(e);const TA=(e,n,r)=>{var i;return((i=e.getValue(n))==null||(i=i.toString())==null?void 0:i.toLowerCase())===r?.toLowerCase()};TA.autoRemove=e=>Kr(e);const AA=(e,n,r)=>{var i;return(i=e.getValue(n))==null?void 0:i.includes(r)};AA.autoRemove=e=>Kr(e);const RA=(e,n,r)=>!r.some(i=>{var s;return!((s=e.getValue(n))!=null&&s.includes(i))});RA.autoRemove=e=>Kr(e)||!(e!=null&&e.length);const MA=(e,n,r)=>r.some(i=>{var s;return(s=e.getValue(n))==null?void 0:s.includes(i)});MA.autoRemove=e=>Kr(e)||!(e!=null&&e.length);const DA=(e,n,r)=>e.getValue(n)===r;DA.autoRemove=e=>Kr(e);const OA=(e,n,r)=>e.getValue(n)==r;OA.autoRemove=e=>Kr(e);const s0=(e,n,r)=>{let[i,s]=r;const l=e.getValue(n);return l>=i&&l<=s};s0.resolveFilterValue=e=>{let[n,r]=e,i=typeof n!="number"?parseFloat(n):n,s=typeof r!="number"?parseFloat(r):r,l=n===null||Number.isNaN(i)?-1/0:i,u=r===null||Number.isNaN(s)?1/0:s;if(l>u){const d=l;l=u,u=d}return[l,u]};s0.autoRemove=e=>Kr(e)||Kr(e[0])&&Kr(e[1]);const Xi={includesString:EA,includesStringSensitive:NA,equalsString:TA,arrIncludes:AA,arrIncludesAll:RA,arrIncludesSome:MA,equals:DA,weakEquals:OA,inNumberRange:s0};function Kr(e){return e==null||e===""}const $$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:hr("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const r=n.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);return typeof i=="string"?Xi.includesString:typeof i=="number"?Xi.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?Xi.equals:Array.isArray(i)?Xi.arrIncludes:Xi.weakEquals},e.getFilterFn=()=>{var r,i;return Zh(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(i=n.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?r:Xi[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,i,s;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((i=n.options.enableColumnFilters)!=null?i:!0)&&((s=n.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=n.getState().columnFilters)==null||(r=r.find(i=>i.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,i;return(r=(i=n.getState().columnFilters)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?r:-1},e.setFilterValue=r=>{n.setColumnFilters(i=>{const s=e.getFilterFn(),l=i?.find(g=>g.id===e.id),u=Ua(r,l?l.value:void 0);if(HC(s,u,e)){var d;return(d=i?.filter(g=>g.id!==e.id))!=null?d:[]}const h={id:e.id,value:u};if(l){var p;return(p=i?.map(g=>g.id===e.id?h:g))!=null?p:[]}return i!=null&&i.length?[...i,h]:[h]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const r=e.getAllLeafColumns(),i=s=>{var l;return(l=Ua(n,s))==null?void 0:l.filter(u=>{const d=r.find(h=>h.id===u.id);if(d){const h=d.getFilterFn();if(HC(h,u.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},e.resetColumnFilters=n=>{var r,i;e.setColumnFilters(n?[]:(r=(i=e.initialState)==null?void 0:i.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function HC(e,n,r){return(e&&e.autoRemove?e.autoRemove(n,r):!1)||typeof n>"u"||typeof n=="string"&&!n}const H$=(e,n,r)=>r.reduce((i,s)=>{const l=s.getValue(e);return i+(typeof l=="number"?l:0)},0),G$=(e,n,r)=>{let i;return r.forEach(s=>{const l=s.getValue(e);l!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}),i},q$=(e,n,r)=>{let i;return r.forEach(s=>{const l=s.getValue(e);l!=null&&(i<l||i===void 0&&l>=l)&&(i=l)}),i},Y$=(e,n,r)=>{let i,s;return r.forEach(l=>{const u=l.getValue(e);u!=null&&(i===void 0?u>=u&&(i=s=u):(i>u&&(i=u),s<u&&(s=u)))}),[i,s]},X$=(e,n)=>{let r=0,i=0;if(n.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++r,i+=l)}),r)return i/r},K$=(e,n)=>{if(!n.length)return;const r=n.map(l=>l.getValue(e));if(!P$(r))return;if(r.length===1)return r[0];const i=Math.floor(r.length/2),s=r.sort((l,u)=>l-u);return r.length%2!==0?s[i]:(s[i-1]+s[i])/2},W$=(e,n)=>Array.from(new Set(n.map(r=>r.getValue(e))).values()),Z$=(e,n)=>new Set(n.map(r=>r.getValue(e))).size,Q$=(e,n)=>n.length,Jg={sum:H$,min:G$,max:q$,extent:Y$,mean:X$,median:K$,unique:W$,uniqueCount:Z$,count:Q$},J$={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,r;return(n=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:hr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(i=>i!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,i;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((i=n.options.enableGrouping)!=null?i:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=n.getCoreRowModel().flatRows[0],i=r?.getValue(e.id);if(typeof i=="number")return Jg.sum;if(Object.prototype.toString.call(i)==="[object Date]")return Jg.extent},e.getAggregationFn=()=>{var r,i;if(!e)throw new Error;return Zh(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(i=n.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?r:Jg[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var r,i;e.setGrouping(n?[]:(r=(i=e.initialState)==null?void 0:i.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const i=n.getColumn(r);return i!=null&&i.columnDef.getGroupingValue?(e._groupingValuesCache[r]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,n,r,i)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=r.subRows)!=null&&s.length)}}};function e7(e,n,r){if(!(n!=null&&n.length)||!r)return e;const i=e.filter(l=>!n.includes(l.id));return r==="remove"?i:[...n.map(l=>e.find(u=>u.id===l)).filter(Boolean),...i]}const t7={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:hr("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=He(r=>[Hu(n,r)],r=>r.findIndex(i=>i.id===e.id),Ge(n.options,"debugColumns")),e.getIsFirstColumn=r=>{var i;return((i=Hu(n,r)[0])==null?void 0:i.id)===e.id},e.getIsLastColumn=r=>{var i;const s=Hu(n,r);return((i=s[s.length-1])==null?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var r;e.setColumnOrder(n?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=He(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,r,i)=>s=>{let l=[];if(!(n!=null&&n.length))l=s;else{const u=[...n],d=[...s];for(;d.length&&u.length;){const h=u.shift(),p=d.findIndex(g=>g.id===h);p>-1&&l.push(d.splice(p,1)[0])}l=[...l,...d]}return e7(l,r,i)},Ge(e.options,"debugTable"))}},ey=()=>({left:[],right:[]}),n7={getInitialState:e=>({columnPinning:ey(),...e}),getDefaultOptions:e=>({onColumnPinningChange:hr("columnPinning",e)}),createColumn:(e,n)=>{e.pin=r=>{const i=e.getLeafColumns().map(s=>s.id).filter(Boolean);n.setColumnPinning(s=>{var l,u;if(r==="right"){var d,h;return{left:((d=s?.left)!=null?d:[]).filter(y=>!(i!=null&&i.includes(y))),right:[...((h=s?.right)!=null?h:[]).filter(y=>!(i!=null&&i.includes(y))),...i]}}if(r==="left"){var p,g;return{left:[...((p=s?.left)!=null?p:[]).filter(y=>!(i!=null&&i.includes(y))),...i],right:((g=s?.right)!=null?g:[]).filter(y=>!(i!=null&&i.includes(y)))}}return{left:((l=s?.left)!=null?l:[]).filter(y=>!(i!=null&&i.includes(y))),right:((u=s?.right)!=null?u:[]).filter(y=>!(i!=null&&i.includes(y)))}})},e.getCanPin=()=>e.getLeafColumns().some(i=>{var s,l,u;return((s=i.columnDef.enablePinning)!=null?s:!0)&&((l=(u=n.options.enableColumnPinning)!=null?u:n.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(d=>d.id),{left:i,right:s}=n.getState().columnPinning,l=r.some(d=>i?.includes(d)),u=r.some(d=>s?.includes(d));return l?"left":u?"right":!1},e.getPinnedIndex=()=>{var r,i;const s=e.getIsPinned();return s?(r=(i=n.getState().columnPinning)==null||(i=i[s])==null?void 0:i.indexOf(e.id))!=null?r:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=He(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(r,i,s)=>{const l=[...i??[],...s??[]];return r.filter(u=>!l.includes(u.column.id))},Ge(n.options,"debugRows")),e.getLeftVisibleCells=He(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),Ge(n.options,"debugRows")),e.getRightVisibleCells=He(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(r,i)=>(i??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),Ge(n.options,"debugRows"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var r,i;return e.setColumnPinning(n?ey():(r=(i=e.initialState)==null?void 0:i.columnPinning)!=null?r:ey())},e.getIsSomeColumnsPinned=n=>{var r;const i=e.getState().columnPinning;if(!n){var s,l;return!!((s=i.left)!=null&&s.length||(l=i.right)!=null&&l.length)}return!!((r=i[n])!=null&&r.length)},e.getLeftLeafColumns=He(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.id===i)).filter(Boolean),Ge(e.options,"debugColumns")),e.getRightLeafColumns=He(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.id===i)).filter(Boolean),Ge(e.options,"debugColumns")),e.getCenterLeafColumns=He(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const s=[...r??[],...i??[]];return n.filter(l=>!s.includes(l.id))},Ge(e.options,"debugColumns"))}};function r7(e){return e||(typeof document<"u"?document:null)}const mf={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ty=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),i7={getDefaultColumnDef:()=>mf,getInitialState:e=>({columnSizing:{},columnSizingInfo:ty(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:hr("columnSizing",e),onColumnSizingInfoChange:hr("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var r,i,s;const l=n.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:mf.minSize,(i=l??e.columnDef.size)!=null?i:mf.size),(s=e.columnDef.maxSize)!=null?s:mf.maxSize)},e.getStart=He(r=>[r,Hu(n,r),n.getState().columnSizing],(r,i)=>i.slice(0,e.getIndex(r)).reduce((s,l)=>s+l.getSize(),0),Ge(n.options,"debugColumns")),e.getAfter=He(r=>[r,Hu(n,r),n.getState().columnSizing],(r,i)=>i.slice(e.getIndex(r)+1).reduce((s,l)=>s+l.getSize(),0),Ge(n.options,"debugColumns")),e.resetSize=()=>{n.setColumnSizing(r=>{let{[e.id]:i,...s}=r;return s})},e.getCanResize=()=>{var r,i;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((i=n.options.enableColumnResizing)!=null?i:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let r=0;const i=s=>{if(s.subHeaders.length)s.subHeaders.forEach(i);else{var l;r+=(l=s.column.getSize())!=null?l:0}};return i(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const i=n.getColumn(e.column.id),s=i?.getCanResize();return l=>{if(!i||!s||(l.persist==null||l.persist(),ny(l)&&l.touches&&l.touches.length>1))return;const u=e.getSize(),d=e?e.getLeafHeaders().map(j=>[j.column.id,j.column.getSize()]):[[i.id,i.getSize()]],h=ny(l)?Math.round(l.touches[0].clientX):l.clientX,p={},g=(j,E)=>{typeof E=="number"&&(n.setColumnSizingInfo(N=>{var M,R;const z=n.options.columnResizeDirection==="rtl"?-1:1,P=(E-((M=N?.startOffset)!=null?M:0))*z,D=Math.max(P/((R=N?.startSize)!=null?R:0),-.999999);return N.columnSizingStart.forEach($=>{let[U,X]=$;p[U]=Math.round(Math.max(X+X*D,0)*100)/100}),{...N,deltaOffset:P,deltaPercentage:D}}),(n.options.columnResizeMode==="onChange"||j==="end")&&n.setColumnSizing(N=>({...N,...p})))},y=j=>g("move",j),v=j=>{g("end",j),n.setColumnSizingInfo(E=>({...E,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=r7(r),_={moveHandler:j=>y(j.clientX),upHandler:j=>{x?.removeEventListener("mousemove",_.moveHandler),x?.removeEventListener("mouseup",_.upHandler),v(j.clientX)}},C={moveHandler:j=>(j.cancelable&&(j.preventDefault(),j.stopPropagation()),y(j.touches[0].clientX),!1),upHandler:j=>{var E;x?.removeEventListener("touchmove",C.moveHandler),x?.removeEventListener("touchend",C.upHandler),j.cancelable&&(j.preventDefault(),j.stopPropagation()),v((E=j.touches[0])==null?void 0:E.clientX)}},k=a7()?{passive:!1}:!1;ny(l)?(x?.addEventListener("touchmove",C.moveHandler,k),x?.addEventListener("touchend",C.upHandler,k)):(x?.addEventListener("mousemove",_.moveHandler,k),x?.addEventListener("mouseup",_.upHandler,k)),n.setColumnSizingInfo(j=>({...j,startOffset:h,startSize:u,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var r;e.setColumnSizing(n?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=n=>{var r;e.setColumnSizingInfo(n?ty():(r=e.initialState.columnSizingInfo)!=null?r:ty())},e.getTotalSize=()=>{var n,r;return(n=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((i,s)=>i+s.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,r;return(n=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((i,s)=>i+s.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,r;return(n=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((i,s)=>i+s.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,r;return(n=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((i,s)=>i+s.getSize(),0))!=null?n:0}}};let gf=null;function a7(){if(typeof gf=="boolean")return gf;let e=!1;try{const n={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,n),window.removeEventListener("test",r)}catch{e=!1}return gf=e,gf}function ny(e){return e.type==="touchstart"}const s7={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:hr("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=r=>{e.getCanHide()&&n.setColumnVisibility(i=>({...i,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,i;const s=e.columns;return(r=s.length?s.some(l=>l.getIsVisible()):(i=n.getState().columnVisibility)==null?void 0:i[e.id])!=null?r:!0},e.getCanHide=()=>{var r,i;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((i=n.options.enableHiding)!=null?i:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=He(()=>[e.getAllCells(),n.getState().columnVisibility],r=>r.filter(i=>i.column.getIsVisible()),Ge(n.options,"debugRows")),e.getVisibleCells=He(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,i,s)=>[...r,...i,...s],Ge(n.options,"debugRows"))},createTable:e=>{const n=(r,i)=>He(()=>[i(),i().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),Ge(e.options,"debugColumns"));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var i;e.setColumnVisibility(r?{}:(i=e.initialState.columnVisibility)!=null?i:{})},e.toggleAllColumnsVisible=r=>{var i;r=(i=r)!=null?i:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,l)=>({...s,[l.id]:r||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var i;e.toggleAllColumnsVisible((i=r.target)==null?void 0:i.checked)}}};function Hu(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const o7={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},l7={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:hr("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var r;const i=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[n.id])==null?void 0:r.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var r,i,s,l;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((i=n.options.enableGlobalFilter)!=null?i:!0)&&((s=n.options.enableFilters)!=null?s:!0)&&((l=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Xi.includesString,e.getGlobalFilterFn=()=>{var n,r;const{globalFilterFn:i}=e.options;return Zh(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[i])!=null?n:Xi[i]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},u7={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:hr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,r=!1;e._autoResetExpanded=()=>{var i,s;if(!n){e._queue(()=>{n=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?i:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=i=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(i),e.toggleAllRowsExpanded=i=>{i??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=i=>{var s,l;e.setExpanded(i?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const i=e.getState().expanded;return i===!0||Object.values(i).some(Boolean)},e.getIsAllRowsExpanded=()=>{const i=e.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let i=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const u=l.split(".");i=Math.max(i,u.length)}),i},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=r=>{n.setExpanded(i=>{var s;const l=i===!0?!0:!!(i!=null&&i[e.id]);let u={};if(i===!0?Object.keys(n.getRowModel().rowsById).forEach(d=>{u[d]=!0}):u=i,r=(s=r)!=null?s:!l,!l&&r)return{...u,[e.id]:!0};if(l&&!r){const{[e.id]:d,...h}=u;return h}return i})},e.getIsExpanded=()=>{var r;const i=n.getState().expanded;return!!((r=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?r:i===!0||i?.[e.id])},e.getCanExpand=()=>{var r,i,s;return(r=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?r:((i=n.options.enableExpanding)!=null?i:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let r=!0,i=e;for(;r&&i.parentId;)i=n.getRow(i.parentId,!0),r=i.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},cv=0,dv=10,ry=()=>({pageIndex:cv,pageSize:dv}),c7={getInitialState:e=>({...e,pagination:{...ry(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:hr("pagination",e)}),createTable:e=>{let n=!1,r=!1;e._autoResetPageIndex=()=>{var i,s;if(!n){e._queue(()=>{n=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?i:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=i=>{const s=l=>Ua(i,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=i=>{var s;e.setPagination(i?ry():(s=e.initialState.pagination)!=null?s:ry())},e.setPageIndex=i=>{e.setPagination(s=>{let l=Ua(i,s.pageIndex);const u=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,u)),{...s,pageIndex:l}})},e.resetPageIndex=i=>{var s,l;e.setPageIndex(i?cv:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:cv)},e.resetPageSize=i=>{var s,l;e.setPageSize(i?dv:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:dv)},e.setPageSize=i=>{e.setPagination(s=>{const l=Math.max(1,Ua(i,s.pageSize)),u=s.pageSize*s.pageIndex,d=Math.floor(u/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=i=>e.setPagination(s=>{var l;let u=Ua(i,(l=e.options.pageCount)!=null?l:-1);return typeof u=="number"&&(u=Math.max(-1,u)),{...s,pageCount:u}}),e.getPageOptions=He(()=>[e.getPageCount()],i=>{let s=[];return i&&i>0&&(s=[...new Array(i)].fill(null).map((l,u)=>u)),s},Ge(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:i}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:i<s-1},e.previousPage=()=>e.setPageIndex(i=>i-1),e.nextPage=()=>e.setPageIndex(i=>i+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var i;return(i=e.options.pageCount)!=null?i:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var i;return(i=e.options.rowCount)!=null?i:e.getPrePaginationRowModel().rows.length}}},iy=()=>({top:[],bottom:[]}),d7={getInitialState:e=>({rowPinning:iy(),...e}),getDefaultOptions:e=>({onRowPinningChange:hr("rowPinning",e)}),createRow:(e,n)=>{e.pin=(r,i,s)=>{const l=i?e.getLeafRows().map(h=>{let{id:p}=h;return p}):[],u=s?e.getParentRows().map(h=>{let{id:p}=h;return p}):[],d=new Set([...u,e.id,...l]);n.setRowPinning(h=>{var p,g;if(r==="bottom"){var y,v;return{top:((y=h?.top)!=null?y:[]).filter(C=>!(d!=null&&d.has(C))),bottom:[...((v=h?.bottom)!=null?v:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)]}}if(r==="top"){var x,_;return{top:[...((x=h?.top)!=null?x:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)],bottom:((_=h?.bottom)!=null?_:[]).filter(C=>!(d!=null&&d.has(C)))}}return{top:((p=h?.top)!=null?p:[]).filter(C=>!(d!=null&&d.has(C))),bottom:((g=h?.bottom)!=null?g:[]).filter(C=>!(d!=null&&d.has(C)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:i,enablePinning:s}=n.options;return typeof i=="function"?i(e):(r=i??s)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:i,bottom:s}=n.getState().rowPinning,l=r.some(d=>i?.includes(d)),u=r.some(d=>s?.includes(d));return l?"top":u?"bottom":!1},e.getPinnedIndex=()=>{var r,i;const s=e.getIsPinned();if(!s)return-1;const l=(r=s==="top"?n.getTopRows():n.getBottomRows())==null?void 0:r.map(u=>{let{id:d}=u;return d});return(i=l?.indexOf(e.id))!=null?i:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var r,i;return e.setRowPinning(n?iy():(r=(i=e.initialState)==null?void 0:i.rowPinning)!=null?r:iy())},e.getIsSomeRowsPinned=n=>{var r;const i=e.getState().rowPinning;if(!n){var s,l;return!!((s=i.top)!=null&&s.length||(l=i.bottom)!=null&&l.length)}return!!((r=i[n])!=null&&r.length)},e._getPinnedRows=(n,r,i)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(r??[]).map(u=>{const d=e.getRow(u,!0);return d.getIsAllParentsExpanded()?d:null}):(r??[]).map(u=>n.find(d=>d.id===u))).filter(Boolean).map(u=>({...u,position:i}))},e.getTopRows=He(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,r)=>e._getPinnedRows(n,r,"top"),Ge(e.options,"debugRows")),e.getBottomRows=He(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,r)=>e._getPinnedRows(n,r,"bottom"),Ge(e.options,"debugRows")),e.getCenterRows=He(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,r,i)=>{const s=new Set([...r??[],...i??[]]);return n.filter(l=>!s.has(l.id))},Ge(e.options,"debugRows"))}},f7={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:hr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var r;return e.setRowSelection(n?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(r=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const i={...r},s=e.getPreGroupedRowModel().flatRows;return n?s.forEach(l=>{l.getCanSelect()&&(i[l.id]=!0)}):s.forEach(l=>{delete i[l.id]}),i})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(r=>{const i=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),s={...r};return e.getRowModel().rows.forEach(l=>{fv(s,l.id,i,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=He(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,r)=>Object.keys(n).length?ay(e,r):{rows:[],flatRows:[],rowsById:{}},Ge(e.options,"debugTable")),e.getFilteredSelectedRowModel=He(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,r)=>Object.keys(n).length?ay(e,r):{rows:[],flatRows:[],rowsById:{}},Ge(e.options,"debugTable")),e.getGroupedSelectedRowModel=He(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,r)=>Object.keys(n).length?ay(e,r):{rows:[],flatRows:[],rowsById:{}},Ge(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let i=!!(n.length&&Object.keys(r).length);return i&&n.some(s=>s.getCanSelect()&&!r[s.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:r}=e.getState();let i=!!n.length;return i&&n.some(s=>!r[s.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var n;const r=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(r,i)=>{const s=e.getIsSelected();n.setRowSelection(l=>{var u;if(r=typeof r<"u"?r:!s,e.getCanSelect()&&s===r)return l;const d={...l};return fv(d,e.id,r,(u=i?.selectChildren)!=null?u:!0,n),d})},e.getIsSelected=()=>{const{rowSelection:r}=n.getState();return o0(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=n.getState();return hv(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=n.getState();return hv(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(r=n.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(r=n.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(r=n.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return i=>{var s;r&&e.toggleSelected((s=i.target)==null?void 0:s.checked)}}}},fv=(e,n,r,i,s)=>{var l;const u=s.getRow(n,!0);r?(u.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),u.getCanSelect()&&(e[n]=!0)):delete e[n],i&&(l=u.subRows)!=null&&l.length&&u.getCanSelectSubRows()&&u.subRows.forEach(d=>fv(e,d.id,r,i,s))};function ay(e,n){const r=e.getState().rowSelection,i=[],s={},l=function(u,d){return u.map(h=>{var p;const g=o0(h,r);if(g&&(i.push(h),s[h.id]=h),(p=h.subRows)!=null&&p.length&&(h={...h,subRows:l(h.subRows)}),g)return h}).filter(Boolean)};return{rows:l(n.rows),flatRows:i,rowsById:s}}function o0(e,n){var r;return(r=n[e.id])!=null?r:!1}function hv(e,n,r){var i;if(!((i=e.subRows)!=null&&i.length))return!1;let s=!0,l=!1;return e.subRows.forEach(u=>{if(!(l&&!s)&&(u.getCanSelect()&&(o0(u,n)?l=!0:s=!1),u.subRows&&u.subRows.length)){const d=hv(u,n);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const pv=/([0-9]+)/gm,h7=(e,n,r)=>zA(Ha(e.getValue(r)).toLowerCase(),Ha(n.getValue(r)).toLowerCase()),p7=(e,n,r)=>zA(Ha(e.getValue(r)),Ha(n.getValue(r))),m7=(e,n,r)=>l0(Ha(e.getValue(r)).toLowerCase(),Ha(n.getValue(r)).toLowerCase()),g7=(e,n,r)=>l0(Ha(e.getValue(r)),Ha(n.getValue(r))),y7=(e,n,r)=>{const i=e.getValue(r),s=n.getValue(r);return i>s?1:i<s?-1:0},v7=(e,n,r)=>l0(e.getValue(r),n.getValue(r));function l0(e,n){return e===n?0:e>n?1:-1}function Ha(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function zA(e,n){const r=e.split(pv).filter(Boolean),i=n.split(pv).filter(Boolean);for(;r.length&&i.length;){const s=r.shift(),l=i.shift(),u=parseInt(s,10),d=parseInt(l,10),h=[u,d].sort();if(isNaN(h[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(h[1]))return isNaN(u)?-1:1;if(u>d)return 1;if(d>u)return-1}return r.length-i.length}const gu={alphanumeric:h7,alphanumericCaseSensitive:p7,text:m7,textCaseSensitive:g7,datetime:y7,basic:v7},x7={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:hr("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const r=n.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const s of r){const l=s?.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return gu.datetime;if(typeof l=="string"&&(i=!0,l.split(pv).length>1))return gu.alphanumeric}return i?gu.text:gu.basic},e.getAutoSortDir=()=>{const r=n.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,i;if(!e)throw new Error;return Zh(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(i=n.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?r:gu[e.columnDef.sortingFn]},e.toggleSorting=(r,i)=>{const s=e.getNextSortingOrder(),l=typeof r<"u"&&r!==null;n.setSorting(u=>{const d=u?.find(x=>x.id===e.id),h=u?.findIndex(x=>x.id===e.id);let p=[],g,y=l?r:s==="desc";if(u!=null&&u.length&&e.getCanMultiSort()&&i?d?g="toggle":g="add":u!=null&&u.length&&h!==u.length-1?g="replace":d?g="toggle":g="replace",g==="toggle"&&(l||s||(g="remove")),g==="add"){var v;p=[...u,{id:e.id,desc:y}],p.splice(0,p.length-((v=n.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else g==="toggle"?p=u.map(x=>x.id===e.id?{...x,desc:y}:x):g==="remove"?p=u.filter(x=>x.id!==e.id):p=[{id:e.id,desc:y}];return p})},e.getFirstSortDir=()=>{var r,i;return((r=(i=e.columnDef.sortDescFirst)!=null?i:n.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var i,s;const l=e.getFirstSortDir(),u=e.getIsSorted();return u?u!==l&&((i=n.options.enableSortingRemoval)==null||i)&&(!(r&&(s=n.options.enableMultiRemove)!=null)||s)?!1:u==="desc"?"asc":"desc":l},e.getCanSort=()=>{var r,i;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((i=n.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,i;return(r=(i=e.columnDef.enableMultiSort)!=null?i:n.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const i=(r=n.getState().sorting)==null?void 0:r.find(s=>s.id===e.id);return i?i.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,i;return(r=(i=n.getState().sorting)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?r:-1},e.clearSorting=()=>{n.setSorting(r=>r!=null&&r.length?r.filter(i=>i.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return i=>{r&&(i.persist==null||i.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(i):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var r,i;e.setSorting(n?[]:(r=(i=e.initialState)==null?void 0:i.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},b7=[F$,s7,t7,n7,B$,$$,o7,l7,x7,J$,u7,c7,d7,f7,i7];function w7(e){var n,r;const i=[...b7,...(n=e._features)!=null?n:[]];let s={_features:i};const l=s._features.reduce((v,x)=>Object.assign(v,x.getDefaultOptions==null?void 0:x.getDefaultOptions(s)),{}),u=v=>s.options.mergeOptions?s.options.mergeOptions(l,v):{...l,...v};let h={...{},...(r=e.initialState)!=null?r:{}};s._features.forEach(v=>{var x;h=(x=v.getInitialState==null?void 0:v.getInitialState(h))!=null?x:h});const p=[];let g=!1;const y={_features:i,options:{...l,...e},initialState:h,_queue:v=>{p.push(v),g||(g=!0,Promise.resolve().then(()=>{for(;p.length;)p.shift()();g=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{s.setState(s.initialState)},setOptions:v=>{const x=Ua(v,s.options);s.options=u(x)},getState:()=>s.options.state,setState:v=>{s.options.onStateChange==null||s.options.onStateChange(v)},_getRowId:(v,x,_)=>{var C;return(C=s.options.getRowId==null?void 0:s.options.getRowId(v,x,_))!=null?C:`${_?[_.id,x].join("."):x}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(v,x)=>{let _=(x?s.getPrePaginationRowModel():s.getRowModel()).rowsById[v];if(!_&&(_=s.getCoreRowModel().rowsById[v],!_))throw new Error;return _},_getDefaultColumnDef:He(()=>[s.options.defaultColumn],v=>{var x;return v=(x=v)!=null?x:{},{header:_=>{const C=_.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:_=>{var C,k;return(C=(k=_.renderValue())==null||k.toString==null?void 0:k.toString())!=null?C:null},...s._features.reduce((_,C)=>Object.assign(_,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...v}},Ge(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:He(()=>[s._getColumnDefs()],v=>{const x=function(_,C,k){return k===void 0&&(k=0),_.map(j=>{const E=V$(s,j,k,C),N=j;return E.columns=N.columns?x(N.columns,E,k+1):[],E})};return x(v)},Ge(e,"debugColumns")),getAllFlatColumns:He(()=>[s.getAllColumns()],v=>v.flatMap(x=>x.getFlatColumns()),Ge(e,"debugColumns")),_getAllFlatColumnsById:He(()=>[s.getAllFlatColumns()],v=>v.reduce((x,_)=>(x[_.id]=_,x),{}),Ge(e,"debugColumns")),getAllLeafColumns:He(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(v,x)=>{let _=v.flatMap(C=>C.getLeafColumns());return x(_)},Ge(e,"debugColumns")),getColumn:v=>s._getAllFlatColumnsById()[v]};Object.assign(s,y);for(let v=0;v<s._features.length;v++){const x=s._features[v];x==null||x.createTable==null||x.createTable(s)}return s}function S7(){return e=>He(()=>[e.options.data],n=>{const r={rows:[],flatRows:[],rowsById:{}},i=function(s,l,u){l===void 0&&(l=0);const d=[];for(let p=0;p<s.length;p++){const g=U$(e,e._getRowId(s[p],p,u),s[p],p,l,void 0,u?.id);if(r.flatRows.push(g),r.rowsById[g.id]=g,d.push(g),e.options.getSubRows){var h;g.originalSubRows=e.options.getSubRows(s[p],p),(h=g.originalSubRows)!=null&&h.length&&(g.subRows=i(g.originalSubRows,l+1,g))}}return d};return r.rows=i(n),r},Ge(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function GC(e,n){return e?_7(e)?S.createElement(e,n):e:null}function _7(e){return C7(e)||typeof e=="function"||j7(e)}function C7(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function j7(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function k7(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=S.useState(()=>({current:w7(n)})),[i,s]=S.useState(()=>r.current.initialState);return r.current.setOptions(l=>({...l,...e,state:{...i,...e.state},onStateChange:u=>{s(u),e.onStateChange==null||e.onStateChange(u)}})),r.current}function qC({className:e,orientation:n="horizontal",...r}){return f.jsx(g6,{"data-slot":"tabs","data-orientation":n,className:Ee("group/tabs flex gap-2 data-horizontal:flex-col",e),...r})}const E7=Sh("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function YC({className:e,variant:n="default",...r}){return f.jsx(y6,{"data-slot":"tabs-list","data-variant":n,className:Ee(E7({variant:n}),e),...r})}function yu({className:e,...n}){return f.jsx(v6,{"data-slot":"tabs-trigger",className:Ee("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...n})}function vu({className:e,...n}){return f.jsx(x6,{"data-slot":"tabs-content",className:Ee("flex-1 text-sm outline-none",e),...n})}function mv({className:e,...n}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:Ee("w-full caption-bottom text-sm",e),...n})})}function gv({className:e,...n}){return f.jsx("thead",{"data-slot":"table-header",className:Ee("[&_tr]:border-b",e),...n})}function yv({className:e,...n}){return f.jsx("tbody",{"data-slot":"table-body",className:Ee("[&_tr:last-child]:border-0",e),...n})}function _s({className:e,...n}){return f.jsx("tr",{"data-slot":"table-row",className:Ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})}function Gr({className:e,...n}){return f.jsx("th",{"data-slot":"table-head",className:Ee("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...n})}function Rr({className:e,...n}){return f.jsx("td",{"data-slot":"table-cell",className:Ee("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...n})}const N7=Sh("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Ns({className:e,variant:n="default",asChild:r=!1,...i}){const s=r?Ch:"span";return f.jsx(s,{"data-slot":"badge","data-variant":n,className:Ee(N7({variant:n}),e),...i})}function XC(e){return e.split(`
|
|
81
|
+
`).map(n=>n.trim()).filter(Boolean)}function KC(e){const n={};for(const r of e){const i=r.key.trim();if(!i)continue;const s=r.value.trim();!s&&r.configured||s&&(n[i]=s)}return n}function T7(){const[e,n]=S.useState(!0),[r,i]=S.useState(!1),[s,l]=S.useState(!1),[u,d]=S.useState(!1),[h,p]=S.useState(null),[g,y]=S.useState([]),[v,x]=S.useState(null);S.useEffect(()=>{pe.getMcpServers().then(D=>{y(D.servers.map($=>{const U=[],X=$.env_configured??{};for(const[K,ae]of Object.entries(X))U.push({key:K,value:"",configured:!!ae});return{id:$.id,name:$.name??"",enabled:!!$.enabled,command:$.command??"",argsText:($.args??[]).join(`
|
|
82
|
+
`),envRows:U.length?U:[{key:"",value:""}]}}))}).catch(D=>p(D instanceof Error?D.message:String(D))).finally(()=>n(!1))},[]);const _=g.length>0;function C(){y(D=>[...D,{id:"",name:"",enabled:!0,command:"npx",argsText:"",envRows:[{key:"",value:""}]}]),d(!1),x(null)}function k(D,$){y(U=>U.map((X,K)=>K===D?{...X,...$}:X)),d(!1),x(null)}async function j(){p(null),i(!0),x(null);try{await pe.saveMcpServers(g.map(D=>({id:D.id.trim(),name:D.name.trim()||null,enabled:D.enabled,transport:"stdio",command:D.command.trim(),args:XC(D.argsText),env:KC(D.envRows)}))),d(!0),setTimeout(()=>d(!1),1500)}catch(D){p(D instanceof Error?D.message:String(D))}finally{i(!1)}}const E=S.useMemo(()=>{if(g.length!==1)return!1;const D=g[0];return!!(D.id.trim()&&D.command.trim())},[g]);async function N(){if(E){p(null),l(!0),x(null);try{const D=g[0],$=await pe.testMcpServer({id:D.id.trim(),name:D.name.trim()||null,enabled:D.enabled,transport:"stdio",command:D.command.trim(),args:XC(D.argsText),env:KC(D.envRows)});x($)}catch(D){p(D instanceof Error?D.message:String(D))}finally{l(!1)}}}function M(D){y($=>$.map((U,X)=>X===D?{...U,envRows:[...U.envRows,{key:"",value:""}]}:U)),d(!1),x(null)}function R(D,$,U){y(X=>X.map((K,ae)=>{if(ae!==D)return K;const B=K.envRows.map((Z,O)=>O===$?{...Z,...U}:Z);return{...K,envRows:B}})),d(!1),x(null)}function z(D,$){y(U=>U.map((X,K)=>{if(K!==D)return X;const ae=X.envRows.filter((B,Z)=>Z!==$);return{...X,envRows:ae.length?ae:[{key:"",value:""}]}})),d(!1),x(null)}async function P(D){p(null),x(null);const U=g[D]?.id?.trim();if(U)try{await pe.deleteMcpServer(U)}catch(X){p(X instanceof Error?X.message:String(X))}y(X=>X.filter((K,ae)=>ae!==D))}return e?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading…"}):f.jsx("div",{className:"space-y-6",children:f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"MCP Servers"}),f.jsxs(Kt,{children:["Add MCP (Model Context Protocol) servers to expose extra tools to agents. For discovery, browse"," ",f.jsx("a",{className:"text-primary hover:underline",href:"https://mcpservers.org/en",target:"_blank",rel:"noreferrer",children:"mcpservers.org"}),"."]})]}),f.jsxs(Wt,{className:"space-y-4",children:[!_&&f.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No MCP servers configured yet. Click “Add server”."}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(be,{type:"button",variant:"outline",onClick:C,children:"Add server"}),f.jsx(be,{type:"button",onClick:j,disabled:r||g.length===0,children:r?"Saving…":u?"Saved":"Save"}),f.jsx(be,{type:"button",variant:"secondary",disabled:!E||s,onClick:N,title:g.length===1?"":"Testing supports a single draft at a time",children:s?"Testing…":"Test (single server)"})]}),v&&f.jsxs("div",{className:Ee("rounded-lg border p-3 text-sm",v.ok?"bg-green-50/50 dark:bg-green-950/20":"bg-muted/20"),children:[f.jsx("div",{className:"font-medium",children:v.ok?"Test passed":"Test failed"}),v.error&&f.jsx("div",{className:"text-destructive mt-1",children:v.error}),f.jsxs("div",{className:"mt-2",children:[f.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Tools discovered:"}),v.tools.length===0?f.jsx("div",{className:"text-muted-foreground",children:"None"}):f.jsx("ul",{className:"list-disc pl-5 space-y-1",children:v.tools.map(D=>f.jsxs("li",{children:[f.jsx("span",{className:"font-mono",children:D.name}),D.description?f.jsxs("span",{className:"text-muted-foreground",children:[" — ",D.description]}):null]},D.name))})]})]}),h&&f.jsx("p",{className:"text-sm text-destructive",children:h}),f.jsx("div",{className:"space-y-4",children:g.map((D,$)=>f.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsxs("div",{className:"text-sm font-medium",children:["Server #",$+1]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("label",{className:"text-sm flex items-center gap-2",children:[f.jsx("input",{type:"checkbox",checked:D.enabled,onChange:U=>k($,{enabled:U.target.checked})}),"Enabled"]}),f.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:()=>P($),children:"Delete"})]})]}),f.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Ne,{children:"ID *"}),f.jsx(Ue,{value:D.id,onChange:U=>k($,{id:U.target.value}),placeholder:"twitter-mcp",className:"font-mono"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Used to prefix tool ids (e.g. mcp_twitter-mcp_post_tweet)."})]}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Ne,{children:"Name"}),f.jsx(Ue,{value:D.name,onChange:U=>k($,{name:U.target.value}),placeholder:"Twitter MCP"})]})]}),f.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Ne,{children:"Command *"}),f.jsx(Ue,{value:D.command,onChange:U=>k($,{command:U.target.value}),placeholder:"npx",className:"font-mono"})]}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Ne,{children:"Args (one per line)"}),f.jsx("textarea",{value:D.argsText,onChange:U=>k($,{argsText:U.target.value}),placeholder:`-y
|
|
83
|
+
@enescinar/twitter-mcp`,className:"min-h-[80px] w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm font-mono"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx(Ne,{children:"Env (key / value)"}),f.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>M($),children:"Add variable"})]}),f.jsx("div",{className:"space-y-2",children:D.envRows.map((U,X)=>f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Ue,{value:U.key,onChange:K=>R($,X,{key:K.target.value}),placeholder:"API_KEY",className:"font-mono flex-1 min-w-[120px]"}),f.jsx(Ue,{type:"password",value:U.value,onChange:K=>R($,X,{value:K.target.value}),placeholder:U.configured?"•••••••• (already set — leave blank to keep)":"Value",className:"font-mono flex-[2] min-w-[160px]",autoComplete:"off"}),f.jsx(be,{type:"button",variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>z($,X),"aria-label":"Remove env row",children:"×"})]},X))}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Values are stored locally. The server never returns saved secret values to the dashboard."})]})]},$))})]})]})})}function WC(e,n){if(!e?.trim())return!1;if(!n?.trim())return!0;const r=l=>l.trim().replace(/^v/i,"").split(".").map(u=>parseInt(u,10)||0),i=r(e),s=r(n);for(let l=0;l<Math.max(i.length,s.length);l++){const u=i[l]??0,d=s[l]??0;if(u>d)return!0;if(u<d)return!1}return!1}function A7(e,n){if(n&&typeof n=="object"&&(n.format==="password"||n.secret===!0))return!0;const r=e.toUpperCase();return r.includes("PASSWORD")||r.includes("SECRET")||r.includes("API_KEY")||r.includes("TOKEN")||r.endsWith("_KEY")}function R7(){const[e,n]=S.useState([]),[r,i]=S.useState(!0),[s,l]=S.useState(null),[u,d]=S.useState(""),[h,p]=S.useState(""),[g,y]=S.useState(null),[v,x]=S.useState(null),[_,C]=S.useState(""),[k,j]=S.useState(!1),[E,N]=S.useState(null),[M,R]=S.useState({}),[z,P]=S.useState({}),[D,$]=S.useState(null),[U,X]=S.useState(null),[K,ae]=S.useState({}),[B,Z]=S.useState(!1),[O,q]=S.useState(null),[I,H]=S.useState(null),[A,F]=S.useState(null),[G,L]=S.useState(new Set),[ee,ce]=S.useState([]),[Y,Q]=S.useState(null),[re,fe]=S.useState(null),[we,ke]=S.useState(!1),[Ie,et]=S.useState(null),[lt,cn]=S.useState(null),[yt,me]=S.useState(new Set),[Le,ut]=S.useState(!1),Zt=S.useRef(null),[Ut,Cn]=S.useState("installed"),[nn,wt]=S.useState(0),[mn,he]=S.useState(20),[Se,Oe]=S.useState(!1),[W,ve]=S.useState(""),[st,jt]=S.useState("");function kt(){i(!0),pe.getSkills().then(se=>n(se.skills)).catch(se=>l(se.message)).finally(()=>i(!1))}S.useEffect(()=>{kt()},[]);function Tt(){ke(!0),et(null),pe.getStoreRegistry().then(se=>{ce(se.skills),Q(se.storeBase),fe(se.registryUrl??null),wt(0)}).catch(se=>et(se instanceof Error?se.message:String(se))).finally(()=>ke(!1))}S.useEffect(()=>{Ut==="discover"&&Tt()},[Ut]),S.useEffect(()=>{Tt()},[]);const jn=S.useMemo(()=>{const se=W.trim().toLowerCase();return se?e.filter(_e=>_e.id.toLowerCase().includes(se)||_e.name.toLowerCase().includes(se)||(_e.description?.toLowerCase().includes(se)??!1)):e},[e,W]),pt=S.useMemo(()=>{const se=st.trim().toLowerCase();return se?ee.filter(_e=>_e.slug.toLowerCase().includes(se)||_e.name.toLowerCase().includes(se)||(_e.description?.toLowerCase().includes(se)??!1)):ee},[ee,st]),kn=pt.length,rn=Math.max(1,Math.ceil(kn/mn)),_i=Math.min(nn,Math.max(0,rn-1)),On=pt.slice(_i*mn,(_i+1)*mn);S.useEffect(()=>{wt(0)},[st]),S.useEffect(()=>{nn>=rn&&rn>0&&wt(rn-1)},[rn,nn]),S.useEffect(()=>{const se=Zt.current;if(!se)return;const _e=On.some(mt=>yt.has(mt.slug)),tt=On.length>0&&On.every(mt=>yt.has(mt.slug));se.indeterminate=_e&&!tt},[yt,On]);async function Qa(se){try{const _e=await pe.getSkillConfig(se);P(tt=>({...tt,[se]:_e.configured}))}catch{P(_e=>({..._e,[se]:[]}))}}S.useEffect(()=>{for(const se of e)se.required_env?.length&&Qa(se.id),pe.getSkillConfigSchema(se.id).then(_e=>{ae(tt=>({...tt,[se.id]:_e??null}))}).catch(()=>ae(_e=>({..._e,[se.id]:null})))},[e]),S.useEffect(()=>{if(!O){H(null);return}pe.getSkillSetup(O.id).then(se=>H(se.setup_markdown??null)).catch(()=>H(null))},[O]);async function Gs(se,_e){X(null),$(se);try{const tt=M[se]??{},mt={};for(const Qt of _e){const Fn=tt[Qt]?.trim();Fn&&(mt[Qt]=Fn)}await pe.saveSkillConfig(se,mt),await Qa(se),R(Qt=>({...Qt,[se]:{...Qt[se]??{},...mt}}))}catch(tt){X(tt instanceof Error?tt.message:String(tt))}finally{$(null)}}function Ci(se,_e,tt){R(mt=>({...mt,[se]:{...mt[se]??{},[_e]:tt}}))}async function qs(se){if(se.preventDefault(),!!u.trim()){j(!0),N(null);try{const _e=await pe.installSkill({path:u.trim()});Qe.success(`Installed: ${_e.skill.id}`),d(""),p(""),y(null),Z(!1),kt()}catch(_e){N(_e instanceof Error?_e.message:String(_e))}finally{j(!1)}}}async function Ja(se){if(se.preventDefault(),!!h.trim()){j(!0),N(null);try{const _e=await pe.installSkill({url:h.trim()});Qe.success(`Installed: ${_e.skill.id}`),p(""),d(""),y(null),Z(!1),kt()}catch(_e){N(_e instanceof Error?_e.message:String(_e))}finally{j(!1)}}}async function cp(se){if(se.preventDefault(),!!g){j(!0),N(null);try{const _e=await pe.uploadSkill(g);Qe.success(`Installed: ${_e.skill.id}`),y(null),d(""),p(""),Z(!1),kt()}catch(_e){N(_e instanceof Error?_e.message:String(_e))}finally{j(!1)}}}async function Lc(se){if(se.preventDefault(),!!v){j(!0),N(null);try{const _e=await pe.uploadSkillMd(v,_.trim()||void 0);Qe.success(`Installed: ${_e.skill.id}`),x(null),C(""),Z(!1),kt()}catch(_e){N(_e instanceof Error?_e.message:String(_e))}finally{j(!1)}}}async function vl(se){if(window.confirm(`Uninstall skill "${se}"? This removes the skill folder.`)){F(se);try{await pe.uninstallSkill(se),Qe.success(`Uninstalled ${se}`),kt()}catch(_e){Qe.error(_e instanceof Error?_e.message:String(_e))}finally{F(null)}}}const oa=S.useMemo(()=>[{accessorKey:"name",header:"Name",cell:({row:se})=>f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"font-medium",children:se.original.name}),se.original.system&&f.jsx(Ns,{variant:"outline",className:"text-xs",children:"System"})]})},{accessorKey:"id",header:"ID",cell:({row:se})=>f.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:se.original.id})},{accessorKey:"description",header:"Description",cell:({row:se})=>se.original.description?f.jsx("span",{className:"text-muted-foreground text-sm max-w-[240px] truncate block",title:se.original.description,children:se.original.description}):"—"},{id:"version",header:"Version",cell:({row:se})=>f.jsx("span",{className:"text-muted-foreground text-sm",children:se.original.version??"—"})},{id:"tools",header:"Tools",cell:({row:se})=>se.original.tools.length>0?f.jsx("div",{className:"flex flex-wrap gap-1",children:se.original.tools.map(_e=>f.jsx(Ns,{variant:"secondary",className:"font-mono text-xs",children:_e.id},_e.id))}):f.jsx("span",{className:"text-muted-foreground",children:"—"})},{id:"actions",cell:({row:se})=>{const _e=se.original,tt=_e.required_env&&_e.required_env.length>0,mt=ee.find(zn=>zn.slug===_e.id),Qt=!!(mt?.downloadUrl&&mt.version&&WC(mt.version,_e.version)),Fn=lt===_e.id;return f.jsxs(r0,{children:[f.jsx(i0,{asChild:!0,children:f.jsxs(be,{variant:"ghost",className:"h-8 w-8 p-0",disabled:A!==null||Fn,children:[f.jsx("span",{className:"sr-only",children:"Open menu"}),f.jsx(a8,{className:"h-4 w-4"})]})}),f.jsxs(a0,{align:"end",children:[Qt&&f.jsxs(Rn,{onClick:async()=>{if(mt?.downloadUrl){cn(_e.id);try{await pe.installSkill({url:mt.downloadUrl,slug:mt.slug,version:mt.version}),Qe.success(`Updated: ${_e.id}`),kt(),Tt()}catch(zn){Qe.error(zn instanceof Error?zn.message:String(zn))}finally{cn(null)}}},disabled:Fn,children:[f.jsx(G_,{className:"mr-2 h-4 w-4"}),Fn?"Updating…":"Update from hub"]}),tt&&f.jsxs(Rn,{onClick:()=>q(_e),children:[f.jsx($8,{className:"mr-2 h-4 w-4"}),"Setup"]}),!_e.system&&f.jsxs(Rn,{className:"text-destructive focus:text-destructive",onClick:()=>vl(_e.id),disabled:A===_e.id,children:[f.jsx(Xo,{className:"mr-2 h-4 w-4"}),A===_e.id?"Uninstalling…":"Uninstall"]})]})]})}}],[A,ee,lt]),xl=k7({data:jn,columns:oa,getCoreRowModel:S7()});return r&&e.length===0?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading skills…"}):s&&e.length===0?f.jsxs("div",{className:"p-4 text-destructive",children:["Failed to load skills: ",s]}):f.jsxs("div",{className:"space-y-6 p-4",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Skills"}),f.jsx("p",{className:"text-muted-foreground",children:"Browse installed skills and install from URL, path, or SKILL.md."})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(be,{variant:e.length===0?"default":"outline",size:e.length===0?"default":"sm",onClick:async()=>{Oe(!0);try{const{installed:se}=await pe.installSystemSkills();Qe.success(se>0?`Installed ${se} default skill${se===1?"":"s"}.`:"No new skills to install (already present)."),kt()}catch(se){Qe.error(se instanceof Error?se.message:String(se))}finally{Oe(!1)}},disabled:Se,children:Se?"Installing…":"Install default skills"}),f.jsx(be,{onClick:()=>{Z(!0),N(null)},children:"Install skill"})]})]}),f.jsxs(qC,{value:Ut,onValueChange:Cn,className:"w-full",children:[f.jsxs(YC,{className:"grid w-full max-w-[420px] grid-cols-3",children:[f.jsx(yu,{value:"installed",children:"Installed skills"}),f.jsx(yu,{value:"discover",children:"Discover"}),f.jsx(yu,{value:"mcp",children:"MCP Servers"})]}),f.jsx(vu,{value:"installed",className:"mt-4",children:f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Installed skills"}),f.jsxs(Kt,{children:["You can find and install more skills from the SulalaHub store. ",f.jsx("a",{href:"https://hub.sulala.ai",className:"text-blue-500",target:"_blank",rel:"noopener noreferrer",children:"Visit the store"})," to find and install skills."]})]}),f.jsx(Wt,{children:e.length===0?f.jsxs("div",{className:"space-y-2",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed. Install default skills (memory, date, fetch, jq, file-search) or use Install skill to add one."}),f.jsx(be,{variant:"secondary",size:"sm",onClick:async()=>{Oe(!0);try{const{installed:se}=await pe.installSystemSkills();Qe.success(se>0?`Installed ${se} default skill${se===1?"":"s"}.`:"No new skills to install (already present)."),kt()}catch(se){Qe.error(se instanceof Error?se.message:String(se))}finally{Oe(!1)}},disabled:Se,children:Se?"Installing…":"Install default skills"})]}):f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"relative max-w-sm",children:[f.jsx(Wy,{className:"absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),f.jsx(Ue,{placeholder:"Search by name, id, or description",value:W,onChange:se=>ve(se.target.value),className:"pl-8"})]}),f.jsx("div",{className:"overflow-hidden rounded-md border",children:f.jsxs(mv,{children:[f.jsx(gv,{children:xl.getHeaderGroups().map(se=>f.jsx(_s,{children:se.headers.map(_e=>f.jsx(Gr,{children:_e.isPlaceholder?null:GC(_e.column.columnDef.header,_e.getContext())},_e.id))},se.id))}),f.jsx(yv,{children:xl.getRowModel().rows?.length?xl.getRowModel().rows.map(se=>f.jsx(_s,{"data-state":se.getIsSelected()&&"selected",children:se.getVisibleCells().map(_e=>f.jsx(Rr,{children:GC(_e.column.columnDef.cell,_e.getContext())},_e.id))},se.id)):f.jsx(_s,{children:f.jsx(Rr,{colSpan:oa.length,className:"h-24 text-center text-muted-foreground",children:W.trim()?"No skills match your search.":"No skills."})})})]})})]})})]})}),f.jsx(vu,{value:"discover",className:"mt-4",children:f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsxs(Xt,{className:"flex items-center gap-2",children:[f.jsx(q8,{className:"h-5 w-5"}),"Discover"]}),f.jsxs(Kt,{children:["Skills from the SulalaHub store (ZIP install). Use ",f.jsx("strong",{children:"Details"})," to open the skill on the store: see creator, rating, comments, and to rate, comment, or report."]})]}),f.jsxs(Wt,{children:[we&&f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store…"}),Ie&&f.jsx("p",{className:"text-sm text-destructive mb-4",children:Ie}),re&&f.jsx("p",{className:"text-xs text-muted-foreground mb-3 font-mono truncate",title:re}),!Y&&!we&&f.jsxs("p",{className:"text-sm text-muted-foreground",children:["No store configured. A default registry URL is set in workspace config when you run ",f.jsx("code",{className:"rounded bg-muted px-1",children:"sulala onboard"})," (",f.jsx("code",{className:"rounded bg-muted px-1",children:"~/.agent-os/config.json"})," → ",f.jsx("code",{className:"rounded bg-muted px-1",children:"skills_registry_url"}),"). You can override with ",f.jsx("code",{className:"rounded bg-muted px-1",children:"SKILLS_REGISTRY_URL"})," (env) and restart the agent, then open Discover again."]}),Y&&ee.length===0&&!we&&f.jsxs("p",{className:"text-sm text-muted-foreground",children:["No skills returned. Ensure the URL above is the registry (",f.jsx("code",{className:"rounded bg-muted px-1",children:"/api/sulalahub/registry"}),"), not a skill content URL (",f.jsx("code",{className:"rounded bg-muted px-1",children:"/api/sulalahub/skills/…"}),")."]}),Y&&ee.length>0&&f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs("div",{className:"relative max-w-[240px]",children:[f.jsx(Wy,{className:"absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),f.jsx(Ue,{placeholder:"Search name, slug, or description",value:st,onChange:se=>jt(se.target.value),className:"pl-8 h-8"})]}),f.jsx(be,{variant:"outline",size:"sm",onClick:Tt,disabled:we,children:"Refresh"}),f.jsxs("span",{className:"text-sm text-muted-foreground",children:[kn," skill",kn!==1?"s":"",st.trim()&&kn!==ee.length&&` (filtered from ${ee.length})`]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ne,{htmlFor:"discover-page-size",className:"text-sm text-muted-foreground whitespace-nowrap",children:"Per page"}),f.jsxs(Au,{value:String(mn),onValueChange:se=>{he(Number(se)),wt(0)},children:[f.jsx(Mu,{id:"discover-page-size",className:"w-[72px]",size:"sm",children:f.jsx(Ru,{})}),f.jsxs(Du,{children:[f.jsx(Wi,{value:"10",children:"10"}),f.jsx(Wi,{value:"20",children:"20"}),f.jsx(Wi,{value:"50",children:"50"}),f.jsx(Wi,{value:"100",children:"100"})]})]})]})]}),yt.size>0&&f.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[f.jsxs("span",{className:"text-sm text-muted-foreground",children:[yt.size," selected"]}),f.jsx(be,{size:"sm",disabled:Le,onClick:async()=>{const se=On.filter(tt=>yt.has(tt.slug)&&(tt.downloadUrl??"").trim()!=="");if(se.length===0)return;ut(!0);let _e=0;for(const tt of se)try{await pe.installSkill({url:tt.downloadUrl,slug:tt.slug,version:tt.version}),_e++}catch{Qe.error(`Failed: ${tt.name}`)}_e&&(Qe.success(_e===1?`Installed: ${se[0].name}`:`Installed/updated ${_e} skills`),kt(),Tt(),me(new Set)),ut(!1)},children:Le?"Installing…":"Install / Update selected"}),f.jsx(be,{size:"sm",variant:"ghost",disabled:Le,onClick:()=>me(new Set),children:"Clear selection"})]}),f.jsx("div",{className:"rounded-md border",children:f.jsxs(mv,{children:[f.jsx(gv,{children:f.jsxs(_s,{children:[f.jsx(Gr,{className:"w-10",children:f.jsx("input",{ref:Zt,type:"checkbox","aria-label":"Select all on page",checked:On.length>0&&On.every(se=>yt.has(se.slug)),onChange:se=>{if(se.target.checked)me(_e=>new Set([..._e,...On.map(tt=>tt.slug)]));else{const _e=new Set(On.map(tt=>tt.slug));me(tt=>new Set([...tt].filter(mt=>!_e.has(mt))))}},disabled:Le,className:"rounded border-input"})}),f.jsx(Gr,{children:"Name"}),f.jsx(Gr,{children:"Description"}),f.jsx(Gr,{className:"w-[100px]",children:"Version"}),f.jsx(Gr,{className:"w-[200px]",children:"Actions"})]})}),f.jsx(yv,{children:On.map(se=>{const _e=e.find(Lt=>Lt.id===se.slug),tt=!!_e,mt=tt&&se.version&&WC(se.version,_e?.version),Qt=se.downloadUrl??"",Fn=async()=>{if(Qt){cn(se.slug);try{const Lt=await pe.installSkill({url:Qt,slug:se.slug,version:se.version});Qe.success(mt?`Updated: ${Lt.skill.id}`:`Installed: ${Lt.skill.id}`),kt(),Tt()}catch(Lt){Qe.error(Lt instanceof Error?Lt.message:String(Lt))}finally{cn(null)}}},zn=yt.has(se.slug);return f.jsxs(_s,{children:[f.jsx(Rr,{className:"w-10",children:f.jsx("input",{type:"checkbox","aria-label":`Select ${se.name}`,checked:zn,onChange:Lt=>{Lt.target.checked?me(Mt=>new Set([...Mt,se.slug])):me(Mt=>{const dn=new Set(Mt);return dn.delete(se.slug),dn})},disabled:Le,className:"rounded border-input"})}),f.jsx(Rr,{className:"font-medium",children:se.name}),f.jsx(Rr,{className:"text-muted-foreground text-sm max-w-[320px] truncate",title:se.description,children:se.description??"—"}),f.jsx(Rr,{className:"text-muted-foreground text-sm",children:se.version??"—"}),f.jsx(Rr,{children:f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[Y&&f.jsx(be,{size:"sm",variant:"ghost",className:"text-muted-foreground",asChild:!0,children:f.jsxs("a",{href:`${Y.replace(/\/$/,"")}/skills/${encodeURIComponent(se.slug)}`,target:"_blank",rel:"noopener noreferrer",title:"View on store: creator, rating, comments, rate, report",children:[f.jsx(FI,{className:"mr-1.5 h-3.5 w-3.5"}),"Details"]})}),tt&&!mt?f.jsx(Ns,{variant:"secondary",children:"Installed"}):f.jsx(be,{size:"sm",variant:mt?"default":"outline",disabled:lt!==null||Le||!Qt,onClick:Fn,children:lt===se.slug?"Installing…":mt?f.jsxs(f.Fragment,{children:[f.jsx(G_,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]}):f.jsxs(f.Fragment,{children:[f.jsx(n8,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})})]})})]},se.slug)})})]})}),f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[f.jsxs("span",{className:"text-muted-foreground",children:["Showing ",kn===0?0:_i*mn+1,"–",Math.min((_i+1)*mn,kn)," of ",kn]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(be,{variant:"outline",size:"sm",onClick:()=>wt(se=>Math.max(0,se-1)),disabled:_i<=0,"aria-label":"Previous page",children:f.jsx(Xf,{className:"h-4 w-4"})}),f.jsxs("span",{className:"min-w-[80px] text-center text-muted-foreground",children:["Page ",_i+1," of ",rn]}),f.jsx(be,{variant:"outline",size:"sm",onClick:()=>wt(se=>Math.min(rn-1,se+1)),disabled:_i>=rn-1,"aria-label":"Next page",children:f.jsx(Zn,{className:"h-4 w-4"})})]})]})]})]})]})}),f.jsx(vu,{value:"mcp",className:"mt-4",children:f.jsx(T7,{})})]}),B&&f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>Z(!1),"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 w-full max-w-lg rounded-lg border bg-background p-4 shadow-lg",children:[f.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Install skill"}),f.jsx(be,{variant:"ghost",size:"icon",onClick:()=>Z(!1),"aria-label":"Close",children:f.jsx(Is,{className:"h-4 w-4"})})]}),f.jsxs(qC,{defaultValue:"url",className:"w-full",children:[f.jsxs(YC,{className:"grid w-full grid-cols-2",children:[f.jsx(yu,{value:"url",children:"URL or archive"}),f.jsx(yu,{value:"md",children:"SKILL.md file"})]}),f.jsxs(vu,{value:"url",className:"space-y-4 pt-4",children:[f.jsxs("form",{onSubmit:cp,className:"space-y-2",children:[f.jsx(Ne,{children:"Upload archive"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("input",{type:"file",accept:".tar.gz,.tgz,.tar,.zip,application/gzip,application/x-tar,application/zip",className:"text-sm file:mr-2 file:rounded-lg file:border-0 file:bg-primary file:px-3 file:py-1.5 file:text-primary-foreground file:text-sm",onChange:se=>y(se.target.files?.[0]??null)}),f.jsx(be,{type:"submit",disabled:k||!g,children:k?"Installing…":"Upload & install"})]})]}),f.jsxs("form",{onSubmit:qs,className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"install-path",children:"From path"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{id:"install-path",placeholder:"/path/to/skill/folder or ./skills/weather",value:u,onChange:se=>d(se.target.value)}),f.jsx(be,{type:"submit",disabled:k,children:"Install"})]})]}),f.jsxs("form",{onSubmit:Ja,className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"install-url",children:"From URL (ZIP or tar.gz)"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Store skill URL or direct ZIP/tar.gz link. Installed to ~/.agent-os/skills/"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{id:"install-url",placeholder:"http://localhost:3000/api/sulalahub/skills/test4 or …/download",value:h,onChange:se=>p(se.target.value)}),f.jsx(be,{type:"submit",disabled:k,children:"Install"})]})]})]}),f.jsx(vu,{value:"md",className:"space-y-4 pt-4",children:f.jsxs("form",{onSubmit:Lc,className:"space-y-2",children:[f.jsx(Ne,{children:"Upload SKILL.md"}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:["Upload a single SKILL.md file. Skill id is taken from frontmatter ",f.jsx("code",{className:"rounded bg-muted px-1",children:"name"})," or the optional field below."]}),f.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[f.jsx("input",{type:"file",accept:".md,.markdown",className:"text-sm file:mr-2 file:rounded-lg file:border-0 file:bg-primary file:px-3 file:py-1.5 file:text-primary-foreground file:text-sm",onChange:se=>x(se.target.files?.[0]??null)}),f.jsx(Ue,{placeholder:"Skill ID (optional)",value:_,onChange:se=>C(se.target.value),className:"max-w-[180px]"}),f.jsx(be,{type:"submit",disabled:k||!v,children:k?"Installing…":"Upload SKILL.md"})]})]})})]}),E&&f.jsx("p",{className:"mt-4 text-sm text-destructive",children:E})]})]}),O&&f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>{q(null),X(null)},"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 w-full max-w-lg max-h-[90vh] overflow-y-auto rounded-lg border bg-background p-4 shadow-lg",children:[f.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[f.jsxs("h2",{className:"text-lg font-semibold",children:["Setup — ",O.name]}),f.jsx(be,{variant:"ghost",size:"icon",onClick:()=>{q(null),X(null)},"aria-label":"Close",children:f.jsx(Is,{className:"h-4 w-4"})})]}),I&&f.jsx("div",{className:"mb-4 rounded-md border bg-muted/30 p-3 text-sm prose prose-sm dark:prose-invert max-w-none",children:f.jsx(Wh,{content:I})}),f.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Required env vars for this skill. Stored in ~/.agent-os/configs/"}),f.jsx("div",{className:"space-y-3",children:O.required_env?.map(se=>{const _e=z[O.id]?.includes(se),tt=M[O.id]?.[se]??"",Qt=(K[O.id]&&typeof K[O.id]=="object"&&"properties"in K[O.id]?K[O.id].properties:void 0)?.[se],Fn=typeof Qt=="object"&&Qt?.title||se,zn=A7(se,Qt),Lt=`${O.id}|${se}`,Mt=G.has(Lt),dn=()=>{L(ni=>{const la=new Set(ni);return la.has(Lt)?la.delete(Lt):la.add(Lt),la})};return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ne,{htmlFor:`setup-${O.id}-${se}`,className:"min-w-[120px] font-mono text-xs shrink-0",title:typeof Qt=="object"?Qt.description:void 0,children:Fn}),f.jsxs("div",{className:"relative flex flex-1 items-center",children:[f.jsx(Ue,{id:`setup-${O.id}-${se}`,type:zn?Mt?"text":"password":"text",autoComplete:"off",placeholder:_e&&zn?"•••••••• (already set)":_e&&!zn?"(already set)":`Set ${se}`,value:tt,onChange:ni=>Ci(O.id,se,ni.target.value),className:"font-mono text-sm flex-1 pr-9"}),zn&&f.jsx(be,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground",onClick:dn,"aria-label":Mt?"Hide value":"Show value",children:Mt?f.jsx(l8,{className:"size-4"}):f.jsx(c8,{className:"size-4"})})]})]},se)})}),U&&f.jsx("p",{className:"mt-2 text-sm text-destructive",children:U}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsx(be,{variant:"outline",onClick:()=>{q(null),X(null)},children:"Cancel"}),f.jsx(be,{disabled:D===O.id,onClick:()=>Gs(O.id,O.required_env).then(()=>{Qe.success("Configuration saved"),q(null),X(null)}),children:D===O.id?"Saving…":"Save"})]})]})]})]})}const M7="agent1.jpg";function D7(e){return e?`/media/${e}`:`/media/${M7}`}function ZC(e){if(!e||!e.trim())return"Not scheduled";const n=e.trim();return n==="*/10 * * * *"?"Every 10 min":n==="*/5 * * * *"?"Every 5 min":n==="0 * * * *"?"Every hour":n==="0 9 * * *"?"Daily at 9:00":n==="0 7 * * *"?"Daily at 7:00":n==="0 18 * * *"?"Daily at 18:00":/^0 \d+ \* \* \*$/.test(n)?`Daily at ${n.split(" ")[1]}:00`:n}function QC(e){const n=new Date(e),i=new Date().getTime()-n.getTime(),s=Math.floor(i/6e4),l=Math.floor(i/36e5),u=Math.floor(i/864e5);return s<1?"Just now":s<60?`${s}m ago`:l<24?`${l}h ago`:u<7?`${u}d ago`:n.toLocaleDateString()}function O7({onNavigate:e}){const{openChatWithAgent:n}=Ux(),[r,i]=S.useState([]),[s,l]=S.useState([]),[u,d]=S.useState({}),[h,p]=S.useState({}),[g,y]=S.useState(!0),[v,x]=S.useState(null),[_,C]=S.useState(null),[k,j]=S.useState(null);function E(){return pe.getAgents().then(P=>i(P.agents)).catch(P=>x(P.message))}function N(){return pe.getGraphs().then(P=>Promise.all(P.graphs.map(D=>pe.getGraph(D.id)))).then(P=>l(P)).catch(P=>x(P.message))}function M(){return Promise.all([E(),N()])}S.useEffect(()=>{M().then(()=>y(!1)).catch(()=>y(!1))},[]),S.useEffect(()=>{const P=r.filter($=>$.schedule?.trim()),D=s.filter($=>$.schedule?.trim());if(P.length===0&&D.length===0){d({}),p({});return}pe.getTasks({limit:300}).then(({tasks:$})=>{const U={};for(const K of P){const ae=$.filter(B=>B.agent_id===K.id&&(B.status==="completed"||B.status==="failed")).sort((B,Z)=>Z.updated_at.localeCompare(B.updated_at));U[K.id]=ae[0]??null}d(U);const X={};for(const K of D){const ae=$.filter(B=>B.graph_id===K.id&&(B.status==="completed"||B.status==="failed")).sort((B,Z)=>Z.updated_at.localeCompare(B.updated_at));X[K.id]=ae[0]??null}p(X)}).catch(()=>{d({}),p({})})},[r,s]);const R=r.filter(P=>P.schedule?.trim()),z=s.filter(P=>P.schedule?.trim());return g?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading…"}):v?f.jsxs("div",{className:"p-4 text-destructive",children:["Failed to load: ",v]}):f.jsxs("div",{className:"space-y-8 p-6 max-w-4xl mx-auto",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Schedules"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Agents and graphs with a cron schedule. Enable or disable runs here; edit schedules on the Agents or Graphs page."})]}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsxs(Xt,{className:"flex items-center gap-2",children:[f.jsx(ST,{className:"size-5"}),"Scheduled agents"]}),f.jsx(Kt,{children:R.length===0?"No agents have a schedule. Set a schedule on the Agents page to see them here.":`${R.length} agent${R.length===1?"":"s"} with a schedule.`})]}),f.jsx(Wt,{children:R.length===0?f.jsxs("div",{className:"py-8 text-center text-muted-foreground text-sm",children:["Go to ",f.jsx("strong",{children:"Agents"})," → choose an agent → Edit schedule to add a cron (e.g. daily 9:00)."]}):f.jsx("ul",{className:"space-y-3",children:R.map(P=>{const D=u[P.id],$=P.schedule_enabled===!1;return f.jsxs("li",{className:"flex flex-col gap-2 rounded-lg border border-border/80 bg-card p-4 transition-colors hover:border-border",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("img",{src:D7(P.avatar),alt:"",className:"h-12 w-12 shrink-0 rounded-full object-cover border border-border"}),f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:P.name}),f.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:P.id})]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsxs(be,{size:"sm",variant:$?"default":"secondary",disabled:_===P.id,onClick:async()=>{C(P.id);try{await pe.updateAgent(P.id,{schedule_enabled:!$}),await M(),Qe.success($?"Schedule enabled":"Schedule paused")}catch(U){Qe.error(U instanceof Error?U.message:"Failed to update")}finally{C(null)}},children:[$?f.jsx(Yo,{className:"size-4"}):f.jsx(Kf,{className:"size-4"}),$?"Enable":"Pause"]}),f.jsx("span",{className:"text-sm text-muted-foreground",children:$?"Paused":"Enabled"}),f.jsxs(be,{size:"sm",variant:"ghost",onClick:()=>n(P.id),className:"gap-1",children:[f.jsx(Hh,{className:"size-4"}),"Chat"]})]})]}),f.jsxs("div",{className:"grid gap-1 text-sm text-muted-foreground sm:grid-cols-2",children:[f.jsxs("span",{children:[f.jsx("strong",{className:"text-foreground/90",children:"Schedule:"})," ",ZC(P.schedule)]}),D?f.jsxs("span",{children:[f.jsx("strong",{className:"text-foreground/90",children:"Last run:"})," ",QC(D.updated_at),D.status==="failed"&&" (failed)"]}):f.jsxs("span",{children:[f.jsx("strong",{className:"text-foreground/90",children:"Last run:"})," —"]})]}),(P.schedule_input??"").trim()&&f.jsxs("p",{className:"text-xs text-muted-foreground",children:['Task: "',P.schedule_input,'"']})]},P.id)})})})]}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsxs(Xt,{className:"flex items-center gap-2",children:[f.jsx(nc,{className:"size-5"}),"Scheduled graphs"]}),f.jsx(Kt,{children:z.length===0?"No graphs have a schedule. Set a schedule on the Graphs page to see them here.":`${z.length} graph${z.length===1?"":"s"} with a schedule.`})]}),f.jsx(Wt,{children:z.length===0?f.jsxs("div",{className:"py-8 text-center text-muted-foreground text-sm",children:["Go to ",f.jsx("strong",{children:"Graphs"})," → choose a graph → Edit schedule to add a cron (e.g. daily 9:00)."]}):f.jsx("ul",{className:"space-y-3",children:z.map(P=>{const D=h[P.id],$=P.schedule_enabled===!1;return f.jsxs("li",{className:"flex flex-col gap-2 rounded-lg border border-border/80 bg-card p-4 transition-colors hover:border-border",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full border border-border bg-muted",children:f.jsx(nc,{className:"size-6 text-muted-foreground"})}),f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Graph"}),f.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:P.id})]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsxs(be,{size:"sm",variant:$?"default":"secondary",disabled:k===P.id,onClick:async()=>{j(P.id);try{await pe.saveGraph({...P,schedule_enabled:!$}),await N(),Qe.success($?"Schedule enabled":"Schedule paused")}catch(U){Qe.error(U instanceof Error?U.message:"Failed to update")}finally{j(null)}},children:[$?f.jsx(Yo,{className:"size-4"}):f.jsx(Kf,{className:"size-4"}),$?"Enable":"Pause"]}),f.jsx("span",{className:"text-sm text-muted-foreground",children:$?"Paused":"Enabled"}),f.jsxs(be,{size:"sm",variant:"ghost",onClick:async()=>{try{await pe.enqueueGraphTask(P.id,(P.schedule_input??"").trim()||"Scheduled run"),Qe.success("Run enqueued")}catch(U){Qe.error(U instanceof Error?U.message:"Failed to enqueue")}},className:"gap-1",children:[f.jsx(_T,{className:"size-4"}),"Run now"]}),e&&f.jsxs(be,{size:"sm",variant:"ghost",onClick:()=>e("graphs"),className:"gap-1",children:[f.jsx(kT,{className:"size-4"}),"Edit"]})]})]}),f.jsxs("div",{className:"grid gap-1 text-sm text-muted-foreground sm:grid-cols-2",children:[f.jsxs("span",{children:[f.jsx("strong",{className:"text-foreground/90",children:"Schedule:"})," ",ZC(P.schedule)]}),D?f.jsxs("span",{children:[f.jsx("strong",{className:"text-foreground/90",children:"Last run:"})," ",QC(D.updated_at),D.status==="failed"&&" (failed)"]}):f.jsxs("span",{children:[f.jsx("strong",{className:"text-foreground/90",children:"Last run:"})," —"]})]}),(P.schedule_input??"").trim()&&f.jsxs("p",{className:"text-xs text-muted-foreground",children:['Task: "',P.schedule_input,'"']})]},P.id)})})})]})]})}const PA=S.createContext({});function z7(e){const n=S.useRef(null);return n.current===null&&(n.current=e()),n.current}const u0=S.createContext(null),LA=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function P7(e=!0){const n=S.useContext(u0);if(n===null)return[!0,null];const{isPresent:r,onExitComplete:i,register:s}=n,l=S.useId();S.useEffect(()=>{e&&s(l)},[e]);const u=S.useCallback(()=>e&&i&&i(l),[l,i,e]);return!r&&i?[!1,u]:[!0]}const c0=typeof window<"u",L7=c0?S.useLayoutEffect:S.useEffect,fr=e=>e;let IA=fr;const I7={useManualTiming:!1};function V7(e){let n=new Set,r=new Set,i=!1,s=!1;const l=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function d(p){l.has(p)&&(h.schedule(p),e()),p(u)}const h={schedule:(p,g=!1,y=!1)=>{const x=y&&i?n:r;return g&&l.add(p),x.has(p)||x.add(p),p},cancel:p=>{r.delete(p),l.delete(p)},process:p=>{if(u=p,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(d),n.clear(),i=!1,s&&(s=!1,h.process(p))}};return h}const yf=["read","resolveKeyframes","update","preRender","render","postRender"],F7=40;function VA(e,n){let r=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},l=()=>r=!0,u=yf.reduce((j,E)=>(j[E]=V7(l),j),{}),{read:d,resolveKeyframes:h,update:p,preRender:g,render:y,postRender:v}=u,x=()=>{const j=performance.now();r=!1,s.delta=i?1e3/60:Math.max(Math.min(j-s.timestamp,F7),1),s.timestamp=j,s.isProcessing=!0,d.process(s),h.process(s),p.process(s),g.process(s),y.process(s),v.process(s),s.isProcessing=!1,r&&n&&(i=!1,e(x))},_=()=>{r=!0,i=!0,s.isProcessing||e(x)};return{schedule:yf.reduce((j,E)=>{const N=u[E];return j[E]=(M,R=!1,z=!1)=>(r||_(),N.schedule(M,R,z)),j},{}),cancel:j=>{for(let E=0;E<yf.length;E++)u[yf[E]].cancel(j)},state:s,steps:u}}const{schedule:Pt,cancel:Ga,state:Sn,steps:sy}=VA(typeof requestAnimationFrame<"u"?requestAnimationFrame:fr,!0),FA=S.createContext({strict:!1}),JC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},rl={};for(const e in JC)rl[e]={isEnabled:n=>JC[e].some(r=>!!n[r])};function U7(e){for(const n in e)rl[n]={...rl[n],...e[n]}}const B7=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function eh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||B7.has(e)}let UA=e=>!eh(e);function $7(e){e&&(UA=n=>n.startsWith("on")?!eh(n):e(n))}try{$7(require("@emotion/is-prop-valid").default)}catch{}function H7(e,n,r){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(UA(s)||r===!0&&eh(s)||!n&&!eh(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function G7(e){if(typeof Proxy>"u")return e;const n=new Map,r=(...i)=>e(...i);return new Proxy(r,{get:(i,s)=>s==="create"?e:(n.has(s)||n.set(s,e(s)),n.get(s))})}const Qh=S.createContext({});function ic(e){return typeof e=="string"||Array.isArray(e)}function Jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const d0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],f0=["initial",...d0];function ep(e){return Jh(e.animate)||f0.some(n=>ic(e[n]))}function BA(e){return!!(ep(e)||e.variants)}function q7(e,n){if(ep(e)){const{initial:r,animate:i}=e;return{initial:r===!1||ic(r)?r:void 0,animate:ic(i)?i:void 0}}return e.inherit!==!1?n:{}}function Y7(e){const{initial:n,animate:r}=q7(e,S.useContext(Qh));return S.useMemo(()=>({initial:n,animate:r}),[e2(n),e2(r)])}function e2(e){return Array.isArray(e)?e.join(" "):e}const X7=Symbol.for("motionComponentSymbol");function Fo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function K7(e,n,r){return S.useCallback(i=>{i&&e.onMount&&e.onMount(i),n&&(i?n.mount(i):n.unmount()),r&&(typeof r=="function"?r(i):Fo(r)&&(r.current=i))},[n])}const h0=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),W7="framerAppearId",$A="data-"+h0(W7),{schedule:p0}=VA(queueMicrotask,!1),HA=S.createContext({});function Z7(e,n,r,i,s){var l,u;const{visualElement:d}=S.useContext(Qh),h=S.useContext(FA),p=S.useContext(u0),g=S.useContext(LA).reducedMotion,y=S.useRef(null);i=i||h.renderer,!y.current&&i&&(y.current=i(e,{visualState:n,parent:d,props:r,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:g}));const v=y.current,x=S.useContext(HA);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&Q7(y.current,r,s,x);const _=S.useRef(!1);S.useInsertionEffect(()=>{v&&_.current&&v.update(r,p)});const C=r[$A],k=S.useRef(!!C&&!(!((l=window.MotionHandoffIsComplete)===null||l===void 0)&&l.call(window,C))&&((u=window.MotionHasOptimisedAnimation)===null||u===void 0?void 0:u.call(window,C)));return L7(()=>{v&&(_.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),p0.render(v.render),k.current&&v.animationState&&v.animationState.animateChanges())}),S.useEffect(()=>{v&&(!k.current&&v.animationState&&v.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var j;(j=window.MotionHandoffMarkAsComplete)===null||j===void 0||j.call(window,C)}),k.current=!1))}),v}function Q7(e,n,r,i){const{layoutId:s,layout:l,drag:u,dragConstraints:d,layoutScroll:h,layoutRoot:p}=n;e.projection=new r(e.latestValues,n["data-framer-portal-id"]?void 0:GA(e.parent)),e.projection.setOptions({layoutId:s,layout:l,alwaysMeasureLayout:!!u||d&&Fo(d),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:i,layoutScroll:h,layoutRoot:p})}function GA(e){if(e)return e.options.allowProjection!==!1?e.projection:GA(e.parent)}function J7({preloadedFeatures:e,createVisualElement:n,useRender:r,useVisualState:i,Component:s}){var l,u;e&&U7(e);function d(p,g){let y;const v={...S.useContext(LA),...p,layoutId:eH(p)},{isStatic:x}=v,_=Y7(p),C=i(p,x);if(!x&&c0){tH();const k=nH(v);y=k.MeasureLayout,_.visualElement=Z7(s,C,v,n,k.ProjectionNode)}return f.jsxs(Qh.Provider,{value:_,children:[y&&_.visualElement?f.jsx(y,{visualElement:_.visualElement,...v}):null,r(s,p,K7(C,_.visualElement,g),C,x,_.visualElement)]})}d.displayName=`motion.${typeof s=="string"?s:`create(${(u=(l=s.displayName)!==null&&l!==void 0?l:s.name)!==null&&u!==void 0?u:""})`}`;const h=S.forwardRef(d);return h[X7]=s,h}function eH({layoutId:e}){const n=S.useContext(PA).id;return n&&e!==void 0?n+"-"+e:e}function tH(e,n){S.useContext(FA).strict}function nH(e){const{drag:n,layout:r}=rl;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const rH=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function m0(e){return typeof e!="string"||e.includes("-")?!1:!!(rH.indexOf(e)>-1||/[A-Z]/u.test(e))}function t2(e){const n=[{},{}];return e?.values.forEach((r,i)=>{n[0][i]=r.get(),n[1][i]=r.getVelocity()}),n}function g0(e,n,r,i){if(typeof n=="function"){const[s,l]=t2(i);n=n(r!==void 0?r:e.custom,s,l)}if(typeof n=="string"&&(n=e.variants&&e.variants[n]),typeof n=="function"){const[s,l]=t2(i);n=n(r!==void 0?r:e.custom,s,l)}return n}const vv=e=>Array.isArray(e),iH=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),aH=e=>vv(e)?e[e.length-1]||0:e,Mn=e=>!!(e&&e.getVelocity);function Rf(e){const n=Mn(e)?e.get():e;return iH(n)?n.toValue():n}function sH({scrapeMotionValuesFromProps:e,createRenderState:n,onUpdate:r},i,s,l){const u={latestValues:oH(i,s,l,e),renderState:n()};return r&&(u.onMount=d=>r({props:i,current:d,...u}),u.onUpdate=d=>r(d)),u}const qA=e=>(n,r)=>{const i=S.useContext(Qh),s=S.useContext(u0),l=()=>sH(e,n,i,s);return r?l():z7(l)};function oH(e,n,r,i){const s={},l=i(e,{});for(const v in l)s[v]=Rf(l[v]);let{initial:u,animate:d}=e;const h=ep(e),p=BA(e);n&&p&&!h&&e.inherit!==!1&&(u===void 0&&(u=n.initial),d===void 0&&(d=n.animate));let g=r?r.initial===!1:!1;g=g||u===!1;const y=g?d:u;if(y&&typeof y!="boolean"&&!Jh(y)){const v=Array.isArray(y)?y:[y];for(let x=0;x<v.length;x++){const _=g0(e,v[x]);if(_){const{transitionEnd:C,transition:k,...j}=_;for(const E in j){let N=j[E];if(Array.isArray(N)){const M=g?N.length-1:0;N=N[M]}N!==null&&(s[E]=N)}for(const E in C)s[E]=C[E]}}}return s}const gl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Hs=new Set(gl),YA=e=>n=>typeof n=="string"&&n.startsWith(e),XA=YA("--"),lH=YA("var(--"),y0=e=>lH(e)?uH.test(e.split("/*")[0].trim()):!1,uH=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,KA=(e,n)=>n&&typeof e=="number"?n.transform(e):e,ia=(e,n,r)=>r>n?n:r<e?e:r,yl={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ac={...yl,transform:e=>ia(0,1,e)},vf={...yl,default:1},kc=e=>({test:n=>typeof n=="string"&&n.endsWith(e)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${e}`}),Ia=kc("deg"),mi=kc("%"),Fe=kc("px"),cH=kc("vh"),dH=kc("vw"),n2={...mi,parse:e=>mi.parse(e)/100,transform:e=>mi.transform(e*100)},fH={borderWidth:Fe,borderTopWidth:Fe,borderRightWidth:Fe,borderBottomWidth:Fe,borderLeftWidth:Fe,borderRadius:Fe,radius:Fe,borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomRightRadius:Fe,borderBottomLeftRadius:Fe,width:Fe,maxWidth:Fe,height:Fe,maxHeight:Fe,top:Fe,right:Fe,bottom:Fe,left:Fe,padding:Fe,paddingTop:Fe,paddingRight:Fe,paddingBottom:Fe,paddingLeft:Fe,margin:Fe,marginTop:Fe,marginRight:Fe,marginBottom:Fe,marginLeft:Fe,backgroundPositionX:Fe,backgroundPositionY:Fe},hH={rotate:Ia,rotateX:Ia,rotateY:Ia,rotateZ:Ia,scale:vf,scaleX:vf,scaleY:vf,scaleZ:vf,skew:Ia,skewX:Ia,skewY:Ia,distance:Fe,translateX:Fe,translateY:Fe,translateZ:Fe,x:Fe,y:Fe,z:Fe,perspective:Fe,transformPerspective:Fe,opacity:ac,originX:n2,originY:n2,originZ:Fe},r2={...yl,transform:Math.round},v0={...fH,...hH,zIndex:r2,size:Fe,fillOpacity:ac,strokeOpacity:ac,numOctaves:r2},pH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mH=gl.length;function gH(e,n,r){let i="",s=!0;for(let l=0;l<mH;l++){const u=gl[l],d=e[u];if(d===void 0)continue;let h=!0;if(typeof d=="number"?h=d===(u.startsWith("scale")?1:0):h=parseFloat(d)===0,!h||r){const p=KA(d,v0[u]);if(!h){s=!1;const g=pH[u]||u;i+=`${g}(${p}) `}r&&(n[u]=p)}}return i=i.trim(),r?i=r(n,s?"":i):s&&(i="none"),i}function x0(e,n,r){const{style:i,vars:s,transformOrigin:l}=e;let u=!1,d=!1;for(const h in n){const p=n[h];if(Hs.has(h)){u=!0;continue}else if(XA(h)){s[h]=p;continue}else{const g=KA(p,v0[h]);h.startsWith("origin")?(d=!0,l[h]=g):i[h]=g}}if(n.transform||(u||r?i.transform=gH(n,e.transform,r):i.transform&&(i.transform="none")),d){const{originX:h="50%",originY:p="50%",originZ:g=0}=l;i.transformOrigin=`${h} ${p} ${g}`}}const yH={offset:"stroke-dashoffset",array:"stroke-dasharray"},vH={offset:"strokeDashoffset",array:"strokeDasharray"};function xH(e,n,r=1,i=0,s=!0){e.pathLength=1;const l=s?yH:vH;e[l.offset]=Fe.transform(-i);const u=Fe.transform(n),d=Fe.transform(r);e[l.array]=`${u} ${d}`}function i2(e,n,r){return typeof e=="string"?e:Fe.transform(n+r*e)}function bH(e,n,r){const i=i2(n,e.x,e.width),s=i2(r,e.y,e.height);return`${i} ${s}`}function b0(e,{attrX:n,attrY:r,attrScale:i,originX:s,originY:l,pathLength:u,pathSpacing:d=1,pathOffset:h=0,...p},g,y){if(x0(e,p,y),g){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:v,style:x,dimensions:_}=e;v.transform&&(_&&(x.transform=v.transform),delete v.transform),_&&(s!==void 0||l!==void 0||x.transform)&&(x.transformOrigin=bH(_,s!==void 0?s:.5,l!==void 0?l:.5)),n!==void 0&&(v.x=n),r!==void 0&&(v.y=r),i!==void 0&&(v.scale=i),u!==void 0&&xH(v,u,d,h,!1)}const w0=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),WA=()=>({...w0(),attrs:{}}),S0=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ZA(e,{style:n,vars:r},i,s){Object.assign(e.style,n,s&&s.getProjectionStyles(i));for(const l in r)e.style.setProperty(l,r[l])}const QA=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function JA(e,n,r,i){ZA(e,n,void 0,i);for(const s in n.attrs)e.setAttribute(QA.has(s)?s:h0(s),n.attrs[s])}const th={};function wH(e){Object.assign(th,e)}function eR(e,{layout:n,layoutId:r}){return Hs.has(e)||e.startsWith("origin")||(n||r!==void 0)&&(!!th[e]||e==="opacity")}function _0(e,n,r){var i;const{style:s}=e,l={};for(const u in s)(Mn(s[u])||n.style&&Mn(n.style[u])||eR(u,e)||((i=r?.getValue(u))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(l[u]=s[u]);return l}function tR(e,n,r){const i=_0(e,n,r);for(const s in e)if(Mn(e[s])||Mn(n[s])){const l=gl.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[l]=e[s]}return i}function SH(e,n){try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}const a2=["x","y","width","height","cx","cy","r"],_H={useVisualState:qA({scrapeMotionValuesFromProps:tR,createRenderState:WA,onUpdate:({props:e,prevProps:n,current:r,renderState:i,latestValues:s})=>{if(!r)return;let l=!!e.drag;if(!l){for(const d in s)if(Hs.has(d)){l=!0;break}}if(!l)return;let u=!n;if(n)for(let d=0;d<a2.length;d++){const h=a2[d];e[h]!==n[h]&&(u=!0)}u&&Pt.read(()=>{SH(r,i),Pt.render(()=>{b0(i,s,S0(r.tagName),e.transformTemplate),JA(r,i)})})}})},CH={useVisualState:qA({scrapeMotionValuesFromProps:_0,createRenderState:w0})};function nR(e,n,r){for(const i in n)!Mn(n[i])&&!eR(i,r)&&(e[i]=n[i])}function jH({transformTemplate:e},n){return S.useMemo(()=>{const r=w0();return x0(r,n,e),Object.assign({},r.vars,r.style)},[n])}function kH(e,n){const r=e.style||{},i={};return nR(i,r,e),Object.assign(i,jH(e,n)),i}function EH(e,n){const r={},i=kH(e,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}function NH(e,n,r,i){const s=S.useMemo(()=>{const l=WA();return b0(l,n,S0(i),e.transformTemplate),{...l.attrs,style:{...l.style}}},[n]);if(e.style){const l={};nR(l,e.style,e),s.style={...l,...s.style}}return s}function TH(e=!1){return(r,i,s,{latestValues:l},u)=>{const h=(m0(r)?NH:EH)(i,l,u,r),p=H7(i,typeof r=="string",e),g=r!==S.Fragment?{...p,...h,ref:s}:{},{children:y}=i,v=S.useMemo(()=>Mn(y)?y.get():y,[y]);return S.createElement(r,{...g,children:v})}}function AH(e,n){return function(i,{forwardMotionProps:s}={forwardMotionProps:!1}){const u={...m0(i)?_H:CH,preloadedFeatures:e,useRender:TH(s),createVisualElement:n,Component:i};return J7(u)}}function rR(e,n){if(!Array.isArray(n))return!1;const r=n.length;if(r!==e.length)return!1;for(let i=0;i<r;i++)if(n[i]!==e[i])return!1;return!0}function tp(e,n,r){const i=e.getProps();return g0(i,n,r!==void 0?r:i.custom,e)}function C0(e,n){return e?e[n]||e.default||e:void 0}const iR=new Set(["width","height","top","left","right","bottom",...gl]);let Mf;function RH(){Mf=void 0}const gi={now:()=>(Mf===void 0&&gi.set(Sn.isProcessing||I7.useManualTiming?Sn.timestamp:performance.now()),Mf),set:e=>{Mf=e,queueMicrotask(RH)}};function j0(e,n){e.indexOf(n)===-1&&e.push(n)}function k0(e,n){const r=e.indexOf(n);r>-1&&e.splice(r,1)}class E0{constructor(){this.subscriptions=[]}add(n){return j0(this.subscriptions,n),()=>k0(this.subscriptions,n)}notify(n,r,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](n,r,i);else for(let l=0;l<s;l++){const u=this.subscriptions[l];u&&u(n,r,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function aR(e,n){return n?e*(1e3/n):0}const s2=30,MH=e=>!isNaN(parseFloat(e));class DH{constructor(n,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,s=!0)=>{const l=gi.now();this.updatedAt!==l&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(n),this.owner=r.owner}setCurrent(n){this.current=n,this.updatedAt=gi.now(),this.canTrackVelocity===null&&n!==void 0&&(this.canTrackVelocity=MH(this.current))}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return this.on("change",n)}on(n,r){this.events[n]||(this.events[n]=new E0);const i=this.events[n].add(r);return n==="change"?()=>{i(),Pt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,r){this.passiveEffect=n,this.stopPassiveEffect=r}set(n,r=!0){!r||!this.passiveEffect?this.updateAndNotify(n,r):this.passiveEffect(n,this.updateAndNotify)}setWithVelocity(n,r,i){this.set(r),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-i}jump(n,r=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=gi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>s2)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,s2);return aR(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(n){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=n(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function sc(e,n){return new DH(e,n)}function OH(e,n,r){e.hasValue(n)?e.getValue(n).set(r):e.addValue(n,sc(r))}function zH(e,n){const r=tp(e,n);let{transitionEnd:i={},transition:s={},...l}=r||{};l={...l,...i};for(const u in l){const d=aH(l[u]);OH(e,u,d)}}function PH(e){return!!(Mn(e)&&e.add)}function xv(e,n){const r=e.getValue("willChange");if(PH(r))return r.add(n)}function sR(e){return e.props[$A]}function N0(e){let n;return()=>(n===void 0&&(n=e()),n)}const LH=N0(()=>window.ScrollTimeline!==void 0);class IH{constructor(n){this.stop=()=>this.runAll("stop"),this.animations=n.filter(Boolean)}get finished(){return Promise.all(this.animations.map(n=>"finished"in n?n.finished:n))}getAll(n){return this.animations[0][n]}setAll(n,r){for(let i=0;i<this.animations.length;i++)this.animations[i][n]=r}attachTimeline(n,r){const i=this.animations.map(s=>{if(LH()&&s.attachTimeline)return s.attachTimeline(n);if(typeof r=="function")return r(s)});return()=>{i.forEach((s,l)=>{s&&s(),this.animations[l].stop()})}}get time(){return this.getAll("time")}set time(n){this.setAll("time",n)}get speed(){return this.getAll("speed")}set speed(n){this.setAll("speed",n)}get startTime(){return this.getAll("startTime")}get duration(){let n=0;for(let r=0;r<this.animations.length;r++)n=Math.max(n,this.animations[r].duration);return n}runAll(n){this.animations.forEach(r=>r[n]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class VH extends IH{then(n,r){return Promise.all(this.animations).then(n).catch(r)}}const Ji=e=>e*1e3,ea=e=>e/1e3;function T0(e){return typeof e=="function"}function o2(e,n){e.timeline=n,e.onfinish=null}const A0=e=>Array.isArray(e)&&typeof e[0]=="number",FH={linearEasing:void 0};function UH(e,n){const r=N0(e);return()=>{var i;return(i=FH[n])!==null&&i!==void 0?i:r()}}const nh=UH(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),il=(e,n,r)=>{const i=n-e;return i===0?1:(r-e)/i},oR=(e,n,r=10)=>{let i="";const s=Math.max(Math.round(n/r),2);for(let l=0;l<s;l++)i+=e(il(0,s-1,l))+", ";return`linear(${i.substring(0,i.length-2)})`};function lR(e){return!!(typeof e=="function"&&nh()||!e||typeof e=="string"&&(e in bv||nh())||A0(e)||Array.isArray(e)&&e.every(lR))}const Ou=([e,n,r,i])=>`cubic-bezier(${e}, ${n}, ${r}, ${i})`,bv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ou([0,.65,.55,1]),circOut:Ou([.55,0,1,.45]),backIn:Ou([.31,.01,.66,-.59]),backOut:Ou([.33,1.53,.69,.99])};function uR(e,n){if(e)return typeof e=="function"&&nh()?oR(e,n):A0(e)?Ou(e):Array.isArray(e)?e.map(r=>uR(r,n)||bv.easeOut):bv[e]}const cR=(e,n,r)=>(((1-3*r+3*n)*e+(3*r-6*n))*e+3*n)*e,BH=1e-7,$H=12;function HH(e,n,r,i,s){let l,u,d=0;do u=n+(r-n)/2,l=cR(u,i,s)-e,l>0?r=u:n=u;while(Math.abs(l)>BH&&++d<$H);return u}function Ec(e,n,r,i){if(e===n&&r===i)return fr;const s=l=>HH(l,0,1,e,r);return l=>l===0||l===1?l:cR(s(l),n,i)}const dR=e=>n=>n<=.5?e(2*n)/2:(2-e(2*(1-n)))/2,fR=e=>n=>1-e(1-n),hR=Ec(.33,1.53,.69,.99),R0=fR(hR),pR=dR(R0),mR=e=>(e*=2)<1?.5*R0(e):.5*(2-Math.pow(2,-10*(e-1))),M0=e=>1-Math.sin(Math.acos(e)),gR=fR(M0),yR=dR(M0),vR=e=>/^0[^.\s]+$/u.test(e);function GH(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||vR(e):!0}const Gu=e=>Math.round(e*1e5)/1e5,D0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function qH(e){return e==null}const YH=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,O0=(e,n)=>r=>!!(typeof r=="string"&&YH.test(r)&&r.startsWith(e)||n&&!qH(r)&&Object.prototype.hasOwnProperty.call(r,n)),xR=(e,n,r)=>i=>{if(typeof i!="string")return i;const[s,l,u,d]=i.match(D0);return{[e]:parseFloat(s),[n]:parseFloat(l),[r]:parseFloat(u),alpha:d!==void 0?parseFloat(d):1}},XH=e=>ia(0,255,e),oy={...yl,transform:e=>Math.round(XH(e))},js={test:O0("rgb","red"),parse:xR("red","green","blue"),transform:({red:e,green:n,blue:r,alpha:i=1})=>"rgba("+oy.transform(e)+", "+oy.transform(n)+", "+oy.transform(r)+", "+Gu(ac.transform(i))+")"};function KH(e){let n="",r="",i="",s="";return e.length>5?(n=e.substring(1,3),r=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(n=e.substring(1,2),r=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),n+=n,r+=r,i+=i,s+=s),{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const wv={test:O0("#"),parse:KH,transform:js.transform},Uo={test:O0("hsl","hue"),parse:xR("hue","saturation","lightness"),transform:({hue:e,saturation:n,lightness:r,alpha:i=1})=>"hsla("+Math.round(e)+", "+mi.transform(Gu(n))+", "+mi.transform(Gu(r))+", "+Gu(ac.transform(i))+")"},An={test:e=>js.test(e)||wv.test(e)||Uo.test(e),parse:e=>js.test(e)?js.parse(e):Uo.test(e)?Uo.parse(e):wv.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?js.transform(e):Uo.transform(e)},WH=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ZH(e){var n,r;return isNaN(e)&&typeof e=="string"&&(((n=e.match(D0))===null||n===void 0?void 0:n.length)||0)+(((r=e.match(WH))===null||r===void 0?void 0:r.length)||0)>0}const bR="number",wR="color",QH="var",JH="var(",l2="${}",eG=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function oc(e){const n=e.toString(),r=[],i={color:[],number:[],var:[]},s=[];let l=0;const d=n.replace(eG,h=>(An.test(h)?(i.color.push(l),s.push(wR),r.push(An.parse(h))):h.startsWith(JH)?(i.var.push(l),s.push(QH),r.push(h)):(i.number.push(l),s.push(bR),r.push(parseFloat(h))),++l,l2)).split(l2);return{values:r,split:d,indexes:i,types:s}}function SR(e){return oc(e).values}function _R(e){const{split:n,types:r}=oc(e),i=n.length;return s=>{let l="";for(let u=0;u<i;u++)if(l+=n[u],s[u]!==void 0){const d=r[u];d===bR?l+=Gu(s[u]):d===wR?l+=An.transform(s[u]):l+=s[u]}return l}}const tG=e=>typeof e=="number"?0:e;function nG(e){const n=SR(e);return _R(e)(n.map(tG))}const qa={test:ZH,parse:SR,createTransformer:_R,getAnimatableNone:nG},rG=new Set(["brightness","contrast","saturate","opacity"]);function iG(e){const[n,r]=e.slice(0,-1).split("(");if(n==="drop-shadow")return e;const[i]=r.match(D0)||[];if(!i)return e;const s=r.replace(i,"");let l=rG.has(n)?1:0;return i!==r&&(l*=100),n+"("+l+s+")"}const aG=/\b([a-z-]*)\(.*?\)/gu,Sv={...qa,getAnimatableNone:e=>{const n=e.match(aG);return n?n.map(iG).join(" "):e}},sG={...v0,color:An,backgroundColor:An,outlineColor:An,fill:An,stroke:An,borderColor:An,borderTopColor:An,borderRightColor:An,borderBottomColor:An,borderLeftColor:An,filter:Sv,WebkitFilter:Sv},z0=e=>sG[e];function CR(e,n){let r=z0(e);return r!==Sv&&(r=qa),r.getAnimatableNone?r.getAnimatableNone(n):void 0}const oG=new Set(["auto","none","0"]);function lG(e,n,r){let i=0,s;for(;i<e.length&&!s;){const l=e[i];typeof l=="string"&&!oG.has(l)&&oc(l).values.length&&(s=e[i]),i++}if(s&&r)for(const l of n)e[l]=CR(r,s)}const u2=e=>e===yl||e===Fe,c2=(e,n)=>parseFloat(e.split(", ")[n]),d2=(e,n)=>(r,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/u);if(s)return c2(s[1],n);{const l=i.match(/^matrix\((.+)\)$/u);return l?c2(l[1],e):0}},uG=new Set(["x","y","z"]),cG=gl.filter(e=>!uG.has(e));function dG(e){const n=[];return cG.forEach(r=>{const i=e.getValue(r);i!==void 0&&(n.push([r,i.get()]),i.set(r.startsWith("scale")?1:0))}),n}const al={width:({x:e},{paddingLeft:n="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(n)-parseFloat(r),height:({y:e},{paddingTop:n="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(n)-parseFloat(r),top:(e,{top:n})=>parseFloat(n),left:(e,{left:n})=>parseFloat(n),bottom:({y:e},{top:n})=>parseFloat(n)+(e.max-e.min),right:({x:e},{left:n})=>parseFloat(n)+(e.max-e.min),x:d2(4,13),y:d2(5,14)};al.translateX=al.x;al.translateY=al.y;const Ts=new Set;let _v=!1,Cv=!1;function jR(){if(Cv){const e=Array.from(Ts).filter(i=>i.needsMeasurement),n=new Set(e.map(i=>i.element)),r=new Map;n.forEach(i=>{const s=dG(i);s.length&&(r.set(i,s),i.render())}),e.forEach(i=>i.measureInitialState()),n.forEach(i=>{i.render();const s=r.get(i);s&&s.forEach(([l,u])=>{var d;(d=i.getValue(l))===null||d===void 0||d.set(u)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Cv=!1,_v=!1,Ts.forEach(e=>e.complete()),Ts.clear()}function kR(){Ts.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Cv=!0)})}function fG(){kR(),jR()}class P0{constructor(n,r,i,s,l,u=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...n],this.onComplete=r,this.name=i,this.motionValue=s,this.element=l,this.isAsync=u}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ts.add(this),_v||(_v=!0,Pt.read(kR),Pt.resolveKeyframes(jR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:r,element:i,motionValue:s}=this;for(let l=0;l<n.length;l++)if(n[l]===null)if(l===0){const u=s?.get(),d=n[n.length-1];if(u!==void 0)n[0]=u;else if(i&&r){const h=i.readValue(r,d);h!=null&&(n[0]=h)}n[0]===void 0&&(n[0]=d),s&&u===void 0&&s.set(n[0])}else n[l]=n[l-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ts.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ts.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ER=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),hG=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pG(e){const n=hG.exec(e);if(!n)return[,];const[,r,i,s]=n;return[`--${r??i}`,s]}function NR(e,n,r=1){const[i,s]=pG(e);if(!i)return;const l=window.getComputedStyle(n).getPropertyValue(i);if(l){const u=l.trim();return ER(u)?parseFloat(u):u}return y0(s)?NR(s,n,r+1):s}const TR=e=>n=>n.test(e),mG={test:e=>e==="auto",parse:e=>e},AR=[yl,Fe,mi,Ia,dH,cH,mG],f2=e=>AR.find(TR(e));class RR extends P0{constructor(n,r,i,s,l){super(n,r,i,s,l,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:r,name:i}=this;if(!r||!r.current)return;super.readKeyframes();for(let h=0;h<n.length;h++){let p=n[h];if(typeof p=="string"&&(p=p.trim(),y0(p))){const g=NR(p,r.current);g!==void 0&&(n[h]=g),h===n.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!iR.has(i)||n.length!==2)return;const[s,l]=n,u=f2(s),d=f2(l);if(u!==d)if(u2(u)&&u2(d))for(let h=0;h<n.length;h++){const p=n[h];typeof p=="string"&&(n[h]=parseFloat(p))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:r}=this,i=[];for(let s=0;s<n.length;s++)GH(n[s])&&i.push(s);i.length&&lG(n,i,r)}measureInitialState(){const{element:n,unresolvedKeyframes:r,name:i}=this;if(!n||!n.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=al[i](n.measureViewportBox(),window.getComputedStyle(n.current)),r[0]=this.measuredOrigin;const s=r[r.length-1];s!==void 0&&n.getValue(i,s).jump(s,!1)}measureEndState(){var n;const{element:r,name:i,unresolvedKeyframes:s}=this;if(!r||!r.current)return;const l=r.getValue(i);l&&l.jump(this.measuredOrigin,!1);const u=s.length-1,d=s[u];s[u]=al[i](r.measureViewportBox(),window.getComputedStyle(r.current)),d!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=d),!((n=this.removedTransforms)===null||n===void 0)&&n.length&&this.removedTransforms.forEach(([h,p])=>{r.getValue(h).set(p)}),this.resolveNoneKeyframes()}}const h2=(e,n)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qa.test(e)||e==="0")&&!e.startsWith("url("));function gG(e){const n=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==n)return!0}function yG(e,n,r,i){const s=e[0];if(s===null)return!1;if(n==="display"||n==="visibility")return!0;const l=e[e.length-1],u=h2(s,n),d=h2(l,n);return!u||!d?!1:gG(e)||(r==="spring"||T0(r))&&i}const vG=e=>e!==null;function np(e,{repeat:n,repeatType:r="loop"},i){const s=e.filter(vG),l=n&&r!=="loop"&&n%2===1?0:s.length-1;return!l||i===void 0?s[l]:i}const xG=40;class MR{constructor({autoplay:n=!0,delay:r=0,type:i="keyframes",repeat:s=0,repeatDelay:l=0,repeatType:u="loop",...d}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=gi.now(),this.options={autoplay:n,delay:r,type:i,repeat:s,repeatDelay:l,repeatType:u,...d},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>xG?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&fG(),this._resolved}onKeyframesResolved(n,r){this.resolvedAt=gi.now(),this.hasAttemptedResolve=!0;const{name:i,type:s,velocity:l,delay:u,onComplete:d,onUpdate:h,isGenerator:p}=this.options;if(!p&&!yG(n,i,s,l))if(u)this.options.duration=0;else{h&&h(np(n,this.options,r)),d&&d(),this.resolveFinishedPromise();return}const g=this.initPlayback(n,r);g!==!1&&(this._resolved={keyframes:n,finalKeyframe:r,...g},this.onPostResolved())}onPostResolved(){}then(n,r){return this.currentFinishedPromise.then(n,r)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(n=>{this.resolveFinishedPromise=n})}}const jv=2e4;function DR(e){let n=0;const r=50;let i=e.next(n);for(;!i.done&&n<jv;)n+=r,i=e.next(n);return n>=jv?1/0:n}const Bt=(e,n,r)=>e+(n-e)*r;function ly(e,n,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}function bG({hue:e,saturation:n,lightness:r,alpha:i}){e/=360,n/=100,r/=100;let s=0,l=0,u=0;if(!n)s=l=u=r;else{const d=r<.5?r*(1+n):r+n-r*n,h=2*r-d;s=ly(h,d,e+1/3),l=ly(h,d,e),u=ly(h,d,e-1/3)}return{red:Math.round(s*255),green:Math.round(l*255),blue:Math.round(u*255),alpha:i}}function rh(e,n){return r=>r>0?n:e}const uy=(e,n,r)=>{const i=e*e,s=r*(n*n-i)+i;return s<0?0:Math.sqrt(s)},wG=[wv,js,Uo],SG=e=>wG.find(n=>n.test(e));function p2(e){const n=SG(e);if(!n)return!1;let r=n.parse(e);return n===Uo&&(r=bG(r)),r}const m2=(e,n)=>{const r=p2(e),i=p2(n);if(!r||!i)return rh(e,n);const s={...r};return l=>(s.red=uy(r.red,i.red,l),s.green=uy(r.green,i.green,l),s.blue=uy(r.blue,i.blue,l),s.alpha=Bt(r.alpha,i.alpha,l),js.transform(s))},_G=(e,n)=>r=>n(e(r)),Nc=(...e)=>e.reduce(_G),kv=new Set(["none","hidden"]);function CG(e,n){return kv.has(e)?r=>r<=0?e:n:r=>r>=1?n:e}function jG(e,n){return r=>Bt(e,n,r)}function L0(e){return typeof e=="number"?jG:typeof e=="string"?y0(e)?rh:An.test(e)?m2:NG:Array.isArray(e)?OR:typeof e=="object"?An.test(e)?m2:kG:rh}function OR(e,n){const r=[...e],i=r.length,s=e.map((l,u)=>L0(l)(l,n[u]));return l=>{for(let u=0;u<i;u++)r[u]=s[u](l);return r}}function kG(e,n){const r={...e,...n},i={};for(const s in r)e[s]!==void 0&&n[s]!==void 0&&(i[s]=L0(e[s])(e[s],n[s]));return s=>{for(const l in i)r[l]=i[l](s);return r}}function EG(e,n){var r;const i=[],s={color:0,var:0,number:0};for(let l=0;l<n.values.length;l++){const u=n.types[l],d=e.indexes[u][s[u]],h=(r=e.values[d])!==null&&r!==void 0?r:0;i[l]=h,s[u]++}return i}const NG=(e,n)=>{const r=qa.createTransformer(n),i=oc(e),s=oc(n);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?kv.has(e)&&!s.values.length||kv.has(n)&&!i.values.length?CG(e,n):Nc(OR(EG(i,s),s.values),r):rh(e,n)};function zR(e,n,r){return typeof e=="number"&&typeof n=="number"&&typeof r=="number"?Bt(e,n,r):L0(e)(e,n)}const TG=5;function PR(e,n,r){const i=Math.max(n-TG,0);return aR(r-e(i),n-i)}const Gt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},cy=.001;function AG({duration:e=Gt.duration,bounce:n=Gt.bounce,velocity:r=Gt.velocity,mass:i=Gt.mass}){let s,l,u=1-n;u=ia(Gt.minDamping,Gt.maxDamping,u),e=ia(Gt.minDuration,Gt.maxDuration,ea(e)),u<1?(s=p=>{const g=p*u,y=g*e,v=g-r,x=Ev(p,u),_=Math.exp(-y);return cy-v/x*_},l=p=>{const y=p*u*e,v=y*r+r,x=Math.pow(u,2)*Math.pow(p,2)*e,_=Math.exp(-y),C=Ev(Math.pow(p,2),u);return(-s(p)+cy>0?-1:1)*((v-x)*_)/C}):(s=p=>{const g=Math.exp(-p*e),y=(p-r)*e+1;return-cy+g*y},l=p=>{const g=Math.exp(-p*e),y=(r-p)*(e*e);return g*y});const d=5/e,h=MG(s,l,d);if(e=Ji(e),isNaN(h))return{stiffness:Gt.stiffness,damping:Gt.damping,duration:e};{const p=Math.pow(h,2)*i;return{stiffness:p,damping:u*2*Math.sqrt(i*p),duration:e}}}const RG=12;function MG(e,n,r){let i=r;for(let s=1;s<RG;s++)i=i-e(i)/n(i);return i}function Ev(e,n){return e*Math.sqrt(1-n*n)}const DG=["duration","bounce"],OG=["stiffness","damping","mass"];function g2(e,n){return n.some(r=>e[r]!==void 0)}function zG(e){let n={velocity:Gt.velocity,stiffness:Gt.stiffness,damping:Gt.damping,mass:Gt.mass,isResolvedFromDuration:!1,...e};if(!g2(e,OG)&&g2(e,DG))if(e.visualDuration){const r=e.visualDuration,i=2*Math.PI/(r*1.2),s=i*i,l=2*ia(.05,1,1-(e.bounce||0))*Math.sqrt(s);n={...n,mass:Gt.mass,stiffness:s,damping:l}}else{const r=AG(e);n={...n,...r,mass:Gt.mass},n.isResolvedFromDuration=!0}return n}function LR(e=Gt.visualDuration,n=Gt.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:n}:e;let{restSpeed:i,restDelta:s}=r;const l=r.keyframes[0],u=r.keyframes[r.keyframes.length-1],d={done:!1,value:l},{stiffness:h,damping:p,mass:g,duration:y,velocity:v,isResolvedFromDuration:x}=zG({...r,velocity:-ea(r.velocity||0)}),_=v||0,C=p/(2*Math.sqrt(h*g)),k=u-l,j=ea(Math.sqrt(h/g)),E=Math.abs(k)<5;i||(i=E?Gt.restSpeed.granular:Gt.restSpeed.default),s||(s=E?Gt.restDelta.granular:Gt.restDelta.default);let N;if(C<1){const R=Ev(j,C);N=z=>{const P=Math.exp(-C*j*z);return u-P*((_+C*j*k)/R*Math.sin(R*z)+k*Math.cos(R*z))}}else if(C===1)N=R=>u-Math.exp(-j*R)*(k+(_+j*k)*R);else{const R=j*Math.sqrt(C*C-1);N=z=>{const P=Math.exp(-C*j*z),D=Math.min(R*z,300);return u-P*((_+C*j*k)*Math.sinh(D)+R*k*Math.cosh(D))/R}}const M={calculatedDuration:x&&y||null,next:R=>{const z=N(R);if(x)d.done=R>=y;else{let P=0;C<1&&(P=R===0?Ji(_):PR(N,R,z));const D=Math.abs(P)<=i,$=Math.abs(u-z)<=s;d.done=D&&$}return d.value=d.done?u:z,d},toString:()=>{const R=Math.min(DR(M),jv),z=oR(P=>M.next(R*P).value,R,30);return R+"ms "+z}};return M}function y2({keyframes:e,velocity:n=0,power:r=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:l=500,modifyTarget:u,min:d,max:h,restDelta:p=.5,restSpeed:g}){const y=e[0],v={done:!1,value:y},x=D=>d!==void 0&&D<d||h!==void 0&&D>h,_=D=>d===void 0?h:h===void 0||Math.abs(d-D)<Math.abs(h-D)?d:h;let C=r*n;const k=y+C,j=u===void 0?k:u(k);j!==k&&(C=j-y);const E=D=>-C*Math.exp(-D/i),N=D=>j+E(D),M=D=>{const $=E(D),U=N(D);v.done=Math.abs($)<=p,v.value=v.done?j:U};let R,z;const P=D=>{x(v.value)&&(R=D,z=LR({keyframes:[v.value,_(v.value)],velocity:PR(N,D,v.value),damping:s,stiffness:l,restDelta:p,restSpeed:g}))};return P(0),{calculatedDuration:null,next:D=>{let $=!1;return!z&&R===void 0&&($=!0,M(D),P(D)),R!==void 0&&D>=R?z.next(D-R):(!$&&M(D),v)}}}const PG=Ec(.42,0,1,1),LG=Ec(0,0,.58,1),IR=Ec(.42,0,.58,1),IG=e=>Array.isArray(e)&&typeof e[0]!="number",VG={linear:fr,easeIn:PG,easeInOut:IR,easeOut:LG,circIn:M0,circInOut:yR,circOut:gR,backIn:R0,backInOut:pR,backOut:hR,anticipate:mR},v2=e=>{if(A0(e)){IA(e.length===4);const[n,r,i,s]=e;return Ec(n,r,i,s)}else if(typeof e=="string")return VG[e];return e};function FG(e,n,r){const i=[],s=r||zR,l=e.length-1;for(let u=0;u<l;u++){let d=s(e[u],e[u+1]);if(n){const h=Array.isArray(n)?n[u]||fr:n;d=Nc(h,d)}i.push(d)}return i}function UG(e,n,{clamp:r=!0,ease:i,mixer:s}={}){const l=e.length;if(IA(l===n.length),l===1)return()=>n[0];if(l===2&&n[0]===n[1])return()=>n[1];const u=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const d=FG(n,i,s),h=d.length,p=g=>{if(u&&g<e[0])return n[0];let y=0;if(h>1)for(;y<e.length-2&&!(g<e[y+1]);y++);const v=il(e[y],e[y+1],g);return d[y](v)};return r?g=>p(ia(e[0],e[l-1],g)):p}function BG(e,n){const r=e[e.length-1];for(let i=1;i<=n;i++){const s=il(0,n,i);e.push(Bt(r,1,s))}}function $G(e){const n=[0];return BG(n,e.length-1),n}function HG(e,n){return e.map(r=>r*n)}function GG(e,n){return e.map(()=>n||IR).splice(0,e.length-1)}function ih({duration:e=300,keyframes:n,times:r,ease:i="easeInOut"}){const s=IG(i)?i.map(v2):v2(i),l={done:!1,value:n[0]},u=HG(r&&r.length===n.length?r:$G(n),e),d=UG(u,n,{ease:Array.isArray(s)?s:GG(n,s)});return{calculatedDuration:e,next:h=>(l.value=d(h),l.done=h>=e,l)}}const qG=e=>{const n=({timestamp:r})=>e(r);return{start:()=>Pt.update(n,!0),stop:()=>Ga(n),now:()=>Sn.isProcessing?Sn.timestamp:gi.now()}},YG={decay:y2,inertia:y2,tween:ih,keyframes:ih,spring:LR},XG=e=>e/100;class I0 extends MR{constructor(n){super(n),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:h}=this.options;h&&h()};const{name:r,motionValue:i,element:s,keyframes:l}=this.options,u=s?.KeyframeResolver||P0,d=(h,p)=>this.onKeyframesResolved(h,p);this.resolver=new u(l,d,r,i,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(n){const{type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:l,velocity:u=0}=this.options,d=T0(r)?r:YG[r]||ih;let h,p;d!==ih&&typeof n[0]!="number"&&(h=Nc(XG,zR(n[0],n[1])),n=[0,100]);const g=d({...this.options,keyframes:n});l==="mirror"&&(p=d({...this.options,keyframes:[...n].reverse(),velocity:-u})),g.calculatedDuration===null&&(g.calculatedDuration=DR(g));const{calculatedDuration:y}=g,v=y+s,x=v*(i+1)-s;return{generator:g,mirroredGenerator:p,mapPercentToKeyframes:h,calculatedDuration:y,resolvedDuration:v,totalDuration:x}}onPostResolved(){const{autoplay:n=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!n?this.pause():this.state=this.pendingPlayState}tick(n,r=!1){const{resolved:i}=this;if(!i){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:s,generator:l,mirroredGenerator:u,mapPercentToKeyframes:d,keyframes:h,calculatedDuration:p,totalDuration:g,resolvedDuration:y}=i;if(this.startTime===null)return l.next(0);const{delay:v,repeat:x,repeatType:_,repeatDelay:C,onUpdate:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-g/this.speed,this.startTime)),r?this.currentTime=n:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(n-this.startTime)*this.speed;const j=this.currentTime-v*(this.speed>=0?1:-1),E=this.speed>=0?j<0:j>g;this.currentTime=Math.max(j,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let N=this.currentTime,M=l;if(x){const D=Math.min(this.currentTime,g)/y;let $=Math.floor(D),U=D%1;!U&&D>=1&&(U=1),U===1&&$--,$=Math.min($,x+1),$%2&&(_==="reverse"?(U=1-U,C&&(U-=C/y)):_==="mirror"&&(M=u)),N=ia(0,1,U)*y}const R=E?{done:!1,value:h[0]}:M.next(N);d&&(R.value=d(R.value));let{done:z}=R;!E&&p!==null&&(z=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&z);return P&&s!==void 0&&(R.value=np(h,this.options,s)),k&&k(R.value),P&&this.finish(),R}get duration(){const{resolved:n}=this;return n?ea(n.calculatedDuration):0}get time(){return ea(this.currentTime)}set time(n){n=Ji(n),this.currentTime=n,this.holdTime!==null||this.speed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.speed)}get speed(){return this.playbackSpeed}set speed(n){const r=this.playbackSpeed!==n;this.playbackSpeed=n,r&&(this.time=ea(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:n=qG,onPlay:r,startTime:i}=this.options;this.driver||(this.driver=n(l=>this.tick(l))),r&&r();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var n;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(n=this.currentTime)!==null&&n!==void 0?n:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:n}=this.options;n&&n()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}}const KG=new Set(["opacity","clipPath","filter","transform"]);function WG(e,n,r,{delay:i=0,duration:s=300,repeat:l=0,repeatType:u="loop",ease:d="easeInOut",times:h}={}){const p={[n]:r};h&&(p.offset=h);const g=uR(d,s);return Array.isArray(g)&&(p.easing=g),e.animate(p,{delay:i,duration:s,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:l+1,direction:u==="reverse"?"alternate":"normal"})}const ZG=N0(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ah=10,QG=2e4;function JG(e){return T0(e.type)||e.type==="spring"||!lR(e.ease)}function eq(e,n){const r=new I0({...n,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const s=[];let l=0;for(;!i.done&&l<QG;)i=r.sample(l),s.push(i.value),l+=ah;return{times:void 0,keyframes:s,duration:l-ah,ease:"linear"}}const VR={anticipate:mR,backInOut:pR,circInOut:yR};function tq(e){return e in VR}class x2 extends MR{constructor(n){super(n);const{name:r,motionValue:i,element:s,keyframes:l}=this.options;this.resolver=new RR(l,(u,d)=>this.onKeyframesResolved(u,d),r,i,s),this.resolver.scheduleResolve()}initPlayback(n,r){let{duration:i=300,times:s,ease:l,type:u,motionValue:d,name:h,startTime:p}=this.options;if(!d.owner||!d.owner.current)return!1;if(typeof l=="string"&&nh()&&tq(l)&&(l=VR[l]),JG(this.options)){const{onComplete:y,onUpdate:v,motionValue:x,element:_,...C}=this.options,k=eq(n,C);n=k.keyframes,n.length===1&&(n[1]=n[0]),i=k.duration,s=k.times,l=k.ease,u="keyframes"}const g=WG(d.owner.current,h,n,{...this.options,duration:i,times:s,ease:l});return g.startTime=p??this.calcStartTime(),this.pendingTimeline?(o2(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:y}=this.options;d.set(np(n,this.options,r)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:i,times:s,type:u,ease:l,keyframes:n}}get duration(){const{resolved:n}=this;if(!n)return 0;const{duration:r}=n;return ea(r)}get time(){const{resolved:n}=this;if(!n)return 0;const{animation:r}=n;return ea(r.currentTime||0)}set time(n){const{resolved:r}=this;if(!r)return;const{animation:i}=r;i.currentTime=Ji(n)}get speed(){const{resolved:n}=this;if(!n)return 1;const{animation:r}=n;return r.playbackRate}set speed(n){const{resolved:r}=this;if(!r)return;const{animation:i}=r;i.playbackRate=n}get state(){const{resolved:n}=this;if(!n)return"idle";const{animation:r}=n;return r.playState}get startTime(){const{resolved:n}=this;if(!n)return null;const{animation:r}=n;return r.startTime}attachTimeline(n){if(!this._resolved)this.pendingTimeline=n;else{const{resolved:r}=this;if(!r)return fr;const{animation:i}=r;o2(i,n)}return fr}play(){if(this.isStopped)return;const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:n}=this;if(!n)return;const{animation:r,keyframes:i,duration:s,type:l,ease:u,times:d}=n;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:p,onUpdate:g,onComplete:y,element:v,...x}=this.options,_=new I0({...x,keyframes:i,duration:s,type:l,ease:u,times:d,isGenerator:!0}),C=Ji(this.time);p.setWithVelocity(_.sample(C-ah).value,_.sample(C).value,ah)}const{onStop:h}=this.options;h&&h(),this.cancel()}complete(){const{resolved:n}=this;n&&n.animation.finish()}cancel(){const{resolved:n}=this;n&&n.animation.cancel()}static supports(n){const{motionValue:r,name:i,repeatDelay:s,repeatType:l,damping:u,type:d}=n;if(!r||!r.owner||!(r.owner.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:p}=r.owner.getProps();return ZG()&&i&&KG.has(i)&&!h&&!p&&!s&&l!=="mirror"&&u!==0&&d!=="inertia"}}const nq={type:"spring",stiffness:500,damping:25,restSpeed:10},rq=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iq={type:"keyframes",duration:.8},aq={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sq=(e,{keyframes:n})=>n.length>2?iq:Hs.has(e)?e.startsWith("scale")?rq(n[1]):nq:aq;function oq({when:e,delay:n,delayChildren:r,staggerChildren:i,staggerDirection:s,repeat:l,repeatType:u,repeatDelay:d,from:h,elapsed:p,...g}){return!!Object.keys(g).length}const V0=(e,n,r,i={},s,l)=>u=>{const d=C0(i,e)||{},h=d.delay||i.delay||0;let{elapsed:p=0}=i;p=p-Ji(h);let g={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:n.getVelocity(),...d,delay:-p,onUpdate:v=>{n.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{u(),d.onComplete&&d.onComplete()},name:e,motionValue:n,element:l?void 0:s};oq(d)||(g={...g,...sq(e,g)}),g.duration&&(g.duration=Ji(g.duration)),g.repeatDelay&&(g.repeatDelay=Ji(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(y=!0)),y&&!l&&n.get()!==void 0){const v=np(g.keyframes,d);if(v!==void 0)return Pt.update(()=>{g.onUpdate(v),g.onComplete()}),new VH([])}return!l&&x2.supports(g)?new x2(g):new I0(g)};function lq({protectedKeys:e,needsAnimating:n},r){const i=e.hasOwnProperty(r)&&n[r]!==!0;return n[r]=!1,i}function FR(e,n,{delay:r=0,transitionOverride:i,type:s}={}){var l;let{transition:u=e.getDefaultTransition(),transitionEnd:d,...h}=n;i&&(u=i);const p=[],g=s&&e.animationState&&e.animationState.getState()[s];for(const y in h){const v=e.getValue(y,(l=e.latestValues[y])!==null&&l!==void 0?l:null),x=h[y];if(x===void 0||g&&lq(g,y))continue;const _={delay:r,...C0(u||{},y)};let C=!1;if(window.MotionHandoffAnimation){const j=sR(e);if(j){const E=window.MotionHandoffAnimation(j,y,Pt);E!==null&&(_.startTime=E,C=!0)}}xv(e,y),v.start(V0(y,v,x,e.shouldReduceMotion&&iR.has(y)?{type:!1}:_,e,C));const k=v.animation;k&&p.push(k)}return d&&Promise.all(p).then(()=>{Pt.update(()=>{d&&zH(e,d)})}),p}function Nv(e,n,r={}){var i;const s=tp(e,n,r.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:l=e.getDefaultTransition()||{}}=s||{};r.transitionOverride&&(l=r.transitionOverride);const u=s?()=>Promise.all(FR(e,s,r)):()=>Promise.resolve(),d=e.variantChildren&&e.variantChildren.size?(p=0)=>{const{delayChildren:g=0,staggerChildren:y,staggerDirection:v}=l;return uq(e,n,g+p,y,v,r)}:()=>Promise.resolve(),{when:h}=l;if(h){const[p,g]=h==="beforeChildren"?[u,d]:[d,u];return p().then(()=>g())}else return Promise.all([u(),d(r.delay)])}function uq(e,n,r=0,i=0,s=1,l){const u=[],d=(e.variantChildren.size-1)*i,h=s===1?(p=0)=>p*i:(p=0)=>d-p*i;return Array.from(e.variantChildren).sort(cq).forEach((p,g)=>{p.notify("AnimationStart",n),u.push(Nv(p,n,{...l,delay:r+h(g)}).then(()=>p.notify("AnimationComplete",n)))}),Promise.all(u)}function cq(e,n){return e.sortNodePosition(n)}function dq(e,n,r={}){e.notify("AnimationStart",n);let i;if(Array.isArray(n)){const s=n.map(l=>Nv(e,l,r));i=Promise.all(s)}else if(typeof n=="string")i=Nv(e,n,r);else{const s=typeof n=="function"?tp(e,n,r.custom):n;i=Promise.all(FR(e,s,r))}return i.then(()=>{e.notify("AnimationComplete",n)})}const fq=f0.length;function UR(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?UR(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const n={};for(let r=0;r<fq;r++){const i=f0[r],s=e.props[i];(ic(s)||s===!1)&&(n[i]=s)}return n}const hq=[...d0].reverse(),pq=d0.length;function mq(e){return n=>Promise.all(n.map(({animation:r,options:i})=>dq(e,r,i)))}function gq(e){let n=mq(e),r=b2(),i=!0;const s=h=>(p,g)=>{var y;const v=tp(e,g,h==="exit"?(y=e.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(v){const{transition:x,transitionEnd:_,...C}=v;p={...p,...C,..._}}return p};function l(h){n=h(e)}function u(h){const{props:p}=e,g=UR(e.parent)||{},y=[],v=new Set;let x={},_=1/0;for(let k=0;k<pq;k++){const j=hq[k],E=r[j],N=p[j]!==void 0?p[j]:g[j],M=ic(N),R=j===h?E.isActive:null;R===!1&&(_=k);let z=N===g[j]&&N!==p[j]&&M;if(z&&i&&e.manuallyAnimateOnMount&&(z=!1),E.protectedKeys={...x},!E.isActive&&R===null||!N&&!E.prevProp||Jh(N)||typeof N=="boolean")continue;const P=yq(E.prevProp,N);let D=P||j===h&&E.isActive&&!z&&M||k>_&&M,$=!1;const U=Array.isArray(N)?N:[N];let X=U.reduce(s(j),{});R===!1&&(X={});const{prevResolvedValues:K={}}=E,ae={...K,...X},B=q=>{D=!0,v.has(q)&&($=!0,v.delete(q)),E.needsAnimating[q]=!0;const I=e.getValue(q);I&&(I.liveStyle=!1)};for(const q in ae){const I=X[q],H=K[q];if(x.hasOwnProperty(q))continue;let A=!1;vv(I)&&vv(H)?A=!rR(I,H):A=I!==H,A?I!=null?B(q):v.add(q):I!==void 0&&v.has(q)?B(q):E.protectedKeys[q]=!0}E.prevProp=N,E.prevResolvedValues=X,E.isActive&&(x={...x,...X}),i&&e.blockInitialAnimation&&(D=!1),D&&(!(z&&P)||$)&&y.push(...U.map(q=>({animation:q,options:{type:j}})))}if(v.size){const k={};v.forEach(j=>{const E=e.getBaseTarget(j),N=e.getValue(j);N&&(N.liveStyle=!0),k[j]=E??null}),y.push({animation:k})}let C=!!y.length;return i&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(C=!1),i=!1,C?n(y):Promise.resolve()}function d(h,p){var g;if(r[h].isActive===p)return Promise.resolve();(g=e.variantChildren)===null||g===void 0||g.forEach(v=>{var x;return(x=v.animationState)===null||x===void 0?void 0:x.setActive(h,p)}),r[h].isActive=p;const y=u(h);for(const v in r)r[v].protectedKeys={};return y}return{animateChanges:u,setActive:d,setAnimateFunction:l,getState:()=>r,reset:()=>{r=b2(),i=!0}}}function yq(e,n){return typeof n=="string"?n!==e:Array.isArray(n)?!rR(n,e):!1}function xs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function b2(){return{animate:xs(!0),whileInView:xs(),whileHover:xs(),whileTap:xs(),whileDrag:xs(),whileFocus:xs(),exit:xs()}}class Za{constructor(n){this.isMounted=!1,this.node=n}update(){}}class vq extends Za{constructor(n){super(n),n.animationState||(n.animationState=gq(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();Jh(n)&&(this.unmountControls=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:r}=this.node.prevProps||{};n!==r&&this.updateAnimationControlsSubscription()}unmount(){var n;this.node.animationState.reset(),(n=this.unmountControls)===null||n===void 0||n.call(this)}}let xq=0;class bq extends Za{constructor(){super(...arguments),this.id=xq++}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===i)return;const s=this.node.animationState.setActive("exit",!n);r&&!n&&s.then(()=>r(this.id))}mount(){const{register:n}=this.node.presenceContext||{};n&&(this.unmount=n(this.id))}unmount(){}}const wq={animation:{Feature:vq},exit:{Feature:bq}},Br={x:!1,y:!1};function BR(){return Br.x||Br.y}function Sq(e){return e==="x"||e==="y"?Br[e]?null:(Br[e]=!0,()=>{Br[e]=!1}):Br.x||Br.y?null:(Br.x=Br.y=!0,()=>{Br.x=Br.y=!1})}const F0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function lc(e,n,r,i={passive:!0}){return e.addEventListener(n,r,i),()=>e.removeEventListener(n,r)}function Tc(e){return{point:{x:e.pageX,y:e.pageY}}}const _q=e=>n=>F0(n)&&e(n,Tc(n));function qu(e,n,r,i){return lc(e,n,_q(r),i)}const w2=(e,n)=>Math.abs(e-n);function Cq(e,n){const r=w2(e.x,n.x),i=w2(e.y,n.y);return Math.sqrt(r**2+i**2)}class $R{constructor(n,r,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:l=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=fy(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,x=Cq(y.offset,{x:0,y:0})>=3;if(!v&&!x)return;const{point:_}=y,{timestamp:C}=Sn;this.history.push({..._,timestamp:C});const{onStart:k,onMove:j}=this.handlers;v||(k&&k(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),j&&j(this.lastMoveEvent,y)},this.handlePointerMove=(y,v)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=dy(v,this.transformPagePoint),Pt.update(this.updatePoint,!0)},this.handlePointerUp=(y,v)=>{this.end();const{onEnd:x,onSessionEnd:_,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=fy(y.type==="pointercancel"?this.lastMoveEventInfo:dy(v,this.transformPagePoint),this.history);this.startEvent&&x&&x(y,k),_&&_(y,k)},!F0(n))return;this.dragSnapToOrigin=l,this.handlers=r,this.transformPagePoint=i,this.contextWindow=s||window;const u=Tc(n),d=dy(u,this.transformPagePoint),{point:h}=d,{timestamp:p}=Sn;this.history=[{...h,timestamp:p}];const{onSessionStart:g}=r;g&&g(n,fy(d,this.history)),this.removeListeners=Nc(qu(this.contextWindow,"pointermove",this.handlePointerMove),qu(this.contextWindow,"pointerup",this.handlePointerUp),qu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),Ga(this.updatePoint)}}function dy(e,n){return n?{point:n(e.point)}:e}function S2(e,n){return{x:e.x-n.x,y:e.y-n.y}}function fy({point:e},n){return{point:e,delta:S2(e,HR(n)),offset:S2(e,jq(n)),velocity:kq(n,.1)}}function jq(e){return e[0]}function HR(e){return e[e.length-1]}function kq(e,n){if(e.length<2)return{x:0,y:0};let r=e.length-1,i=null;const s=HR(e);for(;r>=0&&(i=e[r],!(s.timestamp-i.timestamp>Ji(n)));)r--;if(!i)return{x:0,y:0};const l=ea(s.timestamp-i.timestamp);if(l===0)return{x:0,y:0};const u={x:(s.x-i.x)/l,y:(s.y-i.y)/l};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}const GR=1e-4,Eq=1-GR,Nq=1+GR,qR=.01,Tq=0-qR,Aq=0+qR;function pr(e){return e.max-e.min}function Rq(e,n,r){return Math.abs(e-n)<=r}function _2(e,n,r,i=.5){e.origin=i,e.originPoint=Bt(n.min,n.max,e.origin),e.scale=pr(r)/pr(n),e.translate=Bt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=Eq&&e.scale<=Nq||isNaN(e.scale))&&(e.scale=1),(e.translate>=Tq&&e.translate<=Aq||isNaN(e.translate))&&(e.translate=0)}function Yu(e,n,r,i){_2(e.x,n.x,r.x,i?i.originX:void 0),_2(e.y,n.y,r.y,i?i.originY:void 0)}function C2(e,n,r){e.min=r.min+n.min,e.max=e.min+pr(n)}function Mq(e,n,r){C2(e.x,n.x,r.x),C2(e.y,n.y,r.y)}function j2(e,n,r){e.min=n.min-r.min,e.max=e.min+pr(n)}function Xu(e,n,r){j2(e.x,n.x,r.x),j2(e.y,n.y,r.y)}function Dq(e,{min:n,max:r},i){return n!==void 0&&e<n?e=i?Bt(n,e,i.min):Math.max(e,n):r!==void 0&&e>r&&(e=i?Bt(r,e,i.max):Math.min(e,r)),e}function k2(e,n,r){return{min:n!==void 0?e.min+n:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function Oq(e,{top:n,left:r,bottom:i,right:s}){return{x:k2(e.x,r,s),y:k2(e.y,n,i)}}function E2(e,n){let r=n.min-e.min,i=n.max-e.max;return n.max-n.min<e.max-e.min&&([r,i]=[i,r]),{min:r,max:i}}function zq(e,n){return{x:E2(e.x,n.x),y:E2(e.y,n.y)}}function Pq(e,n){let r=.5;const i=pr(e),s=pr(n);return s>i?r=il(n.min,n.max-i,e.min):i>s&&(r=il(e.min,e.max-s,n.min)),ia(0,1,r)}function Lq(e,n){const r={};return n.min!==void 0&&(r.min=n.min-e.min),n.max!==void 0&&(r.max=n.max-e.min),r}const Tv=.35;function Iq(e=Tv){return e===!1?e=0:e===!0&&(e=Tv),{x:N2(e,"left","right"),y:N2(e,"top","bottom")}}function N2(e,n,r){return{min:T2(e,n),max:T2(e,r)}}function T2(e,n){return typeof e=="number"?e:e[n]||0}const A2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bo=()=>({x:A2(),y:A2()}),R2=()=>({min:0,max:0}),tn=()=>({x:R2(),y:R2()});function Nr(e){return[e("x"),e("y")]}function YR({top:e,left:n,right:r,bottom:i}){return{x:{min:n,max:r},y:{min:e,max:i}}}function Vq({x:e,y:n}){return{top:n.min,right:e.max,bottom:n.max,left:e.min}}function Fq(e,n){if(!n)return e;const r=n({x:e.left,y:e.top}),i=n({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:i.y,right:i.x}}function hy(e){return e===void 0||e===1}function Av({scale:e,scaleX:n,scaleY:r}){return!hy(e)||!hy(n)||!hy(r)}function ws(e){return Av(e)||XR(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function XR(e){return M2(e.x)||M2(e.y)}function M2(e){return e&&e!=="0%"}function sh(e,n,r){const i=e-r,s=n*i;return r+s}function D2(e,n,r,i,s){return s!==void 0&&(e=sh(e,s,i)),sh(e,r,i)+n}function Rv(e,n=0,r=1,i,s){e.min=D2(e.min,n,r,i,s),e.max=D2(e.max,n,r,i,s)}function KR(e,{x:n,y:r}){Rv(e.x,n.translate,n.scale,n.originPoint),Rv(e.y,r.translate,r.scale,r.originPoint)}const O2=.999999999999,z2=1.0000000000001;function Uq(e,n,r,i=!1){const s=r.length;if(!s)return;n.x=n.y=1;let l,u;for(let d=0;d<s;d++){l=r[d],u=l.projectionDelta;const{visualElement:h}=l.options;h&&h.props.style&&h.props.style.display==="contents"||(i&&l.options.layoutScroll&&l.scroll&&l!==l.root&&Ho(e,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),u&&(n.x*=u.x.scale,n.y*=u.y.scale,KR(e,u)),i&&ws(l.latestValues)&&Ho(e,l.latestValues))}n.x<z2&&n.x>O2&&(n.x=1),n.y<z2&&n.y>O2&&(n.y=1)}function $o(e,n){e.min=e.min+n,e.max=e.max+n}function P2(e,n,r,i,s=.5){const l=Bt(e.min,e.max,s);Rv(e,n,r,l,i)}function Ho(e,n){P2(e.x,n.x,n.scaleX,n.scale,n.originX),P2(e.y,n.y,n.scaleY,n.scale,n.originY)}function WR(e,n){return YR(Fq(e.getBoundingClientRect(),n))}function Bq(e,n,r){const i=WR(e,r),{scroll:s}=n;return s&&($o(i.x,s.offset.x),$o(i.y,s.offset.y)),i}const ZR=({current:e})=>e?e.ownerDocument.defaultView:null,$q=new WeakMap;class Hq{constructor(n){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=tn(),this.visualElement=n}start(n,{snapToCursor:r=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=g=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Tc(g).point)},l=(g,y)=>{const{drag:v,dragPropagation:x,onDragStart:_}=this.getProps();if(v&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Sq(v),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nr(k=>{let j=this.getAxisMotionValue(k).get()||0;if(mi.test(j)){const{projection:E}=this.visualElement;if(E&&E.layout){const N=E.layout.layoutBox[k];N&&(j=pr(N)*(parseFloat(j)/100))}}this.originPoint[k]=j}),_&&Pt.postRender(()=>_(g,y)),xv(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},u=(g,y)=>{const{dragPropagation:v,dragDirectionLock:x,onDirectionLock:_,onDrag:C}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:k}=y;if(x&&this.currentDirection===null){this.currentDirection=Gq(k),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",y.point,k),this.updateAxis("y",y.point,k),this.visualElement.render(),C&&C(g,y)},d=(g,y)=>this.stop(g,y),h=()=>Nr(g=>{var y;return this.getAnimationState(g)==="paused"&&((y=this.getAxisMotionValue(g).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new $R(n,{onSessionStart:s,onStart:l,onMove:u,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:ZR(this.visualElement)})}stop(n,r){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:l}=this.getProps();l&&Pt.postRender(()=>l(n,r))}cancel(){this.isDragging=!1;const{projection:n,animationState:r}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(n,r,i){const{drag:s}=this.getProps();if(!i||!xf(n,s,this.currentDirection))return;const l=this.getAxisMotionValue(n);let u=this.originPoint[n]+i[n];this.constraints&&this.constraints[n]&&(u=Dq(u,this.constraints[n],this.elastic[n])),l.set(u)}resolveConstraints(){var n;const{dragConstraints:r,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(n=this.visualElement.projection)===null||n===void 0?void 0:n.layout,l=this.constraints;r&&Fo(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&s?this.constraints=Oq(s.layoutBox,r):this.constraints=!1,this.elastic=Iq(i),l!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Nr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=Lq(s.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:r}=this.getProps();if(!n||!Fo(n))return!1;const i=n.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const l=Bq(i,s.root,this.visualElement.getTransformPagePoint());let u=zq(s.layout.layoutBox,l);if(r){const d=r(Vq(u));this.hasMutatedConstraints=!!d,d&&(u=YR(d))}return u}startAnimation(n){const{drag:r,dragMomentum:i,dragElastic:s,dragTransition:l,dragSnapToOrigin:u,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},p=Nr(g=>{if(!xf(g,r,this.currentDirection))return;let y=h&&h[g]||{};u&&(y={min:0,max:0});const v=s?200:1e6,x=s?40:1e7,_={type:"inertia",velocity:i?n[g]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...l,...y};return this.startAxisValueAnimation(g,_)});return Promise.all(p).then(d)}startAxisValueAnimation(n,r){const i=this.getAxisMotionValue(n);return xv(this.visualElement,n),i.start(V0(n,i,0,r,this.visualElement,!1))}stopAnimation(){Nr(n=>this.getAxisMotionValue(n).stop())}pauseAnimation(){Nr(n=>{var r;return(r=this.getAxisMotionValue(n).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(n){var r;return(r=this.getAxisMotionValue(n).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(n){const r=`_drag${n.toUpperCase()}`,i=this.visualElement.getProps(),s=i[r];return s||this.visualElement.getValue(n,(i.initial?i.initial[n]:void 0)||0)}snapToCursor(n){Nr(r=>{const{drag:i}=this.getProps();if(!xf(r,i,this.currentDirection))return;const{projection:s}=this.visualElement,l=this.getAxisMotionValue(r);if(s&&s.layout){const{min:u,max:d}=s.layout.layoutBox[r];l.set(n[r]-Bt(u,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Fo(r)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Nr(u=>{const d=this.getAxisMotionValue(u);if(d&&this.constraints!==!1){const h=d.get();s[u]=Pq({min:h,max:h},this.constraints[u])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Nr(u=>{if(!xf(u,n,null))return;const d=this.getAxisMotionValue(u),{min:h,max:p}=this.constraints[u];d.set(Bt(h,p,s[u]))})}addListeners(){if(!this.visualElement.current)return;$q.set(this.visualElement,this);const n=this.visualElement.current,r=qu(n,"pointerdown",h=>{const{drag:p,dragListener:g=!0}=this.getProps();p&&g&&this.start(h)}),i=()=>{const{dragConstraints:h}=this.getProps();Fo(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,l=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Pt.read(i);const u=lc(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(Nr(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=h[g].translate,y.set(y.get()+h[g].translate))}),this.visualElement.render())}));return()=>{u(),r(),l(),d&&d()}}getProps(){const n=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:l=!1,dragElastic:u=Tv,dragMomentum:d=!0}=n;return{...n,drag:r,dragDirectionLock:i,dragPropagation:s,dragConstraints:l,dragElastic:u,dragMomentum:d}}}function xf(e,n,r){return(n===!0||n===e)&&(r===null||r===e)}function Gq(e,n=10){let r=null;return Math.abs(e.y)>n?r="y":Math.abs(e.x)>n&&(r="x"),r}class qq extends Za{constructor(n){super(n),this.removeGroupControls=fr,this.removeListeners=fr,this.controls=new Hq(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fr}unmount(){this.removeGroupControls(),this.removeListeners()}}const L2=e=>(n,r)=>{e&&Pt.postRender(()=>e(n,r))};class Yq extends Za{constructor(){super(...arguments),this.removePointerDownListener=fr}onPointerDown(n){this.session=new $R(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ZR(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:r,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:L2(n),onStart:L2(r),onMove:i,onEnd:(l,u)=>{delete this.session,s&&Pt.postRender(()=>s(l,u))}}}mount(){this.removePointerDownListener=qu(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Df={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function I2(e,n){return n.max===n.min?0:e/(n.max-n.min)*100}const xu={correct:(e,n)=>{if(!n.target)return e;if(typeof e=="string")if(Fe.test(e))e=parseFloat(e);else return e;const r=I2(e,n.target.x),i=I2(e,n.target.y);return`${r}% ${i}%`}},Xq={correct:(e,{treeScale:n,projectionDelta:r})=>{const i=e,s=qa.parse(e);if(s.length>5)return i;const l=qa.createTransformer(e),u=typeof s[0]!="number"?1:0,d=r.x.scale*n.x,h=r.y.scale*n.y;s[0+u]/=d,s[1+u]/=h;const p=Bt(d,h,.5);return typeof s[2+u]=="number"&&(s[2+u]/=p),typeof s[3+u]=="number"&&(s[3+u]/=p),l(s)}};class Kq extends S.Component{componentDidMount(){const{visualElement:n,layoutGroup:r,switchLayoutGroup:i,layoutId:s}=this.props,{projection:l}=n;wH(Wq),l&&(r.group&&r.group.add(l),i&&i.register&&s&&i.register(l),l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,onExitComplete:()=>this.safeToRemove()})),Df.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:r,visualElement:i,drag:s,isPresent:l}=this.props,u=i.projection;return u&&(u.isPresent=l,s||n.layoutDependency!==r||r===void 0?u.willUpdate():this.safeToRemove(),n.isPresent!==l&&(l?u.promote():u.relegate()||Pt.postRender(()=>{const d=u.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:n}=this.props.visualElement;n&&(n.root.didUpdate(),p0.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:r,switchLayoutGroup:i}=this.props,{projection:s}=n;s&&(s.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function QR(e){const[n,r]=P7(),i=S.useContext(PA);return f.jsx(Kq,{...e,layoutGroup:i,switchLayoutGroup:S.useContext(HA),isPresent:n,safeToRemove:r})}const Wq={borderRadius:{...xu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xu,borderTopRightRadius:xu,borderBottomLeftRadius:xu,borderBottomRightRadius:xu,boxShadow:Xq};function Zq(e,n,r){const i=Mn(e)?e:sc(e);return i.start(V0("",i,n,r)),i.animation}function Qq(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Jq=(e,n)=>e.depth-n.depth;class eY{constructor(){this.children=[],this.isDirty=!1}add(n){j0(this.children,n),this.isDirty=!0}remove(n){k0(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(Jq),this.isDirty=!1,this.children.forEach(n)}}function tY(e,n){const r=gi.now(),i=({timestamp:s})=>{const l=s-r;l>=n&&(Ga(i),e(l-n))};return Pt.read(i,!0),()=>Ga(i)}const JR=["TopLeft","TopRight","BottomLeft","BottomRight"],nY=JR.length,V2=e=>typeof e=="string"?parseFloat(e):e,F2=e=>typeof e=="number"||Fe.test(e);function rY(e,n,r,i,s,l){s?(e.opacity=Bt(0,r.opacity!==void 0?r.opacity:1,iY(i)),e.opacityExit=Bt(n.opacity!==void 0?n.opacity:1,0,aY(i))):l&&(e.opacity=Bt(n.opacity!==void 0?n.opacity:1,r.opacity!==void 0?r.opacity:1,i));for(let u=0;u<nY;u++){const d=`border${JR[u]}Radius`;let h=U2(n,d),p=U2(r,d);if(h===void 0&&p===void 0)continue;h||(h=0),p||(p=0),h===0||p===0||F2(h)===F2(p)?(e[d]=Math.max(Bt(V2(h),V2(p),i),0),(mi.test(p)||mi.test(h))&&(e[d]+="%")):e[d]=p}(n.rotate||r.rotate)&&(e.rotate=Bt(n.rotate||0,r.rotate||0,i))}function U2(e,n){return e[n]!==void 0?e[n]:e.borderRadius}const iY=eM(0,.5,gR),aY=eM(.5,.95,fr);function eM(e,n,r){return i=>i<e?0:i>n?1:r(il(e,n,i))}function B2(e,n){e.min=n.min,e.max=n.max}function kr(e,n){B2(e.x,n.x),B2(e.y,n.y)}function $2(e,n){e.translate=n.translate,e.scale=n.scale,e.originPoint=n.originPoint,e.origin=n.origin}function H2(e,n,r,i,s){return e-=n,e=sh(e,1/r,i),s!==void 0&&(e=sh(e,1/s,i)),e}function sY(e,n=0,r=1,i=.5,s,l=e,u=e){if(mi.test(n)&&(n=parseFloat(n),n=Bt(u.min,u.max,n/100)-u.min),typeof n!="number")return;let d=Bt(l.min,l.max,i);e===l&&(d-=n),e.min=H2(e.min,n,r,d,s),e.max=H2(e.max,n,r,d,s)}function G2(e,n,[r,i,s],l,u){sY(e,n[r],n[i],n[s],n.scale,l,u)}const oY=["x","scaleX","originX"],lY=["y","scaleY","originY"];function q2(e,n,r,i){G2(e.x,n,oY,r?r.x:void 0,i?i.x:void 0),G2(e.y,n,lY,r?r.y:void 0,i?i.y:void 0)}function Y2(e){return e.translate===0&&e.scale===1}function tM(e){return Y2(e.x)&&Y2(e.y)}function X2(e,n){return e.min===n.min&&e.max===n.max}function uY(e,n){return X2(e.x,n.x)&&X2(e.y,n.y)}function K2(e,n){return Math.round(e.min)===Math.round(n.min)&&Math.round(e.max)===Math.round(n.max)}function nM(e,n){return K2(e.x,n.x)&&K2(e.y,n.y)}function W2(e){return pr(e.x)/pr(e.y)}function Z2(e,n){return e.translate===n.translate&&e.scale===n.scale&&e.originPoint===n.originPoint}class cY{constructor(){this.members=[]}add(n){j0(this.members,n),n.scheduleRender()}remove(n){if(k0(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(n){const r=this.members.findIndex(s=>n===s);if(r===0)return!1;let i;for(let s=r;s>=0;s--){const l=this.members[s];if(l.isPresent!==!1){i=l;break}}return i?(this.promote(i),!0):!1}promote(n,r){const i=this.lead;if(n!==i&&(this.prevLead=i,this.lead=n,n.show(),i)){i.instance&&i.scheduleRender(),n.scheduleRender(),n.resumeFrom=i,r&&(n.resumeFrom.preserveOpacity=!0),i.snapshot&&(n.snapshot=i.snapshot,n.snapshot.latestValues=i.animationValues||i.latestValues),n.root&&n.root.isUpdating&&(n.isLayoutDirty=!0);const{crossfade:s}=n.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(n=>{const{options:r,resumingFrom:i}=n;r.onExitComplete&&r.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(n=>{n.instance&&n.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function dY(e,n,r){let i="";const s=e.x.translate/n.x,l=e.y.translate/n.y,u=r?.z||0;if((s||l||u)&&(i=`translate3d(${s}px, ${l}px, ${u}px) `),(n.x!==1||n.y!==1)&&(i+=`scale(${1/n.x}, ${1/n.y}) `),r){const{transformPerspective:p,rotate:g,rotateX:y,rotateY:v,skewX:x,skewY:_}=r;p&&(i=`perspective(${p}px) ${i}`),g&&(i+=`rotate(${g}deg) `),y&&(i+=`rotateX(${y}deg) `),v&&(i+=`rotateY(${v}deg) `),x&&(i+=`skewX(${x}deg) `),_&&(i+=`skewY(${_}deg) `)}const d=e.x.scale*n.x,h=e.y.scale*n.y;return(d!==1||h!==1)&&(i+=`scale(${d}, ${h})`),i||"none"}const Ss={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},zu=typeof window<"u"&&window.MotionDebug!==void 0,py=["","X","Y","Z"],fY={visibility:"hidden"},Q2=1e3;let hY=0;function my(e,n,r,i){const{latestValues:s}=n;s[e]&&(r[e]=s[e],n.setStaticValue(e,0),i&&(i[e]=0))}function rM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:n}=e.options;if(!n)return;const r=sR(n);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:s,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Pt,!(s||l))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&rM(i)}function iM({attachResizeListener:e,defaultParent:n,measureScroll:r,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(u={},d=n?.()){this.id=hY++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,zu&&(Ss.totalNodes=Ss.resolvedTargetDeltas=Ss.recalculatedProjection=0),this.nodes.forEach(gY),this.nodes.forEach(wY),this.nodes.forEach(SY),this.nodes.forEach(yY),zu&&window.MotionDebug.record(Ss)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new eY)}addEventListener(u,d){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new E0),this.eventHandlers.get(u).add(d)}notifyListeners(u,...d){const h=this.eventHandlers.get(u);h&&h.notify(...d)}hasListeners(u){return this.eventHandlers.has(u)}mount(u,d=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Qq(u),this.instance=u;const{layoutId:h,layout:p,visualElement:g}=this.options;if(g&&!g.current&&g.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),d&&(p||h)&&(this.isLayoutDirty=!0),e){let y;const v=()=>this.root.updateBlockedByResize=!1;e(u,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=tY(v,250),Df.hasAnimatedSinceResize&&(Df.hasAnimatedSinceResize=!1,this.nodes.forEach(ej))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&g&&(h||p)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:v,hasRelativeTargetChanged:x,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||g.getDefaultTransition()||EY,{onLayoutAnimationStart:k,onLayoutAnimationComplete:j}=g.getProps(),E=!this.targetLayout||!nM(this.targetLayout,_)||x,N=!v&&x;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||N||v&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,N);const M={...C0(C,"layout"),onPlay:k,onComplete:j};(g.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else v||ej(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ga(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(_Y),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&rM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(J2);return}this.isUpdating||this.nodes.forEach(xY),this.isUpdating=!1,this.nodes.forEach(bY),this.nodes.forEach(pY),this.nodes.forEach(mY),this.clearAllSnapshots();const d=gi.now();Sn.delta=ia(0,1e3/60,d-Sn.timestamp),Sn.timestamp=d,Sn.isProcessing=!0,sy.update.process(Sn),sy.preRender.process(Sn),sy.render.process(Sn),Sn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,p0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vY),this.sharedNodes.forEach(CY)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutCorrected=tn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(d=!1),d){const h=i(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:h,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!s)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!tM(this.projectionDelta),h=this.getTransformTemplate(),p=h?h(this.latestValues,""):void 0,g=p!==this.prevTransformTemplateValue;u&&(d||ws(this.latestValues)||g)&&(s(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return u&&(h=this.removeTransform(h)),NY(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:d}=this.options;if(!d)return tn();const h=d.measureViewportBox();if(!(((u=this.scroll)===null||u===void 0?void 0:u.wasRoot)||this.path.some(TY))){const{scroll:g}=this.root;g&&($o(h.x,g.offset.x),$o(h.y,g.offset.y))}return h}removeElementScroll(u){var d;const h=tn();if(kr(h,u),!((d=this.scroll)===null||d===void 0)&&d.wasRoot)return h;for(let p=0;p<this.path.length;p++){const g=this.path[p],{scroll:y,options:v}=g;g!==this.root&&y&&v.layoutScroll&&(y.wasRoot&&kr(h,u),$o(h.x,y.offset.x),$o(h.y,y.offset.y))}return h}applyTransform(u,d=!1){const h=tn();kr(h,u);for(let p=0;p<this.path.length;p++){const g=this.path[p];!d&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Ho(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),ws(g.latestValues)&&Ho(h,g.latestValues)}return ws(this.latestValues)&&Ho(h,this.latestValues),h}removeTransform(u){const d=tn();kr(d,u);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!p.instance||!ws(p.latestValues))continue;Av(p.latestValues)&&p.updateSnapshot();const g=tn(),y=p.measurePageBox();kr(g,y),q2(d,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,g)}return ws(this.latestValues)&&q2(d,this.latestValues),d}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Sn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){var d;const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const p=!!this.resumingFrom||this!==h;if(!(u||p&&this.isSharedProjectionDirty||this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:v}=this.options;if(!(!this.layout||!(y||v))){if(this.resolvedRelativeTargetAt=Sn.timestamp,!this.targetDelta&&!this.relativeTarget){const x=this.getClosestProjectingParent();x&&x.layout&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=tn(),this.relativeTargetOrigin=tn(),Xu(this.relativeTargetOrigin,this.layout.layoutBox,x.layout.layoutBox),kr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=tn(),this.targetWithTransforms=tn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Mq(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):kr(this.target,this.layout.layoutBox),KR(this.target,this.targetDelta)):kr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const x=this.getClosestProjectingParent();x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=tn(),this.relativeTargetOrigin=tn(),Xu(this.relativeTargetOrigin,this.target,x.target),kr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}zu&&Ss.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Av(this.parent.latestValues)||XR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var u;const d=this.getLead(),h=!!this.resumingFrom||this!==d;let p=!0;if((this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty)&&(p=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(p=!1),this.resolvedRelativeTargetAt===Sn.timestamp&&(p=!1),p)return;const{layout:g,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||y))return;kr(this.layoutCorrected,this.layout.layoutBox);const v=this.treeScale.x,x=this.treeScale.y;Uq(this.layoutCorrected,this.treeScale,this.path,h),d.layout&&!d.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(d.target=d.layout.layoutBox,d.targetWithTransforms=tn());const{target:_}=d;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($2(this.prevProjectionDelta.x,this.projectionDelta.x),$2(this.prevProjectionDelta.y,this.projectionDelta.y)),Yu(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==v||this.treeScale.y!==x||!Z2(this.projectionDelta.x,this.prevProjectionDelta.x)||!Z2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_)),zu&&Ss.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var d;if((d=this.options.visualElement)===null||d===void 0||d.scheduleRender(),u){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Bo(),this.projectionDelta=Bo(),this.projectionDeltaWithTransform=Bo()}setAnimationOrigin(u,d=!1){const h=this.snapshot,p=h?h.latestValues:{},g={...this.latestValues},y=Bo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=tn(),x=h?h.source:void 0,_=this.layout?this.layout.source:void 0,C=x!==_,k=this.getStack(),j=!k||k.members.length<=1,E=!!(C&&!j&&this.options.crossfade===!0&&!this.path.some(kY));this.animationProgress=0;let N;this.mixTargetDelta=M=>{const R=M/1e3;tj(y.x,u.x,R),tj(y.y,u.y,R),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xu(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jY(this.relativeTarget,this.relativeTargetOrigin,v,R),N&&uY(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=tn()),kr(N,this.relativeTarget)),C&&(this.animationValues=g,rY(g,p,this.latestValues,R,E,j)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ga(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pt.update(()=>{Df.hasAnimatedSinceResize=!0,this.currentAnimation=Zq(0,Q2,{...u,onUpdate:d=>{this.mixTargetDelta(d),u.onUpdate&&u.onUpdate(d)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Q2),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:d,target:h,layout:p,latestValues:g}=u;if(!(!d||!h||!p)){if(this!==u&&this.layout&&p&&aM(this.options.animationType,this.layout.layoutBox,p.layoutBox)){h=this.target||tn();const y=pr(this.layout.layoutBox.x);h.x.min=u.target.x.min,h.x.max=h.x.min+y;const v=pr(this.layout.layoutBox.y);h.y.min=u.target.y.min,h.y.max=h.y.min+v}kr(d,h),Ho(d,g),Yu(this.projectionDeltaWithTransform,this.layoutCorrected,d,g)}}registerSharedNode(u,d){this.sharedNodes.has(u)||this.sharedNodes.set(u,new cY),this.sharedNodes.get(u).add(d);const p=d.options.initialPromotionConfig;d.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(d):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){var u;const{layoutId:d}=this.options;return d?((u=this.getStack())===null||u===void 0?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:d}=this.options;return d?(u=this.getStack())===null||u===void 0?void 0:u.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:d,preserveFollowOpacity:h}={}){const p=this.getStack();p&&p.promote(this,h),u&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let d=!1;const{latestValues:h}=u;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const p={};h.z&&my("z",u,p,this.animationValues);for(let g=0;g<py.length;g++)my(`rotate${py[g]}`,u,p,this.animationValues),my(`skew${py[g]}`,u,p,this.animationValues);u.render();for(const g in p)u.setStaticValue(g,p[g]),this.animationValues&&(this.animationValues[g]=p[g]);u.scheduleRender()}getProjectionStyles(u){var d,h;if(!this.instance||this.isSVG)return;if(!this.isVisible)return fY;const p={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,p.opacity="",p.pointerEvents=Rf(u?.pointerEvents)||"",p.transform=g?g(this.latestValues,""):"none",p;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=Rf(u?.pointerEvents)||""),this.hasProjected&&!ws(this.latestValues)&&(C.transform=g?g({},""):"none",this.hasProjected=!1),C}const v=y.animationValues||y.latestValues;this.applyTransformsToTarget(),p.transform=dY(this.projectionDeltaWithTransform,this.treeScale,v),g&&(p.transform=g(v,p.transform));const{x,y:_}=this.projectionDelta;p.transformOrigin=`${x.origin*100}% ${_.origin*100}% 0`,y.animationValues?p.opacity=y===this?(h=(d=v.opacity)!==null&&d!==void 0?d:this.latestValues.opacity)!==null&&h!==void 0?h:1:this.preserveOpacity?this.latestValues.opacity:v.opacityExit:p.opacity=y===this?v.opacity!==void 0?v.opacity:"":v.opacityExit!==void 0?v.opacityExit:0;for(const C in th){if(v[C]===void 0)continue;const{correct:k,applyTo:j}=th[C],E=p.transform==="none"?v[C]:k(v[C],y);if(j){const N=j.length;for(let M=0;M<N;M++)p[j[M]]=E}else p[C]=E}return this.options.layoutId&&(p.pointerEvents=y===this?Rf(u?.pointerEvents)||"":"none"),p}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var d;return(d=u.currentAnimation)===null||d===void 0?void 0:d.stop()}),this.root.nodes.forEach(J2),this.root.sharedNodes.clear()}}}function pY(e){e.updateLayout()}function mY(e){var n;const r=((n=e.resumeFrom)===null||n===void 0?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:l}=e.options,u=r.source!==e.layout.source;l==="size"?Nr(y=>{const v=u?r.measuredBox[y]:r.layoutBox[y],x=pr(v);v.min=i[y].min,v.max=v.min+x}):aM(l,r.layoutBox,i)&&Nr(y=>{const v=u?r.measuredBox[y]:r.layoutBox[y],x=pr(i[y]);v.max=v.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[y].max=e.relativeTarget[y].min+x)});const d=Bo();Yu(d,i,r.layoutBox);const h=Bo();u?Yu(h,e.applyTransform(s,!0),r.measuredBox):Yu(h,i,r.layoutBox);const p=!tM(d);let g=!1;if(!e.resumeFrom){const y=e.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:v,layout:x}=y;if(v&&x){const _=tn();Xu(_,r.layoutBox,v.layoutBox);const C=tn();Xu(C,i,x.layoutBox),nM(_,C)||(g=!0),y.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=_,e.relativeParent=y)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:r,delta:h,layoutDelta:d,hasLayoutChanged:p,hasRelativeTargetChanged:g})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function gY(e){zu&&Ss.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function yY(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function vY(e){e.clearSnapshot()}function J2(e){e.clearMeasurements()}function xY(e){e.isLayoutDirty=!1}function bY(e){const{visualElement:n}=e.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),e.resetTransform()}function ej(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function wY(e){e.resolveTargetDelta()}function SY(e){e.calcProjection()}function _Y(e){e.resetSkewAndRotation()}function CY(e){e.removeLeadSnapshot()}function tj(e,n,r){e.translate=Bt(n.translate,0,r),e.scale=Bt(n.scale,1,r),e.origin=n.origin,e.originPoint=n.originPoint}function nj(e,n,r,i){e.min=Bt(n.min,r.min,i),e.max=Bt(n.max,r.max,i)}function jY(e,n,r,i){nj(e.x,n.x,r.x,i),nj(e.y,n.y,r.y,i)}function kY(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const EY={duration:.45,ease:[.4,0,.1,1]},rj=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ij=rj("applewebkit/")&&!rj("chrome/")?Math.round:fr;function aj(e){e.min=ij(e.min),e.max=ij(e.max)}function NY(e){aj(e.x),aj(e.y)}function aM(e,n,r){return e==="position"||e==="preserve-aspect"&&!Rq(W2(n),W2(r),.2)}function TY(e){var n;return e!==e.root&&((n=e.scroll)===null||n===void 0?void 0:n.wasRoot)}const AY=iM({attachResizeListener:(e,n)=>lc(e,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),gy={current:void 0},sM=iM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!gy.current){const e=new AY({});e.mount(window),e.setOptions({layoutScroll:!0}),gy.current=e}return gy.current},resetTransform:(e,n)=>{e.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),RY={pan:{Feature:Yq},drag:{Feature:qq,ProjectionNode:sM,MeasureLayout:QR}};function MY(e,n,r){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const l=(i=void 0)!==null&&i!==void 0?i:s.querySelectorAll(e);return l?Array.from(l):[]}return Array.from(e)}function oM(e,n){const r=MY(e),i=new AbortController,s={passive:!0,...n,signal:i.signal};return[r,s,()=>i.abort()]}function sj(e){return n=>{n.pointerType==="touch"||BR()||e(n)}}function DY(e,n,r={}){const[i,s,l]=oM(e,r),u=sj(d=>{const{target:h}=d,p=n(d);if(typeof p!="function"||!h)return;const g=sj(y=>{p(y),h.removeEventListener("pointerleave",g)});h.addEventListener("pointerleave",g,s)});return i.forEach(d=>{d.addEventListener("pointerenter",u,s)}),l}function oj(e,n,r){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",r==="Start");const s="onHover"+r,l=i[s];l&&Pt.postRender(()=>l(n,Tc(n)))}class OY extends Za{mount(){const{current:n}=this.node;n&&(this.unmount=DY(n,r=>(oj(this.node,r,"Start"),i=>oj(this.node,i,"End"))))}unmount(){}}class zY extends Za{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Nc(lc(this.node.current,"focus",()=>this.onFocus()),lc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const lM=(e,n)=>n?e===n?!0:lM(e,n.parentElement):!1,PY=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function LY(e){return PY.has(e.tagName)||e.tabIndex!==-1}const Pu=new WeakSet;function lj(e){return n=>{n.key==="Enter"&&e(n)}}function yy(e,n){e.dispatchEvent(new PointerEvent("pointer"+n,{isPrimary:!0,bubbles:!0}))}const IY=(e,n)=>{const r=e.currentTarget;if(!r)return;const i=lj(()=>{if(Pu.has(r))return;yy(r,"down");const s=lj(()=>{yy(r,"up")}),l=()=>yy(r,"cancel");r.addEventListener("keyup",s,n),r.addEventListener("blur",l,n)});r.addEventListener("keydown",i,n),r.addEventListener("blur",()=>r.removeEventListener("keydown",i),n)};function uj(e){return F0(e)&&!BR()}function VY(e,n,r={}){const[i,s,l]=oM(e,r),u=d=>{const h=d.currentTarget;if(!uj(d)||Pu.has(h))return;Pu.add(h);const p=n(d),g=(x,_)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",v),!(!uj(x)||!Pu.has(h))&&(Pu.delete(h),typeof p=="function"&&p(x,{success:_}))},y=x=>{g(x,r.useGlobalTarget||lM(h,x.target))},v=x=>{g(x,!1)};window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",v,s)};return i.forEach(d=>{!LY(d)&&d.getAttribute("tabindex")===null&&(d.tabIndex=0),(r.useGlobalTarget?window:d).addEventListener("pointerdown",u,s),d.addEventListener("focus",p=>IY(p,s),s)}),l}function cj(e,n,r){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",r==="Start");const s="onTap"+(r==="End"?"":r),l=i[s];l&&Pt.postRender(()=>l(n,Tc(n)))}class FY extends Za{mount(){const{current:n}=this.node;n&&(this.unmount=VY(n,r=>(cj(this.node,r,"Start"),(i,{success:s})=>cj(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Mv=new WeakMap,vy=new WeakMap,UY=e=>{const n=Mv.get(e.target);n&&n(e)},BY=e=>{e.forEach(UY)};function $Y({root:e,...n}){const r=e||document;vy.has(r)||vy.set(r,{});const i=vy.get(r),s=JSON.stringify(n);return i[s]||(i[s]=new IntersectionObserver(BY,{root:e,...n})),i[s]}function HY(e,n,r){const i=$Y(n);return Mv.set(e,r),i.observe(e),()=>{Mv.delete(e),i.unobserve(e)}}const GY={some:0,all:1};class qY extends Za{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:n={}}=this.node.getProps(),{root:r,margin:i,amount:s="some",once:l}=n,u={root:r?r.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:GY[s]},d=h=>{const{isIntersecting:p}=h;if(this.isInView===p||(this.isInView=p,l&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),v=p?g:y;v&&v(h)};return HY(this.node.current,u,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:r}=this.node;["amount","margin","root"].some(YY(n,r))&&this.startObserver()}unmount(){}}function YY({viewport:e={}},{viewport:n={}}={}){return r=>e[r]!==n[r]}const XY={inView:{Feature:qY},tap:{Feature:FY},focus:{Feature:zY},hover:{Feature:OY}},KY={layout:{ProjectionNode:sM,MeasureLayout:QR}},Dv={current:null},uM={current:!1};function WY(){if(uM.current=!0,!!c0)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),n=()=>Dv.current=e.matches;e.addListener(n),n()}else Dv.current=!1}const ZY=[...AR,An,qa],QY=e=>ZY.find(TR(e)),dj=new WeakMap;function JY(e,n,r){for(const i in n){const s=n[i],l=r[i];if(Mn(s))e.addValue(i,s);else if(Mn(l))e.addValue(i,sc(s,{owner:e}));else if(l!==s)if(e.hasValue(i)){const u=e.getValue(i);u.liveStyle===!0?u.jump(s):u.hasAnimated||u.set(s)}else{const u=e.getStaticValue(i);e.addValue(i,sc(u!==void 0?u:s,{owner:e}))}}for(const i in r)n[i]===void 0&&e.removeValue(i);return n}const fj=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class eX{scrapeMotionValuesFromProps(n,r,i){return{}}constructor({parent:n,props:r,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:l,visualState:u},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=P0,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=gi.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Pt.render(this.render,!1,!0))};const{latestValues:h,renderState:p,onUpdate:g}=u;this.onUpdate=g,this.latestValues=h,this.baseTarget={...h},this.initialValues=r.initial?{...h}:{},this.renderState=p,this.parent=n,this.props=r,this.presenceContext=i,this.depth=n?n.depth+1:0,this.reducedMotionConfig=s,this.options=d,this.blockInitialAnimation=!!l,this.isControllingVariants=ep(r),this.isVariantNode=BA(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:y,...v}=this.scrapeMotionValuesFromProps(r,{},this);for(const x in v){const _=v[x];h[x]!==void 0&&Mn(_)&&_.set(h[x],!1)}}mount(n){this.current=n,dj.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),uM.current||WY(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Dv.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){dj.delete(this.current),this.projection&&this.projection.unmount(),Ga(this.notifyUpdate),Ga(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(n,r){this.valueSubscriptions.has(n)&&this.valueSubscriptions.get(n)();const i=Hs.has(n),s=r.on("change",d=>{this.latestValues[n]=d,this.props.onUpdate&&Pt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),l=r.on("renderRequest",this.scheduleRender);let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,n,r)),this.valueSubscriptions.set(n,()=>{s(),l(),u&&u(),r.owner&&r.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}updateFeatures(){let n="animation";for(n in rl){const r=rl[n];if(!r)continue;const{isEnabled:i,Feature:s}=r;if(!this.features[n]&&s&&i(this.props)&&(this.features[n]=new s(this)),this.features[n]){const l=this.features[n];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):tn()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,r){this.latestValues[n]=r}update(n,r){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let i=0;i<fj.length;i++){const s=fj[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const l="on"+s,u=n[l];u&&(this.propEventSubscriptions[s]=this.on(s,u))}this.prevMotionValues=JY(this,this.scrapeMotionValuesFromProps(n,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(n){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(n),()=>r.variantChildren.delete(n)}addValue(n,r){const i=this.values.get(n);r!==i&&(i&&this.removeValue(n),this.bindToMotionValue(n,r),this.values.set(n,r),this.latestValues[n]=r.get())}removeValue(n){this.values.delete(n);const r=this.valueSubscriptions.get(n);r&&(r(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,r){if(this.props.values&&this.props.values[n])return this.props.values[n];let i=this.values.get(n);return i===void 0&&r!==void 0&&(i=sc(r===null?void 0:r,{owner:this}),this.addValue(n,i)),i}readValue(n,r){var i;let s=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:(i=this.getBaseTargetFromProps(this.props,n))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,n,this.options);return s!=null&&(typeof s=="string"&&(ER(s)||vR(s))?s=parseFloat(s):!QY(s)&&qa.test(r)&&(s=CR(n,r)),this.setBaseTarget(n,Mn(s)?s.get():s)),Mn(s)?s.get():s}setBaseTarget(n,r){this.baseTarget[n]=r}getBaseTarget(n){var r;const{initial:i}=this.props;let s;if(typeof i=="string"||typeof i=="object"){const u=g0(this.props,i,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);u&&(s=u[n])}if(i&&s!==void 0)return s;const l=this.getBaseTargetFromProps(this.props,n);return l!==void 0&&!Mn(l)?l:this.initialValues[n]!==void 0&&s===void 0?void 0:this.baseTarget[n]}on(n,r){return this.events[n]||(this.events[n]=new E0),this.events[n].add(r)}notify(n,...r){this.events[n]&&this.events[n].notify(...r)}}class cM extends eX{constructor(){super(...arguments),this.KeyframeResolver=RR}sortInstanceNodePosition(n,r){return n.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(n,r){return n.style?n.style[r]:void 0}removeValueFromRenderState(n,{vars:r,style:i}){delete r[n],delete i[n]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;Mn(n)&&(this.childSubscription=n.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function tX(e){return window.getComputedStyle(e)}class nX extends cM{constructor(){super(...arguments),this.type="html",this.renderInstance=ZA}readValueFromInstance(n,r){if(Hs.has(r)){const i=z0(r);return i&&i.default||0}else{const i=tX(n),s=(XA(r)?i.getPropertyValue(r):i[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(n,{transformPagePoint:r}){return WR(n,r)}build(n,r,i){x0(n,r,i.transformTemplate)}scrapeMotionValuesFromProps(n,r,i){return _0(n,r,i)}}class rX extends cM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=tn}getBaseTargetFromProps(n,r){return n[r]}readValueFromInstance(n,r){if(Hs.has(r)){const i=z0(r);return i&&i.default||0}return r=QA.has(r)?r:h0(r),n.getAttribute(r)}scrapeMotionValuesFromProps(n,r,i){return tR(n,r,i)}build(n,r,i){b0(n,r,this.isSVGTag,i.transformTemplate)}renderInstance(n,r,i,s){JA(n,r,i,s)}mount(n){this.isSVGTag=S0(n.tagName),super.mount(n)}}const iX=(e,n)=>m0(e)?new rX(n):new nX(n,{allowProjection:e!==S.Fragment}),aX=AH({...wq,...XY,...RY,...KY},iX),sX=G7(aX);function oX({width:e=16,height:n=16,x:r=0,y:i=0,cx:s=1,cy:l=1,cr:u=1,className:d,glow:h=!1,...p}){const g=S.useId(),y=S.useRef(null),[v,x]=S.useState({width:0,height:0});S.useEffect(()=>{const C=()=>{if(y.current){const{width:k,height:j}=y.current.getBoundingClientRect();x({width:k,height:j})}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const _=Array.from({length:Math.ceil(v.width/e)*Math.ceil(v.height/n)},(C,k)=>{const j=k%Math.ceil(v.width/e),E=Math.floor(k/Math.ceil(v.width/e));return{x:j*e+s+r,y:E*n+l+i,delay:Math.random()*5,duration:Math.random()*3+2}});return f.jsxs("svg",{ref:y,"aria-hidden":"true",className:Ee("pointer-events-none absolute inset-0 h-full w-full text-neutral-400/80",d),...p,children:[f.jsx("defs",{children:f.jsxs("radialGradient",{id:`${g}-gradient`,children:[f.jsx("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"1"}),f.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0"})]})}),_.map(C=>f.jsx(sX.circle,{cx:C.x,cy:C.y,r:u,fill:h?`url(#${g}-gradient)`:"currentColor",initial:h?{opacity:.4,scale:1}:{},animate:h?{opacity:[.4,1,.4],scale:[1,1.5,1]}:{},transition:h?{duration:C.duration,repeat:1/0,repeatType:"reverse",delay:C.delay,ease:"easeInOut"}:{}},`${C.x}-${C.y}`))]})}function lX(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,s,l,u,d=[],h=!0,p=!1;try{if(l=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;h=!1}else for(;!(h=(i=l.call(r)).done)&&(d.push(i.value),d.length!==n);h=!0);}catch(g){p=!0,s=g}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(p)throw s}}return d}}function uX(e,n,r){return n=yX(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function hj(e,n){return fX(e)||lX(e,n)||dM(e,n)||mX()}function cX(e){return dX(e)||hX(e)||dM(e)||pX()}function dX(e){if(Array.isArray(e))return Ov(e)}function fX(e){if(Array.isArray(e))return e}function hX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dM(e,n){if(e){if(typeof e=="string")return Ov(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ov(e,n)}}function Ov(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function pX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
84
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
85
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gX(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function yX(e){var n=gX(e,"string");return typeof n=="symbol"?n:String(n)}var vX=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(cX(Object.entries(n).filter(function(s){var l=hj(s,1),u=l[0];return!i.has(u)}).map(function(s){var l=hj(s,2),u=l[0],d=l[1];return uX({},u,d)}))))};function zv(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function xX(e){if(Array.isArray(e))return e}function bX(e){if(Array.isArray(e))return zv(e)}function wX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SX(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,s,l,u,d=[],h=!0,p=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(h=(i=l.call(r)).done)&&(d.push(i.value),d.length!==n);h=!0);}catch(g){p=!0,s=g}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(p)throw s}}return d}}function _X(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
87
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jX(e,n){return xX(e)||SX(e,n)||fM(e,n)||_X()}function pj(e){return bX(e)||wX(e)||fM(e)||CX()}function fM(e,n){if(e){if(typeof e=="string")return zv(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zv(e,n):void 0}}function kX(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.wrapperElementType,i=r===void 0?"div":r,s=n.nodeMapper,l=s===void 0?function(g){return g}:s,u=n.methodNames,d=u===void 0?[]:u,h=n.initPropNames,p=h===void 0?[]:h;return S.forwardRef(function(g,y){var v=S.useRef(),x=S.useMemo(function(){var k=Object.fromEntries(p.filter(function(j){return g.hasOwnProperty(j)}).map(function(j){return[j,g[j]]}));return e(k)},[]);mj(function(){x(l(v.current))},S.useLayoutEffect),mj(function(){return x._destructor instanceof Function?x._destructor:void 0});var _=S.useCallback(function(k){for(var j=arguments.length,E=new Array(j>1?j-1:0),N=1;N<j;N++)E[N-1]=arguments[N];return x[k]instanceof Function?x[k].apply(x,E):void 0},[x]),C=S.useRef({});return Object.keys(vX(g,[].concat(pj(d),pj(p)))).filter(function(k){return C.current[k]!==g[k]}).forEach(function(k){return _(k,g[k])}),C.current=g,S.useImperativeHandle(y,function(){return Object.fromEntries(d.map(function(k){return[k,function(){for(var j=arguments.length,E=new Array(j),N=0;N<j;N++)E[N]=arguments[N];return _.apply(void 0,[k].concat(E))}]}))},[_]),Xn.createElement(i,{ref:v})})}function mj(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.useEffect,r=S.useRef(),i=S.useRef(!1),s=S.useRef(!1),l=S.useState(0),u=jX(l,2);u[0];var d=u[1];i.current&&(s.current=!0),n(function(){return i.current||(r.current=e(),i.current=!0),d(function(h){return h+1}),function(){s.current&&r.current&&r.current()}},[])}var Pv="http://www.w3.org/1999/xhtml";const gj={svg:"http://www.w3.org/2000/svg",xhtml:Pv,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rp(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),gj.hasOwnProperty(n)?{space:gj[n],local:e}:e}function EX(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===Pv&&n.documentElement.namespaceURI===Pv?n.createElement(e):n.createElementNS(r,e)}}function NX(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hM(e){var n=rp(e);return(n.local?NX:EX)(n)}function TX(){}function U0(e){return e==null?TX:function(){return this.querySelector(e)}}function AX(e){typeof e!="function"&&(e=U0(e));for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s)for(var l=n[s],u=l.length,d=i[s]=new Array(u),h,p,g=0;g<u;++g)(h=l[g])&&(p=e.call(h,h.__data__,g,l))&&("__data__"in h&&(p.__data__=h.__data__),d[g]=p);return new mr(i,this._parents)}function RX(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function MX(){return[]}function pM(e){return e==null?MX:function(){return this.querySelectorAll(e)}}function DX(e){return function(){return RX(e.apply(this,arguments))}}function OX(e){typeof e=="function"?e=DX(e):e=pM(e);for(var n=this._groups,r=n.length,i=[],s=[],l=0;l<r;++l)for(var u=n[l],d=u.length,h,p=0;p<d;++p)(h=u[p])&&(i.push(e.call(h,h.__data__,p,u)),s.push(h));return new mr(i,s)}function mM(e){return function(){return this.matches(e)}}function gM(e){return function(n){return n.matches(e)}}var zX=Array.prototype.find;function PX(e){return function(){return zX.call(this.children,e)}}function LX(){return this.firstElementChild}function IX(e){return this.select(e==null?LX:PX(typeof e=="function"?e:gM(e)))}var VX=Array.prototype.filter;function FX(){return Array.from(this.children)}function UX(e){return function(){return VX.call(this.children,e)}}function BX(e){return this.selectAll(e==null?FX:UX(typeof e=="function"?e:gM(e)))}function $X(e){typeof e!="function"&&(e=mM(e));for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s)for(var l=n[s],u=l.length,d=i[s]=[],h,p=0;p<u;++p)(h=l[p])&&e.call(h,h.__data__,p,l)&&d.push(h);return new mr(i,this._parents)}function yM(e){return new Array(e.length)}function HX(){return new mr(this._enter||this._groups.map(yM),this._parents)}function oh(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}oh.prototype={constructor:oh,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function GX(e){return function(){return e}}function qX(e,n,r,i,s,l){for(var u=0,d,h=n.length,p=l.length;u<p;++u)(d=n[u])?(d.__data__=l[u],i[u]=d):r[u]=new oh(e,l[u]);for(;u<h;++u)(d=n[u])&&(s[u]=d)}function YX(e,n,r,i,s,l,u){var d,h,p=new Map,g=n.length,y=l.length,v=new Array(g),x;for(d=0;d<g;++d)(h=n[d])&&(v[d]=x=u.call(h,h.__data__,d,n)+"",p.has(x)?s[d]=h:p.set(x,h));for(d=0;d<y;++d)x=u.call(e,l[d],d,l)+"",(h=p.get(x))?(i[d]=h,h.__data__=l[d],p.delete(x)):r[d]=new oh(e,l[d]);for(d=0;d<g;++d)(h=n[d])&&p.get(v[d])===h&&(s[d]=h)}function XX(e){return e.__data__}function KX(e,n){if(!arguments.length)return Array.from(this,XX);var r=n?YX:qX,i=this._parents,s=this._groups;typeof e!="function"&&(e=GX(e));for(var l=s.length,u=new Array(l),d=new Array(l),h=new Array(l),p=0;p<l;++p){var g=i[p],y=s[p],v=y.length,x=WX(e.call(g,g&&g.__data__,p,i)),_=x.length,C=d[p]=new Array(_),k=u[p]=new Array(_),j=h[p]=new Array(v);r(g,y,C,k,j,x,n);for(var E=0,N=0,M,R;E<_;++E)if(M=C[E]){for(E>=N&&(N=E+1);!(R=k[N])&&++N<_;);M._next=R||null}}return u=new mr(u,i),u._enter=d,u._exit=h,u}function WX(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ZX(){return new mr(this._exit||this._groups.map(yM),this._parents)}function QX(e,n,r){var i=this.enter(),s=this,l=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(s=n(s),s&&(s=s.selection())),r==null?l.remove():r(l),i&&s?i.merge(s).order():s}function JX(e){for(var n=e.selection?e.selection():e,r=this._groups,i=n._groups,s=r.length,l=i.length,u=Math.min(s,l),d=new Array(s),h=0;h<u;++h)for(var p=r[h],g=i[h],y=p.length,v=d[h]=new Array(y),x,_=0;_<y;++_)(x=p[_]||g[_])&&(v[_]=x);for(;h<s;++h)d[h]=r[h];return new mr(d,this._parents)}function eK(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var i=e[n],s=i.length-1,l=i[s],u;--s>=0;)(u=i[s])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function tK(e){e||(e=nK);function n(y,v){return y&&v?e(y.__data__,v.__data__):!y-!v}for(var r=this._groups,i=r.length,s=new Array(i),l=0;l<i;++l){for(var u=r[l],d=u.length,h=s[l]=new Array(d),p,g=0;g<d;++g)(p=u[g])&&(h[g]=p);h.sort(n)}return new mr(s,this._parents).order()}function nK(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function rK(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iK(){return Array.from(this)}function aK(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],s=0,l=i.length;s<l;++s){var u=i[s];if(u)return u}return null}function sK(){let e=0;for(const n of this)++e;return e}function oK(){return!this.node()}function lK(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var s=n[r],l=0,u=s.length,d;l<u;++l)(d=s[l])&&e.call(d,d.__data__,l,s);return this}function uK(e){return function(){this.removeAttribute(e)}}function cK(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dK(e,n){return function(){this.setAttribute(e,n)}}function fK(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function hK(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function pK(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function mK(e,n){var r=rp(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((n==null?r.local?cK:uK:typeof n=="function"?r.local?pK:hK:r.local?fK:dK)(r,n))}function vM(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function gK(e){return function(){this.style.removeProperty(e)}}function yK(e,n,r){return function(){this.style.setProperty(e,n,r)}}function vK(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function xK(e,n,r){return arguments.length>1?this.each((n==null?gK:typeof n=="function"?vK:yK)(e,n,r??"")):sl(this.node(),e)}function sl(e,n){return e.style.getPropertyValue(n)||vM(e).getComputedStyle(e,null).getPropertyValue(n)}function bK(e){return function(){delete this[e]}}function wK(e,n){return function(){this[e]=n}}function SK(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function _K(e,n){return arguments.length>1?this.each((n==null?bK:typeof n=="function"?SK:wK)(e,n)):this.node()[e]}function xM(e){return e.trim().split(/^|\s+/)}function B0(e){return e.classList||new bM(e)}function bM(e){this._node=e,this._names=xM(e.getAttribute("class")||"")}bM.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wM(e,n){for(var r=B0(e),i=-1,s=n.length;++i<s;)r.add(n[i])}function SM(e,n){for(var r=B0(e),i=-1,s=n.length;++i<s;)r.remove(n[i])}function CK(e){return function(){wM(this,e)}}function jK(e){return function(){SM(this,e)}}function kK(e,n){return function(){(n.apply(this,arguments)?wM:SM)(this,e)}}function EK(e,n){var r=xM(e+"");if(arguments.length<2){for(var i=B0(this.node()),s=-1,l=r.length;++s<l;)if(!i.contains(r[s]))return!1;return!0}return this.each((typeof n=="function"?kK:n?CK:jK)(r,n))}function NK(){this.textContent=""}function TK(e){return function(){this.textContent=e}}function AK(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function RK(e){return arguments.length?this.each(e==null?NK:(typeof e=="function"?AK:TK)(e)):this.node().textContent}function MK(){this.innerHTML=""}function DK(e){return function(){this.innerHTML=e}}function OK(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function zK(e){return arguments.length?this.each(e==null?MK:(typeof e=="function"?OK:DK)(e)):this.node().innerHTML}function PK(){this.nextSibling&&this.parentNode.appendChild(this)}function LK(){return this.each(PK)}function IK(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function VK(){return this.each(IK)}function FK(e){var n=typeof e=="function"?e:hM(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function UK(){return null}function BK(e,n){var r=typeof e=="function"?e:hM(e),i=n==null?UK:typeof n=="function"?n:U0(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function $K(){var e=this.parentNode;e&&e.removeChild(this)}function HK(){return this.each($K)}function GK(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function qK(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function YK(e){return this.select(e?qK:GK)}function XK(e){return arguments.length?this.property("__data__",e):this.node().__data__}function KK(e){return function(n){e.call(this,n,this.__data__)}}function WK(e){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");return i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function ZK(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,s=n.length,l;r<s;++r)l=n[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):n[++i]=l;++i?n.length=i:delete this.__on}}}function QK(e,n,r){return function(){var i=this.__on,s,l=KK(n);if(i){for(var u=0,d=i.length;u<d;++u)if((s=i[u]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=r),s.value=n;return}}this.addEventListener(e.type,l,r),s={type:e.type,name:e.name,value:n,listener:l,options:r},i?i.push(s):this.__on=[s]}}function JK(e,n,r){var i=WK(e+""),s,l=i.length,u;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,p=d.length,g;h<p;++h)for(s=0,g=d[h];s<l;++s)if((u=i[s]).type===g.type&&u.name===g.name)return g.value}return}for(d=n?QK:ZK,s=0;s<l;++s)this.each(d(i[s],n,r));return this}function _M(e,n,r){var i=vM(e),s=i.CustomEvent;typeof s=="function"?s=new s(n,r):(s=i.document.createEvent("Event"),r?(s.initEvent(n,r.bubbles,r.cancelable),s.detail=r.detail):s.initEvent(n,!1,!1)),e.dispatchEvent(s)}function eW(e,n){return function(){return _M(this,e,n)}}function tW(e,n){return function(){return _M(this,e,n.apply(this,arguments))}}function nW(e,n){return this.each((typeof n=="function"?tW:eW)(e,n))}function*rW(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],s=0,l=i.length,u;s<l;++s)(u=i[s])&&(yield u)}var CM=[null];function mr(e,n){this._groups=e,this._parents=n}function Ac(){return new mr([[document.documentElement]],CM)}function iW(){return this}mr.prototype=Ac.prototype={constructor:mr,select:AX,selectAll:OX,selectChild:IX,selectChildren:BX,filter:$X,data:KX,enter:HX,exit:ZX,join:QX,merge:JX,selection:iW,order:eK,sort:tK,call:rK,nodes:iK,node:aK,size:sK,empty:oK,each:lK,attr:mK,style:xK,property:_K,classed:EK,text:RK,html:zK,raise:LK,lower:VK,append:FK,insert:BK,remove:HK,clone:YK,datum:XK,on:JK,dispatch:nW,[Symbol.iterator]:rW};function Or(e){return typeof e=="string"?new mr([[document.querySelector(e)]],[document.documentElement]):new mr([[e]],CM)}function aW(e){let n;for(;n=e.sourceEvent;)e=n;return e}function ui(e,n){if(e=aW(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var s=n.getBoundingClientRect();return[e.clientX-s.left-n.clientLeft,e.clientY-s.top-n.clientTop]}}return[e.pageX,e.pageY]}var sW={value:()=>{}};function Rc(){for(var e=0,n=arguments.length,r={},i;e<n;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new Of(r)}function Of(e){this._=e}function oW(e,n){return e.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");if(s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Of.prototype=Rc.prototype={constructor:Of,on:function(e,n){var r=this._,i=oW(e+"",r),s,l=-1,u=i.length;if(arguments.length<2){for(;++l<u;)if((s=(e=i[l]).type)&&(s=lW(r[s],e.name)))return s;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++l<u;)if(s=(e=i[l]).type)r[s]=yj(r[s],e.name,n);else if(n==null)for(s in r)r[s]=yj(r[s],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new Of(e)},call:function(e,n){if((s=arguments.length-2)>0)for(var r=new Array(s),i=0,s,l;i<s;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,s=l.length;i<s;++i)l[i].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],s=0,l=i.length;s<l;++s)i[s].value.apply(n,r)}};function lW(e,n){for(var r=0,i=e.length,s;r<i;++r)if((s=e[r]).name===n)return s.value}function yj(e,n,r){for(var i=0,s=e.length;i<s;++i)if(e[i].name===n){e[i]=sW,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}const uW={passive:!1},uc={capture:!0,passive:!1};function xy(e){e.stopImmediatePropagation()}function Zo(e){e.preventDefault(),e.stopImmediatePropagation()}function jM(e){var n=e.document.documentElement,r=Or(e).on("dragstart.drag",Zo,uc);"onselectstart"in n?r.on("selectstart.drag",Zo,uc):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function kM(e,n){var r=e.document.documentElement,i=Or(e).on("dragstart.drag",null);n&&(i.on("click.drag",Zo,uc),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const bf=e=>()=>e;function Lv(e,{sourceEvent:n,subject:r,target:i,identifier:s,active:l,x:u,y:d,dx:h,dy:p,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:g}})}Lv.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function cW(e){return!e.ctrlKey&&!e.button}function dW(){return this.parentNode}function fW(e,n){return n??{x:e.x,y:e.y}}function hW(){return navigator.maxTouchPoints||"ontouchstart"in this}function pW(){var e=cW,n=dW,r=fW,i=hW,s={},l=Rc("start","drag","end"),u=0,d,h,p,g,y=0;function v(M){M.on("mousedown.drag",x).filter(i).on("touchstart.drag",k).on("touchmove.drag",j,uW).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(M,R){if(!(g||!e.call(this,M,R))){var z=N(this,n.call(this,M,R),M,R,"mouse");z&&(Or(M.view).on("mousemove.drag",_,uc).on("mouseup.drag",C,uc),jM(M.view),xy(M),p=!1,d=M.clientX,h=M.clientY,z("start",M))}}function _(M){if(Zo(M),!p){var R=M.clientX-d,z=M.clientY-h;p=R*R+z*z>y}s.mouse("drag",M)}function C(M){Or(M.view).on("mousemove.drag mouseup.drag",null),kM(M.view,p),Zo(M),s.mouse("end",M)}function k(M,R){if(e.call(this,M,R)){var z=M.changedTouches,P=n.call(this,M,R),D=z.length,$,U;for($=0;$<D;++$)(U=N(this,P,M,R,z[$].identifier,z[$]))&&(xy(M),U("start",M,z[$]))}}function j(M){var R=M.changedTouches,z=R.length,P,D;for(P=0;P<z;++P)(D=s[R[P].identifier])&&(Zo(M),D("drag",M,R[P]))}function E(M){var R=M.changedTouches,z=R.length,P,D;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),P=0;P<z;++P)(D=s[R[P].identifier])&&(xy(M),D("end",M,R[P]))}function N(M,R,z,P,D,$){var U=l.copy(),X=ui($||z,R),K,ae,B;if((B=r.call(M,new Lv("beforestart",{sourceEvent:z,target:v,identifier:D,active:u,x:X[0],y:X[1],dx:0,dy:0,dispatch:U}),P))!=null)return K=B.x-X[0]||0,ae=B.y-X[1]||0,function Z(O,q,I){var H=X,A;switch(O){case"start":s[D]=Z,A=u++;break;case"end":delete s[D],--u;case"drag":X=ui(I||q,R),A=u;break}U.call(O,M,new Lv(O,{sourceEvent:q,subject:B,target:v,identifier:D,active:A,x:X[0]+K,y:X[1]+ae,dx:X[0]-H[0],dy:X[1]-H[1],dispatch:U}),P)}}return v.filter=function(M){return arguments.length?(e=typeof M=="function"?M:bf(!!M),v):e},v.container=function(M){return arguments.length?(n=typeof M=="function"?M:bf(M),v):n},v.subject=function(M){return arguments.length?(r=typeof M=="function"?M:bf(M),v):r},v.touchable=function(M){return arguments.length?(i=typeof M=="function"?M:bf(!!M),v):i},v.on=function(){var M=l.on.apply(l,arguments);return M===l?v:M},v.clickDistance=function(M){return arguments.length?(y=(M=+M)*M,v):Math.sqrt(y)},v}function $0(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function EM(e,n){var r=Object.create(e.prototype);for(var i in n)r[i]=n[i];return r}function Mc(){}var cc=.7,lh=1/cc,Qo="\\s*([+-]?\\d+)\\s*",dc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mW=/^#([0-9a-f]{3,8})$/,gW=new RegExp(`^rgb\\(${Qo},${Qo},${Qo}\\)$`),yW=new RegExp(`^rgb\\(${yi},${yi},${yi}\\)$`),vW=new RegExp(`^rgba\\(${Qo},${Qo},${Qo},${dc}\\)$`),xW=new RegExp(`^rgba\\(${yi},${yi},${yi},${dc}\\)$`),bW=new RegExp(`^hsl\\(${dc},${yi},${yi}\\)$`),wW=new RegExp(`^hsla\\(${dc},${yi},${yi},${dc}\\)$`),vj={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$0(Mc,fc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xj,formatHex:xj,formatHex8:SW,formatHsl:_W,formatRgb:bj,toString:bj});function xj(){return this.rgb().formatHex()}function SW(){return this.rgb().formatHex8()}function _W(){return NM(this).formatHsl()}function bj(){return this.rgb().formatRgb()}function fc(e){var n,r;return e=(e+"").trim().toLowerCase(),(n=mW.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?wj(n):r===3?new Kn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?wf(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?wf(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=gW.exec(e))?new Kn(n[1],n[2],n[3],1):(n=yW.exec(e))?new Kn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=vW.exec(e))?wf(n[1],n[2],n[3],n[4]):(n=xW.exec(e))?wf(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=bW.exec(e))?Cj(n[1],n[2]/100,n[3]/100,1):(n=wW.exec(e))?Cj(n[1],n[2]/100,n[3]/100,n[4]):vj.hasOwnProperty(e)?wj(vj[e]):e==="transparent"?new Kn(NaN,NaN,NaN,0):null}function wj(e){return new Kn(e>>16&255,e>>8&255,e&255,1)}function wf(e,n,r,i){return i<=0&&(e=n=r=NaN),new Kn(e,n,r,i)}function CW(e){return e instanceof Mc||(e=fc(e)),e?(e=e.rgb(),new Kn(e.r,e.g,e.b,e.opacity)):new Kn}function Iv(e,n,r,i){return arguments.length===1?CW(e):new Kn(e,n,r,i??1)}function Kn(e,n,r,i){this.r=+e,this.g=+n,this.b=+r,this.opacity=+i}$0(Kn,Iv,EM(Mc,{brighter(e){return e=e==null?lh:Math.pow(lh,e),new Kn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new Kn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kn(As(this.r),As(this.g),As(this.b),uh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Sj,formatHex:Sj,formatHex8:jW,formatRgb:_j,toString:_j}));function Sj(){return`#${ks(this.r)}${ks(this.g)}${ks(this.b)}`}function jW(){return`#${ks(this.r)}${ks(this.g)}${ks(this.b)}${ks((isNaN(this.opacity)?1:this.opacity)*255)}`}function _j(){const e=uh(this.opacity);return`${e===1?"rgb(":"rgba("}${As(this.r)}, ${As(this.g)}, ${As(this.b)}${e===1?")":`, ${e})`}`}function uh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function As(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ks(e){return e=As(e),(e<16?"0":"")+e.toString(16)}function Cj(e,n,r,i){return i<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new qr(e,n,r,i)}function NM(e){if(e instanceof qr)return new qr(e.h,e.s,e.l,e.opacity);if(e instanceof Mc||(e=fc(e)),!e)return new qr;if(e instanceof qr)return e;e=e.rgb();var n=e.r/255,r=e.g/255,i=e.b/255,s=Math.min(n,r,i),l=Math.max(n,r,i),u=NaN,d=l-s,h=(l+s)/2;return d?(n===l?u=(r-i)/d+(r<i)*6:r===l?u=(i-n)/d+2:u=(n-r)/d+4,d/=h<.5?l+s:2-l-s,u*=60):d=h>0&&h<1?0:u,new qr(u,d,h,e.opacity)}function kW(e,n,r,i){return arguments.length===1?NM(e):new qr(e,n,r,i??1)}function qr(e,n,r,i){this.h=+e,this.s=+n,this.l=+r,this.opacity=+i}$0(qr,kW,EM(Mc,{brighter(e){return e=e==null?lh:Math.pow(lh,e),new qr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new qr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*n,s=2*r-i;return new Kn(by(e>=240?e-240:e+120,s,i),by(e,s,i),by(e<120?e+240:e-120,s,i),this.opacity)},clamp(){return new qr(jj(this.h),Sf(this.s),Sf(this.l),uh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=uh(this.opacity);return`${e===1?"hsl(":"hsla("}${jj(this.h)}, ${Sf(this.s)*100}%, ${Sf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jj(e){return e=(e||0)%360,e<0?e+360:e}function Sf(e){return Math.max(0,Math.min(1,e||0))}function by(e,n,r){return(e<60?n+(r-n)*e/60:e<180?r:e<240?n+(r-n)*(240-e)/60:n)*255}const TM=e=>()=>e;function EW(e,n){return function(r){return e+r*n}}function NW(e,n,r){return e=Math.pow(e,r),n=Math.pow(n,r)-e,r=1/r,function(i){return Math.pow(e+i*n,r)}}function TW(e){return(e=+e)==1?AM:function(n,r){return r-n?NW(n,r,e):TM(isNaN(n)?r:n)}}function AM(e,n){var r=n-e;return r?EW(e,r):TM(isNaN(e)?n:e)}const kj=(function e(n){var r=TW(n);function i(s,l){var u=r((s=Iv(s)).r,(l=Iv(l)).r),d=r(s.g,l.g),h=r(s.b,l.b),p=AM(s.opacity,l.opacity);return function(g){return s.r=u(g),s.g=d(g),s.b=h(g),s.opacity=p(g),s+""}}return i.gamma=e,i})(1);function Va(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}var Vv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wy=new RegExp(Vv.source,"g");function AW(e){return function(){return e}}function RW(e){return function(n){return e(n)+""}}function MW(e,n){var r=Vv.lastIndex=wy.lastIndex=0,i,s,l,u=-1,d=[],h=[];for(e=e+"",n=n+"";(i=Vv.exec(e))&&(s=wy.exec(n));)(l=s.index)>r&&(l=n.slice(r,l),d[u]?d[u]+=l:d[++u]=l),(i=i[0])===(s=s[0])?d[u]?d[u]+=s:d[++u]=s:(d[++u]=null,h.push({i:u,x:Va(i,s)})),r=wy.lastIndex;return r<n.length&&(l=n.slice(r),d[u]?d[u]+=l:d[++u]=l),d.length<2?h[0]?RW(h[0].x):AW(n):(n=h.length,function(p){for(var g=0,y;g<n;++g)d[(y=h[g]).i]=y.x(p);return d.join("")})}var Ej=180/Math.PI,Fv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function RM(e,n,r,i,s,l){var u,d,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*r+n*i)&&(r-=e*h,i-=n*h),(d=Math.sqrt(r*r+i*i))&&(r/=d,i/=d,h/=d),e*i<n*r&&(e=-e,n=-n,h=-h,u=-u),{translateX:s,translateY:l,rotate:Math.atan2(n,e)*Ej,skewX:Math.atan(h)*Ej,scaleX:u,scaleY:d}}var _f;function DW(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Fv:RM(n.a,n.b,n.c,n.d,n.e,n.f)}function OW(e){return e==null||(_f||(_f=document.createElementNS("http://www.w3.org/2000/svg","g")),_f.setAttribute("transform",e),!(e=_f.transform.baseVal.consolidate()))?Fv:(e=e.matrix,RM(e.a,e.b,e.c,e.d,e.e,e.f))}function MM(e,n,r,i){function s(p){return p.length?p.pop()+" ":""}function l(p,g,y,v,x,_){if(p!==y||g!==v){var C=x.push("translate(",null,n,null,r);_.push({i:C-4,x:Va(p,y)},{i:C-2,x:Va(g,v)})}else(y||v)&&x.push("translate("+y+n+v+r)}function u(p,g,y,v){p!==g?(p-g>180?g+=360:g-p>180&&(p+=360),v.push({i:y.push(s(y)+"rotate(",null,i)-2,x:Va(p,g)})):g&&y.push(s(y)+"rotate("+g+i)}function d(p,g,y,v){p!==g?v.push({i:y.push(s(y)+"skewX(",null,i)-2,x:Va(p,g)}):g&&y.push(s(y)+"skewX("+g+i)}function h(p,g,y,v,x,_){if(p!==y||g!==v){var C=x.push(s(x)+"scale(",null,",",null,")");_.push({i:C-4,x:Va(p,y)},{i:C-2,x:Va(g,v)})}else(y!==1||v!==1)&&x.push(s(x)+"scale("+y+","+v+")")}return function(p,g){var y=[],v=[];return p=e(p),g=e(g),l(p.translateX,p.translateY,g.translateX,g.translateY,y,v),u(p.rotate,g.rotate,y,v),d(p.skewX,g.skewX,y,v),h(p.scaleX,p.scaleY,g.scaleX,g.scaleY,y,v),p=g=null,function(x){for(var _=-1,C=v.length,k;++_<C;)y[(k=v[_]).i]=k.x(x);return y.join("")}}}var zW=MM(DW,"px, ","px)","deg)"),PW=MM(OW,", ",")",")"),LW=1e-12;function Nj(e){return((e=Math.exp(e))+1/e)/2}function IW(e){return((e=Math.exp(e))-1/e)/2}function VW(e){return((e=Math.exp(2*e))-1)/(e+1)}const FW=(function e(n,r,i){function s(l,u){var d=l[0],h=l[1],p=l[2],g=u[0],y=u[1],v=u[2],x=g-d,_=y-h,C=x*x+_*_,k,j;if(C<LW)j=Math.log(v/p)/n,k=function(P){return[d+P*x,h+P*_,p*Math.exp(n*P*j)]};else{var E=Math.sqrt(C),N=(v*v-p*p+i*C)/(2*p*r*E),M=(v*v-p*p-i*C)/(2*v*r*E),R=Math.log(Math.sqrt(N*N+1)-N),z=Math.log(Math.sqrt(M*M+1)-M);j=(z-R)/n,k=function(P){var D=P*j,$=Nj(R),U=p/(r*E)*($*VW(n*D+R)-IW(R));return[d+U*x,h+U*_,p*$/Nj(n*D+R)]}}return k.duration=j*1e3*n/Math.SQRT2,k}return s.rho=function(l){var u=Math.max(.001,+l),d=u*u,h=d*d;return e(u,d,h)},s})(Math.SQRT2,2,4);var ol=0,Lu=0,bu=0,DM=1e3,ch,Iu,dh=0,Vs=0,ip=0,hc=typeof performance=="object"&&performance.now?performance:Date,OM=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function H0(){return Vs||(OM(UW),Vs=hc.now()+ip)}function UW(){Vs=0}function fh(){this._call=this._time=this._next=null}fh.prototype=G0.prototype={constructor:fh,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?H0():+r)+(n==null?0:+n),!this._next&&Iu!==this&&(Iu?Iu._next=this:ch=this,Iu=this),this._call=e,this._time=r,Uv()},stop:function(){this._call&&(this._call=null,this._time=1/0,Uv())}};function G0(e,n,r){var i=new fh;return i.restart(e,n,r),i}function BW(){H0(),++ol;for(var e=ch,n;e;)(n=Vs-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ol}function Tj(){Vs=(dh=hc.now())+ip,ol=Lu=0;try{BW()}finally{ol=0,HW(),Vs=0}}function $W(){var e=hc.now(),n=e-dh;n>DM&&(ip-=n,dh=e)}function HW(){for(var e,n=ch,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:ch=r);Iu=e,Uv(i)}function Uv(e){if(!ol){Lu&&(Lu=clearTimeout(Lu));var n=e-Vs;n>24?(e<1/0&&(Lu=setTimeout(Tj,e-hc.now()-ip)),bu&&(bu=clearInterval(bu))):(bu||(dh=hc.now(),bu=setInterval($W,DM)),ol=1,OM(Tj))}}function Aj(e,n,r){var i=new fh;return n=n==null?0:+n,i.restart(s=>{i.stop(),e(s+n)},n,r),i}var GW=Rc("start","end","cancel","interrupt"),qW=[],zM=0,Rj=1,Bv=2,zf=3,Mj=4,$v=5,Pf=6;function ap(e,n,r,i,s,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;YW(e,r,{name:n,index:i,group:s,on:GW,tween:qW,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:zM})}function q0(e,n){var r=ti(e,n);if(r.state>zM)throw new Error("too late; already scheduled");return r}function Si(e,n){var r=ti(e,n);if(r.state>zf)throw new Error("too late; already running");return r}function ti(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function YW(e,n,r){var i=e.__transition,s;i[n]=r,r.timer=G0(l,0,r.time);function l(p){r.state=Rj,r.timer.restart(u,r.delay,r.time),r.delay<=p&&u(p-r.delay)}function u(p){var g,y,v,x;if(r.state!==Rj)return h();for(g in i)if(x=i[g],x.name===r.name){if(x.state===zf)return Aj(u);x.state===Mj?(x.state=Pf,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete i[g]):+g<n&&(x.state=Pf,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete i[g])}if(Aj(function(){r.state===zf&&(r.state=Mj,r.timer.restart(d,r.delay,r.time),d(p))}),r.state=Bv,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Bv){for(r.state=zf,s=new Array(v=r.tween.length),g=0,y=-1;g<v;++g)(x=r.tween[g].value.call(e,e.__data__,r.index,r.group))&&(s[++y]=x);s.length=y+1}}function d(p){for(var g=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(h),r.state=$v,1),y=-1,v=s.length;++y<v;)s[y].call(e,g);r.state===$v&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=Pf,r.timer.stop(),delete i[n];for(var p in i)return;delete e.__transition}}function Lf(e,n){var r=e.__transition,i,s,l=!0,u;if(r){n=n==null?null:n+"";for(u in r){if((i=r[u]).name!==n){l=!1;continue}s=i.state>Bv&&i.state<$v,i.state=Pf,i.timer.stop(),i.on.call(s?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[u]}l&&delete e.__transition}}function XW(e){return this.each(function(){Lf(this,e)})}function KW(e,n){var r,i;return function(){var s=Si(this,e),l=s.tween;if(l!==r){i=r=l;for(var u=0,d=i.length;u<d;++u)if(i[u].name===n){i=i.slice(),i.splice(u,1);break}}s.tween=i}}function WW(e,n,r){var i,s;if(typeof r!="function")throw new Error;return function(){var l=Si(this,e),u=l.tween;if(u!==i){s=(i=u).slice();for(var d={name:n,value:r},h=0,p=s.length;h<p;++h)if(s[h].name===n){s[h]=d;break}h===p&&s.push(d)}l.tween=s}}function ZW(e,n){var r=this._id;if(e+="",arguments.length<2){for(var i=ti(this.node(),r).tween,s=0,l=i.length,u;s<l;++s)if((u=i[s]).name===e)return u.value;return null}return this.each((n==null?KW:WW)(r,e,n))}function Y0(e,n,r){var i=e._id;return e.each(function(){var s=Si(this,i);(s.value||(s.value={}))[n]=r.apply(this,arguments)}),function(s){return ti(s,i).value[n]}}function PM(e,n){var r;return(typeof n=="number"?Va:n instanceof fc?kj:(r=fc(n))?(n=r,kj):MW)(e,n)}function QW(e){return function(){this.removeAttribute(e)}}function JW(e){return function(){this.removeAttributeNS(e.space,e.local)}}function eZ(e,n,r){var i,s=r+"",l;return function(){var u=this.getAttribute(e);return u===s?null:u===i?l:l=n(i=u,r)}}function tZ(e,n,r){var i,s=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===s?null:u===i?l:l=n(i=u,r)}}function nZ(e,n,r){var i,s,l;return function(){var u,d=r(this),h;return d==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=d+"",u===h?null:u===i&&h===s?l:(s=h,l=n(i=u,d)))}}function rZ(e,n,r){var i,s,l;return function(){var u,d=r(this),h;return d==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=d+"",u===h?null:u===i&&h===s?l:(s=h,l=n(i=u,d)))}}function iZ(e,n){var r=rp(e),i=r==="transform"?PW:PM;return this.attrTween(e,typeof n=="function"?(r.local?rZ:nZ)(r,i,Y0(this,"attr."+e,n)):n==null?(r.local?JW:QW)(r):(r.local?tZ:eZ)(r,i,n))}function aZ(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function sZ(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function oZ(e,n){var r,i;function s(){var l=n.apply(this,arguments);return l!==i&&(r=(i=l)&&sZ(e,l)),r}return s._value=n,s}function lZ(e,n){var r,i;function s(){var l=n.apply(this,arguments);return l!==i&&(r=(i=l)&&aZ(e,l)),r}return s._value=n,s}function uZ(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var i=rp(e);return this.tween(r,(i.local?oZ:lZ)(i,n))}function cZ(e,n){return function(){q0(this,e).delay=+n.apply(this,arguments)}}function dZ(e,n){return n=+n,function(){q0(this,e).delay=n}}function fZ(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?cZ:dZ)(n,e)):ti(this.node(),n).delay}function hZ(e,n){return function(){Si(this,e).duration=+n.apply(this,arguments)}}function pZ(e,n){return n=+n,function(){Si(this,e).duration=n}}function mZ(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?hZ:pZ)(n,e)):ti(this.node(),n).duration}function gZ(e,n){if(typeof n!="function")throw new Error;return function(){Si(this,e).ease=n}}function yZ(e){var n=this._id;return arguments.length?this.each(gZ(n,e)):ti(this.node(),n).ease}function vZ(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;Si(this,e).ease=r}}function xZ(e){if(typeof e!="function")throw new Error;return this.each(vZ(this._id,e))}function bZ(e){typeof e!="function"&&(e=mM(e));for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s)for(var l=n[s],u=l.length,d=i[s]=[],h,p=0;p<u;++p)(h=l[p])&&e.call(h,h.__data__,p,l)&&d.push(h);return new aa(i,this._parents,this._name,this._id)}function wZ(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,i=n.length,s=r.length,l=Math.min(i,s),u=new Array(i),d=0;d<l;++d)for(var h=n[d],p=r[d],g=h.length,y=u[d]=new Array(g),v,x=0;x<g;++x)(v=h[x]||p[x])&&(y[x]=v);for(;d<i;++d)u[d]=n[d];return new aa(u,this._parents,this._name,this._id)}function SZ(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function _Z(e,n,r){var i,s,l=SZ(n)?q0:Si;return function(){var u=l(this,e),d=u.on;d!==i&&(s=(i=d).copy()).on(n,r),u.on=s}}function CZ(e,n){var r=this._id;return arguments.length<2?ti(this.node(),r).on.on(e):this.each(_Z(r,e,n))}function jZ(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function kZ(){return this.on("end.remove",jZ(this._id))}function EZ(e){var n=this._name,r=this._id;typeof e!="function"&&(e=U0(e));for(var i=this._groups,s=i.length,l=new Array(s),u=0;u<s;++u)for(var d=i[u],h=d.length,p=l[u]=new Array(h),g,y,v=0;v<h;++v)(g=d[v])&&(y=e.call(g,g.__data__,v,d))&&("__data__"in g&&(y.__data__=g.__data__),p[v]=y,ap(p[v],n,r,v,p,ti(g,r)));return new aa(l,this._parents,n,r)}function NZ(e){var n=this._name,r=this._id;typeof e!="function"&&(e=pM(e));for(var i=this._groups,s=i.length,l=[],u=[],d=0;d<s;++d)for(var h=i[d],p=h.length,g,y=0;y<p;++y)if(g=h[y]){for(var v=e.call(g,g.__data__,y,h),x,_=ti(g,r),C=0,k=v.length;C<k;++C)(x=v[C])&&ap(x,n,r,C,v,_);l.push(v),u.push(g)}return new aa(l,u,n,r)}var TZ=Ac.prototype.constructor;function AZ(){return new TZ(this._groups,this._parents)}function RZ(e,n){var r,i,s;return function(){var l=sl(this,e),u=(this.style.removeProperty(e),sl(this,e));return l===u?null:l===r&&u===i?s:s=n(r=l,i=u)}}function LM(e){return function(){this.style.removeProperty(e)}}function MZ(e,n,r){var i,s=r+"",l;return function(){var u=sl(this,e);return u===s?null:u===i?l:l=n(i=u,r)}}function DZ(e,n,r){var i,s,l;return function(){var u=sl(this,e),d=r(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(e),sl(this,e))),u===h?null:u===i&&h===s?l:(s=h,l=n(i=u,d))}}function OZ(e,n){var r,i,s,l="style."+n,u="end."+l,d;return function(){var h=Si(this,e),p=h.on,g=h.value[l]==null?d||(d=LM(n)):void 0;(p!==r||s!==g)&&(i=(r=p).copy()).on(u,s=g),h.on=i}}function zZ(e,n,r){var i=(e+="")=="transform"?zW:PM;return n==null?this.styleTween(e,RZ(e,i)).on("end.style."+e,LM(e)):typeof n=="function"?this.styleTween(e,DZ(e,i,Y0(this,"style."+e,n))).each(OZ(this._id,e)):this.styleTween(e,MZ(e,i,n),r).on("end.style."+e,null)}function PZ(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function LZ(e,n,r){var i,s;function l(){var u=n.apply(this,arguments);return u!==s&&(i=(s=u)&&PZ(e,u,r)),i}return l._value=n,l}function IZ(e,n,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,LZ(e,n,r??""))}function VZ(e){return function(){this.textContent=e}}function FZ(e){return function(){var n=e(this);this.textContent=n??""}}function UZ(e){return this.tween("text",typeof e=="function"?FZ(Y0(this,"text",e)):VZ(e==null?"":e+""))}function BZ(e){return function(n){this.textContent=e.call(this,n)}}function $Z(e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&BZ(s)),n}return i._value=e,i}function HZ(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,$Z(e))}function GZ(){for(var e=this._name,n=this._id,r=IM(),i=this._groups,s=i.length,l=0;l<s;++l)for(var u=i[l],d=u.length,h,p=0;p<d;++p)if(h=u[p]){var g=ti(h,n);ap(h,e,r,p,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new aa(i,this._parents,e,r)}function qZ(){var e,n,r=this,i=r._id,s=r.size();return new Promise(function(l,u){var d={value:u},h={value:function(){--s===0&&l()}};r.each(function(){var p=Si(this,i),g=p.on;g!==e&&(n=(e=g).copy(),n._.cancel.push(d),n._.interrupt.push(d),n._.end.push(h)),p.on=n}),s===0&&l()})}var YZ=0;function aa(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function IM(){return++YZ}var Hi=Ac.prototype;aa.prototype={constructor:aa,select:EZ,selectAll:NZ,selectChild:Hi.selectChild,selectChildren:Hi.selectChildren,filter:bZ,merge:wZ,selection:AZ,transition:GZ,call:Hi.call,nodes:Hi.nodes,node:Hi.node,size:Hi.size,empty:Hi.empty,each:Hi.each,on:CZ,attr:iZ,attrTween:uZ,style:zZ,styleTween:IZ,text:UZ,textTween:HZ,remove:kZ,tween:ZW,delay:fZ,duration:mZ,ease:yZ,easeVarying:xZ,end:qZ,[Symbol.iterator]:Hi[Symbol.iterator]};function XZ(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var KZ={time:null,delay:0,duration:250,ease:XZ};function WZ(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function ZZ(e){var n,r;e instanceof aa?(n=e._id,e=e._name):(n=IM(),(r=KZ).time=H0(),e=e==null?null:e+"");for(var i=this._groups,s=i.length,l=0;l<s;++l)for(var u=i[l],d=u.length,h,p=0;p<d;++p)(h=u[p])&&ap(h,e,n,p,u,r||WZ(h,n));return new aa(i,this._parents,e,n)}Ac.prototype.interrupt=XW;Ac.prototype.transition=ZZ;const Cf=e=>()=>e;function QZ(e,{sourceEvent:n,target:r,transform:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function Zi(e,n,r){this.k=e,this.x=n,this.y=r}Zi.prototype={constructor:Zi,scale:function(e){return e===1?this:new Zi(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Zi(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var X0=new Zi(1,0,0);li.prototype=Zi.prototype;function li(e){for(;!e.__zoom;)if(!(e=e.parentNode))return X0;return e.__zoom}function Sy(e){e.stopImmediatePropagation()}function wu(e){e.preventDefault(),e.stopImmediatePropagation()}function JZ(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function eQ(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Dj(){return this.__zoom||X0}function tQ(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nQ(){return navigator.maxTouchPoints||"ontouchstart"in this}function rQ(e,n,r){var i=e.invertX(n[0][0])-r[0][0],s=e.invertX(n[1][0])-r[1][0],l=e.invertY(n[0][1])-r[0][1],u=e.invertY(n[1][1])-r[1][1];return e.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function iQ(){var e=JZ,n=eQ,r=rQ,i=tQ,s=nQ,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,h=FW,p=Rc("start","zoom","end"),g,y,v,x=500,_=150,C=0,k=10;function j(B){B.property("__zoom",Dj).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",U).filter(s).on("touchstart.zoom",X).on("touchmove.zoom",K).on("touchend.zoom touchcancel.zoom",ae).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(B,Z,O,q){var I=B.selection?B.selection():B;I.property("__zoom",Dj),B!==I?R(B,Z,O,q):I.interrupt().each(function(){z(this,arguments).event(q).start().zoom(null,typeof Z=="function"?Z.apply(this,arguments):Z).end()})},j.scaleBy=function(B,Z,O,q){j.scaleTo(B,function(){var I=this.__zoom.k,H=typeof Z=="function"?Z.apply(this,arguments):Z;return I*H},O,q)},j.scaleTo=function(B,Z,O,q){j.transform(B,function(){var I=n.apply(this,arguments),H=this.__zoom,A=O==null?M(I):typeof O=="function"?O.apply(this,arguments):O,F=H.invert(A),G=typeof Z=="function"?Z.apply(this,arguments):Z;return r(N(E(H,G),A,F),I,u)},O,q)},j.translateBy=function(B,Z,O,q){j.transform(B,function(){return r(this.__zoom.translate(typeof Z=="function"?Z.apply(this,arguments):Z,typeof O=="function"?O.apply(this,arguments):O),n.apply(this,arguments),u)},null,q)},j.translateTo=function(B,Z,O,q,I){j.transform(B,function(){var H=n.apply(this,arguments),A=this.__zoom,F=q==null?M(H):typeof q=="function"?q.apply(this,arguments):q;return r(X0.translate(F[0],F[1]).scale(A.k).translate(typeof Z=="function"?-Z.apply(this,arguments):-Z,typeof O=="function"?-O.apply(this,arguments):-O),H,u)},q,I)};function E(B,Z){return Z=Math.max(l[0],Math.min(l[1],Z)),Z===B.k?B:new Zi(Z,B.x,B.y)}function N(B,Z,O){var q=Z[0]-O[0]*B.k,I=Z[1]-O[1]*B.k;return q===B.x&&I===B.y?B:new Zi(B.k,q,I)}function M(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function R(B,Z,O,q){B.on("start.zoom",function(){z(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(q).end()}).tween("zoom",function(){var I=this,H=arguments,A=z(I,H).event(q),F=n.apply(I,H),G=O==null?M(F):typeof O=="function"?O.apply(I,H):O,L=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ee=I.__zoom,ce=typeof Z=="function"?Z.apply(I,H):Z,Y=h(ee.invert(G).concat(L/ee.k),ce.invert(G).concat(L/ce.k));return function(Q){if(Q===1)Q=ce;else{var re=Y(Q),fe=L/re[2];Q=new Zi(fe,G[0]-re[0]*fe,G[1]-re[1]*fe)}A.zoom(null,Q)}})}function z(B,Z,O){return!O&&B.__zooming||new P(B,Z)}function P(B,Z){this.that=B,this.args=Z,this.active=0,this.sourceEvent=null,this.extent=n.apply(B,Z),this.taps=0}P.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,Z){return this.mouse&&B!=="mouse"&&(this.mouse[1]=Z.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=Z.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=Z.invert(this.touch1[0])),this.that.__zoom=Z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var Z=Or(this.that).datum();p.call(B,this.that,new QZ(B,{sourceEvent:this.sourceEvent,target:j,transform:this.that.__zoom,dispatch:p}),Z)}};function D(B,...Z){if(!e.apply(this,arguments))return;var O=z(this,Z).event(B),q=this.__zoom,I=Math.max(l[0],Math.min(l[1],q.k*Math.pow(2,i.apply(this,arguments)))),H=ui(B);if(O.wheel)(O.mouse[0][0]!==H[0]||O.mouse[0][1]!==H[1])&&(O.mouse[1]=q.invert(O.mouse[0]=H)),clearTimeout(O.wheel);else{if(q.k===I)return;O.mouse=[H,q.invert(H)],Lf(this),O.start()}wu(B),O.wheel=setTimeout(A,_),O.zoom("mouse",r(N(E(q,I),O.mouse[0],O.mouse[1]),O.extent,u));function A(){O.wheel=null,O.end()}}function $(B,...Z){if(v||!e.apply(this,arguments))return;var O=B.currentTarget,q=z(this,Z,!0).event(B),I=Or(B.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",L,!0),H=ui(B,O),A=B.clientX,F=B.clientY;jM(B.view),Sy(B),q.mouse=[H,this.__zoom.invert(H)],Lf(this),q.start();function G(ee){if(wu(ee),!q.moved){var ce=ee.clientX-A,Y=ee.clientY-F;q.moved=ce*ce+Y*Y>C}q.event(ee).zoom("mouse",r(N(q.that.__zoom,q.mouse[0]=ui(ee,O),q.mouse[1]),q.extent,u))}function L(ee){I.on("mousemove.zoom mouseup.zoom",null),kM(ee.view,q.moved),wu(ee),q.event(ee).end()}}function U(B,...Z){if(e.apply(this,arguments)){var O=this.__zoom,q=ui(B.changedTouches?B.changedTouches[0]:B,this),I=O.invert(q),H=O.k*(B.shiftKey?.5:2),A=r(N(E(O,H),q,I),n.apply(this,Z),u);wu(B),d>0?Or(this).transition().duration(d).call(R,A,q,B):Or(this).call(j.transform,A,q,B)}}function X(B,...Z){if(e.apply(this,arguments)){var O=B.touches,q=O.length,I=z(this,Z,B.changedTouches.length===q).event(B),H,A,F,G;for(Sy(B),A=0;A<q;++A)F=O[A],G=ui(F,this),G=[G,this.__zoom.invert(G),F.identifier],I.touch0?!I.touch1&&I.touch0[2]!==G[2]&&(I.touch1=G,I.taps=0):(I.touch0=G,H=!0,I.taps=1+!!g);g&&(g=clearTimeout(g)),H&&(I.taps<2&&(y=G[0],g=setTimeout(function(){g=null},x)),Lf(this),I.start())}}function K(B,...Z){if(this.__zooming){var O=z(this,Z).event(B),q=B.changedTouches,I=q.length,H,A,F,G;for(wu(B),H=0;H<I;++H)A=q[H],F=ui(A,this),O.touch0&&O.touch0[2]===A.identifier?O.touch0[0]=F:O.touch1&&O.touch1[2]===A.identifier&&(O.touch1[0]=F);if(A=O.that.__zoom,O.touch1){var L=O.touch0[0],ee=O.touch0[1],ce=O.touch1[0],Y=O.touch1[1],Q=(Q=ce[0]-L[0])*Q+(Q=ce[1]-L[1])*Q,re=(re=Y[0]-ee[0])*re+(re=Y[1]-ee[1])*re;A=E(A,Math.sqrt(Q/re)),F=[(L[0]+ce[0])/2,(L[1]+ce[1])/2],G=[(ee[0]+Y[0])/2,(ee[1]+Y[1])/2]}else if(O.touch0)F=O.touch0[0],G=O.touch0[1];else return;O.zoom("touch",r(N(A,F,G),O.extent,u))}}function ae(B,...Z){if(this.__zooming){var O=z(this,Z).event(B),q=B.changedTouches,I=q.length,H,A;for(Sy(B),v&&clearTimeout(v),v=setTimeout(function(){v=null},x),H=0;H<I;++H)A=q[H],O.touch0&&O.touch0[2]===A.identifier?delete O.touch0:O.touch1&&O.touch1[2]===A.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(A=ui(A,this),Math.hypot(y[0]-A[0],y[1]-A[1])<k)){var F=Or(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return j.wheelDelta=function(B){return arguments.length?(i=typeof B=="function"?B:Cf(+B),j):i},j.filter=function(B){return arguments.length?(e=typeof B=="function"?B:Cf(!!B),j):e},j.touchable=function(B){return arguments.length?(s=typeof B=="function"?B:Cf(!!B),j):s},j.extent=function(B){return arguments.length?(n=typeof B=="function"?B:Cf([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),j):n},j.scaleExtent=function(B){return arguments.length?(l[0]=+B[0],l[1]=+B[1],j):[l[0],l[1]]},j.translateExtent=function(B){return arguments.length?(u[0][0]=+B[0][0],u[1][0]=+B[1][0],u[0][1]=+B[0][1],u[1][1]=+B[1][1],j):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},j.constrain=function(B){return arguments.length?(r=B,j):r},j.duration=function(B){return arguments.length?(d=+B,j):d},j.interpolate=function(B){return arguments.length?(h=B,j):h},j.on=function(){var B=p.on.apply(p,arguments);return B===p?j:B},j.clickDistance=function(B){return arguments.length?(C=(B=+B)*B,j):Math.sqrt(C)},j.tapDistance=function(B){return arguments.length?(k=+B,j):k},j}class Oj extends Map{constructor(n,r=oQ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),n!=null)for(const[i,s]of n)this.set(i,s)}get(n){return super.get(zj(this,n))}has(n){return super.has(zj(this,n))}set(n,r){return super.set(aQ(this,n),r)}delete(n){return super.delete(sQ(this,n))}}function zj({_intern:e,_key:n},r){const i=n(r);return e.has(i)?e.get(i):r}function aQ({_intern:e,_key:n},r){const i=n(r);return e.has(i)?e.get(i):(e.set(i,r),r)}function sQ({_intern:e,_key:n},r){const i=n(r);return e.has(i)&&(r=e.get(i),e.delete(i)),r}function oQ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Pj(e,n){let r;if(n===void 0)for(const i of e)i!=null&&(r<i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let s of e)(s=n(s,++i,e))!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}return r}function Lj(e,n){let r;if(n===void 0)for(const i of e)i!=null&&(r>i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let s of e)(s=n(s,++i,e))!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}return r}function lQ(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var uQ=typeof global=="object"&&global&&global.Object===Object&&global,cQ=typeof self=="object"&&self&&self.Object===Object&&self,VM=uQ||cQ||Function("return this")(),hh=VM.Symbol,FM=Object.prototype,dQ=FM.hasOwnProperty,fQ=FM.toString,Su=hh?hh.toStringTag:void 0;function hQ(e){var n=dQ.call(e,Su),r=e[Su];try{e[Su]=void 0;var i=!0}catch{}var s=fQ.call(e);return i&&(n?e[Su]=r:delete e[Su]),s}var pQ=Object.prototype,mQ=pQ.toString;function gQ(e){return mQ.call(e)}var yQ="[object Null]",vQ="[object Undefined]",Ij=hh?hh.toStringTag:void 0;function xQ(e){return e==null?e===void 0?vQ:yQ:Ij&&Ij in Object(e)?hQ(e):gQ(e)}function bQ(e){return e!=null&&typeof e=="object"}var wQ="[object Symbol]";function SQ(e){return typeof e=="symbol"||bQ(e)&&xQ(e)==wQ}var _Q=/\s/;function CQ(e){for(var n=e.length;n--&&_Q.test(e.charAt(n)););return n}var jQ=/^\s+/;function kQ(e){return e&&e.slice(0,CQ(e)+1).replace(jQ,"")}function ph(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Vj=NaN,EQ=/^[-+]0x[0-9a-f]+$/i,NQ=/^0b[01]+$/i,TQ=/^0o[0-7]+$/i,AQ=parseInt;function Fj(e){if(typeof e=="number")return e;if(SQ(e))return Vj;if(ph(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ph(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=kQ(e);var r=NQ.test(e);return r||TQ.test(e)?AQ(e.slice(2),r?2:8):EQ.test(e)?Vj:+e}var _y=function(){return VM.Date.now()},RQ="Expected a function",MQ=Math.max,DQ=Math.min;function UM(e,n,r){var i,s,l,u,d,h,p=0,g=!1,y=!1,v=!0;if(typeof e!="function")throw new TypeError(RQ);n=Fj(n)||0,ph(r)&&(g=!!r.leading,y="maxWait"in r,l=y?MQ(Fj(r.maxWait)||0,n):l,v="trailing"in r?!!r.trailing:v);function x(z){var P=i,D=s;return i=s=void 0,p=z,u=e.apply(D,P),u}function _(z){return p=z,d=setTimeout(j,n),g?x(z):u}function C(z){var P=z-h,D=z-p,$=n-P;return y?DQ($,l-D):$}function k(z){var P=z-h,D=z-p;return h===void 0||P>=n||P<0||y&&D>=l}function j(){var z=_y();if(k(z))return E(z);d=setTimeout(j,C(z))}function E(z){return d=void 0,v&&i?x(z):(i=s=void 0,u)}function N(){d!==void 0&&clearTimeout(d),p=0,i=h=s=d=void 0}function M(){return d===void 0?u:E(_y())}function R(){var z=_y(),P=k(z);if(i=arguments,s=this,h=z,P){if(d===void 0)return _(h);if(y)return clearTimeout(d),d=setTimeout(j,n),x(h)}return d===void 0&&(d=setTimeout(j,n)),u}return R.cancel=N,R.flush=M,R}var OQ="Expected a function";function zQ(e,n,r){var i=!0,s=!0;if(typeof e!="function")throw new TypeError(OQ);return ph(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),UM(e,n,{leading:i,maxWait:n,trailing:s})}var Rs=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Rs.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Rs.Bounce.In(e*2)*.5:Rs.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),Vu=function(){return performance.now()},BM=(function(){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,n)}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var s=0,l=r;s<l.length;s++){var u=l[s];(n=u._group)===null||n===void 0||n.remove(u),u._group=this,this._tweens[u.getId()]=u,this._tweensAddedDuringUpdate[u.getId()]=u}},e.prototype.remove=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,s=n;i<s.length;i++){var l=s[i];l._group=void 0,delete this._tweens[l.getId()],delete this._tweensAddedDuringUpdate[l.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(n){return!n.isPlaying()})},e.prototype.update=function(n,r){n===void 0&&(n=Vu()),r===void 0&&(r=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<i.length;s++){var l=this._tweens[i[s]],u=!r;l&&l.update(n,u)===!1&&!r&&this.remove(l)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),Hv={Linear:function(e,n){var r=e.length-1,i=r*n,s=Math.floor(i),l=Hv.Utils.Linear;return n<0?l(e[0],e[1],i):n>1?l(e[r],e[r-1],r-i):l(e[s],e[s+1>r?r:s+1],i-s)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},$M=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Gv=new BM,Uj=(function(){function e(n,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Rs.Linear.None,this._interpolationFunction=Hv.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=$M.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=n,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=Gv,Gv.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=Vu()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var l in this._valuesEnd)s[l]=this._valuesEnd[l];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,s,l){for(var u in i){var d=n[u],h=Array.isArray(d),p=h?"array":typeof d,g=!h&&Array.isArray(i[u]);if(!(p==="undefined"||p==="function")){if(g){var y=i[u];if(y.length===0)continue;for(var v=[d],x=0,_=y.length;x<_;x+=1){var C=this._handleRelativeValue(d,y[x]);if(isNaN(C)){g=!1,console.warn("Found invalid interpolation list. Skipping.");break}v.push(C)}g&&(i[u]=v)}if((p==="object"||h)&&d&&!g){r[u]=h?[]:{};var k=d;for(var j in k)r[u][j]=k[j];s[u]=h?[]:{};var y=i[u];if(!this._isDynamic){var E={};for(var j in y)E[j]=y[j];i[u]=y=E}this._setupProperties(k,r[u],y,s[u],l)}else(typeof r[u]>"u"||l)&&(r[u]=d),h||(r[u]*=1),g?s[u]=i[u].slice().reverse():s[u]=r[u]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(n){return n===void 0&&(n=Vu()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this)},e.prototype.resume=function(n){return n===void 0&&(n=Vu()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n?(n.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var n;return(n=this._group)===null||n===void 0||n.remove(this),this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=Rs.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=Hv.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){var i=this,s;if(n===void 0&&(n=Vu()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var l;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var u=n-this._startTime,d=this._duration+((s=this._repeatDelayTime)!==null&&s!==void 0?s:this._delayTime),h=this._duration+this._repeat*d,p=function(){if(i._duration===0||u>h)return 1;var C=Math.trunc(u/d),k=u-C*d,j=Math.min(k/i._duration,1);return j===0&&u===i._duration?1:j},g=p(),y=this._easingFunction(g);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,y),this._onUpdateCallback&&this._onUpdateCallback(this._object,g),this._duration===0||u>=this._duration)if(this._repeat>0){var v=Math.min(Math.trunc((u-this._duration)/d)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=v);for(l in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[l]=="string"&&(this._valuesStartRepeat[l]=this._valuesStartRepeat[l]+parseFloat(this._valuesEnd[l])),this._yoyo&&this._swapEndStartRepeatValues(l),this._valuesStart[l]=this._valuesStartRepeat[l];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=d*v,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var x=0,_=this._chainedTweens.length;x<_;x++)this._chainedTweens[x].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,i,s){for(var l in i)if(r[l]!==void 0){var u=r[l]||0,d=i[l],h=Array.isArray(n[l]),p=Array.isArray(d),g=!h&&p;g?n[l]=this._interpolationFunction(d,s):typeof d=="object"&&d?this._updateProperties(n[l],u,d,s):(d=this._handleRelativeValue(u,d),typeof d=="number"&&(n[l]=u+(d-u)*s))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e.autoStartOnUpdate=!1,e})();$M.nextId;var xi=Gv;xi.getAll.bind(xi);xi.removeAll.bind(xi);xi.add.bind(xi);xi.remove.bind(xi);xi.update.bind(xi);function Bj(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function PQ(e){if(Array.isArray(e))return e}function LQ(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function IQ(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function VQ(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,s,l,u,d=[],h=!0,p=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(h=(i=l.call(r)).done)&&(d.push(i.value),d.length!==n);h=!0);}catch(g){p=!0,s=g}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(p)throw s}}return d}}function FQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
88
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UQ(e,n){return PQ(e)||VQ(e,n)||BQ(e,n)||FQ()}function BQ(e,n){if(e){if(typeof e=="string")return Bj(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bj(e,n):void 0}}var $Q=IQ(function e(n,r){var i=r.default,s=i===void 0?null:i,l=r.triggerUpdate,u=l===void 0?!0:l,d=r.onChange,h=d===void 0?function(p,g){}:d;LQ(this,e),this.name=n,this.defaultVal=s,this.triggerUpdate=u,this.onChange=h});function K0(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,s=i===void 0?{}:i,l=e.methods,u=l===void 0?{}:l,d=e.aliases,h=d===void 0?{}:d,p=e.init,g=p===void 0?function(){}:p,y=e.update,v=y===void 0?function(){}:y,x=Object.keys(s).map(function(_){return new $Q(_,s[_])});return function _(){for(var C=arguments.length,k=new Array(C),j=0;j<C;j++)k[j]=arguments[j];var E=!!(this instanceof _&&this.constructor),N=E?k.shift():void 0,M=k[0],R=M===void 0?{}:M,z=Object.assign({},r instanceof Function?r(R):r,{initialised:!1}),P={};function D(X){return $(X,R),U(),D}var $=function(K,ae){g.call(D,K,z,ae),z.initialised=!0},U=UM(function(){z.initialised&&(v.call(D,z,P),P={})},1);return x.forEach(function(X){D[X.name]=K(X);function K(ae){var B=ae.name,Z=ae.triggerUpdate,O=Z===void 0?!1:Z,q=ae.onChange,I=q===void 0?function(F,G){}:q,H=ae.defaultVal,A=H===void 0?null:H;return function(F){var G=z[B];if(!arguments.length)return G;var L=F===void 0?A:F;return z[B]=L,I.call(D,L,z,G),!P.hasOwnProperty(B)&&(P[B]=G),O&&U(),D}}}),Object.keys(u).forEach(function(X){D[X]=function(){for(var K,ae=arguments.length,B=new Array(ae),Z=0;Z<ae;Z++)B[Z]=arguments[Z];return(K=u[X]).call.apply(K,[D,z].concat(B))}}),Object.entries(h).forEach(function(X){var K=UQ(X,2),ae=K[0],B=K[1];return D[ae]=D[B]}),D.resetProps=function(){return x.forEach(function(X){D[X.name](X.defaultVal)}),D},D.resetProps(),z._rerender=U,E&&N&&D(N),D}}var gt=(function(e){return typeof e=="function"?e:typeof e=="string"?function(n){return n[e]}:function(n){return e}});function mh(e){"@babel/helpers - typeof";return mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},mh(e)}var HQ=/^\s+/,GQ=/\s+$/;function ze(e,n){if(e=e||"",n=n||{},e instanceof ze)return e;if(!(this instanceof ze))return new ze(e,n);var r=qQ(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}ze.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,i,s,l,u,d;return r=n.r/255,i=n.g/255,s=n.b/255,r<=.03928?l=r/12.92:l=Math.pow((r+.055)/1.055,2.4),i<=.03928?u=i/12.92:u=Math.pow((i+.055)/1.055,2.4),s<=.03928?d=s/12.92:d=Math.pow((s+.055)/1.055,2.4),.2126*l+.7152*u+.0722*d},setAlpha:function(n){return this._a=HM(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=Hj(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=Hj(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),s=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+s+"%)":"hsva("+r+", "+i+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var n=$j(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=$j(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),s=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+s+"%)":"hsla("+r+", "+i+"%, "+s+"%, "+this._roundA+")"},toHex:function(n){return Gj(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return WQ(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Vt(this._r,255)*100)+"%",g:Math.round(Vt(this._g,255)*100)+"%",b:Math.round(Vt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Vt(this._r,255)*100)+"%, "+Math.round(Vt(this._g,255)*100)+"%, "+Math.round(Vt(this._b,255)*100)+"%)":"rgba("+Math.round(Vt(this._r,255)*100)+"%, "+Math.round(Vt(this._g,255)*100)+"%, "+Math.round(Vt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:lJ[Gj(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+qj(this._r,this._g,this._b,this._a),i=r,s=this._gradientType?"GradientType = 1, ":"";if(n){var l=ze(n);i="#"+qj(l._r,l._g,l._b,l._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+r+",endColorstr="+i+")"},toString:function(n){var r=!!n;n=n||this._format;var i=!1,s=this._a<1&&this._a>=0,l=!r&&s&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return l?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return ze(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(eJ,arguments)},brighten:function(){return this._applyModification(tJ,arguments)},darken:function(){return this._applyModification(nJ,arguments)},desaturate:function(){return this._applyModification(ZQ,arguments)},saturate:function(){return this._applyModification(QQ,arguments)},greyscale:function(){return this._applyModification(JQ,arguments)},spin:function(){return this._applyModification(rJ,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(sJ,arguments)},complement:function(){return this._applyCombination(iJ,arguments)},monochromatic:function(){return this._applyCombination(oJ,arguments)},splitcomplement:function(){return this._applyCombination(aJ,arguments)},triad:function(){return this._applyCombination(Yj,[3])},tetrad:function(){return this._applyCombination(Yj,[4])}};ze.fromRatio=function(e,n){if(mh(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=Fu(e[i]));e=r}return ze(e,n)};function qQ(e){var n={r:0,g:0,b:0},r=1,i=null,s=null,l=null,u=!1,d=!1;return typeof e=="string"&&(e=fJ(e)),mh(e)=="object"&&(Gi(e.r)&&Gi(e.g)&&Gi(e.b)?(n=YQ(e.r,e.g,e.b),u=!0,d=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Gi(e.h)&&Gi(e.s)&&Gi(e.v)?(i=Fu(e.s),s=Fu(e.v),n=KQ(e.h,i,s),u=!0,d="hsv"):Gi(e.h)&&Gi(e.s)&&Gi(e.l)&&(i=Fu(e.s),l=Fu(e.l),n=XQ(e.h,i,l),u=!0,d="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=HM(r),{ok:u,format:e.format||d,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function YQ(e,n,r){return{r:Vt(e,255)*255,g:Vt(n,255)*255,b:Vt(r,255)*255}}function $j(e,n,r){e=Vt(e,255),n=Vt(n,255),r=Vt(r,255);var i=Math.max(e,n,r),s=Math.min(e,n,r),l,u,d=(i+s)/2;if(i==s)l=u=0;else{var h=i-s;switch(u=d>.5?h/(2-i-s):h/(i+s),i){case e:l=(n-r)/h+(n<r?6:0);break;case n:l=(r-e)/h+2;break;case r:l=(e-n)/h+4;break}l/=6}return{h:l,s:u,l:d}}function XQ(e,n,r){var i,s,l;e=Vt(e,360),n=Vt(n,100),r=Vt(r,100);function u(p,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(g-p)*6*y:y<1/2?g:y<2/3?p+(g-p)*(2/3-y)*6:p}if(n===0)i=s=l=r;else{var d=r<.5?r*(1+n):r+n-r*n,h=2*r-d;i=u(h,d,e+1/3),s=u(h,d,e),l=u(h,d,e-1/3)}return{r:i*255,g:s*255,b:l*255}}function Hj(e,n,r){e=Vt(e,255),n=Vt(n,255),r=Vt(r,255);var i=Math.max(e,n,r),s=Math.min(e,n,r),l,u,d=i,h=i-s;if(u=i===0?0:h/i,i==s)l=0;else{switch(i){case e:l=(n-r)/h+(n<r?6:0);break;case n:l=(r-e)/h+2;break;case r:l=(e-n)/h+4;break}l/=6}return{h:l,s:u,v:d}}function KQ(e,n,r){e=Vt(e,360)*6,n=Vt(n,100),r=Vt(r,100);var i=Math.floor(e),s=e-i,l=r*(1-n),u=r*(1-s*n),d=r*(1-(1-s)*n),h=i%6,p=[r,u,l,l,d,r][h],g=[d,r,r,u,l,l][h],y=[l,l,d,r,r,u][h];return{r:p*255,g:g*255,b:y*255}}function Gj(e,n,r,i){var s=[Yr(Math.round(e).toString(16)),Yr(Math.round(n).toString(16)),Yr(Math.round(r).toString(16))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function WQ(e,n,r,i,s){var l=[Yr(Math.round(e).toString(16)),Yr(Math.round(n).toString(16)),Yr(Math.round(r).toString(16)),Yr(GM(i))];return s&&l[0].charAt(0)==l[0].charAt(1)&&l[1].charAt(0)==l[1].charAt(1)&&l[2].charAt(0)==l[2].charAt(1)&&l[3].charAt(0)==l[3].charAt(1)?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0)+l[3].charAt(0):l.join("")}function qj(e,n,r,i){var s=[Yr(GM(i)),Yr(Math.round(e).toString(16)),Yr(Math.round(n).toString(16)),Yr(Math.round(r).toString(16))];return s.join("")}ze.equals=function(e,n){return!e||!n?!1:ze(e).toRgbString()==ze(n).toRgbString()};ze.random=function(){return ze.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function ZQ(e,n){n=n===0?0:n||10;var r=ze(e).toHsl();return r.s-=n/100,r.s=sp(r.s),ze(r)}function QQ(e,n){n=n===0?0:n||10;var r=ze(e).toHsl();return r.s+=n/100,r.s=sp(r.s),ze(r)}function JQ(e){return ze(e).desaturate(100)}function eJ(e,n){n=n===0?0:n||10;var r=ze(e).toHsl();return r.l+=n/100,r.l=sp(r.l),ze(r)}function tJ(e,n){n=n===0?0:n||10;var r=ze(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),ze(r)}function nJ(e,n){n=n===0?0:n||10;var r=ze(e).toHsl();return r.l-=n/100,r.l=sp(r.l),ze(r)}function rJ(e,n){var r=ze(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,ze(r)}function iJ(e){var n=ze(e).toHsl();return n.h=(n.h+180)%360,ze(n)}function Yj(e,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=ze(e).toHsl(),i=[ze(e)],s=360/n,l=1;l<n;l++)i.push(ze({h:(r.h+l*s)%360,s:r.s,l:r.l}));return i}function aJ(e){var n=ze(e).toHsl(),r=n.h;return[ze(e),ze({h:(r+72)%360,s:n.s,l:n.l}),ze({h:(r+216)%360,s:n.s,l:n.l})]}function sJ(e,n,r){n=n||6,r=r||30;var i=ze(e).toHsl(),s=360/r,l=[ze(e)];for(i.h=(i.h-(s*n>>1)+720)%360;--n;)i.h=(i.h+s)%360,l.push(ze(i));return l}function oJ(e,n){n=n||6;for(var r=ze(e).toHsv(),i=r.h,s=r.s,l=r.v,u=[],d=1/n;n--;)u.push(ze({h:i,s,v:l})),l=(l+d)%1;return u}ze.mix=function(e,n,r){r=r===0?0:r||50;var i=ze(e).toRgb(),s=ze(n).toRgb(),l=r/100,u={r:(s.r-i.r)*l+i.r,g:(s.g-i.g)*l+i.g,b:(s.b-i.b)*l+i.b,a:(s.a-i.a)*l+i.a};return ze(u)};ze.readability=function(e,n){var r=ze(e),i=ze(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};ze.isReadable=function(e,n,r){var i=ze.readability(e,n),s,l;switch(l=!1,s=hJ(r),s.level+s.size){case"AAsmall":case"AAAlarge":l=i>=4.5;break;case"AAlarge":l=i>=3;break;case"AAAsmall":l=i>=7;break}return l};ze.mostReadable=function(e,n,r){var i=null,s=0,l,u,d,h;r=r||{},u=r.includeFallbackColors,d=r.level,h=r.size;for(var p=0;p<n.length;p++)l=ze.readability(e,n[p]),l>s&&(s=l,i=ze(n[p]));return ze.isReadable(e,i,{level:d,size:h})||!u?i:(r.includeFallbackColors=!1,ze.mostReadable(e,["#fff","#000"],r))};var qv=ze.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},lJ=ze.hexNames=uJ(qv);function uJ(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function HM(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Vt(e,n){cJ(e)&&(e="100%");var r=dJ(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function sp(e){return Math.min(1,Math.max(0,e))}function lr(e){return parseInt(e,16)}function cJ(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function dJ(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Yr(e){return e.length==1?"0"+e:""+e}function Fu(e){return e<=1&&(e=e*100+"%"),e}function GM(e){return Math.round(parseFloat(e)*255).toString(16)}function Xj(e){return lr(e)/255}var Fr=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",s="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+s),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Gi(e){return!!Fr.CSS_UNIT.exec(e)}function fJ(e){e=e.replace(HQ,"").replace(GQ,"").toLowerCase();var n=!1;if(qv[e])e=qv[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Fr.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Fr.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Fr.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Fr.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Fr.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Fr.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Fr.hex8.exec(e))?{r:lr(r[1]),g:lr(r[2]),b:lr(r[3]),a:Xj(r[4]),format:n?"name":"hex8"}:(r=Fr.hex6.exec(e))?{r:lr(r[1]),g:lr(r[2]),b:lr(r[3]),format:n?"name":"hex"}:(r=Fr.hex4.exec(e))?{r:lr(r[1]+""+r[1]),g:lr(r[2]+""+r[2]),b:lr(r[3]+""+r[3]),a:Xj(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=Fr.hex3.exec(e))?{r:lr(r[1]+""+r[1]),g:lr(r[2]+""+r[2]),b:lr(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function hJ(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function Yv(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function pJ(e){if(Array.isArray(e))return Yv(e)}function qM(e,n,r){if(typeof e=="function"?e===n:e.has(n))return arguments.length<3?n:r;throw new TypeError("Private element is not present on this object")}function mJ(e,n){if(n.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gJ(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Er(e,n){return e.get(qM(e,n))}function Kj(e,n,r){mJ(e,n),n.set(e,r)}function Wj(e,n,r){return e.set(qM(e,n),r),r}function yJ(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_J(i.key),i)}}function vJ(e,n,r){return n&&yJ(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
89
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wJ(e){return pJ(e)||xJ(e)||CJ(e)||bJ()}function SJ(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _J(e){var n=SJ(e,"string");return typeof n=="symbol"?n:n+""}function CJ(e,n){if(e){if(typeof e=="string")return Yv(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yv(e,n):void 0}}var jJ=123,kJ=function(n){return"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0"))},YM=function(n,r,i){return(n<<16)+(r<<8)+i},EJ=function(n){var r=ze(n).toRgb(),i=r.r,s=r.g,l=r.b;return YM(i,s,l)},Zj=function(n,r){return n*jJ%Math.pow(2,r)},bs=new WeakMap,qi=new WeakMap,NJ=(function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;gJ(this,e),Kj(this,bs,void 0),Kj(this,qi,void 0),Wj(qi,this,n),this.reset()}return vJ(e,[{key:"reset",value:function(){Wj(bs,this,["__reserved for background__"])}},{key:"register",value:function(r){if(Er(bs,this).length>=Math.pow(2,24-Er(qi,this)))return null;var i=Er(bs,this).length,s=Zj(i,Er(qi,this)),l=kJ(i+(s<<24-Er(qi,this)));return Er(bs,this).push(r),l}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?EJ(r):YM.apply(void 0,wJ(r));if(!i)return null;var s=i&Math.pow(2,24-Er(qi,this))-1,l=i>>24-Er(qi,this)&Math.pow(2,Er(qi,this))-1;return Zj(s,Er(qi,this))!==l||s>=Er(bs,this).length?null:Er(bs,this)[s]}}])})(),Dc,Ft,XM,KM,Fa,Qj,WM,ZM,QM,W0,Xv,Kv,gh={},yh=[],TJ=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,op=Array.isArray;function hi(e,n){for(var r in n)e[r]=n[r];return e}function Z0(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function AJ(e,n,r){var i,s,l,u={};for(l in n)l=="key"?i=n[l]:l=="ref"?s=n[l]:u[l]=n[l];if(arguments.length>2&&(u.children=arguments.length>3?Dc.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(l in e.defaultProps)u[l]===void 0&&(u[l]=e.defaultProps[l]);return Ku(e,u,i,s,null)}function Ku(e,n,r,i,s){var l={type:e,props:n,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++XM,__i:-1,__u:0};return s==null&&Ft.vnode!=null&&Ft.vnode(l),l}function lp(e){return e.children}function If(e,n){this.props=e,this.context=n}function ll(e,n){if(n==null)return e.__?ll(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ll(e):null}function RJ(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],s=[],l=hi({},n);l.__v=n.__v+1,Ft.vnode&&Ft.vnode(l),Q0(e.__P,l,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??ll(n),!!(32&n.__u),s),l.__v=n.__v,l.__.__k[l.__i]=l,nD(i,l,s),n.__e=n.__=null,l.__e!=r&&JM(l)}}function JM(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),JM(e)}function Jj(e){(!e.__d&&(e.__d=!0)&&Fa.push(e)&&!vh.__r++||Qj!=Ft.debounceRendering)&&((Qj=Ft.debounceRendering)||WM)(vh)}function vh(){try{for(var e,n=1;Fa.length;)Fa.length>n&&Fa.sort(ZM),e=Fa.shift(),n=Fa.length,RJ(e)}finally{Fa.length=vh.__r=0}}function eD(e,n,r,i,s,l,u,d,h,p,g){var y,v,x,_,C,k,j,E=i&&i.__k||yh,N=n.length;for(h=MJ(r,n,E,h,N),y=0;y<N;y++)(x=r.__k[y])!=null&&(v=x.__i!=-1&&E[x.__i]||gh,x.__i=y,k=Q0(e,x,v,s,l,u,d,h,p,g),_=x.__e,x.ref&&v.ref!=x.ref&&(v.ref&&J0(v.ref,null,x),g.push(x.ref,x.__c||_,x)),C==null&&_!=null&&(C=_),(j=!!(4&x.__u))||v.__k===x.__k?h=tD(x,h,e,j):typeof x.type=="function"&&k!==void 0?h=k:_&&(h=_.nextSibling),x.__u&=-7);return r.__e=C,h}function MJ(e,n,r,i,s){var l,u,d,h,p,g=r.length,y=g,v=0;for(e.__k=new Array(s),l=0;l<s;l++)(u=n[l])!=null&&typeof u!="boolean"&&typeof u!="function"?(typeof u=="string"||typeof u=="number"||typeof u=="bigint"||u.constructor==String?u=e.__k[l]=Ku(null,u,null,null,null):op(u)?u=e.__k[l]=Ku(lp,{children:u},null,null,null):u.constructor===void 0&&u.__b>0?u=e.__k[l]=Ku(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[l]=u,h=l+v,u.__=e,u.__b=e.__b+1,d=null,(p=u.__i=DJ(u,r,h,y))!=-1&&(y--,(d=r[p])&&(d.__u|=2)),d==null||d.__v==null?(p==-1&&(s>g?v--:s<g&&v++),typeof u.type!="function"&&(u.__u|=4)):p!=h&&(p==h-1?v--:p==h+1?v++:(p>h?v--:v++,u.__u|=4))):e.__k[l]=null;if(y)for(l=0;l<g;l++)(d=r[l])!=null&&(2&d.__u)==0&&(d.__e==i&&(i=ll(d)),iD(d,d));return i}function tD(e,n,r,i){var s,l;if(typeof e.type=="function"){for(s=e.__k,l=0;s&&l<s.length;l++)s[l]&&(s[l].__=e,n=tD(s[l],n,r,i));return n}e.__e!=n&&(i&&(n&&e.type&&!n.parentNode&&(n=ll(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function DJ(e,n,r,i){var s,l,u,d=e.key,h=e.type,p=n[r],g=p!=null&&(2&p.__u)==0;if(p===null&&d==null||g&&d==p.key&&h==p.type)return r;if(i>(g?1:0)){for(s=r-1,l=r+1;s>=0||l<n.length;)if((p=n[u=s>=0?s--:l++])!=null&&(2&p.__u)==0&&d==p.key&&h==p.type)return u}return-1}function ek(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||TJ.test(n)?r:r+"px"}function jf(e,n,r,i,s){var l,u;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(n in i)r&&n in r||ek(e.style,n,"");if(r)for(n in r)i&&r[n]==i[n]||ek(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")l=n!=(n=n.replace(QM,"$1")),u=n.toLowerCase(),n=u in e||n=="onFocusOut"||n=="onFocusIn"?u.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+l]=r,r?i?r.u=i.u:(r.u=W0,e.addEventListener(n,l?Kv:Xv,l)):e.removeEventListener(n,l?Kv:Xv,l);else{if(s=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function tk(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=W0++;else if(n.t<r.u)return;return r(Ft.event?Ft.event(n):n)}}}function Q0(e,n,r,i,s,l,u,d,h,p){var g,y,v,x,_,C,k,j,E,N,M,R,z,P,D,$=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(h=!!(32&r.__u),l=[d=n.__e=r.__e]),(g=Ft.__b)&&g(n);e:if(typeof $=="function")try{if(j=n.props,E=$.prototype&&$.prototype.render,N=(g=$.contextType)&&i[g.__c],M=g?N?N.props.value:g.__:i,r.__c?k=(y=n.__c=r.__c).__=y.__E:(E?n.__c=y=new $(j,M):(n.__c=y=new If(j,M),y.constructor=$,y.render=zJ),N&&N.sub(y),y.state||(y.state={}),y.__n=i,v=y.__d=!0,y.__h=[],y._sb=[]),E&&y.__s==null&&(y.__s=y.state),E&&$.getDerivedStateFromProps!=null&&(y.__s==y.state&&(y.__s=hi({},y.__s)),hi(y.__s,$.getDerivedStateFromProps(j,y.__s))),x=y.props,_=y.state,y.__v=n,v)E&&$.getDerivedStateFromProps==null&&y.componentWillMount!=null&&y.componentWillMount(),E&&y.componentDidMount!=null&&y.__h.push(y.componentDidMount);else{if(E&&$.getDerivedStateFromProps==null&&j!==x&&y.componentWillReceiveProps!=null&&y.componentWillReceiveProps(j,M),n.__v==r.__v||!y.__e&&y.shouldComponentUpdate!=null&&y.shouldComponentUpdate(j,y.__s,M)===!1){n.__v!=r.__v&&(y.props=j,y.state=y.__s,y.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(U){U&&(U.__=n)}),yh.push.apply(y.__h,y._sb),y._sb=[],y.__h.length&&u.push(y);break e}y.componentWillUpdate!=null&&y.componentWillUpdate(j,y.__s,M),E&&y.componentDidUpdate!=null&&y.__h.push(function(){y.componentDidUpdate(x,_,C)})}if(y.context=M,y.props=j,y.__P=e,y.__e=!1,R=Ft.__r,z=0,E)y.state=y.__s,y.__d=!1,R&&R(n),g=y.render(y.props,y.state,y.context),yh.push.apply(y.__h,y._sb),y._sb=[];else do y.__d=!1,R&&R(n),g=y.render(y.props,y.state,y.context),y.state=y.__s;while(y.__d&&++z<25);y.state=y.__s,y.getChildContext!=null&&(i=hi(hi({},i),y.getChildContext())),E&&!v&&y.getSnapshotBeforeUpdate!=null&&(C=y.getSnapshotBeforeUpdate(x,_)),P=g!=null&&g.type===lp&&g.key==null?rD(g.props.children):g,d=eD(e,op(P)?P:[P],n,r,i,s,l,u,d,h,p),y.base=n.__e,n.__u&=-161,y.__h.length&&u.push(y),k&&(y.__E=y.__=null)}catch(U){if(n.__v=null,h||l!=null)if(U.then){for(n.__u|=h?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;l[l.indexOf(d)]=null,n.__e=d}else{for(D=l.length;D--;)Z0(l[D]);Wv(n)}else n.__e=r.__e,n.__k=r.__k,U.then||Wv(n);Ft.__e(U,n,r)}else l==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):d=n.__e=OJ(r.__e,n,r,i,s,l,u,h,p);return(g=Ft.diffed)&&g(n),128&n.__u?void 0:d}function Wv(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Wv))}function nD(e,n,r){for(var i=0;i<r.length;i++)J0(r[i],r[++i],r[++i]);Ft.__c&&Ft.__c(n,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(l){l.call(s)})}catch(l){Ft.__e(l,s.__v)}})}function rD(e){return typeof e!="object"||e==null||e.__b>0?e:op(e)?e.map(rD):hi({},e)}function OJ(e,n,r,i,s,l,u,d,h){var p,g,y,v,x,_,C,k=r.props||gh,j=n.props,E=n.type;if(E=="svg"?s="http://www.w3.org/2000/svg":E=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),l!=null){for(p=0;p<l.length;p++)if((x=l[p])&&"setAttribute"in x==!!E&&(E?x.localName==E:x.nodeType==3)){e=x,l[p]=null;break}}if(e==null){if(E==null)return document.createTextNode(j);e=document.createElementNS(s,E,j.is&&j),d&&(Ft.__m&&Ft.__m(n,l),d=!1),l=null}if(E==null)k===j||d&&e.data==j||(e.data=j);else{if(l=l&&Dc.call(e.childNodes),!d&&l!=null)for(k={},p=0;p<e.attributes.length;p++)k[(x=e.attributes[p]).name]=x.value;for(p in k)x=k[p],p=="dangerouslySetInnerHTML"?y=x:p=="children"||p in j||p=="value"&&"defaultValue"in j||p=="checked"&&"defaultChecked"in j||jf(e,p,null,x,s);for(p in j)x=j[p],p=="children"?v=x:p=="dangerouslySetInnerHTML"?g=x:p=="value"?_=x:p=="checked"?C=x:d&&typeof x!="function"||k[p]===x||jf(e,p,x,k[p],s);if(g)d||y&&(g.__html==y.__html||g.__html==e.innerHTML)||(e.innerHTML=g.__html),n.__k=[];else if(y&&(e.innerHTML=""),eD(n.type=="template"?e.content:e,op(v)?v:[v],n,r,i,E=="foreignObject"?"http://www.w3.org/1999/xhtml":s,l,u,l?l[0]:r.__k&&ll(r,0),d,h),l!=null)for(p=l.length;p--;)Z0(l[p]);d||(p="value",E=="progress"&&_==null?e.removeAttribute("value"):_!=null&&(_!==e[p]||E=="progress"&&!_||E=="option"&&_!=k[p])&&jf(e,p,_,k[p],s),p="checked",C!=null&&C!=e[p]&&jf(e,p,C,k[p],s))}return e}function J0(e,n,r){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(s){Ft.__e(s,r)}}function iD(e,n,r){var i,s;if(Ft.unmount&&Ft.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||J0(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(l){Ft.__e(l,n)}i.base=i.__P=null}if(i=e.__k)for(s=0;s<i.length;s++)i[s]&&iD(i[s],n,r||typeof e.type!="function");r||Z0(e.__e),e.__c=e.__=e.__e=void 0}function zJ(e,n,r){return this.constructor(e,r)}function PJ(e,n,r){var i,s,l,u;n==document&&(n=document.documentElement),Ft.__&&Ft.__(e,n),s=(i=!1)?null:n.__k,l=[],u=[],Q0(n,e=n.__k=AJ(lp,null,[e]),s||gh,gh,n.namespaceURI,s?null:n.firstChild?Dc.call(n.childNodes):null,l,s?s.__e:n.firstChild,i,u),nD(l,e,u)}function aD(e,n,r){var i,s,l,u,d=hi({},e.props);for(l in e.type&&e.type.defaultProps&&(u=e.type.defaultProps),n)l=="key"?i=n[l]:l=="ref"?s=n[l]:d[l]=n[l]===void 0&&u!=null?u[l]:n[l];return arguments.length>2&&(d.children=arguments.length>3?Dc.call(arguments,2):r),Ku(e.type,d,i||e.key,s||e.ref,null)}Dc=yh.slice,Ft={__e:function(e,n,r,i){for(var s,l,u;n=n.__;)if((s=n.__c)&&!s.__)try{if((l=s.constructor)&&l.getDerivedStateFromError!=null&&(s.setState(l.getDerivedStateFromError(e)),u=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,i||{}),u=s.__d),u)return s.__E=s}catch(d){e=d}throw e}},XM=0,KM=function(e){return e!=null&&e.constructor===void 0},If.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=hi({},this.state),typeof e=="function"&&(e=e(hi({},r),this.props)),e&&hi(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Jj(this))},If.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jj(this))},If.prototype.render=lp,Fa=[],WM=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ZM=function(e,n){return e.__v.__b-n.__v.__b},vh.__r=0,QM=/(PointerCapture)$|Capture$/i,W0=0,Xv=tk(!1),Kv=tk(!0);function nk(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function LJ(e){if(Array.isArray(e))return e}function IJ(e,n,r){return(n=HJ(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function VJ(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,s,l,u,d=[],h=!0,p=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(h=(i=l.call(r)).done)&&(d.push(i.value),d.length!==n);h=!0);}catch(g){p=!0,s=g}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(p)throw s}}return d}}function FJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
90
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rk(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,i)}return r}function UJ(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?rk(Object(r),!0).forEach(function(i){IJ(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rk(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function BJ(e,n){return LJ(e)||VJ(e,n)||GJ(e,n)||FJ()}function $J(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function HJ(e){var n=$J(e,"string");return typeof n=="symbol"?n:n+""}function xh(e){"@babel/helpers - typeof";return xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},xh(e)}function GJ(e,n){if(e){if(typeof e=="string")return nk(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nk(e,n):void 0}}var Zv=function(n){if(xh(n)!=="object")return n;var r=aD(n);if(r.props){var i;r.props=UJ({},r.props),r!=null&&(i=r.props)!==null&&i!==void 0&&i.children&&(r.props.children=Array.isArray(r.props.children)?r.props.children.map(Zv):Zv(r.props.children))}return r},qJ=function(n){return KM(aD(n))},YJ=function(n,r){delete r.__k,PJ(Zv(n),r)};function XJ(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",r==="top"&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}var KJ=`.float-tooltip-kap {
|
|
91
|
+
position: absolute;
|
|
92
|
+
width: max-content; /* prevent shrinking near right edge */
|
|
93
|
+
max-width: max(50%, 150px);
|
|
94
|
+
padding: 3px 5px;
|
|
95
|
+
border-radius: 3px;
|
|
96
|
+
font: 12px sans-serif;
|
|
97
|
+
color: #eee;
|
|
98
|
+
background: rgba(0,0,0,0.6);
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
}
|
|
101
|
+
`;XJ(KJ);var WJ=K0({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.style,l=s===void 0?{}:s,u=!!n&&xh(n)==="object"&&!!n.node&&typeof n.node=="function",d=Or(u?n.node():n);d.style("position")==="static"&&d.style("position","relative"),r.tooltipEl=d.append("div").attr("class","float-tooltip-kap"),Object.entries(l).forEach(function(p){var g=BJ(p,2),y=g[0],v=g[1];return r.tooltipEl.style(y,v)}),r.tooltipEl.style("left","-10000px").style("display","none");var h="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,d.on("mousemove.".concat(h),function(p){r.mouseInside=!0;var g=ui(p),y=d.node(),v=y.offsetWidth,x=y.offsetHeight,_=[r.offsetX===null||r.offsetX===void 0?"-".concat(g[0]/v*100,"%"):typeof r.offsetX=="number"?"calc(-50% + ".concat(r.offsetX,"px)"):r.offsetX,r.offsetY===null||r.offsetY===void 0?x>130&&x-g[1]<100?"calc(-100% - 6px)":"21px":typeof r.offsetY=="number"?r.offsetY<0?"calc(-100% - ".concat(Math.abs(r.offsetY),"px)"):"".concat(r.offsetY,"px"):r.offsetY];r.tooltipEl.style("left",g[0]+"px").style("top",g[1]+"px").style("transform","translate(".concat(_.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),d.on("mouseover.".concat(h),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),d.on("mouseout.".concat(h),function(){r.mouseInside=!1,r.tooltipEl.style("display","none")})},update:function(n){n.tooltipEl.style("display",n.content&&n.mouseInside?"inline":"none"),n.content?n.content instanceof HTMLElement?(n.tooltipEl.text(""),n.tooltipEl.append(function(){return n.content})):typeof n.content=="string"?n.tooltipEl.html(n.content):qJ(n.content)?(n.tooltipEl.text(""),YJ(n.content,n.tooltipEl.node())):(n.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",n.content,n.content.toString())):n.tooltipEl.text("")}});function ZJ(e,n,r){var i,s=1;e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function l(){var u,d=i.length,h,p=0,g=0,y=0;for(u=0;u<d;++u)h=i[u],p+=h.x||0,g+=h.y||0,y+=h.z||0;for(p=(p/d-e)*s,g=(g/d-n)*s,y=(y/d-r)*s,u=0;u<d;++u)h=i[u],p&&(h.x-=p),g&&(h.y-=g),y&&(h.z-=y)}return l.initialize=function(u){i=u},l.x=function(u){return arguments.length?(e=+u,l):e},l.y=function(u){return arguments.length?(n=+u,l):n},l.z=function(u){return arguments.length?(r=+u,l):r},l.strength=function(u){return arguments.length?(s=+u,l):s},l}function QJ(e){const n=+this._x.call(null,e);return sD(this.cover(n),n,e)}function sD(e,n,r){if(isNaN(n))return e;var i,s=e._root,l={data:r},u=e._x0,d=e._x1,h,p,g,y,v;if(!s)return e._root=l,e;for(;s.length;)if((g=n>=(h=(u+d)/2))?u=h:d=h,i=s,!(s=s[y=+g]))return i[y]=l,e;if(p=+e._x.call(null,s.data),n===p)return l.next=s,i?i[y]=l:e._root=l,e;do i=i?i[y]=new Array(2):e._root=new Array(2),(g=n>=(h=(u+d)/2))?u=h:d=h;while((y=+g)==(v=+(p>=h)));return i[v]=s,i[y]=l,e}function JJ(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n);let i=1/0,s=-1/0;for(let l=0,u;l<n;++l)isNaN(u=+this._x.call(null,e[l]))||(r[l]=u,u<i&&(i=u),u>s&&(s=u));if(i>s)return this;this.cover(i).cover(s);for(let l=0;l<n;++l)sD(this,r[l],e[l]);return this}function eee(e){if(isNaN(e=+e))return this;var n=this._x0,r=this._x1;if(isNaN(n))r=(n=Math.floor(e))+1;else{for(var i=r-n||1,s=this._root,l,u;n>e||e>=r;)switch(u=+(e<n),l=new Array(2),l[u]=s,s=l,i*=2,u){case 0:r=n+i;break;case 1:n=r-i;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._x1=r,this}function tee(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function nee(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function ta(e,n,r){this.node=e,this.x0=n,this.x1=r}function ree(e,n){var r,i=this._x0,s,l,u=this._x1,d=[],h=this._root,p,g;for(h&&d.push(new ta(h,i,u)),n==null?n=1/0:(i=e-n,u=e+n);p=d.pop();)if(!(!(h=p.node)||(s=p.x0)>u||(l=p.x1)<i))if(h.length){var y=(s+l)/2;d.push(new ta(h[1],y,l),new ta(h[0],s,y)),(g=+(e>=y))&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var v=Math.abs(e-+this._x.call(null,h.data));v<n&&(n=v,i=e-v,u=e+v,r=h.data)}return r}function iee(e){if(isNaN(h=+this._x.call(null,e)))return this;var n,r=this._root,i,s,l,u=this._x0,d=this._x1,h,p,g,y,v;if(!r)return this;if(r.length)for(;;){if((g=h>=(p=(u+d)/2))?u=p:d=p,n=r,!(r=r[y=+g]))return this;if(!r.length)break;n[y+1&1]&&(i=n,v=y)}for(;r.data!==e;)if(s=r,!(r=r.next))return this;return(l=r.next)&&delete r.next,s?(l?s.next=l:delete s.next,this):n?(l?n[y]=l:delete n[y],(r=n[0]||n[1])&&r===(n[1]||n[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=l,this)}function aee(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function see(){return this._root}function oee(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function lee(e){var n=[],r,i=this._root,s,l,u;for(i&&n.push(new ta(i,this._x0,this._x1));r=n.pop();)if(!e(i=r.node,l=r.x0,u=r.x1)&&i.length){var d=(l+u)/2;(s=i[1])&&n.push(new ta(s,d,u)),(s=i[0])&&n.push(new ta(s,l,d))}return this}function uee(e){var n=[],r=[],i;for(this._root&&n.push(new ta(this._root,this._x0,this._x1));i=n.pop();){var s=i.node;if(s.length){var l,u=i.x0,d=i.x1,h=(u+d)/2;(l=s[0])&&n.push(new ta(l,u,h)),(l=s[1])&&n.push(new ta(l,h,d))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.x1);return this}function cee(e){return e[0]}function dee(e){return arguments.length?(this._x=e,this):this._x}function oD(e,n){var r=new eb(n??cee,NaN,NaN);return e==null?r:r.addAll(e)}function eb(e,n,r){this._x=e,this._x0=n,this._x1=r,this._root=void 0}function ik(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var Jn=oD.prototype=eb.prototype;Jn.copy=function(){var e=new eb(this._x,this._x0,this._x1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=ik(n),e;for(r=[{source:n,target:e._root=new Array(2)}];n=r.pop();)for(var s=0;s<2;++s)(i=n.source[s])&&(i.length?r.push({source:i,target:n.target[s]=new Array(2)}):n.target[s]=ik(i));return e};Jn.add=QJ;Jn.addAll=JJ;Jn.cover=eee;Jn.data=tee;Jn.extent=nee;Jn.find=ree;Jn.remove=iee;Jn.removeAll=aee;Jn.root=see;Jn.size=oee;Jn.visit=lee;Jn.visitAfter=uee;Jn.x=dee;function fee(e){const n=+this._x.call(null,e),r=+this._y.call(null,e);return lD(this.cover(n,r),n,r,e)}function lD(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var s,l=e._root,u={data:i},d=e._x0,h=e._y0,p=e._x1,g=e._y1,y,v,x,_,C,k,j,E;if(!l)return e._root=u,e;for(;l.length;)if((C=n>=(y=(d+p)/2))?d=y:p=y,(k=r>=(v=(h+g)/2))?h=v:g=v,s=l,!(l=l[j=k<<1|C]))return s[j]=u,e;if(x=+e._x.call(null,l.data),_=+e._y.call(null,l.data),n===x&&r===_)return u.next=l,s?s[j]=u:e._root=u,e;do s=s?s[j]=new Array(4):e._root=new Array(4),(C=n>=(y=(d+p)/2))?d=y:p=y,(k=r>=(v=(h+g)/2))?h=v:g=v;while((j=k<<1|C)===(E=(_>=v)<<1|x>=y));return s[E]=l,s[j]=u,e}function hee(e){var n,r,i=e.length,s,l,u=new Array(i),d=new Array(i),h=1/0,p=1/0,g=-1/0,y=-1/0;for(r=0;r<i;++r)isNaN(s=+this._x.call(null,n=e[r]))||isNaN(l=+this._y.call(null,n))||(u[r]=s,d[r]=l,s<h&&(h=s),s>g&&(g=s),l<p&&(p=l),l>y&&(y=l));if(h>g||p>y)return this;for(this.cover(h,p).cover(g,y),r=0;r<i;++r)lD(this,u[r],d[r],e[r]);return this}function pee(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,s=this._x1,l=this._y1;if(isNaN(r))s=(r=Math.floor(e))+1,l=(i=Math.floor(n))+1;else{for(var u=s-r||1,d=this._root,h,p;r>e||e>=s||i>n||n>=l;)switch(p=(n<i)<<1|e<r,h=new Array(4),h[p]=d,d=h,u*=2,p){case 0:s=r+u,l=i+u;break;case 1:r=s-u,l=i+u;break;case 2:s=r+u,i=l-u;break;case 3:r=s-u,i=l-u;break}this._root&&this._root.length&&(this._root=d)}return this._x0=r,this._y0=i,this._x1=s,this._y1=l,this}function mee(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function gee(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Ln(e,n,r,i,s){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=s}function yee(e,n,r){var i,s=this._x0,l=this._y0,u,d,h,p,g=this._x1,y=this._y1,v=[],x=this._root,_,C;for(x&&v.push(new Ln(x,s,l,g,y)),r==null?r=1/0:(s=e-r,l=n-r,g=e+r,y=n+r,r*=r);_=v.pop();)if(!(!(x=_.node)||(u=_.x0)>g||(d=_.y0)>y||(h=_.x1)<s||(p=_.y1)<l))if(x.length){var k=(u+h)/2,j=(d+p)/2;v.push(new Ln(x[3],k,j,h,p),new Ln(x[2],u,j,k,p),new Ln(x[1],k,d,h,j),new Ln(x[0],u,d,k,j)),(C=(n>=j)<<1|e>=k)&&(_=v[v.length-1],v[v.length-1]=v[v.length-1-C],v[v.length-1-C]=_)}else{var E=e-+this._x.call(null,x.data),N=n-+this._y.call(null,x.data),M=E*E+N*N;if(M<r){var R=Math.sqrt(r=M);s=e-R,l=n-R,g=e+R,y=n+R,i=x.data}}return i}function vee(e){if(isNaN(g=+this._x.call(null,e))||isNaN(y=+this._y.call(null,e)))return this;var n,r=this._root,i,s,l,u=this._x0,d=this._y0,h=this._x1,p=this._y1,g,y,v,x,_,C,k,j;if(!r)return this;if(r.length)for(;;){if((_=g>=(v=(u+h)/2))?u=v:h=v,(C=y>=(x=(d+p)/2))?d=x:p=x,n=r,!(r=r[k=C<<1|_]))return this;if(!r.length)break;(n[k+1&3]||n[k+2&3]||n[k+3&3])&&(i=n,j=k)}for(;r.data!==e;)if(s=r,!(r=r.next))return this;return(l=r.next)&&delete r.next,s?(l?s.next=l:delete s.next,this):n?(l?n[k]=l:delete n[k],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[j]=r:this._root=r),this):(this._root=l,this)}function xee(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function bee(){return this._root}function wee(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function See(e){var n=[],r,i=this._root,s,l,u,d,h;for(i&&n.push(new Ln(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,l=r.x0,u=r.y0,d=r.x1,h=r.y1)&&i.length){var p=(l+d)/2,g=(u+h)/2;(s=i[3])&&n.push(new Ln(s,p,g,d,h)),(s=i[2])&&n.push(new Ln(s,l,g,p,h)),(s=i[1])&&n.push(new Ln(s,p,u,d,g)),(s=i[0])&&n.push(new Ln(s,l,u,p,g))}return this}function _ee(e){var n=[],r=[],i;for(this._root&&n.push(new Ln(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var s=i.node;if(s.length){var l,u=i.x0,d=i.y0,h=i.x1,p=i.y1,g=(u+h)/2,y=(d+p)/2;(l=s[0])&&n.push(new Ln(l,u,d,g,y)),(l=s[1])&&n.push(new Ln(l,g,d,h,y)),(l=s[2])&&n.push(new Ln(l,u,y,g,p)),(l=s[3])&&n.push(new Ln(l,g,y,h,p))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Cee(e){return e[0]}function jee(e){return arguments.length?(this._x=e,this):this._x}function kee(e){return e[1]}function Eee(e){return arguments.length?(this._y=e,this):this._y}function uD(e,n,r){var i=new tb(n??Cee,r??kee,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function tb(e,n,r,i,s,l){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=s,this._y1=l,this._root=void 0}function ak(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var Vn=uD.prototype=tb.prototype;Vn.copy=function(){var e=new tb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=ak(n),e;for(r=[{source:n,target:e._root=new Array(4)}];n=r.pop();)for(var s=0;s<4;++s)(i=n.source[s])&&(i.length?r.push({source:i,target:n.target[s]=new Array(4)}):n.target[s]=ak(i));return e};Vn.add=fee;Vn.addAll=hee;Vn.cover=pee;Vn.data=mee;Vn.extent=gee;Vn.find=yee;Vn.remove=vee;Vn.removeAll=xee;Vn.root=bee;Vn.size=wee;Vn.visit=See;Vn.visitAfter=_ee;Vn.x=jee;Vn.y=Eee;function Nee(e){const n=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return cD(this.cover(n,r,i),n,r,i,e)}function cD(e,n,r,i,s){if(isNaN(n)||isNaN(r)||isNaN(i))return e;var l,u=e._root,d={data:s},h=e._x0,p=e._y0,g=e._z0,y=e._x1,v=e._y1,x=e._z1,_,C,k,j,E,N,M,R,z,P,D;if(!u)return e._root=d,e;for(;u.length;)if((M=n>=(_=(h+y)/2))?h=_:y=_,(R=r>=(C=(p+v)/2))?p=C:v=C,(z=i>=(k=(g+x)/2))?g=k:x=k,l=u,!(u=u[P=z<<2|R<<1|M]))return l[P]=d,e;if(j=+e._x.call(null,u.data),E=+e._y.call(null,u.data),N=+e._z.call(null,u.data),n===j&&r===E&&i===N)return d.next=u,l?l[P]=d:e._root=d,e;do l=l?l[P]=new Array(8):e._root=new Array(8),(M=n>=(_=(h+y)/2))?h=_:y=_,(R=r>=(C=(p+v)/2))?p=C:v=C,(z=i>=(k=(g+x)/2))?g=k:x=k;while((P=z<<2|R<<1|M)===(D=(N>=k)<<2|(E>=C)<<1|j>=_));return l[D]=u,l[P]=d,e}function Tee(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n),i=new Float64Array(n),s=new Float64Array(n);let l=1/0,u=1/0,d=1/0,h=-1/0,p=-1/0,g=-1/0;for(let y=0,v,x,_,C;y<n;++y)isNaN(x=+this._x.call(null,v=e[y]))||isNaN(_=+this._y.call(null,v))||isNaN(C=+this._z.call(null,v))||(r[y]=x,i[y]=_,s[y]=C,x<l&&(l=x),x>h&&(h=x),_<u&&(u=_),_>p&&(p=_),C<d&&(d=C),C>g&&(g=C));if(l>h||u>p||d>g)return this;this.cover(l,u,d).cover(h,p,g);for(let y=0;y<n;++y)cD(this,r[y],i[y],s[y],e[y]);return this}function Aee(e,n,r){if(isNaN(e=+e)||isNaN(n=+n)||isNaN(r=+r))return this;var i=this._x0,s=this._y0,l=this._z0,u=this._x1,d=this._y1,h=this._z1;if(isNaN(i))u=(i=Math.floor(e))+1,d=(s=Math.floor(n))+1,h=(l=Math.floor(r))+1;else{for(var p=u-i||1,g=this._root,y,v;i>e||e>=u||s>n||n>=d||l>r||r>=h;)switch(v=(r<l)<<2|(n<s)<<1|e<i,y=new Array(8),y[v]=g,g=y,p*=2,v){case 0:u=i+p,d=s+p,h=l+p;break;case 1:i=u-p,d=s+p,h=l+p;break;case 2:u=i+p,s=d-p,h=l+p;break;case 3:i=u-p,s=d-p,h=l+p;break;case 4:u=i+p,d=s+p,l=h-p;break;case 5:i=u-p,d=s+p,l=h-p;break;case 6:u=i+p,s=d-p,l=h-p;break;case 7:i=u-p,s=d-p,l=h-p;break}this._root&&this._root.length&&(this._root=g)}return this._x0=i,this._y0=s,this._z0=l,this._x1=u,this._y1=d,this._z1=h,this}function Ree(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Mee(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function Nt(e,n,r,i,s,l,u){this.node=e,this.x0=n,this.y0=r,this.z0=i,this.x1=s,this.y1=l,this.z1=u}function Dee(e,n,r,i){var s,l=this._x0,u=this._y0,d=this._z0,h,p,g,y,v,x,_=this._x1,C=this._y1,k=this._z1,j=[],E=this._root,N,M;for(E&&j.push(new Nt(E,l,u,d,_,C,k)),i==null?i=1/0:(l=e-i,u=n-i,d=r-i,_=e+i,C=n+i,k=r+i,i*=i);N=j.pop();)if(!(!(E=N.node)||(h=N.x0)>_||(p=N.y0)>C||(g=N.z0)>k||(y=N.x1)<l||(v=N.y1)<u||(x=N.z1)<d))if(E.length){var R=(h+y)/2,z=(p+v)/2,P=(g+x)/2;j.push(new Nt(E[7],R,z,P,y,v,x),new Nt(E[6],h,z,P,R,v,x),new Nt(E[5],R,p,P,y,z,x),new Nt(E[4],h,p,P,R,z,x),new Nt(E[3],R,z,g,y,v,P),new Nt(E[2],h,z,g,R,v,P),new Nt(E[1],R,p,g,y,z,P),new Nt(E[0],h,p,g,R,z,P)),(M=(r>=P)<<2|(n>=z)<<1|e>=R)&&(N=j[j.length-1],j[j.length-1]=j[j.length-1-M],j[j.length-1-M]=N)}else{var D=e-+this._x.call(null,E.data),$=n-+this._y.call(null,E.data),U=r-+this._z.call(null,E.data),X=D*D+$*$+U*U;if(X<i){var K=Math.sqrt(i=X);l=e-K,u=n-K,d=r-K,_=e+K,C=n+K,k=r+K,s=E.data}}return s}const Oee=(e,n,r,i,s,l)=>Math.sqrt((e-i)**2+(n-s)**2+(r-l)**2);function zee(e,n,r,i){const s=[],l=e-i,u=n-i,d=r-i,h=e+i,p=n+i,g=r+i;return this.visit((y,v,x,_,C,k,j)=>{if(!y.length)do{const E=y.data;Oee(e,n,r,this._x(E),this._y(E),this._z(E))<=i&&s.push(E)}while(y=y.next);return v>h||x>p||_>g||C<l||k<u||j<d}),s}function Pee(e){if(isNaN(v=+this._x.call(null,e))||isNaN(x=+this._y.call(null,e))||isNaN(_=+this._z.call(null,e)))return this;var n,r=this._root,i,s,l,u=this._x0,d=this._y0,h=this._z0,p=this._x1,g=this._y1,y=this._z1,v,x,_,C,k,j,E,N,M,R,z;if(!r)return this;if(r.length)for(;;){if((E=v>=(C=(u+p)/2))?u=C:p=C,(N=x>=(k=(d+g)/2))?d=k:g=k,(M=_>=(j=(h+y)/2))?h=j:y=j,n=r,!(r=r[R=M<<2|N<<1|E]))return this;if(!r.length)break;(n[R+1&7]||n[R+2&7]||n[R+3&7]||n[R+4&7]||n[R+5&7]||n[R+6&7]||n[R+7&7])&&(i=n,z=R)}for(;r.data!==e;)if(s=r,!(r=r.next))return this;return(l=r.next)&&delete r.next,s?(l?s.next=l:delete s.next,this):n?(l?n[R]=l:delete n[R],(r=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&r===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[z]=r:this._root=r),this):(this._root=l,this)}function Lee(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Iee(){return this._root}function Vee(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Fee(e){var n=[],r,i=this._root,s,l,u,d,h,p,g;for(i&&n.push(new Nt(i,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=n.pop();)if(!e(i=r.node,l=r.x0,u=r.y0,d=r.z0,h=r.x1,p=r.y1,g=r.z1)&&i.length){var y=(l+h)/2,v=(u+p)/2,x=(d+g)/2;(s=i[7])&&n.push(new Nt(s,y,v,x,h,p,g)),(s=i[6])&&n.push(new Nt(s,l,v,x,y,p,g)),(s=i[5])&&n.push(new Nt(s,y,u,x,h,v,g)),(s=i[4])&&n.push(new Nt(s,l,u,x,y,v,g)),(s=i[3])&&n.push(new Nt(s,y,v,d,h,p,x)),(s=i[2])&&n.push(new Nt(s,l,v,d,y,p,x)),(s=i[1])&&n.push(new Nt(s,y,u,d,h,v,x)),(s=i[0])&&n.push(new Nt(s,l,u,d,y,v,x))}return this}function Uee(e){var n=[],r=[],i;for(this._root&&n.push(new Nt(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=n.pop();){var s=i.node;if(s.length){var l,u=i.x0,d=i.y0,h=i.z0,p=i.x1,g=i.y1,y=i.z1,v=(u+p)/2,x=(d+g)/2,_=(h+y)/2;(l=s[0])&&n.push(new Nt(l,u,d,h,v,x,_)),(l=s[1])&&n.push(new Nt(l,v,d,h,p,x,_)),(l=s[2])&&n.push(new Nt(l,u,x,h,v,g,_)),(l=s[3])&&n.push(new Nt(l,v,x,h,p,g,_)),(l=s[4])&&n.push(new Nt(l,u,d,_,v,x,y)),(l=s[5])&&n.push(new Nt(l,v,d,_,p,x,y)),(l=s[6])&&n.push(new Nt(l,u,x,_,v,g,y)),(l=s[7])&&n.push(new Nt(l,v,x,_,p,g,y))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.z0,i.x1,i.y1,i.z1);return this}function Bee(e){return e[0]}function $ee(e){return arguments.length?(this._x=e,this):this._x}function Hee(e){return e[1]}function Gee(e){return arguments.length?(this._y=e,this):this._y}function qee(e){return e[2]}function Yee(e){return arguments.length?(this._z=e,this):this._z}function dD(e,n,r,i){var s=new nb(n??Bee,r??Hee,i??qee,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?s:s.addAll(e)}function nb(e,n,r,i,s,l,u,d,h){this._x=e,this._y=n,this._z=r,this._x0=i,this._y0=s,this._z0=l,this._x1=u,this._y1=d,this._z1=h,this._root=void 0}function sk(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var _n=dD.prototype=nb.prototype;_n.copy=function(){var e=new nb(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=sk(n),e;for(r=[{source:n,target:e._root=new Array(8)}];n=r.pop();)for(var s=0;s<8;++s)(i=n.source[s])&&(i.length?r.push({source:i,target:n.target[s]=new Array(8)}):n.target[s]=sk(i));return e};_n.add=Nee;_n.addAll=Tee;_n.cover=Aee;_n.data=Ree;_n.extent=Mee;_n.find=Dee;_n.findAllWithinRadius=zee;_n.remove=Pee;_n.removeAll=Lee;_n.root=Iee;_n.size=Vee;_n.visit=Fee;_n.visitAfter=Uee;_n.x=$ee;_n.y=Gee;_n.z=Yee;function Qi(e){return function(){return e}}function Ki(e){return(e()-.5)*1e-6}function Xee(e){return e.index}function ok(e,n){var r=e.get(n);if(!r)throw new Error("node not found: "+n);return r}function Kee(e){var n=Xee,r=v,i,s=Qi(30),l,u,d,h,p,g,y=1;e==null&&(e=[]);function v(j){return 1/Math.min(h[j.source.index],h[j.target.index])}function x(j){for(var E=0,N=e.length;E<y;++E)for(var M=0,R,z,P,D=0,$=0,U=0,X,K;M<N;++M)R=e[M],z=R.source,P=R.target,D=P.x+P.vx-z.x-z.vx||Ki(g),d>1&&($=P.y+P.vy-z.y-z.vy||Ki(g)),d>2&&(U=P.z+P.vz-z.z-z.vz||Ki(g)),X=Math.sqrt(D*D+$*$+U*U),X=(X-l[M])/X*j*i[M],D*=X,$*=X,U*=X,P.vx-=D*(K=p[M]),d>1&&(P.vy-=$*K),d>2&&(P.vz-=U*K),z.vx+=D*(K=1-K),d>1&&(z.vy+=$*K),d>2&&(z.vz+=U*K)}function _(){if(u){var j,E=u.length,N=e.length,M=new Map(u.map((z,P)=>[n(z,P,u),z])),R;for(j=0,h=new Array(E);j<N;++j)R=e[j],R.index=j,typeof R.source!="object"&&(R.source=ok(M,R.source)),typeof R.target!="object"&&(R.target=ok(M,R.target)),h[R.source.index]=(h[R.source.index]||0)+1,h[R.target.index]=(h[R.target.index]||0)+1;for(j=0,p=new Array(N);j<N;++j)R=e[j],p[j]=h[R.source.index]/(h[R.source.index]+h[R.target.index]);i=new Array(N),C(),l=new Array(N),k()}}function C(){if(u)for(var j=0,E=e.length;j<E;++j)i[j]=+r(e[j],j,e)}function k(){if(u)for(var j=0,E=e.length;j<E;++j)l[j]=+s(e[j],j,e)}return x.initialize=function(j,...E){u=j,g=E.find(N=>typeof N=="function")||Math.random,d=E.find(N=>[1,2,3].includes(N))||2,_()},x.links=function(j){return arguments.length?(e=j,_(),x):e},x.id=function(j){return arguments.length?(n=j,x):n},x.iterations=function(j){return arguments.length?(y=+j,x):y},x.strength=function(j){return arguments.length?(r=typeof j=="function"?j:Qi(+j),C(),x):r},x.distance=function(j){return arguments.length?(s=typeof j=="function"?j:Qi(+j),k(),x):s},x}const Wee=1664525,Zee=1013904223,lk=4294967296;function Qee(){let e=1;return()=>(e=(Wee*e+Zee)%lk)/lk}var uk=3;function Cy(e){return e.x}function ck(e){return e.y}function Jee(e){return e.z}var ete=10,tte=Math.PI*(3-Math.sqrt(5)),nte=Math.PI*20/(9+Math.sqrt(221));function rte(e,n){n=n||2;var r=Math.min(uk,Math.max(1,Math.round(n))),i,s=1,l=.001,u=1-Math.pow(l,1/300),d=0,h=.6,p=new Map,g=G0(x),y=Rc("tick","end"),v=Qee();e==null&&(e=[]);function x(){_(),y.call("tick",i),s<l&&(g.stop(),y.call("end",i))}function _(j){var E,N=e.length,M;j===void 0&&(j=1);for(var R=0;R<j;++R)for(s+=(d-s)*u,p.forEach(function(z){z(s)}),E=0;E<N;++E)M=e[E],M.fx==null?M.x+=M.vx*=h:(M.x=M.fx,M.vx=0),r>1&&(M.fy==null?M.y+=M.vy*=h:(M.y=M.fy,M.vy=0)),r>2&&(M.fz==null?M.z+=M.vz*=h:(M.z=M.fz,M.vz=0));return i}function C(){for(var j=0,E=e.length,N;j<E;++j){if(N=e[j],N.index=j,N.fx!=null&&(N.x=N.fx),N.fy!=null&&(N.y=N.fy),N.fz!=null&&(N.z=N.fz),isNaN(N.x)||r>1&&isNaN(N.y)||r>2&&isNaN(N.z)){var M=ete*(r>2?Math.cbrt(.5+j):r>1?Math.sqrt(.5+j):j),R=j*tte,z=j*nte;r===1?N.x=M:r===2?(N.x=M*Math.cos(R),N.y=M*Math.sin(R)):(N.x=M*Math.sin(R)*Math.cos(z),N.y=M*Math.cos(R),N.z=M*Math.sin(R)*Math.sin(z))}(isNaN(N.vx)||r>1&&isNaN(N.vy)||r>2&&isNaN(N.vz))&&(N.vx=0,r>1&&(N.vy=0),r>2&&(N.vz=0))}}function k(j){return j.initialize&&j.initialize(e,v,r),j}return C(),i={tick:_,restart:function(){return g.restart(x),i},stop:function(){return g.stop(),i},numDimensions:function(j){return arguments.length?(r=Math.min(uk,Math.max(1,Math.round(j))),p.forEach(k),i):r},nodes:function(j){return arguments.length?(e=j,C(),p.forEach(k),i):e},alpha:function(j){return arguments.length?(s=+j,i):s},alphaMin:function(j){return arguments.length?(l=+j,i):l},alphaDecay:function(j){return arguments.length?(u=+j,i):+u},alphaTarget:function(j){return arguments.length?(d=+j,i):d},velocityDecay:function(j){return arguments.length?(h=1-j,i):1-h},randomSource:function(j){return arguments.length?(v=j,p.forEach(k),i):v},force:function(j,E){return arguments.length>1?(E==null?p.delete(j):p.set(j,k(E)),i):p.get(j)},find:function(){var j=Array.prototype.slice.call(arguments),E=j.shift()||0,N=(r>1?j.shift():null)||0,M=(r>2?j.shift():null)||0,R=j.shift()||1/0,z=0,P=e.length,D,$,U,X,K,ae;for(R*=R,z=0;z<P;++z)K=e[z],D=E-K.x,$=N-(K.y||0),U=M-(K.z||0),X=D*D+$*$+U*U,X<R&&(ae=K,R=X);return ae},on:function(j,E){return arguments.length>1?(y.on(j,E),i):y.on(j)}}}function ite(){var e,n,r,i,s,l=Qi(-30),u,d=1,h=1/0,p=.81;function g(_){var C,k=e.length,j=(n===1?oD(e,Cy):n===2?uD(e,Cy,ck):n===3?dD(e,Cy,ck,Jee):null).visitAfter(v);for(s=_,C=0;C<k;++C)r=e[C],j.visit(x)}function y(){if(e){var _,C=e.length,k;for(u=new Array(C),_=0;_<C;++_)k=e[_],u[k.index]=+l(k,_,e)}}function v(_){var C=0,k,j,E=0,N,M,R,z,P=_.length;if(P){for(N=M=R=z=0;z<P;++z)(k=_[z])&&(j=Math.abs(k.value))&&(C+=k.value,E+=j,N+=j*(k.x||0),M+=j*(k.y||0),R+=j*(k.z||0));C*=Math.sqrt(4/P),_.x=N/E,n>1&&(_.y=M/E),n>2&&(_.z=R/E)}else{k=_,k.x=k.data.x,n>1&&(k.y=k.data.y),n>2&&(k.z=k.data.z);do C+=u[k.data.index];while(k=k.next)}_.value=C}function x(_,C,k,j,E){if(!_.value)return!0;var N=[k,j,E][n-1],M=_.x-r.x,R=n>1?_.y-r.y:0,z=n>2?_.z-r.z:0,P=N-C,D=M*M+R*R+z*z;if(P*P/p<D)return D<h&&(M===0&&(M=Ki(i),D+=M*M),n>1&&R===0&&(R=Ki(i),D+=R*R),n>2&&z===0&&(z=Ki(i),D+=z*z),D<d&&(D=Math.sqrt(d*D)),r.vx+=M*_.value*s/D,n>1&&(r.vy+=R*_.value*s/D),n>2&&(r.vz+=z*_.value*s/D)),!0;if(_.length||D>=h)return;(_.data!==r||_.next)&&(M===0&&(M=Ki(i),D+=M*M),n>1&&R===0&&(R=Ki(i),D+=R*R),n>2&&z===0&&(z=Ki(i),D+=z*z),D<d&&(D=Math.sqrt(d*D)));do _.data!==r&&(P=u[_.data.index]*s/D,r.vx+=M*P,n>1&&(r.vy+=R*P),n>2&&(r.vz+=z*P));while(_=_.next)}return g.initialize=function(_,...C){e=_,i=C.find(k=>typeof k=="function")||Math.random,n=C.find(k=>[1,2,3].includes(k))||2,y()},g.strength=function(_){return arguments.length?(l=typeof _=="function"?_:Qi(+_),y(),g):l},g.distanceMin=function(_){return arguments.length?(d=_*_,g):Math.sqrt(d)},g.distanceMax=function(_){return arguments.length?(h=_*_,g):Math.sqrt(h)},g.theta=function(_){return arguments.length?(p=_*_,g):Math.sqrt(p)},g}function ate(e,n,r,i){var s,l,u=Qi(.1),d,h;typeof e!="function"&&(e=Qi(+e)),n==null&&(n=0),r==null&&(r=0),i==null&&(i=0);function p(y){for(var v=0,x=s.length;v<x;++v){var _=s[v],C=_.x-n||1e-6,k=(_.y||0)-r||1e-6,j=(_.z||0)-i||1e-6,E=Math.sqrt(C*C+k*k+j*j),N=(h[v]-E)*d[v]*y/E;_.vx+=C*N,l>1&&(_.vy+=k*N),l>2&&(_.vz+=j*N)}}function g(){if(s){var y,v=s.length;for(d=new Array(v),h=new Array(v),y=0;y<v;++y)h[y]=+e(s[y],y,s),d[y]=isNaN(h[y])?0:+u(s[y],y,s)}}return p.initialize=function(y,...v){s=y,l=v.find(x=>[1,2,3].includes(x))||2,g()},p.strength=function(y){return arguments.length?(u=typeof y=="function"?y:Qi(+y),g(),p):u},p.radius=function(y){return arguments.length?(e=typeof y=="function"?y:Qi(+y),g(),p):e},p.x=function(y){return arguments.length?(n=+y,p):n},p.y=function(y){return arguments.length?(r=+y,p):r},p.z=function(y){return arguments.length?(i=+y,p):i},p}const{abs:_u,cos:Yi,sin:Lo,acos:ste,atan2:Cu,sqrt:za,pow:Tr}=Math;function ju(e){return e<0?-Tr(-e,1/3):Tr(e,1/3)}const fD=Math.PI,kf=2*fD,Pa=fD/2,ote=1e-6,jy=Number.MAX_SAFE_INTEGER||9007199254740991,ky=Number.MIN_SAFE_INTEGER||-9007199254740991,lte={x:0,y:0,z:0},je={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,n){const r=n(e);let i=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(i+=r.z*r.z),za(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];const i=n.length-1;if(e===1)return n[i].t=1,n[i];const s=1-e;let l=n;if(i===0)return n[0].t=e,n[0];if(i===1){const d={x:s*l[0].x+e*l[1].x,y:s*l[0].y+e*l[1].y,t:e};return r&&(d.z=s*l[0].z+e*l[1].z),d}if(i<4){let d=s*s,h=e*e,p,g,y,v=0;i===2?(l=[l[0],l[1],l[2],lte],p=d,g=s*e*2,y=h):i===3&&(p=d*s,g=d*e*3,y=s*h*3,v=e*h);const x={x:p*l[0].x+g*l[1].x+y*l[2].x+v*l[3].x,y:p*l[0].y+g*l[1].y+y*l[2].y+v*l[3].y,t:e};return r&&(x.z=p*l[0].z+g*l[1].z+y*l[2].z+v*l[3].z),x}const u=JSON.parse(JSON.stringify(n));for(;u.length>1;){for(let d=0;d<u.length-1;d++)u[d]={x:u[d].x+(u[d+1].x-u[d].x)*e,y:u[d].y+(u[d+1].y-u[d].y)*e},typeof u[d].z<"u"&&(u[d].z=u[d].z+(u[d+1].z-u[d].z)*e);u.splice(u.length-1,1)}return u[0].t=e,u[0]},computeWithRatios:function(e,n,r,i){const s=1-e,l=r,u=n;let d=l[0],h=l[1],p=l[2],g=l[3],y;if(d*=s,h*=e,u.length===2)return y=d+h,{x:(d*u[0].x+h*u[1].x)/y,y:(d*u[0].y+h*u[1].y)/y,z:i?(d*u[0].z+h*u[1].z)/y:!1,t:e};if(d*=s,h*=2*s,p*=e*e,u.length===3)return y=d+h+p,{x:(d*u[0].x+h*u[1].x+p*u[2].x)/y,y:(d*u[0].y+h*u[1].y+p*u[2].y)/y,z:i?(d*u[0].z+h*u[1].z+p*u[2].z)/y:!1,t:e};if(d*=s,h*=1.5*s,p*=3*s,g*=e*e*e,u.length===4)return y=d+h+p+g,{x:(d*u[0].x+h*u[1].x+p*u[2].x+g*u[3].x)/y,y:(d*u[0].y+h*u[1].y+p*u[2].y+g*u[3].y)/y,z:i?(d*u[0].z+h*u[1].z+p*u[2].z+g*u[3].z)/y:!1,t:e}},derive:function(e,n){const r=[];for(let i=e,s=i.length,l=s-1;s>1;s--,l--){const u=[];for(let d=0,h;d<l;d++)h={x:l*(i[d+1].x-i[d].x),y:l*(i[d+1].y-i[d].y)},n&&(h.z=l*(i[d+1].z-i[d].z)),u.push(h);r.push(u),i=u}return r},between:function(e,n,r){return n<=e&&e<=r||je.approximately(e,n)||je.approximately(e,r)},approximately:function(e,n,r){return _u(e-n)<=(r||ote)},length:function(e){const r=je.Tvalues.length;let i=0;for(let s=0,l;s<r;s++)l=.5*je.Tvalues[s]+.5,i+=je.Cvalues[s]*je.arcfn(l,e);return .5*i},map:function(e,n,r,i,s){const l=r-n,u=s-i,d=e-n,h=d/l;return i+u*h},lerp:function(e,n,r){const i={x:n.x+e*(r.x-n.x),y:n.y+e*(r.y-n.y)};return n.z!==void 0&&r.z!==void 0&&(i.z=n.z+e*(r.z-n.z)),i},pointToString:function(e){let n=e.x+"/"+e.y;return typeof e.z<"u"&&(n+="/"+e.z),n},pointsToString:function(e){return"["+e.map(je.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){const i=n.x-e.x,s=n.y-e.y,l=r.x-e.x,u=r.y-e.y,d=i*u-s*l,h=i*l+s*u;return Cu(d,h)},round:function(e,n){const r=""+e,i=r.indexOf(".");return parseFloat(r.substring(0,i+1+n))},dist:function(e,n){const r=e.x-n.x,i=e.y-n.y;return za(r*r+i*i)},closest:function(e,n){let r=Tr(2,63),i,s;return e.forEach(function(l,u){s=je.dist(n,l),s<r&&(r=s,i=u)}),{mdist:r,mpos:i}},abcratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=Tr(e,n)+Tr(1-e,n),i=r-1;return _u(i/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=Tr(1-e,n),i=Tr(e,n)+r;return r/i},lli8:function(e,n,r,i,s,l,u,d){const h=(e*i-n*r)*(s-u)-(e-r)*(s*d-l*u),p=(e*i-n*r)*(l-d)-(n-i)*(s*d-l*u),g=(e-r)*(l-d)-(n-i)*(s-u);return g==0?!1:{x:h/g,y:p/g}},lli4:function(e,n,r,i){const s=e.x,l=e.y,u=n.x,d=n.y,h=r.x,p=r.y,g=i.x,y=i.y;return je.lli8(s,l,u,d,h,p,g,y)},lli:function(e,n){return je.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new zt(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=jy,r=jy,i=ky,s=ky;return e.forEach(function(l){const u=l.bbox();n>u.x.min&&(n=u.x.min),r>u.y.min&&(r=u.y.min),i<u.x.max&&(i=u.x.max),s<u.y.max&&(s=u.y.max)}),{x:{min:n,mid:(n+i)/2,max:i,size:i-n},y:{min:r,mid:(r+s)/2,max:s,size:s-r}}},shapeintersections:function(e,n,r,i,s){if(!je.bboxoverlap(n,i))return[];const l=[],u=[e.startcap,e.forward,e.back,e.endcap],d=[r.startcap,r.forward,r.back,r.endcap];return u.forEach(function(h){h.virtual||d.forEach(function(p){if(p.virtual)return;const g=h.intersects(p,s);g.length>0&&(g.c1=h,g.c2=p,g.s1=e,g.s2=r,l.push(g))})}),l},makeshape:function(e,n,r){const i=n.points.length,s=e.points.length,l=je.makeline(n.points[i-1],e.points[0]),u=je.makeline(e.points[s-1],n.points[0]),d={startcap:l,forward:e,back:n,endcap:u,bbox:je.findbbox([l,e,n,u])};return d.intersections=function(h){return je.shapeintersections(d,d.bbox,h,h.bbox,r)},d},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=jy,s=ky,l,u;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let d=0,h=r.length;d<h;d++)l=r[d],u=e.get(l),u[n]<i&&(i=u[n]),u[n]>s&&(s=u[n]);return{min:i,mid:(i+s)/2,max:s,size:s-i}},align:function(e,n){const r=n.p1.x,i=n.p1.y,s=-Cu(n.p2.y-i,n.p2.x-r),l=function(u){return{x:(u.x-r)*Yi(s)-(u.y-i)*Lo(s),y:(u.x-r)*Lo(s)+(u.y-i)*Yi(s)}};return e.map(l)},roots:function(e,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=e.length-1,i=je.align(e,n),s=function(P){return 0<=P&&P<=1};if(r===2){const P=i[0].y,D=i[1].y,$=i[2].y,U=P-2*D+$;if(U!==0){const X=-za(D*D-P*$),K=-P+D,ae=-(X+K)/U,B=-(-X+K)/U;return[ae,B].filter(s)}else if(D!==$&&U===0)return[(2*D-$)/(2*D-2*$)].filter(s);return[]}const l=i[0].y,u=i[1].y,d=i[2].y,h=i[3].y;let p=-l+3*u-3*d+h,g=3*l-6*u+3*d,y=-3*l+3*u,v=l;if(je.approximately(p,0)){if(je.approximately(g,0))return je.approximately(y,0)?[]:[-v/y].filter(s);const P=za(y*y-4*g*v),D=2*g;return[(P-y)/D,(-y-P)/D].filter(s)}g/=p,y/=p,v/=p;const x=(3*y-g*g)/3,_=x/3,C=(2*g*g*g-9*g*y+27*v)/27,k=C/2,j=k*k+_*_*_;let E,N,M,R,z;if(j<0){const P=-x/3,D=P*P*P,$=za(D),U=-C/(2*$),X=U<-1?-1:U>1?1:U,K=ste(X),ae=ju($),B=2*ae;return M=B*Yi(K/3)-g/3,R=B*Yi((K+kf)/3)-g/3,z=B*Yi((K+2*kf)/3)-g/3,[M,R,z].filter(s)}else{if(j===0)return E=k<0?ju(-k):-ju(k),M=2*E-g/3,R=-E-g/3,[M,R].filter(s);{const P=za(j);return E=ju(-k+P),N=ju(k+P),[E-N-g/3].filter(s)}}},droots:function(e){if(e.length===3){const n=e[0],r=e[1],i=e[2],s=n-2*r+i;if(s!==0){const l=-za(r*r-n*i),u=-n+r,d=-(l+u)/s,h=-(-l+u)/s;return[d,h]}else if(r!==i&&s===0)return[(2*r-i)/(2*(r-i))];return[]}if(e.length===2){const n=e[0],r=e[1];return n!==r?[n/(n-r)]:[]}return[]},curvature:function(e,n,r,i,s){let l,u,d,h,p=0,g=0;const y=je.compute(e,n),v=je.compute(e,r),x=y.x*y.x+y.y*y.y;if(i?(l=za(Tr(y.y*v.z-v.y*y.z,2)+Tr(y.z*v.x-v.z*y.x,2)+Tr(y.x*v.y-v.x*y.y,2)),u=Tr(x+y.z*y.z,3/2)):(l=y.x*v.y-y.y*v.x,u=Tr(x,3/2)),l===0||u===0)return{k:0,r:0};if(p=l/u,g=u/l,!s){const _=je.curvature(e-.001,n,r,i,!0).k,C=je.curvature(e+.001,n,r,i,!0).k;h=(C-p+(p-_))/2,d=(_u(C-p)+_u(p-_))/2}return{k:p,r:g,dk:h,adk:d}},inflections:function(e){if(e.length<4)return[];const n=je.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,s=n[1].x*n[2].y,l=n[3].x*n[2].y,u=18*(-3*r+2*i+3*s-l),d=18*(3*r-i-3*s),h=18*(s-r);if(je.approximately(u,0)){if(!je.approximately(d,0)){let v=-h/d;if(0<=v&&v<=1)return[v]}return[]}const p=2*u;if(je.approximately(p,0))return[];const g=d*d-4*u*h;if(g<0)return[];const y=Math.sqrt(g);return[(y-d)/p,-(d+y)/p].filter(function(v){return 0<=v&&v<=1})},bboxoverlap:function(e,n){const r=["x","y"],i=r.length;for(let s=0,l,u,d,h;s<i;s++)if(l=r[s],u=e[l].mid,d=n[l].mid,h=(e[l].size+n[l].size)/2,_u(u-d)>=h)return!1;return!0},expandbox:function(e,n){n.x.min<e.x.min&&(e.x.min=n.x.min),n.y.min<e.y.min&&(e.y.min=n.y.min),n.z&&n.z.min<e.z.min&&(e.z.min=n.z.min),n.x.max>e.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){const i=e.bbox(),s=n.bbox(),l=1e5,u=r||.5;if(i.x.size+i.y.size<u&&s.x.size+s.y.size<u)return[(l*(e._t1+e._t2)/2|0)/l+"/"+(l*(n._t1+n._t2)/2|0)/l];let d=e.split(.5),h=n.split(.5),p=[{left:d.left,right:h.left},{left:d.left,right:h.right},{left:d.right,right:h.right},{left:d.right,right:h.left}];p=p.filter(function(y){return je.bboxoverlap(y.left.bbox(),y.right.bbox())});let g=[];return p.length===0||(p.forEach(function(y){g=g.concat(je.pairiteration(y.left,y.right,u))}),g=g.filter(function(y,v){return g.indexOf(y)===v})),g},getccenter:function(e,n,r){const i=n.x-e.x,s=n.y-e.y,l=r.x-n.x,u=r.y-n.y,d=i*Yi(Pa)-s*Lo(Pa),h=i*Lo(Pa)+s*Yi(Pa),p=l*Yi(Pa)-u*Lo(Pa),g=l*Lo(Pa)+u*Yi(Pa),y=(e.x+n.x)/2,v=(e.y+n.y)/2,x=(n.x+r.x)/2,_=(n.y+r.y)/2,C=y+d,k=v+h,j=x+p,E=_+g,N=je.lli8(y,v,C,k,x,_,j,E),M=je.dist(N,e);let R=Cu(e.y-N.y,e.x-N.x),z=Cu(n.y-N.y,n.x-N.x),P=Cu(r.y-N.y,r.x-N.x),D;return R<P?((R>z||z>P)&&(R+=kf),R>P&&(D=P,P=R,R=D)):P<z&&z<R?(D=P,P=R,R=D):P+=kf,N.s=R,N.e=P,N.r=M,N},numberSort:function(e,n){return e-n}};class Wu{constructor(n){this.curves=[],this._3d=!1,n&&(this.curves=n,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(n){return je.pointsToString(n.points)}).join(", ")+"]"}addCurve(n){this.curves.push(n),this._3d=this._3d||n._3d}length(){return this.curves.map(function(n){return n.length()}).reduce(function(n,r){return n+r})}curve(n){return this.curves[n]}bbox(){const n=this.curves;for(var r=n[0].bbox(),i=1;i<n.length;i++)je.expandbox(r,n[i].bbox());return r}offset(n){const r=[];return this.curves.forEach(function(i){r.push(...i.offset(n))}),new Wu(r)}}const{abs:ku,min:dk,max:fk,cos:ute,sin:cte,acos:dte,sqrt:Eu}=Math,fte=Math.PI;class zt{constructor(n){let r=n&&n.forEach?n:Array.from(arguments).slice(),i=!1;if(typeof r[0]=="object"){i=r.length;const x=[];r.forEach(function(_){["x","y","z"].forEach(function(C){typeof _[C]<"u"&&x.push(_[C])})}),r=x}let s=!1;const l=r.length;if(i){if(i>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");s=!0}}else if(l!==6&&l!==8&&l!==9&&l!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const u=this._3d=!s&&(l===9||l===12)||n&&n[0]&&typeof n[0].z<"u",d=this.points=[];for(let x=0,_=u?3:2;x<l;x+=_){var h={x:r[x],y:r[x+1]};u&&(h.z=r[x+2]),d.push(h)}const p=this.order=d.length-1,g=this.dims=["x","y"];u&&g.push("z"),this.dimlen=g.length;const y=je.align(d,{p1:d[0],p2:d[p]}),v=je.dist(d[0],d[p]);this._linear=y.reduce((x,_)=>x+ku(_.y),0)<v/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,i,s){if(typeof s>"u"&&(s=.5),s===0)return new zt(r,r,i);if(s===1)return new zt(n,r,r);const l=zt.getABC(2,n,r,i,s);return new zt(n,l.A,i)}static cubicFromPoints(n,r,i,s,l){typeof s>"u"&&(s=.5);const u=zt.getABC(3,n,r,i,s);typeof l>"u"&&(l=je.dist(r,u.C));const d=l*(1-s)/s,h=je.dist(n,i),p=(i.x-n.x)/h,g=(i.y-n.y)/h,y=l*p,v=l*g,x=d*p,_=d*g,C={x:r.x-y,y:r.y-v},k={x:r.x+x,y:r.y+_},j=u.A,E={x:j.x+(C.x-j.x)/(1-s),y:j.y+(C.y-j.y)/(1-s)},N={x:j.x+(k.x-j.x)/s,y:j.y+(k.y-j.y)/s},M={x:n.x+(E.x-n.x)/s,y:n.y+(E.y-n.y)/s},R={x:i.x+(N.x-i.x)/(1-s),y:i.y+(N.y-i.y)/(1-s)};return new zt(n,M,R,i)}static getUtils(){return je}getUtils(){return zt.getUtils()}static get PolyBezier(){return Wu}valueOf(){return this.toString()}toString(){return je.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const n=this.points,r=n[0].x,i=n[0].y,s=["M",r,i,this.order===2?"Q":"C"];for(let l=1,u=n.length;l<u;l++)s.push(n[l].x),s.push(n[l].y);return s.join(" ")}setRatios(n){if(n.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=n,this._lut=[]}verify(){const n=this.coordDigest();n!==this._print&&(this._print=n,this.update())}coordDigest(){return this.points.map(function(n,r){return""+r+n.x+n.y+(n.z?n.z:0)}).join("")}update(){this._lut=[],this.dpoints=je.derive(this.points,this._3d),this.computedirection()}computedirection(){const n=this.points,r=je.angle(n[0],n[this.order],n[1]);this.clockwise=r>0}length(){return je.length(this.derivative.bind(this))}static getABC(n=2,r,i,s,l=.5){const u=je.projectionratio(l,n),d=1-u,h={x:u*r.x+d*s.x,y:u*r.y+d*s.y},p=je.abcratio(l,n);return{A:{x:i.x+(i.x-h.x)/p,y:i.y+(i.y-h.y)/p},B:i,C:h,S:r,E:s}}getABC(n,r){r=r||this.get(n);let i=this.points[0],s=this.points[this.order];return zt.getABC(this.order,i,r,s,n)}getLUT(n){if(this.verify(),n=n||100,this._lut.length===n+1)return this._lut;this._lut=[],n++,this._lut=[];for(let r=0,i,s;r<n;r++)s=r/(n-1),i=this.compute(s),i.t=s,this._lut.push(i);return this._lut}on(n,r){r=r||5;const i=this.getLUT(),s=[];for(let l=0,u,d=0;l<i.length;l++)u=i[l],je.dist(u,n)<r&&(s.push(u),d+=l/i.length);return s.length?t/=s.length:!1}project(n){const r=this.getLUT(),i=r.length-1,s=je.closest(r,n),l=s.mpos,u=(l-1)/i,d=(l+1)/i,h=.1/i;let p=s.mdist,g=u,y=g,v;p+=1;for(let x;g<d+h;g+=h)v=this.compute(g),x=je.dist(n,v),x<p&&(p=x,y=g);return y=y<0?0:y>1?1:y,v=this.compute(y),v.t=y,v.d=p,v}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?je.computeWithRatios(n,this.points,this.ratios,this._3d):je.compute(n,this.points,this._3d,this.ratios)}raise(){const n=this.points,r=[n[0]],i=n.length;for(let s=1,l,u;s<i;s++)l=n[s],u=n[s-1],r[s]={x:(i-s)/i*l.x+s/i*u.x,y:(i-s)/i*l.y+s/i*u.y};return r[i]=n[i-1],new zt(r)}derivative(n){return je.compute(n,this.dpoints[0],this._3d)}dderivative(n){return je.compute(n,this.dpoints[1],this._3d)}align(){let n=this.points;return new zt(je.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(n){return je.curvature(n,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return je.inflections(this.points)}normal(n){return this._3d?this.__normal3(n):this.__normal2(n)}__normal2(n){const r=this.derivative(n),i=Eu(r.x*r.x+r.y*r.y);return{t:n,x:-r.y/i,y:r.x/i}}__normal3(n){const r=this.derivative(n),i=this.derivative(n+.01),s=Eu(r.x*r.x+r.y*r.y+r.z*r.z),l=Eu(i.x*i.x+i.y*i.y+i.z*i.z);r.x/=s,r.y/=s,r.z/=s,i.x/=l,i.y/=l,i.z/=l;const u={x:i.y*r.z-i.z*r.y,y:i.z*r.x-i.x*r.z,z:i.x*r.y-i.y*r.x},d=Eu(u.x*u.x+u.y*u.y+u.z*u.z);u.x/=d,u.y/=d,u.z/=d;const h=[u.x*u.x,u.x*u.y-u.z,u.x*u.z+u.y,u.x*u.y+u.z,u.y*u.y,u.y*u.z-u.x,u.x*u.z-u.y,u.y*u.z+u.x,u.z*u.z];return{t:n,x:h[0]*r.x+h[1]*r.y+h[2]*r.z,y:h[3]*r.x+h[4]*r.y+h[5]*r.z,z:h[6]*r.x+h[7]*r.y+h[8]*r.z}}hull(n){let r=this.points,i=[],s=[],l=0;for(s[l++]=r[0],s[l++]=r[1],s[l++]=r[2],this.order===3&&(s[l++]=r[3]);r.length>1;){i=[];for(let u=0,d,h=r.length-1;u<h;u++)d=je.lerp(n,r[u],r[u+1]),s[l++]=d,i.push(d);r=i}return s}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;const i=this.hull(n),s={left:this.order===2?new zt([i[0],i[3],i[5]]):new zt([i[0],i[4],i[7],i[9]]),right:this.order===2?new zt([i[5],i[4],i[2]]):new zt([i[9],i[8],i[6],i[3]]),span:i};return s.left._t1=je.map(0,0,1,this._t1,this._t2),s.left._t2=je.map(n,0,1,this._t1,this._t2),s.right._t1=je.map(n,0,1,this._t1,this._t2),s.right._t2=je.map(1,0,1,this._t1,this._t2),r?(r=je.map(r,n,1,0,1),s.right.split(r).left):s}extrema(){const n={};let r=[];return this.dims.forEach((function(i){let s=function(u){return u[i]},l=this.dpoints[0].map(s);n[i]=je.droots(l),this.order===3&&(l=this.dpoints[1].map(s),n[i]=n[i].concat(je.droots(l))),n[i]=n[i].filter(function(u){return u>=0&&u<=1}),r=r.concat(n[i].sort(je.numberSort))}).bind(this)),n.values=r.sort(je.numberSort).filter(function(i,s){return r.indexOf(i)===s}),n}bbox(){const n=this.extrema(),r={};return this.dims.forEach((function(i){r[i]=je.getminmax(this,i,n[i])}).bind(this)),r}overlaps(n){const r=this.bbox(),i=n.bbox();return je.bboxoverlap(r,i)}offset(n,r){if(typeof r<"u"){const i=this.get(n),s=this.normal(n),l={c:i,n:s,x:i.x+s.x*r,y:i.y+s.y*r};return this._3d&&(l.z=i.z+s.z*r),l}if(this._linear){const i=this.normal(0),s=this.points.map(function(l){const u={x:l.x+n*i.x,y:l.y+n*i.y};return l.z&&i.z&&(u.z=l.z+n*i.z),u});return[new zt(s)]}return this.reduce().map(function(i){return i._linear?i.offset(n)[0]:i.scale(n)})}simple(){if(this.order===3){const s=je.angle(this.points[0],this.points[3],this.points[1]),l=je.angle(this.points[0],this.points[3],this.points[2]);if(s>0&&l<0||s<0&&l>0)return!1}const n=this.normal(0),r=this.normal(1);let i=n.x*r.x+n.y*r.y;return this._3d&&(i+=n.z*r.z),ku(dte(i))<fte/3}reduce(){let n,r=0,i=0,s=.01,l,u=[],d=[],h=this.extrema().values;for(h.indexOf(0)===-1&&(h=[0].concat(h)),h.indexOf(1)===-1&&h.push(1),r=h[0],n=1;n<h.length;n++)i=h[n],l=this.split(r,i),l._t1=r,l._t2=i,u.push(l),r=i;return u.forEach(function(p){for(r=0,i=0;i<=1;)for(i=r+s;i<=1+s;i+=s)if(l=p.split(r,i),!l.simple()){if(i-=s,ku(r-i)<s)return[];l=p.split(r,i),l._t1=je.map(r,0,1,p._t1,p._t2),l._t2=je.map(i,0,1,p._t1,p._t2),d.push(l),r=i;break}r<1&&(l=p.split(r,1),l._t1=je.map(r,0,1,p._t1,p._t2),l._t2=p._t2,d.push(l))}),d}translate(n,r,i){i=typeof i=="number"?i:r;const s=this.order;let l=this.points.map((u,d)=>(1-d/s)*r+d/s*i);return new zt(this.points.map((u,d)=>({x:u.x+n.x*l[d],y:u.y+n.y*l[d]})))}scale(n){const r=this.order;let i=!1;if(typeof n=="function"&&(i=n),i&&r===2)return this.raise().scale(i);const s=this.clockwise,l=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);const u=i?i(0):n,d=i?i(1):n,h=[this.offset(0,10),this.offset(1,10)],p=[],g=je.lli4(h[0],h[0].c,h[1],h[1].c);if(!g)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(y){const v=p[y*r]=je.copy(l[y*r]);v.x+=(y?d:u)*h[y].n.x,v.y+=(y?d:u)*h[y].n.y}),i?([0,1].forEach(function(y){if(!(r===2&&y)){var v=l[y+1],x={x:v.x-g.x,y:v.y-g.y},_=i?i((y+1)/r):n;i&&!s&&(_=-_);var C=Eu(x.x*x.x+x.y*x.y);x.x/=C,x.y/=C,p[y+1]={x:v.x+_*x.x,y:v.y+_*x.y}}}),new zt(p)):([0,1].forEach(y=>{if(r===2&&y)return;const v=p[y*r],x=this.derivative(y),_={x:v.x+x.x,y:v.y+x.y};p[y+1]=je.lli4(v,_,g,l[y+1])}),new zt(p))}outline(n,r,i,s){if(r=r===void 0?n:r,this._linear){const R=this.normal(0),z=this.points[0],P=this.points[this.points.length-1];let D,$,U;i===void 0&&(i=n,s=r),D={x:z.x+R.x*n,y:z.y+R.y*n},U={x:P.x+R.x*i,y:P.y+R.y*i},$={x:(D.x+U.x)/2,y:(D.y+U.y)/2};const X=[D,$,U];D={x:z.x-R.x*r,y:z.y-R.y*r},U={x:P.x-R.x*s,y:P.y-R.y*s},$={x:(D.x+U.x)/2,y:(D.y+U.y)/2};const K=[U,$,D],ae=je.makeline(K[2],X[0]),B=je.makeline(X[2],K[0]),Z=[ae,new zt(X),B,new zt(K)];return new Wu(Z)}const l=this.reduce(),u=l.length,d=[];let h=[],p,g=0,y=this.length();const v=typeof i<"u"&&typeof s<"u";function x(R,z,P,D,$){return function(U){const X=D/P,K=(D+$)/P,ae=z-R;return je.map(U,0,1,R+X*ae,R+K*ae)}}l.forEach(function(R){const z=R.length();v?(d.push(R.scale(x(n,i,y,g,z))),h.push(R.scale(x(-r,-s,y,g,z)))):(d.push(R.scale(n)),h.push(R.scale(-r))),g+=z}),h=h.map(function(R){return p=R.points,p[3]?R.points=[p[3],p[2],p[1],p[0]]:R.points=[p[2],p[1],p[0]],R}).reverse();const _=d[0].points[0],C=d[u-1].points[d[u-1].points.length-1],k=h[u-1].points[h[u-1].points.length-1],j=h[0].points[0],E=je.makeline(k,_),N=je.makeline(C,j),M=[E].concat(d).concat([N]).concat(h);return new Wu(M)}outlineshapes(n,r,i){r=r||n;const s=this.outline(n,r).curves,l=[];for(let u=1,d=s.length;u<d/2;u++){const h=je.makeshape(s[u],s[d-u],i);h.startcap.virtual=u>1,h.endcap.virtual=u<d/2-1,l.push(h)}return l}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof zt&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(n){const r=dk(n.p1.x,n.p2.x),i=dk(n.p1.y,n.p2.y),s=fk(n.p1.x,n.p2.x),l=fk(n.p1.y,n.p2.y);return je.roots(this.points,n).filter(u=>{var d=this.get(u);return je.between(d.x,r,s)&&je.between(d.y,i,l)})}selfintersects(n){const r=this.reduce(),i=r.length-2,s=[];for(let l=0,u,d,h;l<i;l++)d=r.slice(l,l+1),h=r.slice(l+2),u=this.curveintersects(d,h,n),s.push(...u);return s}curveintersects(n,r,i){const s=[];n.forEach(function(u){r.forEach(function(d){u.overlaps(d)&&s.push({left:u,right:d})})});let l=[];return s.forEach(function(u){const d=je.pairiteration(u.left,u.right,i);d.length>0&&(l=l.concat(d))}),l}arcs(n){return n=n||.5,this._iterate(n,[])}_error(n,r,i,s){const l=(s-i)/4,u=this.get(i+l),d=this.get(s-l),h=je.dist(n,r),p=je.dist(n,u),g=je.dist(n,d);return ku(p-h)+ku(g-h)}_iterate(n,r){let i=0,s=1,l;do{l=0,s=1;let u=this.get(i),d,h,p,g,y=!1,v=!1,x,_=s,C=1;do if(v=y,g=p,_=(i+s)/2,d=this.get(_),h=this.get(s),p=je.getccenter(u,d,h),p.interval={start:i,end:s},y=this._error(p,u,i,s)<=n,x=v&&!y,x||(C=s),y){if(s>=1){if(p.interval.end=C=1,g=p,s>1){let j={x:p.x+p.r*ute(p.e),y:p.y+p.r*cte(p.e)};p.e+=je.angle({x:p.x,y:p.y},j,this.get(1))}break}s=s+(s-i)/2}else s=_;while(!x&&l++<100);if(l>=100)break;g=g||p,r.push(g),i=C}while(s<1);return r}}function Qv(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function hte(e){if(Array.isArray(e))return e}function pte(e){if(Array.isArray(e))return Qv(e)}function mte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gte(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,s,l,u,d=[],h=!0,p=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(h=(i=l.call(r)).done)&&(d.push(i.value),d.length!==n);h=!0);}catch(g){p=!0,s=g}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(p)throw s}}return d}}function yte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
102
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vte(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
103
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xte(e,n){if(e==null)return{};var r,i,s=bte(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)r=l[i],n.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function bte(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;r[i]=e[i]}return r}function wte(e,n){return hte(e)||gte(e,n)||hD(e,n)||yte()}function Ste(e){return pte(e)||mte(e)||hD(e)||vte()}function _te(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Cte(e){var n=_te(e,"string");return typeof n=="symbol"?n:n+""}function hD(e,n){if(e){if(typeof e=="string")return Qv(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qv(e,n):void 0}}var jte=(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=(n instanceof Array?n.length?n:[void 0]:[n]).map(function(d){return{keyAccessor:d,isProp:!(d instanceof Function)}}),l=e.reduce(function(d,h){var p=d,g=h;return s.forEach(function(y,v){var x=y.keyAccessor,_=y.isProp,C;if(_){var k=g,j=k[x],E=xte(k,[x].map(Cte));C=j,g=E}else C=x(g,v);v+1<s.length?(p.hasOwnProperty(C)||(p[C]={}),p=p[C]):r?(p.hasOwnProperty(C)||(p[C]=[]),p[C].push(g)):p[C]=g}),d},{});r instanceof Function&&(function d(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;p===s.length?Object.keys(h).forEach(function(g){return h[g]=r(h[g])}):Object.values(h).forEach(function(g){return d(g,p+1)})})(l);var u=l;return i&&(u=[],(function d(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];p.length===s.length?u.push({keys:p,vals:h}):Object.entries(h).forEach(function(g){var y=wte(g,2),v=y[0],x=y[1];return d(x,[].concat(Ste(p),[v]))})})(l),n instanceof Array&&n.length===0&&u.length===1&&(u[0].keys=[])),u});function kte(e,n){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(n).domain(e);break}return this}const hk=Symbol("implicit");function pD(){var e=new Oj,n=[],r=[],i=hk;function s(l){let u=e.get(l);if(u===void 0){if(i!==hk)return i;e.set(l,u=n.push(l)-1)}return r[u%r.length]}return s.domain=function(l){if(!arguments.length)return n.slice();n=[],e=new Oj;for(const u of l)e.has(u)||e.set(u,n.push(u)-1);return s},s.range=function(l){return arguments.length?(r=Array.from(l),s):r.slice()},s.unknown=function(l){return arguments.length?(i=l,s):i},s.copy=function(){return pD(n,r).unknown(i)},kte.apply(s,arguments),s}function Ete(e){for(var n=e.length/6|0,r=new Array(n),i=0;i<n;)r[i]="#"+e.slice(i*6,++i*6);return r}const Nte=Ete("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function Tte(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",r==="top"&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}var Ate=`.force-graph-container canvas {
|
|
104
|
+
display: block;
|
|
105
|
+
user-select: none;
|
|
106
|
+
outline: none;
|
|
107
|
+
-webkit-tap-highlight-color: transparent;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.force-graph-container .clickable {
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.force-graph-container .grabbable {
|
|
115
|
+
cursor: move;
|
|
116
|
+
cursor: grab;
|
|
117
|
+
cursor: -moz-grab;
|
|
118
|
+
cursor: -webkit-grab;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.force-graph-container .grabbable:active {
|
|
122
|
+
cursor: grabbing;
|
|
123
|
+
cursor: -moz-grabbing;
|
|
124
|
+
cursor: -webkit-grabbing;
|
|
125
|
+
}
|
|
126
|
+
`;Tte(Ate);function Jv(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Rte(e){if(Array.isArray(e))return e}function Mte(e){if(Array.isArray(e))return Jv(e)}function pk(e,n,r){if(mD())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,n);var s=new(e.bind.apply(e,i));return s}function pc(e,n,r){return(n=Ite(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function mD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mD=function(){return!!e})()}function Dte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ote(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,s,l,u,d=[],h=!0,p=!1;try{if(l=(r=r.call(e)).next,n!==0)for(;!(h=(i=l.call(r)).done)&&(d.push(i.value),d.length!==n);h=!0);}catch(g){p=!0,s=g}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(p)throw s}}return d}}function zte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
127
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pte(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
128
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mk(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,i)}return r}function Io(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?mk(Object(r),!0).forEach(function(i){pc(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mk(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Zu(e,n){return Rte(e)||Ote(e,n)||gD(e,n)||zte()}function zr(e){return Mte(e)||Dte(e)||gD(e)||Pte()}function Lte(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ite(e){var n=Lte(e,"string");return typeof n=="symbol"?n:n+""}function ex(e){"@babel/helpers - typeof";return ex=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ex(e)}function gD(e,n){if(e){if(typeof e=="string")return Jv(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Jv(e,n):void 0}}var Vte=pD(Nte);function gk(e,n,r){!n||typeof r!="string"||e.filter(function(i){return!i[r]}).forEach(function(i){i[r]=Vte(n(i))})}function Fte(e,n){var r=e.nodes,i=e.links,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=s.nodeFilter,u=l===void 0?function(){return!0}:l,d=s.onLoopError,h=d===void 0?function(x){throw"Invalid DAG structure! Found cycle in node path: ".concat(x.join(" -> "),".")}:d,p={};r.forEach(function(x){return p[n(x)]={data:x,out:[],depth:-1,skip:!u(x)}}),i.forEach(function(x){var _=x.source,C=x.target,k=M(_),j=M(C);if(!p.hasOwnProperty(k))throw"Missing source node with id: ".concat(k);if(!p.hasOwnProperty(j))throw"Missing target node with id: ".concat(j);var E=p[k],N=p[j];E.out.push(N);function M(R){return ex(R)==="object"?n(R):R}});var g=[];v(Object.values(p));var y=Object.assign.apply(Object,[{}].concat(zr(Object.entries(p).filter(function(x){var _=Zu(x,2),C=_[1];return!C.skip}).map(function(x){var _=Zu(x,2),C=_[0],k=_[1];return pc({},C,k.depth)}))));return y;function v(x){for(var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,k=function(){var M=x[j];if(_.indexOf(M)!==-1){var R=[].concat(zr(_.slice(_.indexOf(M))),[M]).map(function(z){return n(z.data)});return g.some(function(z){return z.length===R.length&&z.every(function(P,D){return P===R[D]})})||(g.push(R),h(R)),1}C>M.depth&&(M.depth=C,v(M.out,[].concat(zr(_),[M]),C+(M.skip?0:1)))},j=0,E=x.length;j<E;j++)k()}}var Ute=2,Tn=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},yk=function(n,r){if(!r.isShadow){var i=gt(r.linkDirectionalParticles);r.graphData.links.forEach(function(s){var l=Math.round(Math.abs(i(s)));l?s.__photons=zr(Array(l)).map(function(){return{}}):delete s.__photons})}},bh=K0({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,yk(n,r)}},dagMode:{onChange:function(n,r){!n&&(r.graphData.nodes||[]).forEach(function(i){return i.fx=i.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(n){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:Tn},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:Tn},nodeColor:{default:"color",triggerUpdate:!1,onChange:Tn},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:Tn},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:Tn},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:Tn},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:Tn},linkColor:{default:"color",triggerUpdate:!1,onChange:Tn},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:Tn},linkWidth:{default:1,triggerUpdate:!1,onChange:Tn},linkCurvature:{default:0,triggerUpdate:!1,onChange:Tn},linkCanvasObject:{triggerUpdate:!1,onChange:Tn},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:Tn},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:Tn},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:Tn},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:Tn},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:yk},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaDecay(n)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaTarget(n)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.velocityDecay(n)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(n,r,i){return i===void 0?n.forceLayout.force(r):(n.forceLayout.force(r,i),this)},d3ReheatSimulation:function(n){return n.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(n){return n.cntTicks=0,n.startTickTime=new Date,n.engineRunning=!0,this},isEngineRunning:function(n){return!!n.engineRunning},tickFrame:function(n){return!n.isShadow&&r(),s(),!n.isShadow&&l(),!n.isShadow&&u(),i(),this;function r(){n.engineRunning&&(++n.cntTicks>n.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin?(n.engineRunning=!1,n.onEngineStop()):(n.forceLayout.tick(),n.onEngineTick()))}function i(){var d=gt(n.nodeVisibility),h=gt(n.nodeVal),p=gt(n.nodeColor),g=gt(n.nodeCanvasObjectMode),y=n.ctx,v=n.isShadow/n.globalScale,x=n.graphData.nodes.filter(d);y.save(),x.forEach(function(_){var C=g(_);if(n.nodeCanvasObject&&(C==="before"||C==="replace")&&(n.nodeCanvasObject(_,y,n.globalScale),C==="replace")){y.restore();return}var k=Math.sqrt(Math.max(0,h(_)||1))*n.nodeRelSize+v;y.beginPath(),y.arc(_.x,_.y,k,0,2*Math.PI,!1),y.fillStyle=p(_)||"rgba(31, 120, 180, 0.92)",y.fill(),n.nodeCanvasObject&&C==="after"&&n.nodeCanvasObject(_,n.ctx,n.globalScale)}),y.restore()}function s(){var d=gt(n.linkVisibility),h=gt(n.linkColor),p=gt(n.linkWidth),g=gt(n.linkLineDash),y=gt(n.linkCurvature),v=gt(n.linkCanvasObjectMode),x=n.ctx,_=n.isShadow*2,C=n.graphData.links.filter(d);C.forEach(z);var k=[],j=[],E=C;if(n.linkCanvasObject){var N=[],M=[];C.forEach(function(P){return({before:k,after:j,replace:N}[v(P)]||M).push(P)}),E=[].concat(zr(k),j,M),k=k.concat(N)}x.save(),k.forEach(function(P){return n.linkCanvasObject(P,x,n.globalScale)}),x.restore();var R=jte(E,[h,p,g]);x.save(),Object.entries(R).forEach(function(P){var D=Zu(P,2),$=D[0],U=D[1],X=!$||$==="undefined"?"rgba(0,0,0,0.15)":$;Object.entries(U).forEach(function(K){var ae=Zu(K,2),B=ae[0],Z=ae[1],O=(B||1)/n.globalScale+_;Object.entries(Z).forEach(function(q){var I=Zu(q,2);I[0];var H=I[1],A=g(H[0]);x.beginPath(),H.forEach(function(F){var G=F.source,L=F.target;if(!(!G||!L||!G.hasOwnProperty("x")||!L.hasOwnProperty("x"))){x.moveTo(G.x,G.y);var ee=F.__controlPoints;ee?x[ee.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(x,zr(ee).concat([L.x,L.y])):x.lineTo(L.x,L.y)}}),x.strokeStyle=X,x.lineWidth=O,x.setLineDash(A||[]),x.stroke()})})}),x.restore(),x.save(),j.forEach(function(P){return n.linkCanvasObject(P,x,n.globalScale)}),x.restore();function z(P){var D=y(P);if(!D){P.__controlPoints=null;return}var $=P.source,U=P.target;if(!(!$||!U||!$.hasOwnProperty("x")||!U.hasOwnProperty("x"))){var X=Math.sqrt(Math.pow(U.x-$.x,2)+Math.pow(U.y-$.y,2));if(X>0){var K=Math.atan2(U.y-$.y,U.x-$.x),ae=X*D,B={x:($.x+U.x)/2+ae*Math.cos(K-Math.PI/2),y:($.y+U.y)/2+ae*Math.sin(K-Math.PI/2)};P.__controlPoints=[B.x,B.y]}else{var Z=D*70;P.__controlPoints=[U.x,U.y-Z,U.x+Z,U.y]}}}}function l(){var d=1.6,h=.2,p=gt(n.linkDirectionalArrowLength),g=gt(n.linkDirectionalArrowRelPos),y=gt(n.linkVisibility),v=gt(n.linkDirectionalArrowColor||n.linkColor),x=gt(n.nodeVal),_=n.ctx;_.save(),n.graphData.links.filter(y).forEach(function(C){var k=p(C);if(!(!k||k<0)){var j=C.source,E=C.target;if(!(!j||!E||!j.hasOwnProperty("x")||!E.hasOwnProperty("x"))){var N=Math.sqrt(Math.max(0,x(j)||1))*n.nodeRelSize,M=Math.sqrt(Math.max(0,x(E)||1))*n.nodeRelSize,R=Math.min(1,Math.max(0,g(C))),z=v(C)||"rgba(0,0,0,0.28)",P=k/d/2,D=C.__controlPoints&&pk(zt,[j.x,j.y].concat(zr(C.__controlPoints),[E.x,E.y])),$=D?function(O){return D.get(O)}:function(O){return{x:j.x+(E.x-j.x)*O||0,y:j.y+(E.y-j.y)*O||0}},U=D?D.length():Math.sqrt(Math.pow(E.x-j.x,2)+Math.pow(E.y-j.y,2)),X=N+k+(U-N-M-k)*R,K=$(X/U),ae=$((X-k)/U),B=$((X-k*(1-h))/U),Z=Math.atan2(K.y-ae.y,K.x-ae.x)-Math.PI/2;_.beginPath(),_.moveTo(K.x,K.y),_.lineTo(ae.x+P*Math.cos(Z),ae.y+P*Math.sin(Z)),_.lineTo(B.x,B.y),_.lineTo(ae.x-P*Math.cos(Z),ae.y-P*Math.sin(Z)),_.fillStyle=z,_.fill()}}}),_.restore()}function u(){var d=gt(n.linkDirectionalParticles),h=gt(n.linkDirectionalParticleSpeed),p=gt(n.linkDirectionalParticleOffset),g=gt(n.linkDirectionalParticleWidth),y=gt(n.linkVisibility),v=gt(n.linkDirectionalParticleColor||n.linkColor),x=n.ctx;x.save(),n.graphData.links.filter(y).forEach(function(_){var C=d(_);if(!(!_.hasOwnProperty("__photons")||!_.__photons.length)){var k=_.source,j=_.target;if(!(!k||!j||!k.hasOwnProperty("x")||!j.hasOwnProperty("x"))){var E=h(_),N=Math.abs(p(_)),M=_.__photons||[],R=Math.max(0,g(_)/2)/Math.sqrt(n.globalScale),z=v(_)||"rgba(0,0,0,0.28)";x.fillStyle=z;var P=_.__controlPoints?pk(zt,[k.x,k.y].concat(zr(_.__controlPoints),[j.x,j.y])):null,D=0,$=!1;M.forEach(function(U){var X=!!U.__singleHop;if(U.hasOwnProperty("__progressRatio")||(U.__progressRatio=X?0:(D+N)/C),!X&&D++,U.__progressRatio+=E,U.__progressRatio>=1)if(!X)U.__progressRatio=U.__progressRatio%1;else{$=!0;return}var K=U.__progressRatio,ae=P?P.get(K):{x:k.x+(j.x-k.x)*K||0,y:k.y+(j.y-k.y)*K||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(ae.x,ae.y,_,x,n.globalScale):(x.beginPath(),x.arc(ae.x,ae.y,R,0,2*Math.PI,!1),x.fill())}),$&&(_.__photons=_.__photons.filter(function(U){return!U.__singleHop||U.__progressRatio<=1}))}}}),x.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:rte().force("link",Kee()).force("charge",ite()).force("center",ZJ()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&gk(n.graphData.nodes,gt(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&gk(n.graphData.links,gt(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(v){v.source=v[n.linkSource],v.target=v[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var i=n.forceLayout.force("link");i&&i.id(function(v){return v[n.nodeId]}).links(n.graphData.links);var s=n.dagMode&&Fte(n.graphData,function(v){return v[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),l=Math.max.apply(Math,zr(Object.values(s||[]))),u=n.dagLevelDistance||n.graphData.nodes.length/(l||1)*Ute*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var d=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(v){return delete v[d]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var h=["rl","bu"].includes(n.dagMode),p=function(x){return(s[x[n.nodeId]]-l/2)*u*(h?-1:1)},g=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(v){return v[g]=p(v)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?ate(function(v){var x=s[v[n.nodeId]]||-1;return(n.dagMode==="radialin"?l-x:x)*u}).strength(function(v){return n.dagNodeFilter(v)?1:0}):null);for(var y=0;y<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);y++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function yD(e,n){var r=e instanceof Array?e:[e],i=new n;return i._destructor&&i._destructor(),{linkProp:function(l){return{default:i[l](),onChange:function(d,h){r.forEach(function(p){return h[p][l](d)})},triggerUpdate:!1}},linkMethod:function(l){return function(u){for(var d=arguments.length,h=new Array(d>1?d-1:0),p=1;p<d;p++)h[p-1]=arguments[p];var g=[];return r.forEach(function(y){var v=u[y],x=v[l].apply(v,h);x!==v&&g.push(x)}),g.length?g[0]:this}}}}var Bte=800,$te=4,Hte=5,vD=yD("forceGraph",bh),Gte=yD(["forceGraph","shadowGraph"],bh),qte=Object.assign.apply(Object,zr(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(e){return pc({},e,vD.linkProp(e))})).concat(zr(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return pc({},e,Gte.linkProp(e))})))),Yte=Object.assign.apply(Object,zr(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return pc({},e,vD.linkMethod(e))})));function Ey(e){if(e.canvas){var n=e.canvas.width,r=e.canvas.height;n===300&&r===150&&(n=r=0);var i=window.devicePixelRatio;n/=i,r/=i,[e.canvas,e.shadowCanvas].forEach(function(l){l.style.width="".concat(e.width,"px"),l.style.height="".concat(e.height,"px"),l.width=e.width*i,l.height=e.height*i,!n&&!r&&l.getContext("2d").scale(i,i)});var s=li(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/s,(e.height-r)/2/s),e.needsRedraw=!0}}function xD(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function vk(e,n,r){e.save(),xD(e),e.clearRect(0,0,n,r),e.restore()}var Xte=K0({props:Io({width:{default:window.innerWidth,onChange:function(n,r){return Ey(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return Ey(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(n,r){[n.nodes,n.links].every(function(s){return(s||[]).every(function(l){return!l.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:n.nodes},{type:"Link",objs:n.links}].forEach(i),r.forceGraph.graphData(n),r.shadowGraph.graphData(n);function i(s){var l=s.type,u=s.objs;u.filter(function(d){if(!d.hasOwnProperty("__indexColor"))return!0;var h=r.colorTracker.lookup(d.__indexColor);return!h||!h.hasOwnProperty("d")||h.d!==d}).forEach(function(d){d.__indexColor=r.colorTracker.register({type:l,d})})}},triggerUpdate:!1},backgroundColor:{onChange:function(n,r){r.canvas&&n&&(r.canvas.style.background=n)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(n,r){r.shadowGraph.nodeCanvasObject(n?function(i,s,l){return n(i,i.__indexColor,s,l)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(n,r){r.shadowGraph.linkCanvasObject(n?function(i,s,l){return n(i,i.__indexColor,s,l)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(n,r){r.zoom.scaleExtent([n,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(n,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],n])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(n,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},qte),aliases:{stopAnimation:"pauseAnimation"},methods:Io({graph2ScreenCoords:function(n,r,i){var s=li(n.canvas);return{x:r*s.k+s.x,y:i*s.k+s.y}},screen2GraphCoords:function(n,r,i){var s=li(n.canvas);return{x:(r-s.x)/s.k,y:(i-s.y)/s.k}},centerAt:function(n,r,i,s){if(!n.canvas)return null;if(r!==void 0||i!==void 0){var l=Object.assign({},r!==void 0?{x:r}:{},i!==void 0?{y:i}:{});return s?n.tweenGroup.add(new Uj(u()).to(l,s).easing(Rs.Quadratic.Out).onUpdate(d).onComplete(function(){n.tweenGroup.remove(this)}).start()):d(l),this}return u();function u(){var h=li(n.canvas);return{x:(n.width/2-h.x)/h.k,y:(n.height/2-h.y)/h.k}}function d(h){var p=h.x,g=h.y;n.zoom.translateTo(n.zoom.__baseElem,p===void 0?u().x:p,g===void 0?u().y:g),n.needsRedraw=!0}},zoom:function(n,r,i){if(!n.canvas)return null;if(r!==void 0)return i?n.tweenGroup.add(new Uj({k:s()}).to({k:r},i).easing(Rs.Quadratic.Out).onUpdate(function(u){var d=u.k;return l(d)}).onComplete(function(){n.tweenGroup.remove(this)}).start()):l(r),this;return s();function s(){return li(n.canvas).k}function l(u){n.zoom.scaleTo(n.zoom.__baseElem,u),n.needsRedraw=!0}},zoomToFit:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,s=arguments.length,l=new Array(s>3?s-3:0),u=3;u<s;u++)l[u-3]=arguments[u];var d=this.getGraphBbox.apply(this,l);if(d){var h={x:(d.x[0]+d.x[1])/2,y:(d.y[0]+d.y[1])/2},p=Math.max(1e-12,Math.min(1e12,(n.width-i*2)/(d.x[1]-d.x[0]),(n.height-i*2)/(d.y[1]-d.y[0])));this.centerAt(h.x,h.y,r),this.zoom(p,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=gt(n.nodeVal),s=function(d){return Math.sqrt(Math.max(0,i(d)||1))*n.nodeRelSize},l=n.graphData.nodes.filter(r).map(function(u){return{x:u.x,y:u.y,r:s(u)}});return l.length?{x:[Lj(l,function(u){return u.x-u.r}),Pj(l,function(u){return u.x+u.r})],y:[Lj(l,function(u){return u.y-u.r}),Pj(l,function(u){return u.y+u.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},Yte),stateInit:function(){return{lastSetZoom:1,zoom:iQ(),forceGraph:new bh,shadowGraph:new bh().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new NJ,tweenGroup:new BM}},init:function(n,r){var i=this;n.innerHTML="";var s=document.createElement("div");s.classList.add("force-graph-container"),s.style.position="relative",n.appendChild(s),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),s.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var l=r.canvas.getContext("2d"),u=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),d={x:-1e12,y:-1e12},h=function(){var y=null,v=window.devicePixelRatio,x=d.x>0&&d.y>0?u.getImageData(d.x*v,d.y*v,1,1):null;return x&&(y=r.colorTracker.lookup(x.data)),y};Or(r.canvas).call(pW().subject(function(){if(!r.enableNodeDrag)return null;var g=h();return g&&g.type==="Node"?g.d:null}).on("start",function(g){var y=g.subject;y.__initialDragPos={x:y.x,y:y.y,fx:y.fx,fy:y.fy},g.active||(y.fx=y.x,y.fy=y.y),r.canvas.classList.add("grabbable")}).on("drag",function(g){var y=g.subject,v=y.__initialDragPos,x=g,_=li(r.canvas).k,C={x:v.x+(x.x-v.x)/_-y.x,y:v.y+(x.y-v.y)/_-y.y};["x","y"].forEach(function(k){return y["f".concat(k)]=y[k]=v[k]+(x[k]-v[k])/_}),!(!y.__dragged&&Hte>=Math.sqrt(lQ(["x","y"].map(function(k){return Math.pow(g[k]-v[k],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,y.__dragged=!0,r.onNodeDrag(y,C))}).on("end",function(g){var y=g.subject,v=y.__initialDragPos,x={x:y.x-v.x,y:y.y-v.y};v.fx===void 0&&(y.fx=void 0),v.fy===void 0&&(y.fy=void 0),delete y.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,y.__dragged&&(delete y.__dragged,r.onNodeDragEnd(y,x))})),r.zoom(r.zoom.__baseElem=Or(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(g){return!g.button&&r.enableZoomPanInteraction&&(g.type!=="wheel"||gt(r.enableZoomInteraction)(g))&&(g.type==="wheel"||gt(r.enablePanInteraction)(g))}).on("zoom",function(g){var y=g.transform;[l,u].forEach(function(v){xD(v),v.translate(y.x,y.y),v.scale(y.k,y.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(Io(Io({},y),i.centerAt())),r.needsRedraw=!0}).on("end",function(g){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(Io(Io({},g.transform),i.centerAt()))}),Ey(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){li(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=$te/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new WJ(s),["pointermove","pointerdown"].forEach(function(g){return s.addEventListener(g,function(y){g==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=y),!r.isPointerDragging&&y.type==="pointermove"&&r.onBackgroundClick&&(y.pressure>0||r.isPointerPressed)&&(y.pointerType==="mouse"||y.movementX===void 0||[y.movementX,y.movementY].some(function(_){return Math.abs(_)>1}))&&(r.isPointerDragging=!0);var v=x(s);d.x=y.pageX-v.left,d.y=y.pageY-v.top;function x(_){var C=_.getBoundingClientRect(),k=window.pageXOffset||document.documentElement.scrollLeft,j=window.pageYOffset||document.documentElement.scrollTop;return{top:C.top+j,left:C.left+k}}},{passive:!0})}),s.addEventListener("pointerup",function(g){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var y=[g,r.pointerDownEvent];requestAnimationFrame(function(){if(g.button===0)if(r.hoverObj){var v=r["on".concat(r.hoverObj.type,"Click")];v&&v.apply(void 0,[r.hoverObj.d].concat(y))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,y);if(g.button===2)if(r.hoverObj){var x=r["on".concat(r.hoverObj.type,"RightClick")];x&&x.apply(void 0,[r.hoverObj.d].concat(y))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,y)})}},{passive:!0}),s.addEventListener("contextmenu",function(g){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(g.preventDefault(),!1)}),r.forceGraph(l),r.shadowGraph(u);var p=zQ(function(){vk(u,r.width,r.height),r.shadowGraph.linkWidth(function(y){return gt(r.linkWidth)(y)+r.linkHoverPrecision});var g=li(r.canvas);r.shadowGraph.globalScale(g.k).tickFrame()},Bte);r.flushShadowCanvas=p.flush,(this._animationCycle=function g(){var y=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(N){return N.__photons&&N.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var v=r.isPointerDragging?null:h();if(v!==r.hoverObj){var x=r.hoverObj,_=x?x.type:null,C=v?v.type:null;if(_&&_!==C){var k=r["on".concat(_,"Hover")];k&&k(null,x.d)}if(C){var j=r["on".concat(C,"Hover")];j&&j(v.d,_===C?x.d:null)}r.tooltip.content(v&>(r["".concat(v.type.toLowerCase(),"Label")])(v.d)||null),r.canvas.classList[(v&&r["on".concat(C,"Click")]||!v&&r.onBackgroundClick)&>(r.showPointerCursor)(v?.d)?"add":"remove"]("clickable"),r.hoverObj=v}y&&p()}if(y){vk(l,r.width,r.height);var E=li(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(l,E),r.forceGraph.globalScale(E).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(l,E)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(g)})()},update:function(n){}}),Ny={exports:{}},Ty,xk;function Kte(){if(xk)return Ty;xk=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ty=e,Ty}var Ay,bk;function Wte(){if(bk)return Ay;bk=1;var e=Kte();function n(){}function r(){}return r.resetWarningCache=n,Ay=function(){function i(u,d,h,p,g,y){if(y!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}i.isRequired=i;function s(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:s,element:i,elementType:i,instanceOf:s,node:i,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:r,resetWarningCache:n};return l.PropTypes=l,l},Ay}var wk;function Zte(){return wk||(wk=1,Ny.exports=Wte()()),Ny.exports}var Qte=Zte();const ne=mc(Qte),up={width:ne.number,height:ne.number,graphData:ne.shape({nodes:ne.arrayOf(ne.object).isRequired,links:ne.arrayOf(ne.object).isRequired}),backgroundColor:ne.string,nodeRelSize:ne.number,nodeId:ne.string,nodeLabel:ne.oneOfType([ne.string,ne.func]),nodeVal:ne.oneOfType([ne.number,ne.string,ne.func]),nodeVisibility:ne.oneOfType([ne.bool,ne.string,ne.func]),nodeColor:ne.oneOfType([ne.string,ne.func]),nodeAutoColorBy:ne.oneOfType([ne.string,ne.func]),onNodeHover:ne.func,onNodeClick:ne.func,linkSource:ne.string,linkTarget:ne.string,linkLabel:ne.oneOfType([ne.string,ne.func]),linkVisibility:ne.oneOfType([ne.bool,ne.string,ne.func]),linkColor:ne.oneOfType([ne.string,ne.func]),linkAutoColorBy:ne.oneOfType([ne.string,ne.func]),linkWidth:ne.oneOfType([ne.number,ne.string,ne.func]),linkCurvature:ne.oneOfType([ne.number,ne.string,ne.func]),linkDirectionalArrowLength:ne.oneOfType([ne.number,ne.string,ne.func]),linkDirectionalArrowColor:ne.oneOfType([ne.string,ne.func]),linkDirectionalArrowRelPos:ne.oneOfType([ne.number,ne.string,ne.func]),linkDirectionalParticles:ne.oneOfType([ne.number,ne.string,ne.func]),linkDirectionalParticleSpeed:ne.oneOfType([ne.number,ne.string,ne.func]),linkDirectionalParticleOffset:ne.oneOfType([ne.number,ne.string,ne.func]),linkDirectionalParticleWidth:ne.oneOfType([ne.number,ne.string,ne.func]),linkDirectionalParticleColor:ne.oneOfType([ne.string,ne.func]),onLinkHover:ne.func,onLinkClick:ne.func,dagMode:ne.oneOf(["td","bu","lr","rl","zin","zout","radialin","radialout"]),dagLevelDistance:ne.number,dagNodeFilter:ne.func,onDagError:ne.func,d3AlphaMin:ne.number,d3AlphaDecay:ne.number,d3VelocityDecay:ne.number,warmupTicks:ne.number,cooldownTicks:ne.number,cooldownTime:ne.number,onEngineTick:ne.func,onEngineStop:ne.func,getGraphBbox:ne.func},bD={zoomToFit:ne.func,onNodeRightClick:ne.func,onNodeDrag:ne.func,onNodeDragEnd:ne.func,onLinkRightClick:ne.func,linkHoverPrecision:ne.number,onBackgroundClick:ne.func,onBackgroundRightClick:ne.func,showPointerCursor:ne.oneOfType([ne.bool,ne.func]),enablePointerInteraction:ne.bool,enableNodeDrag:ne.bool},rb={showNavInfo:ne.bool,nodeOpacity:ne.number,nodeResolution:ne.number,nodeThreeObject:ne.oneOfType([ne.object,ne.string,ne.func]),nodeThreeObjectExtend:ne.oneOfType([ne.bool,ne.string,ne.func]),nodePositionUpdate:ne.func,linkOpacity:ne.number,linkResolution:ne.number,linkCurveRotation:ne.oneOfType([ne.number,ne.string,ne.func]),linkMaterial:ne.oneOfType([ne.object,ne.string,ne.func]),linkThreeObject:ne.oneOfType([ne.object,ne.string,ne.func]),linkThreeObjectExtend:ne.oneOfType([ne.bool,ne.string,ne.func]),linkPositionUpdate:ne.func,linkDirectionalArrowResolution:ne.number,linkDirectionalParticleResolution:ne.number,linkDirectionalParticleThreeObject:ne.oneOfType([ne.object,ne.string,ne.func]),forceEngine:ne.oneOf(["d3","ngraph"]),ngraphPhysics:ne.object,numDimensions:ne.oneOf([1,2,3])},Jte=Object.assign({},up,bD,{linkLineDash:ne.oneOfType([ne.arrayOf(ne.number),ne.string,ne.func]),nodeCanvasObjectMode:ne.oneOfType([ne.string,ne.func]),nodeCanvasObject:ne.func,nodePointerAreaPaint:ne.func,linkCanvasObjectMode:ne.oneOfType([ne.string,ne.func]),linkCanvasObject:ne.func,linkPointerAreaPaint:ne.func,linkDirectionalParticleCanvasObject:ne.func,autoPauseRedraw:ne.bool,minZoom:ne.number,maxZoom:ne.number,enableZoomInteraction:ne.oneOfType([ne.bool,ne.func]),enablePanInteraction:ne.oneOfType([ne.bool,ne.func]),onZoom:ne.func,onZoomEnd:ne.func,onRenderFramePre:ne.func,onRenderFramePost:ne.func});Object.assign({},up,bD,rb,{enableNavigationControls:ne.bool,controlType:ne.oneOf(["trackball","orbit","fly"]),rendererConfig:ne.object,extraRenderers:ne.arrayOf(ne.shape({render:ne.func.isRequired}))});Object.assign({},up,rb,{nodeDesc:ne.oneOfType([ne.string,ne.func]),linkDesc:ne.oneOfType([ne.string,ne.func])});Object.assign({},up,rb,{markerAttrs:ne.object,yOffset:ne.number,glScale:ne.number});const ib=kX(Xte,{methodNames:["emitParticle","d3Force","d3ReheatSimulation","stopAnimation","pauseAnimation","resumeAnimation","centerAt","zoom","zoomToFit","getGraphBbox","screen2GraphCoords","graph2ScreenCoords"]});ib.displayName="ForceGraph2D";ib.propTypes=Jte;function ene(e){try{return new Date(e).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function tne(){const[e,n]=S.useState([]),[r,i]=S.useState("graph"),[s,l]=S.useState([]),[u,d]=S.useState(!1),[h,p]=S.useState(""),[g,y]=S.useState(""),[v,x]=S.useState(!1),[_,C]=S.useState(""),[k,j]=S.useState(""),[E,N]=S.useState(!1),[M,R]=S.useState(null),[z,P]=S.useState(!1),[D,$]=S.useState(null),[U,X]=S.useState([]),[K,ae]=S.useState([]),[B,Z]=S.useState(!1),[O,q]=S.useState(null),[I,H]=S.useState(!0),[A,F]=S.useState(null),G=S.useRef(null),L=S.useRef(null),[ee,ce]=S.useState({w:0,h:0}),[Y,Q]=S.useState(!1),[re,fe]=S.useState(null),we=re?U.find(me=>me.id===re)??null:null,ke=(()=>{if(!we)return"";if(we.type==="agent"){const me=we.agent_id;return(me?e.find(ut=>ut.id===me):void 0)?.name??me??we.id}return we.type==="tag"?String(we.label??we.id):we.type==="memory"?String(we.label??we.text??we.id):we.id})(),Ie=(()=>{if(!we)return{incoming:[],outgoing:[]};const me=K.filter(ut=>ut.to===we.id).map(ut=>ut.from),Le=K.filter(ut=>ut.from===we.id).map(ut=>ut.to);return{incoming:me,outgoing:Le}})();S.useEffect(()=>{pe.getAgents().then(me=>n(me.agents)).catch(me=>F(me.message)).finally(()=>H(!1))},[]),S.useEffect(()=>{try{const me=sessionStorage.getItem("memoryFilterAgentId");me&&(sessionStorage.removeItem("memoryFilterAgentId"),y(me),i("list"),d(!0),F(null),pe.searchMemory({agent_id:me,limit:50,semantic:!1}).then(Le=>l(Le.results)).catch(Le=>F(Le.message)).finally(()=>d(!1)))}catch{}},[]),S.useEffect(()=>{r==="graph"&&U.length===0&&!B&<()},[r]),S.useEffect(()=>{if(r!=="graph"||U.length===0||ee.w>0&&ee.h>0)return;const me=L.current;if(!me)return;let Le=0,ut=!1,Zt=0;const Ut=10,Cn=()=>{if(ut||Zt>=Ut)return;Zt+=1;const nn=me.getBoundingClientRect(),wt=Math.max(0,Math.floor(nn.width)),mn=Math.max(0,Math.floor(nn.height));if(wt>0&&mn>0){ce({w:wt,h:mn});return}Le=requestAnimationFrame(Cn)};return Le=requestAnimationFrame(Cn),()=>{ut=!0,cancelAnimationFrame(Le)}},[r,U.length,ee.w,ee.h]);function et(){if(r==="graph"){lt();return}d(!0),F(null),pe.searchMemory({q:h.trim()||void 0,agent_id:g.trim()||void 0,limit:50,semantic:v}).then(me=>l(me.results)).catch(me=>F(me.message)).finally(()=>d(!1))}function lt(){Z(!0),q(null),pe.getMemoryGraph({q:h.trim()||void 0,agent_id:g.trim()||void 0,limit:200}).then(me=>{X(me.nodes??[]),ae(me.edges??[])}).catch(me=>q(me.message)).finally(()=>Z(!1))}function cn(me){confirm("Delete this memory?")&&($(me),pe.deleteMemory(me).then(()=>l(Le=>Le.filter(ut=>ut.id!==me))).catch(Le=>F(Le.message)).finally(()=>$(null)))}function yt(){if(!_.trim()||!k.trim()){R("Agent and text are required.");return}N(!0),R(null),P(!1),pe.writeMemory({agent_id:_.trim(),text:k.trim()}).then(()=>{j(""),P(!0),et()}).catch(me=>R(me.message)).finally(()=>N(!1))}return S.useLayoutEffect(()=>{const me=L.current;if(!me)return;const Le=()=>{const Zt=me.getBoundingClientRect(),Ut=Math.max(0,Math.floor(Zt.width)),Cn=Math.max(0,Math.floor(Zt.height));ce(nn=>nn.w===Ut&&nn.h===Cn?nn:{w:Ut,h:Cn})};if(Le(),r==="graph"){const Zt=requestAnimationFrame(()=>Le()),Ut=new ResizeObserver(()=>Le());return Ut.observe(me),()=>{cancelAnimationFrame(Zt),Ut.disconnect()}}const ut=new ResizeObserver(()=>Le());return ut.observe(me),()=>ut.disconnect()},[r,U.length]),I?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading…"}):f.jsxs("div",{className:"relative min-h-[calc(100vh-3rem)] w-full overflow-x-hidden",children:[f.jsxs("div",{className:"absolute inset-0 z-0 min-h-[calc(100vh-3rem)]",children:[f.jsx(oX,{className:Ee("h-full w-full opacity-60","[mask-image:radial-gradient(ellipse_90%_90%_at_50%_50%,white,transparent_70%)]")}),f.jsx("div",{ref:L,className:Ee("absolute inset-0 h-full w-full min-h-[400px]",r!=="graph"&&"pointer-events-none"),style:{opacity:r==="graph"&&U.length>0&&!B?.9:0},"aria-hidden":r!=="graph",children:r==="graph"&&!B&&U.length>0&&ee.w>0&&ee.h>0&&f.jsx(ib,{ref:G,width:ee.w,height:ee.h,graphData:{nodes:U.map(me=>({id:me.id,label:me.type==="agent"?e.find(Le=>Le.id===me.agent_id)?.name??me.agent_id:me.type==="memory"?String(me.label??me.text??me.id):me.type==="tag"?String(me.label??me.id):me.id,type:me.type})),links:K.map(me=>({source:me.from,target:me.to,type:me.type}))},onNodeClick:me=>{const Le=String(me.id??"");Le&&(fe(Le),Q(!0))},nodeCanvasObject:(me,Le,ut)=>{const Zt=me.label,Ut=me.type,Cn=12/ut,nn=6;Le.beginPath(),Ut==="agent"?Le.fillStyle="#0f172a":Ut==="tag"?Le.fillStyle="#16a34a":Le.fillStyle="#2563eb",Le.arc(me.x,me.y,nn,0,2*Math.PI,!1),Le.fill(),Le.font=`${Cn}px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,Le.textAlign="left",Le.textBaseline="middle",Le.fillStyle="#111827",Le.fillText(Zt,me.x+nn+3,me.y)},linkColor:me=>me.type==="tagged"?"rgba(22,163,74,0.4)":"rgba(148,163,184,0.6)",linkWidth:1,cooldownTicks:60,onEngineStop:()=>{const me=G.current;me&&me.zoomToFit(400)}})})]}),f.jsxs("div",{className:"relative z-10 flex flex-col gap-4 p-6 w-full max-w-full max-w-4xl mx-auto",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 px-4 py-3 ",children:[f.jsxs("div",{children:[f.jsxs("h1",{className:"text-2xl font-semibold tracking-tight flex items-center gap-2",children:[f.jsx(Dx,{className:"size-6"}),"Memory"]}),f.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:r==="list"?"Search and add long-term memories. Switch to Graph to visualize.":"Visualize agents, memories, and tags. Click a node for details."})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("div",{className:"inline-flex rounded-full border bg-muted/60 p-1 text-xs",children:[f.jsx("button",{type:"button",className:Ee("px-3 py-1.5 rounded-full",r==="graph"?"bg-background shadow-sm":"text-muted-foreground"),onClick:()=>i("graph"),children:"Graph"}),f.jsx("button",{type:"button",className:Ee("px-3 py-1.5 rounded-full",r==="list"?"bg-background shadow-sm":"text-muted-foreground"),onClick:()=>i("list"),children:"List"})]}),f.jsxs(be,{onClick:et,disabled:u||B,children:[f.jsx(Wy,{className:"size-4 mr-1"}),r==="graph"?B?"Loading…":"Load graph":u?"Searching…":"Search"]})]})]}),(A||O)&&f.jsxs("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 px-4 py-2 text-sm text-destructive",children:[A,A&&O&&" · ",O]}),r==="list"?f.jsxs(f.Fragment,{children:[f.jsxs(qt,{className:"bg-background/90 backdrop-blur-sm shadow-sm",children:[f.jsxs(Yt,{children:[f.jsx(Xt,{className:"text-base",children:"Search memories"}),f.jsx(Kt,{children:"Filter by text or agent. Leave search empty to list recent."})]}),f.jsx(Wt,{className:"space-y-3",children:f.jsxs("div",{className:"flex flex-wrap gap-2 items-end",children:[f.jsxs("div",{className:"flex-1 min-w-[200px]",children:[f.jsx(Ne,{className:"text-xs",children:"Query (optional)"}),f.jsx(Ue,{placeholder:"Search in memory text…",value:h,onChange:me=>p(me.target.value),onKeyDown:me=>me.key==="Enter"&&et(),className:"mt-1"})]}),f.jsxs("div",{className:"w-[180px]",children:[f.jsx(Ne,{className:"text-xs",children:"Agent"}),f.jsxs("select",{value:g,onChange:me=>y(me.target.value),className:"mt-1 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[f.jsx("option",{value:"",children:"All agents"}),e.map(me=>f.jsx("option",{value:me.id,children:me.name},me.id))]})]}),f.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:v,onChange:me=>x(me.target.checked),className:"rounded border-input"}),"Semantic search"]})]})})]}),f.jsxs(qt,{className:"bg-background/90 backdrop-blur-sm shadow-sm",children:[f.jsxs(Yt,{children:[f.jsx(Xt,{className:"text-base",children:"Add memory"}),f.jsx(Kt,{children:"Store a fact for an agent."})]}),f.jsxs(Wt,{className:"space-y-3",children:[f.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[f.jsxs("div",{children:[f.jsx(Ne,{className:"text-xs",children:"Agent"}),f.jsxs("select",{value:_,onChange:me=>C(me.target.value),className:"mt-1 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[f.jsx("option",{value:"",children:"Select agent"}),e.map(me=>f.jsx("option",{value:me.id,children:me.name},me.id))]})]}),f.jsxs("div",{className:"sm:col-span-2",children:[f.jsx(Ne,{className:"text-xs",children:"Text"}),f.jsx(Ue,{placeholder:"e.g. User prefers dark mode",value:k,onChange:me=>j(me.target.value),className:"mt-1"})]})]}),M&&f.jsx("p",{className:"text-sm text-destructive",children:M}),z&&f.jsx("p",{className:"text-sm text-green-600",children:"Memory saved."}),f.jsxs(be,{onClick:yt,disabled:E||!_.trim()||!k.trim(),children:[f.jsx(Ky,{className:"size-4 mr-1"}),E?"Saving…":"Add memory"]})]})]}),f.jsxs(qt,{className:"bg-background/90 backdrop-blur-sm shadow-sm",children:[f.jsxs(Yt,{children:[f.jsx(Xt,{className:"text-base",children:"Results"}),f.jsxs(Kt,{children:[s.length," memor",s.length===1?"y":"ies"]})]}),f.jsx(Wt,{children:s.length===0?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Run a search or leave query empty and click Search."}):f.jsx("ul",{className:"space-y-3",children:s.map(me=>f.jsxs("li",{className:"rounded-lg border bg-card p-3 text-sm flex items-start justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("p",{className:"font-medium text-muted-foreground text-xs",children:[e.find(Le=>Le.id===me.agent_id)?.name??me.agent_id,me.user_id?` · user ${me.user_id}`:""," · ",ene(me.created_at)]}),f.jsx("p",{className:"mt-1",children:me.text})]}),f.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>cn(me.id),disabled:D===me.id,title:"Delete memory",children:f.jsx(Xo,{className:"size-4"})})]},me.id))})})]})]}):f.jsx("div",{className:"px-4 py-3 max-w-md",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:B?"Loading memory graph…":U.length===0?"No graph data yet. Click Load graph.":`${U.length} nodes · ${K.length} edges`})})]}),f.jsx(zx,{open:Y,onOpenChange:Q,children:f.jsxs(Px,{side:"right",className:"w-[420px] sm:max-w-md",children:[f.jsxs(Lx,{children:[f.jsx(Ix,{children:"Details"}),f.jsx(AT,{children:we?`${we.type} • ${ke}`:"Select a node to see details."})]}),f.jsx("div",{className:"px-4 pb-4 space-y-4 overflow-auto",children:we?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"Type"}),f.jsx("div",{className:"font-medium",children:we.type})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"ID"}),f.jsx("div",{className:"font-mono text-xs break-all",children:we.id})]}),we.type==="agent"&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"Agent"}),f.jsx("div",{className:"font-medium",children:ke})]}),we.type==="tag"&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"Tag"}),f.jsx("div",{className:"font-medium",children:ke})]}),we.type==="memory"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"Text"}),f.jsx("div",{className:"break-words",children:String(we.text??ke)})]}),typeof we.created_at=="string"&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"Created"}),f.jsx("div",{className:"font-mono text-xs",children:String(we.created_at)})]}),we.user_id&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"User"}),f.jsx("div",{className:"font-mono text-xs break-all",children:String(we.user_id)})]}),we.scope&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"Scope"}),f.jsx("div",{className:"font-medium",children:String(we.scope)})]}),we.tags&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("div",{className:"w-24 text-muted-foreground",children:"Tags"}),f.jsx("div",{className:"font-mono text-xs break-all",children:String(we.tags)})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-sm font-medium",children:"Connections"}),f.jsxs("div",{className:"text-sm text-muted-foreground",children:[Ie.incoming.length," incoming • ",Ie.outgoing.length," outgoing"]}),f.jsxs("div",{className:"space-y-1",children:[Ie.outgoing.slice(0,10).map(me=>f.jsxs("button",{type:"button",className:"w-full text-left text-sm rounded-md border px-2 py-1 hover:bg-muted",onClick:()=>fe(me),children:["→ ",me]},`out:${me}`)),Ie.incoming.slice(0,10).map(me=>f.jsxs("button",{type:"button",className:"w-full text-left text-sm rounded-md border px-2 py-1 hover:bg-muted",onClick:()=>fe(me),children:["← ",me]},`in:${me}`))]})]})]}):f.jsx("div",{className:"text-sm text-muted-foreground",children:"No selection."})})]})})]})}function wD(){const[e,n]=S.useState(null),[r,i]=S.useState(!1);return S.useEffect(()=>{const s=D9(),l=new WebSocket(s);return l.onopen=()=>i(!0),l.onclose=()=>i(!1),l.onerror=()=>i(!1),l.onmessage=u=>{try{const d=JSON.parse(u.data);n(d)}catch{}},()=>{l.close()}},[]),{lastEvent:e,connected:r}}function nne(){const[e,n]=S.useState([]),[r,i]=S.useState(!0),[s,l]=S.useState(null),{lastEvent:u,connected:d}=wD();function h(p=!1){p||i(!0),pe.getTasks({limit:50}).then(g=>n(g.tasks)).catch(g=>l(g.message)).finally(()=>i(!1))}return S.useEffect(()=>{h()},[]),S.useEffect(()=>{u&&h(!0)},[u]),r&&e.length===0?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading tasks…"}):s&&e.length===0?f.jsxs("div",{className:"p-4 text-destructive",children:["Failed to load tasks: ",s]}):f.jsxs("div",{className:"space-y-6 p-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Tasks"}),f.jsx("p",{className:"text-muted-foreground",children:"Live updates when tasks complete."})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[d&&f.jsx(Ns,{variant:"secondary",children:"Live"}),f.jsxs(Ns,{variant:"outline",children:[e.length," tasks"]})]})]}),f.jsxs(mv,{children:[f.jsx(gv,{children:f.jsxs(_s,{children:[f.jsx(Gr,{children:"Status"}),f.jsx(Gr,{children:"Agent / Graph"}),f.jsx(Gr,{children:"Input"}),f.jsx(Gr,{children:"Updated"}),f.jsx(Gr,{className:"max-w-xs",children:"Result"})]})}),f.jsx(yv,{children:e.map(p=>f.jsxs(_s,{children:[f.jsx(Rr,{children:f.jsx(Ns,{variant:p.status==="completed"?"default":p.status==="failed"?"destructive":p.status==="running"?"secondary":"outline",children:p.status})}),f.jsx(Rr,{className:"font-mono text-xs",children:p.graph_id?`graph: ${p.graph_id}`:p.agent_id??"—"}),f.jsx(Rr,{className:"max-w-[200px] truncate text-sm",children:p.input}),f.jsx(Rr,{className:"text-muted-foreground text-xs",children:p.updated_at}),f.jsx(Rr,{className:"max-w-xs truncate text-xs",children:p.result?.output??p.result?.error??"—"})]},p.id))})]})]})}function Oc({docKey:e,title:n,open:r,onOpenChange:i}){const[s,l]=S.useState(null),[u,d]=S.useState(!1),[h,p]=S.useState(null);return S.useEffect(()=>{r&&(d(!0),p(null),pe.getDoc(e).then(g=>{l(g.content)}).catch(g=>{p(g.message),l(null)}).finally(()=>d(!1)))},[r,e]),f.jsx(zx,{open:r,onOpenChange:i,children:f.jsxs(Px,{side:"right",className:"w-full sm:max-w-xl flex flex-col p-0",children:[f.jsx(Lx,{className:"p-4 border-b shrink-0",children:f.jsx(Ix,{children:n})}),f.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[u&&f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),h&&f.jsx("p",{className:"text-sm text-destructive",children:h}),s&&!u&&f.jsx(Wh,{content:s,className:"text-sm [&_h1]:text-lg [&_h2]:text-base [&_h1]:mt-4 [&_h2]:mt-3 [&_ul]:my-2 [&_ol]:my-2"})]})]})})}function rne(){const[e,n]=S.useState([]),[r,i]=S.useState(!0),[s,l]=S.useState(null),{lastEvent:u,connected:d}=wD();function h(p=!1){p||i(!0),pe.getLogs().then(g=>n(g.events??[])).catch(g=>l(g.message)).finally(()=>i(!1))}return S.useEffect(()=>{h()},[]),S.useEffect(()=>{u&&h(!0)},[u]),r&&e.length===0?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading logs…"}):s&&e.length===0?f.jsxs("div",{className:"p-4 text-destructive",children:["Failed to load logs: ",s]}):f.jsxs("div",{className:"space-y-6 p-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Logs"}),f.jsx("p",{className:"text-muted-foreground",children:"Live event stream from the runtime."})]}),d&&f.jsx(Ns,{variant:"secondary",children:"Live"})]}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Event stream"}),f.jsx(Kt,{children:"Task, agent, and tool events from the runtime."})]}),f.jsx(Wt,{children:f.jsx("ul",{className:"space-y-2 max-h-[70vh] overflow-y-auto",children:[...e].reverse().map((p,g)=>f.jsxs("li",{className:"rounded-lg border bg-muted/30 p-2 font-mono text-xs",children:[f.jsx("span",{className:"text-muted-foreground",children:p.timestamp})," ",f.jsx("span",{className:"font-semibold",children:p.type}),f.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-all text-[10px]",children:JSON.stringify(p.data)})]},g))})})]})]})}const Ry=[{id:"openai",label:"OpenAI",getKeyUrl:"https://platform.openai.com/api-keys",envVar:"OPENAI_API_KEY",hint:"GPT-4, GPT-4o. Used when agent model is e.g. gpt-4o-mini."},{id:"anthropic",label:"Anthropic",getKeyUrl:"https://console.anthropic.com/settings/keys",envVar:"ANTHROPIC_API_KEY",hint:"Claude. Set this when your agent uses Anthropic as provider; or use OpenRouter key with model anthropic/claude-*."},{id:"google",label:"Google (Gemini)",getKeyUrl:"https://aistudio.google.com/app/apikey",envVar:"GOOGLE_GENERATIVE_AI_API_KEY",hint:"Gemini. Set this when your agent uses Google (Gemini) as provider; or use OpenRouter with model google/gemini-*."},{id:"openrouter",label:"OpenRouter",getKeyUrl:"https://openrouter.ai/keys",envVar:"OPENROUTER_API_KEY",hint:"One key for 400+ models (OpenAI, Claude, Gemini via e.g. openai/gpt-4o, anthropic/claude-3.5-sonnet)."}];function SD({compact:e,onHasKeyChange:n}){const[r,i]=S.useState({}),[s,l]=S.useState({}),[u,d]=S.useState({}),[h,p]=S.useState(!0),[g,y]=S.useState(!1),[v,x]=S.useState(!1),[_,C]=S.useState(null);S.useEffect(()=>{pe.getSettings().then(E=>{const N={openai:E.has_openai_key??!1,anthropic:E.has_anthropic_key??!1,google:E.has_google_key??!1,openrouter:E.has_openrouter_key??!1};i(N),n?.(N.openai||N.anthropic||N.google||N.openrouter)}).catch(E=>C(E.message)).finally(()=>p(!1))},[n]);function k(E){E.preventDefault(),C(null),x(!0);const N={};u.openai&&(N.openai_api_key=s.openai?.trim()||null),u.anthropic&&(N.anthropic_api_key=s.anthropic?.trim()||null),u.google&&(N.google_api_key=s.google?.trim()||null),u.openrouter&&(N.openrouter_api_key=s.openrouter?.trim()||null),pe.saveSettings(N).then(()=>{i(M=>({...M,...Object.fromEntries(Ry.filter(R=>u[R.id]).map(R=>[R.id,!!s[R.id]?.trim()]))})),l(M=>({...M,...Object.fromEntries(Ry.filter(R=>u[R.id]).map(R=>[R.id,""]))})),d({}),y(!0),setTimeout(()=>y(!1),2e3),n?.(!0)}).catch(M=>C(M.message)).finally(()=>x(!1))}if(h)return f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading settings…"});const j=f.jsxs("form",{className:"space-y-6",onSubmit:k,children:[Ry.map(E=>f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Ne,{htmlFor:`api-key-${E.id}`,children:E.label}),f.jsxs("a",{href:E.getKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Get API key",f.jsx(kT,{className:"size-3"})]})]}),f.jsx(Ue,{id:`api-key-${E.id}`,type:"password",autoComplete:"off",placeholder:r[E.id]&&!u[E.id]?"•••••••• (leave blank to keep, or enter new to replace)":`Paste ${E.label} key…`,value:s[E.id]??"",onChange:N=>{l(M=>({...M,[E.id]:N.target.value})),d(M=>({...M,[E.id]:!0}))},className:"font-mono text-sm"}),!e&&f.jsx("p",{className:"text-xs text-muted-foreground",children:E.hint})]},E.id)),_&&f.jsx("p",{className:"text-sm text-destructive",children:_}),f.jsx(be,{type:"submit",disabled:v||!Object.keys(u).length,children:g?"Saved":v?"Saving…":"Save"})]});return e?f.jsx("div",{className:"space-y-4",children:j}):f.jsx("div",{className:"space-y-6",children:f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"AI API keys"}),f.jsx(Kt,{children:"Add API keys for the providers you use. Stored in ~/.agent-os on the server. Env vars override if set. Agents use OpenAI or OpenRouter depending on the model (e.g. openai/gpt-4o uses OpenRouter)."})]}),f.jsx(Wt,{children:j})]})})}const zc="",ine=[{id:"channels",label:"Overview"},{id:"telegram",label:"Telegram"},{id:"slack",label:"Slack"},{id:"discord",label:"Discord"},{id:"signal",label:"Signal"},{id:"viber",label:"Viber"}],ane=[{id:"dashboard_access",label:"Dashboard access",icon:f.jsx(ET,{className:"size-4"})},{id:"ai_provider",label:"AI Provider",icon:f.jsx(w8,{className:"size-4"})}],sne=[{id:"tasks",label:"Tasks",icon:f.jsx(_8,{className:"size-4"})},{id:"logs",label:"Logs",icon:f.jsx(P8,{className:"size-4"})}],one=e=>e==="channels"||e==="telegram"||e==="slack"||e==="discord"||e==="signal"||e==="viber";function Pc({currentStep:e}){const n=[{n:1,label:"Configure"},{n:2,label:"Verify"},{n:3,label:"Ready"}];return f.jsx("div",{className:"flex items-center gap-2 text-sm mb-4",children:n.map(({n:r,label:i})=>f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:Ee("font-medium",r===e?"text-primary":"text-muted-foreground"),children:[r," ",i]}),r<3&&f.jsx("span",{className:"text-muted-foreground",children:"→"})]},r))})}function lne(){return f.jsx(SD,{})}function une(){const[e,n]=S.useState(!1),[r,i]=S.useState(null),[s,l]=S.useState(null),[u,d]=S.useState(!1);async function h(){n(!0),i(null),l(null);try{const g=await pe.regenerateDashboardToken();i(g.token),l(g.message)}catch(g){l(g instanceof Error?g.message:String(g))}finally{n(!1)}}function p(){r&&navigator.clipboard.writeText(r).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})}return f.jsx("div",{className:"space-y-6",children:f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Dashboard login token"}),f.jsx(Kt,{children:"The gateway token is used to log in to this dashboard. You can regenerate it here and copy the new token. After restarting the server, the new token will be required to log in; your current session stays valid until then."})]}),f.jsxs(Wt,{className:"space-y-4",children:[f.jsx(be,{type:"button",onClick:h,disabled:e,children:e?"Regenerating…":"Regenerate token"}),r&&f.jsxs("div",{className:"space-y-2 rounded-lg border bg-muted/30 p-3",children:[f.jsx(Ne,{className:"text-xs",children:"New token (copy and save it)"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ue,{readOnly:!0,value:r,className:"font-mono text-sm"}),f.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:p,title:"Copy",children:f.jsx(CT,{className:"size-4"})})]}),u&&f.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"Copied to clipboard."}),s&&f.jsx("p",{className:"text-xs text-muted-foreground",children:s})]}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:["You can also view or regenerate the token from the CLI: ",f.jsx("code",{className:"rounded bg-muted px-1",children:"sulala dashboard-token"})," or ",f.jsx("code",{className:"rounded bg-muted px-1",children:"sulala dashboard-token --regenerate"})]})]})]})})}function cne(){const[e,n]=S.useState(""),[r,i]=S.useState(""),[s,l]=S.useState([]),[u,d]=S.useState(!0),[h,p]=S.useState(!1),[g,y]=S.useState(!1),[v,x]=S.useState(null),[_,C]=S.useState(!1),[k,j]=S.useState(null),[E,N]=S.useState(""),[M,R]=S.useState(!1),[z,P]=S.useState(null),[D,$]=S.useState(!1),[U,X]=S.useState(!1),[K,ae]=S.useState(!1);function B(){pe.getTelegramStatus().then(j).catch(()=>j(null))}S.useEffect(()=>{Promise.all([pe.getSettings(),pe.getAgents()]).then(([H,A])=>{C(!!H.telegram_configured),i(H.telegram_default_agent_id??""),l(A.agents.map(F=>({id:F.id,name:F.name}))),H.telegram_configured||n("")}).catch(H=>x(H.message)).finally(()=>d(!1))},[]),S.useEffect(()=>{u||B()},[u]);const Z=zc.replace(/\/$/,""),O=`${Z}/api/channels/telegram/webhook`;S.useEffect(()=>{!E&&Z&&N(Z)},[Z]);function q(H){H.preventDefault(),x(null),p(!0),pe.saveSettings({telegram_bot_token:e.trim()||null,telegram_default_agent_id:r.trim()||null}).then(()=>{C(!!e.trim()),y(!0),setTimeout(()=>y(!1),2e3),ae(!0),B(),setTimeout(()=>ae(!1),1500)}).catch(A=>x(A.message)).finally(()=>p(!1))}const I=k?.configured?k?.error?2:3:1;return u?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading…"}):f.jsxs("div",{className:"space-y-6",children:[f.jsx(Oc,{docKey:"telegram-setup",title:"How to set up Telegram",open:D,onOpenChange:$}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Telegram"}),f.jsx(Kt,{children:"Paste your bot token from BotFather. For local dev the server uses polling (no HTTPS). For production, set a webhook in Advanced."}),f.jsx(Pc,{currentStep:I}),f.jsxs("button",{type:"button",className:"flex items-center gap-1 text-sm text-primary hover:underline",onClick:()=>$(!0),children:[f.jsx(Zn,{className:"size-4"}),"How to get credentials"]})]}),f.jsxs(Wt,{children:[k&&k.configured&&f.jsx("div",{className:"mb-4 rounded-lg border bg-muted/30 px-3 py-2 text-sm",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[f.jsx("span",{className:"font-medium",children:"Status:"}),f.jsx("span",{className:"text-green-600 dark:text-green-400",children:k.webhook_set?"Webhook connected":"Using polling"}),k.webhook_url&&f.jsx("span",{className:"text-muted-foreground truncate max-w-[200px]",title:k.webhook_url,children:k.webhook_url}),k.error&&f.jsx("span",{className:"text-destructive",children:k.error}),f.jsx(be,{type:"button",variant:"ghost",size:"sm",className:"ml-auto",onClick:B,children:"Refresh"})]})}),f.jsxs("form",{className:"space-y-4",onSubmit:q,children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"telegram-token",children:"Bot token *"}),f.jsx(Ue,{id:"telegram-token",type:"password",autoComplete:"off",placeholder:_?"•••••••• (leave blank to keep existing)":"123456:ABC-DEF...",value:e,onChange:H=>n(H.target.value)}),_&&!e&&f.jsx("p",{className:"text-xs text-muted-foreground",children:"Token is already set. Enter a new one to replace, or leave blank to keep it."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"telegram-agent",children:"Default agent"}),f.jsxs("select",{id:"telegram-agent",className:"flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm",value:r,onChange:H=>i(H.target.value),children:[f.jsx("option",{value:"",children:"First agent (fallback)"}),s.map(H=>f.jsxs("option",{value:H.id,children:[H.name," (",H.id,")"]},H.id))]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Agent that will reply to Telegram messages."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(be,{type:"button",variant:"ghost",size:"sm",className:"px-0 text-muted-foreground",onClick:()=>X(!U),children:[U?f.jsx(hl,{className:"size-4 mr-1 inline"}):f.jsx(Zn,{className:"size-4 mr-1 inline"}),U?"Hide advanced":"Show advanced"]}),U&&f.jsxs("div",{className:"space-y-2 rounded-lg border bg-muted/20 p-3",children:[f.jsx(Ne,{children:"Webhook (optional, for production)"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Only needed when you have a public HTTPS URL. If unset, the server uses polling."}),f.jsx("p",{className:"text-sm font-mono break-all bg-muted/50 rounded px-2 py-1.5",children:O}),k?.configured&&!k?.webhook_set&&f.jsxs("div",{className:"flex flex-wrap items-end gap-2 pt-2",children:[f.jsxs("div",{className:"flex-1 min-w-[200px] space-y-1",children:[f.jsx(Ne,{htmlFor:"webhook-base",className:"text-xs",children:"Public base URL (HTTPS)"}),f.jsx(Ue,{id:"webhook-base",type:"url",placeholder:"https://your-ngrok-or-domain.com",value:E,onChange:H=>{N(H.target.value),P(null)},className:"font-mono text-sm"})]}),f.jsx(be,{type:"button",disabled:M||!E.trim(),onClick:()=>{P(null),R(!0),pe.setTelegramWebhook(E.trim()).then(H=>{H.ok?B():P(H.error??"Failed")}).catch(H=>P(H.message)).finally(()=>R(!1))},children:M?"Setting…":"Set webhook"})]}),z&&f.jsx("p",{className:"text-sm text-destructive",children:z})]})]}),v&&f.jsx("p",{className:"text-sm text-destructive",children:v}),f.jsx(be,{type:"submit",disabled:h,children:h?"Saving…":K?"Verifying…":g?"Saved":"Save & Test"})]})]})]})]})}function dne(){const[e,n]=S.useState(""),[r,i]=S.useState(""),[s,l]=S.useState([]),[u,d]=S.useState(!0),[h,p]=S.useState(!1),[g,y]=S.useState(!1),[v,x]=S.useState(null),[_,C]=S.useState(!1),[k,j]=S.useState(null),[E,N]=S.useState(!1),[M,R]=S.useState(!1);S.useEffect(()=>{Promise.all([pe.getSettings(),pe.getAgents()]).then(([D,$])=>{C(!!D.signal_configured),n(D.signal_bridge_url??""),i(D.signal_default_agent_id??""),l($.agents.map(U=>({id:U.id,name:U.name})))}).catch(D=>x(D.message)).finally(()=>d(!1))},[]),S.useEffect(()=>{u||pe.getSignalStatus().then(j).catch(()=>j(null))},[u]);function z(D){D.preventDefault(),x(null),p(!0),pe.saveSettings({signal_bridge_url:e.trim()?e.trim():_?void 0:null,signal_default_agent_id:r.trim()||null}).then(()=>{C(!!e.trim()),y(!0),setTimeout(()=>y(!1),2e3),R(!0),pe.getSignalStatus().then(j).finally(()=>setTimeout(()=>R(!1),800))}).catch($=>x($.message)).finally(()=>p(!1))}const P=k?.configured?3:1;return u?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading…"}):f.jsxs("div",{className:"space-y-6",children:[f.jsx(Oc,{docKey:"signal-setup",title:"How to set up Signal",open:E,onOpenChange:N}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Signal"}),f.jsx(Kt,{children:"Use a Signal bridge (e.g. signal-cli or signal-cli-api) that receives Signal messages and POSTs to our webhook. We reply via the bridge’s send endpoint."}),f.jsx(Pc,{currentStep:P}),f.jsxs("button",{type:"button",className:"flex items-center gap-1 text-sm text-primary hover:underline",onClick:()=>N(!0),children:[f.jsx(Zn,{className:"size-4"}),"How to get credentials"]})]}),f.jsxs(Wt,{children:[k?.configured&&f.jsxs("div",{className:"mb-4 rounded-lg border bg-muted/30 px-3 py-2 text-sm",children:[f.jsx("span",{className:"font-medium",children:"Status:"})," ",f.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Bridge URL set"})]}),f.jsxs("form",{className:"space-y-4",onSubmit:z,children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"signal-bridge-url",children:"Bridge URL *"}),f.jsx(Ue,{id:"signal-bridge-url",type:"url",autoComplete:"off",placeholder:_?"Leave blank to keep current":"http://localhost:8080",value:e,onChange:D=>n(D.target.value)}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:["Base URL of the Signal bridge. The bridge must POST incoming messages to our webhook and expose POST /send with body ","{ to, text }"," for replies."]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"signal-agent",children:"Default agent"}),f.jsxs("select",{id:"signal-agent",className:"flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm",value:r,onChange:D=>i(D.target.value),children:[f.jsx("option",{value:"",children:"First agent (fallback)"}),s.map(D=>f.jsxs("option",{value:D.id,children:[D.name," (",D.id,")"]},D.id))]})]}),f.jsxs("p",{className:"text-xs text-muted-foreground font-mono break-all",children:["Webhook URL (for bridge): ",zc,"/api/channels/signal/webhook"]}),v&&f.jsx("p",{className:"text-sm text-destructive",children:v}),f.jsx(be,{type:"submit",disabled:h,children:h?"Saving…":M?"Verifying…":g?"Saved":"Save & Test"})]})]})]})]})}function fne(){const[e,n]=S.useState(""),[r,i]=S.useState(""),[s,l]=S.useState([]),[u,d]=S.useState(!0),[h,p]=S.useState(!1),[g,y]=S.useState(!1),[v,x]=S.useState(null),[_,C]=S.useState(!1),[k,j]=S.useState(null),[E,N]=S.useState(!1),[M,R]=S.useState(!1),[z,P]=S.useState(!1),[D,$]=S.useState(""),[U,X]=S.useState(null),[K,ae]=S.useState(!1),B=zc+"/api/channels/viber/webhook";function Z(){pe.getViberStatus().then(j).catch(()=>j(null))}S.useEffect(()=>{Promise.all([pe.getSettings(),pe.getAgents()]).then(([I,H])=>{C(!!I.viber_configured),i(I.viber_default_agent_id??""),l(H.agents.map(A=>({id:A.id,name:A.name}))),I.viber_configured||n("")}).catch(I=>x(I.message)).finally(()=>d(!1))},[]),S.useEffect(()=>{u||Z()},[u]);function O(I){I.preventDefault(),x(null),p(!0),pe.saveSettings({viber_auth_token:e.trim()||(_?void 0:null),viber_default_agent_id:r.trim()||null}).then(()=>{C(!!e.trim()),y(!0),setTimeout(()=>y(!1),2e3),R(!0),Z(),setTimeout(()=>R(!1),800)}).catch(H=>x(H.message)).finally(()=>p(!1))}const q=k?.configured?k?.error?2:3:1;return u?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading…"}):f.jsxs("div",{className:"space-y-6",children:[f.jsx(Oc,{docKey:"viber-setup",title:"How to set up Viber",open:E,onOpenChange:N}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Viber"}),f.jsx(Kt,{children:"Paste your Viber bot auth token. Viber requires a public HTTPS URL for the webhook—set it in Advanced."}),f.jsx(Pc,{currentStep:q}),f.jsxs("button",{type:"button",className:"flex items-center gap-1 text-sm text-primary hover:underline",onClick:()=>N(!0),children:[f.jsx(Zn,{className:"size-4"}),"How to get credentials"]})]}),f.jsxs(Wt,{children:[k?.configured&&f.jsx("div",{className:"mb-4 rounded-lg border bg-muted/30 px-3 py-2 text-sm",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[f.jsx("span",{className:"font-medium",children:"Status:"}),f.jsx("span",{className:k.webhook_set?"text-green-600 dark:text-green-400":"text-muted-foreground",children:k.webhook_set?"Webhook connected":"Webhook not set"}),k.webhook_url&&f.jsx("span",{className:"text-muted-foreground truncate max-w-[200px]",title:k.webhook_url,children:k.webhook_url}),k.error&&f.jsx("span",{className:"text-destructive",children:k.error}),f.jsx(be,{type:"button",variant:"ghost",size:"sm",className:"ml-auto",onClick:Z,children:"Refresh"})]})}),f.jsxs("form",{className:"space-y-4",onSubmit:O,children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"viber-token",children:"Auth token *"}),f.jsx(Ue,{id:"viber-token",type:"password",autoComplete:"off",placeholder:_?"•••••••• (leave blank to keep)":"Paste auth token…",value:e,onChange:I=>n(I.target.value)}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"From Viber: More → Settings → Bots → Edit Info → Your app key."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"viber-agent",children:"Default agent"}),f.jsxs("select",{id:"viber-agent",className:"flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm",value:r,onChange:I=>i(I.target.value),children:[f.jsx("option",{value:"",children:"First agent (fallback)"}),s.map(I=>f.jsxs("option",{value:I.id,children:[I.name," (",I.id,")"]},I.id))]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(be,{type:"button",variant:"ghost",size:"sm",className:"px-0 text-muted-foreground",onClick:()=>P(!z),children:[z?f.jsx(hl,{className:"size-4 mr-1 inline"}):f.jsx(Zn,{className:"size-4 mr-1 inline"}),z?"Hide advanced":"Show advanced"]}),z&&f.jsxs("div",{className:"space-y-2 rounded-lg border bg-muted/20 p-3",children:[f.jsx(Ne,{children:"Webhook (required for Viber)"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Viber requires a public HTTPS URL. Use ngrok or your domain."}),f.jsx("p",{className:"text-sm font-mono break-all bg-muted/50 rounded px-2 py-1.5",children:B}),k?.configured&&f.jsxs("div",{className:"flex flex-wrap items-end gap-2 pt-2",children:[f.jsxs("div",{className:"flex-1 min-w-[200px] space-y-1",children:[f.jsx(Ne,{htmlFor:"viber-webhook-base",className:"text-xs",children:"Public base URL (HTTPS)"}),f.jsx(Ue,{id:"viber-webhook-base",type:"url",placeholder:"https://your-ngrok-or-domain.com",value:D,onChange:I=>{$(I.target.value),X(null)},className:"font-mono text-sm"})]}),f.jsx(be,{type:"button",disabled:K||!D.trim(),onClick:()=>{X(null),ae(!0),pe.setViberWebhook(D.trim()).then(I=>{I.ok?Z():X(I.error??"Failed")}).catch(I=>X(I.message)).finally(()=>ae(!1))},children:K?"Setting…":"Set webhook"})]}),U&&f.jsx("p",{className:"text-sm text-destructive",children:U})]})]}),v&&f.jsx("p",{className:"text-sm text-destructive",children:v}),f.jsx(be,{type:"submit",disabled:h,children:h?"Saving…":M?"Verifying…":g?"Saved":"Save & Test"})]})]})]})]})}function hne({onConfigure:e}){const[n,r]=S.useState(null);S.useEffect(()=>{pe.getSettings().then(r).catch(()=>r(null))},[]);const i=[{id:"telegram",name:"Telegram",configured:!!n?.telegram_configured},{id:"slack",name:"Slack",configured:!!n?.slack_configured},{id:"discord",name:"Discord",configured:!!n?.discord_configured},{id:"signal",name:"Signal",configured:!!n?.signal_configured},{id:"viber",name:"Viber",configured:!!n?.viber_configured}];return f.jsx("div",{className:"space-y-6",children:f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Channels"}),f.jsx(Kt,{children:"Connect messaging platforms so users can talk to your agent from Telegram, Slack, Discord, Signal, or Viber. Configure each channel below."})]}),f.jsx(Wt,{children:f.jsx("div",{className:"flex flex-wrap gap-4",children:i.map(s=>f.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border bg-card px-4 py-3 min-w-[200px]",children:[f.jsxs("div",{children:[f.jsx("p",{className:"font-medium",children:s.name}),f.jsx("p",{className:Ee("text-xs",s.configured?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:s.configured?"Configured":"Not configured"})]}),f.jsx(be,{variant:"outline",size:"sm",onClick:()=>e(s.id),children:"Configure"})]},s.id))})})]})})}function pne(){const[e,n]=S.useState(""),[r,i]=S.useState(""),[s,l]=S.useState(""),[u,d]=S.useState([]),[h,p]=S.useState(!0),[g,y]=S.useState(!1),[v,x]=S.useState(!1),[_,C]=S.useState(null),[k,j]=S.useState(!1),[E,N]=S.useState(null),[M,R]=S.useState(!1),[z,P]=S.useState(!1),[D,$]=S.useState(!1);S.useEffect(()=>{Promise.all([pe.getSettings(),pe.getAgents()]).then(([K,ae])=>{j(!!K.slack_configured),l(K.slack_default_agent_id??""),d(ae.agents.map(B=>({id:B.id,name:B.name}))),K.slack_configured||n("")}).catch(K=>C(K.message)).finally(()=>p(!1))},[]),S.useEffect(()=>{h||pe.getSlackStatus().then(N).catch(()=>N(null))},[h]);function U(K){K.preventDefault(),C(null),y(!0),pe.saveSettings({slack_bot_token:e.trim()||null,slack_signing_secret:r.trim()||null,slack_default_agent_id:s.trim()||null}).then(()=>{j(!!e.trim()),x(!0),setTimeout(()=>x(!1),2e3),$(!0),pe.getSlackStatus().then(N).finally(()=>setTimeout(()=>$(!1),800))}).catch(ae=>C(ae.message)).finally(()=>y(!1))}const X=E?.configured?3:1;return h?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading…"}):f.jsxs("div",{className:"space-y-6",children:[f.jsx(Oc,{docKey:"slack-setup",title:"How to set up Slack",open:M,onOpenChange:R}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Slack"}),f.jsx(Kt,{children:"Paste your bot token from the Slack Developer Portal. Set the Events API Request URL to your webhook."}),f.jsx(Pc,{currentStep:X}),f.jsxs("button",{type:"button",className:"flex items-center gap-1 text-sm text-primary hover:underline",onClick:()=>R(!0),children:[f.jsx(Zn,{className:"size-4"}),"How to get credentials"]})]}),f.jsxs(Wt,{children:[E?.configured&&f.jsxs("div",{className:"mb-4 rounded-lg border bg-muted/30 px-3 py-2 text-sm",children:[f.jsx("span",{className:"font-medium",children:"Status:"})," ",f.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Bot token set"})]}),f.jsxs("form",{className:"space-y-4",onSubmit:U,children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"slack-token",children:"Bot token (xoxb-…) *"}),f.jsx(Ue,{id:"slack-token",type:"password",autoComplete:"off",placeholder:k?"•••••••• (leave blank to keep)":"xoxb-…",value:e,onChange:K=>n(K.target.value)})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(be,{type:"button",variant:"ghost",size:"sm",className:"px-0 text-muted-foreground",onClick:()=>P(!z),children:[z?f.jsx(hl,{className:"size-4 mr-1 inline"}):f.jsx(Zn,{className:"size-4 mr-1 inline"}),z?"Hide advanced":"Show advanced"]}),z&&f.jsxs("div",{className:"space-y-2 rounded-lg border bg-muted/20 p-3",children:[f.jsx(Ne,{htmlFor:"slack-signing-secret",children:"Signing secret"}),f.jsx(Ue,{id:"slack-signing-secret",type:"password",autoComplete:"off",placeholder:"From app Basic Information → Signing Secret",value:r,onChange:K=>i(K.target.value)}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Required to verify requests from Slack. Find it in your app’s Basic Info."})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"slack-agent",children:"Default agent"}),f.jsxs("select",{id:"slack-agent",className:"flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm",value:s,onChange:K=>l(K.target.value),children:[f.jsx("option",{value:"",children:"First agent (fallback)"}),u.map(K=>f.jsxs("option",{value:K.id,children:[K.name," (",K.id,")"]},K.id))]})]}),f.jsxs("p",{className:"text-xs text-muted-foreground font-mono break-all",children:["Webhook URL: ",zc,"/api/channels/slack/webhook"]}),_&&f.jsx("p",{className:"text-sm text-destructive",children:_}),f.jsx(be,{type:"submit",disabled:g,children:g?"Saving…":D?"Verifying…":v?"Saved":"Save & Test"})]})]})]})]})}function mne(){const[e,n]=S.useState(""),[r,i]=S.useState(""),[s,l]=S.useState(""),[u,d]=S.useState([]),[h,p]=S.useState(!0),[g,y]=S.useState(!1),[v,x]=S.useState(!1),[_,C]=S.useState(null),[k,j]=S.useState(!1),[E,N]=S.useState(null),[M,R]=S.useState(!1),[z,P]=S.useState(!1);S.useEffect(()=>{Promise.all([pe.getSettings(),pe.getAgents()]).then(([U,X])=>{j(!!U.discord_configured),l(U.discord_default_agent_id??""),d(X.agents.map(K=>({id:K.id,name:K.name}))),U.discord_configured||n("")}).catch(U=>C(U.message)).finally(()=>p(!1))},[]),S.useEffect(()=>{h||pe.getDiscordStatus().then(N).catch(()=>N(null))},[h]);function D(U){U.preventDefault(),C(null),y(!0),pe.saveSettings({discord_bot_token:e.trim()||null,discord_public_key:r.trim()||null,discord_default_agent_id:s.trim()||null}).then(()=>{j(!!e.trim()),x(!0),setTimeout(()=>x(!1),2e3),P(!0),pe.getDiscordStatus().then(N).finally(()=>setTimeout(()=>P(!1),800))}).catch(X=>C(X.message)).finally(()=>y(!1))}const $=E?.configured?3:1;return h?f.jsx("div",{className:"p-4 text-muted-foreground",children:"Loading…"}):f.jsxs("div",{className:"space-y-6",children:[f.jsx(Oc,{docKey:"discord-setup",title:"How to set up Discord",open:M,onOpenChange:R}),f.jsxs(qt,{children:[f.jsxs(Yt,{children:[f.jsx(Xt,{children:"Discord"}),f.jsx(Kt,{children:"Paste your bot token and application public key from the Discord Developer Portal. Set the Interactions endpoint URL to your webhook."}),f.jsx(Pc,{currentStep:$}),f.jsxs("button",{type:"button",className:"flex items-center gap-1 text-sm text-primary hover:underline",onClick:()=>R(!0),children:[f.jsx(Zn,{className:"size-4"}),"How to get credentials"]})]}),f.jsxs(Wt,{children:[E?.configured&&f.jsxs("div",{className:"mb-4 rounded-lg border bg-muted/30 px-3 py-2 text-sm",children:[f.jsx("span",{className:"font-medium",children:"Status:"})," ",f.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Bot token set"})]}),f.jsxs("form",{className:"space-y-4",onSubmit:D,children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"discord-token",children:"Bot token *"}),f.jsx(Ue,{id:"discord-token",type:"password",autoComplete:"off",placeholder:k?"•••••••• (leave blank to keep)":"Paste bot token…",value:e,onChange:U=>n(U.target.value)})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"discord-public-key",children:"Application public key (hex) *"}),f.jsx(Ue,{id:"discord-public-key",type:"text",autoComplete:"off",placeholder:"64-char hex from Developer Portal → General Information",value:r,onChange:U=>i(U.target.value)}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Required to verify interaction requests. Copy from your app’s General Information."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"discord-agent",children:"Default agent"}),f.jsxs("select",{id:"discord-agent",className:"flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm",value:s,onChange:U=>l(U.target.value),children:[f.jsx("option",{value:"",children:"First agent (fallback)"}),u.map(U=>f.jsxs("option",{value:U.id,children:[U.name," (",U.id,")"]},U.id))]})]}),f.jsxs("p",{className:"text-xs text-muted-foreground font-mono break-all",children:["Interactions URL: ",zc,"/api/channels/discord/webhook"]}),_&&f.jsx("p",{className:"text-sm text-destructive",children:_}),f.jsx(be,{type:"submit",disabled:g,children:g?"Saving…":z?"Verifying…":v?"Saved":"Save & Test"})]})]})]})]})}function gne(){const[e,n]=S.useState("ai_provider"),r=one(e);return f.jsxs("div",{className:"flex flex-1 min-h-0",children:[f.jsxs("nav",{className:"w-52 shrink-0 border-r bg-muted/30 p-3 flex flex-col gap-0.5",children:[ane.map(i=>f.jsxs("button",{type:"button",onClick:()=>n(i.id),className:Ee("flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors w-full text-left",e===i.id?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[i.icon,i.label]},i.id)),f.jsxs("div",{className:"pt-1 mt-1 border-t border-border/50",children:[f.jsxs("button",{type:"button",onClick:()=>n("channels"),className:Ee("flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors w-full text-left",r?"text-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[r?f.jsx(hl,{className:"size-4"}):f.jsx(Zn,{className:"size-4"}),f.jsx(V8,{className:"size-4"}),"Channels"]}),r&&f.jsx("div",{className:"ml-3 mt-0.5 flex flex-col gap-0.5",children:ine.map(i=>f.jsx("button",{type:"button",onClick:()=>n(i.id),className:Ee("flex items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors w-full text-left",e===i.id?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:i.label},i.id))})]}),sne.map(i=>f.jsxs("button",{type:"button",onClick:()=>n(i.id),className:Ee("flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors w-full text-left",e===i.id?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[i.icon,i.label]},i.id))]}),f.jsx("main",{className:"flex-1 min-w-0 overflow-auto",children:f.jsxs("div",{className:"p-6",children:[e==="dashboard_access"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-6",children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Dashboard access"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Manage the gateway token used to log in to this dashboard. Regenerate here or via the CLI."})]}),f.jsx(une,{})]}),e==="ai_provider"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-6",children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Settings"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Configure your AI provider and API key. Agents use this for LLM and agent-suggestion calls."})]}),f.jsx(lne,{})]}),e==="channels"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-6",children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Channels"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect Telegram, Slack, or Discord so users can talk to your agent from those platforms."})]}),f.jsx(hne,{onConfigure:n})]}),e==="telegram"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-6",children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Telegram"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect a Telegram bot to talk to your agent from Telegram."})]}),f.jsx(cne,{})]}),e==="slack"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-6",children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Slack"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect Slack so users can message your agent in channels or DMs."})]}),f.jsx(pne,{})]}),e==="discord"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-6",children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Discord"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect Discord via a slash command (e.g. /chat) to talk to your agent."})]}),f.jsx(mne,{})]}),e==="signal"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-6",children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Signal"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect Signal via a bridge (e.g. signal-cli) so users can message your agent."})]}),f.jsx(dne,{})]}),e==="viber"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-6",children:[f.jsx("h1",{className:"text-2xl font-semibold",children:"Viber"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Connect a Viber bot so users can message your agent from Viber."})]}),f.jsx(fne,{})]}),e==="tasks"&&f.jsx(nne,{}),e==="logs"&&f.jsx(rne,{})]})})]})}const My=[{id:1,title:"AI Provider",icon:x8},{id:2,title:"First agent",icon:tl},{id:3,title:"Channel",icon:Hh}];function yne({onComplete:e,onRefresh:n,onCompleteAndOpenSettings:r,hasAnyAiKey:i,hasAnyAgent:s}){const[l,u]=S.useState(1),[d,h]=S.useState(i),[p,g]=S.useState(!1),[y,v]=S.useState(null),x=d,_=My.findIndex(k=>k.id===l);function C(){v(null),g(!0),pe.installSystemAgents().then(()=>{n(),u(3)}).catch(k=>v(k instanceof Error?k.message:String(k))).finally(()=>g(!1))}return f.jsx("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-background p-6",children:f.jsxs("div",{className:"w-full max-w-xl mx-auto space-y-8",children:[f.jsxs("div",{className:"text-center space-y-2",children:[f.jsxs("div",{className:"inline-flex items-center justify-center gap-2 rounded-full bg-primary/10 px-4 py-2 text-sm font-medium text-primary",children:[f.jsx(NT,{className:"size-4"}),"Welcome to Agent OS"]}),f.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Set up in 3 steps"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:"Configure your AI provider, add an agent, and optionally connect a channel."})]}),f.jsx("div",{className:"flex items-center justify-center gap-2",children:My.map((k,j)=>f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:Ee("flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium transition-colors",l===k.id?"bg-primary text-primary-foreground":j<_?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:[f.jsx(k.icon,{className:"size-3.5"}),k.title]}),j<My.length-1&&f.jsx(Zn,{className:"size-4 text-muted-foreground/50","aria-hidden":!0})]},k.id))}),f.jsxs("div",{className:"min-h-[280px] rounded-xl border bg-card p-6",children:[l===1&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"Add at least one API key so your agents can use an AI model. OpenRouter lets you use many models with one key."}),f.jsx(SD,{compact:!0,onHasKeyChange:h})]}),l===2&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"Create your first agent. You can install default agents from the system or add one later from the Agents page."}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 pt-2",children:[f.jsx(be,{onClick:C,disabled:p,className:"flex-1",children:p?"Installing…":"Install default agents"}),f.jsx(be,{variant:"outline",onClick:()=>u(3),className:"flex-1",children:"I'll add one later"})]}),y&&f.jsx("p",{className:"text-sm text-destructive",children:y}),s&&f.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"You already have at least one agent. Click Next to continue."})]}),l===3&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect Telegram, Slack, Discord, or another channel so users can talk to your agent from their favorite app. You can configure this anytime in Settings."}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 pt-2",children:[f.jsx(be,{onClick:e,className:"flex-1",children:"Get started"}),r&&f.jsx(be,{variant:"outline",onClick:r,className:"flex-1",children:"Open Settings to add a channel"})]})]})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{children:l>1&&f.jsx(be,{variant:"ghost",onClick:()=>u(k=>k-1),children:"Back"})}),f.jsx("div",{className:"flex gap-2",children:l<3&&f.jsxs(be,{disabled:l===1&&!x,onClick:()=>u(k=>k+1),children:["Next",f.jsx(Zn,{className:"ml-1 size-4"})]})})]})]})})}function vne(e){const[n,r]=S.useState(!0),[i,s]=S.useState(!1),[l,u]=S.useState(null),[d,h]=S.useState(!1),[p,g]=S.useState(!1),[y,v]=S.useState(!1),[x,_]=S.useState(!1),C=S.useCallback(()=>{r(!0),u(null),Promise.all([pe.getSettings(),pe.getAgents()]).then(([E,N])=>{const M=!!E.has_openai_key||!!E.has_anthropic_key||!!E.has_google_key||!!E.has_openrouter_key,R=!!E.telegram_configured||!!E.slack_configured||!!E.discord_configured||!!E.signal_configured||!!E.viber_configured;g(M),v(N.agents.length>0),_(R),h(!E.onboarding_completed)}).catch(()=>{h(!1)}).finally(()=>r(!1))},[]);S.useEffect(()=>{if(!e){r(!1),h(!1);return}let E=!1;async function N(){r(!0),u(null);try{const M=await W_();if(E)return;if(!M.ready){if(s(!0),await P9(),E)return;const $=await W_();if(s(!1),E)return;if(!$.ready){u($.error??"Workspace could not be prepared."),r(!1);return}}const[R,z]=await Promise.all([pe.getSettings(),pe.getAgents()]);if(E)return;const P=!!R.has_openai_key||!!R.has_anthropic_key||!!R.has_google_key||!!R.has_openrouter_key,D=!!R.telegram_configured||!!R.slack_configured||!!R.discord_configured||!!R.signal_configured||!!R.viber_configured;g(P),v(z.agents.length>0),_(D),h(!R.onboarding_completed)}catch{E||h(!1)}finally{E||(s(!1),r(!1))}}return N(),()=>{E=!0}},[e]);const k=S.useCallback(()=>{pe.saveSettings({onboarding_completed:!0}).then(()=>C()).catch(()=>C())},[C]),j=S.useCallback(()=>{pe.saveSettings({onboarding_completed:!1}).then(()=>C()).catch(()=>C())},[C]);return{showWizard:d,hasAnyAiKey:p,hasAnyAgent:y,hasAnyChannel:x,loading:n,settingUp:i,workspaceError:l,refresh:C,completeOnboarding:k,resetOnboarding:j}}function xne({onSuccess:e}){const[n,r]=S.useState(""),[i,s]=S.useState(null),[l,u]=S.useState(!1);async function d(h){h.preventDefault();const p=n.trim();if(!p){s("Enter the dashboard token.");return}s(null),u(!0),Wf(p);try{await pe.getAgents(),e()}catch{Wf(null),s("Invalid token. Run sulala dashboard-token in a terminal to view or copy the token.")}finally{u(!1)}}return f.jsx("div",{className:"fixed inset-0 z-50 flex min-h-screen items-center justify-center bg-background p-4",children:f.jsxs(qt,{className:"w-full max-w-sm",children:[f.jsxs(Yt,{className:"space-y-1 text-center",children:[f.jsx("div",{className:"mx-auto mb-2 flex size-10 items-center justify-center rounded-full bg-primary/10",children:f.jsx(ET,{className:"size-5 text-primary"})}),f.jsx(Xt,{className:"text-xl",children:"Dashboard access"}),f.jsx(Kt,{children:"This server is protected. Enter the dashboard token to continue."})]}),f.jsxs(Wt,{children:[f.jsxs("form",{onSubmit:d,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{htmlFor:"dashboard-token",children:"Token"}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:["Get your token from the server: run"," ",f.jsx("code",{className:"rounded bg-muted px-1",children:"sulala dashboard-token"})," in a terminal and paste it here. To generate a new token: ",f.jsx("code",{className:"rounded bg-muted px-1",children:"sulala dashboard-token --regenerate"})]}),f.jsx(Ue,{id:"dashboard-token",type:"password",placeholder:"Paste your dashboard token…",value:n,onChange:h=>{r(h.target.value),s(null)},autoComplete:"current-password",autoFocus:!0,disabled:l})]}),i&&f.jsx("p",{className:"text-sm text-destructive",role:"alert",children:i}),f.jsx(be,{type:"submit",className:"w-full",disabled:l,children:l?"Verifying…":"Continue"})]}),f.jsx("p",{className:"mt-4 text-center text-xs text-muted-foreground",children:"After logging in, you can regenerate the token in Settings → Dashboard access."})]})]})})}function bne({token:e,onContinue:n}){const[r,i]=S.useState(!1);function s(){navigator.clipboard.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})}function l(){Wf(e),n()}return f.jsx("div",{className:"fixed inset-0 z-50 flex min-h-screen items-center justify-center bg-background p-4",children:f.jsxs(qt,{className:"w-full max-w-md",children:[f.jsxs(Yt,{className:"space-y-1 text-center",children:[f.jsx("div",{className:"mx-auto mb-2 flex size-10 items-center justify-center rounded-full bg-primary/10",children:f.jsx(NT,{className:"size-5 text-primary"})}),f.jsx(Xt,{className:"text-xl",children:"Welcome — save your login token"}),f.jsx(Kt,{children:"Copy this token and store it somewhere safe. You will need it to log in next time."})]}),f.jsxs(Wt,{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ne,{className:"text-xs",children:"Dashboard token (copy and save)"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{readOnly:!0,value:e,className:"font-mono text-sm",type:"text","aria-label":"Dashboard token"}),f.jsx(be,{type:"button",variant:"outline",onClick:s,title:"Copy token",children:r?"Copied!":f.jsxs(f.Fragment,{children:[f.jsx(CT,{className:"size-4 mr-1"}),"Copy"]})})]})]}),f.jsx(be,{onClick:l,className:"w-full",children:"Continue to dashboard"}),f.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"You can regenerate the token later in Settings → Dashboard access."})]})]})})}function wne({page:e,onNavigate:n}){const{graphChatGraphId:r,graphChatInitialInput:i,clearGraphChat:s}=xA();switch(e){case"agents":return f.jsx(BC,{onNavigate:n});case"chat":return f.jsx(h$,{});case"graphs":return f.jsx(N$,{});case"graph-chat":return f.jsx(R$,{graphId:r??"",initialInput:i,onBack:()=>{s(),n("graphs")}});case"skills":return f.jsx(R7,{});case"schedules":return f.jsx(O7,{onNavigate:n});case"memory":return f.jsx(tne,{});case"settings":return f.jsx(gne,{});default:return f.jsx(BC,{onNavigate:n})}}function Sne(){const[e,n]=S.useState("agents"),[r,i]=S.useState(()=>qh()?"ok":"checking"),[s,l]=S.useState(void 0),u=r==="ok",{showWizard:d,loading:h,settingUp:p,workspaceError:g,hasAnyAiKey:y,hasAnyAgent:v,refresh:x,completeOnboarding:_}=vne(u);return S.useEffect(()=>{const C=()=>i("required");return window.addEventListener(Qy,C),()=>window.removeEventListener(Qy,C)},[]),S.useEffect(()=>{r==="checking"&&O9().then(C=>i(C?"required":"ok")).catch(()=>i("ok"))},[r]),S.useEffect(()=>{r==="required"&&(l(void 0),z9().then(C=>l(C??null)).catch(()=>l(null)))},[r]),r==="checking"?f.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"})}):r==="required"?s===void 0?f.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"})}):s!==null?f.jsx(bne,{token:s,onContinue:()=>i("ok")}):f.jsx(xne,{onSuccess:()=>i("ok")}):g?f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3 bg-background p-6",children:[f.jsx("p",{className:"text-sm font-medium text-destructive",children:"Workspace setup failed"}),f.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-md",children:g}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Ensure the app has write access to its data directory (e.g. not on iCloud or a read-only volume)."})]}):h&&!d?f.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3 bg-background",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:p?"Setting up workspace…":"Loading…"}),p&&f.jsx("p",{className:"text-xs text-muted-foreground",children:"Creating database and default agents"})]}):d?f.jsx(yne,{hasAnyAiKey:y,hasAnyAgent:v,onRefresh:x,onComplete:_,onCompleteAndOpenSettings:()=>{n("settings"),_()}}):f.jsx(L9,{onNavigate:C=>n(C),children:f.jsx(w$,{onNavigate:C=>n(C),children:f.jsx(A9,{activePage:e,onNavigate:n,children:f.jsx(wne,{page:e,onNavigate:n})})})})}$4.createRoot(document.getElementById("root")).render(f.jsx(S.StrictMode,{children:f.jsx(E9,{children:f.jsx(n9,{children:f.jsx(Sne,{})})})}));
|