agent-dag 1.33.138 → 1.33.139
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.
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();var Il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ld={exports:{}},Ko={},ud={exports:{}},Le={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var yw;function Ij(){if(yw)return Le;yw=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.iterator;function y(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,_={};function S(I,W,X){this.props=I,this.context=W,this.refs=_,this.updater=X||x}S.prototype.isReactComponent={},S.prototype.setState=function(I,W){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,W,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function b(){}b.prototype=S.prototype;function k(I,W,X){this.props=I,this.context=W,this.refs=_,this.updater=X||x}var E=k.prototype=new b;E.constructor=k,N(E,S.prototype),E.isPureReactComponent=!0;var C=Array.isArray,T=Object.prototype.hasOwnProperty,M={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function H(I,W,X){var U,J={},re=null,le=null;if(W!=null)for(U in W.ref!==void 0&&(le=W.ref),W.key!==void 0&&(re=""+W.key),W)T.call(W,U)&&!L.hasOwnProperty(U)&&(J[U]=W[U]);var de=arguments.length-2;if(de===1)J.children=X;else if(1<de){for(var te=Array(de),ce=0;ce<de;ce++)te[ce]=arguments[ce+2];J.children=te}if(I&&I.defaultProps)for(U in de=I.defaultProps,de)J[U]===void 0&&(J[U]=de[U]);return{$$typeof:e,type:I,key:re,ref:le,props:J,_owner:M.current}}function O(I,W){return{$$typeof:e,type:I.type,key:W,ref:I.ref,props:I.props,_owner:I._owner}}function P(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function F(I){var W={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(X){return W[X]})}var G=/\/+/g;function q(I,W){return typeof I=="object"&&I!==null&&I.key!=null?F(""+I.key):W.toString(36)}function j(I,W,X,U,J){var re=typeof I;(re==="undefined"||re==="boolean")&&(I=null);var le=!1;if(I===null)le=!0;else switch(re){case"string":case"number":le=!0;break;case"object":switch(I.$$typeof){case e:case n:le=!0}}if(le)return le=I,J=J(le),I=U===""?"."+q(le,0):U,C(J)?(X="",I!=null&&(X=I.replace(G,"$&/")+"/"),j(J,W,X,"",function(ce){return ce})):J!=null&&(P(J)&&(J=O(J,X+(!J.key||le&&le.key===J.key?"":(""+J.key).replace(G,"$&/")+"/")+I)),W.push(J)),1;if(le=0,U=U===""?".":U+":",C(I))for(var de=0;de<I.length;de++){re=I[de];var te=U+q(re,de);le+=j(re,W,X,te,J)}else if(te=y(I),typeof te=="function")for(I=te.call(I),de=0;!(re=I.next()).done;)re=re.value,te=U+q(re,de++),le+=j(re,W,X,te,J);else if(re==="object")throw W=String(I),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return le}function Q(I,W,X){if(I==null)return I;var U=[],J=0;return j(I,U,"","",function(re){return W.call(X,re,J++)}),U}function z(I){if(I._status===-1){var W=I._result;W=W(),W.then(function(X){(I._status===0||I._status===-1)&&(I._status=1,I._result=X)},function(X){(I._status===0||I._status===-1)&&(I._status=2,I._result=X)}),I._status===-1&&(I._status=0,I._result=W)}if(I._status===1)return I._result.default;throw I._result}var ne={current:null},Z={transition:null},$={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:Z,ReactCurrentOwner:M};function K(){throw Error("act(...) is not supported in production builds of React.")}return Le.Children={map:Q,forEach:function(I,W,X){Q(I,function(){W.apply(this,arguments)},X)},count:function(I){var W=0;return Q(I,function(){W++}),W},toArray:function(I){return Q(I,function(W){return W})||[]},only:function(I){if(!P(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Le.Component=S,Le.Fragment=r,Le.Profiler=o,Le.PureComponent=k,Le.StrictMode=s,Le.Suspense=p,Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,Le.act=K,Le.cloneElement=function(I,W,X){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var U=N({},I.props),J=I.key,re=I.ref,le=I._owner;if(W!=null){if(W.ref!==void 0&&(re=W.ref,le=M.current),W.key!==void 0&&(J=""+W.key),I.type&&I.type.defaultProps)var de=I.type.defaultProps;for(te in W)T.call(W,te)&&!L.hasOwnProperty(te)&&(U[te]=W[te]===void 0&&de!==void 0?de[te]:W[te])}var te=arguments.length-2;if(te===1)U.children=X;else if(1<te){de=Array(te);for(var ce=0;ce<te;ce++)de[ce]=arguments[ce+2];U.children=de}return{$$typeof:e,type:I.type,key:J,ref:re,props:U,_owner:le}},Le.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:l,_context:I},I.Consumer=I},Le.createElement=H,Le.createFactory=function(I){var W=H.bind(null,I);return W.type=I,W},Le.createRef=function(){return{current:null}},Le.forwardRef=function(I){return{$$typeof:c,render:I}},Le.isValidElement=P,Le.lazy=function(I){return{$$typeof:f,_payload:{_status:-1,_result:I},_init:z}},Le.memo=function(I,W){return{$$typeof:h,type:I,compare:W===void 0?null:W}},Le.startTransition=function(I){var W=Z.transition;Z.transition={};try{I()}finally{Z.transition=W}},Le.unstable_act=K,Le.useCallback=function(I,W){return ne.current.useCallback(I,W)},Le.useContext=function(I){return ne.current.useContext(I)},Le.useDebugValue=function(){},Le.useDeferredValue=function(I){return ne.current.useDeferredValue(I)},Le.useEffect=function(I,W){return ne.current.useEffect(I,W)},Le.useId=function(){return ne.current.useId()},Le.useImperativeHandle=function(I,W,X){return ne.current.useImperativeHandle(I,W,X)},Le.useInsertionEffect=function(I,W){return ne.current.useInsertionEffect(I,W)},Le.useLayoutEffect=function(I,W){return ne.current.useLayoutEffect(I,W)},Le.useMemo=function(I,W){return ne.current.useMemo(I,W)},Le.useReducer=function(I,W,X){return ne.current.useReducer(I,W,X)},Le.useRef=function(I){return ne.current.useRef(I)},Le.useState=function(I){return ne.current.useState(I)},Le.useSyncExternalStore=function(I,W,X){return ne.current.useSyncExternalStore(I,W,X)},Le.useTransition=function(){return ne.current.useTransition()},Le.version="18.3.1",Le}var ww;function va(){return ww||(ww=1,ud.exports=Ij()),ud.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var xw;function Mj(){if(xw)return Ko;xw=1;var e=va(),n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(c,p,h){var f,g={},y=null,x=null;h!==void 0&&(y=""+h),p.key!==void 0&&(y=""+p.key),p.ref!==void 0&&(x=p.ref);for(f in p)s.call(p,f)&&!l.hasOwnProperty(f)&&(g[f]=p[f]);if(c&&c.defaultProps)for(f in p=c.defaultProps,p)g[f]===void 0&&(g[f]=p[f]);return{$$typeof:n,type:c,key:y,ref:x,props:g,_owner:o.current}}return Ko.Fragment=r,Ko.jsx=u,Ko.jsxs=u,Ko}var _w;function Pj(){return _w||(_w=1,ld.exports=Mj()),ld.exports}var m=Pj(),Ml={},cd={exports:{}},an={},dd={exports:{}},fd={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var bw;function Oj(){return bw||(bw=1,(function(e){function n(Z,$){var K=Z.length;Z.push($);e:for(;0<K;){var I=K-1>>>1,W=Z[I];if(0<o(W,$))Z[I]=$,Z[K]=W,K=I;else break e}}function r(Z){return Z.length===0?null:Z[0]}function s(Z){if(Z.length===0)return null;var $=Z[0],K=Z.pop();if(K!==$){Z[0]=K;e:for(var I=0,W=Z.length,X=W>>>1;I<X;){var U=2*(I+1)-1,J=Z[U],re=U+1,le=Z[re];if(0>o(J,K))re<W&&0>o(le,J)?(Z[I]=le,Z[re]=K,I=re):(Z[I]=J,Z[U]=K,I=U);else if(re<W&&0>o(le,K))Z[I]=le,Z[re]=K,I=re;else break e}}return $}function o(Z,$){var K=Z.sortIndex-$.sortIndex;return K!==0?K:Z.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var p=[],h=[],f=1,g=null,y=3,x=!1,N=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(Z){for(var $=r(h);$!==null;){if($.callback===null)s(h);else if($.startTime<=Z)s(h),$.sortIndex=$.expirationTime,n(p,$);else break;$=r(h)}}function C(Z){if(_=!1,E(Z),!N)if(r(p)!==null)N=!0,z(T);else{var $=r(h);$!==null&&ne(C,$.startTime-Z)}}function T(Z,$){N=!1,_&&(_=!1,b(H),H=-1),x=!0;var K=y;try{for(E($),g=r(p);g!==null&&(!(g.expirationTime>$)||Z&&!F());){var I=g.callback;if(typeof I=="function"){g.callback=null,y=g.priorityLevel;var W=I(g.expirationTime<=$);$=e.unstable_now(),typeof W=="function"?g.callback=W:g===r(p)&&s(p),E($)}else s(p);g=r(p)}if(g!==null)var X=!0;else{var U=r(h);U!==null&&ne(C,U.startTime-$),X=!1}return X}finally{g=null,y=K,x=!1}}var M=!1,L=null,H=-1,O=5,P=-1;function F(){return!(e.unstable_now()-P<O)}function G(){if(L!==null){var Z=e.unstable_now();P=Z;var $=!0;try{$=L(!0,Z)}finally{$?q():(M=!1,L=null)}}else M=!1}var q;if(typeof k=="function")q=function(){k(G)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,Q=j.port2;j.port1.onmessage=G,q=function(){Q.postMessage(null)}}else q=function(){S(G,0)};function z(Z){L=Z,M||(M=!0,q())}function ne(Z,$){H=S(function(){Z(e.unstable_now())},$)}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(Z){Z.callback=null},e.unstable_continueExecution=function(){N||x||(N=!0,z(T))},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return r(p)},e.unstable_next=function(Z){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var K=y;y=$;try{return Z()}finally{y=K}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Z,$){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var K=y;y=Z;try{return $()}finally{y=K}},e.unstable_scheduleCallback=function(Z,$,K){var I=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?I+K:I):K=I,Z){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=K+W,Z={id:f++,callback:$,priorityLevel:Z,startTime:K,expirationTime:W,sortIndex:-1},K>I?(Z.sortIndex=K,n(h,Z),r(p)===null&&Z===r(h)&&(_?(b(H),H=-1):_=!0,ne(C,K-I))):(Z.sortIndex=W,n(p,Z),N||x||(N=!0,z(T))),Z},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(Z){var $=y;return function(){var K=y;y=$;try{return Z.apply(this,arguments)}finally{y=K}}}})(fd)),fd}var Sw;function Lj(){return Sw||(Sw=1,dd.exports=Oj()),dd.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var kw;function qj(){if(kw)return an;kw=1;var e=va(),n=Lj();function r(t){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+t,a=1;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function l(t,i){u(t,i),u(t+"Capture",i)}function u(t,i){for(o[t]=i,t=0;t<i.length;t++)s.add(i[t])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,h=/^[: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]*$/,f={},g={};function y(t){return p.call(g,t)?!0:p.call(f,t)?!1:h.test(t)?g[t]=!0:(f[t]=!0,!1)}function x(t,i,a,d){if(a!==null&&a.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:a!==null?!a.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function N(t,i,a,d){if(i===null||typeof i>"u"||x(t,i,a,d))return!0;if(d)return!1;if(a!==null)switch(a.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function _(t,i,a,d,v,w,R){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=v,this.mustUseProperty=a,this.propertyName=t,this.type=i,this.sanitizeURL=w,this.removeEmptyString=R}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){S[t]=new _(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var i=t[0];S[i]=new _(i,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){S[t]=new _(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){S[t]=new _(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){S[t]=new _(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){S[t]=new _(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){S[t]=new _(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){S[t]=new _(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){S[t]=new _(t,5,!1,t.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function k(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var i=t.replace(b,k);S[i]=new _(i,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var i=t.replace(b,k);S[i]=new _(i,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var i=t.replace(b,k);S[i]=new _(i,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){S[t]=new _(t,1,!1,t.toLowerCase(),null,!1,!1)}),S.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){S[t]=new _(t,1,!1,t.toLowerCase(),null,!0,!0)});function E(t,i,a,d){var v=S.hasOwnProperty(i)?S[i]:null;(v!==null?v.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(N(i,a,v,d)&&(a=null),d||v===null?y(i)&&(a===null?t.removeAttribute(i):t.setAttribute(i,""+a)):v.mustUseProperty?t[v.propertyName]=a===null?v.type===3?!1:"":a:(i=v.attributeName,d=v.attributeNamespace,a===null?t.removeAttribute(i):(v=v.type,a=v===3||v===4&&a===!0?"":""+a,d?t.setAttributeNS(d,i,a):t.setAttribute(i,a))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),M=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),F=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),Z=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=Z&&t[Z]||t["@@iterator"],typeof t=="function"?t:null)}var K=Object.assign,I;function W(t){if(I===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);I=i&&i[1]||""}return`
|
|
34
|
+
`+I+t}var X=!1;function U(t,i){if(!t||X)return"";X=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(oe){var d=oe}Reflect.construct(t,[],i)}else{try{i.call()}catch(oe){d=oe}t.call(i.prototype)}else{try{throw Error()}catch(oe){d=oe}t()}}catch(oe){if(oe&&d&&typeof oe.stack=="string"){for(var v=oe.stack.split(`
|
|
35
|
+
`),w=d.stack.split(`
|
|
36
|
+
`),R=v.length-1,D=w.length-1;1<=R&&0<=D&&v[R]!==w[D];)D--;for(;1<=R&&0<=D;R--,D--)if(v[R]!==w[D]){if(R!==1||D!==1)do if(R--,D--,0>D||v[R]!==w[D]){var Y=`
|
|
37
|
+
`+v[R].replace(" at new "," at ");return t.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",t.displayName)),Y}while(1<=R&&0<=D);break}}}finally{X=!1,Error.prepareStackTrace=a}return(t=t?t.displayName||t.name:"")?W(t):""}function J(t){switch(t.tag){case 5:return W(t.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return t=U(t.type,!1),t;case 11:return t=U(t.type.render,!1),t;case 1:return t=U(t.type,!0),t;default:return""}}function re(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case L:return"Fragment";case M:return"Portal";case O:return"Profiler";case H:return"StrictMode";case q:return"Suspense";case j:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case F:return(t.displayName||"Context")+".Consumer";case P:return(t._context.displayName||"Context")+".Provider";case G:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return i=t.displayName||null,i!==null?i:re(t.type)||"Memo";case z:i=t._payload,t=t._init;try{return re(t(i))}catch{}}return null}function le(t){var i=t.type;switch(t.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=i.render,t=t.displayName||t.name||"",i.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(i);case 8:return i===H?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function de(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function te(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ce(t){var i=te(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,i),d=""+t[i];if(!t.hasOwnProperty(i)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var v=a.get,w=a.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return v.call(this)},set:function(R){d=""+R,w.call(this,R)}}),Object.defineProperty(t,i,{enumerable:a.enumerable}),{getValue:function(){return d},setValue:function(R){d=""+R},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Ce(t){t._valueTracker||(t._valueTracker=ce(t))}function ve(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),d="";return t&&(d=te(t)?t.checked?"true":"false":t.value),t=d,t!==a?(i.setValue(t),!0):!1}function Te(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ye(t,i){var a=i.checked;return K({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??t._wrapperState.initialChecked})}function ke(t,i){var a=i.defaultValue==null?"":i.defaultValue,d=i.checked!=null?i.checked:i.defaultChecked;a=de(i.value!=null?i.value:a),t._wrapperState={initialChecked:d,initialValue:a,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function Ge(t,i){i=i.checked,i!=null&&E(t,"checked",i,!1)}function we(t,i){Ge(t,i);var a=de(i.value),d=i.type;if(a!=null)d==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+a):t.value!==""+a&&(t.value=""+a);else if(d==="submit"||d==="reset"){t.removeAttribute("value");return}i.hasOwnProperty("value")?Be(t,i.type,a):i.hasOwnProperty("defaultValue")&&Be(t,i.type,de(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(t.defaultChecked=!!i.defaultChecked)}function _e(t,i,a){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var d=i.type;if(!(d!=="submit"&&d!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+t._wrapperState.initialValue,a||i===t.value||(t.value=i),t.defaultValue=i}a=t.name,a!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,a!==""&&(t.name=a)}function Be(t,i,a){(i!=="number"||Te(t.ownerDocument)!==t)&&(a==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+a&&(t.defaultValue=""+a))}var Ye=Array.isArray;function ot(t,i,a,d){if(t=t.options,i){i={};for(var v=0;v<a.length;v++)i["$"+a[v]]=!0;for(a=0;a<t.length;a++)v=i.hasOwnProperty("$"+t[a].value),t[a].selected!==v&&(t[a].selected=v),v&&d&&(t[a].defaultSelected=!0)}else{for(a=""+de(a),i=null,v=0;v<t.length;v++){if(t[v].value===a){t[v].selected=!0,d&&(t[v].defaultSelected=!0);return}i!==null||t[v].disabled||(i=t[v])}i!==null&&(i.selected=!0)}}function tt(t,i){if(i.dangerouslySetInnerHTML!=null)throw Error(r(91));return K({},i,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Fe(t,i){var a=i.value;if(a==null){if(a=i.children,i=i.defaultValue,a!=null){if(i!=null)throw Error(r(92));if(Ye(a)){if(1<a.length)throw Error(r(93));a=a[0]}i=a}i==null&&(i=""),a=i}t._wrapperState={initialValue:de(a)}}function Qe(t,i){var a=de(i.value),d=de(i.defaultValue);a!=null&&(a=""+a,a!==t.value&&(t.value=a),i.defaultValue==null&&t.defaultValue!==a&&(t.defaultValue=a)),d!=null&&(t.defaultValue=""+d)}function ft(t){var i=t.textContent;i===t._wrapperState.initialValue&&i!==""&&i!==null&&(t.value=i)}function St(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function nt(t,i){return t==null||t==="http://www.w3.org/1999/xhtml"?St(i):t==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var vt,Kt=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,a,d,v){MSApp.execUnsafeLocalFunction(function(){return t(i,a,d,v)})}:t})(function(t,i){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=i;else{for(vt=vt||document.createElement("div"),vt.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=vt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;i.firstChild;)t.appendChild(i.firstChild)}});function Ot(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var Je={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},kt=["Webkit","ms","Moz","O"];Object.keys(Je).forEach(function(t){kt.forEach(function(i){i=i+t.charAt(0).toUpperCase()+t.substring(1),Je[i]=Je[t]})});function rt(t,i,a){return i==null||typeof i=="boolean"||i===""?"":a||typeof i!="number"||i===0||Je.hasOwnProperty(t)&&Je[t]?(""+i).trim():i+"px"}function yt(t,i){t=t.style;for(var a in i)if(i.hasOwnProperty(a)){var d=a.indexOf("--")===0,v=rt(a,i[a],d);a==="float"&&(a="cssFloat"),d?t.setProperty(a,v):t[a]=v}}var vn=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Tt(t,i){if(i){if(vn[t]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(r(137,t));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(r(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(r(61))}if(i.style!=null&&typeof i.style!="object")throw Error(r(62))}}function At(t,i){if(t.indexOf("-")===-1)return typeof i.is=="string";switch(t){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 $n=null;function Dn(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ze=null,yn=null,Xt=null;function wn(t){if(t=Po(t)){if(typeof Ze!="function")throw Error(r(280));var i=t.stateNode;i&&(i=Ga(i),Ze(t.stateNode,t.type,i))}}function fs(t){yn?Xt?Xt.push(t):Xt=[t]:yn=t}function xn(){if(yn){var t=yn,i=Xt;if(Xt=yn=null,wn(t),i)for(t=0;t<i.length;t++)wn(i[t])}}function _r(t,i){return t(i)}function hs(){}var xi=!1;function _i(t,i,a){if(xi)return t(i,a);xi=!0;try{return _r(t,i,a)}finally{xi=!1,(yn!==null||Xt!==null)&&(hs(),xn())}}function or(t,i){var a=t.stateNode;if(a===null)return null;var d=Ga(a);if(d===null)return null;a=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(t=t.type,d=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!d;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(r(231,i,typeof a));return a}var _n=!1;if(c)try{var ar={};Object.defineProperty(ar,"passive",{get:function(){_n=!0}}),window.addEventListener("test",ar,ar),window.removeEventListener("test",ar,ar)}catch{_n=!1}function ps(t,i,a,d,v,w,R,D,Y){var oe=Array.prototype.slice.call(arguments,3);try{i.apply(a,oe)}catch(pe){this.onError(pe)}}var bn=!1,br=null,lr=!1,Et=null,Br={onError:function(t){bn=!0,br=t}};function Ur(t,i,a,d,v,w,R,D,Y){bn=!1,br=null,ps.apply(Br,arguments)}function Qt(t,i,a,d,v,w,R,D,Y){if(Ur.apply(this,arguments),bn){if(bn){var oe=br;bn=!1,br=null}else throw Error(r(198));lr||(lr=!0,Et=oe)}}function dn(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function bi(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function ms(t){if(dn(t)!==t)throw Error(r(188))}function Sr(t){var i=t.alternate;if(!i){if(i=dn(t),i===null)throw Error(r(188));return i!==t?null:t}for(var a=t,d=i;;){var v=a.return;if(v===null)break;var w=v.alternate;if(w===null){if(d=v.return,d!==null){a=d;continue}break}if(v.child===w.child){for(w=v.child;w;){if(w===a)return ms(v),t;if(w===d)return ms(v),i;w=w.sibling}throw Error(r(188))}if(a.return!==d.return)a=v,d=w;else{for(var R=!1,D=v.child;D;){if(D===a){R=!0,a=v,d=w;break}if(D===d){R=!0,d=v,a=w;break}D=D.sibling}if(!R){for(D=w.child;D;){if(D===a){R=!0,a=w,d=v;break}if(D===d){R=!0,d=w,a=v;break}D=D.sibling}if(!R)throw Error(r(189))}}if(a.alternate!==d)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?t:i}function Si(t){return t=Sr(t),t!==null?ki(t):null}function ki(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var i=ki(t);if(i!==null)return i;t=t.sibling}return null}var gs=n.unstable_scheduleCallback,Hr=n.unstable_cancelCallback,Ei=n.unstable_shouldYield,Ni=n.unstable_requestPaint,We=n.unstable_now,go=n.unstable_getCurrentPriorityLevel,zt=n.unstable_ImmediatePriority,Wr=n.unstable_UserBlockingPriority,ur=n.unstable_NormalPriority,Ci=n.unstable_LowPriority,kr=n.unstable_IdlePriority,cr=null,wt=null;function Vr(t){if(wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(cr,t,void 0,(t.current.flags&128)===128)}catch{}}var en=Math.clz32?Math.clz32:vo,Ca=Math.log,Fu=Math.LN2;function vo(t){return t>>>=0,t===0?32:31-(Ca(t)/Fu|0)|0}var Fn=64,Ri=4194304;function ji(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ti(t,i){var a=t.pendingLanes;if(a===0)return 0;var d=0,v=t.suspendedLanes,w=t.pingedLanes,R=a&268435455;if(R!==0){var D=R&~v;D!==0?d=ji(D):(w&=R,w!==0&&(d=ji(w)))}else R=a&~v,R!==0?d=ji(R):w!==0&&(d=ji(w));if(d===0)return 0;if(i!==0&&i!==d&&(i&v)===0&&(v=d&-d,w=i&-i,v>=w||v===16&&(w&4194240)!==0))return i;if((d&4)!==0&&(d|=a&16),i=t.entangledLanes,i!==0)for(t=t.entanglements,i&=d;0<i;)a=31-en(i),v=1<<a,d|=t[a],i&=~v;return d}function Ra(t,i){switch(t){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zu(t,i){for(var a=t.suspendedLanes,d=t.pingedLanes,v=t.expirationTimes,w=t.pendingLanes;0<w;){var R=31-en(w),D=1<<R,Y=v[R];Y===-1?((D&a)===0||(D&d)!==0)&&(v[R]=Ra(D,i)):Y<=i&&(t.expiredLanes|=D),w&=~D}}function Bt(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function ja(){var t=Fn;return Fn<<=1,(Fn&4194240)===0&&(Fn=64),t}function Ai(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function Sn(t,i,a){t.pendingLanes|=i,i!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,i=31-en(i),t[i]=a}function Ii(t,i){var a=t.pendingLanes&~i;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=i,t.mutableReadLanes&=i,t.entangledLanes&=i,i=t.entanglements;var d=t.eventTimes;for(t=t.expirationTimes;0<a;){var v=31-en(a),w=1<<v;i[v]=0,d[v]=-1,t[v]=-1,a&=~w}}function Mi(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var d=31-en(a),v=1<<d;v&i|t[d]&i&&(t[d]|=i),a&=~v}}var $e=0;function yo(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Pi,vs,Ta,wo,Aa,xo=!1,Gr=[],Lt=null,kn=null,zn=null,Oi=new Map,Li=new Map,Bn=[],Ia="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Un(t,i){switch(t){case"focusin":case"focusout":Lt=null;break;case"dragenter":case"dragleave":kn=null;break;case"mouseover":case"mouseout":zn=null;break;case"pointerover":case"pointerout":Oi.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Li.delete(i.pointerId)}}function qi(t,i,a,d,v,w){return t===null||t.nativeEvent!==w?(t={blockedOn:i,domEventName:a,eventSystemFlags:d,nativeEvent:w,targetContainers:[v]},i!==null&&(i=Po(i),i!==null&&vs(i)),t):(t.eventSystemFlags|=d,i=t.targetContainers,v!==null&&i.indexOf(v)===-1&&i.push(v),t)}function Ma(t,i,a,d,v){switch(i){case"focusin":return Lt=qi(Lt,t,i,a,d,v),!0;case"dragenter":return kn=qi(kn,t,i,a,d,v),!0;case"mouseover":return zn=qi(zn,t,i,a,d,v),!0;case"pointerover":var w=v.pointerId;return Oi.set(w,qi(Oi.get(w)||null,t,i,a,d,v)),!0;case"gotpointercapture":return w=v.pointerId,Li.set(w,qi(Li.get(w)||null,t,i,a,d,v)),!0}return!1}function Pa(t){var i=zi(t.target);if(i!==null){var a=dn(i);if(a!==null){if(i=a.tag,i===13){if(i=bi(a),i!==null){t.blockedOn=i,Aa(t.priority,function(){Ta(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function dr(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=Di(t.domEventName,t.eventSystemFlags,i[0],t.nativeEvent);if(a===null){a=t.nativeEvent;var d=new a.constructor(a.type,a);$n=d,a.target.dispatchEvent(d),$n=null}else return i=Po(a),i!==null&&vs(i),t.blockedOn=a,!1;i.shift()}return!0}function fr(t,i,a){dr(t)&&a.delete(i)}function ys(){xo=!1,Lt!==null&&dr(Lt)&&(Lt=null),kn!==null&&dr(kn)&&(kn=null),zn!==null&&dr(zn)&&(zn=null),Oi.forEach(fr),Li.forEach(fr)}function Hn(t,i){t.blockedOn===i&&(t.blockedOn=null,xo||(xo=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,ys)))}function $i(t){function i(v){return Hn(v,t)}if(0<Gr.length){Hn(Gr[0],t);for(var a=1;a<Gr.length;a++){var d=Gr[a];d.blockedOn===t&&(d.blockedOn=null)}}for(Lt!==null&&Hn(Lt,t),kn!==null&&Hn(kn,t),zn!==null&&Hn(zn,t),Oi.forEach(i),Li.forEach(i),a=0;a<Bn.length;a++)d=Bn[a],d.blockedOn===t&&(d.blockedOn=null);for(;0<Bn.length&&(a=Bn[0],a.blockedOn===null);)Pa(a),a.blockedOn===null&&Bn.shift()}var mt=C.ReactCurrentBatchConfig,Yr=!0;function Oa(t,i,a,d){var v=$e,w=mt.transition;mt.transition=null;try{$e=1,ws(t,i,a,d)}finally{$e=v,mt.transition=w}}function La(t,i,a,d){var v=$e,w=mt.transition;mt.transition=null;try{$e=4,ws(t,i,a,d)}finally{$e=v,mt.transition=w}}function ws(t,i,a,d){if(Yr){var v=Di(t,i,a,d);if(v===null)Zu(t,i,d,Er,a),Un(t,d);else if(Ma(v,t,i,a,d))d.stopPropagation();else if(Un(t,d),i&4&&-1<Ia.indexOf(t)){for(;v!==null;){var w=Po(v);if(w!==null&&Pi(w),w=Di(t,i,a,d),w===null&&Zu(t,i,d,Er,a),w===v)break;v=w}v!==null&&d.stopPropagation()}else Zu(t,i,d,null,a)}}var Er=null;function Di(t,i,a,d){if(Er=null,t=Dn(d),t=zi(t),t!==null)if(i=dn(t),i===null)t=null;else if(a=i.tag,a===13){if(t=bi(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null);return Er=t,null}function _o(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(go()){case zt:return 1;case Wr:return 4;case ur:case Ci:return 16;case kr:return 536870912;default:return 16}default:return 16}}var En=null,xs=null,Kr=null;function bo(){if(Kr)return Kr;var t,i=xs,a=i.length,d,v="value"in En?En.value:En.textContent,w=v.length;for(t=0;t<a&&i[t]===v[t];t++);var R=a-t;for(d=1;d<=R&&i[a-d]===v[w-d];d++);return Kr=v.slice(t,1<d?1-d:void 0)}function hr(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function _s(){return!0}function Wn(){return!1}function Ut(t){function i(a,d,v,w,R){this._reactName=a,this._targetInst=v,this.type=d,this.nativeEvent=w,this.target=R,this.currentTarget=null;for(var D in t)t.hasOwnProperty(D)&&(a=t[D],this[D]=a?a(w):w[D]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?_s:Wn,this.isPropagationStopped=Wn,this}return K(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=_s)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=_s)},persist:function(){},isPersistent:_s}),i}var Nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ht=Ut(Nr),Xr=K({},Nr,{view:0,detail:0}),qa=Ut(Xr),bs,Ss,B,V=K({},Xr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zr,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==B&&(B&&t.type==="mousemove"?(bs=t.screenX-B.screenX,Ss=t.screenY-B.screenY):Ss=bs=0,B=t),bs)},movementY:function(t){return"movementY"in t?t.movementY:Ss}}),ae=Ut(V),fe=K({},V,{dataTransfer:0}),xe=Ut(fe),Ne=K({},Xr,{relatedTarget:0}),Ie=Ut(Ne),De=K({},Nr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ve=Ut(De),Xe=K({},Nr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),at=Ut(Xe),Nn=K({},Nr,{data:0}),Qr=Ut(Nn),So={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fi={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"},ko={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $a(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=ko[t])?!!i[t]:!1}function Zr(){return $a}var Vn=K({},Xr,{key:function(t){if(t.key){var i=So[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=hr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Fi[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zr,charCode:function(t){return t.type==="keypress"?hr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?hr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),xt=Ut(Vn),Da=K({},V,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uy=Ut(Da),_R=K({},Xr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zr}),bR=Ut(_R),SR=K({},Nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),kR=Ut(SR),ER=K({},V,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),NR=Ut(ER),CR=[9,13,27,32],Bu=c&&"CompositionEvent"in window,Eo=null;c&&"documentMode"in document&&(Eo=document.documentMode);var RR=c&&"TextEvent"in window&&!Eo,cy=c&&(!Bu||Eo&&8<Eo&&11>=Eo),dy=" ",fy=!1;function hy(t,i){switch(t){case"keyup":return CR.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function py(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ks=!1;function jR(t,i){switch(t){case"compositionend":return py(i);case"keypress":return i.which!==32?null:(fy=!0,dy);case"textInput":return t=i.data,t===dy&&fy?null:t;default:return null}}function TR(t,i){if(ks)return t==="compositionend"||!Bu&&hy(t,i)?(t=bo(),Kr=xs=En=null,ks=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return cy&&i.locale!=="ko"?null:i.data;default:return null}}var AR={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 my(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!AR[t.type]:i==="textarea"}function gy(t,i,a,d){fs(d),i=Ha(i,"onChange"),0<i.length&&(a=new Ht("onChange","change",null,a,d),t.push({event:a,listeners:i}))}var No=null,Co=null;function IR(t){Py(t,0)}function Fa(t){var i=js(t);if(ve(i))return t}function MR(t,i){if(t==="change")return i}var vy=!1;if(c){var Uu;if(c){var Hu="oninput"in document;if(!Hu){var yy=document.createElement("div");yy.setAttribute("oninput","return;"),Hu=typeof yy.oninput=="function"}Uu=Hu}else Uu=!1;vy=Uu&&(!document.documentMode||9<document.documentMode)}function wy(){No&&(No.detachEvent("onpropertychange",xy),Co=No=null)}function xy(t){if(t.propertyName==="value"&&Fa(Co)){var i=[];gy(i,Co,t,Dn(t)),_i(IR,i)}}function PR(t,i,a){t==="focusin"?(wy(),No=i,Co=a,No.attachEvent("onpropertychange",xy)):t==="focusout"&&wy()}function OR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Fa(Co)}function LR(t,i){if(t==="click")return Fa(i)}function qR(t,i){if(t==="input"||t==="change")return Fa(i)}function $R(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Gn=typeof Object.is=="function"?Object.is:$R;function Ro(t,i){if(Gn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),d=Object.keys(i);if(a.length!==d.length)return!1;for(d=0;d<a.length;d++){var v=a[d];if(!p.call(i,v)||!Gn(t[v],i[v]))return!1}return!0}function _y(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function by(t,i){var a=_y(t);t=0;for(var d;a;){if(a.nodeType===3){if(d=t+a.textContent.length,t<=i&&d>=i)return{node:a,offset:i-t};t=d}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=_y(a)}}function Sy(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Sy(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function ky(){for(var t=window,i=Te();i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=Te(t.document)}return i}function Wu(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}function DR(t){var i=ky(),a=t.focusedElem,d=t.selectionRange;if(i!==a&&a&&a.ownerDocument&&Sy(a.ownerDocument.documentElement,a)){if(d!==null&&Wu(a)){if(i=d.start,t=d.end,t===void 0&&(t=i),"selectionStart"in a)a.selectionStart=i,a.selectionEnd=Math.min(t,a.value.length);else if(t=(i=a.ownerDocument||document)&&i.defaultView||window,t.getSelection){t=t.getSelection();var v=a.textContent.length,w=Math.min(d.start,v);d=d.end===void 0?w:Math.min(d.end,v),!t.extend&&w>d&&(v=d,d=w,w=v),v=by(a,w);var R=by(a,d);v&&R&&(t.rangeCount!==1||t.anchorNode!==v.node||t.anchorOffset!==v.offset||t.focusNode!==R.node||t.focusOffset!==R.offset)&&(i=i.createRange(),i.setStart(v.node,v.offset),t.removeAllRanges(),w>d?(t.addRange(i),t.extend(R.node,R.offset)):(i.setEnd(R.node,R.offset),t.addRange(i)))}}for(i=[],t=a;t=t.parentNode;)t.nodeType===1&&i.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<i.length;a++)t=i[a],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var FR=c&&"documentMode"in document&&11>=document.documentMode,Es=null,Vu=null,jo=null,Gu=!1;function Ey(t,i,a){var d=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Gu||Es==null||Es!==Te(d)||(d=Es,"selectionStart"in d&&Wu(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),jo&&Ro(jo,d)||(jo=d,d=Ha(Vu,"onSelect"),0<d.length&&(i=new Ht("onSelect","select",null,i,a),t.push({event:i,listeners:d}),i.target=Es)))}function za(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var Ns={animationend:za("Animation","AnimationEnd"),animationiteration:za("Animation","AnimationIteration"),animationstart:za("Animation","AnimationStart"),transitionend:za("Transition","TransitionEnd")},Yu={},Ny={};c&&(Ny=document.createElement("div").style,"AnimationEvent"in window||(delete Ns.animationend.animation,delete Ns.animationiteration.animation,delete Ns.animationstart.animation),"TransitionEvent"in window||delete Ns.transitionend.transition);function Ba(t){if(Yu[t])return Yu[t];if(!Ns[t])return t;var i=Ns[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in Ny)return Yu[t]=i[a];return t}var Cy=Ba("animationend"),Ry=Ba("animationiteration"),jy=Ba("animationstart"),Ty=Ba("transitionend"),Ay=new Map,Iy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Jr(t,i){Ay.set(t,i),l(i,[t])}for(var Ku=0;Ku<Iy.length;Ku++){var Xu=Iy[Ku],zR=Xu.toLowerCase(),BR=Xu[0].toUpperCase()+Xu.slice(1);Jr(zR,"on"+BR)}Jr(Cy,"onAnimationEnd"),Jr(Ry,"onAnimationIteration"),Jr(jy,"onAnimationStart"),Jr("dblclick","onDoubleClick"),Jr("focusin","onFocus"),Jr("focusout","onBlur"),Jr(Ty,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),UR=new Set("cancel close invalid load scroll toggle".split(" ").concat(To));function My(t,i,a){var d=t.type||"unknown-event";t.currentTarget=a,Qt(d,i,void 0,t),t.currentTarget=null}function Py(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var d=t[a],v=d.event;d=d.listeners;e:{var w=void 0;if(i)for(var R=d.length-1;0<=R;R--){var D=d[R],Y=D.instance,oe=D.currentTarget;if(D=D.listener,Y!==w&&v.isPropagationStopped())break e;My(v,D,oe),w=Y}else for(R=0;R<d.length;R++){if(D=d[R],Y=D.instance,oe=D.currentTarget,D=D.listener,Y!==w&&v.isPropagationStopped())break e;My(v,D,oe),w=Y}}}if(lr)throw t=Et,lr=!1,Et=null,t}function it(t,i){var a=i[ic];a===void 0&&(a=i[ic]=new Set);var d=t+"__bubble";a.has(d)||(Oy(i,t,2,!1),a.add(d))}function Qu(t,i,a){var d=0;i&&(d|=4),Oy(a,t,d,i)}var Ua="_reactListening"+Math.random().toString(36).slice(2);function Ao(t){if(!t[Ua]){t[Ua]=!0,s.forEach(function(a){a!=="selectionchange"&&(UR.has(a)||Qu(a,!1,t),Qu(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Ua]||(i[Ua]=!0,Qu("selectionchange",!1,i))}}function Oy(t,i,a,d){switch(_o(i)){case 1:var v=Oa;break;case 4:v=La;break;default:v=ws}a=v.bind(null,i,a,t),v=void 0,!_n||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(v=!0),d?v!==void 0?t.addEventListener(i,a,{capture:!0,passive:v}):t.addEventListener(i,a,!0):v!==void 0?t.addEventListener(i,a,{passive:v}):t.addEventListener(i,a,!1)}function Zu(t,i,a,d,v){var w=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var R=d.tag;if(R===3||R===4){var D=d.stateNode.containerInfo;if(D===v||D.nodeType===8&&D.parentNode===v)break;if(R===4)for(R=d.return;R!==null;){var Y=R.tag;if((Y===3||Y===4)&&(Y=R.stateNode.containerInfo,Y===v||Y.nodeType===8&&Y.parentNode===v))return;R=R.return}for(;D!==null;){if(R=zi(D),R===null)return;if(Y=R.tag,Y===5||Y===6){d=w=R;continue e}D=D.parentNode}}d=d.return}_i(function(){var oe=w,pe=Dn(a),me=[];e:{var he=Ay.get(t);if(he!==void 0){var be=Ht,Ee=t;switch(t){case"keypress":if(hr(a)===0)break e;case"keydown":case"keyup":be=xt;break;case"focusin":Ee="focus",be=Ie;break;case"focusout":Ee="blur",be=Ie;break;case"beforeblur":case"afterblur":be=Ie;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=ae;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=xe;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=bR;break;case Cy:case Ry:case jy:be=Ve;break;case Ty:be=kR;break;case"scroll":be=qa;break;case"wheel":be=NR;break;case"copy":case"cut":case"paste":be=at;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=uy}var Re=(i&4)!==0,gt=!Re&&t==="scroll",ie=Re?he!==null?he+"Capture":null:he;Re=[];for(var ee=oe,se;ee!==null;){se=ee;var ge=se.stateNode;if(se.tag===5&&ge!==null&&(se=ge,ie!==null&&(ge=or(ee,ie),ge!=null&&Re.push(Io(ee,ge,se)))),gt)break;ee=ee.return}0<Re.length&&(he=new be(he,Ee,null,a,pe),me.push({event:he,listeners:Re}))}}if((i&7)===0){e:{if(he=t==="mouseover"||t==="pointerover",be=t==="mouseout"||t==="pointerout",he&&a!==$n&&(Ee=a.relatedTarget||a.fromElement)&&(zi(Ee)||Ee[Cr]))break e;if((be||he)&&(he=pe.window===pe?pe:(he=pe.ownerDocument)?he.defaultView||he.parentWindow:window,be?(Ee=a.relatedTarget||a.toElement,be=oe,Ee=Ee?zi(Ee):null,Ee!==null&&(gt=dn(Ee),Ee!==gt||Ee.tag!==5&&Ee.tag!==6)&&(Ee=null)):(be=null,Ee=oe),be!==Ee)){if(Re=ae,ge="onMouseLeave",ie="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(Re=uy,ge="onPointerLeave",ie="onPointerEnter",ee="pointer"),gt=be==null?he:js(be),se=Ee==null?he:js(Ee),he=new Re(ge,ee+"leave",be,a,pe),he.target=gt,he.relatedTarget=se,ge=null,zi(pe)===oe&&(Re=new Re(ie,ee+"enter",Ee,a,pe),Re.target=se,Re.relatedTarget=gt,ge=Re),gt=ge,be&&Ee)t:{for(Re=be,ie=Ee,ee=0,se=Re;se;se=Cs(se))ee++;for(se=0,ge=ie;ge;ge=Cs(ge))se++;for(;0<ee-se;)Re=Cs(Re),ee--;for(;0<se-ee;)ie=Cs(ie),se--;for(;ee--;){if(Re===ie||ie!==null&&Re===ie.alternate)break t;Re=Cs(Re),ie=Cs(ie)}Re=null}else Re=null;be!==null&&Ly(me,he,be,Re,!1),Ee!==null&>!==null&&Ly(me,gt,Ee,Re,!0)}}e:{if(he=oe?js(oe):window,be=he.nodeName&&he.nodeName.toLowerCase(),be==="select"||be==="input"&&he.type==="file")var je=MR;else if(my(he))if(vy)je=qR;else{je=OR;var Me=PR}else(be=he.nodeName)&&be.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(je=LR);if(je&&(je=je(t,oe))){gy(me,je,a,pe);break e}Me&&Me(t,he,oe),t==="focusout"&&(Me=he._wrapperState)&&Me.controlled&&he.type==="number"&&Be(he,"number",he.value)}switch(Me=oe?js(oe):window,t){case"focusin":(my(Me)||Me.contentEditable==="true")&&(Es=Me,Vu=oe,jo=null);break;case"focusout":jo=Vu=Es=null;break;case"mousedown":Gu=!0;break;case"contextmenu":case"mouseup":case"dragend":Gu=!1,Ey(me,a,pe);break;case"selectionchange":if(FR)break;case"keydown":case"keyup":Ey(me,a,pe)}var Pe;if(Bu)e:{switch(t){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else ks?hy(t,a)&&(Oe="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Oe="onCompositionStart");Oe&&(cy&&a.locale!=="ko"&&(ks||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&ks&&(Pe=bo()):(En=pe,xs="value"in En?En.value:En.textContent,ks=!0)),Me=Ha(oe,Oe),0<Me.length&&(Oe=new Qr(Oe,t,null,a,pe),me.push({event:Oe,listeners:Me}),Pe?Oe.data=Pe:(Pe=py(a),Pe!==null&&(Oe.data=Pe)))),(Pe=RR?jR(t,a):TR(t,a))&&(oe=Ha(oe,"onBeforeInput"),0<oe.length&&(pe=new Qr("onBeforeInput","beforeinput",null,a,pe),me.push({event:pe,listeners:oe}),pe.data=Pe))}Py(me,i)})}function Io(t,i,a){return{instance:t,listener:i,currentTarget:a}}function Ha(t,i){for(var a=i+"Capture",d=[];t!==null;){var v=t,w=v.stateNode;v.tag===5&&w!==null&&(v=w,w=or(t,a),w!=null&&d.unshift(Io(t,w,v)),w=or(t,i),w!=null&&d.push(Io(t,w,v))),t=t.return}return d}function Cs(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Ly(t,i,a,d,v){for(var w=i._reactName,R=[];a!==null&&a!==d;){var D=a,Y=D.alternate,oe=D.stateNode;if(Y!==null&&Y===d)break;D.tag===5&&oe!==null&&(D=oe,v?(Y=or(a,w),Y!=null&&R.unshift(Io(a,Y,D))):v||(Y=or(a,w),Y!=null&&R.push(Io(a,Y,D)))),a=a.return}R.length!==0&&t.push({event:i,listeners:R})}var HR=/\r\n?/g,WR=/\u0000|\uFFFD/g;function qy(t){return(typeof t=="string"?t:""+t).replace(HR,`
|
|
38
|
+
`).replace(WR,"")}function Wa(t,i,a){if(i=qy(i),qy(t)!==i&&a)throw Error(r(425))}function Va(){}var Ju=null,ec=null;function tc(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var nc=typeof setTimeout=="function"?setTimeout:void 0,VR=typeof clearTimeout=="function"?clearTimeout:void 0,$y=typeof Promise=="function"?Promise:void 0,GR=typeof queueMicrotask=="function"?queueMicrotask:typeof $y<"u"?function(t){return $y.resolve(null).then(t).catch(YR)}:nc;function YR(t){setTimeout(function(){throw t})}function rc(t,i){var a=i,d=0;do{var v=a.nextSibling;if(t.removeChild(a),v&&v.nodeType===8)if(a=v.data,a==="/$"){if(d===0){t.removeChild(v),$i(i);return}d--}else a!=="$"&&a!=="$?"&&a!=="$!"||d++;a=v}while(a);$i(i)}function ei(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return t}function Dy(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"){if(i===0)return t;i--}else a==="/$"&&i++}t=t.previousSibling}return null}var Rs=Math.random().toString(36).slice(2),pr="__reactFiber$"+Rs,Mo="__reactProps$"+Rs,Cr="__reactContainer$"+Rs,ic="__reactEvents$"+Rs,KR="__reactListeners$"+Rs,XR="__reactHandles$"+Rs;function zi(t){var i=t[pr];if(i)return i;for(var a=t.parentNode;a;){if(i=a[Cr]||a[pr]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=Dy(t);t!==null;){if(a=t[pr])return a;t=Dy(t)}return i}t=a,a=t.parentNode}return null}function Po(t){return t=t[pr]||t[Cr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function js(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(r(33))}function Ga(t){return t[Mo]||null}var sc=[],Ts=-1;function ti(t){return{current:t}}function st(t){0>Ts||(t.current=sc[Ts],sc[Ts]=null,Ts--)}function et(t,i){Ts++,sc[Ts]=t.current,t.current=i}var ni={},Wt=ti(ni),tn=ti(!1),Bi=ni;function As(t,i){var a=t.type.contextTypes;if(!a)return ni;var d=t.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===i)return d.__reactInternalMemoizedMaskedChildContext;var v={},w;for(w in a)v[w]=i[w];return d&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=v),v}function nn(t){return t=t.childContextTypes,t!=null}function Ya(){st(tn),st(Wt)}function Fy(t,i,a){if(Wt.current!==ni)throw Error(r(168));et(Wt,i),et(tn,a)}function zy(t,i,a){var d=t.stateNode;if(i=i.childContextTypes,typeof d.getChildContext!="function")return a;d=d.getChildContext();for(var v in d)if(!(v in i))throw Error(r(108,le(t)||"Unknown",v));return K({},a,d)}function Ka(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ni,Bi=Wt.current,et(Wt,t),et(tn,tn.current),!0}function By(t,i,a){var d=t.stateNode;if(!d)throw Error(r(169));a?(t=zy(t,i,Bi),d.__reactInternalMemoizedMergedChildContext=t,st(tn),st(Wt),et(Wt,t)):st(tn),et(tn,a)}var Rr=null,Xa=!1,oc=!1;function Uy(t){Rr===null?Rr=[t]:Rr.push(t)}function QR(t){Xa=!0,Uy(t)}function ri(){if(!oc&&Rr!==null){oc=!0;var t=0,i=$e;try{var a=Rr;for($e=1;t<a.length;t++){var d=a[t];do d=d(!0);while(d!==null)}Rr=null,Xa=!1}catch(v){throw Rr!==null&&(Rr=Rr.slice(t+1)),gs(zt,ri),v}finally{$e=i,oc=!1}}return null}var Is=[],Ms=0,Qa=null,Za=0,Cn=[],Rn=0,Ui=null,jr=1,Tr="";function Hi(t,i){Is[Ms++]=Za,Is[Ms++]=Qa,Qa=t,Za=i}function Hy(t,i,a){Cn[Rn++]=jr,Cn[Rn++]=Tr,Cn[Rn++]=Ui,Ui=t;var d=jr;t=Tr;var v=32-en(d)-1;d&=~(1<<v),a+=1;var w=32-en(i)+v;if(30<w){var R=v-v%5;w=(d&(1<<R)-1).toString(32),d>>=R,v-=R,jr=1<<32-en(i)+v|a<<v|d,Tr=w+t}else jr=1<<w|a<<v|d,Tr=t}function ac(t){t.return!==null&&(Hi(t,1),Hy(t,1,0))}function lc(t){for(;t===Qa;)Qa=Is[--Ms],Is[Ms]=null,Za=Is[--Ms],Is[Ms]=null;for(;t===Ui;)Ui=Cn[--Rn],Cn[Rn]=null,Tr=Cn[--Rn],Cn[Rn]=null,jr=Cn[--Rn],Cn[Rn]=null}var fn=null,hn=null,lt=!1,Yn=null;function Wy(t,i){var a=In(5,null,null,0);a.elementType="DELETED",a.stateNode=i,a.return=t,i=t.deletions,i===null?(t.deletions=[a],t.flags|=16):i.push(a)}function Vy(t,i){switch(t.tag){case 5:var a=t.type;return i=i.nodeType!==1||a.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(t.stateNode=i,fn=t,hn=ei(i.firstChild),!0):!1;case 6:return i=t.pendingProps===""||i.nodeType!==3?null:i,i!==null?(t.stateNode=i,fn=t,hn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(a=Ui!==null?{id:jr,overflow:Tr}:null,t.memoizedState={dehydrated:i,treeContext:a,retryLane:1073741824},a=In(18,null,null,0),a.stateNode=i,a.return=t,t.child=a,fn=t,hn=null,!0):!1;default:return!1}}function uc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function cc(t){if(lt){var i=hn;if(i){var a=i;if(!Vy(t,i)){if(uc(t))throw Error(r(418));i=ei(a.nextSibling);var d=fn;i&&Vy(t,i)?Wy(d,a):(t.flags=t.flags&-4097|2,lt=!1,fn=t)}}else{if(uc(t))throw Error(r(418));t.flags=t.flags&-4097|2,lt=!1,fn=t}}}function Gy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;fn=t}function Ja(t){if(t!==fn)return!1;if(!lt)return Gy(t),lt=!0,!1;var i;if((i=t.tag!==3)&&!(i=t.tag!==5)&&(i=t.type,i=i!=="head"&&i!=="body"&&!tc(t.type,t.memoizedProps)),i&&(i=hn)){if(uc(t))throw Yy(),Error(r(418));for(;i;)Wy(t,i),i=ei(i.nextSibling)}if(Gy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));e:{for(t=t.nextSibling,i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"){if(i===0){hn=ei(t.nextSibling);break e}i--}else a!=="$"&&a!=="$!"&&a!=="$?"||i++}t=t.nextSibling}hn=null}}else hn=fn?ei(t.stateNode.nextSibling):null;return!0}function Yy(){for(var t=hn;t;)t=ei(t.nextSibling)}function Ps(){hn=fn=null,lt=!1}function dc(t){Yn===null?Yn=[t]:Yn.push(t)}var ZR=C.ReactCurrentBatchConfig;function Oo(t,i,a){if(t=a.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(r(309));var d=a.stateNode}if(!d)throw Error(r(147,t));var v=d,w=""+t;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===w?i.ref:(i=function(R){var D=v.refs;R===null?delete D[w]:D[w]=R},i._stringRef=w,i)}if(typeof t!="string")throw Error(r(284));if(!a._owner)throw Error(r(290,t))}return t}function el(t,i){throw t=Object.prototype.toString.call(i),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t))}function Ky(t){var i=t._init;return i(t._payload)}function Xy(t){function i(ie,ee){if(t){var se=ie.deletions;se===null?(ie.deletions=[ee],ie.flags|=16):se.push(ee)}}function a(ie,ee){if(!t)return null;for(;ee!==null;)i(ie,ee),ee=ee.sibling;return null}function d(ie,ee){for(ie=new Map;ee!==null;)ee.key!==null?ie.set(ee.key,ee):ie.set(ee.index,ee),ee=ee.sibling;return ie}function v(ie,ee){return ie=di(ie,ee),ie.index=0,ie.sibling=null,ie}function w(ie,ee,se){return ie.index=se,t?(se=ie.alternate,se!==null?(se=se.index,se<ee?(ie.flags|=2,ee):se):(ie.flags|=2,ee)):(ie.flags|=1048576,ee)}function R(ie){return t&&ie.alternate===null&&(ie.flags|=2),ie}function D(ie,ee,se,ge){return ee===null||ee.tag!==6?(ee=nd(se,ie.mode,ge),ee.return=ie,ee):(ee=v(ee,se),ee.return=ie,ee)}function Y(ie,ee,se,ge){var je=se.type;return je===L?pe(ie,ee,se.props.children,ge,se.key):ee!==null&&(ee.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===z&&Ky(je)===ee.type)?(ge=v(ee,se.props),ge.ref=Oo(ie,ee,se),ge.return=ie,ge):(ge=kl(se.type,se.key,se.props,null,ie.mode,ge),ge.ref=Oo(ie,ee,se),ge.return=ie,ge)}function oe(ie,ee,se,ge){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==se.containerInfo||ee.stateNode.implementation!==se.implementation?(ee=rd(se,ie.mode,ge),ee.return=ie,ee):(ee=v(ee,se.children||[]),ee.return=ie,ee)}function pe(ie,ee,se,ge,je){return ee===null||ee.tag!==7?(ee=Zi(se,ie.mode,ge,je),ee.return=ie,ee):(ee=v(ee,se),ee.return=ie,ee)}function me(ie,ee,se){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=nd(""+ee,ie.mode,se),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case T:return se=kl(ee.type,ee.key,ee.props,null,ie.mode,se),se.ref=Oo(ie,null,ee),se.return=ie,se;case M:return ee=rd(ee,ie.mode,se),ee.return=ie,ee;case z:var ge=ee._init;return me(ie,ge(ee._payload),se)}if(Ye(ee)||$(ee))return ee=Zi(ee,ie.mode,se,null),ee.return=ie,ee;el(ie,ee)}return null}function he(ie,ee,se,ge){var je=ee!==null?ee.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return je!==null?null:D(ie,ee,""+se,ge);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case T:return se.key===je?Y(ie,ee,se,ge):null;case M:return se.key===je?oe(ie,ee,se,ge):null;case z:return je=se._init,he(ie,ee,je(se._payload),ge)}if(Ye(se)||$(se))return je!==null?null:pe(ie,ee,se,ge,null);el(ie,se)}return null}function be(ie,ee,se,ge,je){if(typeof ge=="string"&&ge!==""||typeof ge=="number")return ie=ie.get(se)||null,D(ee,ie,""+ge,je);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case T:return ie=ie.get(ge.key===null?se:ge.key)||null,Y(ee,ie,ge,je);case M:return ie=ie.get(ge.key===null?se:ge.key)||null,oe(ee,ie,ge,je);case z:var Me=ge._init;return be(ie,ee,se,Me(ge._payload),je)}if(Ye(ge)||$(ge))return ie=ie.get(se)||null,pe(ee,ie,ge,je,null);el(ee,ge)}return null}function Ee(ie,ee,se,ge){for(var je=null,Me=null,Pe=ee,Oe=ee=0,Pt=null;Pe!==null&&Oe<se.length;Oe++){Pe.index>Oe?(Pt=Pe,Pe=null):Pt=Pe.sibling;var He=he(ie,Pe,se[Oe],ge);if(He===null){Pe===null&&(Pe=Pt);break}t&&Pe&&He.alternate===null&&i(ie,Pe),ee=w(He,ee,Oe),Me===null?je=He:Me.sibling=He,Me=He,Pe=Pt}if(Oe===se.length)return a(ie,Pe),lt&&Hi(ie,Oe),je;if(Pe===null){for(;Oe<se.length;Oe++)Pe=me(ie,se[Oe],ge),Pe!==null&&(ee=w(Pe,ee,Oe),Me===null?je=Pe:Me.sibling=Pe,Me=Pe);return lt&&Hi(ie,Oe),je}for(Pe=d(ie,Pe);Oe<se.length;Oe++)Pt=be(Pe,ie,Oe,se[Oe],ge),Pt!==null&&(t&&Pt.alternate!==null&&Pe.delete(Pt.key===null?Oe:Pt.key),ee=w(Pt,ee,Oe),Me===null?je=Pt:Me.sibling=Pt,Me=Pt);return t&&Pe.forEach(function(fi){return i(ie,fi)}),lt&&Hi(ie,Oe),je}function Re(ie,ee,se,ge){var je=$(se);if(typeof je!="function")throw Error(r(150));if(se=je.call(se),se==null)throw Error(r(151));for(var Me=je=null,Pe=ee,Oe=ee=0,Pt=null,He=se.next();Pe!==null&&!He.done;Oe++,He=se.next()){Pe.index>Oe?(Pt=Pe,Pe=null):Pt=Pe.sibling;var fi=he(ie,Pe,He.value,ge);if(fi===null){Pe===null&&(Pe=Pt);break}t&&Pe&&fi.alternate===null&&i(ie,Pe),ee=w(fi,ee,Oe),Me===null?je=fi:Me.sibling=fi,Me=fi,Pe=Pt}if(He.done)return a(ie,Pe),lt&&Hi(ie,Oe),je;if(Pe===null){for(;!He.done;Oe++,He=se.next())He=me(ie,He.value,ge),He!==null&&(ee=w(He,ee,Oe),Me===null?je=He:Me.sibling=He,Me=He);return lt&&Hi(ie,Oe),je}for(Pe=d(ie,Pe);!He.done;Oe++,He=se.next())He=be(Pe,ie,Oe,He.value,ge),He!==null&&(t&&He.alternate!==null&&Pe.delete(He.key===null?Oe:He.key),ee=w(He,ee,Oe),Me===null?je=He:Me.sibling=He,Me=He);return t&&Pe.forEach(function(Aj){return i(ie,Aj)}),lt&&Hi(ie,Oe),je}function gt(ie,ee,se,ge){if(typeof se=="object"&&se!==null&&se.type===L&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case T:e:{for(var je=se.key,Me=ee;Me!==null;){if(Me.key===je){if(je=se.type,je===L){if(Me.tag===7){a(ie,Me.sibling),ee=v(Me,se.props.children),ee.return=ie,ie=ee;break e}}else if(Me.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===z&&Ky(je)===Me.type){a(ie,Me.sibling),ee=v(Me,se.props),ee.ref=Oo(ie,Me,se),ee.return=ie,ie=ee;break e}a(ie,Me);break}else i(ie,Me);Me=Me.sibling}se.type===L?(ee=Zi(se.props.children,ie.mode,ge,se.key),ee.return=ie,ie=ee):(ge=kl(se.type,se.key,se.props,null,ie.mode,ge),ge.ref=Oo(ie,ee,se),ge.return=ie,ie=ge)}return R(ie);case M:e:{for(Me=se.key;ee!==null;){if(ee.key===Me)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){a(ie,ee.sibling),ee=v(ee,se.children||[]),ee.return=ie,ie=ee;break e}else{a(ie,ee);break}else i(ie,ee);ee=ee.sibling}ee=rd(se,ie.mode,ge),ee.return=ie,ie=ee}return R(ie);case z:return Me=se._init,gt(ie,ee,Me(se._payload),ge)}if(Ye(se))return Ee(ie,ee,se,ge);if($(se))return Re(ie,ee,se,ge);el(ie,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,ee!==null&&ee.tag===6?(a(ie,ee.sibling),ee=v(ee,se),ee.return=ie,ie=ee):(a(ie,ee),ee=nd(se,ie.mode,ge),ee.return=ie,ie=ee),R(ie)):a(ie,ee)}return gt}var Os=Xy(!0),Qy=Xy(!1),tl=ti(null),nl=null,Ls=null,fc=null;function hc(){fc=Ls=nl=null}function pc(t){var i=tl.current;st(tl),t._currentValue=i}function mc(t,i,a){for(;t!==null;){var d=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),t===a)break;t=t.return}}function qs(t,i){nl=t,fc=Ls=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&i)!==0&&(rn=!0),t.firstContext=null)}function jn(t){var i=t._currentValue;if(fc!==t)if(t={context:t,memoizedValue:i,next:null},Ls===null){if(nl===null)throw Error(r(308));Ls=t,nl.dependencies={lanes:0,firstContext:t}}else Ls=Ls.next=t;return i}var Wi=null;function gc(t){Wi===null?Wi=[t]:Wi.push(t)}function Zy(t,i,a,d){var v=i.interleaved;return v===null?(a.next=a,gc(i)):(a.next=v.next,v.next=a),i.interleaved=a,Ar(t,d)}function Ar(t,i){t.lanes|=i;var a=t.alternate;for(a!==null&&(a.lanes|=i),a=t,t=t.return;t!==null;)t.childLanes|=i,a=t.alternate,a!==null&&(a.childLanes|=i),a=t,t=t.return;return a.tag===3?a.stateNode:null}var ii=!1;function vc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jy(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ir(t,i){return{eventTime:t,lane:i,tag:0,payload:null,callback:null,next:null}}function si(t,i,a){var d=t.updateQueue;if(d===null)return null;if(d=d.shared,(Ue&2)!==0){var v=d.pending;return v===null?i.next=i:(i.next=v.next,v.next=i),d.pending=i,Ar(t,a)}return v=d.interleaved,v===null?(i.next=i,gc(d)):(i.next=v.next,v.next=i),d.interleaved=i,Ar(t,a)}function rl(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194240)!==0)){var d=i.lanes;d&=t.pendingLanes,a|=d,i.lanes=a,Mi(t,a)}}function e0(t,i){var a=t.updateQueue,d=t.alternate;if(d!==null&&(d=d.updateQueue,a===d)){var v=null,w=null;if(a=a.firstBaseUpdate,a!==null){do{var R={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};w===null?v=w=R:w=w.next=R,a=a.next}while(a!==null);w===null?v=w=i:w=w.next=i}else v=w=i;a={baseState:d.baseState,firstBaseUpdate:v,lastBaseUpdate:w,shared:d.shared,effects:d.effects},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}function il(t,i,a,d){var v=t.updateQueue;ii=!1;var w=v.firstBaseUpdate,R=v.lastBaseUpdate,D=v.shared.pending;if(D!==null){v.shared.pending=null;var Y=D,oe=Y.next;Y.next=null,R===null?w=oe:R.next=oe,R=Y;var pe=t.alternate;pe!==null&&(pe=pe.updateQueue,D=pe.lastBaseUpdate,D!==R&&(D===null?pe.firstBaseUpdate=oe:D.next=oe,pe.lastBaseUpdate=Y))}if(w!==null){var me=v.baseState;R=0,pe=oe=Y=null,D=w;do{var he=D.lane,be=D.eventTime;if((d&he)===he){pe!==null&&(pe=pe.next={eventTime:be,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Ee=t,Re=D;switch(he=i,be=a,Re.tag){case 1:if(Ee=Re.payload,typeof Ee=="function"){me=Ee.call(be,me,he);break e}me=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Re.payload,he=typeof Ee=="function"?Ee.call(be,me,he):Ee,he==null)break e;me=K({},me,he);break e;case 2:ii=!0}}D.callback!==null&&D.lane!==0&&(t.flags|=64,he=v.effects,he===null?v.effects=[D]:he.push(D))}else be={eventTime:be,lane:he,tag:D.tag,payload:D.payload,callback:D.callback,next:null},pe===null?(oe=pe=be,Y=me):pe=pe.next=be,R|=he;if(D=D.next,D===null){if(D=v.shared.pending,D===null)break;he=D,D=he.next,he.next=null,v.lastBaseUpdate=he,v.shared.pending=null}}while(!0);if(pe===null&&(Y=me),v.baseState=Y,v.firstBaseUpdate=oe,v.lastBaseUpdate=pe,i=v.shared.interleaved,i!==null){v=i;do R|=v.lane,v=v.next;while(v!==i)}else w===null&&(v.shared.lanes=0);Yi|=R,t.lanes=R,t.memoizedState=me}}function t0(t,i,a){if(t=i.effects,i.effects=null,t!==null)for(i=0;i<t.length;i++){var d=t[i],v=d.callback;if(v!==null){if(d.callback=null,d=a,typeof v!="function")throw Error(r(191,v));v.call(d)}}}var Lo={},mr=ti(Lo),qo=ti(Lo),$o=ti(Lo);function Vi(t){if(t===Lo)throw Error(r(174));return t}function yc(t,i){switch(et($o,i),et(qo,t),et(mr,Lo),t=i.nodeType,t){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:nt(null,"");break;default:t=t===8?i.parentNode:i,i=t.namespaceURI||null,t=t.tagName,i=nt(i,t)}st(mr),et(mr,i)}function $s(){st(mr),st(qo),st($o)}function n0(t){Vi($o.current);var i=Vi(mr.current),a=nt(i,t.type);i!==a&&(et(qo,t),et(mr,a))}function wc(t){qo.current===t&&(st(mr),st(qo))}var ct=ti(0);function sl(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var xc=[];function _c(){for(var t=0;t<xc.length;t++)xc[t]._workInProgressVersionPrimary=null;xc.length=0}var ol=C.ReactCurrentDispatcher,bc=C.ReactCurrentBatchConfig,Gi=0,dt=null,Nt=null,It=null,al=!1,Do=!1,Fo=0,JR=0;function Vt(){throw Error(r(321))}function Sc(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!Gn(t[a],i[a]))return!1;return!0}function kc(t,i,a,d,v,w){if(Gi=w,dt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,ol.current=t===null||t.memoizedState===null?rj:ij,t=a(d,v),Do){w=0;do{if(Do=!1,Fo=0,25<=w)throw Error(r(301));w+=1,It=Nt=null,i.updateQueue=null,ol.current=sj,t=a(d,v)}while(Do)}if(ol.current=cl,i=Nt!==null&&Nt.next!==null,Gi=0,It=Nt=dt=null,al=!1,i)throw Error(r(300));return t}function Ec(){var t=Fo!==0;return Fo=0,t}function gr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?dt.memoizedState=It=t:It=It.next=t,It}function Tn(){if(Nt===null){var t=dt.alternate;t=t!==null?t.memoizedState:null}else t=Nt.next;var i=It===null?dt.memoizedState:It.next;if(i!==null)It=i,Nt=t;else{if(t===null)throw Error(r(310));Nt=t,t={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},It===null?dt.memoizedState=It=t:It=It.next=t}return It}function zo(t,i){return typeof i=="function"?i(t):i}function Nc(t){var i=Tn(),a=i.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=t;var d=Nt,v=d.baseQueue,w=a.pending;if(w!==null){if(v!==null){var R=v.next;v.next=w.next,w.next=R}d.baseQueue=v=w,a.pending=null}if(v!==null){w=v.next,d=d.baseState;var D=R=null,Y=null,oe=w;do{var pe=oe.lane;if((Gi&pe)===pe)Y!==null&&(Y=Y.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),d=oe.hasEagerState?oe.eagerState:t(d,oe.action);else{var me={lane:pe,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};Y===null?(D=Y=me,R=d):Y=Y.next=me,dt.lanes|=pe,Yi|=pe}oe=oe.next}while(oe!==null&&oe!==w);Y===null?R=d:Y.next=D,Gn(d,i.memoizedState)||(rn=!0),i.memoizedState=d,i.baseState=R,i.baseQueue=Y,a.lastRenderedState=d}if(t=a.interleaved,t!==null){v=t;do w=v.lane,dt.lanes|=w,Yi|=w,v=v.next;while(v!==t)}else v===null&&(a.lanes=0);return[i.memoizedState,a.dispatch]}function Cc(t){var i=Tn(),a=i.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=t;var d=a.dispatch,v=a.pending,w=i.memoizedState;if(v!==null){a.pending=null;var R=v=v.next;do w=t(w,R.action),R=R.next;while(R!==v);Gn(w,i.memoizedState)||(rn=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),a.lastRenderedState=w}return[w,d]}function r0(){}function i0(t,i){var a=dt,d=Tn(),v=i(),w=!Gn(d.memoizedState,v);if(w&&(d.memoizedState=v,rn=!0),d=d.queue,Rc(a0.bind(null,a,d,t),[t]),d.getSnapshot!==i||w||It!==null&&It.memoizedState.tag&1){if(a.flags|=2048,Bo(9,o0.bind(null,a,d,v,i),void 0,null),Mt===null)throw Error(r(349));(Gi&30)!==0||s0(a,i,v)}return v}function s0(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=dt.updateQueue,i===null?(i={lastEffect:null,stores:null},dt.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function o0(t,i,a,d){i.value=a,i.getSnapshot=d,l0(i)&&u0(t)}function a0(t,i,a){return a(function(){l0(i)&&u0(t)})}function l0(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!Gn(t,a)}catch{return!0}}function u0(t){var i=Ar(t,1);i!==null&&Zn(i,t,1,-1)}function c0(t){var i=gr();return typeof t=="function"&&(t=t()),i.memoizedState=i.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:t},i.queue=t,t=t.dispatch=nj.bind(null,dt,t),[i.memoizedState,t]}function Bo(t,i,a,d){return t={tag:t,create:i,destroy:a,deps:d,next:null},i=dt.updateQueue,i===null?(i={lastEffect:null,stores:null},dt.updateQueue=i,i.lastEffect=t.next=t):(a=i.lastEffect,a===null?i.lastEffect=t.next=t:(d=a.next,a.next=t,t.next=d,i.lastEffect=t)),t}function d0(){return Tn().memoizedState}function ll(t,i,a,d){var v=gr();dt.flags|=t,v.memoizedState=Bo(1|i,a,void 0,d===void 0?null:d)}function ul(t,i,a,d){var v=Tn();d=d===void 0?null:d;var w=void 0;if(Nt!==null){var R=Nt.memoizedState;if(w=R.destroy,d!==null&&Sc(d,R.deps)){v.memoizedState=Bo(i,a,w,d);return}}dt.flags|=t,v.memoizedState=Bo(1|i,a,w,d)}function f0(t,i){return ll(8390656,8,t,i)}function Rc(t,i){return ul(2048,8,t,i)}function h0(t,i){return ul(4,2,t,i)}function p0(t,i){return ul(4,4,t,i)}function m0(t,i){if(typeof i=="function")return t=t(),i(t),function(){i(null)};if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function g0(t,i,a){return a=a!=null?a.concat([t]):null,ul(4,4,m0.bind(null,i,t),a)}function jc(){}function v0(t,i){var a=Tn();i=i===void 0?null:i;var d=a.memoizedState;return d!==null&&i!==null&&Sc(i,d[1])?d[0]:(a.memoizedState=[t,i],t)}function y0(t,i){var a=Tn();i=i===void 0?null:i;var d=a.memoizedState;return d!==null&&i!==null&&Sc(i,d[1])?d[0]:(t=t(),a.memoizedState=[t,i],t)}function w0(t,i,a){return(Gi&21)===0?(t.baseState&&(t.baseState=!1,rn=!0),t.memoizedState=a):(Gn(a,i)||(a=ja(),dt.lanes|=a,Yi|=a,t.baseState=!0),i)}function ej(t,i){var a=$e;$e=a!==0&&4>a?a:4,t(!0);var d=bc.transition;bc.transition={};try{t(!1),i()}finally{$e=a,bc.transition=d}}function x0(){return Tn().memoizedState}function tj(t,i,a){var d=ui(t);if(a={lane:d,action:a,hasEagerState:!1,eagerState:null,next:null},_0(t))b0(i,a);else if(a=Zy(t,i,a,d),a!==null){var v=Jt();Zn(a,t,d,v),S0(a,i,d)}}function nj(t,i,a){var d=ui(t),v={lane:d,action:a,hasEagerState:!1,eagerState:null,next:null};if(_0(t))b0(i,v);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var R=i.lastRenderedState,D=w(R,a);if(v.hasEagerState=!0,v.eagerState=D,Gn(D,R)){var Y=i.interleaved;Y===null?(v.next=v,gc(i)):(v.next=Y.next,Y.next=v),i.interleaved=v;return}}catch{}finally{}a=Zy(t,i,v,d),a!==null&&(v=Jt(),Zn(a,t,d,v),S0(a,i,d))}}function _0(t){var i=t.alternate;return t===dt||i!==null&&i===dt}function b0(t,i){Do=al=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function S0(t,i,a){if((a&4194240)!==0){var d=i.lanes;d&=t.pendingLanes,a|=d,i.lanes=a,Mi(t,a)}}var cl={readContext:jn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},rj={readContext:jn,useCallback:function(t,i){return gr().memoizedState=[t,i===void 0?null:i],t},useContext:jn,useEffect:f0,useImperativeHandle:function(t,i,a){return a=a!=null?a.concat([t]):null,ll(4194308,4,m0.bind(null,i,t),a)},useLayoutEffect:function(t,i){return ll(4194308,4,t,i)},useInsertionEffect:function(t,i){return ll(4,2,t,i)},useMemo:function(t,i){var a=gr();return i=i===void 0?null:i,t=t(),a.memoizedState=[t,i],t},useReducer:function(t,i,a){var d=gr();return i=a!==void 0?a(i):i,d.memoizedState=d.baseState=i,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},d.queue=t,t=t.dispatch=tj.bind(null,dt,t),[d.memoizedState,t]},useRef:function(t){var i=gr();return t={current:t},i.memoizedState=t},useState:c0,useDebugValue:jc,useDeferredValue:function(t){return gr().memoizedState=t},useTransition:function(){var t=c0(!1),i=t[0];return t=ej.bind(null,t[1]),gr().memoizedState=t,[i,t]},useMutableSource:function(){},useSyncExternalStore:function(t,i,a){var d=dt,v=gr();if(lt){if(a===void 0)throw Error(r(407));a=a()}else{if(a=i(),Mt===null)throw Error(r(349));(Gi&30)!==0||s0(d,i,a)}v.memoizedState=a;var w={value:a,getSnapshot:i};return v.queue=w,f0(a0.bind(null,d,w,t),[t]),d.flags|=2048,Bo(9,o0.bind(null,d,w,a,i),void 0,null),a},useId:function(){var t=gr(),i=Mt.identifierPrefix;if(lt){var a=Tr,d=jr;a=(d&~(1<<32-en(d)-1)).toString(32)+a,i=":"+i+"R"+a,a=Fo++,0<a&&(i+="H"+a.toString(32)),i+=":"}else a=JR++,i=":"+i+"r"+a.toString(32)+":";return t.memoizedState=i},unstable_isNewReconciler:!1},ij={readContext:jn,useCallback:v0,useContext:jn,useEffect:Rc,useImperativeHandle:g0,useInsertionEffect:h0,useLayoutEffect:p0,useMemo:y0,useReducer:Nc,useRef:d0,useState:function(){return Nc(zo)},useDebugValue:jc,useDeferredValue:function(t){var i=Tn();return w0(i,Nt.memoizedState,t)},useTransition:function(){var t=Nc(zo)[0],i=Tn().memoizedState;return[t,i]},useMutableSource:r0,useSyncExternalStore:i0,useId:x0,unstable_isNewReconciler:!1},sj={readContext:jn,useCallback:v0,useContext:jn,useEffect:Rc,useImperativeHandle:g0,useInsertionEffect:h0,useLayoutEffect:p0,useMemo:y0,useReducer:Cc,useRef:d0,useState:function(){return Cc(zo)},useDebugValue:jc,useDeferredValue:function(t){var i=Tn();return Nt===null?i.memoizedState=t:w0(i,Nt.memoizedState,t)},useTransition:function(){var t=Cc(zo)[0],i=Tn().memoizedState;return[t,i]},useMutableSource:r0,useSyncExternalStore:i0,useId:x0,unstable_isNewReconciler:!1};function Kn(t,i){if(t&&t.defaultProps){i=K({},i),t=t.defaultProps;for(var a in t)i[a]===void 0&&(i[a]=t[a]);return i}return i}function Tc(t,i,a,d){i=t.memoizedState,a=a(d,i),a=a==null?i:K({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var dl={isMounted:function(t){return(t=t._reactInternals)?dn(t)===t:!1},enqueueSetState:function(t,i,a){t=t._reactInternals;var d=Jt(),v=ui(t),w=Ir(d,v);w.payload=i,a!=null&&(w.callback=a),i=si(t,w,v),i!==null&&(Zn(i,t,v,d),rl(i,t,v))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var d=Jt(),v=ui(t),w=Ir(d,v);w.tag=1,w.payload=i,a!=null&&(w.callback=a),i=si(t,w,v),i!==null&&(Zn(i,t,v,d),rl(i,t,v))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=Jt(),d=ui(t),v=Ir(a,d);v.tag=2,i!=null&&(v.callback=i),i=si(t,v,d),i!==null&&(Zn(i,t,d,a),rl(i,t,d))}};function k0(t,i,a,d,v,w,R){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(d,w,R):i.prototype&&i.prototype.isPureReactComponent?!Ro(a,d)||!Ro(v,w):!0}function E0(t,i,a){var d=!1,v=ni,w=i.contextType;return typeof w=="object"&&w!==null?w=jn(w):(v=nn(i)?Bi:Wt.current,d=i.contextTypes,w=(d=d!=null)?As(t,v):ni),i=new i(a,w),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=dl,t.stateNode=i,i._reactInternals=t,d&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=v,t.__reactInternalMemoizedMaskedChildContext=w),i}function N0(t,i,a,d){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,d),i.state!==t&&dl.enqueueReplaceState(i,i.state,null)}function Ac(t,i,a,d){var v=t.stateNode;v.props=a,v.state=t.memoizedState,v.refs={},vc(t);var w=i.contextType;typeof w=="object"&&w!==null?v.context=jn(w):(w=nn(i)?Bi:Wt.current,v.context=As(t,w)),v.state=t.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&(Tc(t,i,w,a),v.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(i=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),i!==v.state&&dl.enqueueReplaceState(v,v.state,null),il(t,a,v,d),v.state=t.memoizedState),typeof v.componentDidMount=="function"&&(t.flags|=4194308)}function Ds(t,i){try{var a="",d=i;do a+=J(d),d=d.return;while(d);var v=a}catch(w){v=`
|
|
39
|
+
Error generating stack: `+w.message+`
|
|
40
|
+
`+w.stack}return{value:t,source:i,stack:v,digest:null}}function Ic(t,i,a){return{value:t,source:null,stack:a??null,digest:i??null}}function Mc(t,i){try{console.error(i.value)}catch(a){setTimeout(function(){throw a})}}var oj=typeof WeakMap=="function"?WeakMap:Map;function C0(t,i,a){a=Ir(-1,a),a.tag=3,a.payload={element:null};var d=i.value;return a.callback=function(){yl||(yl=!0,Yc=d),Mc(t,i)},a}function R0(t,i,a){a=Ir(-1,a),a.tag=3;var d=t.type.getDerivedStateFromError;if(typeof d=="function"){var v=i.value;a.payload=function(){return d(v)},a.callback=function(){Mc(t,i)}}var w=t.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){Mc(t,i),typeof d!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var R=i.stack;this.componentDidCatch(i.value,{componentStack:R!==null?R:""})}),a}function j0(t,i,a){var d=t.pingCache;if(d===null){d=t.pingCache=new oj;var v=new Set;d.set(i,v)}else v=d.get(i),v===void 0&&(v=new Set,d.set(i,v));v.has(a)||(v.add(a),t=xj.bind(null,t,i,a),i.then(t,t))}function T0(t){do{var i;if((i=t.tag===13)&&(i=t.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return t;t=t.return}while(t!==null);return null}function A0(t,i,a,d,v){return(t.mode&1)===0?(t===i?t.flags|=65536:(t.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(i=Ir(-1,1),i.tag=2,si(a,i,1))),a.lanes|=1),t):(t.flags|=65536,t.lanes=v,t)}var aj=C.ReactCurrentOwner,rn=!1;function Zt(t,i,a,d){i.child=t===null?Qy(i,null,a,d):Os(i,t.child,a,d)}function I0(t,i,a,d,v){a=a.render;var w=i.ref;return qs(i,v),d=kc(t,i,a,d,w,v),a=Ec(),t!==null&&!rn?(i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~v,Mr(t,i,v)):(lt&&a&&ac(i),i.flags|=1,Zt(t,i,d,v),i.child)}function M0(t,i,a,d,v){if(t===null){var w=a.type;return typeof w=="function"&&!td(w)&&w.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(i.tag=15,i.type=w,P0(t,i,w,d,v)):(t=kl(a.type,null,d,i,i.mode,v),t.ref=i.ref,t.return=i,i.child=t)}if(w=t.child,(t.lanes&v)===0){var R=w.memoizedProps;if(a=a.compare,a=a!==null?a:Ro,a(R,d)&&t.ref===i.ref)return Mr(t,i,v)}return i.flags|=1,t=di(w,d),t.ref=i.ref,t.return=i,i.child=t}function P0(t,i,a,d,v){if(t!==null){var w=t.memoizedProps;if(Ro(w,d)&&t.ref===i.ref)if(rn=!1,i.pendingProps=d=w,(t.lanes&v)!==0)(t.flags&131072)!==0&&(rn=!0);else return i.lanes=t.lanes,Mr(t,i,v)}return Pc(t,i,a,d,v)}function O0(t,i,a){var d=i.pendingProps,v=d.children,w=t!==null?t.memoizedState:null;if(d.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(zs,pn),pn|=a;else{if((a&1073741824)===0)return t=w!==null?w.baseLanes|a:a,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:t,cachePool:null,transitions:null},i.updateQueue=null,et(zs,pn),pn|=t,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=w!==null?w.baseLanes:a,et(zs,pn),pn|=d}else w!==null?(d=w.baseLanes|a,i.memoizedState=null):d=a,et(zs,pn),pn|=d;return Zt(t,i,v,a),i.child}function L0(t,i){var a=i.ref;(t===null&&a!==null||t!==null&&t.ref!==a)&&(i.flags|=512,i.flags|=2097152)}function Pc(t,i,a,d,v){var w=nn(a)?Bi:Wt.current;return w=As(i,w),qs(i,v),a=kc(t,i,a,d,w,v),d=Ec(),t!==null&&!rn?(i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~v,Mr(t,i,v)):(lt&&d&&ac(i),i.flags|=1,Zt(t,i,a,v),i.child)}function q0(t,i,a,d,v){if(nn(a)){var w=!0;Ka(i)}else w=!1;if(qs(i,v),i.stateNode===null)hl(t,i),E0(i,a,d),Ac(i,a,d,v),d=!0;else if(t===null){var R=i.stateNode,D=i.memoizedProps;R.props=D;var Y=R.context,oe=a.contextType;typeof oe=="object"&&oe!==null?oe=jn(oe):(oe=nn(a)?Bi:Wt.current,oe=As(i,oe));var pe=a.getDerivedStateFromProps,me=typeof pe=="function"||typeof R.getSnapshotBeforeUpdate=="function";me||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(D!==d||Y!==oe)&&N0(i,R,d,oe),ii=!1;var he=i.memoizedState;R.state=he,il(i,d,R,v),Y=i.memoizedState,D!==d||he!==Y||tn.current||ii?(typeof pe=="function"&&(Tc(i,a,pe,d),Y=i.memoizedState),(D=ii||k0(i,a,D,d,he,Y,oe))?(me||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(i.flags|=4194308)):(typeof R.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=Y),R.props=d,R.state=Y,R.context=oe,d=D):(typeof R.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{R=i.stateNode,Jy(t,i),D=i.memoizedProps,oe=i.type===i.elementType?D:Kn(i.type,D),R.props=oe,me=i.pendingProps,he=R.context,Y=a.contextType,typeof Y=="object"&&Y!==null?Y=jn(Y):(Y=nn(a)?Bi:Wt.current,Y=As(i,Y));var be=a.getDerivedStateFromProps;(pe=typeof be=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(D!==me||he!==Y)&&N0(i,R,d,Y),ii=!1,he=i.memoizedState,R.state=he,il(i,d,R,v);var Ee=i.memoizedState;D!==me||he!==Ee||tn.current||ii?(typeof be=="function"&&(Tc(i,a,be,d),Ee=i.memoizedState),(oe=ii||k0(i,a,oe,d,he,Ee,Y)||!1)?(pe||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(d,Ee,Y),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(d,Ee,Y)),typeof R.componentDidUpdate=="function"&&(i.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof R.componentDidUpdate!="function"||D===t.memoizedProps&&he===t.memoizedState||(i.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&he===t.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Ee),R.props=d,R.state=Ee,R.context=Y,d=oe):(typeof R.componentDidUpdate!="function"||D===t.memoizedProps&&he===t.memoizedState||(i.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&he===t.memoizedState||(i.flags|=1024),d=!1)}return Oc(t,i,a,d,w,v)}function Oc(t,i,a,d,v,w){L0(t,i);var R=(i.flags&128)!==0;if(!d&&!R)return v&&By(i,a,!1),Mr(t,i,w);d=i.stateNode,aj.current=i;var D=R&&typeof a.getDerivedStateFromError!="function"?null:d.render();return i.flags|=1,t!==null&&R?(i.child=Os(i,t.child,null,w),i.child=Os(i,null,D,w)):Zt(t,i,D,w),i.memoizedState=d.state,v&&By(i,a,!0),i.child}function $0(t){var i=t.stateNode;i.pendingContext?Fy(t,i.pendingContext,i.pendingContext!==i.context):i.context&&Fy(t,i.context,!1),yc(t,i.containerInfo)}function D0(t,i,a,d,v){return Ps(),dc(v),i.flags|=256,Zt(t,i,a,d),i.child}var Lc={dehydrated:null,treeContext:null,retryLane:0};function qc(t){return{baseLanes:t,cachePool:null,transitions:null}}function F0(t,i,a){var d=i.pendingProps,v=ct.current,w=!1,R=(i.flags&128)!==0,D;if((D=R)||(D=t!==null&&t.memoizedState===null?!1:(v&2)!==0),D?(w=!0,i.flags&=-129):(t===null||t.memoizedState!==null)&&(v|=1),et(ct,v&1),t===null)return cc(i),t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((i.mode&1)===0?i.lanes=1:t.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(R=d.children,t=d.fallback,w?(d=i.mode,w=i.child,R={mode:"hidden",children:R},(d&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=R):w=El(R,d,0,null),t=Zi(t,d,a,null),w.return=i,t.return=i,w.sibling=t,i.child=w,i.child.memoizedState=qc(a),i.memoizedState=Lc,t):$c(i,R));if(v=t.memoizedState,v!==null&&(D=v.dehydrated,D!==null))return lj(t,i,R,d,D,v,a);if(w){w=d.fallback,R=i.mode,v=t.child,D=v.sibling;var Y={mode:"hidden",children:d.children};return(R&1)===0&&i.child!==v?(d=i.child,d.childLanes=0,d.pendingProps=Y,i.deletions=null):(d=di(v,Y),d.subtreeFlags=v.subtreeFlags&14680064),D!==null?w=di(D,w):(w=Zi(w,R,a,null),w.flags|=2),w.return=i,d.return=i,d.sibling=w,i.child=d,d=w,w=i.child,R=t.child.memoizedState,R=R===null?qc(a):{baseLanes:R.baseLanes|a,cachePool:null,transitions:R.transitions},w.memoizedState=R,w.childLanes=t.childLanes&~a,i.memoizedState=Lc,d}return w=t.child,t=w.sibling,d=di(w,{mode:"visible",children:d.children}),(i.mode&1)===0&&(d.lanes=a),d.return=i,d.sibling=null,t!==null&&(a=i.deletions,a===null?(i.deletions=[t],i.flags|=16):a.push(t)),i.child=d,i.memoizedState=null,d}function $c(t,i){return i=El({mode:"visible",children:i},t.mode,0,null),i.return=t,t.child=i}function fl(t,i,a,d){return d!==null&&dc(d),Os(i,t.child,null,a),t=$c(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function lj(t,i,a,d,v,w,R){if(a)return i.flags&256?(i.flags&=-257,d=Ic(Error(r(422))),fl(t,i,R,d)):i.memoizedState!==null?(i.child=t.child,i.flags|=128,null):(w=d.fallback,v=i.mode,d=El({mode:"visible",children:d.children},v,0,null),w=Zi(w,v,R,null),w.flags|=2,d.return=i,w.return=i,d.sibling=w,i.child=d,(i.mode&1)!==0&&Os(i,t.child,null,R),i.child.memoizedState=qc(R),i.memoizedState=Lc,w);if((i.mode&1)===0)return fl(t,i,R,null);if(v.data==="$!"){if(d=v.nextSibling&&v.nextSibling.dataset,d)var D=d.dgst;return d=D,w=Error(r(419)),d=Ic(w,d,void 0),fl(t,i,R,d)}if(D=(R&t.childLanes)!==0,rn||D){if(d=Mt,d!==null){switch(R&-R){case 4:v=2;break;case 16:v=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(d.suspendedLanes|R))!==0?0:v,v!==0&&v!==w.retryLane&&(w.retryLane=v,Ar(t,v),Zn(d,t,v,-1))}return ed(),d=Ic(Error(r(421))),fl(t,i,R,d)}return v.data==="$?"?(i.flags|=128,i.child=t.child,i=_j.bind(null,t),v._reactRetry=i,null):(t=w.treeContext,hn=ei(v.nextSibling),fn=i,lt=!0,Yn=null,t!==null&&(Cn[Rn++]=jr,Cn[Rn++]=Tr,Cn[Rn++]=Ui,jr=t.id,Tr=t.overflow,Ui=i),i=$c(i,d.children),i.flags|=4096,i)}function z0(t,i,a){t.lanes|=i;var d=t.alternate;d!==null&&(d.lanes|=i),mc(t.return,i,a)}function Dc(t,i,a,d,v){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:a,tailMode:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=a,w.tailMode=v)}function B0(t,i,a){var d=i.pendingProps,v=d.revealOrder,w=d.tail;if(Zt(t,i,d.children,a),d=ct.current,(d&2)!==0)d=d&1|2,i.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&z0(t,a,i);else if(t.tag===19)z0(t,a,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}d&=1}if(et(ct,d),(i.mode&1)===0)i.memoizedState=null;else switch(v){case"forwards":for(a=i.child,v=null;a!==null;)t=a.alternate,t!==null&&sl(t)===null&&(v=a),a=a.sibling;a=v,a===null?(v=i.child,i.child=null):(v=a.sibling,a.sibling=null),Dc(i,!1,v,a,w);break;case"backwards":for(a=null,v=i.child,i.child=null;v!==null;){if(t=v.alternate,t!==null&&sl(t)===null){i.child=v;break}t=v.sibling,v.sibling=a,a=v,v=t}Dc(i,!0,a,null,w);break;case"together":Dc(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function hl(t,i){(i.mode&1)===0&&t!==null&&(t.alternate=null,i.alternate=null,i.flags|=2)}function Mr(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),Yi|=i.lanes,(a&i.childLanes)===0)return null;if(t!==null&&i.child!==t.child)throw Error(r(153));if(i.child!==null){for(t=i.child,a=di(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=di(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function uj(t,i,a){switch(i.tag){case 3:$0(i),Ps();break;case 5:n0(i);break;case 1:nn(i.type)&&Ka(i);break;case 4:yc(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,v=i.memoizedProps.value;et(tl,d._currentValue),d._currentValue=v;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(et(ct,ct.current&1),i.flags|=128,null):(a&i.child.childLanes)!==0?F0(t,i,a):(et(ct,ct.current&1),t=Mr(t,i,a),t!==null?t.sibling:null);et(ct,ct.current&1);break;case 19:if(d=(a&i.childLanes)!==0,(t.flags&128)!==0){if(d)return B0(t,i,a);i.flags|=128}if(v=i.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),et(ct,ct.current),d)break;return null;case 22:case 23:return i.lanes=0,O0(t,i,a)}return Mr(t,i,a)}var U0,Fc,H0,W0;U0=function(t,i){for(var a=i.child;a!==null;){if(a.tag===5||a.tag===6)t.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},Fc=function(){},H0=function(t,i,a,d){var v=t.memoizedProps;if(v!==d){t=i.stateNode,Vi(mr.current);var w=null;switch(a){case"input":v=ye(t,v),d=ye(t,d),w=[];break;case"select":v=K({},v,{value:void 0}),d=K({},d,{value:void 0}),w=[];break;case"textarea":v=tt(t,v),d=tt(t,d),w=[];break;default:typeof v.onClick!="function"&&typeof d.onClick=="function"&&(t.onclick=Va)}Tt(a,d);var R;a=null;for(oe in v)if(!d.hasOwnProperty(oe)&&v.hasOwnProperty(oe)&&v[oe]!=null)if(oe==="style"){var D=v[oe];for(R in D)D.hasOwnProperty(R)&&(a||(a={}),a[R]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(o.hasOwnProperty(oe)?w||(w=[]):(w=w||[]).push(oe,null));for(oe in d){var Y=d[oe];if(D=v!=null?v[oe]:void 0,d.hasOwnProperty(oe)&&Y!==D&&(Y!=null||D!=null))if(oe==="style")if(D){for(R in D)!D.hasOwnProperty(R)||Y&&Y.hasOwnProperty(R)||(a||(a={}),a[R]="");for(R in Y)Y.hasOwnProperty(R)&&D[R]!==Y[R]&&(a||(a={}),a[R]=Y[R])}else a||(w||(w=[]),w.push(oe,a)),a=Y;else oe==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,D=D?D.__html:void 0,Y!=null&&D!==Y&&(w=w||[]).push(oe,Y)):oe==="children"?typeof Y!="string"&&typeof Y!="number"||(w=w||[]).push(oe,""+Y):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(o.hasOwnProperty(oe)?(Y!=null&&oe==="onScroll"&&it("scroll",t),w||D===Y||(w=[])):(w=w||[]).push(oe,Y))}a&&(w=w||[]).push("style",a);var oe=w;(i.updateQueue=oe)&&(i.flags|=4)}},W0=function(t,i,a,d){a!==d&&(i.flags|=4)};function Uo(t,i){if(!lt)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:d.sibling=null}}function Gt(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,d=0;if(i)for(var v=t.child;v!==null;)a|=v.lanes|v.childLanes,d|=v.subtreeFlags&14680064,d|=v.flags&14680064,v.return=t,v=v.sibling;else for(v=t.child;v!==null;)a|=v.lanes|v.childLanes,d|=v.subtreeFlags,d|=v.flags,v.return=t,v=v.sibling;return t.subtreeFlags|=d,t.childLanes=a,i}function cj(t,i,a){var d=i.pendingProps;switch(lc(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(i),null;case 1:return nn(i.type)&&Ya(),Gt(i),null;case 3:return d=i.stateNode,$s(),st(tn),st(Wt),_c(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(t===null||t.child===null)&&(Ja(i)?i.flags|=4:t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Yn!==null&&(Qc(Yn),Yn=null))),Fc(t,i),Gt(i),null;case 5:wc(i);var v=Vi($o.current);if(a=i.type,t!==null&&i.stateNode!=null)H0(t,i,a,d,v),t.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!d){if(i.stateNode===null)throw Error(r(166));return Gt(i),null}if(t=Vi(mr.current),Ja(i)){d=i.stateNode,a=i.type;var w=i.memoizedProps;switch(d[pr]=i,d[Mo]=w,t=(i.mode&1)!==0,a){case"dialog":it("cancel",d),it("close",d);break;case"iframe":case"object":case"embed":it("load",d);break;case"video":case"audio":for(v=0;v<To.length;v++)it(To[v],d);break;case"source":it("error",d);break;case"img":case"image":case"link":it("error",d),it("load",d);break;case"details":it("toggle",d);break;case"input":ke(d,w),it("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!w.multiple},it("invalid",d);break;case"textarea":Fe(d,w),it("invalid",d)}Tt(a,w),v=null;for(var R in w)if(w.hasOwnProperty(R)){var D=w[R];R==="children"?typeof D=="string"?d.textContent!==D&&(w.suppressHydrationWarning!==!0&&Wa(d.textContent,D,t),v=["children",D]):typeof D=="number"&&d.textContent!==""+D&&(w.suppressHydrationWarning!==!0&&Wa(d.textContent,D,t),v=["children",""+D]):o.hasOwnProperty(R)&&D!=null&&R==="onScroll"&&it("scroll",d)}switch(a){case"input":Ce(d),_e(d,w,!0);break;case"textarea":Ce(d),ft(d);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(d.onclick=Va)}d=v,i.updateQueue=d,d!==null&&(i.flags|=4)}else{R=v.nodeType===9?v:v.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=St(a)),t==="http://www.w3.org/1999/xhtml"?a==="script"?(t=R.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof d.is=="string"?t=R.createElement(a,{is:d.is}):(t=R.createElement(a),a==="select"&&(R=t,d.multiple?R.multiple=!0:d.size&&(R.size=d.size))):t=R.createElementNS(t,a),t[pr]=i,t[Mo]=d,U0(t,i,!1,!1),i.stateNode=t;e:{switch(R=At(a,d),a){case"dialog":it("cancel",t),it("close",t),v=d;break;case"iframe":case"object":case"embed":it("load",t),v=d;break;case"video":case"audio":for(v=0;v<To.length;v++)it(To[v],t);v=d;break;case"source":it("error",t),v=d;break;case"img":case"image":case"link":it("error",t),it("load",t),v=d;break;case"details":it("toggle",t),v=d;break;case"input":ke(t,d),v=ye(t,d),it("invalid",t);break;case"option":v=d;break;case"select":t._wrapperState={wasMultiple:!!d.multiple},v=K({},d,{value:void 0}),it("invalid",t);break;case"textarea":Fe(t,d),v=tt(t,d),it("invalid",t);break;default:v=d}Tt(a,v),D=v;for(w in D)if(D.hasOwnProperty(w)){var Y=D[w];w==="style"?yt(t,Y):w==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Y!=null&&Kt(t,Y)):w==="children"?typeof Y=="string"?(a!=="textarea"||Y!=="")&&Ot(t,Y):typeof Y=="number"&&Ot(t,""+Y):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(o.hasOwnProperty(w)?Y!=null&&w==="onScroll"&&it("scroll",t):Y!=null&&E(t,w,Y,R))}switch(a){case"input":Ce(t),_e(t,d,!1);break;case"textarea":Ce(t),ft(t);break;case"option":d.value!=null&&t.setAttribute("value",""+de(d.value));break;case"select":t.multiple=!!d.multiple,w=d.value,w!=null?ot(t,!!d.multiple,w,!1):d.defaultValue!=null&&ot(t,!!d.multiple,d.defaultValue,!0);break;default:typeof v.onClick=="function"&&(t.onclick=Va)}switch(a){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Gt(i),null;case 6:if(t&&i.stateNode!=null)W0(t,i,t.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(r(166));if(a=Vi($o.current),Vi(mr.current),Ja(i)){if(d=i.stateNode,a=i.memoizedProps,d[pr]=i,(w=d.nodeValue!==a)&&(t=fn,t!==null))switch(t.tag){case 3:Wa(d.nodeValue,a,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Wa(d.nodeValue,a,(t.mode&1)!==0)}w&&(i.flags|=4)}else d=(a.nodeType===9?a:a.ownerDocument).createTextNode(d),d[pr]=i,i.stateNode=d}return Gt(i),null;case 13:if(st(ct),d=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(lt&&hn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)Yy(),Ps(),i.flags|=98560,w=!1;else if(w=Ja(i),d!==null&&d.dehydrated!==null){if(t===null){if(!w)throw Error(r(318));if(w=i.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[pr]=i}else Ps(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Gt(i),w=!1}else Yn!==null&&(Qc(Yn),Yn=null),w=!0;if(!w)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=a,i):(d=d!==null,d!==(t!==null&&t.memoizedState!==null)&&d&&(i.child.flags|=8192,(i.mode&1)!==0&&(t===null||(ct.current&1)!==0?Ct===0&&(Ct=3):ed())),i.updateQueue!==null&&(i.flags|=4),Gt(i),null);case 4:return $s(),Fc(t,i),t===null&&Ao(i.stateNode.containerInfo),Gt(i),null;case 10:return pc(i.type._context),Gt(i),null;case 17:return nn(i.type)&&Ya(),Gt(i),null;case 19:if(st(ct),w=i.memoizedState,w===null)return Gt(i),null;if(d=(i.flags&128)!==0,R=w.rendering,R===null)if(d)Uo(w,!1);else{if(Ct!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(R=sl(t),R!==null){for(i.flags|=128,Uo(w,!1),d=R.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),i.subtreeFlags=0,d=a,a=i.child;a!==null;)w=a,t=d,w.flags&=14680066,R=w.alternate,R===null?(w.childLanes=0,w.lanes=t,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=R.childLanes,w.lanes=R.lanes,w.child=R.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=R.memoizedProps,w.memoizedState=R.memoizedState,w.updateQueue=R.updateQueue,w.type=R.type,t=R.dependencies,w.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),a=a.sibling;return et(ct,ct.current&1|2),i.child}t=t.sibling}w.tail!==null&&We()>Bs&&(i.flags|=128,d=!0,Uo(w,!1),i.lanes=4194304)}else{if(!d)if(t=sl(R),t!==null){if(i.flags|=128,d=!0,a=t.updateQueue,a!==null&&(i.updateQueue=a,i.flags|=4),Uo(w,!0),w.tail===null&&w.tailMode==="hidden"&&!R.alternate&&!lt)return Gt(i),null}else 2*We()-w.renderingStartTime>Bs&&a!==1073741824&&(i.flags|=128,d=!0,Uo(w,!1),i.lanes=4194304);w.isBackwards?(R.sibling=i.child,i.child=R):(a=w.last,a!==null?a.sibling=R:i.child=R,w.last=R)}return w.tail!==null?(i=w.tail,w.rendering=i,w.tail=i.sibling,w.renderingStartTime=We(),i.sibling=null,a=ct.current,et(ct,d?a&1|2:a&1),i):(Gt(i),null);case 22:case 23:return Jc(),d=i.memoizedState!==null,t!==null&&t.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(pn&1073741824)!==0&&(Gt(i),i.subtreeFlags&6&&(i.flags|=8192)):Gt(i),null;case 24:return null;case 25:return null}throw Error(r(156,i.tag))}function dj(t,i){switch(lc(i),i.tag){case 1:return nn(i.type)&&Ya(),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return $s(),st(tn),st(Wt),_c(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 5:return wc(i),null;case 13:if(st(ct),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Ps()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return st(ct),null;case 4:return $s(),null;case 10:return pc(i.type._context),null;case 22:case 23:return Jc(),null;case 24:return null;default:return null}}var pl=!1,Yt=!1,fj=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Fs(t,i){var a=t.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(d){ht(t,i,d)}else a.current=null}function zc(t,i,a){try{a()}catch(d){ht(t,i,d)}}var V0=!1;function hj(t,i){if(Ju=Yr,t=ky(),Wu(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var d=a.getSelection&&a.getSelection();if(d&&d.rangeCount!==0){a=d.anchorNode;var v=d.anchorOffset,w=d.focusNode;d=d.focusOffset;try{a.nodeType,w.nodeType}catch{a=null;break e}var R=0,D=-1,Y=-1,oe=0,pe=0,me=t,he=null;t:for(;;){for(var be;me!==a||v!==0&&me.nodeType!==3||(D=R+v),me!==w||d!==0&&me.nodeType!==3||(Y=R+d),me.nodeType===3&&(R+=me.nodeValue.length),(be=me.firstChild)!==null;)he=me,me=be;for(;;){if(me===t)break t;if(he===a&&++oe===v&&(D=R),he===w&&++pe===d&&(Y=R),(be=me.nextSibling)!==null)break;me=he,he=me.parentNode}me=be}a=D===-1||Y===-1?null:{start:D,end:Y}}else a=null}a=a||{start:0,end:0}}else a=null;for(ec={focusedElem:t,selectionRange:a},Yr=!1,Se=i;Se!==null;)if(i=Se,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Se=t;else for(;Se!==null;){i=Se;try{var Ee=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Ee!==null){var Re=Ee.memoizedProps,gt=Ee.memoizedState,ie=i.stateNode,ee=ie.getSnapshotBeforeUpdate(i.elementType===i.type?Re:Kn(i.type,Re),gt);ie.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=i.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ge){ht(i,i.return,ge)}if(t=i.sibling,t!==null){t.return=i.return,Se=t;break}Se=i.return}return Ee=V0,V0=!1,Ee}function Ho(t,i,a){var d=i.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var v=d=d.next;do{if((v.tag&t)===t){var w=v.destroy;v.destroy=void 0,w!==void 0&&zc(i,a,w)}v=v.next}while(v!==d)}}function ml(t,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var a=i=i.next;do{if((a.tag&t)===t){var d=a.create;a.destroy=d()}a=a.next}while(a!==i)}}function Bc(t){var i=t.ref;if(i!==null){var a=t.stateNode;switch(t.tag){case 5:t=a;break;default:t=a}typeof i=="function"?i(t):i.current=t}}function G0(t){var i=t.alternate;i!==null&&(t.alternate=null,G0(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&(delete i[pr],delete i[Mo],delete i[ic],delete i[KR],delete i[XR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Y0(t){return t.tag===5||t.tag===3||t.tag===4}function K0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Y0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Uc(t,i,a){var d=t.tag;if(d===5||d===6)t=t.stateNode,i?a.nodeType===8?a.parentNode.insertBefore(t,i):a.insertBefore(t,i):(a.nodeType===8?(i=a.parentNode,i.insertBefore(t,a)):(i=a,i.appendChild(t)),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=Va));else if(d!==4&&(t=t.child,t!==null))for(Uc(t,i,a),t=t.sibling;t!==null;)Uc(t,i,a),t=t.sibling}function Hc(t,i,a){var d=t.tag;if(d===5||d===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(d!==4&&(t=t.child,t!==null))for(Hc(t,i,a),t=t.sibling;t!==null;)Hc(t,i,a),t=t.sibling}var qt=null,Xn=!1;function oi(t,i,a){for(a=a.child;a!==null;)X0(t,i,a),a=a.sibling}function X0(t,i,a){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(cr,a)}catch{}switch(a.tag){case 5:Yt||Fs(a,i);case 6:var d=qt,v=Xn;qt=null,oi(t,i,a),qt=d,Xn=v,qt!==null&&(Xn?(t=qt,a=a.stateNode,t.nodeType===8?t.parentNode.removeChild(a):t.removeChild(a)):qt.removeChild(a.stateNode));break;case 18:qt!==null&&(Xn?(t=qt,a=a.stateNode,t.nodeType===8?rc(t.parentNode,a):t.nodeType===1&&rc(t,a),$i(t)):rc(qt,a.stateNode));break;case 4:d=qt,v=Xn,qt=a.stateNode.containerInfo,Xn=!0,oi(t,i,a),qt=d,Xn=v;break;case 0:case 11:case 14:case 15:if(!Yt&&(d=a.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){v=d=d.next;do{var w=v,R=w.destroy;w=w.tag,R!==void 0&&((w&2)!==0||(w&4)!==0)&&zc(a,i,R),v=v.next}while(v!==d)}oi(t,i,a);break;case 1:if(!Yt&&(Fs(a,i),d=a.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=a.memoizedProps,d.state=a.memoizedState,d.componentWillUnmount()}catch(D){ht(a,i,D)}oi(t,i,a);break;case 21:oi(t,i,a);break;case 22:a.mode&1?(Yt=(d=Yt)||a.memoizedState!==null,oi(t,i,a),Yt=d):oi(t,i,a);break;default:oi(t,i,a)}}function Q0(t){var i=t.updateQueue;if(i!==null){t.updateQueue=null;var a=t.stateNode;a===null&&(a=t.stateNode=new fj),i.forEach(function(d){var v=bj.bind(null,t,d);a.has(d)||(a.add(d),d.then(v,v))})}}function Qn(t,i){var a=i.deletions;if(a!==null)for(var d=0;d<a.length;d++){var v=a[d];try{var w=t,R=i,D=R;e:for(;D!==null;){switch(D.tag){case 5:qt=D.stateNode,Xn=!1;break e;case 3:qt=D.stateNode.containerInfo,Xn=!0;break e;case 4:qt=D.stateNode.containerInfo,Xn=!0;break e}D=D.return}if(qt===null)throw Error(r(160));X0(w,R,v),qt=null,Xn=!1;var Y=v.alternate;Y!==null&&(Y.return=null),v.return=null}catch(oe){ht(v,i,oe)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)Z0(i,t),i=i.sibling}function Z0(t,i){var a=t.alternate,d=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Qn(i,t),vr(t),d&4){try{Ho(3,t,t.return),ml(3,t)}catch(Re){ht(t,t.return,Re)}try{Ho(5,t,t.return)}catch(Re){ht(t,t.return,Re)}}break;case 1:Qn(i,t),vr(t),d&512&&a!==null&&Fs(a,a.return);break;case 5:if(Qn(i,t),vr(t),d&512&&a!==null&&Fs(a,a.return),t.flags&32){var v=t.stateNode;try{Ot(v,"")}catch(Re){ht(t,t.return,Re)}}if(d&4&&(v=t.stateNode,v!=null)){var w=t.memoizedProps,R=a!==null?a.memoizedProps:w,D=t.type,Y=t.updateQueue;if(t.updateQueue=null,Y!==null)try{D==="input"&&w.type==="radio"&&w.name!=null&&Ge(v,w),At(D,R);var oe=At(D,w);for(R=0;R<Y.length;R+=2){var pe=Y[R],me=Y[R+1];pe==="style"?yt(v,me):pe==="dangerouslySetInnerHTML"?Kt(v,me):pe==="children"?Ot(v,me):E(v,pe,me,oe)}switch(D){case"input":we(v,w);break;case"textarea":Qe(v,w);break;case"select":var he=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!w.multiple;var be=w.value;be!=null?ot(v,!!w.multiple,be,!1):he!==!!w.multiple&&(w.defaultValue!=null?ot(v,!!w.multiple,w.defaultValue,!0):ot(v,!!w.multiple,w.multiple?[]:"",!1))}v[Mo]=w}catch(Re){ht(t,t.return,Re)}}break;case 6:if(Qn(i,t),vr(t),d&4){if(t.stateNode===null)throw Error(r(162));v=t.stateNode,w=t.memoizedProps;try{v.nodeValue=w}catch(Re){ht(t,t.return,Re)}}break;case 3:if(Qn(i,t),vr(t),d&4&&a!==null&&a.memoizedState.isDehydrated)try{$i(i.containerInfo)}catch(Re){ht(t,t.return,Re)}break;case 4:Qn(i,t),vr(t);break;case 13:Qn(i,t),vr(t),v=t.child,v.flags&8192&&(w=v.memoizedState!==null,v.stateNode.isHidden=w,!w||v.alternate!==null&&v.alternate.memoizedState!==null||(Gc=We())),d&4&&Q0(t);break;case 22:if(pe=a!==null&&a.memoizedState!==null,t.mode&1?(Yt=(oe=Yt)||pe,Qn(i,t),Yt=oe):Qn(i,t),vr(t),d&8192){if(oe=t.memoizedState!==null,(t.stateNode.isHidden=oe)&&!pe&&(t.mode&1)!==0)for(Se=t,pe=t.child;pe!==null;){for(me=Se=pe;Se!==null;){switch(he=Se,be=he.child,he.tag){case 0:case 11:case 14:case 15:Ho(4,he,he.return);break;case 1:Fs(he,he.return);var Ee=he.stateNode;if(typeof Ee.componentWillUnmount=="function"){d=he,a=he.return;try{i=d,Ee.props=i.memoizedProps,Ee.state=i.memoizedState,Ee.componentWillUnmount()}catch(Re){ht(d,a,Re)}}break;case 5:Fs(he,he.return);break;case 22:if(he.memoizedState!==null){tw(me);continue}}be!==null?(be.return=he,Se=be):tw(me)}pe=pe.sibling}e:for(pe=null,me=t;;){if(me.tag===5){if(pe===null){pe=me;try{v=me.stateNode,oe?(w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(D=me.stateNode,Y=me.memoizedProps.style,R=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,D.style.display=rt("display",R))}catch(Re){ht(t,t.return,Re)}}}else if(me.tag===6){if(pe===null)try{me.stateNode.nodeValue=oe?"":me.memoizedProps}catch(Re){ht(t,t.return,Re)}}else if((me.tag!==22&&me.tag!==23||me.memoizedState===null||me===t)&&me.child!==null){me.child.return=me,me=me.child;continue}if(me===t)break e;for(;me.sibling===null;){if(me.return===null||me.return===t)break e;pe===me&&(pe=null),me=me.return}pe===me&&(pe=null),me.sibling.return=me.return,me=me.sibling}}break;case 19:Qn(i,t),vr(t),d&4&&Q0(t);break;case 21:break;default:Qn(i,t),vr(t)}}function vr(t){var i=t.flags;if(i&2){try{e:{for(var a=t.return;a!==null;){if(Y0(a)){var d=a;break e}a=a.return}throw Error(r(160))}switch(d.tag){case 5:var v=d.stateNode;d.flags&32&&(Ot(v,""),d.flags&=-33);var w=K0(t);Hc(t,w,v);break;case 3:case 4:var R=d.stateNode.containerInfo,D=K0(t);Uc(t,D,R);break;default:throw Error(r(161))}}catch(Y){ht(t,t.return,Y)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function pj(t,i,a){Se=t,J0(t)}function J0(t,i,a){for(var d=(t.mode&1)!==0;Se!==null;){var v=Se,w=v.child;if(v.tag===22&&d){var R=v.memoizedState!==null||pl;if(!R){var D=v.alternate,Y=D!==null&&D.memoizedState!==null||Yt;D=pl;var oe=Yt;if(pl=R,(Yt=Y)&&!oe)for(Se=v;Se!==null;)R=Se,Y=R.child,R.tag===22&&R.memoizedState!==null?nw(v):Y!==null?(Y.return=R,Se=Y):nw(v);for(;w!==null;)Se=w,J0(w),w=w.sibling;Se=v,pl=D,Yt=oe}ew(t)}else(v.subtreeFlags&8772)!==0&&w!==null?(w.return=v,Se=w):ew(t)}}function ew(t){for(;Se!==null;){var i=Se;if((i.flags&8772)!==0){var a=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Yt||ml(5,i);break;case 1:var d=i.stateNode;if(i.flags&4&&!Yt)if(a===null)d.componentDidMount();else{var v=i.elementType===i.type?a.memoizedProps:Kn(i.type,a.memoizedProps);d.componentDidUpdate(v,a.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var w=i.updateQueue;w!==null&&t0(i,w,d);break;case 3:var R=i.updateQueue;if(R!==null){if(a=null,i.child!==null)switch(i.child.tag){case 5:a=i.child.stateNode;break;case 1:a=i.child.stateNode}t0(i,R,a)}break;case 5:var D=i.stateNode;if(a===null&&i.flags&4){a=D;var Y=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":Y.autoFocus&&a.focus();break;case"img":Y.src&&(a.src=Y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var oe=i.alternate;if(oe!==null){var pe=oe.memoizedState;if(pe!==null){var me=pe.dehydrated;me!==null&&$i(me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Yt||i.flags&512&&Bc(i)}catch(he){ht(i,i.return,he)}}if(i===t){Se=null;break}if(a=i.sibling,a!==null){a.return=i.return,Se=a;break}Se=i.return}}function tw(t){for(;Se!==null;){var i=Se;if(i===t){Se=null;break}var a=i.sibling;if(a!==null){a.return=i.return,Se=a;break}Se=i.return}}function nw(t){for(;Se!==null;){var i=Se;try{switch(i.tag){case 0:case 11:case 15:var a=i.return;try{ml(4,i)}catch(Y){ht(i,a,Y)}break;case 1:var d=i.stateNode;if(typeof d.componentDidMount=="function"){var v=i.return;try{d.componentDidMount()}catch(Y){ht(i,v,Y)}}var w=i.return;try{Bc(i)}catch(Y){ht(i,w,Y)}break;case 5:var R=i.return;try{Bc(i)}catch(Y){ht(i,R,Y)}}}catch(Y){ht(i,i.return,Y)}if(i===t){Se=null;break}var D=i.sibling;if(D!==null){D.return=i.return,Se=D;break}Se=i.return}}var mj=Math.ceil,gl=C.ReactCurrentDispatcher,Wc=C.ReactCurrentOwner,An=C.ReactCurrentBatchConfig,Ue=0,Mt=null,_t=null,$t=0,pn=0,zs=ti(0),Ct=0,Wo=null,Yi=0,vl=0,Vc=0,Vo=null,sn=null,Gc=0,Bs=1/0,Pr=null,yl=!1,Yc=null,ai=null,wl=!1,li=null,xl=0,Go=0,Kc=null,_l=-1,bl=0;function Jt(){return(Ue&6)!==0?We():_l!==-1?_l:_l=We()}function ui(t){return(t.mode&1)===0?1:(Ue&2)!==0&&$t!==0?$t&-$t:ZR.transition!==null?(bl===0&&(bl=ja()),bl):(t=$e,t!==0||(t=window.event,t=t===void 0?16:_o(t.type)),t)}function Zn(t,i,a,d){if(50<Go)throw Go=0,Kc=null,Error(r(185));Sn(t,a,d),((Ue&2)===0||t!==Mt)&&(t===Mt&&((Ue&2)===0&&(vl|=a),Ct===4&&ci(t,$t)),on(t,d),a===1&&Ue===0&&(i.mode&1)===0&&(Bs=We()+500,Xa&&ri()))}function on(t,i){var a=t.callbackNode;zu(t,i);var d=Ti(t,t===Mt?$t:0);if(d===0)a!==null&&Hr(a),t.callbackNode=null,t.callbackPriority=0;else if(i=d&-d,t.callbackPriority!==i){if(a!=null&&Hr(a),i===1)t.tag===0?QR(iw.bind(null,t)):Uy(iw.bind(null,t)),GR(function(){(Ue&6)===0&&ri()}),a=null;else{switch(yo(d)){case 1:a=zt;break;case 4:a=Wr;break;case 16:a=ur;break;case 536870912:a=kr;break;default:a=ur}a=fw(a,rw.bind(null,t))}t.callbackPriority=i,t.callbackNode=a}}function rw(t,i){if(_l=-1,bl=0,(Ue&6)!==0)throw Error(r(327));var a=t.callbackNode;if(Us()&&t.callbackNode!==a)return null;var d=Ti(t,t===Mt?$t:0);if(d===0)return null;if((d&30)!==0||(d&t.expiredLanes)!==0||i)i=Sl(t,d);else{i=d;var v=Ue;Ue|=2;var w=ow();(Mt!==t||$t!==i)&&(Pr=null,Bs=We()+500,Xi(t,i));do try{yj();break}catch(D){sw(t,D)}while(!0);hc(),gl.current=w,Ue=v,_t!==null?i=0:(Mt=null,$t=0,i=Ct)}if(i!==0){if(i===2&&(v=Bt(t),v!==0&&(d=v,i=Xc(t,v))),i===1)throw a=Wo,Xi(t,0),ci(t,d),on(t,We()),a;if(i===6)ci(t,d);else{if(v=t.current.alternate,(d&30)===0&&!gj(v)&&(i=Sl(t,d),i===2&&(w=Bt(t),w!==0&&(d=w,i=Xc(t,w))),i===1))throw a=Wo,Xi(t,0),ci(t,d),on(t,We()),a;switch(t.finishedWork=v,t.finishedLanes=d,i){case 0:case 1:throw Error(r(345));case 2:Qi(t,sn,Pr);break;case 3:if(ci(t,d),(d&130023424)===d&&(i=Gc+500-We(),10<i)){if(Ti(t,0)!==0)break;if(v=t.suspendedLanes,(v&d)!==d){Jt(),t.pingedLanes|=t.suspendedLanes&v;break}t.timeoutHandle=nc(Qi.bind(null,t,sn,Pr),i);break}Qi(t,sn,Pr);break;case 4:if(ci(t,d),(d&4194240)===d)break;for(i=t.eventTimes,v=-1;0<d;){var R=31-en(d);w=1<<R,R=i[R],R>v&&(v=R),d&=~w}if(d=v,d=We()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*mj(d/1960))-d,10<d){t.timeoutHandle=nc(Qi.bind(null,t,sn,Pr),d);break}Qi(t,sn,Pr);break;case 5:Qi(t,sn,Pr);break;default:throw Error(r(329))}}}return on(t,We()),t.callbackNode===a?rw.bind(null,t):null}function Xc(t,i){var a=Vo;return t.current.memoizedState.isDehydrated&&(Xi(t,i).flags|=256),t=Sl(t,i),t!==2&&(i=sn,sn=a,i!==null&&Qc(i)),t}function Qc(t){sn===null?sn=t:sn.push.apply(sn,t)}function gj(t){for(var i=t;;){if(i.flags&16384){var a=i.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var d=0;d<a.length;d++){var v=a[d],w=v.getSnapshot;v=v.value;try{if(!Gn(w(),v))return!1}catch{return!1}}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ci(t,i){for(i&=~Vc,i&=~vl,t.suspendedLanes|=i,t.pingedLanes&=~i,t=t.expirationTimes;0<i;){var a=31-en(i),d=1<<a;t[a]=-1,i&=~d}}function iw(t){if((Ue&6)!==0)throw Error(r(327));Us();var i=Ti(t,0);if((i&1)===0)return on(t,We()),null;var a=Sl(t,i);if(t.tag!==0&&a===2){var d=Bt(t);d!==0&&(i=d,a=Xc(t,d))}if(a===1)throw a=Wo,Xi(t,0),ci(t,i),on(t,We()),a;if(a===6)throw Error(r(345));return t.finishedWork=t.current.alternate,t.finishedLanes=i,Qi(t,sn,Pr),on(t,We()),null}function Zc(t,i){var a=Ue;Ue|=1;try{return t(i)}finally{Ue=a,Ue===0&&(Bs=We()+500,Xa&&ri())}}function Ki(t){li!==null&&li.tag===0&&(Ue&6)===0&&Us();var i=Ue;Ue|=1;var a=An.transition,d=$e;try{if(An.transition=null,$e=1,t)return t()}finally{$e=d,An.transition=a,Ue=i,(Ue&6)===0&&ri()}}function Jc(){pn=zs.current,st(zs)}function Xi(t,i){t.finishedWork=null,t.finishedLanes=0;var a=t.timeoutHandle;if(a!==-1&&(t.timeoutHandle=-1,VR(a)),_t!==null)for(a=_t.return;a!==null;){var d=a;switch(lc(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ya();break;case 3:$s(),st(tn),st(Wt),_c();break;case 5:wc(d);break;case 4:$s();break;case 13:st(ct);break;case 19:st(ct);break;case 10:pc(d.type._context);break;case 22:case 23:Jc()}a=a.return}if(Mt=t,_t=t=di(t.current,null),$t=pn=i,Ct=0,Wo=null,Vc=vl=Yi=0,sn=Vo=null,Wi!==null){for(i=0;i<Wi.length;i++)if(a=Wi[i],d=a.interleaved,d!==null){a.interleaved=null;var v=d.next,w=a.pending;if(w!==null){var R=w.next;w.next=v,d.next=R}a.pending=d}Wi=null}return t}function sw(t,i){do{var a=_t;try{if(hc(),ol.current=cl,al){for(var d=dt.memoizedState;d!==null;){var v=d.queue;v!==null&&(v.pending=null),d=d.next}al=!1}if(Gi=0,It=Nt=dt=null,Do=!1,Fo=0,Wc.current=null,a===null||a.return===null){Ct=1,Wo=i,_t=null;break}e:{var w=t,R=a.return,D=a,Y=i;if(i=$t,D.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var oe=Y,pe=D,me=pe.tag;if((pe.mode&1)===0&&(me===0||me===11||me===15)){var he=pe.alternate;he?(pe.updateQueue=he.updateQueue,pe.memoizedState=he.memoizedState,pe.lanes=he.lanes):(pe.updateQueue=null,pe.memoizedState=null)}var be=T0(R);if(be!==null){be.flags&=-257,A0(be,R,D,w,i),be.mode&1&&j0(w,oe,i),i=be,Y=oe;var Ee=i.updateQueue;if(Ee===null){var Re=new Set;Re.add(Y),i.updateQueue=Re}else Ee.add(Y);break e}else{if((i&1)===0){j0(w,oe,i),ed();break e}Y=Error(r(426))}}else if(lt&&D.mode&1){var gt=T0(R);if(gt!==null){(gt.flags&65536)===0&&(gt.flags|=256),A0(gt,R,D,w,i),dc(Ds(Y,D));break e}}w=Y=Ds(Y,D),Ct!==4&&(Ct=2),Vo===null?Vo=[w]:Vo.push(w),w=R;do{switch(w.tag){case 3:w.flags|=65536,i&=-i,w.lanes|=i;var ie=C0(w,Y,i);e0(w,ie);break e;case 1:D=Y;var ee=w.type,se=w.stateNode;if((w.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(ai===null||!ai.has(se)))){w.flags|=65536,i&=-i,w.lanes|=i;var ge=R0(w,D,i);e0(w,ge);break e}}w=w.return}while(w!==null)}lw(a)}catch(je){i=je,_t===a&&a!==null&&(_t=a=a.return);continue}break}while(!0)}function ow(){var t=gl.current;return gl.current=cl,t===null?cl:t}function ed(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),Mt===null||(Yi&268435455)===0&&(vl&268435455)===0||ci(Mt,$t)}function Sl(t,i){var a=Ue;Ue|=2;var d=ow();(Mt!==t||$t!==i)&&(Pr=null,Xi(t,i));do try{vj();break}catch(v){sw(t,v)}while(!0);if(hc(),Ue=a,gl.current=d,_t!==null)throw Error(r(261));return Mt=null,$t=0,Ct}function vj(){for(;_t!==null;)aw(_t)}function yj(){for(;_t!==null&&!Ei();)aw(_t)}function aw(t){var i=dw(t.alternate,t,pn);t.memoizedProps=t.pendingProps,i===null?lw(t):_t=i,Wc.current=null}function lw(t){var i=t;do{var a=i.alternate;if(t=i.return,(i.flags&32768)===0){if(a=cj(a,i,pn),a!==null){_t=a;return}}else{if(a=dj(a,i),a!==null){a.flags&=32767,_t=a;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ct=6,_t=null;return}}if(i=i.sibling,i!==null){_t=i;return}_t=i=t}while(i!==null);Ct===0&&(Ct=5)}function Qi(t,i,a){var d=$e,v=An.transition;try{An.transition=null,$e=1,wj(t,i,a,d)}finally{An.transition=v,$e=d}return null}function wj(t,i,a,d){do Us();while(li!==null);if((Ue&6)!==0)throw Error(r(327));a=t.finishedWork;var v=t.finishedLanes;if(a===null)return null;if(t.finishedWork=null,t.finishedLanes=0,a===t.current)throw Error(r(177));t.callbackNode=null,t.callbackPriority=0;var w=a.lanes|a.childLanes;if(Ii(t,w),t===Mt&&(_t=Mt=null,$t=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||wl||(wl=!0,fw(ur,function(){return Us(),null})),w=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||w){w=An.transition,An.transition=null;var R=$e;$e=1;var D=Ue;Ue|=4,Wc.current=null,hj(t,a),Z0(a,t),DR(ec),Yr=!!Ju,ec=Ju=null,t.current=a,pj(a),Ni(),Ue=D,$e=R,An.transition=w}else t.current=a;if(wl&&(wl=!1,li=t,xl=v),w=t.pendingLanes,w===0&&(ai=null),Vr(a.stateNode),on(t,We()),i!==null)for(d=t.onRecoverableError,a=0;a<i.length;a++)v=i[a],d(v.value,{componentStack:v.stack,digest:v.digest});if(yl)throw yl=!1,t=Yc,Yc=null,t;return(xl&1)!==0&&t.tag!==0&&Us(),w=t.pendingLanes,(w&1)!==0?t===Kc?Go++:(Go=0,Kc=t):Go=0,ri(),null}function Us(){if(li!==null){var t=yo(xl),i=An.transition,a=$e;try{if(An.transition=null,$e=16>t?16:t,li===null)var d=!1;else{if(t=li,li=null,xl=0,(Ue&6)!==0)throw Error(r(331));var v=Ue;for(Ue|=4,Se=t.current;Se!==null;){var w=Se,R=w.child;if((Se.flags&16)!==0){var D=w.deletions;if(D!==null){for(var Y=0;Y<D.length;Y++){var oe=D[Y];for(Se=oe;Se!==null;){var pe=Se;switch(pe.tag){case 0:case 11:case 15:Ho(8,pe,w)}var me=pe.child;if(me!==null)me.return=pe,Se=me;else for(;Se!==null;){pe=Se;var he=pe.sibling,be=pe.return;if(G0(pe),pe===oe){Se=null;break}if(he!==null){he.return=be,Se=he;break}Se=be}}}var Ee=w.alternate;if(Ee!==null){var Re=Ee.child;if(Re!==null){Ee.child=null;do{var gt=Re.sibling;Re.sibling=null,Re=gt}while(Re!==null)}}Se=w}}if((w.subtreeFlags&2064)!==0&&R!==null)R.return=w,Se=R;else e:for(;Se!==null;){if(w=Se,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:Ho(9,w,w.return)}var ie=w.sibling;if(ie!==null){ie.return=w.return,Se=ie;break e}Se=w.return}}var ee=t.current;for(Se=ee;Se!==null;){R=Se;var se=R.child;if((R.subtreeFlags&2064)!==0&&se!==null)se.return=R,Se=se;else e:for(R=ee;Se!==null;){if(D=Se,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:ml(9,D)}}catch(je){ht(D,D.return,je)}if(D===R){Se=null;break e}var ge=D.sibling;if(ge!==null){ge.return=D.return,Se=ge;break e}Se=D.return}}if(Ue=v,ri(),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(cr,t)}catch{}d=!0}return d}finally{$e=a,An.transition=i}}return!1}function uw(t,i,a){i=Ds(a,i),i=C0(t,i,1),t=si(t,i,1),i=Jt(),t!==null&&(Sn(t,1,i),on(t,i))}function ht(t,i,a){if(t.tag===3)uw(t,t,a);else for(;i!==null;){if(i.tag===3){uw(i,t,a);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ai===null||!ai.has(d))){t=Ds(a,t),t=R0(i,t,1),i=si(i,t,1),t=Jt(),i!==null&&(Sn(i,1,t),on(i,t));break}}i=i.return}}function xj(t,i,a){var d=t.pingCache;d!==null&&d.delete(i),i=Jt(),t.pingedLanes|=t.suspendedLanes&a,Mt===t&&($t&a)===a&&(Ct===4||Ct===3&&($t&130023424)===$t&&500>We()-Gc?Xi(t,0):Vc|=a),on(t,i)}function cw(t,i){i===0&&((t.mode&1)===0?i=1:(i=Ri,Ri<<=1,(Ri&130023424)===0&&(Ri=4194304)));var a=Jt();t=Ar(t,i),t!==null&&(Sn(t,i,a),on(t,a))}function _j(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),cw(t,a)}function bj(t,i){var a=0;switch(t.tag){case 13:var d=t.stateNode,v=t.memoizedState;v!==null&&(a=v.retryLane);break;case 19:d=t.stateNode;break;default:throw Error(r(314))}d!==null&&d.delete(i),cw(t,a)}var dw;dw=function(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps||tn.current)rn=!0;else{if((t.lanes&a)===0&&(i.flags&128)===0)return rn=!1,uj(t,i,a);rn=(t.flags&131072)!==0}else rn=!1,lt&&(i.flags&1048576)!==0&&Hy(i,Za,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;hl(t,i),t=i.pendingProps;var v=As(i,Wt.current);qs(i,a),v=kc(null,i,d,t,v,a);var w=Ec();return i.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,nn(d)?(w=!0,Ka(i)):w=!1,i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,vc(i),v.updater=dl,i.stateNode=v,v._reactInternals=i,Ac(i,d,t,a),i=Oc(null,i,d,!0,w,a)):(i.tag=0,lt&&w&&ac(i),Zt(null,i,v,a),i=i.child),i;case 16:d=i.elementType;e:{switch(hl(t,i),t=i.pendingProps,v=d._init,d=v(d._payload),i.type=d,v=i.tag=kj(d),t=Kn(d,t),v){case 0:i=Pc(null,i,d,t,a);break e;case 1:i=q0(null,i,d,t,a);break e;case 11:i=I0(null,i,d,t,a);break e;case 14:i=M0(null,i,d,Kn(d.type,t),a);break e}throw Error(r(306,d,""))}return i;case 0:return d=i.type,v=i.pendingProps,v=i.elementType===d?v:Kn(d,v),Pc(t,i,d,v,a);case 1:return d=i.type,v=i.pendingProps,v=i.elementType===d?v:Kn(d,v),q0(t,i,d,v,a);case 3:e:{if($0(i),t===null)throw Error(r(387));d=i.pendingProps,w=i.memoizedState,v=w.element,Jy(t,i),il(i,d,null,a);var R=i.memoizedState;if(d=R.element,w.isDehydrated)if(w={element:d,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){v=Ds(Error(r(423)),i),i=D0(t,i,d,a,v);break e}else if(d!==v){v=Ds(Error(r(424)),i),i=D0(t,i,d,a,v);break e}else for(hn=ei(i.stateNode.containerInfo.firstChild),fn=i,lt=!0,Yn=null,a=Qy(i,null,d,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ps(),d===v){i=Mr(t,i,a);break e}Zt(t,i,d,a)}i=i.child}return i;case 5:return n0(i),t===null&&cc(i),d=i.type,v=i.pendingProps,w=t!==null?t.memoizedProps:null,R=v.children,tc(d,v)?R=null:w!==null&&tc(d,w)&&(i.flags|=32),L0(t,i),Zt(t,i,R,a),i.child;case 6:return t===null&&cc(i),null;case 13:return F0(t,i,a);case 4:return yc(i,i.stateNode.containerInfo),d=i.pendingProps,t===null?i.child=Os(i,null,d,a):Zt(t,i,d,a),i.child;case 11:return d=i.type,v=i.pendingProps,v=i.elementType===d?v:Kn(d,v),I0(t,i,d,v,a);case 7:return Zt(t,i,i.pendingProps,a),i.child;case 8:return Zt(t,i,i.pendingProps.children,a),i.child;case 12:return Zt(t,i,i.pendingProps.children,a),i.child;case 10:e:{if(d=i.type._context,v=i.pendingProps,w=i.memoizedProps,R=v.value,et(tl,d._currentValue),d._currentValue=R,w!==null)if(Gn(w.value,R)){if(w.children===v.children&&!tn.current){i=Mr(t,i,a);break e}}else for(w=i.child,w!==null&&(w.return=i);w!==null;){var D=w.dependencies;if(D!==null){R=w.child;for(var Y=D.firstContext;Y!==null;){if(Y.context===d){if(w.tag===1){Y=Ir(-1,a&-a),Y.tag=2;var oe=w.updateQueue;if(oe!==null){oe=oe.shared;var pe=oe.pending;pe===null?Y.next=Y:(Y.next=pe.next,pe.next=Y),oe.pending=Y}}w.lanes|=a,Y=w.alternate,Y!==null&&(Y.lanes|=a),mc(w.return,a,i),D.lanes|=a;break}Y=Y.next}}else if(w.tag===10)R=w.type===i.type?null:w.child;else if(w.tag===18){if(R=w.return,R===null)throw Error(r(341));R.lanes|=a,D=R.alternate,D!==null&&(D.lanes|=a),mc(R,a,i),R=w.sibling}else R=w.child;if(R!==null)R.return=w;else for(R=w;R!==null;){if(R===i){R=null;break}if(w=R.sibling,w!==null){w.return=R.return,R=w;break}R=R.return}w=R}Zt(t,i,v.children,a),i=i.child}return i;case 9:return v=i.type,d=i.pendingProps.children,qs(i,a),v=jn(v),d=d(v),i.flags|=1,Zt(t,i,d,a),i.child;case 14:return d=i.type,v=Kn(d,i.pendingProps),v=Kn(d.type,v),M0(t,i,d,v,a);case 15:return P0(t,i,i.type,i.pendingProps,a);case 17:return d=i.type,v=i.pendingProps,v=i.elementType===d?v:Kn(d,v),hl(t,i),i.tag=1,nn(d)?(t=!0,Ka(i)):t=!1,qs(i,a),E0(i,d,v),Ac(i,d,v,a),Oc(null,i,d,!0,t,a);case 19:return B0(t,i,a);case 22:return O0(t,i,a)}throw Error(r(156,i.tag))};function fw(t,i){return gs(t,i)}function Sj(t,i,a,d){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(t,i,a,d){return new Sj(t,i,a,d)}function td(t){return t=t.prototype,!(!t||!t.isReactComponent)}function kj(t){if(typeof t=="function")return td(t)?1:0;if(t!=null){if(t=t.$$typeof,t===G)return 11;if(t===Q)return 14}return 2}function di(t,i){var a=t.alternate;return a===null?(a=In(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&14680064,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a}function kl(t,i,a,d,v,w){var R=2;if(d=t,typeof t=="function")td(t)&&(R=1);else if(typeof t=="string")R=5;else e:switch(t){case L:return Zi(a.children,v,w,i);case H:R=8,v|=8;break;case O:return t=In(12,a,i,v|2),t.elementType=O,t.lanes=w,t;case q:return t=In(13,a,i,v),t.elementType=q,t.lanes=w,t;case j:return t=In(19,a,i,v),t.elementType=j,t.lanes=w,t;case ne:return El(a,v,w,i);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case P:R=10;break e;case F:R=9;break e;case G:R=11;break e;case Q:R=14;break e;case z:R=16,d=null;break e}throw Error(r(130,t==null?t:typeof t,""))}return i=In(R,a,i,v),i.elementType=t,i.type=d,i.lanes=w,i}function Zi(t,i,a,d){return t=In(7,t,d,i),t.lanes=a,t}function El(t,i,a,d){return t=In(22,t,d,i),t.elementType=ne,t.lanes=a,t.stateNode={isHidden:!1},t}function nd(t,i,a){return t=In(6,t,null,i),t.lanes=a,t}function rd(t,i,a){return i=In(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}function Ej(t,i,a,d,v){this.tag=i,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ai(0),this.expirationTimes=Ai(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ai(0),this.identifierPrefix=d,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function id(t,i,a,d,v,w,R,D,Y){return t=new Ej(t,i,a,D,Y),i===1?(i=1,w===!0&&(i|=8)):i=0,w=In(3,null,null,i),t.current=w,w.stateNode=t,w.memoizedState={element:d,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},vc(w),t}function Nj(t,i,a){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:d==null?null:""+d,children:t,containerInfo:i,implementation:a}}function hw(t){if(!t)return ni;t=t._reactInternals;e:{if(dn(t)!==t||t.tag!==1)throw Error(r(170));var i=t;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(nn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(r(171))}if(t.tag===1){var a=t.type;if(nn(a))return zy(t,a,i)}return i}function pw(t,i,a,d,v,w,R,D,Y){return t=id(a,d,!0,t,v,w,R,D,Y),t.context=hw(null),a=t.current,d=Jt(),v=ui(a),w=Ir(d,v),w.callback=i??null,si(a,w,v),t.current.lanes=v,Sn(t,v,d),on(t,d),t}function Nl(t,i,a,d){var v=i.current,w=Jt(),R=ui(v);return a=hw(a),i.context===null?i.context=a:i.pendingContext=a,i=Ir(w,R),i.payload={element:t},d=d===void 0?null:d,d!==null&&(i.callback=d),t=si(v,i,R),t!==null&&(Zn(t,v,R,w),rl(t,v,R)),R}function Cl(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function mw(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function sd(t,i){mw(t,i),(t=t.alternate)&&mw(t,i)}function Cj(){return null}var gw=typeof reportError=="function"?reportError:function(t){console.error(t)};function od(t){this._internalRoot=t}Rl.prototype.render=od.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(r(409));Nl(t,i,null,null)},Rl.prototype.unmount=od.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;Ki(function(){Nl(null,t,null,null)}),i[Cr]=null}};function Rl(t){this._internalRoot=t}Rl.prototype.unstable_scheduleHydration=function(t){if(t){var i=wo();t={blockedOn:null,target:t,priority:i};for(var a=0;a<Bn.length&&i!==0&&i<Bn[a].priority;a++);Bn.splice(a,0,t),a===0&&Pa(t)}};function ad(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function jl(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function vw(){}function Rj(t,i,a,d,v){if(v){if(typeof d=="function"){var w=d;d=function(){var oe=Cl(R);w.call(oe)}}var R=pw(i,d,t,0,null,!1,!1,"",vw);return t._reactRootContainer=R,t[Cr]=R.current,Ao(t.nodeType===8?t.parentNode:t),Ki(),R}for(;v=t.lastChild;)t.removeChild(v);if(typeof d=="function"){var D=d;d=function(){var oe=Cl(Y);D.call(oe)}}var Y=id(t,0,!1,null,null,!1,!1,"",vw);return t._reactRootContainer=Y,t[Cr]=Y.current,Ao(t.nodeType===8?t.parentNode:t),Ki(function(){Nl(i,Y,a,d)}),Y}function Tl(t,i,a,d,v){var w=a._reactRootContainer;if(w){var R=w;if(typeof v=="function"){var D=v;v=function(){var Y=Cl(R);D.call(Y)}}Nl(i,R,t,v)}else R=Rj(a,i,t,v,d);return Cl(R)}Pi=function(t){switch(t.tag){case 3:var i=t.stateNode;if(i.current.memoizedState.isDehydrated){var a=ji(i.pendingLanes);a!==0&&(Mi(i,a|1),on(i,We()),(Ue&6)===0&&(Bs=We()+500,ri()))}break;case 13:Ki(function(){var d=Ar(t,1);if(d!==null){var v=Jt();Zn(d,t,1,v)}}),sd(t,1)}},vs=function(t){if(t.tag===13){var i=Ar(t,134217728);if(i!==null){var a=Jt();Zn(i,t,134217728,a)}sd(t,134217728)}},Ta=function(t){if(t.tag===13){var i=ui(t),a=Ar(t,i);if(a!==null){var d=Jt();Zn(a,t,i,d)}sd(t,i)}},wo=function(){return $e},Aa=function(t,i){var a=$e;try{return $e=t,i()}finally{$e=a}},Ze=function(t,i,a){switch(i){case"input":if(we(t,a),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<a.length;i++){var d=a[i];if(d!==t&&d.form===t.form){var v=Ga(d);if(!v)throw Error(r(90));ve(d),we(d,v)}}}break;case"textarea":Qe(t,a);break;case"select":i=a.value,i!=null&&ot(t,!!a.multiple,i,!1)}},_r=Zc,hs=Ki;var jj={usingClientEntryPoint:!1,Events:[Po,js,Ga,fs,xn,Zc]},Yo={findFiberByHostInstance:zi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Tj={bundleType:Yo.bundleType,version:Yo.version,rendererPackageName:Yo.rendererPackageName,rendererConfig:Yo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Si(t),t===null?null:t.stateNode},findFiberByHostInstance:Yo.findFiberByHostInstance||Cj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Al=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Al.isDisabled&&Al.supportsFiber)try{cr=Al.inject(Tj),wt=Al}catch{}}return an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jj,an.createPortal=function(t,i){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ad(i))throw Error(r(200));return Nj(t,i,null,a)},an.createRoot=function(t,i){if(!ad(t))throw Error(r(299));var a=!1,d="",v=gw;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),i=id(t,1,!1,null,null,a,!1,d,v),t[Cr]=i.current,Ao(t.nodeType===8?t.parentNode:t),new od(i)},an.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=Si(i),t=t===null?null:t.stateNode,t},an.flushSync=function(t){return Ki(t)},an.hydrate=function(t,i,a){if(!jl(i))throw Error(r(200));return Tl(null,t,i,!0,a)},an.hydrateRoot=function(t,i,a){if(!ad(t))throw Error(r(405));var d=a!=null&&a.hydratedSources||null,v=!1,w="",R=gw;if(a!=null&&(a.unstable_strictMode===!0&&(v=!0),a.identifierPrefix!==void 0&&(w=a.identifierPrefix),a.onRecoverableError!==void 0&&(R=a.onRecoverableError)),i=pw(i,null,t,1,a??null,v,!1,w,R),t[Cr]=i.current,Ao(t),d)for(t=0;t<d.length;t++)a=d[t],v=a._getVersion,v=v(a._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[a,v]:i.mutableSourceEagerHydrationData.push(a,v);return new Rl(i)},an.render=function(t,i,a){if(!jl(i))throw Error(r(200));return Tl(null,t,i,!1,a)},an.unmountComponentAtNode=function(t){if(!jl(t))throw Error(r(40));return t._reactRootContainer?(Ki(function(){Tl(null,null,t,!1,function(){t._reactRootContainer=null,t[Cr]=null})}),!0):!1},an.unstable_batchedUpdates=Zc,an.unstable_renderSubtreeIntoContainer=function(t,i,a,d){if(!jl(a))throw Error(r(200));if(t==null||t._reactInternals===void 0)throw Error(r(38));return Tl(t,i,a,!1,d)},an.version="18.3.1-next-f1338f8080-20240426",an}var Ew;function bE(){if(Ew)return cd.exports;Ew=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(),cd.exports=qj(),cd.exports}var Nw;function $j(){if(Nw)return Ml;Nw=1;var e=bE();return Ml.createRoot=e.createRoot,Ml.hydrateRoot=e.hydrateRoot,Ml}var Dj=$j(),A=va();const ue=_v(A);function Ft(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let r=0,s;r<e.length;r++)(s=Ft(e[r]))!==""&&(n+=(n&&" ")+s);else for(let r in e)e[r]&&(n+=(n&&" ")+r);return n}var hd={exports:{}},pd={},md={exports:{}},gd={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var Cw;function Fj(){if(Cw)return gd;Cw=1;var e=va();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var r=typeof Object.is=="function"?Object.is:n,s=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function c(g,y){var x=y(),N=s({inst:{value:x,getSnapshot:y}}),_=N[0].inst,S=N[1];return l(function(){_.value=x,_.getSnapshot=y,p(_)&&S({inst:_})},[g,x,y]),o(function(){return p(_)&&S({inst:_}),g(function(){p(_)&&S({inst:_})})},[g]),u(x),x}function p(g){var y=g.getSnapshot;g=g.value;try{var x=y();return!r(g,x)}catch{return!0}}function h(g,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return gd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,gd}var Rw;function zj(){return Rw||(Rw=1,md.exports=Fj()),md.exports}/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var jw;function Bj(){if(jw)return pd;jw=1;var e=va(),n=zj();function r(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var s=typeof Object.is=="function"?Object.is:r,o=n.useSyncExternalStore,l=e.useRef,u=e.useEffect,c=e.useMemo,p=e.useDebugValue;return pd.useSyncExternalStoreWithSelector=function(h,f,g,y,x){var N=l(null);if(N.current===null){var _={hasValue:!1,value:null};N.current=_}else _=N.current;N=c(function(){function b(M){if(!k){if(k=!0,E=M,M=y(M),x!==void 0&&_.hasValue){var L=_.value;if(x(L,M))return C=L}return C=M}if(L=C,s(E,M))return L;var H=y(M);return x!==void 0&&x(L,H)?(E=M,L):(E=M,C=H)}var k=!1,E,C,T=g===void 0?null:g;return[function(){return b(f())},T===null?void 0:function(){return b(T())}]},[f,g,y,x]);var S=o(h,N[0],N[1]);return u(function(){_.hasValue=!0,_.value=S},[S]),p(S),S},pd}var Tw;function Uj(){return Tw||(Tw=1,hd.exports=Bj()),hd.exports}var Hj=Uj();const Wj=_v(Hj),Vj={},Aw=e=>{let n;const r=new Set,s=(f,g)=>{const y=typeof f=="function"?f(n):f;if(!Object.is(y,n)){const x=n;n=g??(typeof y!="object"||y===null)?y:Object.assign({},n,y),r.forEach(N=>N(n,x))}},o=()=>n,p={setState:s,getState:o,getInitialState:()=>h,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(Vj?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},h=n=e(s,o,p);return p},Gj=e=>e?Aw(e):Aw,{useDebugValue:Yj}=ue,{useSyncExternalStoreWithSelector:Kj}=Wj,Xj=e=>e;function SE(e,n=Xj,r){const s=Kj(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,r);return Yj(s),s}const Iw=(e,n)=>{const r=Gj(e),s=(o,l=n)=>SE(r,o,l);return Object.assign(s,r),s},Qj=(e,n)=>e?Iw(e,n):Iw;function Rt(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[s,o]of e)if(!Object.is(o,n.get(s)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(n,s)||!Object.is(e[s],n[s]))return!1;return!0}var Zj={value:()=>{}};function mu(){for(var e=0,n=arguments.length,r={},s;e<n;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new Ql(r)}function Ql(e){this._=e}function Jj(e,n){return e.trim().split(/^|\s+/).map(function(r){var s="",o=r.indexOf(".");if(o>=0&&(s=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}Ql.prototype=mu.prototype={constructor:Ql,on:function(e,n){var r=this._,s=Jj(e+"",r),o,l=-1,u=s.length;if(arguments.length<2){for(;++l<u;)if((o=(e=s[l]).type)&&(o=eT(r[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++l<u;)if(o=(e=s[l]).type)r[o]=Mw(r[o],e.name,n);else if(n==null)for(o in r)r[o]=Mw(r[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new Ql(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var r=new Array(o),s=0,o,l;s<o;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],s=0,o=l.length;s<o;++s)l[s].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,l=s.length;o<l;++o)s[o].value.apply(n,r)}};function eT(e,n){for(var r=0,s=e.length,o;r<s;++r)if((o=e[r]).name===n)return o.value}function Mw(e,n,r){for(var s=0,o=e.length;s<o;++s)if(e[s].name===n){e[s]=Zj,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:n,value:r}),e}var Yg="http://www.w3.org/1999/xhtml";const Pw={svg:"http://www.w3.org/2000/svg",xhtml:Yg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function gu(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Pw.hasOwnProperty(n)?{space:Pw[n],local:e}:e}function tT(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===Yg&&n.documentElement.namespaceURI===Yg?n.createElement(e):n.createElementNS(r,e)}}function nT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function kE(e){var n=gu(e);return(n.local?nT:tT)(n)}function rT(){}function bv(e){return e==null?rT:function(){return this.querySelector(e)}}function iT(e){typeof e!="function"&&(e=bv(e));for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o)for(var l=n[o],u=l.length,c=s[o]=new Array(u),p,h,f=0;f<u;++f)(p=l[f])&&(h=e.call(p,p.__data__,f,l))&&("__data__"in p&&(h.__data__=p.__data__),c[f]=h);return new gn(s,this._parents)}function sT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function oT(){return[]}function EE(e){return e==null?oT:function(){return this.querySelectorAll(e)}}function aT(e){return function(){return sT(e.apply(this,arguments))}}function lT(e){typeof e=="function"?e=aT(e):e=EE(e);for(var n=this._groups,r=n.length,s=[],o=[],l=0;l<r;++l)for(var u=n[l],c=u.length,p,h=0;h<c;++h)(p=u[h])&&(s.push(e.call(p,p.__data__,h,u)),o.push(p));return new gn(s,o)}function NE(e){return function(){return this.matches(e)}}function CE(e){return function(n){return n.matches(e)}}var uT=Array.prototype.find;function cT(e){return function(){return uT.call(this.children,e)}}function dT(){return this.firstElementChild}function fT(e){return this.select(e==null?dT:cT(typeof e=="function"?e:CE(e)))}var hT=Array.prototype.filter;function pT(){return Array.from(this.children)}function mT(e){return function(){return hT.call(this.children,e)}}function gT(e){return this.selectAll(e==null?pT:mT(typeof e=="function"?e:CE(e)))}function vT(e){typeof e!="function"&&(e=NE(e));for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o)for(var l=n[o],u=l.length,c=s[o]=[],p,h=0;h<u;++h)(p=l[h])&&e.call(p,p.__data__,h,l)&&c.push(p);return new gn(s,this._parents)}function RE(e){return new Array(e.length)}function yT(){return new gn(this._enter||this._groups.map(RE),this._parents)}function nu(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}nu.prototype={constructor:nu,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 wT(e){return function(){return e}}function xT(e,n,r,s,o,l){for(var u=0,c,p=n.length,h=l.length;u<h;++u)(c=n[u])?(c.__data__=l[u],s[u]=c):r[u]=new nu(e,l[u]);for(;u<p;++u)(c=n[u])&&(o[u]=c)}function _T(e,n,r,s,o,l,u){var c,p,h=new Map,f=n.length,g=l.length,y=new Array(f),x;for(c=0;c<f;++c)(p=n[c])&&(y[c]=x=u.call(p,p.__data__,c,n)+"",h.has(x)?o[c]=p:h.set(x,p));for(c=0;c<g;++c)x=u.call(e,l[c],c,l)+"",(p=h.get(x))?(s[c]=p,p.__data__=l[c],h.delete(x)):r[c]=new nu(e,l[c]);for(c=0;c<f;++c)(p=n[c])&&h.get(y[c])===p&&(o[c]=p)}function bT(e){return e.__data__}function ST(e,n){if(!arguments.length)return Array.from(this,bT);var r=n?_T:xT,s=this._parents,o=this._groups;typeof e!="function"&&(e=wT(e));for(var l=o.length,u=new Array(l),c=new Array(l),p=new Array(l),h=0;h<l;++h){var f=s[h],g=o[h],y=g.length,x=kT(e.call(f,f&&f.__data__,h,s)),N=x.length,_=c[h]=new Array(N),S=u[h]=new Array(N),b=p[h]=new Array(y);r(f,g,_,S,b,x,n);for(var k=0,E=0,C,T;k<N;++k)if(C=_[k]){for(k>=E&&(E=k+1);!(T=S[E])&&++E<N;);C._next=T||null}}return u=new gn(u,s),u._enter=c,u._exit=p,u}function kT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ET(){return new gn(this._exit||this._groups.map(RE),this._parents)}function NT(e,n,r){var s=this.enter(),o=this,l=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),r==null?l.remove():r(l),s&&o?s.merge(o).order():o}function CT(e){for(var n=e.selection?e.selection():e,r=this._groups,s=n._groups,o=r.length,l=s.length,u=Math.min(o,l),c=new Array(o),p=0;p<u;++p)for(var h=r[p],f=s[p],g=h.length,y=c[p]=new Array(g),x,N=0;N<g;++N)(x=h[N]||f[N])&&(y[N]=x);for(;p<o;++p)c[p]=r[p];return new gn(c,this._parents)}function RT(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var s=e[n],o=s.length-1,l=s[o],u;--o>=0;)(u=s[o])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function jT(e){e||(e=TT);function n(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var r=this._groups,s=r.length,o=new Array(s),l=0;l<s;++l){for(var u=r[l],c=u.length,p=o[l]=new Array(c),h,f=0;f<c;++f)(h=u[f])&&(p[f]=h);p.sort(n)}return new gn(o,this._parents).order()}function TT(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function AT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function IT(){return Array.from(this)}function MT(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var s=e[n],o=0,l=s.length;o<l;++o){var u=s[o];if(u)return u}return null}function PT(){let e=0;for(const n of this)++e;return e}function OT(){return!this.node()}function LT(e){for(var n=this._groups,r=0,s=n.length;r<s;++r)for(var o=n[r],l=0,u=o.length,c;l<u;++l)(c=o[l])&&e.call(c,c.__data__,l,o);return this}function qT(e){return function(){this.removeAttribute(e)}}function $T(e){return function(){this.removeAttributeNS(e.space,e.local)}}function DT(e,n){return function(){this.setAttribute(e,n)}}function FT(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function zT(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function BT(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 UT(e,n){var r=gu(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((n==null?r.local?$T:qT:typeof n=="function"?r.local?BT:zT:r.local?FT:DT)(r,n))}function jE(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function HT(e){return function(){this.style.removeProperty(e)}}function WT(e,n,r){return function(){this.style.setProperty(e,n,r)}}function VT(e,n,r){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function GT(e,n,r){return arguments.length>1?this.each((n==null?HT:typeof n=="function"?VT:WT)(e,n,r??"")):ro(this.node(),e)}function ro(e,n){return e.style.getPropertyValue(n)||jE(e).getComputedStyle(e,null).getPropertyValue(n)}function YT(e){return function(){delete this[e]}}function KT(e,n){return function(){this[e]=n}}function XT(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function QT(e,n){return arguments.length>1?this.each((n==null?YT:typeof n=="function"?XT:KT)(e,n)):this.node()[e]}function TE(e){return e.trim().split(/^|\s+/)}function Sv(e){return e.classList||new AE(e)}function AE(e){this._node=e,this._names=TE(e.getAttribute("class")||"")}AE.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 IE(e,n){for(var r=Sv(e),s=-1,o=n.length;++s<o;)r.add(n[s])}function ME(e,n){for(var r=Sv(e),s=-1,o=n.length;++s<o;)r.remove(n[s])}function ZT(e){return function(){IE(this,e)}}function JT(e){return function(){ME(this,e)}}function e2(e,n){return function(){(n.apply(this,arguments)?IE:ME)(this,e)}}function t2(e,n){var r=TE(e+"");if(arguments.length<2){for(var s=Sv(this.node()),o=-1,l=r.length;++o<l;)if(!s.contains(r[o]))return!1;return!0}return this.each((typeof n=="function"?e2:n?ZT:JT)(r,n))}function n2(){this.textContent=""}function r2(e){return function(){this.textContent=e}}function i2(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function s2(e){return arguments.length?this.each(e==null?n2:(typeof e=="function"?i2:r2)(e)):this.node().textContent}function o2(){this.innerHTML=""}function a2(e){return function(){this.innerHTML=e}}function l2(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function u2(e){return arguments.length?this.each(e==null?o2:(typeof e=="function"?l2:a2)(e)):this.node().innerHTML}function c2(){this.nextSibling&&this.parentNode.appendChild(this)}function d2(){return this.each(c2)}function f2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function h2(){return this.each(f2)}function p2(e){var n=typeof e=="function"?e:kE(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function m2(){return null}function g2(e,n){var r=typeof e=="function"?e:kE(e),s=n==null?m2:typeof n=="function"?n:bv(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function v2(){var e=this.parentNode;e&&e.removeChild(this)}function y2(){return this.each(v2)}function w2(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function x2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function _2(e){return this.select(e?x2:w2)}function b2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function S2(e){return function(n){e.call(this,n,this.__data__)}}function k2(e){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");return s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),{type:n,name:r}})}function E2(e){return function(){var n=this.__on;if(n){for(var r=0,s=-1,o=n.length,l;r<o;++r)l=n[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):n[++s]=l;++s?n.length=s:delete this.__on}}}function N2(e,n,r){return function(){var s=this.__on,o,l=S2(n);if(s){for(var u=0,c=s.length;u<c;++u)if((o=s[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=r),o.value=n;return}}this.addEventListener(e.type,l,r),o={type:e.type,name:e.name,value:n,listener:l,options:r},s?s.push(o):this.__on=[o]}}function C2(e,n,r){var s=k2(e+""),o,l=s.length,u;if(arguments.length<2){var c=this.node().__on;if(c){for(var p=0,h=c.length,f;p<h;++p)for(o=0,f=c[p];o<l;++o)if((u=s[o]).type===f.type&&u.name===f.name)return f.value}return}for(c=n?N2:E2,o=0;o<l;++o)this.each(c(s[o],n,r));return this}function PE(e,n,r){var s=jE(e),o=s.CustomEvent;typeof o=="function"?o=new o(n,r):(o=s.document.createEvent("Event"),r?(o.initEvent(n,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function R2(e,n){return function(){return PE(this,e,n)}}function j2(e,n){return function(){return PE(this,e,n.apply(this,arguments))}}function T2(e,n){return this.each((typeof n=="function"?j2:R2)(e,n))}function*A2(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var s=e[n],o=0,l=s.length,u;o<l;++o)(u=s[o])&&(yield u)}var OE=[null];function gn(e,n){this._groups=e,this._parents=n}function ya(){return new gn([[document.documentElement]],OE)}function I2(){return this}gn.prototype=ya.prototype={constructor:gn,select:iT,selectAll:lT,selectChild:fT,selectChildren:gT,filter:vT,data:ST,enter:yT,exit:ET,join:NT,merge:CT,selection:I2,order:RT,sort:jT,call:AT,nodes:IT,node:MT,size:PT,empty:OT,each:LT,attr:UT,style:GT,property:QT,classed:t2,text:s2,html:u2,raise:d2,lower:h2,append:p2,insert:g2,remove:y2,clone:_2,datum:b2,on:C2,dispatch:T2,[Symbol.iterator]:A2};function Pn(e){return typeof e=="string"?new gn([[document.querySelector(e)]],[document.documentElement]):new gn([[e]],OE)}function M2(e){let n;for(;n=e.sourceEvent;)e=n;return e}function er(e,n){if(e=M2(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var s=r.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(n.getScreenCTM().inverse()),[s.x,s.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const P2={passive:!1},aa={capture:!0,passive:!1};function vd(e){e.stopImmediatePropagation()}function Js(e){e.preventDefault(),e.stopImmediatePropagation()}function LE(e){var n=e.document.documentElement,r=Pn(e).on("dragstart.drag",Js,aa);"onselectstart"in n?r.on("selectstart.drag",Js,aa):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function qE(e,n){var r=e.document.documentElement,s=Pn(e).on("dragstart.drag",null);n&&(s.on("click.drag",Js,aa),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in r?s.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Pl=e=>()=>e;function Kg(e,{sourceEvent:n,subject:r,target:s,identifier:o,active:l,x:u,y:c,dx:p,dy:h,dispatch:f}){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:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:p,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:f}})}Kg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function O2(e){return!e.ctrlKey&&!e.button}function L2(){return this.parentNode}function q2(e,n){return n??{x:e.x,y:e.y}}function $2(){return navigator.maxTouchPoints||"ontouchstart"in this}function D2(){var e=O2,n=L2,r=q2,s=$2,o={},l=mu("start","drag","end"),u=0,c,p,h,f,g=0;function y(C){C.on("mousedown.drag",x).filter(s).on("touchstart.drag",S).on("touchmove.drag",b,P2).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(C,T){if(!(f||!e.call(this,C,T))){var M=E(this,n.call(this,C,T),C,T,"mouse");M&&(Pn(C.view).on("mousemove.drag",N,aa).on("mouseup.drag",_,aa),LE(C.view),vd(C),h=!1,c=C.clientX,p=C.clientY,M("start",C))}}function N(C){if(Js(C),!h){var T=C.clientX-c,M=C.clientY-p;h=T*T+M*M>g}o.mouse("drag",C)}function _(C){Pn(C.view).on("mousemove.drag mouseup.drag",null),qE(C.view,h),Js(C),o.mouse("end",C)}function S(C,T){if(e.call(this,C,T)){var M=C.changedTouches,L=n.call(this,C,T),H=M.length,O,P;for(O=0;O<H;++O)(P=E(this,L,C,T,M[O].identifier,M[O]))&&(vd(C),P("start",C,M[O]))}}function b(C){var T=C.changedTouches,M=T.length,L,H;for(L=0;L<M;++L)(H=o[T[L].identifier])&&(Js(C),H("drag",C,T[L]))}function k(C){var T=C.changedTouches,M=T.length,L,H;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),L=0;L<M;++L)(H=o[T[L].identifier])&&(vd(C),H("end",C,T[L]))}function E(C,T,M,L,H,O){var P=l.copy(),F=er(O||M,T),G,q,j;if((j=r.call(C,new Kg("beforestart",{sourceEvent:M,target:y,identifier:H,active:u,x:F[0],y:F[1],dx:0,dy:0,dispatch:P}),L))!=null)return G=j.x-F[0]||0,q=j.y-F[1]||0,function Q(z,ne,Z){var $=F,K;switch(z){case"start":o[H]=Q,K=u++;break;case"end":delete o[H],--u;case"drag":F=er(Z||ne,T),K=u;break}P.call(z,C,new Kg(z,{sourceEvent:ne,subject:j,target:y,identifier:H,active:K,x:F[0]+G,y:F[1]+q,dx:F[0]-$[0],dy:F[1]-$[1],dispatch:P}),L)}}return y.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Pl(!!C),y):e},y.container=function(C){return arguments.length?(n=typeof C=="function"?C:Pl(C),y):n},y.subject=function(C){return arguments.length?(r=typeof C=="function"?C:Pl(C),y):r},y.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Pl(!!C),y):s},y.on=function(){var C=l.on.apply(l,arguments);return C===l?y:C},y.clickDistance=function(C){return arguments.length?(g=(C=+C)*C,y):Math.sqrt(g)},y}function kv(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function $E(e,n){var r=Object.create(e.prototype);for(var s in n)r[s]=n[s];return r}function wa(){}var la=.7,ru=1/la,eo="\\s*([+-]?\\d+)\\s*",ua="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F2=/^#([0-9a-f]{3,8})$/,z2=new RegExp(`^rgb\\(${eo},${eo},${eo}\\)$`),B2=new RegExp(`^rgb\\(${yr},${yr},${yr}\\)$`),U2=new RegExp(`^rgba\\(${eo},${eo},${eo},${ua}\\)$`),H2=new RegExp(`^rgba\\(${yr},${yr},${yr},${ua}\\)$`),W2=new RegExp(`^hsl\\(${ua},${yr},${yr}\\)$`),V2=new RegExp(`^hsla\\(${ua},${yr},${yr},${ua}\\)$`),Ow={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};kv(wa,ca,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lw,formatHex:Lw,formatHex8:G2,formatHsl:Y2,formatRgb:qw,toString:qw});function Lw(){return this.rgb().formatHex()}function G2(){return this.rgb().formatHex8()}function Y2(){return DE(this).formatHsl()}function qw(){return this.rgb().formatRgb()}function ca(e){var n,r;return e=(e+"").trim().toLowerCase(),(n=F2.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?$w(n):r===3?new ln(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?Ol(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?Ol(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=z2.exec(e))?new ln(n[1],n[2],n[3],1):(n=B2.exec(e))?new ln(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=U2.exec(e))?Ol(n[1],n[2],n[3],n[4]):(n=H2.exec(e))?Ol(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=W2.exec(e))?zw(n[1],n[2]/100,n[3]/100,1):(n=V2.exec(e))?zw(n[1],n[2]/100,n[3]/100,n[4]):Ow.hasOwnProperty(e)?$w(Ow[e]):e==="transparent"?new ln(NaN,NaN,NaN,0):null}function $w(e){return new ln(e>>16&255,e>>8&255,e&255,1)}function Ol(e,n,r,s){return s<=0&&(e=n=r=NaN),new ln(e,n,r,s)}function K2(e){return e instanceof wa||(e=ca(e)),e?(e=e.rgb(),new ln(e.r,e.g,e.b,e.opacity)):new ln}function Xg(e,n,r,s){return arguments.length===1?K2(e):new ln(e,n,r,s??1)}function ln(e,n,r,s){this.r=+e,this.g=+n,this.b=+r,this.opacity=+s}kv(ln,Xg,$E(wa,{brighter(e){return e=e==null?ru:Math.pow(ru,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?la:Math.pow(la,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ln(rs(this.r),rs(this.g),rs(this.b),iu(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:Dw,formatHex:Dw,formatHex8:X2,formatRgb:Fw,toString:Fw}));function Dw(){return`#${ts(this.r)}${ts(this.g)}${ts(this.b)}`}function X2(){return`#${ts(this.r)}${ts(this.g)}${ts(this.b)}${ts((isNaN(this.opacity)?1:this.opacity)*255)}`}function Fw(){const e=iu(this.opacity);return`${e===1?"rgb(":"rgba("}${rs(this.r)}, ${rs(this.g)}, ${rs(this.b)}${e===1?")":`, ${e})`}`}function iu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ts(e){return e=rs(e),(e<16?"0":"")+e.toString(16)}function zw(e,n,r,s){return s<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new tr(e,n,r,s)}function DE(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof wa||(e=ca(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var n=e.r/255,r=e.g/255,s=e.b/255,o=Math.min(n,r,s),l=Math.max(n,r,s),u=NaN,c=l-o,p=(l+o)/2;return c?(n===l?u=(r-s)/c+(r<s)*6:r===l?u=(s-n)/c+2:u=(n-r)/c+4,c/=p<.5?l+o:2-l-o,u*=60):c=p>0&&p<1?0:u,new tr(u,c,p,e.opacity)}function Q2(e,n,r,s){return arguments.length===1?DE(e):new tr(e,n,r,s??1)}function tr(e,n,r,s){this.h=+e,this.s=+n,this.l=+r,this.opacity=+s}kv(tr,Q2,$E(wa,{brighter(e){return e=e==null?ru:Math.pow(ru,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?la:Math.pow(la,e),new tr(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,s=r+(r<.5?r:1-r)*n,o=2*r-s;return new ln(yd(e>=240?e-240:e+120,o,s),yd(e,o,s),yd(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new tr(Bw(this.h),Ll(this.s),Ll(this.l),iu(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=iu(this.opacity);return`${e===1?"hsl(":"hsla("}${Bw(this.h)}, ${Ll(this.s)*100}%, ${Ll(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bw(e){return e=(e||0)%360,e<0?e+360:e}function Ll(e){return Math.max(0,Math.min(1,e||0))}function yd(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 FE=e=>()=>e;function Z2(e,n){return function(r){return e+r*n}}function J2(e,n,r){return e=Math.pow(e,r),n=Math.pow(n,r)-e,r=1/r,function(s){return Math.pow(e+s*n,r)}}function eA(e){return(e=+e)==1?zE:function(n,r){return r-n?J2(n,r,e):FE(isNaN(n)?r:n)}}function zE(e,n){var r=n-e;return r?Z2(e,r):FE(isNaN(e)?n:e)}const Uw=(function e(n){var r=eA(n);function s(o,l){var u=r((o=Xg(o)).r,(l=Xg(l)).r),c=r(o.g,l.g),p=r(o.b,l.b),h=zE(o.opacity,l.opacity);return function(f){return o.r=u(f),o.g=c(f),o.b=p(f),o.opacity=h(f),o+""}}return s.gamma=e,s})(1);function pi(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}var Qg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wd=new RegExp(Qg.source,"g");function tA(e){return function(){return e}}function nA(e){return function(n){return e(n)+""}}function rA(e,n){var r=Qg.lastIndex=wd.lastIndex=0,s,o,l,u=-1,c=[],p=[];for(e=e+"",n=n+"";(s=Qg.exec(e))&&(o=wd.exec(n));)(l=o.index)>r&&(l=n.slice(r,l),c[u]?c[u]+=l:c[++u]=l),(s=s[0])===(o=o[0])?c[u]?c[u]+=o:c[++u]=o:(c[++u]=null,p.push({i:u,x:pi(s,o)})),r=wd.lastIndex;return r<n.length&&(l=n.slice(r),c[u]?c[u]+=l:c[++u]=l),c.length<2?p[0]?nA(p[0].x):tA(n):(n=p.length,function(h){for(var f=0,g;f<n;++f)c[(g=p[f]).i]=g.x(h);return c.join("")})}var Hw=180/Math.PI,Zg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function BE(e,n,r,s,o,l){var u,c,p;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(p=e*r+n*s)&&(r-=e*p,s-=n*p),(c=Math.sqrt(r*r+s*s))&&(r/=c,s/=c,p/=c),e*s<n*r&&(e=-e,n=-n,p=-p,u=-u),{translateX:o,translateY:l,rotate:Math.atan2(n,e)*Hw,skewX:Math.atan(p)*Hw,scaleX:u,scaleY:c}}var ql;function iA(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Zg:BE(n.a,n.b,n.c,n.d,n.e,n.f)}function sA(e){return e==null||(ql||(ql=document.createElementNS("http://www.w3.org/2000/svg","g")),ql.setAttribute("transform",e),!(e=ql.transform.baseVal.consolidate()))?Zg:(e=e.matrix,BE(e.a,e.b,e.c,e.d,e.e,e.f))}function UE(e,n,r,s){function o(h){return h.length?h.pop()+" ":""}function l(h,f,g,y,x,N){if(h!==g||f!==y){var _=x.push("translate(",null,n,null,r);N.push({i:_-4,x:pi(h,g)},{i:_-2,x:pi(f,y)})}else(g||y)&&x.push("translate("+g+n+y+r)}function u(h,f,g,y){h!==f?(h-f>180?f+=360:f-h>180&&(h+=360),y.push({i:g.push(o(g)+"rotate(",null,s)-2,x:pi(h,f)})):f&&g.push(o(g)+"rotate("+f+s)}function c(h,f,g,y){h!==f?y.push({i:g.push(o(g)+"skewX(",null,s)-2,x:pi(h,f)}):f&&g.push(o(g)+"skewX("+f+s)}function p(h,f,g,y,x,N){if(h!==g||f!==y){var _=x.push(o(x)+"scale(",null,",",null,")");N.push({i:_-4,x:pi(h,g)},{i:_-2,x:pi(f,y)})}else(g!==1||y!==1)&&x.push(o(x)+"scale("+g+","+y+")")}return function(h,f){var g=[],y=[];return h=e(h),f=e(f),l(h.translateX,h.translateY,f.translateX,f.translateY,g,y),u(h.rotate,f.rotate,g,y),c(h.skewX,f.skewX,g,y),p(h.scaleX,h.scaleY,f.scaleX,f.scaleY,g,y),h=f=null,function(x){for(var N=-1,_=y.length,S;++N<_;)g[(S=y[N]).i]=S.x(x);return g.join("")}}}var oA=UE(iA,"px, ","px)","deg)"),aA=UE(sA,", ",")",")"),lA=1e-12;function Ww(e){return((e=Math.exp(e))+1/e)/2}function uA(e){return((e=Math.exp(e))-1/e)/2}function cA(e){return((e=Math.exp(2*e))-1)/(e+1)}const dA=(function e(n,r,s){function o(l,u){var c=l[0],p=l[1],h=l[2],f=u[0],g=u[1],y=u[2],x=f-c,N=g-p,_=x*x+N*N,S,b;if(_<lA)b=Math.log(y/h)/n,S=function(L){return[c+L*x,p+L*N,h*Math.exp(n*L*b)]};else{var k=Math.sqrt(_),E=(y*y-h*h+s*_)/(2*h*r*k),C=(y*y-h*h-s*_)/(2*y*r*k),T=Math.log(Math.sqrt(E*E+1)-E),M=Math.log(Math.sqrt(C*C+1)-C);b=(M-T)/n,S=function(L){var H=L*b,O=Ww(T),P=h/(r*k)*(O*cA(n*H+T)-uA(T));return[c+P*x,p+P*N,h*O/Ww(n*H+T)]}}return S.duration=b*1e3*n/Math.SQRT2,S}return o.rho=function(l){var u=Math.max(.001,+l),c=u*u,p=c*c;return e(u,c,p)},o})(Math.SQRT2,2,4);var io=0,na=0,Xo=0,HE=1e3,su,ra,ou=0,ss=0,vu=0,da=typeof performance=="object"&&performance.now?performance:Date,WE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ev(){return ss||(WE(fA),ss=da.now()+vu)}function fA(){ss=0}function au(){this._call=this._time=this._next=null}au.prototype=VE.prototype={constructor:au,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Ev():+r)+(n==null?0:+n),!this._next&&ra!==this&&(ra?ra._next=this:su=this,ra=this),this._call=e,this._time=r,Jg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jg())}};function VE(e,n,r){var s=new au;return s.restart(e,n,r),s}function hA(){Ev(),++io;for(var e=su,n;e;)(n=ss-e._time)>=0&&e._call.call(void 0,n),e=e._next;--io}function Vw(){ss=(ou=da.now())+vu,io=na=0;try{hA()}finally{io=0,mA(),ss=0}}function pA(){var e=da.now(),n=e-ou;n>HE&&(vu-=n,ou=e)}function mA(){for(var e,n=su,r,s=1/0;n;)n._call?(s>n._time&&(s=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:su=r);ra=e,Jg(s)}function Jg(e){if(!io){na&&(na=clearTimeout(na));var n=e-ss;n>24?(e<1/0&&(na=setTimeout(Vw,e-da.now()-vu)),Xo&&(Xo=clearInterval(Xo))):(Xo||(ou=da.now(),Xo=setInterval(pA,HE)),io=1,WE(Vw))}}function Gw(e,n,r){var s=new au;return n=n==null?0:+n,s.restart(o=>{s.stop(),e(o+n)},n,r),s}var gA=mu("start","end","cancel","interrupt"),vA=[],GE=0,Yw=1,ev=2,Zl=3,Kw=4,tv=5,Jl=6;function yu(e,n,r,s,o,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;yA(e,r,{name:n,index:s,group:o,on:gA,tween:vA,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:GE})}function Nv(e,n){var r=ir(e,n);if(r.state>GE)throw new Error("too late; already scheduled");return r}function wr(e,n){var r=ir(e,n);if(r.state>Zl)throw new Error("too late; already running");return r}function ir(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function yA(e,n,r){var s=e.__transition,o;s[n]=r,r.timer=VE(l,0,r.time);function l(h){r.state=Yw,r.timer.restart(u,r.delay,r.time),r.delay<=h&&u(h-r.delay)}function u(h){var f,g,y,x;if(r.state!==Yw)return p();for(f in s)if(x=s[f],x.name===r.name){if(x.state===Zl)return Gw(u);x.state===Kw?(x.state=Jl,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[f]):+f<n&&(x.state=Jl,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[f])}if(Gw(function(){r.state===Zl&&(r.state=Kw,r.timer.restart(c,r.delay,r.time),c(h))}),r.state=ev,r.on.call("start",e,e.__data__,r.index,r.group),r.state===ev){for(r.state=Zl,o=new Array(y=r.tween.length),f=0,g=-1;f<y;++f)(x=r.tween[f].value.call(e,e.__data__,r.index,r.group))&&(o[++g]=x);o.length=g+1}}function c(h){for(var f=h<r.duration?r.ease.call(null,h/r.duration):(r.timer.restart(p),r.state=tv,1),g=-1,y=o.length;++g<y;)o[g].call(e,f);r.state===tv&&(r.on.call("end",e,e.__data__,r.index,r.group),p())}function p(){r.state=Jl,r.timer.stop(),delete s[n];for(var h in s)return;delete e.__transition}}function eu(e,n){var r=e.__transition,s,o,l=!0,u;if(r){n=n==null?null:n+"";for(u in r){if((s=r[u]).name!==n){l=!1;continue}o=s.state>ev&&s.state<tv,s.state=Jl,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[u]}l&&delete e.__transition}}function wA(e){return this.each(function(){eu(this,e)})}function xA(e,n){var r,s;return function(){var o=wr(this,e),l=o.tween;if(l!==r){s=r=l;for(var u=0,c=s.length;u<c;++u)if(s[u].name===n){s=s.slice(),s.splice(u,1);break}}o.tween=s}}function _A(e,n,r){var s,o;if(typeof r!="function")throw new Error;return function(){var l=wr(this,e),u=l.tween;if(u!==s){o=(s=u).slice();for(var c={name:n,value:r},p=0,h=o.length;p<h;++p)if(o[p].name===n){o[p]=c;break}p===h&&o.push(c)}l.tween=o}}function bA(e,n){var r=this._id;if(e+="",arguments.length<2){for(var s=ir(this.node(),r).tween,o=0,l=s.length,u;o<l;++o)if((u=s[o]).name===e)return u.value;return null}return this.each((n==null?xA:_A)(r,e,n))}function Cv(e,n,r){var s=e._id;return e.each(function(){var o=wr(this,s);(o.value||(o.value={}))[n]=r.apply(this,arguments)}),function(o){return ir(o,s).value[n]}}function YE(e,n){var r;return(typeof n=="number"?pi:n instanceof ca?Uw:(r=ca(n))?(n=r,Uw):rA)(e,n)}function SA(e){return function(){this.removeAttribute(e)}}function kA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function EA(e,n,r){var s,o=r+"",l;return function(){var u=this.getAttribute(e);return u===o?null:u===s?l:l=n(s=u,r)}}function NA(e,n,r){var s,o=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===s?l:l=n(s=u,r)}}function CA(e,n,r){var s,o,l;return function(){var u,c=r(this),p;return c==null?void this.removeAttribute(e):(u=this.getAttribute(e),p=c+"",u===p?null:u===s&&p===o?l:(o=p,l=n(s=u,c)))}}function RA(e,n,r){var s,o,l;return function(){var u,c=r(this),p;return c==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),p=c+"",u===p?null:u===s&&p===o?l:(o=p,l=n(s=u,c)))}}function jA(e,n){var r=gu(e),s=r==="transform"?aA:YE;return this.attrTween(e,typeof n=="function"?(r.local?RA:CA)(r,s,Cv(this,"attr."+e,n)):n==null?(r.local?kA:SA)(r):(r.local?NA:EA)(r,s,n))}function TA(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function AA(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function IA(e,n){var r,s;function o(){var l=n.apply(this,arguments);return l!==s&&(r=(s=l)&&AA(e,l)),r}return o._value=n,o}function MA(e,n){var r,s;function o(){var l=n.apply(this,arguments);return l!==s&&(r=(s=l)&&TA(e,l)),r}return o._value=n,o}function PA(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 s=gu(e);return this.tween(r,(s.local?IA:MA)(s,n))}function OA(e,n){return function(){Nv(this,e).delay=+n.apply(this,arguments)}}function LA(e,n){return n=+n,function(){Nv(this,e).delay=n}}function qA(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?OA:LA)(n,e)):ir(this.node(),n).delay}function $A(e,n){return function(){wr(this,e).duration=+n.apply(this,arguments)}}function DA(e,n){return n=+n,function(){wr(this,e).duration=n}}function FA(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?$A:DA)(n,e)):ir(this.node(),n).duration}function zA(e,n){if(typeof n!="function")throw new Error;return function(){wr(this,e).ease=n}}function BA(e){var n=this._id;return arguments.length?this.each(zA(n,e)):ir(this.node(),n).ease}function UA(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;wr(this,e).ease=r}}function HA(e){if(typeof e!="function")throw new Error;return this.each(UA(this._id,e))}function WA(e){typeof e!="function"&&(e=NE(e));for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o)for(var l=n[o],u=l.length,c=s[o]=[],p,h=0;h<u;++h)(p=l[h])&&e.call(p,p.__data__,h,l)&&c.push(p);return new $r(s,this._parents,this._name,this._id)}function VA(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,s=n.length,o=r.length,l=Math.min(s,o),u=new Array(s),c=0;c<l;++c)for(var p=n[c],h=r[c],f=p.length,g=u[c]=new Array(f),y,x=0;x<f;++x)(y=p[x]||h[x])&&(g[x]=y);for(;c<s;++c)u[c]=n[c];return new $r(u,this._parents,this._name,this._id)}function GA(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 YA(e,n,r){var s,o,l=GA(n)?Nv:wr;return function(){var u=l(this,e),c=u.on;c!==s&&(o=(s=c).copy()).on(n,r),u.on=o}}function KA(e,n){var r=this._id;return arguments.length<2?ir(this.node(),r).on.on(e):this.each(YA(r,e,n))}function XA(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function QA(){return this.on("end.remove",XA(this._id))}function ZA(e){var n=this._name,r=this._id;typeof e!="function"&&(e=bv(e));for(var s=this._groups,o=s.length,l=new Array(o),u=0;u<o;++u)for(var c=s[u],p=c.length,h=l[u]=new Array(p),f,g,y=0;y<p;++y)(f=c[y])&&(g=e.call(f,f.__data__,y,c))&&("__data__"in f&&(g.__data__=f.__data__),h[y]=g,yu(h[y],n,r,y,h,ir(f,r)));return new $r(l,this._parents,n,r)}function JA(e){var n=this._name,r=this._id;typeof e!="function"&&(e=EE(e));for(var s=this._groups,o=s.length,l=[],u=[],c=0;c<o;++c)for(var p=s[c],h=p.length,f,g=0;g<h;++g)if(f=p[g]){for(var y=e.call(f,f.__data__,g,p),x,N=ir(f,r),_=0,S=y.length;_<S;++_)(x=y[_])&&yu(x,n,r,_,y,N);l.push(y),u.push(f)}return new $r(l,u,n,r)}var eI=ya.prototype.constructor;function tI(){return new eI(this._groups,this._parents)}function nI(e,n){var r,s,o;return function(){var l=ro(this,e),u=(this.style.removeProperty(e),ro(this,e));return l===u?null:l===r&&u===s?o:o=n(r=l,s=u)}}function KE(e){return function(){this.style.removeProperty(e)}}function rI(e,n,r){var s,o=r+"",l;return function(){var u=ro(this,e);return u===o?null:u===s?l:l=n(s=u,r)}}function iI(e,n,r){var s,o,l;return function(){var u=ro(this,e),c=r(this),p=c+"";return c==null&&(p=c=(this.style.removeProperty(e),ro(this,e))),u===p?null:u===s&&p===o?l:(o=p,l=n(s=u,c))}}function sI(e,n){var r,s,o,l="style."+n,u="end."+l,c;return function(){var p=wr(this,e),h=p.on,f=p.value[l]==null?c||(c=KE(n)):void 0;(h!==r||o!==f)&&(s=(r=h).copy()).on(u,o=f),p.on=s}}function oI(e,n,r){var s=(e+="")=="transform"?oA:YE;return n==null?this.styleTween(e,nI(e,s)).on("end.style."+e,KE(e)):typeof n=="function"?this.styleTween(e,iI(e,s,Cv(this,"style."+e,n))).each(sI(this._id,e)):this.styleTween(e,rI(e,s,n),r).on("end.style."+e,null)}function aI(e,n,r){return function(s){this.style.setProperty(e,n.call(this,s),r)}}function lI(e,n,r){var s,o;function l(){var u=n.apply(this,arguments);return u!==o&&(s=(o=u)&&aI(e,u,r)),s}return l._value=n,l}function uI(e,n,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;return this.tween(s,lI(e,n,r??""))}function cI(e){return function(){this.textContent=e}}function dI(e){return function(){var n=e(this);this.textContent=n??""}}function fI(e){return this.tween("text",typeof e=="function"?dI(Cv(this,"text",e)):cI(e==null?"":e+""))}function hI(e){return function(n){this.textContent=e.call(this,n)}}function pI(e){var n,r;function s(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&hI(o)),n}return s._value=e,s}function mI(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,pI(e))}function gI(){for(var e=this._name,n=this._id,r=XE(),s=this._groups,o=s.length,l=0;l<o;++l)for(var u=s[l],c=u.length,p,h=0;h<c;++h)if(p=u[h]){var f=ir(p,n);yu(p,e,r,h,u,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new $r(s,this._parents,e,r)}function vI(){var e,n,r=this,s=r._id,o=r.size();return new Promise(function(l,u){var c={value:u},p={value:function(){--o===0&&l()}};r.each(function(){var h=wr(this,s),f=h.on;f!==e&&(n=(e=f).copy(),n._.cancel.push(c),n._.interrupt.push(c),n._.end.push(p)),h.on=n}),o===0&&l()})}var yI=0;function $r(e,n,r,s){this._groups=e,this._parents=n,this._name=r,this._id=s}function XE(){return++yI}var Or=ya.prototype;$r.prototype={constructor:$r,select:ZA,selectAll:JA,selectChild:Or.selectChild,selectChildren:Or.selectChildren,filter:WA,merge:VA,selection:tI,transition:gI,call:Or.call,nodes:Or.nodes,node:Or.node,size:Or.size,empty:Or.empty,each:Or.each,on:KA,attr:jA,attrTween:PA,style:oI,styleTween:uI,text:fI,textTween:mI,remove:QA,tween:bA,delay:qA,duration:FA,ease:BA,easeVarying:HA,end:vI,[Symbol.iterator]:Or[Symbol.iterator]};function wI(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var xI={time:null,delay:0,duration:250,ease:wI};function _I(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 bI(e){var n,r;e instanceof $r?(n=e._id,e=e._name):(n=XE(),(r=xI).time=Ev(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,l=0;l<o;++l)for(var u=s[l],c=u.length,p,h=0;h<c;++h)(p=u[h])&&yu(p,e,n,h,u,r||_I(p,n));return new $r(s,this._parents,e,n)}ya.prototype.interrupt=wA;ya.prototype.transition=bI;const $l=e=>()=>e;function SI(e,{sourceEvent:n,target:r,transform:s,dispatch:o}){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:s,enumerable:!0,configurable:!0},_:{value:o}})}function Lr(e,n,r){this.k=e,this.x=n,this.y=r}Lr.prototype={constructor:Lr,scale:function(e){return e===1?this:new Lr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Lr(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 qr=new Lr(1,0,0);Lr.prototype;function xd(e){e.stopImmediatePropagation()}function Qo(e){e.preventDefault(),e.stopImmediatePropagation()}function kI(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function EI(){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 Xw(){return this.__zoom||qr}function NI(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function CI(){return navigator.maxTouchPoints||"ontouchstart"in this}function RI(e,n,r){var s=e.invertX(n[0][0])-r[0][0],o=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(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function QE(){var e=kI,n=EI,r=RI,s=NI,o=CI,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,p=dA,h=mu("start","zoom","end"),f,g,y,x=500,N=150,_=0,S=10;function b(j){j.property("__zoom",Xw).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",P).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(j,Q,z,ne){var Z=j.selection?j.selection():j;Z.property("__zoom",Xw),j!==Z?T(j,Q,z,ne):Z.interrupt().each(function(){M(this,arguments).event(ne).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},b.scaleBy=function(j,Q,z,ne){b.scaleTo(j,function(){var Z=this.__zoom.k,$=typeof Q=="function"?Q.apply(this,arguments):Q;return Z*$},z,ne)},b.scaleTo=function(j,Q,z,ne){b.transform(j,function(){var Z=n.apply(this,arguments),$=this.__zoom,K=z==null?C(Z):typeof z=="function"?z.apply(this,arguments):z,I=$.invert(K),W=typeof Q=="function"?Q.apply(this,arguments):Q;return r(E(k($,W),K,I),Z,u)},z,ne)},b.translateBy=function(j,Q,z,ne){b.transform(j,function(){return r(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof z=="function"?z.apply(this,arguments):z),n.apply(this,arguments),u)},null,ne)},b.translateTo=function(j,Q,z,ne,Z){b.transform(j,function(){var $=n.apply(this,arguments),K=this.__zoom,I=ne==null?C($):typeof ne=="function"?ne.apply(this,arguments):ne;return r(qr.translate(I[0],I[1]).scale(K.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof z=="function"?-z.apply(this,arguments):-z),$,u)},ne,Z)};function k(j,Q){return Q=Math.max(l[0],Math.min(l[1],Q)),Q===j.k?j:new Lr(Q,j.x,j.y)}function E(j,Q,z){var ne=Q[0]-z[0]*j.k,Z=Q[1]-z[1]*j.k;return ne===j.x&&Z===j.y?j:new Lr(j.k,ne,Z)}function C(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function T(j,Q,z,ne){j.on("start.zoom",function(){M(this,arguments).event(ne).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(ne).end()}).tween("zoom",function(){var Z=this,$=arguments,K=M(Z,$).event(ne),I=n.apply(Z,$),W=z==null?C(I):typeof z=="function"?z.apply(Z,$):z,X=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),U=Z.__zoom,J=typeof Q=="function"?Q.apply(Z,$):Q,re=p(U.invert(W).concat(X/U.k),J.invert(W).concat(X/J.k));return function(le){if(le===1)le=J;else{var de=re(le),te=X/de[2];le=new Lr(te,W[0]-de[0]*te,W[1]-de[1]*te)}K.zoom(null,le)}})}function M(j,Q,z){return!z&&j.__zooming||new L(j,Q)}function L(j,Q){this.that=j,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=n.apply(j,Q),this.taps=0}L.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,Q){return this.mouse&&j!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var Q=Pn(this.that).datum();h.call(j,this.that,new SI(j,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:h}),Q)}};function H(j,...Q){if(!e.apply(this,arguments))return;var z=M(this,Q).event(j),ne=this.__zoom,Z=Math.max(l[0],Math.min(l[1],ne.k*Math.pow(2,s.apply(this,arguments)))),$=er(j);if(z.wheel)(z.mouse[0][0]!==$[0]||z.mouse[0][1]!==$[1])&&(z.mouse[1]=ne.invert(z.mouse[0]=$)),clearTimeout(z.wheel);else{if(ne.k===Z)return;z.mouse=[$,ne.invert($)],eu(this),z.start()}Qo(j),z.wheel=setTimeout(K,N),z.zoom("mouse",r(E(k(ne,Z),z.mouse[0],z.mouse[1]),z.extent,u));function K(){z.wheel=null,z.end()}}function O(j,...Q){if(y||!e.apply(this,arguments))return;var z=j.currentTarget,ne=M(this,Q,!0).event(j),Z=Pn(j.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",X,!0),$=er(j,z),K=j.clientX,I=j.clientY;LE(j.view),xd(j),ne.mouse=[$,this.__zoom.invert($)],eu(this),ne.start();function W(U){if(Qo(U),!ne.moved){var J=U.clientX-K,re=U.clientY-I;ne.moved=J*J+re*re>_}ne.event(U).zoom("mouse",r(E(ne.that.__zoom,ne.mouse[0]=er(U,z),ne.mouse[1]),ne.extent,u))}function X(U){Z.on("mousemove.zoom mouseup.zoom",null),qE(U.view,ne.moved),Qo(U),ne.event(U).end()}}function P(j,...Q){if(e.apply(this,arguments)){var z=this.__zoom,ne=er(j.changedTouches?j.changedTouches[0]:j,this),Z=z.invert(ne),$=z.k*(j.shiftKey?.5:2),K=r(E(k(z,$),ne,Z),n.apply(this,Q),u);Qo(j),c>0?Pn(this).transition().duration(c).call(T,K,ne,j):Pn(this).call(b.transform,K,ne,j)}}function F(j,...Q){if(e.apply(this,arguments)){var z=j.touches,ne=z.length,Z=M(this,Q,j.changedTouches.length===ne).event(j),$,K,I,W;for(xd(j),K=0;K<ne;++K)I=z[K],W=er(I,this),W=[W,this.__zoom.invert(W),I.identifier],Z.touch0?!Z.touch1&&Z.touch0[2]!==W[2]&&(Z.touch1=W,Z.taps=0):(Z.touch0=W,$=!0,Z.taps=1+!!f);f&&(f=clearTimeout(f)),$&&(Z.taps<2&&(g=W[0],f=setTimeout(function(){f=null},x)),eu(this),Z.start())}}function G(j,...Q){if(this.__zooming){var z=M(this,Q).event(j),ne=j.changedTouches,Z=ne.length,$,K,I,W;for(Qo(j),$=0;$<Z;++$)K=ne[$],I=er(K,this),z.touch0&&z.touch0[2]===K.identifier?z.touch0[0]=I:z.touch1&&z.touch1[2]===K.identifier&&(z.touch1[0]=I);if(K=z.that.__zoom,z.touch1){var X=z.touch0[0],U=z.touch0[1],J=z.touch1[0],re=z.touch1[1],le=(le=J[0]-X[0])*le+(le=J[1]-X[1])*le,de=(de=re[0]-U[0])*de+(de=re[1]-U[1])*de;K=k(K,Math.sqrt(le/de)),I=[(X[0]+J[0])/2,(X[1]+J[1])/2],W=[(U[0]+re[0])/2,(U[1]+re[1])/2]}else if(z.touch0)I=z.touch0[0],W=z.touch0[1];else return;z.zoom("touch",r(E(K,I,W),z.extent,u))}}function q(j,...Q){if(this.__zooming){var z=M(this,Q).event(j),ne=j.changedTouches,Z=ne.length,$,K;for(xd(j),y&&clearTimeout(y),y=setTimeout(function(){y=null},x),$=0;$<Z;++$)K=ne[$],z.touch0&&z.touch0[2]===K.identifier?delete z.touch0:z.touch1&&z.touch1[2]===K.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(K=er(K,this),Math.hypot(g[0]-K[0],g[1]-K[1])<S)){var I=Pn(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return b.wheelDelta=function(j){return arguments.length?(s=typeof j=="function"?j:$l(+j),b):s},b.filter=function(j){return arguments.length?(e=typeof j=="function"?j:$l(!!j),b):e},b.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:$l(!!j),b):o},b.extent=function(j){return arguments.length?(n=typeof j=="function"?j:$l([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),b):n},b.scaleExtent=function(j){return arguments.length?(l[0]=+j[0],l[1]=+j[1],b):[l[0],l[1]]},b.translateExtent=function(j){return arguments.length?(u[0][0]=+j[0][0],u[1][0]=+j[1][0],u[0][1]=+j[0][1],u[1][1]=+j[1][1],b):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},b.constrain=function(j){return arguments.length?(r=j,b):r},b.duration=function(j){return arguments.length?(c=+j,b):c},b.interpolate=function(j){return arguments.length?(p=j,b):p},b.on=function(){var j=h.on.apply(h,arguments);return j===h?b:j},b.clickDistance=function(j){return arguments.length?(_=(j=+j)*j,b):Math.sqrt(_)},b.tapDistance=function(j){return arguments.length?(S=+j,b):S},b}var jI=bE();const wu=A.createContext(null),TI=wu.Provider,Dr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,n)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?n.targetHandle:n.sourceHandle}", edge id: ${n.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},ZE=Dr.error001();function Ke(e,n){const r=A.useContext(wu);if(r===null)throw new Error(ZE);return SE(r,e,n)}const jt=()=>{const e=A.useContext(wu);if(e===null)throw new Error(ZE);return A.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},AI=e=>e.userSelectionActive?"none":"all";function Rv({position:e,children:n,className:r,style:s,...o}){const l=Ke(AI),u=`${e}`.split("-");return ue.createElement("div",{className:Ft(["react-flow__panel",r,...u]),style:{...s,pointerEvents:l},...o},n)}function II({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:ue.createElement(Rv,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ue.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const MI=({x:e,y:n,label:r,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:l={},labelBgPadding:u=[2,4],labelBgBorderRadius:c=2,children:p,className:h,...f})=>{const g=A.useRef(null),[y,x]=A.useState({x:0,y:0,width:0,height:0}),N=Ft(["react-flow__edge-textwrapper",h]);return A.useEffect(()=>{if(g.current){const _=g.current.getBBox();x({x:_.x,y:_.y,width:_.width,height:_.height})}},[r]),typeof r>"u"||!r?null:ue.createElement("g",{transform:`translate(${e-y.width/2} ${n-y.height/2})`,className:N,visibility:y.width?"visible":"hidden",...f},o&&ue.createElement("rect",{width:y.width+2*u[0],x:-u[0],y:-u[1],height:y.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:c,ry:c}),ue.createElement("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:g,style:s},r),p)};var PI=A.memo(MI);const jv=e=>({width:e.offsetWidth,height:e.offsetHeight}),so=(e,n=0,r=1)=>Math.min(Math.max(e,n),r),Tv=(e={x:0,y:0},n)=>({x:so(e.x,n[0][0],n[1][0]),y:so(e.y,n[0][1],n[1][1])}),Qw=(e,n,r)=>e<n?so(Math.abs(e-n),1,50)/50:e>r?-so(Math.abs(e-r),1,50)/50:0,JE=(e,n)=>{const r=Qw(e.x,35,n.width-35)*20,s=Qw(e.y,35,n.height-35)*20;return[r,s]},eN=e=>{var n;return((n=e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},tN=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),fa=({x:e,y:n,width:r,height:s})=>({x:e,y:n,x2:e+r,y2:n+s}),nN=({x:e,y:n,x2:r,y2:s})=>({x:e,y:n,width:r-e,height:s-n}),Zw=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),OI=(e,n)=>nN(tN(fa(e),fa(n))),nv=(e,n)=>{const r=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),s=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(r*s)},LI=e=>On(e.width)&&On(e.height)&&On(e.x)&&On(e.y),On=e=>!isNaN(e)&&isFinite(e),pt=Symbol.for("internals"),rN=["Enter"," ","Escape"],qI=(e,n)=>{},$I=e=>"nativeEvent"in e;function rv(e){var o,l;const n=$I(e)?e.nativeEvent:e,r=((l=(o=n.composedPath)==null?void 0:o.call(n))==null?void 0:l[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(r==null?void 0:r.nodeName)||(r==null?void 0:r.hasAttribute("contenteditable"))||!!(r!=null&&r.closest(".nokey"))}const iN=e=>"clientX"in e,vi=(e,n)=>{var l,u;const r=iN(e),s=r?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,o=r?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:s-((n==null?void 0:n.left)??0),y:o-((n==null?void 0:n.top)??0)}},lu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},xa=({id:e,path:n,labelX:r,labelY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:p,labelBgBorderRadius:h,style:f,markerEnd:g,markerStart:y,interactionWidth:x=20})=>ue.createElement(ue.Fragment,null,ue.createElement("path",{id:e,style:f,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:g,markerStart:y}),x&&ue.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),o&&On(r)&&On(s)?ue.createElement(PI,{x:r,y:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:p,labelBgBorderRadius:h}):null);xa.displayName="BaseEdge";function Zo(e,n,r){return r===void 0?r:s=>{const o=n().edges.find(l=>l.id===e);o&&r(s,{...o})}}function sN({sourceX:e,sourceY:n,targetX:r,targetY:s}){const o=Math.abs(r-e)/2,l=r<e?r+o:r-o,u=Math.abs(s-n)/2,c=s<n?s+u:s-u;return[l,c,o,u]}function oN({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:c}){const p=e*.125+o*.375+u*.375+r*.125,h=n*.125+l*.375+c*.375+s*.125,f=Math.abs(p-e),g=Math.abs(h-n);return[p,h,f,g]}var os;(function(e){e.Strict="strict",e.Loose="loose"})(os||(os={}));var ns;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ns||(ns={}));var ha;(function(e){e.Partial="partial",e.Full="full"})(ha||(ha={}));var gi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(gi||(gi={}));var uu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(uu||(uu={}));var Ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ae||(Ae={}));function Jw({pos:e,x1:n,y1:r,x2:s,y2:o}){return e===Ae.Left||e===Ae.Right?[.5*(n+s),r]:[n,.5*(r+o)]}function aN({sourceX:e,sourceY:n,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:l=Ae.Top}){const[u,c]=Jw({pos:r,x1:e,y1:n,x2:s,y2:o}),[p,h]=Jw({pos:l,x1:s,y1:o,x2:e,y2:n}),[f,g,y,x]=oN({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:u,sourceControlY:c,targetControlX:p,targetControlY:h});return[`M${e},${n} C${u},${c} ${p},${h} ${s},${o}`,f,g,y,x]}const Av=A.memo(({sourceX:e,sourceY:n,targetX:r,targetY:s,sourcePosition:o=Ae.Bottom,targetPosition:l=Ae.Top,label:u,labelStyle:c,labelShowBg:p,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:x,markerStart:N,interactionWidth:_})=>{const[S,b,k]=aN({sourceX:e,sourceY:n,sourcePosition:o,targetX:r,targetY:s,targetPosition:l});return ue.createElement(xa,{path:S,labelX:b,labelY:k,label:u,labelStyle:c,labelShowBg:p,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:x,markerStart:N,interactionWidth:_})});Av.displayName="SimpleBezierEdge";const ex={[Ae.Left]:{x:-1,y:0},[Ae.Right]:{x:1,y:0},[Ae.Top]:{x:0,y:-1},[Ae.Bottom]:{x:0,y:1}},DI=({source:e,sourcePosition:n=Ae.Bottom,target:r})=>n===Ae.Left||n===Ae.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},tx=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function FI({source:e,sourcePosition:n=Ae.Bottom,target:r,targetPosition:s=Ae.Top,center:o,offset:l}){const u=ex[n],c=ex[s],p={x:e.x+u.x*l,y:e.y+u.y*l},h={x:r.x+c.x*l,y:r.y+c.y*l},f=DI({source:p,sourcePosition:n,target:h}),g=f.x!==0?"x":"y",y=f[g];let x=[],N,_;const S={x:0,y:0},b={x:0,y:0},[k,E,C,T]=sN({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(u[g]*c[g]===-1){N=o.x??k,_=o.y??E;const L=[{x:N,y:p.y},{x:N,y:h.y}],H=[{x:p.x,y:_},{x:h.x,y:_}];u[g]===y?x=g==="x"?L:H:x=g==="x"?H:L}else{const L=[{x:p.x,y:h.y}],H=[{x:h.x,y:p.y}];if(g==="x"?x=u.x===y?H:L:x=u.y===y?L:H,n===s){const q=Math.abs(e[g]-r[g]);if(q<=l){const j=Math.min(l-1,l-q);u[g]===y?S[g]=(p[g]>e[g]?-1:1)*j:b[g]=(h[g]>r[g]?-1:1)*j}}if(n!==s){const q=g==="x"?"y":"x",j=u[g]===c[q],Q=p[q]>h[q],z=p[q]<h[q];(u[g]===1&&(!j&&Q||j&&z)||u[g]!==1&&(!j&&z||j&&Q))&&(x=g==="x"?L:H)}const O={x:p.x+S.x,y:p.y+S.y},P={x:h.x+b.x,y:h.y+b.y},F=Math.max(Math.abs(O.x-x[0].x),Math.abs(P.x-x[0].x)),G=Math.max(Math.abs(O.y-x[0].y),Math.abs(P.y-x[0].y));F>=G?(N=(O.x+P.x)/2,_=x[0].y):(N=x[0].x,_=(O.y+P.y)/2)}return[[e,{x:p.x+S.x,y:p.y+S.y},...x,{x:h.x+b.x,y:h.y+b.y},r],N,_,C,T]}function zI(e,n,r,s){const o=Math.min(tx(e,n)/2,tx(n,r)/2,s),{x:l,y:u}=n;if(e.x===l&&l===r.x||e.y===u&&u===r.y)return`L${l} ${u}`;if(e.y===u){const h=e.x<r.x?-1:1,f=e.y<r.y?1:-1;return`L ${l+o*h},${u}Q ${l},${u} ${l},${u+o*f}`}const c=e.x<r.x?1:-1,p=e.y<r.y?-1:1;return`L ${l},${u+o*p}Q ${l},${u} ${l+o*c},${u}`}function iv({sourceX:e,sourceY:n,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:l=Ae.Top,borderRadius:u=5,centerX:c,centerY:p,offset:h=20}){const[f,g,y,x,N]=FI({source:{x:e,y:n},sourcePosition:r,target:{x:s,y:o},targetPosition:l,center:{x:c,y:p},offset:h});return[f.reduce((S,b,k)=>{let E="";return k>0&&k<f.length-1?E=zI(f[k-1],b,f[k+1],u):E=`${k===0?"M":"L"}${b.x} ${b.y}`,S+=E,S},""),g,y,x,N]}const xu=A.memo(({sourceX:e,sourceY:n,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:p,labelBgBorderRadius:h,style:f,sourcePosition:g=Ae.Bottom,targetPosition:y=Ae.Top,markerEnd:x,markerStart:N,pathOptions:_,interactionWidth:S})=>{const[b,k,E]=iv({sourceX:e,sourceY:n,sourcePosition:g,targetX:r,targetY:s,targetPosition:y,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset});return ue.createElement(xa,{path:b,labelX:k,labelY:E,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:p,labelBgBorderRadius:h,style:f,markerEnd:x,markerStart:N,interactionWidth:S})});xu.displayName="SmoothStepEdge";const Iv=A.memo(e=>{var n;return ue.createElement(xu,{...e,pathOptions:A.useMemo(()=>{var r;return{borderRadius:0,offset:(r=e.pathOptions)==null?void 0:r.offset}},[(n=e.pathOptions)==null?void 0:n.offset])})});Iv.displayName="StepEdge";function BI({sourceX:e,sourceY:n,targetX:r,targetY:s}){const[o,l,u,c]=sN({sourceX:e,sourceY:n,targetX:r,targetY:s});return[`M ${e},${n}L ${r},${s}`,o,l,u,c]}const Mv=A.memo(({sourceX:e,sourceY:n,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:p,labelBgBorderRadius:h,style:f,markerEnd:g,markerStart:y,interactionWidth:x})=>{const[N,_,S]=BI({sourceX:e,sourceY:n,targetX:r,targetY:s});return ue.createElement(xa,{path:N,labelX:_,labelY:S,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:p,labelBgBorderRadius:h,style:f,markerEnd:g,markerStart:y,interactionWidth:x})});Mv.displayName="StraightEdge";function Dl(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function nx({pos:e,x1:n,y1:r,x2:s,y2:o,c:l}){switch(e){case Ae.Left:return[n-Dl(n-s,l),r];case Ae.Right:return[n+Dl(s-n,l),r];case Ae.Top:return[n,r-Dl(r-o,l)];case Ae.Bottom:return[n,r+Dl(o-r,l)]}}function lN({sourceX:e,sourceY:n,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:l=Ae.Top,curvature:u=.25}){const[c,p]=nx({pos:r,x1:e,y1:n,x2:s,y2:o,c:u}),[h,f]=nx({pos:l,x1:s,y1:o,x2:e,y2:n,c:u}),[g,y,x,N]=oN({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:c,sourceControlY:p,targetControlX:h,targetControlY:f});return[`M${e},${n} C${c},${p} ${h},${f} ${s},${o}`,g,y,x,N]}const cu=A.memo(({sourceX:e,sourceY:n,targetX:r,targetY:s,sourcePosition:o=Ae.Bottom,targetPosition:l=Ae.Top,label:u,labelStyle:c,labelShowBg:p,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:x,markerStart:N,pathOptions:_,interactionWidth:S})=>{const[b,k,E]=lN({sourceX:e,sourceY:n,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:_==null?void 0:_.curvature});return ue.createElement(xa,{path:b,labelX:k,labelY:E,label:u,labelStyle:c,labelShowBg:p,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:x,markerStart:N,interactionWidth:S})});cu.displayName="BezierEdge";const Pv=A.createContext(null),UI=Pv.Provider;Pv.Consumer;const HI=()=>A.useContext(Pv),WI=e=>"id"in e&&"source"in e&&"target"in e,VI=({source:e,sourceHandle:n,target:r,targetHandle:s})=>`reactflow__edge-${e}${n||""}-${r}${s||""}`,sv=(e,n)=>typeof e>"u"?"":typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,GI=(e,n)=>n.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),YI=(e,n)=>{if(!e.source||!e.target)return n;let r;return WI(e)?r={...e}:r={...e,id:VI(e)},GI(r,n)?n:n.concat(r)},ov=({x:e,y:n},[r,s,o],l,[u,c])=>{const p={x:(e-r)/o,y:(n-s)/o};return l?{x:u*Math.round(p.x/u),y:c*Math.round(p.y/c)}:p},uN=({x:e,y:n},[r,s,o])=>({x:e*o+r,y:n*o+s}),is=(e,n=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const r=(e.width??0)*n[0],s=(e.height??0)*n[1],o={x:e.position.x-r,y:e.position.y-s};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-s}:o}},_u=(e,n=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((s,o)=>{const{x:l,y:u}=is(o,n).positionAbsolute;return tN(s,fa({x:l,y:u,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return nN(r)},cN=(e,n,[r,s,o]=[0,0,1],l=!1,u=!1,c=[0,0])=>{const p={x:(n.x-r)/o,y:(n.y-s)/o,width:n.width/o,height:n.height/o},h=[];return e.forEach(f=>{const{width:g,height:y,selectable:x=!0,hidden:N=!1}=f;if(u&&!x||N)return!1;const{positionAbsolute:_}=is(f,c),S={x:_.x,y:_.y,width:g||0,height:y||0},b=nv(p,S),k=typeof g>"u"||typeof y>"u"||g===null||y===null,E=l&&b>0,C=(g||0)*(y||0);(k||E||b>=C||f.dragging)&&h.push(f)}),h},dN=(e,n)=>{const r=e.map(s=>s.id);return n.filter(s=>r.includes(s.source)||r.includes(s.target))},fN=(e,n,r,s,o,l=.1)=>{const u=n/(e.width*(1+l)),c=r/(e.height*(1+l)),p=Math.min(u,c),h=so(p,s,o),f=e.x+e.width/2,g=e.y+e.height/2,y=n/2-f*h,x=r/2-g*h;return{x:y,y:x,zoom:h}},es=(e,n=0)=>e.transition().duration(n);function rx(e,n,r,s){return(n[r]||[]).reduce((o,l)=>{var u,c;return`${e.id}-${l.id}-${r}`!==s&&o.push({id:l.id||null,type:r,nodeId:e.id,x:(((u=e.positionAbsolute)==null?void 0:u.x)??0)+l.x+l.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+l.y+l.height/2}),o},[])}function KI(e,n,r,s,o,l){const{x:u,y:c}=vi(e),h=n.elementsFromPoint(u,c).find(N=>N.classList.contains("react-flow__handle"));if(h){const N=h.getAttribute("data-nodeid");if(N){const _=Ov(void 0,h),S=h.getAttribute("data-handleid"),b=l({nodeId:N,id:S,type:_});if(b){const k=o.find(E=>E.nodeId===N&&E.type===_&&E.id===S);return{handle:{id:S,type:_,nodeId:N,x:(k==null?void 0:k.x)||r.x,y:(k==null?void 0:k.y)||r.y},validHandleResult:b}}}}let f=[],g=1/0;if(o.forEach(N=>{const _=Math.sqrt((N.x-r.x)**2+(N.y-r.y)**2);if(_<=s){const S=l(N);_<=g&&(_<g?f=[{handle:N,validHandleResult:S}]:_===g&&f.push({handle:N,validHandleResult:S}),g=_)}}),!f.length)return{handle:null,validHandleResult:hN()};if(f.length===1)return f[0];const y=f.some(({validHandleResult:N})=>N.isValid),x=f.some(({handle:N})=>N.type==="target");return f.find(({handle:N,validHandleResult:_})=>x?N.type==="target":y?_.isValid:!0)||f[0]}const XI={source:null,target:null,sourceHandle:null,targetHandle:null},hN=()=>({handleDomNode:null,isValid:!1,connection:XI,endHandle:null});function pN(e,n,r,s,o,l,u){const c=o==="target",p=u.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),h={...hN(),handleDomNode:p};if(p){const f=Ov(void 0,p),g=p.getAttribute("data-nodeid"),y=p.getAttribute("data-handleid"),x=p.classList.contains("connectable"),N=p.classList.contains("connectableend"),_={source:c?g:r,sourceHandle:c?y:s,target:c?r:g,targetHandle:c?s:y};h.connection=_,x&&N&&(n===os.Strict?c&&f==="source"||!c&&f==="target":g!==r||y!==s)&&(h.endHandle={nodeId:g,handleId:y,type:f},h.isValid=l(_))}return h}function QI({nodes:e,nodeId:n,handleId:r,handleType:s}){return e.reduce((o,l)=>{if(l[pt]){const{handleBounds:u}=l[pt];let c=[],p=[];u&&(c=rx(l,u,"source",`${n}-${r}-${s}`),p=rx(l,u,"target",`${n}-${r}-${s}`)),o.push(...c,...p)}return o},[])}function Ov(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function _d(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function ZI(e,n){let r=null;return n?r="valid":e&&!n&&(r="invalid"),r}function mN({event:e,handleId:n,nodeId:r,onConnect:s,isTarget:o,getState:l,setState:u,isValidConnection:c,edgeUpdaterType:p,onReconnectEnd:h}){const f=eN(e.target),{connectionMode:g,domNode:y,autoPanOnConnect:x,connectionRadius:N,onConnectStart:_,panBy:S,getNodes:b,cancelConnection:k}=l();let E=0,C;const{x:T,y:M}=vi(e),L=f==null?void 0:f.elementFromPoint(T,M),H=Ov(p,L),O=y==null?void 0:y.getBoundingClientRect();if(!O||!H)return;let P,F=vi(e,O),G=!1,q=null,j=!1,Q=null;const z=QI({nodes:b(),nodeId:r,handleId:n,handleType:H}),ne=()=>{if(!x)return;const[K,I]=JE(F,O);S({x:K,y:I}),E=requestAnimationFrame(ne)};u({connectionPosition:F,connectionStatus:null,connectionNodeId:r,connectionHandleId:n,connectionHandleType:H,connectionStartHandle:{nodeId:r,handleId:n,type:H},connectionEndHandle:null}),_==null||_(e,{nodeId:r,handleId:n,handleType:H});function Z(K){const{transform:I}=l();F=vi(K,O);const{handle:W,validHandleResult:X}=KI(K,f,ov(F,I,!1,[1,1]),N,z,U=>pN(U,g,r,n,o?"target":"source",c,f));if(C=W,G||(ne(),G=!0),Q=X.handleDomNode,q=X.connection,j=X.isValid,u({connectionPosition:C&&j?uN({x:C.x,y:C.y},I):F,connectionStatus:ZI(!!C,j),connectionEndHandle:X.endHandle}),!C&&!j&&!Q)return _d(P);q.source!==q.target&&Q&&(_d(P),P=Q,Q.classList.add("connecting","react-flow__handle-connecting"),Q.classList.toggle("valid",j),Q.classList.toggle("react-flow__handle-valid",j))}function $(K){var I,W;(C||Q)&&q&&j&&(s==null||s(q)),(W=(I=l()).onConnectEnd)==null||W.call(I,K),p&&(h==null||h(K)),_d(P),k(),cancelAnimationFrame(E),G=!1,j=!1,q=null,Q=null,f.removeEventListener("mousemove",Z),f.removeEventListener("mouseup",$),f.removeEventListener("touchmove",Z),f.removeEventListener("touchend",$)}f.addEventListener("mousemove",Z),f.addEventListener("mouseup",$),f.addEventListener("touchmove",Z),f.addEventListener("touchend",$)}const ix=()=>!0,JI=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),eM=(e,n,r)=>s=>{const{connectionStartHandle:o,connectionEndHandle:l,connectionClickStartHandle:u}=s;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===n&&(o==null?void 0:o.type)===r||(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===n&&(l==null?void 0:l.type)===r,clickConnecting:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.handleId)===n&&(u==null?void 0:u.type)===r}},gN=A.forwardRef(({type:e="source",position:n=Ae.Top,isValidConnection:r,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:l=!0,id:u,onConnect:c,children:p,className:h,onMouseDown:f,onTouchStart:g,...y},x)=>{var O,P;const N=u||null,_=e==="target",S=jt(),b=HI(),{connectOnClick:k,noPanClassName:E}=Ke(JI,Rt),{connecting:C,clickConnecting:T}=Ke(eM(b,N,e),Rt);b||(P=(O=S.getState()).onError)==null||P.call(O,"010",Dr.error010());const M=F=>{const{defaultEdgeOptions:G,onConnect:q,hasDefaultEdges:j}=S.getState(),Q={...G,...F};if(j){const{edges:z,setEdges:ne}=S.getState();ne(YI(Q,z))}q==null||q(Q),c==null||c(Q)},L=F=>{if(!b)return;const G=iN(F);o&&(G&&F.button===0||!G)&&mN({event:F,handleId:N,nodeId:b,onConnect:M,isTarget:_,getState:S.getState,setState:S.setState,isValidConnection:r||S.getState().isValidConnection||ix}),G?f==null||f(F):g==null||g(F)},H=F=>{const{onClickConnectStart:G,onClickConnectEnd:q,connectionClickStartHandle:j,connectionMode:Q,isValidConnection:z}=S.getState();if(!b||!j&&!o)return;if(!j){G==null||G(F,{nodeId:b,handleId:N,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:N}});return}const ne=eN(F.target),Z=r||z||ix,{connection:$,isValid:K}=pN({nodeId:b,id:N,type:e},Q,j.nodeId,j.handleId||null,j.type,Z,ne);K&&M($),q==null||q(F),S.setState({connectionClickStartHandle:null})};return ue.createElement("div",{"data-handleid":N,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${N}-${e}`,className:Ft(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,h,{source:!_,target:_,connectable:s,connectablestart:o,connectableend:l,connecting:T,connectionindicator:s&&(o&&!C||l&&C)}]),onMouseDown:L,onTouchStart:L,onClick:k?H:void 0,ref:x,...y},p)});gN.displayName="Handle";var oo=A.memo(gN);const vN=({data:e,isConnectable:n,targetPosition:r=Ae.Top,sourcePosition:s=Ae.Bottom})=>ue.createElement(ue.Fragment,null,ue.createElement(oo,{type:"target",position:r,isConnectable:n}),e==null?void 0:e.label,ue.createElement(oo,{type:"source",position:s,isConnectable:n}));vN.displayName="DefaultNode";var av=A.memo(vN);const yN=({data:e,isConnectable:n,sourcePosition:r=Ae.Bottom})=>ue.createElement(ue.Fragment,null,e==null?void 0:e.label,ue.createElement(oo,{type:"source",position:r,isConnectable:n}));yN.displayName="InputNode";var wN=A.memo(yN);const xN=({data:e,isConnectable:n,targetPosition:r=Ae.Top})=>ue.createElement(ue.Fragment,null,ue.createElement(oo,{type:"target",position:r,isConnectable:n}),e==null?void 0:e.label);xN.displayName="OutputNode";var _N=A.memo(xN);const Lv=()=>null;Lv.displayName="GroupNode";const tM=e=>({selectedNodes:e.getNodes().filter(n=>n.selected),selectedEdges:e.edges.filter(n=>n.selected).map(n=>({...n}))}),Fl=e=>e.id;function nM(e,n){return Rt(e.selectedNodes.map(Fl),n.selectedNodes.map(Fl))&&Rt(e.selectedEdges.map(Fl),n.selectedEdges.map(Fl))}const bN=A.memo(({onSelectionChange:e})=>{const n=jt(),{selectedNodes:r,selectedEdges:s}=Ke(tM,nM);return A.useEffect(()=>{const o={nodes:r,edges:s};e==null||e(o),n.getState().onSelectionChange.forEach(l=>l(o))},[r,s,e]),null});bN.displayName="SelectionListener";const rM=e=>!!e.onSelectionChange;function iM({onSelectionChange:e}){const n=Ke(rM);return e||n?ue.createElement(bN,{onSelectionChange:e}):null}const sM=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Hs(e,n){A.useEffect(()=>{typeof e<"u"&&n(e)},[e])}function qe(e,n,r){A.useEffect(()=>{typeof n<"u"&&r({[e]:n})},[n])}const oM=({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,onConnect:o,onConnectStart:l,onConnectEnd:u,onClickConnectStart:c,onClickConnectEnd:p,nodesDraggable:h,nodesConnectable:f,nodesFocusable:g,edgesFocusable:y,edgesUpdatable:x,elevateNodesOnSelect:N,minZoom:_,maxZoom:S,nodeExtent:b,onNodesChange:k,onEdgesChange:E,elementsSelectable:C,connectionMode:T,snapGrid:M,snapToGrid:L,translateExtent:H,connectOnClick:O,defaultEdgeOptions:P,fitView:F,fitViewOptions:G,onNodesDelete:q,onEdgesDelete:j,onNodeDrag:Q,onNodeDragStart:z,onNodeDragStop:ne,onSelectionDrag:Z,onSelectionDragStart:$,onSelectionDragStop:K,noPanClassName:I,nodeOrigin:W,rfId:X,autoPanOnConnect:U,autoPanOnNodeDrag:J,onError:re,connectionRadius:le,isValidConnection:de,nodeDragThreshold:te})=>{const{setNodes:ce,setEdges:Ce,setDefaultNodesAndEdges:ve,setMinZoom:Te,setMaxZoom:ye,setTranslateExtent:ke,setNodeExtent:Ge,reset:we}=Ke(sM,Rt),_e=jt();return A.useEffect(()=>{const Be=s==null?void 0:s.map(Ye=>({...Ye,...P}));return ve(r,Be),()=>{we()}},[]),qe("defaultEdgeOptions",P,_e.setState),qe("connectionMode",T,_e.setState),qe("onConnect",o,_e.setState),qe("onConnectStart",l,_e.setState),qe("onConnectEnd",u,_e.setState),qe("onClickConnectStart",c,_e.setState),qe("onClickConnectEnd",p,_e.setState),qe("nodesDraggable",h,_e.setState),qe("nodesConnectable",f,_e.setState),qe("nodesFocusable",g,_e.setState),qe("edgesFocusable",y,_e.setState),qe("edgesUpdatable",x,_e.setState),qe("elementsSelectable",C,_e.setState),qe("elevateNodesOnSelect",N,_e.setState),qe("snapToGrid",L,_e.setState),qe("snapGrid",M,_e.setState),qe("onNodesChange",k,_e.setState),qe("onEdgesChange",E,_e.setState),qe("connectOnClick",O,_e.setState),qe("fitViewOnInit",F,_e.setState),qe("fitViewOnInitOptions",G,_e.setState),qe("onNodesDelete",q,_e.setState),qe("onEdgesDelete",j,_e.setState),qe("onNodeDrag",Q,_e.setState),qe("onNodeDragStart",z,_e.setState),qe("onNodeDragStop",ne,_e.setState),qe("onSelectionDrag",Z,_e.setState),qe("onSelectionDragStart",$,_e.setState),qe("onSelectionDragStop",K,_e.setState),qe("noPanClassName",I,_e.setState),qe("nodeOrigin",W,_e.setState),qe("rfId",X,_e.setState),qe("autoPanOnConnect",U,_e.setState),qe("autoPanOnNodeDrag",J,_e.setState),qe("onError",re,_e.setState),qe("connectionRadius",le,_e.setState),qe("isValidConnection",de,_e.setState),qe("nodeDragThreshold",te,_e.setState),Hs(e,ce),Hs(n,Ce),Hs(_,Te),Hs(S,ye),Hs(H,ke),Hs(b,Ge),null},sx={display:"none"},aM={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},SN="react-flow__node-desc",kN="react-flow__edge-desc",lM="react-flow__aria-live",uM=e=>e.ariaLiveMessage;function cM({rfId:e}){const n=Ke(uM);return ue.createElement("div",{id:`${lM}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:aM},n)}function dM({rfId:e,disableKeyboardA11y:n}){return ue.createElement(ue.Fragment,null,ue.createElement("div",{id:`${SN}-${e}`,style:sx},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ue.createElement("div",{id:`${kN}-${e}`,style:sx},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&ue.createElement(cM,{rfId:e}))}var pa=(e=null,n={actInsideInputWithModifier:!0})=>{const[r,s]=A.useState(!1),o=A.useRef(!1),l=A.useRef(new Set([])),[u,c]=A.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.split("+")),f=h.reduce((g,y)=>g.concat(...y),[]);return[h,f]}return[[],[]]},[e]);return A.useEffect(()=>{const p=typeof document<"u"?document:null,h=(n==null?void 0:n.target)||p;if(e!==null){const f=x=>{if(o.current=x.ctrlKey||x.metaKey||x.shiftKey,(!o.current||o.current&&!n.actInsideInputWithModifier)&&rv(x))return!1;const _=ax(x.code,c);l.current.add(x[_]),ox(u,l.current,!1)&&(x.preventDefault(),s(!0))},g=x=>{if((!o.current||o.current&&!n.actInsideInputWithModifier)&&rv(x))return!1;const _=ax(x.code,c);ox(u,l.current,!0)?(s(!1),l.current.clear()):l.current.delete(x[_]),x.key==="Meta"&&l.current.clear(),o.current=!1},y=()=>{l.current.clear(),s(!1)};return h==null||h.addEventListener("keydown",f),h==null||h.addEventListener("keyup",g),window.addEventListener("blur",y),()=>{h==null||h.removeEventListener("keydown",f),h==null||h.removeEventListener("keyup",g),window.removeEventListener("blur",y)}}},[e,s]),r};function ox(e,n,r){return e.filter(s=>r||s.length===n.size).some(s=>s.every(o=>n.has(o)))}function ax(e,n){return n.includes(e)?"code":"key"}function EN(e,n,r,s){var c,p;const o=e.parentNode||e.parentId;if(!o)return r;const l=n.get(o),u=is(l,s);return EN(l,n,{x:(r.x??0)+u.x,y:(r.y??0)+u.y,z:(((c=l[pt])==null?void 0:c.z)??0)>(r.z??0)?((p=l[pt])==null?void 0:p.z)??0:r.z??0},s)}function NN(e,n,r){e.forEach(s=>{var l;const o=s.parentNode||s.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||r!=null&&r[s.id]){const{x:u,y:c,z:p}=EN(s,e,{...s.position,z:((l=s[pt])==null?void 0:l.z)??0},n);s.positionAbsolute={x:u,y:c},s[pt].z=p,r!=null&&r[s.id]&&(s[pt].isParent=!0)}})}function bd(e,n,r,s){const o=new Map,l={},u=s?1e3:0;return e.forEach(c=>{var x;const p=(On(c.zIndex)?c.zIndex:0)+(c.selected?u:0),h=n.get(c.id),f={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},g=c.parentNode||c.parentId;g&&(l[g]=!0);const y=(h==null?void 0:h.type)&&(h==null?void 0:h.type)!==c.type;Object.defineProperty(f,pt,{enumerable:!1,value:{handleBounds:y||(x=h==null?void 0:h[pt])==null?void 0:x.handleBounds,z:p}}),o.set(c.id,f)}),NN(o,r,l),o}function CN(e,n={}){const{getNodes:r,width:s,height:o,minZoom:l,maxZoom:u,d3Zoom:c,d3Selection:p,fitViewOnInitDone:h,fitViewOnInit:f,nodeOrigin:g}=e(),y=n.initial&&!h&&f;if(c&&p&&(y||!n.initial)){const N=r().filter(S=>{var k;const b=n.includeHiddenNodes?S.width&&S.height:!S.hidden;return(k=n.nodes)!=null&&k.length?b&&n.nodes.some(E=>E.id===S.id):b}),_=N.every(S=>S.width&&S.height);if(N.length>0&&_){const S=_u(N,g),{x:b,y:k,zoom:E}=fN(S,s,o,n.minZoom??l,n.maxZoom??u,n.padding??.1),C=qr.translate(b,k).scale(E);return typeof n.duration=="number"&&n.duration>0?c.transform(es(p,n.duration),C):c.transform(p,C),!0}}return!1}function fM(e,n){return e.forEach(r=>{const s=n.get(r.id);s&&n.set(s.id,{...s,[pt]:s[pt],selected:r.selected})}),new Map(n)}function hM(e,n){return n.map(r=>{const s=e.find(o=>o.id===r.id);return s&&(r.selected=s.selected),r})}function zl({changedNodes:e,changedEdges:n,get:r,set:s}){const{nodeInternals:o,edges:l,onNodesChange:u,onEdgesChange:c,hasDefaultNodes:p,hasDefaultEdges:h}=r();e!=null&&e.length&&(p&&s({nodeInternals:fM(e,o)}),u==null||u(e)),n!=null&&n.length&&(h&&s({edges:hM(n,l)}),c==null||c(n))}const Ws=()=>{},pM={zoomIn:Ws,zoomOut:Ws,zoomTo:Ws,getZoom:()=>1,setViewport:Ws,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ws,fitBounds:Ws,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},mM=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),gM=()=>{const e=jt(),{d3Zoom:n,d3Selection:r}=Ke(mM,Rt);return A.useMemo(()=>r&&n?{zoomIn:o=>n.scaleBy(es(r,o==null?void 0:o.duration),1.2),zoomOut:o=>n.scaleBy(es(r,o==null?void 0:o.duration),1/1.2),zoomTo:(o,l)=>n.scaleTo(es(r,l==null?void 0:l.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,l)=>{const[u,c,p]=e.getState().transform,h=qr.translate(o.x??u,o.y??c).scale(o.zoom??p);n.transform(es(r,l==null?void 0:l.duration),h)},getViewport:()=>{const[o,l,u]=e.getState().transform;return{x:o,y:l,zoom:u}},fitView:o=>CN(e.getState,o),setCenter:(o,l,u)=>{const{width:c,height:p,maxZoom:h}=e.getState(),f=typeof(u==null?void 0:u.zoom)<"u"?u.zoom:h,g=c/2-o*f,y=p/2-l*f,x=qr.translate(g,y).scale(f);n.transform(es(r,u==null?void 0:u.duration),x)},fitBounds:(o,l)=>{const{width:u,height:c,minZoom:p,maxZoom:h}=e.getState(),{x:f,y:g,zoom:y}=fN(o,u,c,p,h,(l==null?void 0:l.padding)??.1),x=qr.translate(f,g).scale(y);n.transform(es(r,l==null?void 0:l.duration),x)},project:o=>{const{transform:l,snapToGrid:u,snapGrid:c}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),ov(o,l,u,c)},screenToFlowPosition:o=>{const{transform:l,snapToGrid:u,snapGrid:c,domNode:p}=e.getState();if(!p)return o;const{x:h,y:f}=p.getBoundingClientRect(),g={x:o.x-h,y:o.y-f};return ov(g,l,u,c)},flowToScreenPosition:o=>{const{transform:l,domNode:u}=e.getState();if(!u)return o;const{x:c,y:p}=u.getBoundingClientRect(),h=uN(o,l);return{x:h.x+c,y:h.y+p}},viewportInitialized:!0}:pM,[n,r])};function _a(){const e=gM(),n=jt(),r=A.useCallback(()=>n.getState().getNodes().map(_=>({..._})),[]),s=A.useCallback(_=>n.getState().nodeInternals.get(_),[]),o=A.useCallback(()=>{const{edges:_=[]}=n.getState();return _.map(S=>({...S}))},[]),l=A.useCallback(_=>{const{edges:S=[]}=n.getState();return S.find(b=>b.id===_)},[]),u=A.useCallback(_=>{const{getNodes:S,setNodes:b,hasDefaultNodes:k,onNodesChange:E}=n.getState(),C=S(),T=typeof _=="function"?_(C):_;if(k)b(T);else if(E){const M=T.length===0?C.map(L=>({type:"remove",id:L.id})):T.map(L=>({item:L,type:"reset"}));E(M)}},[]),c=A.useCallback(_=>{const{edges:S=[],setEdges:b,hasDefaultEdges:k,onEdgesChange:E}=n.getState(),C=typeof _=="function"?_(S):_;if(k)b(C);else if(E){const T=C.length===0?S.map(M=>({type:"remove",id:M.id})):C.map(M=>({item:M,type:"reset"}));E(T)}},[]),p=A.useCallback(_=>{const S=Array.isArray(_)?_:[_],{getNodes:b,setNodes:k,hasDefaultNodes:E,onNodesChange:C}=n.getState();if(E){const M=[...b(),...S];k(M)}else if(C){const T=S.map(M=>({item:M,type:"add"}));C(T)}},[]),h=A.useCallback(_=>{const S=Array.isArray(_)?_:[_],{edges:b=[],setEdges:k,hasDefaultEdges:E,onEdgesChange:C}=n.getState();if(E)k([...b,...S]);else if(C){const T=S.map(M=>({item:M,type:"add"}));C(T)}},[]),f=A.useCallback(()=>{const{getNodes:_,edges:S=[],transform:b}=n.getState(),[k,E,C]=b;return{nodes:_().map(T=>({...T})),edges:S.map(T=>({...T})),viewport:{x:k,y:E,zoom:C}}},[]),g=A.useCallback(({nodes:_,edges:S})=>{const{nodeInternals:b,getNodes:k,edges:E,hasDefaultNodes:C,hasDefaultEdges:T,onNodesDelete:M,onEdgesDelete:L,onNodesChange:H,onEdgesChange:O}=n.getState(),P=(_||[]).map(Q=>Q.id),F=(S||[]).map(Q=>Q.id),G=k().reduce((Q,z)=>{const ne=z.parentNode||z.parentId,Z=!P.includes(z.id)&&ne&&Q.find(K=>K.id===ne);return(typeof z.deletable=="boolean"?z.deletable:!0)&&(P.includes(z.id)||Z)&&Q.push(z),Q},[]),q=E.filter(Q=>typeof Q.deletable=="boolean"?Q.deletable:!0),j=q.filter(Q=>F.includes(Q.id));if(G||j){const Q=dN(G,q),z=[...j,...Q],ne=z.reduce((Z,$)=>(Z.includes($.id)||Z.push($.id),Z),[]);if((T||C)&&(T&&n.setState({edges:E.filter(Z=>!ne.includes(Z.id))}),C&&(G.forEach(Z=>{b.delete(Z.id)}),n.setState({nodeInternals:new Map(b)}))),ne.length>0&&(L==null||L(z),O&&O(ne.map(Z=>({id:Z,type:"remove"})))),G.length>0&&(M==null||M(G),H)){const Z=G.map($=>({id:$.id,type:"remove"}));H(Z)}}},[]),y=A.useCallback(_=>{const S=LI(_),b=S?null:n.getState().nodeInternals.get(_.id);return!S&&!b?[null,null,S]:[S?_:Zw(b),b,S]},[]),x=A.useCallback((_,S=!0,b)=>{const[k,E,C]=y(_);return k?(b||n.getState().getNodes()).filter(T=>{if(!C&&(T.id===E.id||!T.positionAbsolute))return!1;const M=Zw(T),L=nv(M,k);return S&&L>0||L>=k.width*k.height}):[]},[]),N=A.useCallback((_,S,b=!0)=>{const[k]=y(_);if(!k)return!1;const E=nv(k,S);return b&&E>0||E>=k.width*k.height},[]);return A.useMemo(()=>({...e,getNodes:r,getNode:s,getEdges:o,getEdge:l,setNodes:u,setEdges:c,addNodes:p,addEdges:h,toObject:f,deleteElements:g,getIntersectingNodes:x,isNodeIntersecting:N}),[e,r,s,o,l,u,c,p,h,f,g,x,N])}const vM={actInsideInputWithModifier:!1};var yM=({deleteKeyCode:e,multiSelectionKeyCode:n})=>{const r=jt(),{deleteElements:s}=_a(),o=pa(e,vM),l=pa(n);A.useEffect(()=>{if(o){const{edges:u,getNodes:c}=r.getState(),p=c().filter(f=>f.selected),h=u.filter(f=>f.selected);s({nodes:p,edges:h}),r.setState({nodesSelectionActive:!1})}},[o]),A.useEffect(()=>{r.setState({multiSelectionActive:l})},[l])};function wM(e){const n=jt();A.useEffect(()=>{let r;const s=()=>{var l,u;if(!e.current)return;const o=jv(e.current);(o.height===0||o.width===0)&&((u=(l=n.getState()).onError)==null||u.call(l,"004",Dr.error004())),n.setState({width:o.width||500,height:o.height||500})};return s(),window.addEventListener("resize",s),e.current&&(r=new ResizeObserver(()=>s()),r.observe(e.current)),()=>{window.removeEventListener("resize",s),r&&e.current&&r.unobserve(e.current)}},[])}const qv={position:"absolute",width:"100%",height:"100%",top:0,left:0},xM=(e,n)=>e.x!==n.x||e.y!==n.y||e.zoom!==n.k,Bl=e=>({x:e.x,y:e.y,zoom:e.k}),Vs=(e,n)=>e.target.closest(`.${n}`),lx=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),ux=e=>{const n=e.ctrlKey&&lu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n},_M=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),bM=({onMove:e,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:s,zoomOnScroll:o=!0,zoomOnPinch:l=!0,panOnScroll:u=!1,panOnScrollSpeed:c=.5,panOnScrollMode:p=ns.Free,zoomOnDoubleClick:h=!0,elementsSelectable:f,panOnDrag:g=!0,defaultViewport:y,translateExtent:x,minZoom:N,maxZoom:_,zoomActivationKeyCode:S,preventScrolling:b=!0,children:k,noWheelClassName:E,noPanClassName:C})=>{const T=A.useRef(),M=jt(),L=A.useRef(!1),H=A.useRef(!1),O=A.useRef(null),P=A.useRef({x:0,y:0,zoom:0}),{d3Zoom:F,d3Selection:G,d3ZoomHandler:q,userSelectionActive:j}=Ke(_M,Rt),Q=pa(S),z=A.useRef(0),ne=A.useRef(!1),Z=A.useRef();return wM(O),A.useEffect(()=>{if(O.current){const $=O.current.getBoundingClientRect(),K=QE().scaleExtent([N,_]).translateExtent(x),I=Pn(O.current).call(K),W=qr.translate(y.x,y.y).scale(so(y.zoom,N,_)),X=[[0,0],[$.width,$.height]],U=K.constrain()(W,X,x);K.transform(I,U),K.wheelDelta(ux),M.setState({d3Zoom:K,d3Selection:I,d3ZoomHandler:I.on("wheel.zoom"),transform:[U.x,U.y,U.k],domNode:O.current.closest(".react-flow")})}},[]),A.useEffect(()=>{G&&F&&(u&&!Q&&!j?G.on("wheel.zoom",$=>{if(Vs($,E))return!1;$.preventDefault(),$.stopImmediatePropagation();const K=G.property("__zoom").k||1;if($.ctrlKey&&l){const de=er($),te=ux($),ce=K*Math.pow(2,te);F.scaleTo(G,ce,de,$);return}const I=$.deltaMode===1?20:1;let W=p===ns.Vertical?0:$.deltaX*I,X=p===ns.Horizontal?0:$.deltaY*I;!lu()&&$.shiftKey&&p!==ns.Vertical&&(W=$.deltaY*I,X=0),F.translateBy(G,-(W/K)*c,-(X/K)*c,{internal:!0});const U=Bl(G.property("__zoom")),{onViewportChangeStart:J,onViewportChange:re,onViewportChangeEnd:le}=M.getState();clearTimeout(Z.current),ne.current||(ne.current=!0,n==null||n($,U),J==null||J(U)),ne.current&&(e==null||e($,U),re==null||re(U),Z.current=setTimeout(()=>{r==null||r($,U),le==null||le(U),ne.current=!1},150))},{passive:!1}):typeof q<"u"&&G.on("wheel.zoom",function($,K){if(!b&&$.type==="wheel"&&!$.ctrlKey||Vs($,E))return null;$.preventDefault(),q.call(this,$,K)},{passive:!1}))},[j,u,p,G,F,q,Q,l,b,E,n,e,r]),A.useEffect(()=>{F&&F.on("start",$=>{var W,X;if(!$.sourceEvent||$.sourceEvent.internal)return null;z.current=(W=$.sourceEvent)==null?void 0:W.button;const{onViewportChangeStart:K}=M.getState(),I=Bl($.transform);L.current=!0,P.current=I,((X=$.sourceEvent)==null?void 0:X.type)==="mousedown"&&M.setState({paneDragging:!0}),K==null||K(I),n==null||n($.sourceEvent,I)})},[F,n]),A.useEffect(()=>{F&&(j&&!L.current?F.on("zoom",null):j||F.on("zoom",$=>{var I;const{onViewportChange:K}=M.getState();if(M.setState({transform:[$.transform.x,$.transform.y,$.transform.k]}),H.current=!!(s&&lx(g,z.current??0)),(e||K)&&!((I=$.sourceEvent)!=null&&I.internal)){const W=Bl($.transform);K==null||K(W),e==null||e($.sourceEvent,W)}}))},[j,F,e,g,s]),A.useEffect(()=>{F&&F.on("end",$=>{if(!$.sourceEvent||$.sourceEvent.internal)return null;const{onViewportChangeEnd:K}=M.getState();if(L.current=!1,M.setState({paneDragging:!1}),s&&lx(g,z.current??0)&&!H.current&&s($.sourceEvent),H.current=!1,(r||K)&&xM(P.current,$.transform)){const I=Bl($.transform);P.current=I,clearTimeout(T.current),T.current=setTimeout(()=>{K==null||K(I),r==null||r($.sourceEvent,I)},u?150:0)}})},[F,u,g,r,s]),A.useEffect(()=>{F&&F.filter($=>{const K=Q||o,I=l&&$.ctrlKey;if((g===!0||Array.isArray(g)&&g.includes(1))&&$.button===1&&$.type==="mousedown"&&(Vs($,"react-flow__node")||Vs($,"react-flow__edge")))return!0;if(!g&&!K&&!u&&!h&&!l||j||!h&&$.type==="dblclick"||Vs($,E)&&$.type==="wheel"||Vs($,C)&&($.type!=="wheel"||u&&$.type==="wheel"&&!Q)||!l&&$.ctrlKey&&$.type==="wheel"||!K&&!u&&!I&&$.type==="wheel"||!g&&($.type==="mousedown"||$.type==="touchstart")||Array.isArray(g)&&!g.includes($.button)&&$.type==="mousedown")return!1;const W=Array.isArray(g)&&g.includes($.button)||!$.button||$.button<=1;return(!$.ctrlKey||$.type==="wheel")&&W})},[j,F,o,l,u,h,g,f,Q]),ue.createElement("div",{className:"react-flow__renderer",ref:O,style:qv},k)},SM=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function kM(){const{userSelectionActive:e,userSelectionRect:n}=Ke(SM,Rt);return e&&n?ue.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function cx(e,n){const r=n.parentNode||n.parentId,s=e.find(o=>o.id===r);if(s){const o=n.position.x+n.width-s.width,l=n.position.y+n.height-s.height;if(o>0||l>0||n.position.x<0||n.position.y<0){if(s.style={...s.style},s.style.width=s.style.width??s.width,s.style.height=s.style.height??s.height,o>0&&(s.style.width+=o),l>0&&(s.style.height+=l),n.position.x<0){const u=Math.abs(n.position.x);s.position.x=s.position.x-u,s.style.width+=u,n.position.x=0}if(n.position.y<0){const u=Math.abs(n.position.y);s.position.y=s.position.y-u,s.style.height+=u,n.position.y=0}s.width=s.style.width,s.height=s.style.height}}}function EM(e,n){if(e.some(s=>s.type==="reset"))return e.filter(s=>s.type==="reset").map(s=>s.item);const r=e.filter(s=>s.type==="add").map(s=>s.item);return n.reduce((s,o)=>{const l=e.filter(c=>c.id===o.id);if(l.length===0)return s.push(o),s;const u={...o};for(const c of l)if(c)switch(c.type){case"select":{u.selected=c.selected;break}case"position":{typeof c.position<"u"&&(u.position=c.position),typeof c.positionAbsolute<"u"&&(u.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(u.dragging=c.dragging),u.expandParent&&cx(s,u);break}case"dimensions":{typeof c.dimensions<"u"&&(u.width=c.dimensions.width,u.height=c.dimensions.height),typeof c.updateStyle<"u"&&(u.style={...u.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(u.resizing=c.resizing),u.expandParent&&cx(s,u);break}case"remove":return s}return s.push(u),s},r)}function NM(e,n){return EM(e,n)}const mi=(e,n)=>({id:e,type:"select",selected:n});function Xs(e,n){return e.reduce((r,s)=>{const o=n.includes(s.id);return!s.selected&&o?(s.selected=!0,r.push(mi(s.id,!0))):s.selected&&!o&&(s.selected=!1,r.push(mi(s.id,!1))),r},[])}const Sd=(e,n)=>r=>{r.target===n.current&&(e==null||e(r))},CM=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),RN=A.memo(({isSelecting:e,selectionMode:n=ha.Full,panOnDrag:r,onSelectionStart:s,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:p,onPaneMouseMove:h,onPaneMouseLeave:f,children:g})=>{const y=A.useRef(null),x=jt(),N=A.useRef(0),_=A.useRef(0),S=A.useRef(),{userSelectionActive:b,elementsSelectable:k,dragging:E}=Ke(CM,Rt),C=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),N.current=0,_.current=0},T=q=>{l==null||l(q),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},M=q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){q.preventDefault();return}u==null||u(q)},L=c?q=>c(q):void 0,H=q=>{const{resetSelectedElements:j,domNode:Q}=x.getState();if(S.current=Q==null?void 0:Q.getBoundingClientRect(),!k||!e||q.button!==0||q.target!==y.current||!S.current)return;const{x:z,y:ne}=vi(q,S.current);j(),x.setState({userSelectionRect:{width:0,height:0,startX:z,startY:ne,x:z,y:ne}}),s==null||s(q)},O=q=>{const{userSelectionRect:j,nodeInternals:Q,edges:z,transform:ne,onNodesChange:Z,onEdgesChange:$,nodeOrigin:K,getNodes:I}=x.getState();if(!e||!S.current||!j)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const W=vi(q,S.current),X=j.startX??0,U=j.startY??0,J={...j,x:W.x<X?W.x:X,y:W.y<U?W.y:U,width:Math.abs(W.x-X),height:Math.abs(W.y-U)},re=I(),le=cN(Q,J,ne,n===ha.Partial,!0,K),de=dN(le,z).map(ce=>ce.id),te=le.map(ce=>ce.id);if(N.current!==te.length){N.current=te.length;const ce=Xs(re,te);ce.length&&(Z==null||Z(ce))}if(_.current!==de.length){_.current=de.length;const ce=Xs(z,de);ce.length&&($==null||$(ce))}x.setState({userSelectionRect:J})},P=q=>{if(q.button!==0)return;const{userSelectionRect:j}=x.getState();!b&&j&&q.target===y.current&&(T==null||T(q)),x.setState({nodesSelectionActive:N.current>0}),C(),o==null||o(q)},F=q=>{b&&(x.setState({nodesSelectionActive:N.current>0}),o==null||o(q)),C()},G=k&&(e||b);return ue.createElement("div",{className:Ft(["react-flow__pane",{dragging:E,selection:e}]),onClick:G?void 0:Sd(T,y),onContextMenu:Sd(M,y),onWheel:Sd(L,y),onMouseEnter:G?void 0:p,onMouseDown:G?H:void 0,onMouseMove:G?O:h,onMouseUp:G?P:void 0,onMouseLeave:G?F:f,ref:y,style:qv},g,ue.createElement(kM,null))});RN.displayName="Pane";function jN(e,n){const r=e.parentNode||e.parentId;if(!r)return!1;const s=n.get(r);return s?s.selected?!0:jN(s,n):!1}function dx(e,n,r){let s=e;do{if(s!=null&&s.matches(n))return!0;if(s===r.current)return!1;s=s.parentElement}while(s);return!1}function RM(e,n,r,s){return Array.from(e.values()).filter(o=>(o.selected||o.id===s)&&(!o.parentNode||o.parentId||!jN(o,e))&&(o.draggable||n&&typeof o.draggable>"u")).map(o=>{var l,u;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:r.x-(((l=o.positionAbsolute)==null?void 0:l.x)??0),y:r.y-(((u=o.positionAbsolute)==null?void 0:u.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode||o.parentId,parentId:o.parentNode||o.parentId,width:o.width,height:o.height,expandParent:o.expandParent}})}function jM(e,n){return!n||n==="parent"?n:[n[0],[n[1][0]-(e.width||0),n[1][1]-(e.height||0)]]}function TN(e,n,r,s,o=[0,0],l){const u=jM(e,e.extent||s);let c=u;const p=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(p&&e.width&&e.height){const g=r.get(p),{x:y,y:x}=is(g,o).positionAbsolute;c=g&&On(y)&&On(x)&&On(g.width)&&On(g.height)?[[y+e.width*o[0],x+e.height*o[1]],[y+g.width-e.width+e.width*o[0],x+g.height-e.height+e.height*o[1]]]:c}else l==null||l("005",Dr.error005()),c=u;else if(e.extent&&p&&e.extent!=="parent"){const g=r.get(p),{x:y,y:x}=is(g,o).positionAbsolute;c=[[e.extent[0][0]+y,e.extent[0][1]+x],[e.extent[1][0]+y,e.extent[1][1]+x]]}let h={x:0,y:0};if(p){const g=r.get(p);h=is(g,o).positionAbsolute}const f=c&&c!=="parent"?Tv(n,c):n;return{position:{x:f.x-h.x,y:f.y-h.y},positionAbsolute:f}}function kd({nodeId:e,dragItems:n,nodeInternals:r}){const s=n.map(o=>({...r.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?s.find(o=>o.id===e):s[0],s]}const fx=(e,n,r,s)=>{const o=n.querySelectorAll(e);if(!o||!o.length)return null;const l=Array.from(o),u=n.getBoundingClientRect(),c={x:u.width*s[0],y:u.height*s[1]};return l.map(p=>{const h=p.getBoundingClientRect();return{id:p.getAttribute("data-handleid"),position:p.getAttribute("data-handlepos"),x:(h.left-u.left-c.x)/r,y:(h.top-u.top-c.y)/r,...jv(p)}})};function Jo(e,n,r){return r===void 0?r:s=>{const o=n().nodeInternals.get(e);o&&r(s,{...o})}}function lv({id:e,store:n,unselect:r=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:l,multiSelectionActive:u,nodeInternals:c,onError:p}=n.getState(),h=c.get(e);if(!h){p==null||p("012",Dr.error012(e));return}n.setState({nodesSelectionActive:!1}),h.selected?(r||h.selected&&u)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var f;return(f=s==null?void 0:s.current)==null?void 0:f.blur()})):o([e])}function TM(){const e=jt();return A.useCallback(({sourceEvent:r})=>{const{transform:s,snapGrid:o,snapToGrid:l}=e.getState(),u=r.touches?r.touches[0].clientX:r.clientX,c=r.touches?r.touches[0].clientY:r.clientY,p={x:(u-s[0])/s[2],y:(c-s[1])/s[2]};return{xSnapped:l?o[0]*Math.round(p.x/o[0]):p.x,ySnapped:l?o[1]*Math.round(p.y/o[1]):p.y,...p}},[])}function Ed(e){return(n,r,s)=>e==null?void 0:e(n,s)}function AN({nodeRef:e,disabled:n=!1,noDragClassName:r,handleSelector:s,nodeId:o,isSelectable:l,selectNodesOnDrag:u}){const c=jt(),[p,h]=A.useState(!1),f=A.useRef([]),g=A.useRef({x:null,y:null}),y=A.useRef(0),x=A.useRef(null),N=A.useRef({x:0,y:0}),_=A.useRef(null),S=A.useRef(!1),b=A.useRef(!1),k=A.useRef(!1),E=TM();return A.useEffect(()=>{if(e!=null&&e.current){const C=Pn(e.current),T=({x:H,y:O})=>{const{nodeInternals:P,onNodeDrag:F,onSelectionDrag:G,updateNodePositions:q,nodeExtent:j,snapGrid:Q,snapToGrid:z,nodeOrigin:ne,onError:Z}=c.getState();g.current={x:H,y:O};let $=!1,K={x:0,y:0,x2:0,y2:0};if(f.current.length>1&&j){const W=_u(f.current,ne);K=fa(W)}if(f.current=f.current.map(W=>{const X={x:H-W.distance.x,y:O-W.distance.y};z&&(X.x=Q[0]*Math.round(X.x/Q[0]),X.y=Q[1]*Math.round(X.y/Q[1]));const U=[[j[0][0],j[0][1]],[j[1][0],j[1][1]]];f.current.length>1&&j&&!W.extent&&(U[0][0]=W.positionAbsolute.x-K.x+j[0][0],U[1][0]=W.positionAbsolute.x+(W.width??0)-K.x2+j[1][0],U[0][1]=W.positionAbsolute.y-K.y+j[0][1],U[1][1]=W.positionAbsolute.y+(W.height??0)-K.y2+j[1][1]);const J=TN(W,X,P,U,ne,Z);return $=$||W.position.x!==J.position.x||W.position.y!==J.position.y,W.position=J.position,W.positionAbsolute=J.positionAbsolute,W}),!$)return;q(f.current,!0,!0),h(!0);const I=o?F:Ed(G);if(I&&_.current){const[W,X]=kd({nodeId:o,dragItems:f.current,nodeInternals:P});I(_.current,W,X)}},M=()=>{if(!x.current)return;const[H,O]=JE(N.current,x.current);if(H!==0||O!==0){const{transform:P,panBy:F}=c.getState();g.current.x=(g.current.x??0)-H/P[2],g.current.y=(g.current.y??0)-O/P[2],F({x:H,y:O})&&T(g.current)}y.current=requestAnimationFrame(M)},L=H=>{var ne;const{nodeInternals:O,multiSelectionActive:P,nodesDraggable:F,unselectNodesAndEdges:G,onNodeDragStart:q,onSelectionDragStart:j}=c.getState();b.current=!0;const Q=o?q:Ed(j);(!u||!l)&&!P&&o&&((ne=O.get(o))!=null&&ne.selected||G()),o&&l&&u&&lv({id:o,store:c,nodeRef:e});const z=E(H);if(g.current=z,f.current=RM(O,F,z,o),Q&&f.current){const[Z,$]=kd({nodeId:o,dragItems:f.current,nodeInternals:O});Q(H.sourceEvent,Z,$)}};if(n)C.on(".drag",null);else{const H=D2().on("start",O=>{const{domNode:P,nodeDragThreshold:F}=c.getState();F===0&&L(O),k.current=!1;const G=E(O);g.current=G,x.current=(P==null?void 0:P.getBoundingClientRect())||null,N.current=vi(O.sourceEvent,x.current)}).on("drag",O=>{var q,j;const P=E(O),{autoPanOnNodeDrag:F,nodeDragThreshold:G}=c.getState();if(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1&&(k.current=!0),!k.current){if(!S.current&&b.current&&F&&(S.current=!0,M()),!b.current){const Q=P.xSnapped-(((q=g==null?void 0:g.current)==null?void 0:q.x)??0),z=P.ySnapped-(((j=g==null?void 0:g.current)==null?void 0:j.y)??0);Math.sqrt(Q*Q+z*z)>G&&L(O)}(g.current.x!==P.xSnapped||g.current.y!==P.ySnapped)&&f.current&&b.current&&(_.current=O.sourceEvent,N.current=vi(O.sourceEvent,x.current),T(P))}}).on("end",O=>{if(!(!b.current||k.current)&&(h(!1),S.current=!1,b.current=!1,cancelAnimationFrame(y.current),f.current)){const{updateNodePositions:P,nodeInternals:F,onNodeDragStop:G,onSelectionDragStop:q}=c.getState(),j=o?G:Ed(q);if(P(f.current,!1,!1),j){const[Q,z]=kd({nodeId:o,dragItems:f.current,nodeInternals:F});j(O.sourceEvent,Q,z)}}}).filter(O=>{const P=O.target;return!O.button&&(!r||!dx(P,`.${r}`,e))&&(!s||dx(P,s,e))});return C.call(H),()=>{C.on(".drag",null)}}}},[e,n,r,s,l,c,o,u,E]),p}function IN(){const e=jt();return A.useCallback(r=>{const{nodeInternals:s,nodeExtent:o,updateNodePositions:l,getNodes:u,snapToGrid:c,snapGrid:p,onError:h,nodesDraggable:f}=e.getState(),g=u().filter(k=>k.selected&&(k.draggable||f&&typeof k.draggable>"u")),y=c?p[0]:5,x=c?p[1]:5,N=r.isShiftPressed?4:1,_=r.x*y*N,S=r.y*x*N,b=g.map(k=>{if(k.positionAbsolute){const E={x:k.positionAbsolute.x+_,y:k.positionAbsolute.y+S};c&&(E.x=p[0]*Math.round(E.x/p[0]),E.y=p[1]*Math.round(E.y/p[1]));const{positionAbsolute:C,position:T}=TN(k,E,s,o,void 0,h);k.position=T,k.positionAbsolute=C}return k});l(b,!0,!1)},[])}const to={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ea=e=>{const n=({id:r,type:s,data:o,xPos:l,yPos:u,xPosOrigin:c,yPosOrigin:p,selected:h,onClick:f,onMouseEnter:g,onMouseMove:y,onMouseLeave:x,onContextMenu:N,onDoubleClick:_,style:S,className:b,isDraggable:k,isSelectable:E,isConnectable:C,isFocusable:T,selectNodesOnDrag:M,sourcePosition:L,targetPosition:H,hidden:O,resizeObserver:P,dragHandle:F,zIndex:G,isParent:q,noDragClassName:j,noPanClassName:Q,initialized:z,disableKeyboardA11y:ne,ariaLabel:Z,rfId:$,hasHandleBounds:K})=>{const I=jt(),W=A.useRef(null),X=A.useRef(null),U=A.useRef(L),J=A.useRef(H),re=A.useRef(s),le=E||k||f||g||y||x,de=IN(),te=Jo(r,I.getState,g),ce=Jo(r,I.getState,y),Ce=Jo(r,I.getState,x),ve=Jo(r,I.getState,N),Te=Jo(r,I.getState,_),ye=we=>{const{nodeDragThreshold:_e}=I.getState();if(E&&(!M||!k||_e>0)&&lv({id:r,store:I,nodeRef:W}),f){const Be=I.getState().nodeInternals.get(r);Be&&f(we,{...Be})}},ke=we=>{if(!rv(we)&&!ne)if(rN.includes(we.key)&&E){const _e=we.key==="Escape";lv({id:r,store:I,unselect:_e,nodeRef:W})}else k&&h&&Object.prototype.hasOwnProperty.call(to,we.key)&&(I.setState({ariaLiveMessage:`Moved selected node ${we.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~l}, y: ${~~u}`}),de({x:to[we.key].x,y:to[we.key].y,isShiftPressed:we.shiftKey}))};A.useEffect(()=>()=>{X.current&&(P==null||P.unobserve(X.current),X.current=null)},[]),A.useEffect(()=>{if(W.current&&!O){const we=W.current;(!z||!K||X.current!==we)&&(X.current&&(P==null||P.unobserve(X.current)),P==null||P.observe(we),X.current=we)}},[O,z,K]),A.useEffect(()=>{const we=re.current!==s,_e=U.current!==L,Be=J.current!==H;W.current&&(we||_e||Be)&&(we&&(re.current=s),_e&&(U.current=L),Be&&(J.current=H),I.getState().updateNodeDimensions([{id:r,nodeElement:W.current,forceUpdate:!0}]))},[r,s,L,H]);const Ge=AN({nodeRef:W,disabled:O||!k,noDragClassName:j,handleSelector:F,nodeId:r,isSelectable:E,selectNodesOnDrag:M});return O?null:ue.createElement("div",{className:Ft(["react-flow__node",`react-flow__node-${s}`,{[Q]:k},b,{selected:h,selectable:E,parent:q,dragging:Ge}]),ref:W,style:{zIndex:G,transform:`translate(${c}px,${p}px)`,pointerEvents:le?"all":"none",visibility:z?"visible":"hidden",...S},"data-id":r,"data-testid":`rf__node-${r}`,onMouseEnter:te,onMouseMove:ce,onMouseLeave:Ce,onContextMenu:ve,onClick:ye,onDoubleClick:Te,onKeyDown:T?ke:void 0,tabIndex:T?0:void 0,role:T?"button":void 0,"aria-describedby":ne?void 0:`${SN}-${$}`,"aria-label":Z},ue.createElement(UI,{value:r},ue.createElement(e,{id:r,data:o,type:s,xPos:l,yPos:u,selected:h,isConnectable:C,sourcePosition:L,targetPosition:H,dragging:Ge,dragHandle:F,zIndex:G})))};return n.displayName="NodeWrapper",A.memo(n)};const AM=e=>{const n=e.getNodes().filter(r=>r.selected);return{..._u(n,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function IM({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:r}){const s=jt(),{width:o,height:l,x:u,y:c,transformString:p,userSelectionActive:h}=Ke(AM,Rt),f=IN(),g=A.useRef(null);if(A.useEffect(()=>{var N;r||(N=g.current)==null||N.focus({preventScroll:!0})},[r]),AN({nodeRef:g}),h||!o||!l)return null;const y=e?N=>{const _=s.getState().getNodes().filter(S=>S.selected);e(N,_)}:void 0,x=N=>{Object.prototype.hasOwnProperty.call(to,N.key)&&f({x:to[N.key].x,y:to[N.key].y,isShiftPressed:N.shiftKey})};return ue.createElement("div",{className:Ft(["react-flow__nodesselection","react-flow__container",n]),style:{transform:p}},ue.createElement("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:r?void 0:-1,onKeyDown:r?void 0:x,style:{width:o,height:l,top:c,left:u}}))}var MM=A.memo(IM);const PM=e=>e.nodesSelectionActive,MN=({children:e,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:u,deleteKeyCode:c,onMove:p,onMoveStart:h,onMoveEnd:f,selectionKeyCode:g,selectionOnDrag:y,selectionMode:x,onSelectionStart:N,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:b,zoomActivationKeyCode:k,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:T,panOnScroll:M,panOnScrollSpeed:L,panOnScrollMode:H,zoomOnDoubleClick:O,panOnDrag:P,defaultViewport:F,translateExtent:G,minZoom:q,maxZoom:j,preventScrolling:Q,onSelectionContextMenu:z,noWheelClassName:ne,noPanClassName:Z,disableKeyboardA11y:$})=>{const K=Ke(PM),I=pa(g),W=pa(b),X=W||P,U=W||M,J=I||y&&X!==!0;return yM({deleteKeyCode:c,multiSelectionKeyCode:S}),ue.createElement(bM,{onMove:p,onMoveStart:h,onMoveEnd:f,onPaneContextMenu:l,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:T,panOnScroll:U,panOnScrollSpeed:L,panOnScrollMode:H,zoomOnDoubleClick:O,panOnDrag:!I&&X,defaultViewport:F,translateExtent:G,minZoom:q,maxZoom:j,zoomActivationKeyCode:k,preventScrolling:Q,noWheelClassName:ne,noPanClassName:Z},ue.createElement(RN,{onSelectionStart:N,onSelectionEnd:_,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:X,isSelecting:!!J,selectionMode:x},e,K&&ue.createElement(MM,{onSelectionContextMenu:z,noPanClassName:Z,disableKeyboardA11y:$})))};MN.displayName="FlowRenderer";var OM=A.memo(MN);function LM(e){return Ke(A.useCallback(r=>e?cN(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):r.getNodes(),[e]))}function qM(e){const n={input:ea(e.input||wN),default:ea(e.default||av),output:ea(e.output||_N),group:ea(e.group||Lv)},r={},s=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,l)=>(o[l]=ea(e[l]||av),o),r);return{...n,...s}}const $M=({x:e,y:n,width:r,height:s,origin:o})=>!r||!s?{x:e,y:n}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:n}:{x:e-r*o[0],y:n-s*o[1]},DM=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),PN=e=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:s,elementsSelectable:o,updateNodeDimensions:l,onError:u}=Ke(DM,Rt),c=LM(e.onlyRenderVisibleElements),p=A.useRef(),h=A.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const f=new ResizeObserver(g=>{const y=g.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));l(y)});return p.current=f,f},[]);return A.useEffect(()=>()=>{var f;(f=p==null?void 0:p.current)==null||f.disconnect()},[]),ue.createElement("div",{className:"react-flow__nodes",style:qv},c.map(f=>{var T,M,L;let g=f.type||"default";e.nodeTypes[g]||(u==null||u("003",Dr.error003(g)),g="default");const y=e.nodeTypes[g]||e.nodeTypes.default,x=!!(f.draggable||n&&typeof f.draggable>"u"),N=!!(f.selectable||o&&typeof f.selectable>"u"),_=!!(f.connectable||r&&typeof f.connectable>"u"),S=!!(f.focusable||s&&typeof f.focusable>"u"),b=e.nodeExtent?Tv(f.positionAbsolute,e.nodeExtent):f.positionAbsolute,k=(b==null?void 0:b.x)??0,E=(b==null?void 0:b.y)??0,C=$M({x:k,y:E,width:f.width??0,height:f.height??0,origin:e.nodeOrigin});return ue.createElement(y,{key:f.id,id:f.id,className:f.className,style:f.style,type:g,data:f.data,sourcePosition:f.sourcePosition||Ae.Bottom,targetPosition:f.targetPosition||Ae.Top,hidden:f.hidden,xPos:k,yPos:E,xPosOrigin:C.x,yPosOrigin:C.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!f.selected,isDraggable:x,isSelectable:N,isConnectable:_,isFocusable:S,resizeObserver:h,dragHandle:f.dragHandle,zIndex:((T=f[pt])==null?void 0:T.z)??0,isParent:!!((M=f[pt])!=null&&M.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!f.width&&!!f.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:f.ariaLabel,hasHandleBounds:!!((L=f[pt])!=null&&L.handleBounds)})}))};PN.displayName="NodeRenderer";var FM=A.memo(PN);const zM=(e,n,r)=>r===Ae.Left?e-n:r===Ae.Right?e+n:e,BM=(e,n,r)=>r===Ae.Top?e-n:r===Ae.Bottom?e+n:e,hx="react-flow__edgeupdater",px=({position:e,centerX:n,centerY:r,radius:s=10,onMouseDown:o,onMouseEnter:l,onMouseOut:u,type:c})=>ue.createElement("circle",{onMouseDown:o,onMouseEnter:l,onMouseOut:u,className:Ft([hx,`${hx}-${c}`]),cx:zM(n,s,e),cy:BM(r,s,e),r:s,stroke:"transparent",fill:"transparent"}),UM=()=>!0;var Gs=e=>{const n=({id:r,className:s,type:o,data:l,onClick:u,onEdgeDoubleClick:c,selected:p,animated:h,label:f,labelStyle:g,labelShowBg:y,labelBgStyle:x,labelBgPadding:N,labelBgBorderRadius:_,style:S,source:b,target:k,sourceX:E,sourceY:C,targetX:T,targetY:M,sourcePosition:L,targetPosition:H,elementsSelectable:O,hidden:P,sourceHandleId:F,targetHandleId:G,onContextMenu:q,onMouseEnter:j,onMouseMove:Q,onMouseLeave:z,reconnectRadius:ne,onReconnect:Z,onReconnectStart:$,onReconnectEnd:K,markerEnd:I,markerStart:W,rfId:X,ariaLabel:U,isFocusable:J,isReconnectable:re,pathOptions:le,interactionWidth:de,disableKeyboardA11y:te})=>{const ce=A.useRef(null),[Ce,ve]=A.useState(!1),[Te,ye]=A.useState(!1),ke=jt(),Ge=A.useMemo(()=>`url('#${sv(W,X)}')`,[W,X]),we=A.useMemo(()=>`url('#${sv(I,X)}')`,[I,X]);if(P)return null;const _e=Je=>{var At;const{edges:kt,addSelectedEdges:rt,unselectNodesAndEdges:yt,multiSelectionActive:vn}=ke.getState(),Tt=kt.find($n=>$n.id===r);Tt&&(O&&(ke.setState({nodesSelectionActive:!1}),Tt.selected&&vn?(yt({nodes:[],edges:[Tt]}),(At=ce.current)==null||At.blur()):rt([r])),u&&u(Je,Tt))},Be=Zo(r,ke.getState,c),Ye=Zo(r,ke.getState,q),ot=Zo(r,ke.getState,j),tt=Zo(r,ke.getState,Q),Fe=Zo(r,ke.getState,z),Qe=(Je,kt)=>{if(Je.button!==0)return;const{edges:rt,isValidConnection:yt}=ke.getState(),vn=kt?k:b,Tt=(kt?G:F)||null,At=kt?"target":"source",$n=yt||UM,Dn=kt,Ze=rt.find(wn=>wn.id===r);ye(!0),$==null||$(Je,Ze,At);const yn=wn=>{ye(!1),K==null||K(wn,Ze,At)};mN({event:Je,handleId:Tt,nodeId:vn,onConnect:wn=>Z==null?void 0:Z(Ze,wn),isTarget:Dn,getState:ke.getState,setState:ke.setState,isValidConnection:$n,edgeUpdaterType:At,onReconnectEnd:yn})},ft=Je=>Qe(Je,!0),St=Je=>Qe(Je,!1),nt=()=>ve(!0),vt=()=>ve(!1),Kt=!O&&!u,Ot=Je=>{var kt;if(!te&&rN.includes(Je.key)&&O){const{unselectNodesAndEdges:rt,addSelectedEdges:yt,edges:vn}=ke.getState();Je.key==="Escape"?((kt=ce.current)==null||kt.blur(),rt({edges:[vn.find(At=>At.id===r)]})):yt([r])}};return ue.createElement("g",{className:Ft(["react-flow__edge",`react-flow__edge-${o}`,s,{selected:p,animated:h,inactive:Kt,updating:Ce}]),onClick:_e,onDoubleClick:Be,onContextMenu:Ye,onMouseEnter:ot,onMouseMove:tt,onMouseLeave:Fe,onKeyDown:J?Ot:void 0,tabIndex:J?0:void 0,role:J?"button":"img","data-testid":`rf__edge-${r}`,"aria-label":U===null?void 0:U||`Edge from ${b} to ${k}`,"aria-describedby":J?`${kN}-${X}`:void 0,ref:ce},!Te&&ue.createElement(e,{id:r,source:b,target:k,selected:p,animated:h,label:f,labelStyle:g,labelShowBg:y,labelBgStyle:x,labelBgPadding:N,labelBgBorderRadius:_,data:l,style:S,sourceX:E,sourceY:C,targetX:T,targetY:M,sourcePosition:L,targetPosition:H,sourceHandleId:F,targetHandleId:G,markerStart:Ge,markerEnd:we,pathOptions:le,interactionWidth:de}),re&&ue.createElement(ue.Fragment,null,(re==="source"||re===!0)&&ue.createElement(px,{position:L,centerX:E,centerY:C,radius:ne,onMouseDown:ft,onMouseEnter:nt,onMouseOut:vt,type:"source"}),(re==="target"||re===!0)&&ue.createElement(px,{position:H,centerX:T,centerY:M,radius:ne,onMouseDown:St,onMouseEnter:nt,onMouseOut:vt,type:"target"})))};return n.displayName="EdgeWrapper",A.memo(n)};function HM(e){const n={default:Gs(e.default||cu),straight:Gs(e.bezier||Mv),step:Gs(e.step||Iv),smoothstep:Gs(e.step||xu),simplebezier:Gs(e.simplebezier||Av)},r={},s=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,l)=>(o[l]=Gs(e[l]||cu),o),r);return{...n,...s}}function mx(e,n,r=null){const s=((r==null?void 0:r.x)||0)+n.x,o=((r==null?void 0:r.y)||0)+n.y,l=(r==null?void 0:r.width)||n.width,u=(r==null?void 0:r.height)||n.height;switch(e){case Ae.Top:return{x:s+l/2,y:o};case Ae.Right:return{x:s+l,y:o+u/2};case Ae.Bottom:return{x:s+l/2,y:o+u};case Ae.Left:return{x:s,y:o+u/2}}}function gx(e,n){return e?e.length===1||!n?e[0]:n&&e.find(r=>r.id===n)||null:null}const WM=(e,n,r,s,o,l)=>{const u=mx(r,e,n),c=mx(l,s,o);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y}};function VM({sourcePos:e,targetPos:n,sourceWidth:r,sourceHeight:s,targetWidth:o,targetHeight:l,width:u,height:c,transform:p}){const h={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x+r,n.x+o),y2:Math.max(e.y+s,n.y+l)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const f=fa({x:(0-p[0])/p[2],y:(0-p[1])/p[2],width:u/p[2],height:c/p[2]}),g=Math.max(0,Math.min(f.x2,h.x2)-Math.max(f.x,h.x)),y=Math.max(0,Math.min(f.y2,h.y2)-Math.max(f.y,h.y));return Math.ceil(g*y)>0}function vx(e){var s,o,l,u,c;const n=((s=e==null?void 0:e[pt])==null?void 0:s.handleBounds)||null,r=n&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)<"u";return[{x:((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.x)||0,y:((c=e==null?void 0:e.positionAbsolute)==null?void 0:c.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},n,!!r]}const GM=[{level:0,isMaxLevel:!0,edges:[]}];function YM(e,n,r=!1){let s=-1;const o=e.reduce((u,c)=>{var f,g;const p=On(c.zIndex);let h=p?c.zIndex:0;if(r){const y=n.get(c.target),x=n.get(c.source),N=c.selected||(y==null?void 0:y.selected)||(x==null?void 0:x.selected),_=Math.max(((f=x==null?void 0:x[pt])==null?void 0:f.z)||0,((g=y==null?void 0:y[pt])==null?void 0:g.z)||0,1e3);h=(p?c.zIndex:0)+(N?_:0)}return u[h]?u[h].push(c):u[h]=[c],s=h>s?h:s,u},{}),l=Object.entries(o).map(([u,c])=>{const p=+u;return{edges:c,level:p,isMaxLevel:p===s}});return l.length===0?GM:l}function KM(e,n,r){const s=Ke(A.useCallback(o=>e?o.edges.filter(l=>{const u=n.get(l.source),c=n.get(l.target);return(u==null?void 0:u.width)&&(u==null?void 0:u.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&VM({sourcePos:u.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:u.width,sourceHeight:u.height,targetWidth:c.width,targetHeight:c.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,n]));return YM(s,n,r)}const XM=({color:e="none",strokeWidth:n=1})=>ue.createElement("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),QM=({color:e="none",strokeWidth:n=1})=>ue.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),yx={[uu.Arrow]:XM,[uu.ArrowClosed]:QM};function ZM(e){const n=jt();return A.useMemo(()=>{var o,l;return Object.prototype.hasOwnProperty.call(yx,e)?yx[e]:((l=(o=n.getState()).onError)==null||l.call(o,"009",Dr.error009(e)),null)},[e])}const JM=({id:e,type:n,color:r,width:s=12.5,height:o=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:c="auto-start-reverse"})=>{const p=ZM(n);return p?ue.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0"},ue.createElement(p,{color:r,strokeWidth:u})):null},eP=({defaultColor:e,rfId:n})=>r=>{const s=[];return r.edges.reduce((o,l)=>([l.markerStart,l.markerEnd].forEach(u=>{if(u&&typeof u=="object"){const c=sv(u,n);s.includes(c)||(o.push({id:c,color:u.color||e,...u}),s.push(c))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))},ON=({defaultColor:e,rfId:n})=>{const r=Ke(A.useCallback(eP({defaultColor:e,rfId:n}),[e,n]),(s,o)=>!(s.length!==o.length||s.some((l,u)=>l.id!==o[u].id)));return ue.createElement("defs",null,r.map(s=>ue.createElement(JM,{id:s.id,key:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient})))};ON.displayName="MarkerDefinitions";var tP=A.memo(ON);const nP=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),LN=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:s,edgeTypes:o,noPanClassName:l,onEdgeContextMenu:u,onEdgeMouseEnter:c,onEdgeMouseMove:p,onEdgeMouseLeave:h,onEdgeClick:f,onEdgeDoubleClick:g,onReconnect:y,onReconnectStart:x,onReconnectEnd:N,reconnectRadius:_,children:S,disableKeyboardA11y:b})=>{const{edgesFocusable:k,edgesUpdatable:E,elementsSelectable:C,width:T,height:M,connectionMode:L,nodeInternals:H,onError:O}=Ke(nP,Rt),P=KM(n,H,r);return T?ue.createElement(ue.Fragment,null,P.map(({level:F,edges:G,isMaxLevel:q})=>ue.createElement("svg",{key:F,style:{zIndex:F},width:T,height:M,className:"react-flow__edges react-flow__container"},q&&ue.createElement(tP,{defaultColor:e,rfId:s}),ue.createElement("g",null,G.map(j=>{const[Q,z,ne]=vx(H.get(j.source)),[Z,$,K]=vx(H.get(j.target));if(!ne||!K)return null;let I=j.type||"default";o[I]||(O==null||O("011",Dr.error011(I)),I="default");const W=o[I]||o.default,X=L===os.Strict?$.target:($.target??[]).concat($.source??[]),U=gx(z.source,j.sourceHandle),J=gx(X,j.targetHandle),re=(U==null?void 0:U.position)||Ae.Bottom,le=(J==null?void 0:J.position)||Ae.Top,de=!!(j.focusable||k&&typeof j.focusable>"u"),te=j.reconnectable||j.updatable,ce=typeof y<"u"&&(te||E&&typeof te>"u");if(!U||!J)return O==null||O("008",Dr.error008(U,j)),null;const{sourceX:Ce,sourceY:ve,targetX:Te,targetY:ye}=WM(Q,U,re,Z,J,le);return ue.createElement(W,{key:j.id,id:j.id,className:Ft([j.className,l]),type:I,data:j.data,selected:!!j.selected,animated:!!j.animated,hidden:!!j.hidden,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,style:j.style,source:j.source,target:j.target,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerEnd:j.markerEnd,markerStart:j.markerStart,sourceX:Ce,sourceY:ve,targetX:Te,targetY:ye,sourcePosition:re,targetPosition:le,elementsSelectable:C,onContextMenu:u,onMouseEnter:c,onMouseMove:p,onMouseLeave:h,onClick:f,onEdgeDoubleClick:g,onReconnect:y,onReconnectStart:x,onReconnectEnd:N,reconnectRadius:_,rfId:s,ariaLabel:j.ariaLabel,isFocusable:de,isReconnectable:ce,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth,disableKeyboardA11y:b})})))),S):null};LN.displayName="EdgeRenderer";var rP=A.memo(LN);const iP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function sP({children:e}){const n=Ke(iP);return ue.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}function oP(e){const n=_a(),r=A.useRef(!1);A.useEffect(()=>{!r.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),r.current=!0)},[e,n.viewportInitialized])}const aP={[Ae.Left]:Ae.Right,[Ae.Right]:Ae.Left,[Ae.Top]:Ae.Bottom,[Ae.Bottom]:Ae.Top},qN=({nodeId:e,handleType:n,style:r,type:s=gi.Bezier,CustomComponent:o,connectionStatus:l})=>{var M,L,H;const{fromNode:u,handleId:c,toX:p,toY:h,connectionMode:f}=Ke(A.useCallback(O=>({fromNode:O.nodeInternals.get(e),handleId:O.connectionHandleId,toX:(O.connectionPosition.x-O.transform[0])/O.transform[2],toY:(O.connectionPosition.y-O.transform[1])/O.transform[2],connectionMode:O.connectionMode}),[e]),Rt),g=(M=u==null?void 0:u[pt])==null?void 0:M.handleBounds;let y=g==null?void 0:g[n];if(f===os.Loose&&(y=y||(g==null?void 0:g[n==="source"?"target":"source"])),!u||!y)return null;const x=c?y.find(O=>O.id===c):y[0],N=x?x.x+x.width/2:(u.width??0)/2,_=x?x.y+x.height/2:u.height??0,S=(((L=u.positionAbsolute)==null?void 0:L.x)??0)+N,b=(((H=u.positionAbsolute)==null?void 0:H.y)??0)+_,k=x==null?void 0:x.position,E=k?aP[k]:null;if(!k||!E)return null;if(o)return ue.createElement(o,{connectionLineType:s,connectionLineStyle:r,fromNode:u,fromHandle:x,fromX:S,fromY:b,toX:p,toY:h,fromPosition:k,toPosition:E,connectionStatus:l});let C="";const T={sourceX:S,sourceY:b,sourcePosition:k,targetX:p,targetY:h,targetPosition:E};return s===gi.Bezier?[C]=lN(T):s===gi.Step?[C]=iv({...T,borderRadius:0}):s===gi.SmoothStep?[C]=iv(T):s===gi.SimpleBezier?[C]=aN(T):C=`M${S},${b} ${p},${h}`,ue.createElement("path",{d:C,fill:"none",className:"react-flow__connection-path",style:r})};qN.displayName="ConnectionLine";const lP=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function uP({containerStyle:e,style:n,type:r,component:s}){const{nodeId:o,handleType:l,nodesConnectable:u,width:c,height:p,connectionStatus:h}=Ke(lP,Rt);return!(o&&l&&c&&u)?null:ue.createElement("svg",{style:e,width:c,height:p,className:"react-flow__edges react-flow__connectionline react-flow__container"},ue.createElement("g",{className:Ft(["react-flow__connection",h])},ue.createElement(qN,{nodeId:o,handleType:l,style:n,type:r,CustomComponent:s,connectionStatus:h})))}function wx(e,n){return A.useRef(null),jt(),A.useMemo(()=>n(e),[e])}const $N=({nodeTypes:e,edgeTypes:n,onMove:r,onMoveStart:s,onMoveEnd:o,onInit:l,onNodeClick:u,onEdgeClick:c,onNodeDoubleClick:p,onEdgeDoubleClick:h,onNodeMouseEnter:f,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:x,onSelectionContextMenu:N,onSelectionStart:_,onSelectionEnd:S,connectionLineType:b,connectionLineStyle:k,connectionLineComponent:E,connectionLineContainerStyle:C,selectionKeyCode:T,selectionOnDrag:M,selectionMode:L,multiSelectionKeyCode:H,panActivationKeyCode:O,zoomActivationKeyCode:P,deleteKeyCode:F,onlyRenderVisibleElements:G,elementsSelectable:q,selectNodesOnDrag:j,defaultViewport:Q,translateExtent:z,minZoom:ne,maxZoom:Z,preventScrolling:$,defaultMarkerColor:K,zoomOnScroll:I,zoomOnPinch:W,panOnScroll:X,panOnScrollSpeed:U,panOnScrollMode:J,zoomOnDoubleClick:re,panOnDrag:le,onPaneClick:de,onPaneMouseEnter:te,onPaneMouseMove:ce,onPaneMouseLeave:Ce,onPaneScroll:ve,onPaneContextMenu:Te,onEdgeContextMenu:ye,onEdgeMouseEnter:ke,onEdgeMouseMove:Ge,onEdgeMouseLeave:we,onReconnect:_e,onReconnectStart:Be,onReconnectEnd:Ye,reconnectRadius:ot,noDragClassName:tt,noWheelClassName:Fe,noPanClassName:Qe,elevateEdgesOnSelect:ft,disableKeyboardA11y:St,nodeOrigin:nt,nodeExtent:vt,rfId:Kt})=>{const Ot=wx(e,qM),Je=wx(n,HM);return oP(l),ue.createElement(OM,{onPaneClick:de,onPaneMouseEnter:te,onPaneMouseMove:ce,onPaneMouseLeave:Ce,onPaneContextMenu:Te,onPaneScroll:ve,deleteKeyCode:F,selectionKeyCode:T,selectionOnDrag:M,selectionMode:L,onSelectionStart:_,onSelectionEnd:S,multiSelectionKeyCode:H,panActivationKeyCode:O,zoomActivationKeyCode:P,elementsSelectable:q,onMove:r,onMoveStart:s,onMoveEnd:o,zoomOnScroll:I,zoomOnPinch:W,zoomOnDoubleClick:re,panOnScroll:X,panOnScrollSpeed:U,panOnScrollMode:J,panOnDrag:le,defaultViewport:Q,translateExtent:z,minZoom:ne,maxZoom:Z,onSelectionContextMenu:N,preventScrolling:$,noDragClassName:tt,noWheelClassName:Fe,noPanClassName:Qe,disableKeyboardA11y:St},ue.createElement(sP,null,ue.createElement(rP,{edgeTypes:Je,onEdgeClick:c,onEdgeDoubleClick:h,onlyRenderVisibleElements:G,onEdgeContextMenu:ye,onEdgeMouseEnter:ke,onEdgeMouseMove:Ge,onEdgeMouseLeave:we,onReconnect:_e,onReconnectStart:Be,onReconnectEnd:Ye,reconnectRadius:ot,defaultMarkerColor:K,noPanClassName:Qe,elevateEdgesOnSelect:!!ft,disableKeyboardA11y:St,rfId:Kt},ue.createElement(uP,{style:k,type:b,component:E,containerStyle:C})),ue.createElement("div",{className:"react-flow__edgelabel-renderer"}),ue.createElement(FM,{nodeTypes:Ot,onNodeClick:u,onNodeDoubleClick:p,onNodeMouseEnter:f,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:x,selectNodesOnDrag:j,onlyRenderVisibleElements:G,noPanClassName:Qe,noDragClassName:tt,disableKeyboardA11y:St,nodeOrigin:nt,nodeExtent:vt,rfId:Kt})))};$N.displayName="GraphView";var cP=A.memo($N);const uv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],hi={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:uv,nodeExtent:uv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:os.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:qI,isValidConnection:void 0},dP=()=>Qj((e,n)=>({...hi,setNodes:r=>{const{nodeInternals:s,nodeOrigin:o,elevateNodesOnSelect:l}=n();e({nodeInternals:bd(r,s,o,l)})},getNodes:()=>Array.from(n().nodeInternals.values()),setEdges:r=>{const{defaultEdgeOptions:s={}}=n();e({edges:r.map(o=>({...s,...o}))})},setDefaultNodesAndEdges:(r,s)=>{const o=typeof r<"u",l=typeof s<"u",u=o?bd(r,new Map,n().nodeOrigin,n().elevateNodesOnSelect):new Map;e({nodeInternals:u,edges:l?s:[],hasDefaultNodes:o,hasDefaultEdges:l})},updateNodeDimensions:r=>{const{onNodesChange:s,nodeInternals:o,fitViewOnInit:l,fitViewOnInitDone:u,fitViewOnInitOptions:c,domNode:p,nodeOrigin:h}=n(),f=p==null?void 0:p.querySelector(".react-flow__viewport");if(!f)return;const g=window.getComputedStyle(f),{m22:y}=new window.DOMMatrixReadOnly(g.transform),x=r.reduce((_,S)=>{const b=o.get(S.id);if(b!=null&&b.hidden)o.set(b.id,{...b,[pt]:{...b[pt],handleBounds:void 0}});else if(b){const k=jv(S.nodeElement);!!(k.width&&k.height&&(b.width!==k.width||b.height!==k.height||S.forceUpdate))&&(o.set(b.id,{...b,[pt]:{...b[pt],handleBounds:{source:fx(".source",S.nodeElement,y,h),target:fx(".target",S.nodeElement,y,h)}},...k}),_.push({id:b.id,type:"dimensions",dimensions:k}))}return _},[]);NN(o,h);const N=u||l&&!u&&CN(n,{initial:!0,...c});e({nodeInternals:new Map(o),fitViewOnInitDone:N}),(x==null?void 0:x.length)>0&&(s==null||s(x))},updateNodePositions:(r,s=!0,o=!1)=>{const{triggerNodeChanges:l}=n(),u=r.map(c=>{const p={id:c.id,type:"position",dragging:o};return s&&(p.positionAbsolute=c.positionAbsolute,p.position=c.position),p});l(u)},triggerNodeChanges:r=>{const{onNodesChange:s,nodeInternals:o,hasDefaultNodes:l,nodeOrigin:u,getNodes:c,elevateNodesOnSelect:p}=n();if(r!=null&&r.length){if(l){const h=NM(r,c()),f=bd(h,o,u,p);e({nodeInternals:f})}s==null||s(r)}},addSelectedNodes:r=>{const{multiSelectionActive:s,edges:o,getNodes:l}=n();let u,c=null;s?u=r.map(p=>mi(p,!0)):(u=Xs(l(),r),c=Xs(o,[])),zl({changedNodes:u,changedEdges:c,get:n,set:e})},addSelectedEdges:r=>{const{multiSelectionActive:s,edges:o,getNodes:l}=n();let u,c=null;s?u=r.map(p=>mi(p,!0)):(u=Xs(o,r),c=Xs(l(),[])),zl({changedNodes:c,changedEdges:u,get:n,set:e})},unselectNodesAndEdges:({nodes:r,edges:s}={})=>{const{edges:o,getNodes:l}=n(),u=r||l(),c=s||o,p=u.map(f=>(f.selected=!1,mi(f.id,!1))),h=c.map(f=>mi(f.id,!1));zl({changedNodes:p,changedEdges:h,get:n,set:e})},setMinZoom:r=>{const{d3Zoom:s,maxZoom:o}=n();s==null||s.scaleExtent([r,o]),e({minZoom:r})},setMaxZoom:r=>{const{d3Zoom:s,minZoom:o}=n();s==null||s.scaleExtent([o,r]),e({maxZoom:r})},setTranslateExtent:r=>{var s;(s=n().d3Zoom)==null||s.translateExtent(r),e({translateExtent:r})},resetSelectedElements:()=>{const{edges:r,getNodes:s}=n(),l=s().filter(c=>c.selected).map(c=>mi(c.id,!1)),u=r.filter(c=>c.selected).map(c=>mi(c.id,!1));zl({changedNodes:l,changedEdges:u,get:n,set:e})},setNodeExtent:r=>{const{nodeInternals:s}=n();s.forEach(o=>{o.positionAbsolute=Tv(o.position,r)}),e({nodeExtent:r,nodeInternals:new Map(s)})},panBy:r=>{const{transform:s,width:o,height:l,d3Zoom:u,d3Selection:c,translateExtent:p}=n();if(!u||!c||!r.x&&!r.y)return!1;const h=qr.translate(s[0]+r.x,s[1]+r.y).scale(s[2]),f=[[0,0],[o,l]],g=u==null?void 0:u.constrain()(h,f,p);return u.transform(c,g),s[0]!==g.x||s[1]!==g.y||s[2]!==g.k},cancelConnection:()=>e({connectionNodeId:hi.connectionNodeId,connectionHandleId:hi.connectionHandleId,connectionHandleType:hi.connectionHandleType,connectionStatus:hi.connectionStatus,connectionStartHandle:hi.connectionStartHandle,connectionEndHandle:hi.connectionEndHandle}),reset:()=>e({...hi})}),Object.is),$v=({children:e})=>{const n=A.useRef(null);return n.current||(n.current=dP()),ue.createElement(TI,{value:n.current},e)};$v.displayName="ReactFlowProvider";const DN=({children:e})=>A.useContext(wu)?ue.createElement(ue.Fragment,null,e):ue.createElement($v,null,e);DN.displayName="ReactFlowWrapper";const fP={input:wN,default:av,output:_N,group:Lv},hP={default:cu,straight:Mv,step:Iv,smoothstep:xu,simplebezier:Av},pP=[0,0],mP=[15,15],gP={x:0,y:0,zoom:1},vP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},FN=A.forwardRef(({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,className:o,nodeTypes:l=fP,edgeTypes:u=hP,onNodeClick:c,onEdgeClick:p,onInit:h,onMove:f,onMoveStart:g,onMoveEnd:y,onConnect:x,onConnectStart:N,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:b,onNodeMouseEnter:k,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:M,onNodeDragStart:L,onNodeDrag:H,onNodeDragStop:O,onNodesDelete:P,onEdgesDelete:F,onSelectionChange:G,onSelectionDragStart:q,onSelectionDrag:j,onSelectionDragStop:Q,onSelectionContextMenu:z,onSelectionStart:ne,onSelectionEnd:Z,connectionMode:$=os.Strict,connectionLineType:K=gi.Bezier,connectionLineStyle:I,connectionLineComponent:W,connectionLineContainerStyle:X,deleteKeyCode:U="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:re=!1,selectionMode:le=ha.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:te=lu()?"Meta":"Control",zoomActivationKeyCode:ce=lu()?"Meta":"Control",snapToGrid:Ce=!1,snapGrid:ve=mP,onlyRenderVisibleElements:Te=!1,selectNodesOnDrag:ye=!0,nodesDraggable:ke,nodesConnectable:Ge,nodesFocusable:we,nodeOrigin:_e=pP,edgesFocusable:Be,edgesUpdatable:Ye,elementsSelectable:ot,defaultViewport:tt=gP,minZoom:Fe=.5,maxZoom:Qe=2,translateExtent:ft=uv,preventScrolling:St=!0,nodeExtent:nt,defaultMarkerColor:vt="#b1b1b7",zoomOnScroll:Kt=!0,zoomOnPinch:Ot=!0,panOnScroll:Je=!1,panOnScrollSpeed:kt=.5,panOnScrollMode:rt=ns.Free,zoomOnDoubleClick:yt=!0,panOnDrag:vn=!0,onPaneClick:Tt,onPaneMouseEnter:At,onPaneMouseMove:$n,onPaneMouseLeave:Dn,onPaneScroll:Ze,onPaneContextMenu:yn,children:Xt,onEdgeContextMenu:wn,onEdgeDoubleClick:fs,onEdgeMouseEnter:xn,onEdgeMouseMove:_r,onEdgeMouseLeave:hs,onEdgeUpdate:xi,onEdgeUpdateStart:_i,onEdgeUpdateEnd:or,onReconnect:_n,onReconnectStart:ar,onReconnectEnd:ps,reconnectRadius:bn=10,edgeUpdaterRadius:br=10,onNodesChange:lr,onEdgesChange:Et,noDragClassName:Br="nodrag",noWheelClassName:Ur="nowheel",noPanClassName:Qt="nopan",fitView:dn=!1,fitViewOptions:bi,connectOnClick:ms=!0,attributionPosition:Sr,proOptions:Si,defaultEdgeOptions:ki,elevateNodesOnSelect:gs=!0,elevateEdgesOnSelect:Hr=!1,disableKeyboardA11y:Ei=!1,autoPanOnConnect:Ni=!0,autoPanOnNodeDrag:We=!0,connectionRadius:go=20,isValidConnection:zt,onError:Wr,style:ur,id:Ci,nodeDragThreshold:kr,...cr},wt)=>{const Vr=Ci||"1";return ue.createElement("div",{...cr,style:{...ur,...vP},ref:wt,className:Ft(["react-flow",o]),"data-testid":"rf__wrapper",id:Ci},ue.createElement(DN,null,ue.createElement(cP,{onInit:h,onMove:f,onMoveStart:g,onMoveEnd:y,onNodeClick:c,onEdgeClick:p,onNodeMouseEnter:k,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:T,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:u,connectionLineType:K,connectionLineStyle:I,connectionLineComponent:W,connectionLineContainerStyle:X,selectionKeyCode:J,selectionOnDrag:re,selectionMode:le,deleteKeyCode:U,multiSelectionKeyCode:te,panActivationKeyCode:de,zoomActivationKeyCode:ce,onlyRenderVisibleElements:Te,selectNodesOnDrag:ye,defaultViewport:tt,translateExtent:ft,minZoom:Fe,maxZoom:Qe,preventScrolling:St,zoomOnScroll:Kt,zoomOnPinch:Ot,zoomOnDoubleClick:yt,panOnScroll:Je,panOnScrollSpeed:kt,panOnScrollMode:rt,panOnDrag:vn,onPaneClick:Tt,onPaneMouseEnter:At,onPaneMouseMove:$n,onPaneMouseLeave:Dn,onPaneScroll:Ze,onPaneContextMenu:yn,onSelectionContextMenu:z,onSelectionStart:ne,onSelectionEnd:Z,onEdgeContextMenu:wn,onEdgeDoubleClick:fs,onEdgeMouseEnter:xn,onEdgeMouseMove:_r,onEdgeMouseLeave:hs,onReconnect:_n??xi,onReconnectStart:ar??_i,onReconnectEnd:ps??or,reconnectRadius:bn??br,defaultMarkerColor:vt,noDragClassName:Br,noWheelClassName:Ur,noPanClassName:Qt,elevateEdgesOnSelect:Hr,rfId:Vr,disableKeyboardA11y:Ei,nodeOrigin:_e,nodeExtent:nt}),ue.createElement(oM,{nodes:e,edges:n,defaultNodes:r,defaultEdges:s,onConnect:x,onConnectStart:N,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:b,nodesDraggable:ke,nodesConnectable:Ge,nodesFocusable:we,edgesFocusable:Be,edgesUpdatable:Ye,elementsSelectable:ot,elevateNodesOnSelect:gs,minZoom:Fe,maxZoom:Qe,nodeExtent:nt,onNodesChange:lr,onEdgesChange:Et,snapToGrid:Ce,snapGrid:ve,connectionMode:$,translateExtent:ft,connectOnClick:ms,defaultEdgeOptions:ki,fitView:dn,fitViewOptions:bi,onNodesDelete:P,onEdgesDelete:F,onNodeDragStart:L,onNodeDrag:H,onNodeDragStop:O,onSelectionDrag:j,onSelectionDragStart:q,onSelectionDragStop:Q,noPanClassName:Qt,nodeOrigin:_e,rfId:Vr,autoPanOnConnect:Ni,autoPanOnNodeDrag:We,onError:Wr,connectionRadius:go,isValidConnection:zt,nodeDragThreshold:kr}),ue.createElement(iM,{onSelectionChange:G}),Xt,ue.createElement(II,{proOptions:Si,position:Sr}),ue.createElement(dM,{rfId:Vr,disableKeyboardA11y:Ei})))});FN.displayName="ReactFlow";const yP=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function zN(){return Ke(yP,Rt)}const BN=({id:e,x:n,y:r,width:s,height:o,style:l,color:u,strokeColor:c,strokeWidth:p,className:h,borderRadius:f,shapeRendering:g,onClick:y,selected:x})=>{const{background:N,backgroundColor:_}=l||{},S=u||N||_;return ue.createElement("rect",{className:Ft(["react-flow__minimap-node",{selected:x},h]),x:n,y:r,rx:f,ry:f,width:s,height:o,fill:S,stroke:c,strokeWidth:p,shapeRendering:g,onClick:y?b=>y(b,e):void 0})};BN.displayName="MiniMapNode";var wP=A.memo(BN);const xP=e=>e.nodeOrigin,_P=e=>e.getNodes().filter(n=>!n.hidden&&n.width&&n.height),Nd=e=>e instanceof Function?e:()=>e;function bP({nodeStrokeColor:e="transparent",nodeColor:n="#e2e2e2",nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o=2,nodeComponent:l=wP,onClick:u}){const c=Ke(_P,Rt),p=Ke(xP),h=Nd(n),f=Nd(e),g=Nd(r),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ue.createElement(ue.Fragment,null,c.map(x=>{const{x:N,y:_}=is(x,p).positionAbsolute;return ue.createElement(l,{key:x.id,x:N,y:_,width:x.width,height:x.height,style:x.style,selected:x.selected,className:g(x),color:h(x),borderRadius:s,strokeColor:f(x),strokeWidth:o,shapeRendering:y,onClick:u,id:x.id})}))}var SP=A.memo(bP);const kP=200,EP=150,NP=e=>{const n=e.getNodes(),r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:n.length>0?OI(_u(n,e.nodeOrigin),r):r,rfId:e.rfId}},CP="react-flow__minimap-desc";function UN({style:e,className:n,nodeStrokeColor:r="transparent",nodeColor:s="#e2e2e2",nodeClassName:o="",nodeBorderRadius:l=5,nodeStrokeWidth:u=2,nodeComponent:c,maskColor:p="rgb(240, 240, 240, 0.6)",maskStrokeColor:h="none",maskStrokeWidth:f=1,position:g="bottom-right",onClick:y,onNodeClick:x,pannable:N=!1,zoomable:_=!1,ariaLabel:S="React Flow mini map",inversePan:b=!1,zoomStep:k=10,offsetScale:E=5}){const C=jt(),T=A.useRef(null),{boundingRect:M,viewBB:L,rfId:H}=Ke(NP,Rt),O=(e==null?void 0:e.width)??kP,P=(e==null?void 0:e.height)??EP,F=M.width/O,G=M.height/P,q=Math.max(F,G),j=q*O,Q=q*P,z=E*q,ne=M.x-(j-M.width)/2-z,Z=M.y-(Q-M.height)/2-z,$=j+z*2,K=Q+z*2,I=`${CP}-${H}`,W=A.useRef(0);W.current=q,A.useEffect(()=>{if(T.current){const J=Pn(T.current),re=te=>{const{transform:ce,d3Selection:Ce,d3Zoom:ve}=C.getState();if(te.sourceEvent.type!=="wheel"||!Ce||!ve)return;const Te=-te.sourceEvent.deltaY*(te.sourceEvent.deltaMode===1?.05:te.sourceEvent.deltaMode?1:.002)*k,ye=ce[2]*Math.pow(2,Te);ve.scaleTo(Ce,ye)},le=te=>{const{transform:ce,d3Selection:Ce,d3Zoom:ve,translateExtent:Te,width:ye,height:ke}=C.getState();if(te.sourceEvent.type!=="mousemove"||!Ce||!ve)return;const Ge=W.current*Math.max(1,ce[2])*(b?-1:1),we={x:ce[0]-te.sourceEvent.movementX*Ge,y:ce[1]-te.sourceEvent.movementY*Ge},_e=[[0,0],[ye,ke]],Be=qr.translate(we.x,we.y).scale(ce[2]),Ye=ve.constrain()(Be,_e,Te);ve.transform(Ce,Ye)},de=QE().on("zoom",N?le:null).on("zoom.wheel",_?re:null);return J.call(de),()=>{J.on("zoom",null)}}},[N,_,b,k]);const X=y?J=>{const re=er(J);y(J,{x:re[0],y:re[1]})}:void 0,U=x?(J,re)=>{const le=C.getState().nodeInternals.get(re);x(J,le)}:void 0;return ue.createElement(Rv,{position:g,style:e,className:Ft(["react-flow__minimap",n]),"data-testid":"rf__minimap"},ue.createElement("svg",{width:O,height:P,viewBox:`${ne} ${Z} ${$} ${K}`,role:"img","aria-labelledby":I,ref:T,onClick:X},S&&ue.createElement("title",{id:I},S),ue.createElement(SP,{onClick:U,nodeColor:s,nodeStrokeColor:r,nodeBorderRadius:l,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:c}),ue.createElement("path",{className:"react-flow__minimap-mask",d:`M${ne-z},${Z-z}h${$+z*2}v${K+z*2}h${-$-z*2}z
|
|
57
|
+
M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fill:p,fillRule:"evenodd",stroke:h,strokeWidth:f,pointerEvents:"none"})))}UN.displayName="MiniMap";var RP=A.memo(UN);function jP(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ue.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function TP(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ue.createElement("path",{d:"M0 0h32v4.2H0z"}))}function AP(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ue.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function IP(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ue.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function MP(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ue.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const Qs=({children:e,className:n,...r})=>ue.createElement("button",{type:"button",className:Ft(["react-flow__controls-button",n]),...r},e);Qs.displayName="ControlButton";const PP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),HN=({style:e,showZoom:n=!0,showFitView:r=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:l,onZoomOut:u,onFitView:c,onInteractiveChange:p,className:h,children:f,position:g="bottom-left"})=>{const y=jt(),[x,N]=A.useState(!1),{isInteractive:_,minZoomReached:S,maxZoomReached:b}=Ke(PP,Rt),{zoomIn:k,zoomOut:E,fitView:C}=_a();if(A.useEffect(()=>{N(!0)},[]),!x)return null;const T=()=>{k(),l==null||l()},M=()=>{E(),u==null||u()},L=()=>{C(o),c==null||c()},H=()=>{y.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),p==null||p(!_)};return ue.createElement(Rv,{className:Ft(["react-flow__controls",h]),position:g,style:e,"data-testid":"rf__controls"},n&&ue.createElement(ue.Fragment,null,ue.createElement(Qs,{onClick:T,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},ue.createElement(jP,null)),ue.createElement(Qs,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},ue.createElement(TP,null))),r&&ue.createElement(Qs,{className:"react-flow__controls-fitview",onClick:L,title:"fit view","aria-label":"fit view"},ue.createElement(AP,null)),s&&ue.createElement(Qs,{className:"react-flow__controls-interactive",onClick:H,title:"toggle interactivity","aria-label":"toggle interactivity"},_?ue.createElement(MP,null):ue.createElement(IP,null)),f)};HN.displayName="Controls";var OP=A.memo(HN),nr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(nr||(nr={}));function LP({color:e,dimensions:n,lineWidth:r}){return ue.createElement("path",{stroke:e,strokeWidth:r,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function qP({color:e,radius:n}){return ue.createElement("circle",{cx:n,cy:n,r:n,fill:e})}const $P={[nr.Dots]:"#91919a",[nr.Lines]:"#eee",[nr.Cross]:"#e2e2e2"},DP={[nr.Dots]:1,[nr.Lines]:1,[nr.Cross]:6},FP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function WN({id:e,variant:n=nr.Dots,gap:r=20,size:s,lineWidth:o=1,offset:l=2,color:u,style:c,className:p}){const h=A.useRef(null),{transform:f,patternId:g}=Ke(FP,Rt),y=u||$P[n],x=s||DP[n],N=n===nr.Dots,_=n===nr.Cross,S=Array.isArray(r)?r:[r,r],b=[S[0]*f[2]||1,S[1]*f[2]||1],k=x*f[2],E=_?[k,k]:b,C=N?[k/l,k/l]:[E[0]/l,E[1]/l];return ue.createElement("svg",{className:Ft(["react-flow__background",p]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:h,"data-testid":"rf__background"},ue.createElement("pattern",{id:g+e,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`},N?ue.createElement(qP,{color:y,radius:k/l}):ue.createElement(LP,{dimensions:E,color:y,lineWidth:o})),ue.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${g+e})`}))}WN.displayName="Background";var zP=A.memo(WN);function VN(){return{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreateTokens:0}}function GN(e){const n=e.cache_creation,r=n&&typeof n=="object"?n:e,s=r.ephemeral_1h_input_tokens,o=r.ephemeral_5m_input_tokens;return typeof s!="number"&&typeof o!="number"?{}:{cacheCreate1hTokens:Number(s??0),cacheCreate5mTokens:Number(o??0)}}function YN(e,n=0){if(!e||typeof e!="object"||n>6)return null;const r=e;if(typeof r.input_tokens=="number"||typeof r.output_tokens=="number"||typeof r.cache_read_input_tokens=="number"||typeof r.cache_creation_input_tokens=="number")return{inputTokens:Number(r.input_tokens??0),outputTokens:Number(r.output_tokens??0),cacheReadTokens:Number(r.cache_read_input_tokens??0),cacheCreateTokens:Number(r.cache_creation_input_tokens??0),...GN(r)};for(const s of Object.values(r)){const o=YN(s,n+1);if(o)return o}return null}function BP(e,n){e.inputTokens+=n.inputTokens,e.outputTokens+=n.outputTokens,e.cacheReadTokens+=n.cacheReadTokens,e.cacheCreateTokens+=n.cacheCreateTokens,(n.cacheCreate1hTokens!==void 0||n.cacheCreate5mTokens!==void 0)&&(e.cacheCreate1hTokens=(e.cacheCreate1hTokens??0)+(n.cacheCreate1hTokens??0),e.cacheCreate5mTokens=(e.cacheCreate5mTokens??0)+(n.cacheCreate5mTokens??0))}const UP=/^(?:claude[-_]|gpt[-_]|o\d|codex[-_])/i;function KN(e,n=0){if(!e||typeof e!="object"||n>6)return null;const r=e;if(typeof r.model=="string"&&UP.test(r.model))return r.model;for(const s of Object.values(r)){const o=KN(s,n+1);if(o)return o}return null}function cv(){return{agents:new Map,toolIndex:new Map,toolOwner:new Map,activeSubagentStack:new Map,lastSeq:0,seqEpoch:null,totalEvents:0}}function yi(e){if(!e)return;const n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n[n.length-1]}function Dv(e,n){return`${e}::${n}`}function du(e){return e.agent_type??e.subagent_type??"subagent"}function dv(e){return e.agent_id?e.agent_id:e.parent_tool_use_id?e.parent_tool_use_id:null}function Zs(e,n,r,s){const o=n;let l=e.agents.get(o);return l||(l={id:o,sessionId:n,label:"session",kind:"root",state:"active",startedAt:r,tools:[],prompts:[],toolCount:0,childCount:0,synthetic:s,usage:VN()},e.agents.set(o,l),l)}function XN(e,n,r,s){const o=Dv(n,r),l=e.agents.get(o);if(!l)return null;!l.cwd&&s.cwd&&(l.cwd=s.cwd,l.cwdBasename=yi(s.cwd));const u=du(s);return u&&(l.label==="subagent"||!l.label)&&(l.label=u),l}function xx(e,n,r){const s=n.session_id??"unknown",o=dv(n);if(o){const p=XN(e,s,o,n);if(p)return p}const l=e.activeSubagentStack.get(s),u=l&&l.length>0?l[l.length-1]:null;if(u){const p=e.agents.get(Dv(s,u));if(p)return!p.cwd&&n.cwd&&(p.cwd=n.cwd,p.cwdBasename=yi(n.cwd)),p}const c=Zs(e,s,r,!1);return c.synthetic&&(c.synthetic=!1,c.startedAt=r),!c.cwd&&n.cwd&&(c.cwd=n.cwd,c.cwdBasename=yi(n.cwd)),c.label==="session"&&n.cwd&&(c.label=yi(n.cwd)??"session"),c}function HP(e,n,r,s,o){const l=Dv(n,r),u=Zs(e,n,o,!0);let c=e.agents.get(l);if(c){!c.cwd&&s.cwd&&(c.cwd=s.cwd,c.cwdBasename=yi(s.cwd));const p=du(s);return p&&(c.label==="subagent"||!c.label)&&(c.label=p),c}return c={id:l,sessionId:n,label:du(s),kind:"subagent",parentId:u.id,state:"active",startedAt:o,tools:[],prompts:[],cwd:s.cwd,cwdBasename:yi(s.cwd),toolCount:0,childCount:0,usage:VN()},e.agents.set(l,c),u.childCount+=1,c}function WP(e,n,r){const s=e.activeSubagentStack.get(n)??[];s.includes(r)||(s.push(r),e.activeSubagentStack.set(n,s))}function VP(e,n,r){const s=e.activeSubagentStack.get(n);if(s){for(let o=s.length-1;o>=0;o--)if(s[o]===r){s.splice(o,1);break}s.length===0&&e.activeSubagentStack.delete(n)}}function Ul(e,n=80){if(e==null)return"";if(typeof e=="string")return e.length>n?e.slice(0,n-1)+"…":e;try{const r=JSON.stringify(e);return r.length>n?r.slice(0,n-1)+"…":r}catch{return String(e)}}const _x=200,GP=25;function YP(e,n){const r=n.tools;if(r.length>_x){const s=r.splice(0,r.length-_x);for(const o of s)e.toolIndex.delete(o.id),e.toolOwner.delete(o.id)}for(let s=r.length-GP-1;s>=0;s--){const o=r[s];if(o.trimmed)break;o.input=void 0,o.response=void 0,o.trimmed=!0}}function KP(e,n,r){const s=e.toolIndex.get(r);if(s)return s;for(let o=n.tools.length-1;o>=0;o--)if(n.tools[o].id===r)return n.tools[o];return null}const bx=2e3;function XP(e,n,r){for(let s=e.prompts.length-1;s>=0;s--){const o=e.prompts[s];if(o.at<n-bx)return!1;if(o.text===r&&o.at<=n+bx)return!0}return!1}function QP(e,n,r,s){if(e.agents.size<=r)return!1;const o=[];for(const[u,c]of e.agents)c.state==="done"&&c.endedAt!=null&&n-c.endedAt>s&&o.push({id:u,endedAt:c.endedAt});if(o.length===0)return!1;o.sort((u,c)=>u.endedAt-c.endedAt);let l=0;for(const u of o){if(e.agents.size<=r)break;e.agents.delete(u.id),l++}return l>0}function ZP(e,n,r,s){const o=new Map;for(const[h,f]of e.agents){let g=o.get(f.sessionId);g||(g={ids:[],endedAt:0,live:!1},o.set(f.sessionId,g)),g.ids.push(h),f.state==="done"&&f.endedAt!=null?g.endedAt=Math.max(g.endedAt,f.endedAt):g.live=!0}const l=[...o.values()].filter(h=>!h.live&&h.endedAt>0&&n-h.endedAt>s).sort((h,f)=>h.endedAt-f.endedAt);let c=[...o.values()].filter(h=>!h.live).length-r;if(c<=0)return!1;let p=!1;for(const h of l){if(c<=0)break;for(const f of h.ids)e.agents.delete(f);c--,p=!0}return p}function JP(e,n,r){let s=!1;for(const o of e.agents.values())for(const l of o.tools)l.endedAt==null&&n-l.startedAt>r&&(l.endedAt=l.startedAt+r,l.ok=!1,l.errorPreview="stale (no PostToolUse received)",e.toolIndex.delete(l.id),e.toolOwner.delete(l.id),s=!0);return s}function eO(e){return e==="permission_prompt"?"permission":e==="idle_prompt"?"idle":null}const tO=new Set(["Notification","ModelObserved","ContextObserved","UsageObserved"]);function Sx(e,n){const r=n.epoch??null;if(r!==null&&r!==e.seqEpoch)e.seqEpoch=r,e.lastSeq=0;else if(n.seq<=e.lastSeq)return e;const s=n.payload??{},o=n.receivedAt,l=s.hook_event_name??"Unknown";if(l==="__clear")return{...cv(),lastSeq:n.seq,seqEpoch:e.seqEpoch};e.totalEvents+=1,e.lastSeq=n.seq;const u=s.session_id??"unknown";if(!tO.has(l)){const h=e.agents.get(u);h!=null&&h.waiting&&(h.waiting=null)}if(typeof s.model_context_window=="number"&&s.model_context_window>0){const h=e.agents.get(u);h&&(h.contextWindow=s.model_context_window)}if(l==="ModelObserved"){const h=typeof s.model=="string"?s.model:null;if(h){const g=e.agents.get(u);g&&(g.model=h)}const f=s.subagentModels;if(f&&typeof f=="object")for(const[g,y]of Object.entries(f)){if(typeof y!="string")continue;const x=`${u}::${g}`,N=e.agents.get(x);N&&(N.model=y)}return e}if(l==="ContextObserved"){const h=s.context??null;if(h){const f=e.agents.get(u);f&&(f.context={msgsUser:Number(h.msgsUser??0),msgsAssistant:Number(h.msgsAssistant??0),toolUses:Number(h.toolUses??0),toolResults:Number(h.toolResults??0),systemReminders:Number(h.systemReminders??0),currentContextTokens:Number(h.currentContextTokens??0),claudeMdFiles:Array.isArray(h.claudeMdFiles)?h.claudeMdFiles:[]})}return e}if(l==="UsageObserved"){const h=s.usage??null;if(h){const f=e.agents.get(u);if(f){f.usage.inputTokens=Number(h.input_tokens??0),f.usage.outputTokens=Number(h.output_tokens??0),f.usage.cacheReadTokens=Number(h.cache_read_input_tokens??h.cached_input_tokens??0),f.usage.cacheCreateTokens=Number(h.cache_creation_input_tokens??0);const g=GN(h);f.usage.cacheCreate1hTokens=g.cacheCreate1hTokens,f.usage.cacheCreate5mTokens=g.cacheCreate5mTokens,typeof h.reasoning_output_tokens=="number"&&(f.usage.reasoningOutputTokens=Number(h.reasoning_output_tokens))}}return e}const c=xx(e,s,o);c.provider||(c.provider=s.provider==="codex"?"codex":"claude");const p=KN(s);switch(p&&(c.model=p),l){case"SessionStart":{const h=Zs(e,u,o,!1);h.synthetic=!1,h.state="active",h.startedAt=h.startedAt||o,!h.cwd&&s.cwd&&(h.cwd=s.cwd,h.cwdBasename=yi(s.cwd)),h.label==="session"&&s.cwd&&(h.label=yi(s.cwd)??"session");break}case"UserPromptSubmit":{for(const y of e.agents.values())y.sessionId===u&&y.kind==="subagent"&&y.state==="done"&&y.exitAt==null&&y.endedAt!=null&&y.endedAt<o&&(y.exitAt=o);const h=Zs(e,u,o,!1);h.state="active",h.endedAt=void 0,h.exitAt=void 0;const f=xx(e,s,o);f.state="active",f.exitAt=void 0,f.endedAt=void 0;const g=(typeof s.prompt=="string"?s.prompt:typeof s.message=="string"?s.message:"")??"";g&&!XP(f,o,g)&&(f.prompts.push({at:o,text:g}),f.firstPrompt||(f.firstPrompt=Ul(g,120)));break}case"PreToolUse":{const h=s.tool_use_id?KP(e,c,s.tool_use_id):null;if(h){s.tool_name&&h.name==="?"&&(h.name=s.tool_name),h.endedAt==null&&!h.trimmed&&s.tool_input!==void 0&&(h.input=s.tool_input,h.inputPreview=Ul(s.tool_input));break}const f=s.tool_use_id??`${c.id}:${c.toolCount}`,g={id:f,name:s.tool_name??"?",input:s.tool_input,inputPreview:Ul(s.tool_input),agentId:c.id,startedAt:o};c.tools.push(g),c.toolCount+=1,c.state="active",e.toolIndex.set(f,g),e.toolOwner.set(f,c.id),YP(e,c);break}case"PostToolUse":case"PostToolUseFailure":{const h=s.tool_use_id;if(!h)break;let f=e.toolIndex.get(h),g=!1;if(!f)for(const N of e.agents.values()){const _=N.tools.find(S=>S.id===h);if(_){f=_,g=!0;break}}if(!f)break;f.endedAt=o,f.ok=l==="PostToolUse",f.trimmed||(f.response=s.tool_response),l==="PostToolUseFailure"?f.errorPreview=Ul(s.tool_response):g&&(f.errorPreview=void 0);const y=YN(s.tool_response);y&&(f.usage=y),e.toolIndex.delete(h);const x=e.toolOwner.get(h)??f.agentId;if(e.toolOwner.delete(h),x&&y){const N=e.agents.get(x);N&&BP(N.usage,y)}break}case"SubagentStart":{const h=dv(s);if(!h)break;const f=HP(e,u,h,s,o);f.state="active",f.startedAt=f.startedAt||o,f.exitAt=void 0,f.endedAt=void 0;const g=du(s);g&&(f.label=g),WP(e,u,h);break}case"SubagentStop":{const h=dv(s);if(!h)break;const f=XN(e,u,h,s);if(!f)break;f.state="done",f.endedAt=o,VP(e,u,h);break}case"Stop":case"SessionEnd":{const h=Zs(e,u,o,!1);h.state="done",h.endedAt=o,e.activeSubagentStack.delete(u);break}case"Notification":{const h=eO(s.notification_type);if(!h)break;const f=Zs(e,u,o,!1),g=typeof s.message=="string"?s.message:"",y=f.waiting;f.waiting=y&&y.kind===h&&y.message===g?{kind:h,message:g,since:Math.min(y.since,o)}:{kind:h,message:g,since:o};break}}return e}function Fv(e){let n=5381;for(let r=0;r<e.length;r++)n=(n<<5)+n^e.charCodeAt(r);return Math.abs(n)%360}const nO=Date.UTC(2026,8,1);function rO(e){return e<nO?{input:2,output:10,cacheRead:.2,cacheWrite:2.5,cacheWrite1h:4}:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}}const iO=[{match:/^claude[-_](fable|mythos)[-_]5\b/i,rates:{input:10,output:50,cacheRead:1,cacheWrite:12.5,cacheWrite1h:20}},{match:/^claude[-_]opus[-_]5\b/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25,cacheWrite1h:10}},{match:/^claude[-_]sonnet[-_]5\b/i,rates:rO},{match:/^claude[-_]opus[-_]4[-_.](?:5|6|7|8)\b/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25,cacheWrite1h:10}},{match:/^claude[-_]opus[-_]4(?:[-_.]1)?\b/i,rates:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75,cacheWrite1h:30}},{match:/^claude[-_]sonnet[-_]4[-_.](?:5|6)\b/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}},{match:/^claude[-_]sonnet[-_]4\b/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}},{match:/^claude[-_]haiku[-_]4[-_.]5\b/i,rates:{input:1,output:5,cacheRead:.1,cacheWrite:1.25,cacheWrite1h:2}},{match:/^claude[-_]haiku[-_]3[-_.]5\b/i,rates:{input:.8,output:4,cacheRead:.08,cacheWrite:1,cacheWrite1h:1.6}},{match:/^gpt[-_]5[-_.]6[-_]cyber/i,rates:{input:12.5,output:75,cacheRead:1.25,cacheWrite:0}},{match:/^gpt[-_]5[-_.]6[-_]luna/i,rates:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25}},{match:/^gpt[-_]5[-_.]6[-_]terra/i,rates:{input:2,output:12,cacheRead:.2,cacheWrite:2.5}},{match:/^gpt[-_]5[-_.]6(?:[-_]sol)?\b/i,rates:{input:5,output:30,cacheRead:.5,cacheWrite:6.25}},{match:/^gpt[-_]5[-_.]5[-_]pro/i,rates:{input:30,output:180,cacheRead:30,cacheWrite:0}},{match:/^gpt[-_]5[-_.]5\b/i,rates:{input:5,output:30,cacheRead:.5,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]pro/i,rates:{input:30,output:180,cacheRead:3,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]mini/i,rates:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]nano/i,rates:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4\b/i,rates:{input:2.5,output:15,cacheRead:.25,cacheWrite:0}},{match:/^gpt[-_]5[-_.]3[-_]codex/i,rates:{input:1.75,output:14,cacheRead:.175,cacheWrite:0}},{match:/^gpt[-_]5[-_.]2[-_]pro/i,rates:{input:21,output:168,cacheRead:21,cacheWrite:0}},{match:/^gpt[-_]5[-_.]2\b/i,rates:{input:1.75,output:14,cacheRead:.175,cacheWrite:0}},{match:/^codex[-_]mini/i,rates:{input:1.5,output:6,cacheRead:.375,cacheWrite:0}},{match:/^o1[-_]pro/i,rates:{input:150,output:600,cacheRead:150,cacheWrite:0}},{match:/^o1\b/i,rates:{input:15,output:60,cacheRead:7.5,cacheWrite:0}},{match:/^o3[-_]mini/i,rates:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0}},{match:/^o3[-_]pro/i,rates:{input:20,output:80,cacheRead:20,cacheWrite:0}},{match:/^o4[-_]mini/i,rates:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0}},{match:/^o3\b/i,rates:{input:2,output:8,cacheRead:.5,cacheWrite:0}}];function sO(e){return e?/^(?:gpt[-_]|codex[-_]|o\d)/i.test(e):!1}function zv(e,n=Date.now()){if(!e)return null;for(const r of iO)if(r.match.test(e))return typeof r.rates=="function"?r.rates(n):r.rates;return null}function QN(e,n){const r=Math.max(0,e.cacheCreate1hTokens??0),s=Math.max(0,e.cacheCreate5mTokens??0),o=Math.max(0,e.cacheCreateTokens-r-s),l=s+o,u=n.cacheWrite1h??n.cacheWrite;return{tokens5m:l,tokens1h:r,usd5m:l*n.cacheWrite/1e6,usd1h:r*u/1e6}}function ZN(e,n){return sO(n)?Math.max(0,e.inputTokens-e.cacheReadTokens):e.inputTokens}function un(e,n,r=Date.now()){const s=zv(n,r);if(!s)return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0};const o=ZN(e,n)*s.input/1e6,l=e.outputTokens*s.output/1e6,u=e.cacheReadTokens*s.cacheRead/1e6,c=QN(e,s),p=c.usd5m+c.usd1h;return{input:o,output:l,cacheRead:u,cacheWrite:p,total:o+l+u+p}}const kx=2e5,oO=1e6,aO=[/\[1m\]/i,/^claude[-_]opus[-_]5\b/i,/^claude[-_]sonnet[-_]5\b/i,/^claude[-_]opus[-_]4[-_.](?:5|6|7|8)\b/i,/^claude[-_]sonnet[-_]4[-_.]6\b/i,/^claude[-_](fable|mythos)[-_]5\b/i],lO=[{match:/^gpt[-_]5[-_.]6[-_]cyber/i,window:4e5},{match:/^gpt[-_]5[-_.]6/i,window:105e4},{match:/^gpt[-_]5[-_.]5/i,window:105e4},{match:/^gpt[-_]5[-_.]4[-_](?:mini|nano)/i,window:4e5},{match:/^gpt[-_]5[-_.]4/i,window:105e4},{match:/^gpt[-_]5[-_.]3[-_]codex[-_]spark/i,window:128e3},{match:/^gpt[-_]5[-_.]3[-_]codex/i,window:4e5},{match:/^gpt[-_]5[-_.]2/i,window:4e5},{match:/^gpt[-_]5/i,window:4e5},{match:/^codex[-_]mini/i,window:2e5},{match:/^o\d/i,window:2e5}];function uO(e){if(!e)return kx;for(const n of aO)if(n.test(e))return oO;for(const n of lO)if(n.match.test(e))return n.window;return kx}function JN(e,n){return typeof e=="number"&&e>0?e:uO(n)}function ze(e){if(e<=0)return"—";if(e<.005)return"<1¢";if(e<1){const n=(e*100).toFixed(e<.1?1:0);if(Number(n)<100)return`${n}¢`}return e<100?`$${e.toFixed(2)}`:e<1e4?`$${e.toFixed(0)}`:`$${(e/1e3).toFixed(1)}k`}function fu(e,n){if(e<=0||n<10)return null;const r=e/n,s=r*60;return s>=.01?`${ze(s)}/min`:`${ze(r*3600)}/hr`}const cO=1;function dO(){const e=[];let n=0;return{push(r,s=0){const o={dismiss:r,layer:s,seq:n++};return e.push(o),()=>{const l=e.indexOf(o);l!==-1&&e.splice(l,1)}},dismissTop(){let r;for(const s of e)(!r||s.layer>r.layer||s.layer===r.layer&&s.seq>r.seq)&&(r=s);return r?(r.dismiss(),!0):!1},depth(){return e.length}}}const fv=dO();function fO(e){return e.overlayOpen?"dismiss":e.typing?"blur":"clear-selection"}function Ex(e){return String(e.tagName??"").toUpperCase()==="BODY"}function hO(e,n){return!e||!e.isConnected||Ex(e)?!1:n==null||Ex(n)}function uo(e,n={}){const{focusRef:r,layer:s}=n,o=A.useRef(e);o.current=e,A.useEffect(()=>fv.push(()=>o.current(),s),[s]),A.useEffect(()=>{var u;const l=document.activeElement;return(u=r==null?void 0:r.current)==null||u.focus(),()=>{hO(l,document.activeElement)&&l.focus()}},[])}function Mn(e){return e.toLocaleString()}function pO(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}const mO=60;function gO(e,n=mO){if(e.length<=n)return e;const r=e.slice(e.length-(n-1)),s=r.search(/[/\\]/);return"…"+(s===-1?r:r.slice(s))}function vO({agent:e,onClose:n}){var f;const r=A.useRef(null);uo(n,{focusRef:r});const s=e.context,o=e.usage,l=(s==null?void 0:s.currentContextTokens)??0,u=JN(e.contextWindow,e.model),c=Math.min(100,l/u*100),p=un(o,e.model),h=o.inputTokens+o.cacheReadTokens+o.cacheCreateTokens;return m.jsx("div",{className:"ctx-modal-backdrop",onClick:n,role:"presentation",children:m.jsxs("div",{className:"ctx-modal",onClick:g=>g.stopPropagation(),role:"dialog","aria-label":"Context breakdown",children:[m.jsxs("header",{className:"ctx-modal-head",children:[m.jsxs("div",{children:[m.jsxs("div",{className:"ctx-modal-title",children:["Context · ",e.label]}),m.jsx("div",{className:"ctx-modal-sub",children:"approximation — CC's /context isn't hook-exposed"})]}),m.jsx("button",{type:"button",ref:r,className:"ctx-modal-close",onClick:n,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]}),m.jsxs("section",{className:"ctx-window-row",children:[m.jsx("div",{className:"ctx-window-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(c),children:m.jsx("div",{className:"ctx-window-fill",style:{width:`${c}%`}})}),m.jsxs("div",{className:"ctx-window-meta",children:[m.jsxs("span",{className:"ctx-window-pct",children:[c.toFixed(1),"%"]}),m.jsxs("span",{children:[Mn(l)," / ",Mn(u)," tok (current turn)"]})]})]}),m.jsx("h3",{className:"ctx-section-title",children:"Cumulative usage · whole session"}),m.jsxs("div",{className:"ctx-grid",children:[m.jsx(Jn,{label:"input tokens",val:Mn(o.inputTokens)}),m.jsx(Jn,{label:"output tokens",val:Mn(o.outputTokens)}),m.jsx(Jn,{label:"cache reads",val:Mn(o.cacheReadTokens)}),m.jsx(Jn,{label:"cache writes",val:Mn(o.cacheCreateTokens)}),m.jsx(Jn,{label:"cumulative total",val:Mn(h)}),m.jsx(Jn,{label:"estimated cost",val:ze(p.total),accent:!0})]}),m.jsx("h3",{className:"ctx-section-title",children:"Transcript composition"}),m.jsxs("div",{className:"ctx-grid",children:[m.jsx(Jn,{label:"user messages",val:Mn((s==null?void 0:s.msgsUser)??0)}),m.jsx(Jn,{label:"assistant messages",val:Mn((s==null?void 0:s.msgsAssistant)??0)}),m.jsx(Jn,{label:"tool uses",val:Mn((s==null?void 0:s.toolUses)??0)}),m.jsx(Jn,{label:"tool results",val:Mn((s==null?void 0:s.toolResults)??0)}),m.jsx(Jn,{label:"system-reminders",val:Mn((s==null?void 0:s.systemReminders)??0)})]}),m.jsx("h3",{className:"ctx-section-title",children:"CLAUDE.md files in scope"}),(((f=s==null?void 0:s.claudeMdFiles)==null?void 0:f.length)??0)===0?m.jsx("div",{className:"ctx-empty",children:"No CLAUDE.md files found on the path from cwd to ~/.claude."}):m.jsx("ul",{className:"ctx-md-list",children:s.claudeMdFiles.map(g=>m.jsxs("li",{children:[m.jsx("span",{className:"ctx-md-path",title:g.path,children:gO(g.path)}),m.jsx("span",{className:"ctx-md-size",children:pO(g.bytes)})]},g.path))})]})})}function Jn({label:e,val:n,accent:r}){return m.jsxs("div",{className:`ctx-row${r?" accent":""}`,children:[m.jsx("span",{className:"ctx-row-label",children:e}),m.jsx("span",{className:"ctx-row-val",children:n})]})}function yO({currentContextTokens:e,modelId:n,contextWindow:r,size:s=26,onClick:o,title:l}){const u=JN(r,n),c=Math.min(1,e/u),p=s/2-3,h=s/2,f=2*Math.PI*p,g=f*c,y=c>.9?"var(--err)":c>.7?"var(--inflight)":"var(--accent)";return m.jsx("button",{type:"button",className:"ctx-donut",onClick:o,title:l??`context: ${e.toLocaleString()} / ${u.toLocaleString()} (${(c*100).toFixed(1)}%)`,"aria-label":"Show context breakdown",children:m.jsxs("svg",{width:s,height:s,viewBox:`0 0 ${s} ${s}`,children:[m.jsx("circle",{cx:h,cy:h,r:p,stroke:"var(--line)",strokeWidth:"2.5",fill:"none"}),m.jsx("circle",{cx:h,cy:h,r:p,stroke:y,strokeWidth:"2.5",fill:"none",strokeDasharray:`${g} ${f-g}`,strokeDashoffset:f/4,strokeLinecap:"round",style:{transition:"stroke-dasharray 400ms ease"}}),m.jsx("text",{x:h,y:h+3,textAnchor:"middle",fontSize:"8",fill:"var(--text)",fontWeight:"600",children:Math.round(c*100)})]})})}function wO(e,n){const r=zv(n);if(!r)return"no rates for this model";const s=f=>f.toLocaleString(),o=f=>`$${f}/MTok`,l=un(e,n),u=QN(e,r),c=u.tokens1h>0?[`cache w5m${s(u.tokens5m).padStart(14)} × ${o(r.cacheWrite).padEnd(11)} = ${ze(u.usd5m)}`,`cache w1h${s(u.tokens1h).padStart(14)} × ${o(r.cacheWrite1h??r.cacheWrite).padEnd(11)} = ${ze(u.usd1h)}`]:[`cache w ${s(u.tokens5m).padStart(14)} × ${o(r.cacheWrite).padEnd(11)} = ${ze(u.usd5m)}`],p=ZN(e,n),h=p===e.inputTokens?"input":"uncached";return[`model: ${n}`,`${h.padEnd(9)}${s(p).padStart(14)} × ${o(r.input).padEnd(11)} = ${ze(l.input)}`,`output ${s(e.outputTokens).padStart(14)} × ${o(r.output).padEnd(11)} = ${ze(l.output)}`,`cache r ${s(e.cacheReadTokens).padStart(14)} × ${o(r.cacheRead).padEnd(11)} = ${ze(l.cacheRead)}`,...c,"─────────────────────────────────────────",`total = ${ze(l.total)}`].join(`
|
|
58
|
+
`)}function hv(e,n,r){const s=(n??r)-e;if(s<1e3)return`${Math.max(0,s)}ms`;const o=Math.floor(s/1e3);if(o<60)return`${o}s`;const l=Math.floor(o/60),u=o%60;return`${l}m ${String(u).padStart(2,"0")}s`}function xO({data:e,selected:n}){var p;const r=e.now??Date.now(),s=["agent-node",`state-${e.state}`,e.synthetic?"synthetic":"",n?"selected":""].filter(Boolean).join(" "),o=e.tools.filter(h=>!h.endedAt).length,l=Fv(e.sessionId),u=((p=e.context)==null?void 0:p.currentContextTokens)??0,c=e.kind==="root"&&u>0;return m.jsxs("div",{className:s,style:{"--session-hue":l},children:[m.jsx("span",{className:"accent-stripe"}),m.jsx(oo,{type:"target",position:Ae.Left,style:{background:"transparent",border:"none"}}),m.jsxs("div",{className:"head",children:[m.jsxs("div",{className:"title",children:[m.jsx(_O,{state:e.state}),m.jsx("span",{className:"label",title:e.cwd,children:e.label}),e.synthetic&&m.jsx("span",{className:"synth-tag",title:"No SessionStart captured — synthesised",children:"?"})]}),m.jsxs("div",{className:"head-right",children:[c&&e.onOpenContext&&m.jsx(yO,{currentContextTokens:u,modelId:e.model,contextWindow:e.contextWindow,onClick:()=>e.onOpenContext(e.sessionId)}),m.jsx("div",{className:"time",title:`Started ${new Date(e.startedAt).toLocaleTimeString()}`,children:hv(e.startedAt,e.endedAt,r)})]})]}),m.jsxs("div",{className:"sub",children:[e.kind==="root"?"session":"subagent",e.childCount>0&&m.jsxs("span",{className:"spawn-badge",title:`${e.childCount} subagents spawned`,children:["→ ",e.childCount]}),e.cwdBasename&&e.kind==="subagent"?` · ${e.cwdBasename}`:"",e.model&&m.jsx("span",{className:"model-chip",title:e.model,children:as(e.model)})]}),e.waiting&&m.jsx(bO,{waiting:e.waiting,now:r}),e.tools.length>0&&m.jsx(kO,{tools:e.tools,now:r}),m.jsxs("div",{className:"meta",children:[m.jsxs("span",{children:[m.jsx("b",{children:e.toolCount})," tools"]}),o>0&&m.jsxs("span",{className:"inflight-meta",children:[m.jsx("b",{children:o})," in-flight"]}),e.usage.inputTokens+e.usage.outputTokens>0&&m.jsxs("span",{className:"tokens-meta",title:`in:${e.usage.inputTokens} out:${e.usage.outputTokens} cache-r:${e.usage.cacheReadTokens} cache-c:${e.usage.cacheCreateTokens}${(e.usage.reasoningOutputTokens??0)>0?` reasoning:${e.usage.reasoningOutputTokens}`:""}`,children:[m.jsx("b",{children:SO(e.usage.inputTokens+e.usage.outputTokens)})," tok"]}),e.model&&zv(e.model)&&(()=>{const h=un(e.usage,e.model);if(h.total<=0)return null;const f=Math.max(0,((e.endedAt??r)-e.startedAt)/1e3),g=e.state==="active"?fu(h.total,f):null,y=wO(e.usage,e.model)+(g?`
|
|
59
|
+
burn: ${g}`:"");return m.jsxs("span",{className:"cost-meta",title:y,children:[m.jsx("b",{children:ze(h.total)}),g&&m.jsx("span",{className:"cost-rate",children:g})]})})()]}),m.jsx(oo,{type:"source",position:Ae.Right,style:{background:"transparent",border:"none"}})]})}function _O({state:e}){const n=e==="active"?"live":e==="done"?"done":"err";return m.jsx("span",{className:`state-pill state-${e}`,children:n})}function Bv(e){return e.message?e.message:e.kind==="permission"?"Needs your permission":"Waiting for your input"}function bO({waiting:e,now:n}){const r=e.kind==="permission",s=Bv(e);return m.jsxs("div",{className:r?"waiting-row permission":"waiting-row idle",title:`${s}
|
|
60
|
+
Blocked for ${hv(e.since,void 0,n)} — the answer goes in the terminal, not here.`,children:[r?m.jsx("span",{className:"ap-pulse","aria-hidden":!0}):m.jsx("span",{className:"waiting-dot","aria-hidden":!0}),m.jsx("span",{className:"waiting-said",children:s}),m.jsx("b",{children:hv(e.since,void 0,n)})]})}function SO(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function kO({tools:e,now:n}){const l=new Array(24).fill(0);let u=0;for(const y of e){const x=n-y.startedAt;if(x<0||x>=6e4)continue;const N=23-Math.floor(x/2500);N>=0&&N<24&&(l[N]+=1,u+=1)}const c=Math.max(1,...l),p=132,h=14,f=p/24,g=c/(2500/1e3);return m.jsxs("div",{className:"tool-spark-row",title:`${u} tool calls in last 60s · peak ${g.toFixed(1)}/s`,children:[m.jsx("svg",{className:"tool-spark",width:p,height:h,viewBox:`0 0 ${p} ${h}`,"aria-hidden":!0,children:l.map((y,x)=>{const N=y===0?1.5:Math.max(1.5,y/c*h),_=x===23&&y>0,b=`tool-spark-bar${y>0?" active":""}${_?" latest":""}`;return m.jsx("rect",{x:x*f+.4,y:h-N,width:Math.max(.5,f-1),height:N,rx:.8,className:b},x)})}),m.jsx("span",{className:"tool-spark-label",children:"60s"})]})}function as(e){const n=e.replace(/^anthropic\./,"").replace(/[-_]\d{8}(?!\d)/,""),r=n.match(/^claude[-_](opus|sonnet|haiku|fable|mythos)[-_](\d+(?:[-_.]\d+)*)/i);if(r){const l=r[1][0].toUpperCase()+r[1].slice(1).toLowerCase(),u=r[2].replace(/[-_]/g,".");return`${l} ${u}`}const s=n.match(/^gpt[-_](\d+(?:[-_.]\d+)*)[-_]codex\b/i);if(s)return`GPT-${s[1].replace(/[-_]/g,".")} Codex`;const o=n.match(/^gpt[-_](\d+(?:[-_.]\d+)*)/i);return o?`GPT-${o[1].replace(/[-_]/g,".")}`:e}function Nx(e){if(e==null)return"(none)";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function EO(e){if(e.endedAt==null)return"in-flight…";const n=e.endedAt-e.startedAt;return n<1e3?`${n}ms`:`${(n/1e3).toFixed(2)}s`}function NO({tool:e,onClose:n}){uo(n);const r=e.endedAt==null?"inflight":e.ok===!1?"err":"done";return m.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:m.jsxs("div",{className:"modal",onClick:s=>s.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"tool-modal-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{className:`status-dot ${r}`}),m.jsx("span",{id:"tool-modal-title",className:"modal-tool-name",children:e.name}),m.jsxs("span",{className:"modal-tool-id",title:e.id,children:[e.id.slice(0,12),"…"]})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("span",{className:"modal-dur",children:EO(e)}),m.jsx("button",{className:"btn icon-btn",onClick:n,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),m.jsxs("section",{className:"modal-body",children:[e.trimmed&&m.jsx("div",{className:"modal-section",children:m.jsx("p",{className:"modal-note",children:"Full payloads for this call were released to keep memory bounded — only the previews below are still held."})}),m.jsxs("div",{className:"modal-section",children:[m.jsx("h4",{children:"Input"}),m.jsx("pre",{children:Nx(e.input??e.inputPreview)})]}),m.jsxs("div",{className:"modal-section",children:[m.jsxs("h4",{children:["Response ",r==="err"&&m.jsx("span",{className:"err-tag",children:"error"})]}),m.jsx("pre",{children:e.endedAt==null?"(waiting…)":Nx(e.response??e.errorPreview)})]})]})]})})}const Hl=18,Cx=26,CO=12;function RO(e){return jO(e.nodeInternals.values())}function jO(e){const n=new Map;for(const o of e){if(o.type!=="agent")continue;const l=o.data;if(!(l!=null&&l.sessionId)||l.exitAt!=null||o.width==null||o.height==null)continue;const u=o.position.x,c=o.position.y,p=u+o.width,h=c+o.height,f=n.get(l.sessionId);f?(f.minX=Math.min(f.minX,u),f.minY=Math.min(f.minY,c),f.maxX=Math.max(f.maxX,p),f.maxY=Math.max(f.maxY,h),l.kind==="root"&&(f.label=Rx(l)??f.label)):n.set(l.sessionId,{minX:u,minY:c,maxX:p,maxY:h,label:Rx(l)??l.sessionId})}const r=new Map;for(const o of n.values())r.set(o.label,(r.get(o.label)??0)+1);const s=[];for(const[o,l]of n){const c=(r.get(l.label)??0)>1?`${l.label} · ${TO(o)}`:l.label;s.push({sessionId:o,label:c,x:l.minX-Hl,y:l.minY-Hl-Cx,w:l.maxX-l.minX+Hl*2,h:l.maxY-l.minY+Hl*2+Cx})}return s}function TO(e){const n=e.match(/[a-zA-Z0-9]{4}/);return n?n[0]:e.slice(0,4)}function Rx(e){if(e.kind==="root")return e.label}function AO(){const{x:e,y:n,zoom:r}=zN(),s=_a(),o=Ke(RO,IO);if(o.length<=1)return null;const l=u=>{try{const c=s.getNodes().filter(p=>{const h=p.data;return(h==null?void 0:h.sessionId)===u});if(c.length===0)return;s.fitView({padding:.3,duration:500,nodes:c})}catch{}};return m.jsx("div",{className:"session-clusters",children:o.map(u=>{const c=Fv(u.sessionId),p={position:"absolute",left:u.x*r+e,top:u.y*r+n,width:u.w*r,height:u.h*r,"--session-hue":c},h={position:"absolute",left:u.x*r+e+16*r,top:(u.y-CO)*r+n,transform:`scale(${Math.min(1,r)})`,transformOrigin:"left top","--session-hue":c};return m.jsxs(ue.Fragment,{children:[m.jsx("div",{className:"cluster-card",style:p,"aria-hidden":!0}),m.jsx("button",{type:"button",className:"cluster-label",style:h,title:`Fit view to ${u.label} · drag the wrapper to move the whole session`,onClick:()=>l(u.sessionId),children:u.label})]},u.sessionId)})})}function IO(e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],o=n[r];if(s.sessionId!==o.sessionId||s.label!==o.label||s.x!==o.x||s.y!==o.y||s.w!==o.w||s.h!==o.h)return!1}return!0}function MO({data:e}){return m.jsx("div",{className:"session-group-handle",style:{width:(e==null?void 0:e.w)??0,height:(e==null?void 0:e.h)??0}})}const eC=600,PO=4,OO=36,pv=16,LO=60,qO=6,jx=220,Tx=96,$O=28,DO={Read:"file",Write:"file",Edit:"file",MultiEdit:"file",Glob:"file",Grep:"file",LS:"file",NotebookEdit:"file",Bash:"shell",PowerShell:"shell",shell:"shell",exec_command:"shell",shell_command:"shell",write_stdin:"shell",wait:"shell",apply_patch:"file",update_plan:"task",WebFetch:"web",WebSearch:"web",Task:"agent",Agent:"agent",TodoWrite:"task",TaskCreate:"task",TaskUpdate:"task",TaskList:"task",TaskGet:"task",TaskOutput:"task",TaskStop:"task",EnterPlanMode:"plan",ExitPlanMode:"plan",AskUserQuestion:"plan",Skill:"plan",Workflow:"plan",ScheduleWakeup:"other",CronCreate:"other",CronList:"other",CronDelete:"other",Monitor:"other",PushNotification:"other",RemoteTrigger:"other",ToolSearch:"other"};function FO(e){return e.startsWith("mcp__")?"mcp":DO[e]??"other"}const zO={Read:"📖",Write:"💾",Edit:"✏️",MultiEdit:"🔧",Glob:"🗺️",Grep:"🔎",Bash:"⚡",PowerShell:"💻",shell:"⚡",exec_command:"⚡",shell_command:"⚡",write_stdin:"💻",wait:"⏳",apply_patch:"🩹",update_plan:"📋",LS:"📂",Task:"🤖",Agent:"🤖",TodoWrite:"📋",TaskCreate:"📋",TaskUpdate:"📝",TaskList:"🗂️",TaskGet:"🗂️",TaskOutput:"📤",TaskStop:"🛑",WebFetch:"🌐",WebSearch:"🔭",ToolSearch:"🧰",NotebookEdit:"📓",EnterPlanMode:"🧭",ExitPlanMode:"🏁",AskUserQuestion:"❓",ScheduleWakeup:"⏰",CronCreate:"⏰",CronList:"📅",CronDelete:"🗑️",Skill:"🎯",Workflow:"🎬",Monitor:"📡",PushNotification:"🔔",RemoteTrigger:"📡"};function Ax(e){return e.startsWith("mcp__")?"🔌":zO[e]??"✨"}const BO={git:"🐙",gh:"🐙",glab:"🐙",npm:"📦",pnpm:"📦",yarn:"📦",bun:"📦",brew:"🍺",node:"🟢",deno:"🟢",python:"🐍",python3:"🐍",py:"🐍",pip:"🐍",pip3:"🐍",uv:"🐍",ruby:"💎",bundle:"💎",gem:"💎",cargo:"🦀",rustc:"🦀",rustup:"🦀",go:"🐹",docker:"🐳","docker-compose":"🐳",podman:"🐳",kubectl:"☸️",helm:"☸️",k9s:"☸️",grep:"🔎",rg:"🔎",ag:"🔎",ack:"🔎",find:"🔍",fd:"🔍",locate:"🔍",which:"🔍",ls:"📂",dir:"📂",tree:"📂",cat:"📄",head:"📄",tail:"📄",less:"📄",more:"📄",bat:"📄",cp:"📋",mv:"✂️",rm:"🗑️",rmdir:"🗑️",mkdir:"📁",touch:"📁",sed:"✏️",awk:"✏️",tr:"✏️",curl:"🌐",wget:"🌐",http:"🌐",httpie:"🌐",ssh:"🔐",scp:"🔐",rsync:"🔐",ping:"📡",make:"🔨",cmake:"🔨",ninja:"🔨",bazel:"🔨",just:"🔨",terraform:"🏗️",ansible:"📕",pulumi:"🏗️",ps:"📊",top:"📊",htop:"📊",btm:"📊",kill:"💀",pkill:"💀",systemctl:"⚙️",service:"⚙️",tar:"🗜️",zip:"🗜️",unzip:"🗜️",gzip:"🗜️","7z":"🗜️",vim:"📝",nvim:"📝",nano:"📝",emacs:"📝",code:"📝",jq:"🪺",yq:"🪺",echo:"💬",printf:"💬",ffmpeg:"🎞️",ffprobe:"🎞️",imagemagick:"🖼️",convert:"🖼️","Get-ChildItem":"📂","Get-Content":"📄","Set-Content":"💾","Out-File":"💾","Add-Content":"💾","Set-Location":"📍","Get-Location":"📍","Get-Process":"📊","Start-Process":"▶️","Stop-Process":"💀","Invoke-WebRequest":"🌐","Invoke-RestMethod":"🌐","New-Item":"📁","Remove-Item":"🗑️","Copy-Item":"📋","Move-Item":"✂️","Test-Path":"🔍","Where-Object":"🔎","ForEach-Object":"🔁","Select-Object":"🎯","Measure-Object":"📊","Get-Service":"⚙️","Restart-Service":"⚙️","ConvertTo-Json":"🪺","ConvertFrom-Json":"🪺"};function tC(e){if(!e)return null;let n=e.trim();if(!n)return null;const r=n.match(/^(?:bash|sh|zsh|fish|powershell|pwsh)(?:\.exe)?\s+(?:-c|-Command|-NoProfile|-NonInteractive|\s)+["']([^"']+)["']/i);if(r)return tC(r[1]);for(;;){const l=n.match(/^([A-Z_][A-Z0-9_]*=\S*)\s+/);if(!l)break;n=n.slice(l[0].length)}n=n.replace(/^sudo(?:\s+-\S+)*\s+/,""),n=n.replace(/^(?:time|nohup|xargs)\s+/,"");const s=n.match(/^([^\s|;&<>(]+)/);if(!s)return null;let o=s[1];return o=o.replace(/^.*[/\\]/,""),o=o.replace(/\.(exe|cmd|bat|ps1)$/i,""),o||null}function UO(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;const n=e;if(typeof n.cmd=="string")return n.cmd;if(typeof n.command=="string")return n.command;if(Array.isArray(n.command)&&n.command.every(r=>typeof r=="string")){const r=n.command;if(/powershell|cmd|bash|sh(\.exe)?$/i.test(r[0]??"")){const s=r.findIndex(o=>/^(-Command|-c)$/i.test(o));if(s>=0&&s+1<r.length)return r[s+1]}return r.join(" ")}return typeof n.script=="string"?n.script:null}const HO=new Set(["Bash","PowerShell","shell","exec_command","shell_command","write_stdin","wait"]),WO=new Set(["shell","exec_command","shell_command","write_stdin","wait","apply_patch","update_plan"]);function VO(e,n){return WO.has(e)||e.startsWith("mcp__")?Math.max(Tx,34+n.length*7.5):Tx}function GO(e,n){if(!HO.has(e))return null;const r=UO(n);if(!r)return null;const s=tC(r);return s?{emoji:BO[s]??"⚙️",label:s,category:"shell",detail:r}:null}const YO=new Set(["Read","Write","Edit","MultiEdit","NotebookEdit","LS","Glob","apply_patch"]),Ix={ts:"🟦",tsx:"🟦",d:"🟦",js:"🟨",jsx:"🟨",mjs:"🟨",cjs:"🟨",py:"🐍",pyi:"🐍",ipynb:"📓",rs:"🦀",go:"🐹",rb:"💎",erb:"💎",java:"☕",kt:"☕",scala:"☕",gradle:"☕",cs:"🔷",fs:"🔷",php:"🐘",swift:"🦅",c:"🇨",cpp:"🇨",cc:"🇨",h:"🇨",hpp:"🇨",md:"📝",mdx:"📝",rst:"📝",json:"🪺",json5:"🪺",jsonl:"🪺",yaml:"⚙️",yml:"⚙️",toml:"⚙️",ini:"⚙️",conf:"⚙️",cfg:"⚙️",xml:"📰",html:"🌐",htm:"🌐",vue:"🌐",svelte:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sh:"⚡",bash:"⚡",zsh:"⚡",fish:"⚡",ps1:"⚡",txt:"📄",log:"📄",out:"📄",csv:"📊",tsv:"📊",xlsx:"📊",xls:"📊",pdf:"📕",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",webp:"🖼️",svg:"🖼️",ico:"🖼️",mp4:"🎬",mov:"🎬",avi:"🎬",mkv:"🎬",webm:"🎬",mp3:"🎵",wav:"🎵",ogg:"🎵",flac:"🎵",zip:"🗜️",tar:"🗜️",gz:"🗜️",bz2:"🗜️","7z":"🗜️",xz:"🗜️",rar:"🗜️",env:"🔐",lock:"🔐",pem:"🔐",key:"🔐",crt:"🔐",sql:"🗄️",db:"🗄️",sqlite:"🗄️",parquet:"🗄️"},Mx={dockerfile:"🐳",makefile:"🔨",rakefile:"💎","package.json":"📦","pnpm-lock.yaml":"📦","yarn.lock":"📦","cargo.toml":"🦀","cargo.lock":"🦀","go.mod":"🐹","go.sum":"🐹","pyproject.toml":"🐍","requirements.txt":"🐍","readme.md":"📖",readme:"📖",license:"📜",".gitignore":"🐙",".gitattributes":"🐙",".env":"🔐",".dockerignore":"🐳"};function KO(e){const r=e.replace(/\\/g,"/").replace(/\/+$/,""),s=r.lastIndexOf("/");return s>=0?r.slice(s+1):r}function XO(e){const n=e.toLowerCase();if(Mx[n])return Mx[n];if(n.startsWith("dockerfile."))return"🐳";if(/\.(test|spec)\.[a-z]+$/.test(n))return"🧪";const r=n.lastIndexOf(".");if(r>0&&r<n.length-1){const s=n.slice(r+1);if(Ix[s])return Ix[s]}return"📄"}function QO(e,n){if(!n||typeof n!="object")return null;const r=n;if(e==="apply_patch"&&typeof r.patch=="string"){const s=r.patch.match(/^\*\*\* (?:Update|Add|Delete) File: (.+)$/m);return s?s[1].trim():null}return typeof r.file_path=="string"?r.file_path:typeof r.notebook_path=="string"?r.notebook_path:typeof r.path=="string"?r.path:e==="Glob"&&typeof r.pattern=="string"?r.pattern:null}function ZO(e,n){if(!YO.has(e))return null;const r=QO(e,n);if(!r)return null;const s=KO(r);return s?{emoji:e==="LS"?"📂":XO(s),label:s,category:"file",detail:r}:null}const nC={github:{emoji:"🐙",name:"GitHub"},git:{emoji:"🐙",name:"Git"},gitlab:{emoji:"🦊",name:"GitLab"},slack:{emoji:"💬",name:"Slack"},discord:{emoji:"💬",name:"Discord"},linear:{emoji:"📐",name:"Linear"},jira:{emoji:"🅹",name:"Jira"},atlassian:{emoji:"🅰️",name:"Atlassian"},notion:{emoji:"📓",name:"Notion"},asana:{emoji:"📋",name:"Asana"},intercom:{emoji:"💬",name:"Intercom"},figma:{emoji:"🎨",name:"Figma"},gmail:{emoji:"📧",name:"Gmail"},calendar:{emoji:"📅",name:"Calendar"},drive:{emoji:"☁️",name:"Drive"},zoom:{emoji:"📹",name:"Zoom"},spotify:{emoji:"🎵",name:"Spotify"},youtube:{emoji:"📺",name:"YouTube"},ccd_session:{emoji:"📡",name:"Session"},ccd_directory:{emoji:"📂",name:"Directory"},ccd_session_mgmt:{emoji:"📡",name:"Sessions"},mcp_registry:{emoji:"🧰",name:"Registry"},"computer-use":{emoji:"🖱️",name:"Computer"},"claude-in-chrome":{emoji:"🌐",name:"Chrome"},"claude-preview":{emoji:"👀",name:"Preview"},"scheduled-tasks":{emoji:"⏰",name:"Scheduler"},visualize:{emoji:"🎨",name:"Visualize"},"plugin-design-asana":{emoji:"📋",name:"Asana"},"plugin-design-atlassian":{emoji:"🅰️",name:"Atlassian"},"plugin-design-figma":{emoji:"🎨",name:"Figma"},"plugin-design-intercom":{emoji:"💬",name:"Intercom"},"plugin-design-linear":{emoji:"📐",name:"Linear"},"plugin-design-notion":{emoji:"📓",name:"Notion"},"plugin-design-slack":{emoji:"💬",name:"Slack"}};function rC(e){if(!e.startsWith("mcp__"))return null;const n=e.slice(5),r=n.indexOf("__");return r<=0?{server:n,method:""}:{server:n.slice(0,r),method:n.slice(r+2)}}function JO(e){let n=5381;for(let r=0;r<e.length;r++)n=(n<<5)+n^e.charCodeAt(r);return Math.abs(n)%360}function e3(e,n){const r=rC(e);if(!r)return null;const{server:s,method:o}=r;if(!o)return null;const l=nC[s.toLowerCase()];return{emoji:(l==null?void 0:l.emoji)??"🔌",label:o,category:"mcp",detail:l?`${l.name} · ${o}`:`${s} · ${o}`}}function t3(e,n){return GO(e,n)??ZO(e,n)??e3(e)}const n3={shell:"Shell",exec_command:"Shell",shell_command:"Shell",write_stdin:"stdin",wait:"wait",apply_patch:"Edit",update_plan:"Plan"};function r3(e){const n=rC(e);if(n){const s=nC[n.server.toLowerCase()];return s?{emoji:s.emoji,label:s.name}:{emoji:"🔌",label:n.server,hue:JO(n.server)}}const r=n3[e];return r?{emoji:Ax(e),label:r}:{emoji:Ax(e),label:e}}function i3(e){return e.endedAt==null?"inflight":e.ok===!1?"err":"done"}function s3(e,n,r){if(r==null)return 1;const s=n-r;return s<0?1:Math.max(0,1-s/eC)}function o3(e,n){const r=[],s=new Set;for(let o=e.length-1;o>=0&&r.length<n;o--){const l=e[o];s.has(l.id)||(s.add(l.id),r.push(l))}return r.reverse()}function a3(e,n,r,s,o,l){const u=[];for(const c of e.values()){if(!n.has(c.id)||c.exitAt!=null&&l-c.exitAt>eC)continue;const p=s.get(c.id)??r.get(c.id);if(!p)continue;const h=o3(c.tools,PO);if(h.length===0)continue;const f=c.exitAt??null,g=o.get(c.id),y=Math.max((g==null?void 0:g.width)??jx,jx),x=(g==null?void 0:g.height)??130,N=p.x,_=p.y,S=N+y,b=_+x/2;h.forEach((k,E)=>{const C=E*OO,T=N+y+LO,M=_+qO+C,L=s3(k,l,f),H=k.inputPreview??"",O=i3(k),P=L<.999,F=r3(k.name);u.push({id:`${c.id}::${k.id}`,toolId:k.id,agentId:c.id,toolName:k.name,name:F.label,emoji:F.emoji,status:O,category:FO(k.name),mcpHue:F.hue,inputPreview:H,fade:L,fading:P,worldX:T,worldY:M,anchorX:S,anchorY:b,spawnDx:S-T,spawnDy:b-(M+pv)});const G=t3(k.name,k.input);if(G){const q=VO(k.name,F.label),j=T+q+$O,Q=M,z=T+q,ne=M+pv;u.push({id:`sub:${c.id}::${k.id}`,toolId:k.id,agentId:c.id,toolName:k.name,name:G.label,emoji:G.emoji,isSub:!0,status:O,category:G.category,inputPreview:G.detail??H,fade:L,fading:P,worldX:j,worldY:Q,anchorX:z,anchorY:ne,spawnDx:z-j,spawnDy:0})}})}return u}function l3({agents:e,visibleAgentIds:n,positions:r,pinned:s,measured:o,dimUnmatched:l,spotlight:u,hiddenCategories:c,now:p,onOpenTool:h}){const f=a3(e,n,r,s,o,p),g=c&&c.size>0?f.filter(y=>!c.has(y.category)):f;return m.jsx(u3,{bursts:g,dimUnmatched:l,spotlight:u,onOpenTool:h})}function u3({bursts:e,dimUnmatched:n,spotlight:r,onOpenTool:s}){const{x:o,y:l,zoom:u}=zN();return m.jsxs("div",{className:"tool-bursts-layer","aria-hidden":!0,children:[m.jsx("svg",{className:"tool-bursts-svg",children:e.map(c=>{const p=c.anchorX*u+o,h=c.anchorY*u+l,f=(c.worldX+6)*u+o,g=(c.worldY+pv)*u+l,y=p+(f-p)*.55,x=n!=null&&!n.has(c.agentId),N=r!=null&&!r.has(c.agentId),_=c.fade*(x||N?.14:1);return m.jsx("path",{d:`M ${p} ${h} Q ${y} ${h}, ${f} ${g}`,className:`tool-conn status-${c.status}${c.fading?" fading":""}`,opacity:_},`l:${c.id}`)})}),e.map(c=>{const p=c.worldX*u+o,h=c.worldY*u+l,f={left:`${p}px`,top:`${h}px`,transform:`scale(${u})`,transformOrigin:"left top","--spawn-dx":`${c.spawnDx}px`,"--spawn-dy":`${c.spawnDy}px`},g=c.isSub?`${c.toolName} · ${c.name}`:c.toolName,y=c.inputPreview?`${g} · ${c.inputPreview}`:g,x=s!=null,N=c.mcpHue!=null?{"--mcp-hue":c.mcpHue}:{},_=n!=null&&!n.has(c.agentId),S=r!=null&&!r.has(c.agentId),b=_||S?" dim":"";return m.jsx("div",{className:"tool-burst-wrap",style:f,children:m.jsxs("div",{className:`tool-burst cat-${c.category}${c.mcpHue!=null?" mcp-hue":""} status-${c.status}${c.fading?" fading":""}${x?" clickable":""}${c.isSub?" sub":""}${b}`,style:N,title:y,role:x?"button":void 0,tabIndex:x?0:void 0,"aria-label":x?`Open ${c.toolName} ${c.status==="inflight"?"in flight":c.status} — click for details`:void 0,onClick:x?()=>s(c.toolId):void 0,onKeyDown:x?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),s(c.toolId))}:void 0,children:[m.jsx("span",{className:"tb-emoji",children:c.emoji}),m.jsx("span",{className:"tb-name",children:c.name}),c.status==="inflight"&&m.jsx("span",{className:"tb-spin"}),c.status==="done"&&m.jsx("span",{className:"tb-mark done",children:"✓"}),c.status==="err"&&m.jsx("span",{className:"tb-mark err",children:"×"})]})},c.id)})]})}function c3({state:e,sessionId:n,onClose:r}){const s=A.useMemo(()=>f3(e,n),[e,n]),o=A.useRef(null);return uo(r,{focusRef:o}),s?m.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:m.jsxs("div",{className:"modal session-summary",onClick:l=>l.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"ss-title",children:[m.jsxs("div",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{className:"state-pill state-done","aria-hidden":!0,children:"done"}),m.jsx("span",{id:"ss-title",className:"modal-tool-name",title:s.cwd??s.sessionId,children:s.label}),m.jsxs("span",{className:"modal-tool-id",children:["· ",s.sessionId.slice(0,8)]})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("span",{className:"modal-dur",title:"Total wall time",children:s.durationLabel}),m.jsx("button",{type:"button",ref:o,className:"btn",onClick:r,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),m.jsxs("div",{className:"modal-body",children:[m.jsxs("section",{className:"ss-hero",children:[m.jsxs("div",{className:"ss-hero-left",children:[m.jsx("div",{className:"ss-cost-label",children:"total spend"}),m.jsx("div",{className:"ss-cost",children:ze(s.cost.total)}),s.modelChips.length>0&&m.jsx("div",{className:"ss-models",children:s.modelChips.map(l=>m.jsx("span",{className:"model-chip",title:l,children:as(l)},l))})]}),m.jsx("div",{className:"ss-hero-right",children:s.cost.total>0&&m.jsxs(m.Fragment,{children:[m.jsx(d3,{cost:s.cost}),m.jsxs("div",{className:"ss-cost-legend",children:[m.jsxs("span",{className:"ssl ssl-in",children:["input ",m.jsx("b",{children:ze(s.cost.input)})]}),m.jsxs("span",{className:"ssl ssl-out",children:["output ",m.jsx("b",{children:ze(s.cost.output)})]}),m.jsxs("span",{className:"ssl ssl-cr",children:["cache r ",m.jsx("b",{children:ze(s.cost.cacheRead)})]}),m.jsxs("span",{className:"ssl ssl-cw",children:["cache w ",m.jsx("b",{children:ze(s.cost.cacheWrite)})]})]})]})})]}),m.jsxs("section",{className:"ss-stats",children:[m.jsx(Ys,{label:"agents",value:s.agentCount}),m.jsx(Ys,{label:"subagents",value:s.subagentCount}),m.jsx(Ys,{label:"tool calls",value:s.toolCount}),m.jsx(Ys,{label:"prompts",value:s.promptCount}),m.jsx(Ys,{label:"tokens",value:s.tokensSum.toLocaleString()}),s.errCount>0&&m.jsx(Ys,{label:"errors",value:s.errCount,tone:"err"})]}),s.topTools.length>0&&m.jsxs("section",{className:"modal-section",children:[m.jsx("h4",{children:"Most-used tools"}),m.jsx("div",{className:"ss-top-tools",children:s.topTools.map(([l,u])=>m.jsxs("div",{className:"ss-tt",children:[m.jsx("span",{className:"ss-tt-name",children:l}),m.jsx("span",{className:"ss-tt-bar",children:m.jsx("span",{className:"ss-tt-bar-fill",style:{width:`${u/s.topTools[0][1]*100}%`}})}),m.jsx("span",{className:"ss-tt-count",children:u})]},l))})]}),s.firstPrompt&&m.jsxs("section",{className:"modal-section",children:[m.jsx("h4",{children:"Opening prompt"}),m.jsx("div",{className:"ss-prompt",children:s.firstPrompt})]})]})]})}):null}function Ys({label:e,value:n,tone:r}){return m.jsxs("div",{className:`ss-stat${r?` tone-${r}`:""}`,children:[m.jsx("div",{className:"ss-stat-value",children:n}),m.jsx("div",{className:"ss-stat-label",children:e})]})}function d3({cost:e}){const n=e.total;if(n<=0)return null;const r=(s,o,l)=>{if(s<=0)return null;const u=s/n*100;return m.jsx("span",{className:`cb-seg ${o}`,style:{width:`${u}%`},title:`${l}: ${ze(s)} (${u.toFixed(0)}%)`},o)};return m.jsxs("div",{className:"cost-bar cost-bar-lg","aria-label":"Cost breakdown",children:[r(e.input,"cb-input","input"),r(e.output,"cb-output","output"),r(e.cacheRead,"cb-cache-r","cache read"),r(e.cacheWrite,"cb-cache-w","cache write")]})}function f3(e,n){const r=e.agents.get(n);if(!r)return null;const s=[];for(const E of e.agents.values())E.sessionId===n&&s.push(E);if(s.length===0)return null;const o={input:0,output:0,cacheRead:0,cacheWrite:0,total:0},l=new Set,u=new Map;let c=0,p=0,h=0,f=0,g=0,y,x=1/0,N=0;for(const E of s){const C=un(E.usage,E.model);o.input+=C.input,o.output+=C.output,o.cacheRead+=C.cacheRead,o.cacheWrite+=C.cacheWrite,o.total+=C.total,E.model&&l.add(E.model),E.kind==="subagent"&&g++,p+=E.prompts.length,!y&&E.prompts.length>0&&(y=E.prompts[0].text),h+=E.usage.inputTokens+E.usage.outputTokens,c+=E.toolCount,x=Math.min(x,E.startedAt),N=Math.max(N,E.endedAt??Date.now());for(const T of E.tools)u.set(T.name,(u.get(T.name)??0)+1),T.ok===!1&&f++}const _=Math.max(0,N-x),S=Math.floor(_/1e3),b=S<60?`${S}s`:S<3600?`${Math.floor(S/60)}m ${String(S%60).padStart(2,"0")}s`:`${Math.floor(S/3600)}h ${Math.floor(S%3600/60)}m`,k=Array.from(u.entries()).sort((E,C)=>C[1]-E[1]).slice(0,5);return{sessionId:n,label:r.label||r.cwdBasename||"session",cwd:r.cwd,durationLabel:b,cost:o,modelChips:Array.from(l),agentCount:s.length,subagentCount:g,toolCount:c,promptCount:p,tokensSum:h,errCount:f,topTools:k,firstPrompt:y}}function Px(e){return e.waiting?e.waiting.kind==="permission"?0:1:e.state==="active"?2:3}function h3(e,n){const r=[];for(const s of e.agents.values()){if(s.kind!=="root")continue;let o=s.toolCount,l=un(s.usage,s.model).total,u=s.endedAt??s.startedAt;for(const c of e.agents.values()){if(c.sessionId!==s.sessionId||c.kind==="root")continue;o+=c.toolCount,l+=un(c.usage,c.model).total;const p=c.endedAt??c.startedAt;p>u&&(u=p)}r.push({sessionId:s.sessionId,label:s.label||s.cwdBasename||"session",cwdBasename:s.cwdBasename,state:s.state,waiting:s.waiting,modelId:s.model,toolCount:o,cost:l,startedAt:s.startedAt,lastActivity:u})}return r.sort((s,o)=>{const l=Px(s),u=Px(o);return l!==u?l-u:s.waiting&&o.waiting?s.waiting.since-o.waiting.since:o.lastActivity-s.lastActivity}),r}function Ox(e,n,r){const s=(n??r)-e;if(s<1e3)return"<1s";const o=Math.floor(s/1e3);if(o<60)return`${o}s`;const l=Math.floor(o/60);return l<60?`${l}m`:`${Math.floor(l/60)}h ${l%60}m`}function p3({state:e,now:n,selectedIds:r,onSelect:s,onClose:o}){const l=A.useMemo(()=>h3(e),[e,e.lastSeq,n]),u=l.filter(p=>p.state==="active").length,c=l.filter(p=>p.waiting).length;return m.jsxs("aside",{className:"session-list","aria-label":"Sessions",children:[m.jsxs("div",{className:"sl-header",children:[m.jsxs("h3",{children:["Sessions ",m.jsx("span",{className:"sl-count",children:l.length})]}),c>0&&m.jsxs("span",{className:"sl-waiting-count",children:[c," waiting"]}),u>0&&m.jsxs("span",{className:"sl-live-count",children:[u," live"]}),m.jsx("button",{className:"btn icon-btn sl-close",onClick:o,title:"Hide sidebar (L)","aria-label":"Hide session list",children:"‹"})]}),m.jsxs("div",{className:"sl-rows",children:[l.length===0&&m.jsx("div",{className:"sl-empty",children:"No sessions yet."}),l.map(p=>{const h=r.has(p.sessionId);return m.jsxs("button",{type:"button",className:`sl-row state-${p.state}${h?" selected":""}`,onClick:()=>s(p.sessionId),title:`Focus ${p.label}`,children:[m.jsx("span",{className:`sl-dot state-${p.state}`,"aria-hidden":!0}),m.jsxs("div",{className:"sl-row-body",children:[m.jsxs("div",{className:"sl-row-head",children:[m.jsx("span",{className:"sl-label",children:p.label}),p.modelId&&m.jsx("span",{className:"model-chip",title:p.modelId,children:as(p.modelId)})]}),m.jsxs("div",{className:"sl-row-meta",children:[m.jsxs("span",{title:"tool calls",children:[m.jsx("b",{children:p.toolCount})," tools"]}),p.cost>0&&m.jsx("span",{className:"sl-cost",title:"total spend",children:m.jsx("b",{children:ze(p.cost)})}),p.waiting?m.jsxs("span",{className:"sl-waiting",title:`${Bv(p.waiting)}
|
|
61
|
+
Blocked since ${new Date(p.waiting.since).toLocaleTimeString()} · started ${new Date(p.startedAt).toLocaleString()}`,children:["waiting ",Ox(p.waiting.since,void 0,n)]}):m.jsx("span",{className:"sl-elapsed",title:`Started ${new Date(p.startedAt).toLocaleString()}`,children:Ox(p.startedAt,p.state==="active"?void 0:p.lastActivity,n)})]})]})]},p.sessionId)})]})]})}const mn="ccdeck";function Dt(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(2)}M`:`${(e/1e9).toFixed(2)}B`}function Lx(e,n){if(!e)return null;const r=n-Math.floor(e/1e3);return r<10?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:`${Math.floor(r/3600)}h ago`}function m3(e){return e==="claude-swap"?"Read from claude-swap's last collection — costs no request against your usage-endpoint budget":e==="api"?"Fetched from Anthropic's usage endpoint, at most once every 5 minutes":e==="cli"?"Parsed from `claude /usage`, at most once every 5 minutes":"Last update"}function g3({cost:e}){const n=e.total;if(n<=0)return null;const r=(s,o,l)=>{if(s<=0)return null;const u=s/n*100;return m.jsx("span",{className:`cb-seg ${o}`,style:{width:`${u}%`},title:`${l}: ${ze(s)} (${u.toFixed(0)}%)`},o)};return m.jsxs("div",{className:"cost-bar","aria-label":"Cost breakdown",children:[r(e.input,"cb-input","input"),r(e.output,"cb-output","output"),r(e.cacheRead,"cb-cache-r","cache read"),r(e.cacheWrite,"cb-cache-w","cache write")]})}function v3(e,n){const r=e-n;if(r<=0)return null;const s=Math.floor(r/3600),o=Math.floor(r%3600/60);if(s>23){const l=Math.floor(r/86400),u=Math.floor(r%86400/3600);return`${l}d ${u}h`}return s>0?`${s}h ${o}m`:`${o}m`}function y3(e,n,r,s){const o=Math.max(0,n-s),l=Math.max(0,r-o);if(l<120)return null;const u=Math.min(100,l/r*100),c=e-u;if(Math.abs(c)<3)return{label:"on pace",color:"var(--ok)",expectedPct:u,isDeficit:!1};if(c>0){const p=100-e,h=l>0?e/l:0,f=h>0?p/h:1/0,g={label:`${Math.round(c)}% ahead`,color:"var(--warn)",expectedPct:u,isDeficit:!0};if(f<o&&f<86400){const y=Math.floor(f/3600),x=Math.floor(f%3600/60);g.runsOutIn=y>0?`${y}h ${x}m`:`${x}m`}return g}return{label:`${Math.round(-c)}% reserve`,color:"var(--ok)",expectedPct:u,isDeficit:!1}}function Ji({pct:e,label:n,reset:r,resetAt:s,windowSec:o,limitReached:l,nowSec:u}){const c=Math.min(100,Math.max(0,e)),h=l||c>=90?"var(--err)":c>=70?"var(--warn)":"var(--accent)",f=c===0?"< 1%":`${c}%`,g=c===0?2:c,y=s?v3(s,u):null,x=s&&o?y3(c,s,o,u):null;return m.jsxs("div",{className:"qb-row",children:[m.jsxs("div",{className:"qb-meta",children:[m.jsxs("span",{className:"qb-label",children:[n,l&&m.jsx("span",{className:"qb-limit-badge",title:"Rate limit reached",children:"⛔"})]}),m.jsx("span",{className:"qb-pct",style:{color:h},children:f})]}),m.jsxs("div",{className:"qb-track",children:[m.jsx("div",{className:"qb-fill",style:{width:`${g}%`,background:h,opacity:c===0?.4:1}}),x&&m.jsx("div",{className:"qb-pace-marker",style:{left:`${x.expectedPct}%`,background:x.isDeficit?"var(--err)":"var(--ok)"},title:`To last until reset, stay near ${Math.round(x.expectedPct)}% by now`})]}),m.jsxs("div",{className:"qb-reset-row",children:[y?m.jsxs("span",{className:"qb-reset",children:["resets in ",y]}):r?m.jsxs("span",{className:"qb-reset",children:["resets ",r]}):null,x&&m.jsx("span",{className:"qb-pace",style:{color:x.color},children:x.runsOutIn?`runs out in ${x.runsOutIn}`:x.label})]})]})}const w3=6e4;function x3(){const[e,n]=A.useState(null),[r,s]=A.useState(!1),o=A.useRef(null),l=async(c=!1)=>{c&&s(!0);try{const h=await fetch(c?"/api/quota?refresh=1":"/api/quota");h.ok&&n(await h.json())}catch{}finally{c&&s(!1)}};return A.useEffect(()=>(l(!0),o.current=window.setInterval(()=>l(!1),w3),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{quota:e,loading:r,refresh:()=>l(!0)}}function _3(e){switch(e){case"no_token":return"Run codex login to authenticate.";case"api_key_mode":return"API-key login — ChatGPT quota is only available for codex login.";case"refresh_rejected":return"Codex session expired — run codex login.";case"refresh_failed":return"Couldn't refresh the Codex token — click ↻ to retry.";default:return"ChatGPT API unreachable — click ↻ to retry."}}const iC=6e4;function b3(){const[e,n]=A.useState(null),[r,s]=A.useState(!1),o=A.useRef(null),l=async(c=!1)=>{c&&s(!0);try{const h=await fetch(c?"/api/codex-quota?refresh=1":"/api/codex-quota");h.ok&&n(await h.json())}catch{}finally{c&&s(!1)}};return A.useEffect(()=>(l(!0),o.current=window.setInterval(()=>l(!1),iC),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{data:e,loading:r,refresh:()=>l(!0)}}function S3(){const[e,n]=A.useState(null),r=A.useRef(null),s=async()=>{try{const o=await fetch("/api/codex-usage");o.ok&&n(await o.json())}catch{}};return A.useEffect(()=>(s(),r.current=window.setInterval(s,iC),()=>{r.current!=null&&window.clearInterval(r.current)}),[]),{data:e}}function k3({state:e,now:n,onClose:r}){var L,H;const{quota:s,loading:o,refresh:l}=x3(),{data:u,loading:c,refresh:p}=b3(),{data:h}=S3(),[f,g]=A.useState(()=>Math.floor(Date.now()/1e3));A.useEffect(()=>{const O=window.setInterval(()=>g(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(O)},[]);const{byModel:y,totalCost:x,totalTokens:N,burnRate:_}=A.useMemo(()=>{const O=new Map,P={total:0,input:0,output:0,cacheRead:0,cacheWrite:0};let F=0,G=0,q=0,j=0;for(const $ of e.agents.values()){const K=$.model??"__unknown__",I=un($.usage,$.model),W=O.get(K);W?(W.inputTokens+=$.usage.inputTokens,W.outputTokens+=$.usage.outputTokens,W.cacheReadTokens+=$.usage.cacheReadTokens,W.cacheCreateTokens+=$.usage.cacheCreateTokens,W.cost.total+=I.total,W.cost.input+=I.input,W.cost.output+=I.output,W.cost.cacheRead+=I.cacheRead,W.cost.cacheWrite+=I.cacheWrite,W.agentCount++):O.set(K,{model:K,inputTokens:$.usage.inputTokens,outputTokens:$.usage.outputTokens,cacheReadTokens:$.usage.cacheReadTokens,cacheCreateTokens:$.usage.cacheCreateTokens,cost:{...I},agentCount:1}),P.total+=I.total,P.input+=I.input,P.output+=I.output,P.cacheRead+=I.cacheRead,P.cacheWrite+=I.cacheWrite,F+=$.usage.inputTokens,G+=$.usage.outputTokens,q+=$.usage.cacheReadTokens,j+=$.usage.cacheCreateTokens}const Q=Array.from(O.values()).sort(($,K)=>K.cost.total-$.cost.total);let z=0,ne=0;for(const $ of e.agents.values()){if($.state!=="active")continue;const K=un($.usage,$.model);z+=K.total,ne=Math.max(ne,(($.endedAt??n)-$.startedAt)/1e3)}const Z=ne>0?fu(z,ne):null;return{byModel:Q,totalCost:P,totalTokens:{in:F,out:G,cacheR:q,cacheC:j},burnRate:Z}},[e,e.lastSeq,n]),S=A.useMemo(()=>{const O=[];for(const P of e.agents.values()){if(P.kind!=="root")continue;let F=un(P.usage,P.model).total,G=P.usage.inputTokens,q=P.usage.outputTokens;for(const j of e.agents.values())j.sessionId!==P.sessionId||j.kind==="root"||(F+=un(j.usage,j.model).total,G+=j.usage.inputTokens,q+=j.usage.outputTokens);O.push({sessionId:P.sessionId,label:P.label||P.cwdBasename||"session",state:P.state,cost:F,inputTokens:G,outputTokens:q})}return O.sort((P,F)=>F.cost-P.cost).slice(0,12)},[e,e.lastSeq]),b=x.total>0,k=N.in+N.out,E=o||c,C=Lx(s==null?void 0:s.fetchedAt,f),T=Lx(u==null?void 0:u.fetchedAt,f),M=()=>{l(),p()};return m.jsxs("div",{className:"usage-panel","aria-label":"Usage",children:[m.jsxs("div",{className:"up-header",children:[m.jsx("h3",{children:"Usage"}),_&&m.jsx("span",{className:"up-rate",children:_}),m.jsxs("div",{className:"up-header-right",children:[m.jsx("button",{type:"button",className:"btn up-refresh-btn",onClick:M,disabled:E,title:"Refresh Claude + Codex quota",children:E?"…":"↻"}),m.jsx("button",{type:"button",className:"btn icon-btn up-close",onClick:r,"aria-label":"Close usage panel",title:"Close (U)",children:"×"})]})]}),m.jsxs("section",{className:"up-section up-quota-section",children:[m.jsxs("h4",{className:"up-section-title",children:["Claude quota",C&&!o&&m.jsx("span",{className:"up-section-age",title:m3(s==null?void 0:s.source),children:C})]}),s!=null&&s.ok?m.jsxs("div",{className:"up-quota-bars",children:[s.session5hPct!=null&&m.jsx(Ji,{label:"5-hour window",pct:s.session5hPct,reset:s.session5hReset,resetAt:s.session5hResetAt,windowSec:s.session5hWindowSec,nowSec:f}),s.week7dPct!=null&&m.jsx(Ji,{label:"7-day window",pct:s.week7dPct,reset:s.week7dReset,resetAt:s.week7dResetAt,windowSec:s.week7dWindowSec,nowSec:f}),s.weekSonnetPct!=null&&m.jsx(Ji,{label:"Sonnet (7d)",pct:s.weekSonnetPct,nowSec:f}),s.weekOpusPct!=null&&m.jsx(Ji,{label:"Opus (7d)",pct:s.weekOpusPct,nowSec:f})]}):(s==null?void 0:s.ok)===!1?m.jsxs("div",{className:"up-quota-na",children:[m.jsx("span",{children:"Quota unavailable."}),m.jsxs("span",{className:"up-quota-hint",children:["Run ",m.jsx("code",{children:"/usage"})," in a claude session, then click ↻"]})]}):m.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),m.jsxs("section",{className:"up-section up-quota-section",children:[m.jsxs("h4",{className:"up-section-title",children:["Codex quota",(u==null?void 0:u.ok)&&u.planLabel&&m.jsx("span",{className:"up-plan-badge",children:u.planLabel}),T&&!c&&m.jsx("span",{className:"up-section-age",title:"Fetched from the Codex usage endpoint",children:T})]}),u!=null&&u.ok?m.jsxs("div",{className:"up-quota-bars",children:[(L=u.windows)==null?void 0:L.map(O=>m.jsx(Ji,{label:O.label,pct:O.pct,reset:O.reset??void 0,resetAt:O.resetAt??void 0,windowSec:O.windowSec??void 0,limitReached:u.limitReached&&O.pct>=100,nowSec:f},O.id)),(H=u.extraWindows)==null?void 0:H.map(O=>m.jsx(Ji,{label:O.label,pct:O.pct,reset:O.reset??void 0,resetAt:O.resetAt??void 0,windowSec:O.windowSec??void 0,nowSec:f},O.id)),u.creditLimit&&m.jsx(Ji,{label:`spend cap · $${Math.round(u.creditLimit.used)} of $${Math.round(u.creditLimit.limit)}`,pct:u.creditLimit.usedPct,reset:u.creditLimit.reset??void 0,resetAt:u.creditLimit.resetAt??void 0,limitReached:u.spendControlReached,nowSec:f}),(h==null?void 0:h.ok)&&h.window7d&&h.window7d.sessionCount>0&&m.jsxs("div",{className:"up-quota-sub",children:[Dt(h.window7d.totalTokens)," tokens · ",h.window7d.sessionCount," session",h.window7d.sessionCount!==1?"s":""," (7d)"]}),u.creditsBalance&&!u.creditsUnlimited&&m.jsxs("div",{className:"up-quota-sub up-credits",children:["credits: $",u.creditsBalance,u.overageReached&&" · overage limit reached"]}),u.creditsUnlimited&&m.jsx("div",{className:"up-quota-sub up-credits",children:"credits: unlimited"}),u.resetCredits&&u.resetCredits.availableCount>0&&m.jsxs("div",{className:"up-quota-sub up-reset-credits",title:`Redeem in the Codex CLI or ChatGPT — ${mn} only reports them`,children:[u.resetCredits.availableCount," rate-limit reset",u.resetCredits.availableCount!==1?"s":""," available",u.resetCredits.nextExpiryAt&&` · expires ${new Date(u.resetCredits.nextExpiryAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}`]}),u.promo&&m.jsx("div",{className:"up-quota-sub",children:u.promo}),u.partial&&m.jsx("div",{className:"up-quota-sub up-quota-hint",children:"Partial data — OpenAI returned limits this build doesn't recognise."})]}):(u==null?void 0:u.ok)===!1?m.jsxs("div",{className:"up-quota-na",children:[m.jsx("span",{children:"Quota unavailable."}),m.jsx("span",{className:"up-quota-hint",children:_3(u.reason)})]}):m.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),b?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"up-total",children:[m.jsx("span",{className:"up-total-value",children:ze(x.total)}),m.jsx("span",{className:"up-total-label",children:"total spend"})]}),m.jsx(g3,{cost:x}),k>0&&m.jsxs("div",{className:"up-tokens-row",children:[m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"in"}),Dt(N.in)]}),m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"out"}),Dt(N.out)]}),N.cacheR>0&&m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"cache r"}),Dt(N.cacheR)]}),N.cacheC>0&&m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"cache c"}),Dt(N.cacheC)]})]}),y.filter(O=>O.cost.total>0).length>0&&m.jsxs("section",{className:"up-section",children:[m.jsx("h4",{className:"up-section-title",children:"By model"}),m.jsxs("table",{className:"up-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Model"}),m.jsx("th",{children:"Tokens"}),m.jsx("th",{children:"Cost"})]})}),m.jsx("tbody",{children:y.filter(O=>O.cost.total>0).map(O=>m.jsxs("tr",{children:[m.jsx("td",{className:"up-model-name",title:O.model,children:as(O.model)}),m.jsx("td",{className:"up-num",children:Dt(O.inputTokens+O.outputTokens)}),m.jsx("td",{className:"up-num up-cost-val",children:ze(O.cost.total)})]},O.model))})]})]}),S.filter(O=>O.cost>0).length>0&&m.jsxs("section",{className:"up-section",children:[m.jsx("h4",{className:"up-section-title",children:"By session"}),m.jsx("div",{className:"up-sessions",children:S.filter(O=>O.cost>0).map(O=>m.jsxs("div",{className:"up-session-row",children:[m.jsx("span",{className:`sl-dot state-${O.state}`,"aria-hidden":!0}),m.jsx("span",{className:"up-session-label",children:O.label}),m.jsx("span",{className:"up-session-tokens",children:Dt(O.inputTokens+O.outputTokens)}),m.jsx("span",{className:"up-session-cost",children:ze(O.cost)})]},O.sessionId))})]})]}):k>0?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"up-tokens-row",children:[m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"in"}),Dt(N.in)]}),m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"out"}),Dt(N.out)]})]}),m.jsx("div",{className:"up-hint",children:"Cost appears once a known model is detected."})]}):m.jsxs("div",{className:"up-empty",children:["No usage data yet.",m.jsx("br",{}),"Start a Claude Code or Codex session."]})]})}const qx=18,E3=1100,Ks=(e,n)=>{const r=Math.sin(e*12.9898+n*78.233)*43758.5453;return r-Math.floor(r)},N3=Array.from({length:qx},(e,n)=>{const r=-72+144*n/(qx-1)+(Ks(n,1)-.5)*9,s=(r-90)*(Math.PI/180),o=(54+32*Math.cos(r*Math.PI/180))*(.74+Ks(n,2)*.52);return{dx:Math.cos(s)*o,dy:Math.sin(s)*o,rot:(n%2?1:-1)*(100+Ks(n,3)*260),delay:Math.round(Ks(n,4)*90),dur:760+Math.round(Ks(n,5)*260),scale:.8+Ks(n,6)*.45,hue:n%4,round:n%3===0}});function $x({anchor:e,lifetimeMs:n=E3}){var l;const[r,s]=A.useState(null),o=typeof window<"u"&&((l=window.matchMedia)==null?void 0:l.call(window,"(prefers-reduced-motion: reduce)").matches);return A.useEffect(()=>{if(o)return;const u=e.current;if(!u)return;const c=u.getBoundingClientRect();s({x:c.left+c.width/2,y:c.top+c.height/2});const p=window.setTimeout(()=>s(null),n);return()=>window.clearTimeout(p)},[e,n,o]),o||!r?null:jI.createPortal(m.jsx("div",{className:"confetti",style:{left:`${r.x}px`,top:`${r.y}px`},"aria-hidden":!0,children:N3.map((u,c)=>m.jsx("span",{className:`confetti-bit${u.round?" round":""}`,"data-hue":u.hue,style:{"--dx":`${u.dx.toFixed(1)}px`,"--dy":`${u.dy.toFixed(1)}px`,"--rot":`${u.rot}deg`,"--s":u.scale.toFixed(2),animationDelay:`${u.delay}ms`,animationDuration:`${u.dur}ms, ${u.dur}ms`}},c))}),document.body)}const sC=new Set(["awaiting_url","awaiting_code","registering"]);function C3(e){return e!=null&&sC.has(e)}function oC(e){return e!=null&&e!=="done"&&!sC.has(e)}const R3="the sign-in ended before it finished — the deck restarted, or it was cancelled in another tab",j3="the sign-in did not complete";function T3({state:e,serverError:n,localError:r}){const s=e==="idle";return{title:s?"Sign-in ended":"Sign-in failed",message:r||n||(s?R3:j3)}}const A3="done";function I3(){let e=!1;return{shouldAnnounce(n){return n!==A3?(e=!1,!1):e?!1:(e=!0,!0)}}}const Dx={already_running:"a sign-in is already in progress",no_url:"the claude CLI did not offer a sign-in link — is it installed?",not_waiting:"that sign-in is no longer waiting for a code",not_prompted:"the CLI has not asked for a code yet",code_rejected:"that code was not accepted — copy it again from the browser",no_verdict:"the claude CLI has not answered — try the code again",empty_code:"paste the code from the browser first",login_failed:"the code was not accepted",no_identity:"signed in, but the CLI still reports nobody logged in",add_failed:"signed in, but claude-swap could not record the account",not_a_share:"that does not look like a shared account — it should start with ccdeck1:",corrupt:"that share is incomplete — copy the whole thing",wrong_version:`that share was made by a newer ${mn}`,expired:"that share has expired — make a new one",import_failed:"claude-swap refused the import"},Fx={no_cswap:"claude-swap could not be run — it is not on this deck's PATH. Set AGENTS_DECK_CSWAP to its full path",timeout:"claude-swap took too long and was stopped — try again",switch_failed:"claude-swap refused the switch",bad_account:"that is not an account claude-swap has",unknown_setting:"claude-swap has no such setting",out_of_range:"that value is outside what the setting allows",bad_value:"claude-swap does not accept that value",set_failed:"claude-swap refused the change",command_failed:"claude-swap refused the command"},M3=`claude-swap could not read the login keychain — start ${mn} from a Terminal window rather than a background service`;function mv(e,n){return(e==null?void 0:e.reason)!=="no_cswap"&&/keychain/i.test(ao(e))?M3:e!=null&&e.reason&&Fx[e.reason]?Fx[e.reason]:(e==null?void 0:e.reason)||n}function ao(e){return((e==null?void 0:e.output)||(e==null?void 0:e.detail)||(e==null?void 0:e.error)||"").trim()}const zx={no_install:"ccusage is not installed, and AGENTS_DECK_NO_INSTALL=1 forbids fetching it — unset that variable and restart the deck, or install ccusage yourself",timeout:"ccusage took more than 90 seconds and was stopped — a narrower range usually finishes",bad_output:"ccusage ran but printed no usage data — try again, and run ccusage daily --json in a terminal if it keeps happening",run_failed:"ccusage could not report usage — try again",unreachable:"the deck did not answer — check it is still running, then try again"},P3="ccusage could not be started — npx is not on this deck's PATH. Install Node's npm/npx, or put ccusage on PATH yourself";function O3(e){return/\bnpx\b/i.test(e)&&/(command not found|not found|not recognized|ENOENT)/i.test(e)}function L3(e,n){return O3(ao(e))?P3:e!=null&&e.reason&&zx[e.reason]?zx[e.reason]:(e==null?void 0:e.reason)||n}function tu(e,n){return e!=null&&e.detail?e.detail:e!=null&&e.error&&oC(e.state)?e.error:e!=null&&e.reason&&Dx[e.reason]?Dx[e.reason]:e!=null&&e.error?e.error:(e==null?void 0:e.reason)||n}const q3=1500;async function Wl(e){return(await fetch("/api/claude-accounts/admin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json().catch(()=>null)}const gv=ue.forwardRef((e,n)=>m.jsxs("svg",{className:"aa-mark",viewBox:"0 0 44 44","aria-hidden":!0,ref:n,children:[m.jsx("circle",{className:"aa-mark-ring",cx:"22",cy:"22",r:"20"}),m.jsx("path",{className:"aa-mark-tick",d:"M13.5 22.5 L19.5 28.5 L31 17"})]}));gv.displayName="SuccessMark";function $3({onClose:e,onChanged:n}){const[r,s]=A.useState("login"),[o,l]=A.useState(null),[u,c]=A.useState(""),[p,h]=A.useState(""),[f,g]=A.useState(!1),[y,x]=A.useState(null),[N,_]=A.useState(null),S=A.useRef(!1),b=A.useRef(null),k=A.useRef(null),E=A.useRef(null),C=A.useCallback(()=>{S.current&&Wl({action:"login-cancel"}).catch(()=>{}),e()},[e]);uo(C);const T=A.useCallback(async()=>{g(!0),x(null),S.current=!0;const q=await Wl({action:"login"}).catch(()=>null);if(g(!1),!(q!=null&&q.ok)){x(tu(q,"could not start the sign-in"));return}l(q)},[]);A.useEffect(()=>{if(!C3(o==null?void 0:o.state))return;const q=window.setInterval(async()=>{try{const j=await fetch("/api/claude-accounts/login");j.ok&&l(await j.json())}catch{}},q3);return()=>window.clearInterval(q)},[o]);const M=A.useRef(n);M.current=n;const L=A.useRef(I3());A.useEffect(()=>{var q;(o==null?void 0:o.state)==="awaiting_code"&&((q=b.current)==null||q.focus()),L.current.shouldAnnounce(o==null?void 0:o.state)&&M.current()},[o==null?void 0:o.state]),A.useEffect(()=>{var q;r==="paste"&&((q=k.current)==null||q.focus())},[r]);const H=A.useCallback(async()=>{var j;g(!0),x(null);const q=await Wl({action:"login-code",code:u}).catch(()=>null);if(g(!1),!(q!=null&&q.ok)){x(tu(q,"the code was not accepted")),q!=null&&q.state&&l(q),(j=b.current)==null||j.select();return}c(""),l(q)},[u,o]),O=A.useCallback(async()=>{g(!0),x(null);const q=await Wl({action:"import",blob:p}).catch(()=>null);if(g(!1),!(q!=null&&q.ok)){x(tu(q,"the import failed"));return}h(""),_({added:q.added===!0,num:q.num??null,email:q.email??null}),n()},[p,n]),P=(o==null?void 0:o.state)==="done"?o.account:null,F=oC(o==null?void 0:o.state)||!!(y&&S.current&&!f),G=T3({state:o==null?void 0:o.state,serverError:o==null?void 0:o.error,localError:y});return m.jsx("div",{className:"modal-backdrop",onClick:C,role:"presentation",children:m.jsxs("div",{className:"modal aa-modal",onClick:q=>q.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Add a Claude account",children:[m.jsxs("header",{className:"modal-head",children:[m.jsx("div",{className:"modal-title",children:m.jsxs("span",{className:"aa-tabs",role:"tablist",children:[m.jsx("button",{type:"button",role:"tab","aria-selected":r==="login",className:`aa-tab${r==="login"?" on":""}`,onClick:()=>s("login"),children:"Sign in"}),m.jsx("button",{type:"button",role:"tab","aria-selected":r==="paste",className:`aa-tab${r==="paste"?" on":""}`,onClick:()=>s("paste"),children:"Paste a share"})]})}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"btn icon-btn",onClick:C,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),m.jsx("section",{className:"modal-body aa-body",children:r==="login"?P?m.jsxs("div",{className:"aa-done",children:[m.jsx(gv,{ref:E}),m.jsx($x,{anchor:E}),m.jsx("h4",{children:P.added?`Account ${P.num} added`:"Credentials refreshed"}),m.jsxs("p",{className:"aa-note",children:[m.jsx("strong",{children:P.email}),P.added?" is in the rotation. The account you were using is still active.":" was already managed, so its stored credentials were replaced."]}),m.jsx("button",{type:"button",className:"btn primary",onClick:e,children:"Done"})]}):(o==null?void 0:o.state)==="awaiting_code"||(o==null?void 0:o.state)==="registering"?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"1 · Approve in the browser"}),m.jsx("p",{className:"aa-note",children:"A tab should have opened. If not, use this link:"}),m.jsx("a",{className:"aa-link",href:o.url??"#",target:"_blank",rel:"noreferrer noopener",children:o.url})]}),m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"2 · Paste the code it gives you"}),m.jsxs("div",{className:"aa-field",children:[m.jsx("input",{ref:b,type:"text",value:u,onChange:q=>c(q.target.value),onKeyDown:q=>{q.key==="Enter"&&u.trim()&&!f&&H()},placeholder:"paste the code here",spellCheck:!1,autoComplete:"off","aria-label":"Sign-in code",disabled:o.state==="registering"}),m.jsx("button",{type:"button",className:"btn primary",disabled:f||!u.trim()||o.state==="registering",onClick:H,children:o.state==="registering"?"registering…":"Continue"})]}),(y||o.error)&&m.jsx("p",{className:"aa-err",children:y??o.error}),m.jsx("p",{className:"aa-note",children:"The code goes straight to the claude CLI on this machine. It is never stored or sent anywhere else."})]})]}):F?m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:G.title}),m.jsx("p",{className:"aa-err",children:G.message}),m.jsx("button",{type:"button",className:"btn",onClick:()=>{S.current=!1,l(null),x(null),T()},children:"Try again"})]}):f||S.current?m.jsx("div",{className:"aa-step",children:m.jsx("p",{className:"aa-note",children:"Asking the claude CLI for a sign-in link…"})}):m.jsxs("div",{className:"aa-step aa-primer",children:[m.jsx("h4",{children:"Sign in to Anthropic"}),m.jsx("p",{className:"aa-note",children:"Opens a browser tab where you approve the sign-in, then asks for the code it shows you. claude-swap records the account when it completes, and the account you are using now stays active."}),m.jsx("div",{className:"aa-actions",children:m.jsx("button",{type:"button",className:"btn primary",onClick:T,disabled:f,children:"Open the sign-in page"})})]}):N?m.jsxs("div",{className:"aa-done",children:[m.jsx(gv,{ref:E}),N.added&&m.jsx($x,{anchor:E}),m.jsx("h4",{children:N.added?`Account ${N.num} imported`:"Already here"}),m.jsx("p",{className:"aa-note",children:N.added?m.jsxs(m.Fragment,{children:[N.email?m.jsx("strong",{children:N.email}):"That account"," is in the rotation now. Nothing changed on the deck you copied it from."]}):"This deck already holds that account, so nothing changed."}),m.jsxs("div",{className:"aa-actions",children:[m.jsx("button",{type:"button",className:"btn primary",onClick:e,children:"Done"}),m.jsx("button",{type:"button",className:"btn",onClick:()=>_(null),children:"Import another"})]})]}):m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"Paste an account shared from another deck"}),m.jsxs("div",{className:"aa-field",children:[m.jsx("input",{ref:k,type:"text",value:p,onChange:q=>h(q.target.value),onKeyDown:q=>{q.key==="Enter"&&p.trim()&&!f&&O()},placeholder:"ccdeck1:…",spellCheck:!1,autoComplete:"off","aria-label":"Shared account"}),m.jsx("button",{type:"button",className:"btn primary",disabled:f||!p.trim(),onClick:O,children:f?"importing…":"Import"})]}),y&&m.jsx("p",{className:"aa-err",children:y}),m.jsxs("p",{className:"aa-note",children:["Use ",m.jsx("strong",{children:"share"})," on an account in the other deck. A share carries a live login and expires ten minutes after it is made."]})]})})]})})}function D3(e,n){const r=new Set(e),s=e.length?Math.max(...e):0;return[...new Set([...e,s+1])].sort((o,l)=>o-l).map(o=>{const l=o===n?"here":r.has(o)?"swap":"free";return{slot:o,kind:l,label:l==="here"?`slot ${o}`:`slot ${o} · ${l}`}})}function F3(e,n,r){if(!(r!=null&&r.ok))return null;const s=Number.isInteger(r.to)?r.to:null;if(s==null)return{menuFor:null,confirmRemove:null,shareFor:null,swapNote:null};const o=r.swapped===!0&&s!==n;return{menuFor:e.menuFor===n?s:o&&e.menuFor===s?n:e.menuFor,confirmRemove:null,shareFor:null,swapNote:o?{at:s,displaced:n}:null}}function z3(e,n){const r=e.trim();return{alias:r,commit:r!==(n??"").trim()}}const B3=Object.freeze({text:"couldn't reach the deck server",reload:!0});async function Bx(e){return e.ok?{ok:!0,status:e.status,body:null}:{ok:!1,status:e.status,body:await e.json().catch(()=>null)}}function U3(e){const n=e.find(s=>!s.ok);if(!n)return null;const r=ao(n.body);return{text:mv(n.body,`the deck server answered ${n.status}`),...r?{raw:r}:{},reload:!0}}function Ux(e,n){return n?e!=null&&e.reload&&e.text===n.text&&e.raw===n.raw?e:n:e!=null&&e.reload?null:e}const Hx=15e3,H3=8e3,W3=1800,V3=3e4,G3=[70,80,85,90,95];function Y3(e,n){const r=e-n;if(r<=0)return null;const s=Math.floor(r/86400),o=Math.floor(r%86400/3600),l=Math.floor(r%3600/60);return s>0?`${s}d ${o}h`:o>0?`${o}h ${l}m`:`${l}m`}function Wx(e,n){const r=n-Math.floor(e/1e3);return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function K3(e,n){if(!e)return"";const r=Math.floor(e/1e3)-n;return r<=0?" · due":r<60?` · next in ${r}s`:` · next in ${Math.round(r/60)}m`}function X3(e){switch(e){case"invalid_grant":case"no_refresh_token":return{text:"login expired",hint:"claude-swap's stored login for this account was rejected and cannot be refreshed. Signing in again replaces it — the account keeps its slot, its alias and its history.",fixable:!0};case"http-401":return{text:"re-login needed",hint:"Anthropic refused this account's token.",fixable:!0};case"http-429":return{text:"rate limited",hint:"Anthropic is throttling requests for this account. It clears on its own.",fixable:!1};case"transient":return{text:"temporary error",hint:"A network or server hiccup while reading usage. The next collection retries.",fixable:!1};case"timeout":return{text:"timed out",hint:"Reading this account's usage took too long. The next collection retries.",fixable:!1};case"network":return{text:"unreachable",hint:"Could not reach Anthropic to read this account's usage.",fixable:!1};default:return{text:e,hint:`claude-swap reported "${e}" for this account.`,fixable:!1}}}function Q3({lane:e,nowSec:n}){const r=Math.min(100,Math.max(0,e.pct)),s=r>=90?"var(--err)":r>=70?"var(--warn)":"var(--accent)",o=e.resetAt?Y3(e.resetAt,n):null;return m.jsxs("div",{className:"ap-lane",children:[m.jsx("span",{className:"ap-lane-label",children:e.label}),m.jsx("div",{className:"ap-lane-track",children:m.jsx("div",{className:"ap-lane-fill",style:{width:`${r===0?1.5:r}%`,background:s,opacity:r===0?.4:1}})}),m.jsxs("span",{className:"ap-lane-pct",style:{color:s},children:[r,"%"]}),m.jsx("span",{className:"ap-lane-reset",children:o?`resets ${o}`:""})]})}async function Z3(e){var r;let n=!1;try{n=await Promise.race([((r=navigator.clipboard)==null?void 0:r.writeText(e).then(()=>!0))??Promise.resolve(!1),new Promise(s=>window.setTimeout(()=>s(!1),500))])}catch{n=!1}if(n)return!0;try{const s=document.createElement("textarea");s.value=e,s.setAttribute("readonly",""),s.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(s),s.select(),n=document.execCommand("copy"),s.remove()}catch{n=!1}return n}function J3(e,n){const r=Math.round(e/1e3)-n;return r<=0?{text:"expired",tone:"gone"}:r<60?{text:`expires in ${r}s`,tone:"soon"}:{text:`expires in ${Math.round(r/60)}m`,tone:"ok"}}function eL({onClose:e}){var re,le,de;const[n,r]=A.useState(null),[s,o]=A.useState(null),[l,u]=A.useState(null),[c,p]=A.useState(!1),[h,f]=A.useState(null),[g,y]=A.useState(null),[x,N]=A.useState(()=>Math.floor(Date.now()/1e3)),_=A.useRef(null),[S,b]=A.useState(null),[k,E]=A.useState(!1),[C,T]=A.useState(""),[M,L]=A.useState(null),[H,O]=A.useState(null),[P,F]=A.useState(null),[G,q]=A.useState(!1),[j,Q]=A.useState(null),z=A.useCallback(async(te=!1)=>{te&&p(!0);const ce=new AbortController,Ce=window.setTimeout(()=>ce.abort(),V3);try{const[ve,Te]=await Promise.all([fetch(`/api/claude-accounts${te?"?refresh=1":""}`,{signal:ce.signal}),fetch("/api/cswap-auto",{signal:ce.signal})]);ve.ok&&r(await ve.json()),Te.ok&&o(await Te.json());const ye=U3([await Bx(ve),await Bx(Te)]);y(ke=>Ux(ke,ye))}catch{y(ve=>Ux(ve,B3))}finally{window.clearTimeout(Ce),te&&p(!1)}},[]),ne=A.useCallback(async(te,ce)=>{u(ce),y(null);try{const ve=await(await fetch("/api/cswap-auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(te)})).json().catch(()=>null);return ve!=null&&ve.ok||y({text:mv(ve,"command failed"),raw:ao(ve)}),ve}catch{return y({text:"server unreachable"}),null}finally{u(null)}},[]),Z=A.useCallback(async(te,ce)=>{u(ce),y(null);try{const ve=await(await fetch("/api/claude-accounts/admin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(te)})).json().catch(()=>null);return ve!=null&&ve.ok||y({text:tu(ve,"command failed")}),ve}catch{return y({text:"server unreachable"}),null}finally{u(null)}},[]);A.useEffect(()=>(z(!0),_.current=window.setInterval(()=>z(!1),Hx),()=>{_.current!=null&&window.clearInterval(_.current)}),[z]),A.useEffect(()=>{const te=window.setInterval(()=>N(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(te)},[]);const $=((re=s==null?void 0:s.settings["autoswitch.threshold"])==null?void 0:re.value)??"90",K=(le=n==null?void 0:n.accounts)==null?void 0:le.find(te=>te.active),I=K!=null&&K.lanes.length?Math.max(...K.lanes.map(te=>te.pct)):null,W=I!=null&&I>=Number($)-15,X=async te=>{f(te),y(null);try{const Ce=await(await fetch("/api/claude-accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:te})})).json().catch(()=>null);Ce!=null&&Ce.ok||y({text:mv(Ce,"the switch failed"),raw:ao(Ce)}),await z(!0)}catch{y({text:"server unreachable"})}finally{f(null)}},U=async(te,ce)=>{const{commit:Ce,alias:ve}=z3(C,ce);if(Ce){const Te=await Z({action:"alias",account:te,alias:ve},`alias-${te}`);if(await z(!0),!(Te!=null&&Te.ok))return;T(ve)}L(te),window.setTimeout(()=>L(Te=>Te===te?null:Te),W3)},J=async(te,ce)=>{const Ce=await Z({action:"move",account:te,slot:ce},`move-${te}`),ve=F3({menuFor:S,shareFor:(P==null?void 0:P.num)??null},te,Ce);if(await z(!0),ve){b(ve.menuFor),O(ve.confirmRemove),ve.shareFor==null&&(F(null),q(!1)),Q(ve.swapNote);const Te=ve.swapNote;Te&&window.setTimeout(()=>Q(ye=>ye===Te?null:ye),H3)}};return m.jsxs("div",{className:"accounts-panel","aria-label":"Claude accounts",children:[m.jsxs("div",{className:"ap-header",children:[m.jsx("h3",{children:"Accounts"}),m.jsxs("div",{className:"ap-header-right",children:[m.jsx("button",{type:"button",className:"btn ap-add",onClick:()=>E(!0),title:"Sign in to another Claude account, or paste one shared from another deck",children:"+"}),m.jsx("button",{type:"button",className:"btn ap-refresh",onClick:()=>z(!0),disabled:c,"aria-label":"Reload accounts",title:"Reload from claude-swap",children:c?"…":"↻"}),m.jsx("button",{type:"button",className:"btn icon-btn",onClick:e,"aria-label":"Close accounts panel",title:"Close (A)",children:"×"})]})]}),n==null?g?m.jsxs("div",{className:"ap-empty",role:"alert",children:[m.jsx("span",{title:g.raw||void 0,children:g.text}),m.jsxs("span",{className:"ap-hint",children:["No accounts have arrived, so there is nothing to show yet. The panel keeps trying every ",Hx/1e3," seconds."]}),m.jsx("button",{type:"button",className:"ap-fix",disabled:c,onClick:()=>z(!0),children:c?"trying…":"try again"})]}):m.jsx("div",{className:"ap-empty",children:"Checking…"}):n.ok?m.jsxs(m.Fragment,{children:[(de=n.accounts)==null?void 0:de.map(te=>m.jsxs("div",{className:`ap-account${te.active?" active":""}${te.disabled?" disabled":""}`,children:[m.jsxs("div",{className:"ap-account-head",children:[m.jsx("span",{className:"ap-num",children:te.num}),te.alias&&m.jsx("span",{className:"ap-alias",children:te.alias}),m.jsx("span",{className:"ap-email",title:te.org??void 0,children:te.email}),m.jsx("button",{type:"button",className:`ap-more${S===te.num?" on":""}`,"aria-label":`Manage account ${te.num}`,"aria-expanded":S===te.num,"aria-controls":S===te.num?`ap-manage-${te.num}`:void 0,title:"Share, rename, move, remove",onClick:()=>{b(S===te.num?null:te.num),T(te.alias??""),O(null),F(null),q(!1),Q(null),L(null)},children:"⋯"}),te.active?m.jsx("span",{className:"ap-badge-active",children:"● active"}):m.jsx("button",{type:"button",className:"btn ap-switch",disabled:h!=null||te.disabled,onClick:()=>X(te.num),title:te.disabled?"Held out of rotation":`Switch to ${te.alias??te.email}`,children:h===te.num?"…":"switch"})]}),te.lanes.length>0?te.lanes.map(ce=>m.jsx(Q3,{lane:ce,nowSec:x},ce.id)):m.jsx("div",{className:"ap-hint",children:"No usage recorded yet."}),m.jsxs("div",{className:"ap-meta",children:[te.error&&(()=>{const ce=X3(te.error);return m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"ap-err",title:ce.hint,children:ce.text}),ce.fixable&&m.jsx("button",{type:"button",className:"ap-fix",onClick:()=>E(!0),title:"Open the sign-in dialog. Signing in as this account replaces its stored login in place.",children:"sign in again"})]})})(),((s==null?void 0:s.enabled)||(s==null?void 0:s.external))&&!te.active&&m.jsx("button",{type:"button",className:"ap-rotate",disabled:l!=null,onClick:()=>ne({action:"account",account:te.num,enabled:te.disabled},`rot-${te.num}`).then(()=>z(!0)),title:te.disabled?"Return this account to auto-rotation":"Hold this account out of auto-rotation",children:te.disabled?"held out":"in rotation"}),te.fetchedAt?m.jsxs("span",{className:`ap-age${te.stale?" ap-stale":""}`,title:"When claude-swap last read this account's usage, and when it plans to read it again. It sets that interval itself — 3 minutes at the fastest, wider while an account is recovering from a rate limit — and every surface, including `cswap watch`, follows the same plan.",children:["collected ",Wx(te.fetchedAt,x),K3(te.nextAt,x)]}):m.jsx("span",{className:"ap-age ap-stale",title:"claude-swap has not read this account yet",children:"never collected"})]}),S===te.num&&m.jsxs("div",{className:"ap-manage",id:`ap-manage-${te.num}`,role:"group","aria-label":`Manage account ${te.num}`,children:[m.jsxs("div",{className:"ap-manage-name",children:[m.jsx("label",{className:"ap-vh",htmlFor:`ap-alias-${te.num}`,children:"Alias"}),m.jsx("input",{id:`ap-alias-${te.num}`,className:"ap-manage-input",type:"text",value:C,onChange:ce=>T(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&U(te.num,te.alias)},placeholder:"e.g. work",spellCheck:!1,autoFocus:!0}),m.jsx("button",{type:"button",className:"ap-manage-btn",disabled:l!=null,onClick:()=>U(te.num,te.alias),title:"A short name to show instead of the email",children:M===te.num?"saved":"save"})]}),m.jsxs("div",{className:"ap-manage-acts",children:[m.jsx("label",{className:"ap-vh",htmlFor:`ap-slot-${te.num}`,children:"Slot"}),m.jsx("span",{className:"ap-field",children:m.jsx("select",{id:`ap-slot-${te.num}`,value:String(te.num),disabled:l!=null,onChange:ce=>J(te.num,Number(ce.target.value)),children:D3((n.accounts??[]).map(ce=>ce.num),te.num).map(ce=>m.jsx("option",{value:ce.slot,children:ce.label},ce.slot))})}),m.jsx("button",{type:"button",className:"ap-manage-btn",disabled:l!=null,title:`Copy this account to another ${mn}. The share carries a live login and expires in 10 minutes.`,onClick:async()=>{q(!1);const ce=await Z({action:"share",account:te.num},`share-${te.num}`);ce!=null&&ce.ok&&F({num:te.num,blob:ce.blob,expiresAt:ce.expiresAt})},children:"share"}),m.jsx("button",{type:"button",className:`ap-manage-btn danger${H===te.num?" armed":""}`,disabled:l!=null,title:H===te.num?"This deletes the stored credentials for this account":"Remove this account from claude-swap",onClick:()=>{if(H!==te.num){O(te.num),window.setTimeout(()=>O(ce=>ce===te.num?null:ce),4e3);return}O(null),Z({action:"remove",account:te.num},`rm-${te.num}`).then(()=>{b(null),z(!0)})},children:H===te.num?"confirm":"remove"})]}),(j==null?void 0:j.at)===te.num&&(()=>{var ve;const ce=(ve=n.accounts)==null?void 0:ve.find(Te=>Te.num===j.displaced),Ce=(ce==null?void 0:ce.alias)??(ce==null?void 0:ce.email)??"the account that was there";return m.jsxs("span",{className:"ap-manage-hint ap-manage-swap",title:`Slot ${j.at} was taken, so the two accounts traded places: ${Ce} now holds slot ${j.displaced}.`,children:["swapped with slot ",j.displaced]})})(),(P==null?void 0:P.num)===te.num&&(()=>{const ce=J3(P.expiresAt,x),Ce=ce.tone==="gone";return m.jsxs("div",{className:`ap-share${Ce?" expired":""}`,children:[m.jsx("code",{className:"ap-share-blob",children:P.blob}),m.jsxs("div",{className:"ap-share-foot",children:[m.jsx("button",{type:"button",className:"ap-manage-btn",disabled:l!=null,onClick:async()=>{if(Ce){q(!1);const ve=await Z({action:"share",account:te.num},`share-${te.num}`);ve!=null&&ve.ok&&F({num:te.num,blob:ve.blob,expiresAt:ve.expiresAt});return}await Z3(P.blob)&&(q(!0),window.setTimeout(()=>q(!1),1800))},children:Ce?"make a new share":G?"copied":"copy"}),m.jsxs("span",{className:"ap-manage-hint",children:["carries a live login · ",m.jsx("span",{className:`ap-share-expiry ${ce.tone}`,children:ce.text})]})]})]})})()]})]},te.num)),(s==null?void 0:s.ok)&&m.jsxs("div",{className:"ap-auto",children:[m.jsxs("div",{className:"ap-auto-head",children:[m.jsx("span",{className:"ap-auto-title",children:"Auto-switch"}),m.jsxs("span",{className:"ap-auto-ctl",children:[I!=null&&m.jsxs("span",{className:`ap-auto-now${W?" near":""}`,children:[Math.round(I),"%"]}),m.jsx("span",{className:"ap-field",title:"Switch once the active account passes this much of its limit",children:m.jsx("select",{"aria-label":"Switch threshold",value:$,disabled:l!=null,onChange:te=>ne({action:"setting",key:"autoswitch.threshold",value:te.target.value},"threshold").then(()=>z(!0)),children:G3.map(te=>m.jsxs("option",{value:te,children:[te,"%"]},te))})}),m.jsxs("button",{type:"button",className:`ap-auto-state${s.enabled?" live":""}`,role:"switch","aria-checked":s.enabled,disabled:l!=null,onClick:()=>ne({action:"enable",enabled:!s.enabled},"enable").then(()=>z(!0)),title:s.enabled?"Stop switching accounts automatically":"Switch accounts automatically when the active one nears its limit",children:[m.jsx("i",{className:s.enabled?"ap-pulse":"ap-dot","aria-hidden":!0}),s.enabled?"on":"off"]})]})]}),s.external&&m.jsxs("p",{className:"ap-auto-note",children:[m.jsx("i",{className:"ap-pulse","aria-hidden":!0})," A ",m.jsx("code",{children:"cswap auto"})," loop in your terminal is doing the switching. The deck stands down while it runs",s.enabled?" — this toggle takes over when you stop it.":"."]}),s.lastTick&&m.jsx("div",{className:"ap-auto-foot",children:m.jsxs("span",{className:"ap-auto-result",children:["checked ",Wx(s.lastTick.at,x)]})})]}),g&&m.jsxs("div",{className:"ap-failure",role:"alert",children:[m.jsx("span",{className:"ap-failure-text",title:g.raw||void 0,children:g.text}),m.jsx("button",{type:"button",className:"ap-failure-x",onClick:()=>y(null),"aria-label":"Dismiss this message",title:"Dismiss",children:"×"})]}),m.jsx("p",{className:"ap-footnote",title:"Anthropic's usage endpoint allows roughly 28–30 requests per hour per account, shared by every tool on this machine — polling it from here would rate-limit your account. So the deck never fetches: it asks claude-swap to collect while this panel is open, at most once every three minutes, and claude-swap decides whether that touches the network at all.",children:"Collected by claude-swap while this panel is open."})]}):m.jsx("div",{className:"ap-empty",children:n.reason==="no_cswap"?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"claude-swap isn't installed."}),m.jsx("span",{className:"ap-hint",children:"This panel reads the account store claude-swap keeps — without it there is nothing to show. It is a separate tool, published on PyPI, so it does not come with this package."}),n.hint&&m.jsx("code",{className:"ap-cmd",children:n.hint}),m.jsxs("span",{className:"ap-hint",children:["Then add an account with the ",m.jsx("strong",{children:"+"})," button above."]})]}):n.reason==="no_accounts"?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"No accounts added yet."}),m.jsxs("span",{className:"ap-hint",children:["claude-swap is installed but has nothing in its store. Use the ",m.jsx("strong",{children:"+"})," above to sign one in, or to paste one shared from another deck."]})]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"Couldn't read the account store."}),m.jsxs("span",{className:"ap-hint",children:["claude-swap is installed, but its store could not be read",n.reason?` (${n.reason})`:"","."]})]})}),k&&m.jsx($3,{onClose:()=>E(!1),onChanged:()=>z(!0)})]})}const tL=3e4;function nL({bundle:e,running:n,lastTried:r}){return!n||e===n?!1:r!==n}function rL({bundle:e,running:n,pending:r,lastTried:s}){return n?nL({bundle:e,running:n,lastTried:s})?"reload":r==null||r&&r!==n?"wait":"confirm":"wait"}function iL(e){return!e||e.state!=="failed"?null:`${typeof e.at=="number"?e.at:0}:${e.error??""}`}function sL({asked:e,reported:n}){return n?n!==e:!1}function oL(e){const n=e.thresholdMs??tL;return!e.enabled||e.kind!=="restart"||!e.canRestart?{idleSince:null,restart:!1}:e.busy?{idleSince:null,restart:!1}:e.idleSince==null?{idleSince:e.now,restart:!1}:e.now<e.idleSince?{idleSince:e.now,restart:!1}:{idleSince:e.idleSince,restart:e.now-e.idleSince>=n}}function aL(e){return e.ctrlKey||e.metaKey||e.altKey}const lL=new Set(["button","checkbox","color","file","image","radio","range","reset","submit"]),uL=new Set(["INPUT","TEXTAREA","SELECT","OPTION","BUTTON","SUMMARY","A"]),cL=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","searchbox","slider","spinbutton","switch","tab","textbox","treeitem"]);function aC(e){return typeof e.tagName=="string"?e.tagName.toUpperCase():""}function lC(e){if(!e)return!1;if(e.isContentEditable)return!0;const n=aC(e);return n==="TEXTAREA"?!0:n!=="INPUT"?!1:!lL.has(String(e.type??"text").toLowerCase())}function dL(e){if(!e)return!1;if(lC(e)||uL.has(aC(e)))return!0;const n=typeof e.role=="string"?e.role.trim().toLowerCase():"";return n!==""&&n.split(/\s+/).some(r=>cL.has(r))}function fL({agentCount:e,onConfirm:n,onCancel:r}){const s=A.useRef(null);uo(r,{focusRef:s,layer:cO});const o=e===0?"This deletes the server's event log":`This removes ${e===1?"the one agent":`all ${e} agents`} on the canvas and deletes the server's event log`;return m.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:m.jsxs("div",{className:"modal clear-confirm",onClick:l=>l.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"clear-confirm-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{className:"status-dot err","aria-hidden":!0}),m.jsx("span",{id:"clear-confirm-title",className:"modal-tool-name",children:"Clear the deck?"})]}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"btn icon-btn",onClick:r,"aria-label":"Cancel (Esc)",title:"Cancel (Esc)",children:"×"})})]}),m.jsxs("section",{className:"modal-body",children:[m.jsxs("p",{className:"modal-note",children:[o," — the file a restarted deck replays to rebuild what you see. Layout, pins and selection go with it. This cannot be undone."]}),m.jsxs("div",{className:"cc-actions",children:[m.jsx("button",{type:"button",ref:s,className:"btn",onClick:r,children:"Cancel"}),m.jsx("button",{type:"button",className:"btn danger",onClick:n,children:"Clear everything"})]})]})]})})}function hL(e,n){return e==="confirmation"?n.confirmOpen?"clear":"ignore":n.modalOpen||n.confirmOpen?"ignore":"confirm"}function Vl(e,n){if(n.size!==0)for(const r of Array.from(e.keys()))n.has(r)||e.delete(r)}function pL(e){const n=new Set;for(const r of e)n.add(r.id),n.add(`group:${r.sessionId}`);return n}function uC(e,n,r){return!n.has(e)||r.has(e)}function mL(e,n,r,s){return!n.has(e)&&uC(e,r,s)}function gL(e,n,r){const s={x:0,y:0};return n.set(e,s),r.add(e),s}function vL(e,n,r,s){r.set(e,n),s.delete(e)}const yL=40,wL=120;function xL(e,n){let r=null,s=0,o=Number.NEGATIVE_INFINITY;const l=()=>{r=null,o=n.now(),e()},u=()=>{r!=null&&(n.clearTimeout(r),r=null)},c=(p,h,f)=>{if(r!=null){if(s<=p)return;u()}const g=Math.min(f,Math.max(0,p-h));s=p,r=n.setTimeout(l,g)};return{live(p=yL){const h=n.now(),f=Math.max(o+p,h);if(f<=h){u(),l();return}c(f,h,p)},replay(p=wL){u(),s=n.now()+p,r=n.setTimeout(l,p)},flush(){u(),l()},cancel(){u()}}}function _L(){let e=!1,n=[];return{get paused(){return e},get size(){return n.length},accept(r){return e?(n.push(r),!1):!0},setPaused(r){if(e=r,r||n.length===0)return[];const s=n;return n=[],s}}}const bL="1",Vx="agent-dag.schema",SL=["agent-dag.layout","agent-dag.viewport"];function cC(e){if(typeof window>"u")return null;try{return window.localStorage.getItem(e)}catch{return null}}function kL(e,n=bL){let r=null;try{r=e.getItem(Vx)}catch{return[]}if(r===n)return[];const s=[];if(r!==null)for(const o of SL)try{e.getItem(o)!==null&&(e.removeItem(o),s.push(o))}catch{}try{e.setItem(Vx,n)}catch{}return s}const dC="agent-dag.theme";function EL(e){return e==="light"?"light":"dark"}function NL(){return EL(cC(dC))}function CL({waiting:e,running:n}){return{title:e>0?`(${e}) ${mn}`:mn,icon:e>0?"waiting":n>0?"running":"idle"}}const Cd={waiting:"#c97d12",running:"#2a90d4",idle:"#7e828c"};function Rd(e,n){return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">${n==="waiting"?`<circle cx="16" cy="16" r="14.5" fill="${e}"/>`:`<circle cx="16" cy="16" r="12" fill="none" stroke="${e}" stroke-width="5"/>`+(n==="running"?`<circle cx="16" cy="16" r="5" fill="${e}"/>`:"")}</svg>`}const RL=Object.freeze({waiting:`data:image/svg+xml,${encodeURIComponent(Rd(Cd.waiting,"waiting"))}`,running:`data:image/svg+xml,${encodeURIComponent(Rd(Cd.running,"running"))}`,idle:`data:image/svg+xml,${encodeURIComponent(Rd(Cd.idle,"idle"))}`});function jL(){let e=0;return{begin(){const n=++e;return()=>n===e},cancel(){e++}}}function TL(e,n=new Date){return new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()-(e-1))).toISOString().slice(0,10).replace(/-/g,"")}function AL(e){return!e.answer||e.answer.range!==e.want?{phase:"busy",stale:!1}:e.answer.ok?{phase:e.answer.days>0?"chart":"empty",stale:e.loading}:{phase:"error",stale:e.loading}}function Gl(e){const n=e.toLowerCase();return n.includes("opus")?"#c4b5fd":n.includes("sonnet")?"#7dd3fc":n.includes("haiku")?"#86efac":n.includes("gpt-5")||n.includes("gpt5")?"#fcd34d":n.includes("gpt")?"#fca5a5":n.includes("gemini")?"#a5b4fc":n.includes("codex")?"#fdba74":"#94a3b8"}const IL=[7,14,30,90];function ML(e){const[n,r]=A.useState(null),[s,o]=A.useState(!1),l=A.useRef(jL()).current,u=(c=!1)=>{const p=l.begin(),h=e;o(!0);const g=`/api/ccusage?since=${TL(h)}${c?"&refresh=1":""}`;fetch(g).then(y=>y.json()).then(y=>{p()&&r({range:h,resp:y})}).catch(()=>{p()&&r({range:h,resp:{ok:!1,reason:"unreachable"}})}).finally(()=>{p()&&o(!1)})};return A.useEffect(()=>(u(!1),()=>l.cancel()),[e]),{landed:n,loading:s,reload:()=>u(!0)}}function PL({onClose:e}){var k,E,C;const[n,r]=A.useState(30),[s,o]=A.useState(null),{landed:l,loading:u,reload:c}=ML(n);uo(e);const p=AL({loading:u,want:n,answer:l&&{range:l.range,ok:l.resp.ok===!0,days:((k=l.resp.days)==null?void 0:k.length)??0}}),h=p.phase==="chart"?l.resp.days??[]:[],f=A.useMemo(()=>h.reduce((T,M)=>Math.max(T,M.totalCost),0),[h]),{totalCost:g,totalTok:y,inOut:x,cacheRead:N,modelCosts:_}=A.useMemo(()=>{let T=0,M=0,L=0,H=0;const O=new Map;for(const P of h){T+=P.totalCost,M+=P.totalTokens,L+=P.inputTokens+P.outputTokens,H+=P.cacheReadTokens;for(const F of P.modelBreakdowns)O.set(F.modelName,(O.get(F.modelName)??0)+F.cost)}return{totalCost:T,totalTok:M,inOut:L,cacheRead:H,modelCosts:O}},[h]),S=A.useMemo(()=>Array.from(_.entries()).sort((T,M)=>M[1]-T[1]),[_]),b=s?h.find(T=>T.period===s)??null:null;return m.jsx("div",{className:"uh-backdrop",onClick:e,role:"presentation",children:m.jsxs("div",{className:"uh-modal",onClick:T=>T.stopPropagation(),role:"dialog","aria-label":"Usage history",children:[m.jsxs("header",{className:"uh-head",children:[m.jsxs("div",{className:"uh-titlewrap",children:[m.jsx("div",{className:"uh-title",children:"Usage history"}),m.jsx("div",{className:"uh-sub",children:"via ccusage · local Claude / Codex logs"})]}),m.jsx("div",{className:"uh-range",role:"tablist","aria-label":"Range",children:IL.map(T=>m.jsxs("button",{role:"tab","aria-selected":n===T,className:`uh-range-btn${n===T?" on":""}`,onClick:()=>{r(T),o(null)},children:[T,"d"]},T))}),m.jsx("button",{className:"btn icon-btn uh-reload",onClick:c,disabled:u,title:"Re-run ccusage","aria-label":"Reload",children:u?"…":"↻"}),m.jsx("button",{className:"uh-close",onClick:e,"aria-label":"Close",children:"×"})]}),p.phase==="busy"?m.jsx("div",{className:"uh-status","aria-busy":"true",children:l?"running ccusage…":"running ccusage… (first run downloads the package)"}):p.phase==="error"?m.jsxs("div",{className:"uh-status uh-err",title:ao(l.resp)||void 0,children:[L3(l.resp,"ccusage did not report usage"),m.jsx("div",{children:m.jsx("button",{className:"btn uh-retry",onClick:c,disabled:u,children:u?"trying…":"Try again"})})]}):p.phase==="empty"?m.jsx("div",{className:`uh-status${p.stale?" uh-stale":""}`,"aria-busy":p.stale||void 0,children:"no usage in this range"}):m.jsxs("div",{className:p.stale?"uh-stale":void 0,"aria-busy":p.stale||void 0,children:[m.jsxs("div",{className:"uh-totals",children:[m.jsx(Yl,{label:"total cost",val:ze(g),accent:!0}),m.jsx(Yl,{label:"tokens",val:Dt(y)}),m.jsx(Yl,{label:"input+output",val:Dt(x)}),m.jsx(Yl,{label:"cache reads",val:Dt(N)})]}),m.jsx("div",{className:"uh-chart",role:"img","aria-label":"Daily cost by model",children:h.map(T=>{const M=f>0?T.totalCost/f*100:0,L=T.period===s;return m.jsxs("button",{className:`uh-bar-col${L?" sel":""}`,onClick:()=>o(L?null:T.period),title:`${T.period} · ${ze(T.totalCost)}`,style:{flexBasis:`${100/h.length}%`},children:[m.jsx("div",{className:"uh-bar",style:{height:`${Math.max(M,T.totalCost>0?2:0)}%`},children:T.modelBreakdowns.slice().sort((H,O)=>O.cost-H.cost).map(H=>{const O=T.totalCost>0?H.cost/T.totalCost*100:0;return m.jsx("div",{className:"uh-bar-seg",style:{height:`${O}%`,background:Gl(H.modelName)}},H.modelName)})}),m.jsx("span",{className:"uh-bar-label",children:T.period.slice(5)})]},T.period)})}),m.jsx("div",{className:"uh-legend",children:S.map(([T,M])=>m.jsxs("span",{className:"uh-legend-item",children:[m.jsx("span",{className:"uh-legend-dot",style:{background:Gl(T)}}),as(T)," ",m.jsx("span",{className:"uh-legend-cost",children:ze(M)})]},T))}),b&&m.jsxs("div",{className:"uh-detail",children:[m.jsxs("div",{className:"uh-detail-head",children:[m.jsx("span",{className:"uh-detail-date",children:b.period}),m.jsx("span",{className:"uh-detail-cost",children:ze(b.totalCost)}),(C=(E=b.metadata)==null?void 0:E.agents)!=null&&C.length?m.jsx("span",{className:"uh-detail-agents",children:b.metadata.agents.join(" · ")}):null]}),m.jsxs("div",{className:"uh-detail-mini",children:[m.jsx(Kl,{label:"input",val:Dt(b.inputTokens)}),m.jsx(Kl,{label:"output",val:Dt(b.outputTokens)}),m.jsx(Kl,{label:"cache write",val:Dt(b.cacheCreationTokens)}),m.jsx(Kl,{label:"cache read",val:Dt(b.cacheReadTokens)})]}),m.jsx("div",{className:"uh-detail-models",children:b.modelBreakdowns.slice().sort((T,M)=>M.cost-T.cost).map(T=>{const M=b.totalCost>0?T.cost/b.totalCost*100:0;return m.jsxs("div",{className:"uh-model-row",children:[m.jsxs("span",{className:"uh-model-name",children:[m.jsx("span",{className:"uh-legend-dot",style:{background:Gl(T.modelName)}}),as(T.modelName)]}),m.jsx("span",{className:"uh-model-bar",children:m.jsx("span",{className:"uh-model-bar-fill",style:{width:`${M}%`,background:Gl(T.modelName)}})}),m.jsx("span",{className:"uh-model-cost",children:ze(T.cost)})]},T.modelName)})})]})]})]})})}function Yl({label:e,val:n,accent:r}){return m.jsxs("div",{className:"uh-stat",children:[m.jsx("span",{className:`uh-stat-val${r?" accent":""}`,children:n}),m.jsx("span",{className:"uh-stat-label",children:e})]})}function Kl({label:e,val:n}){return m.jsxs("div",{className:"uh-ministat",children:[m.jsx("span",{className:"uh-ministat-val",children:n}),m.jsx("span",{className:"uh-ministat-label",children:e})]})}function Uv(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jd,Gx;function OL(){if(Gx)return jd;Gx=1;function e(){this.__data__=[],this.size=0}return jd=e,jd}var Td,Yx;function co(){if(Yx)return Td;Yx=1;function e(n,r){return n===r||n!==n&&r!==r}return Td=e,Td}var Ad,Kx;function bu(){if(Kx)return Ad;Kx=1;var e=co();function n(r,s){for(var o=r.length;o--;)if(e(r[o][0],s))return o;return-1}return Ad=n,Ad}var Id,Xx;function LL(){if(Xx)return Id;Xx=1;var e=bu(),n=Array.prototype,r=n.splice;function s(o){var l=this.__data__,u=e(l,o);if(u<0)return!1;var c=l.length-1;return u==c?l.pop():r.call(l,u,1),--this.size,!0}return Id=s,Id}var Md,Qx;function qL(){if(Qx)return Md;Qx=1;var e=bu();function n(r){var s=this.__data__,o=e(s,r);return o<0?void 0:s[o][1]}return Md=n,Md}var Pd,Zx;function $L(){if(Zx)return Pd;Zx=1;var e=bu();function n(r){return e(this.__data__,r)>-1}return Pd=n,Pd}var Od,Jx;function DL(){if(Jx)return Od;Jx=1;var e=bu();function n(r,s){var o=this.__data__,l=e(o,r);return l<0?(++this.size,o.push([r,s])):o[l][1]=s,this}return Od=n,Od}var Ld,e_;function Su(){if(e_)return Ld;e_=1;var e=OL(),n=LL(),r=qL(),s=$L(),o=DL();function l(u){var c=-1,p=u==null?0:u.length;for(this.clear();++c<p;){var h=u[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=s,l.prototype.set=o,Ld=l,Ld}var qd,t_;function FL(){if(t_)return qd;t_=1;var e=Su();function n(){this.__data__=new e,this.size=0}return qd=n,qd}var $d,n_;function zL(){if(n_)return $d;n_=1;function e(n){var r=this.__data__,s=r.delete(n);return this.size=r.size,s}return $d=e,$d}var Dd,r_;function BL(){if(r_)return Dd;r_=1;function e(n){return this.__data__.get(n)}return Dd=e,Dd}var Fd,i_;function UL(){if(i_)return Fd;i_=1;function e(n){return this.__data__.has(n)}return Fd=e,Fd}var zd,s_;function fC(){if(s_)return zd;s_=1;var e=typeof Il=="object"&&Il&&Il.Object===Object&&Il;return zd=e,zd}var Bd,o_;function sr(){if(o_)return Bd;o_=1;var e=fC(),n=typeof self=="object"&&self&&self.Object===Object&&self,r=e||n||Function("return this")();return Bd=r,Bd}var Ud,a_;function fo(){if(a_)return Ud;a_=1;var e=sr(),n=e.Symbol;return Ud=n,Ud}var Hd,l_;function HL(){if(l_)return Hd;l_=1;var e=fo(),n=Object.prototype,r=n.hasOwnProperty,s=n.toString,o=e?e.toStringTag:void 0;function l(u){var c=r.call(u,o),p=u[o];try{u[o]=void 0;var h=!0}catch{}var f=s.call(u);return h&&(c?u[o]=p:delete u[o]),f}return Hd=l,Hd}var Wd,u_;function WL(){if(u_)return Wd;u_=1;var e=Object.prototype,n=e.toString;function r(s){return n.call(s)}return Wd=r,Wd}var Vd,c_;function ls(){if(c_)return Vd;c_=1;var e=fo(),n=HL(),r=WL(),s="[object Null]",o="[object Undefined]",l=e?e.toStringTag:void 0;function u(c){return c==null?c===void 0?o:s:l&&l in Object(c)?n(c):r(c)}return Vd=u,Vd}var Gd,d_;function Ln(){if(d_)return Gd;d_=1;function e(n){var r=typeof n;return n!=null&&(r=="object"||r=="function")}return Gd=e,Gd}var Yd,f_;function ba(){if(f_)return Yd;f_=1;var e=ls(),n=Ln(),r="[object AsyncFunction]",s="[object Function]",o="[object GeneratorFunction]",l="[object Proxy]";function u(c){if(!n(c))return!1;var p=e(c);return p==s||p==o||p==r||p==l}return Yd=u,Yd}var Kd,h_;function VL(){if(h_)return Kd;h_=1;var e=sr(),n=e["__core-js_shared__"];return Kd=n,Kd}var Xd,p_;function GL(){if(p_)return Xd;p_=1;var e=VL(),n=(function(){var s=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""})();function r(s){return!!n&&n in s}return Xd=r,Xd}var Qd,m_;function hC(){if(m_)return Qd;m_=1;var e=Function.prototype,n=e.toString;function r(s){if(s!=null){try{return n.call(s)}catch{}try{return s+""}catch{}}return""}return Qd=r,Qd}var Zd,g_;function YL(){if(g_)return Zd;g_=1;var e=ba(),n=GL(),r=Ln(),s=hC(),o=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,p=u.toString,h=c.hasOwnProperty,f=RegExp("^"+p.call(h).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g(y){if(!r(y)||n(y))return!1;var x=e(y)?f:l;return x.test(s(y))}return Zd=g,Zd}var Jd,v_;function KL(){if(v_)return Jd;v_=1;function e(n,r){return n==null?void 0:n[r]}return Jd=e,Jd}var ef,y_;function us(){if(y_)return ef;y_=1;var e=YL(),n=KL();function r(s,o){var l=n(s,o);return e(l)?l:void 0}return ef=r,ef}var tf,w_;function Hv(){if(w_)return tf;w_=1;var e=us(),n=sr(),r=e(n,"Map");return tf=r,tf}var nf,x_;function ku(){if(x_)return nf;x_=1;var e=us(),n=e(Object,"create");return nf=n,nf}var rf,__;function XL(){if(__)return rf;__=1;var e=ku();function n(){this.__data__=e?e(null):{},this.size=0}return rf=n,rf}var sf,b_;function QL(){if(b_)return sf;b_=1;function e(n){var r=this.has(n)&&delete this.__data__[n];return this.size-=r?1:0,r}return sf=e,sf}var of,S_;function ZL(){if(S_)return of;S_=1;var e=ku(),n="__lodash_hash_undefined__",r=Object.prototype,s=r.hasOwnProperty;function o(l){var u=this.__data__;if(e){var c=u[l];return c===n?void 0:c}return s.call(u,l)?u[l]:void 0}return of=o,of}var af,k_;function JL(){if(k_)return af;k_=1;var e=ku(),n=Object.prototype,r=n.hasOwnProperty;function s(o){var l=this.__data__;return e?l[o]!==void 0:r.call(l,o)}return af=s,af}var lf,E_;function eq(){if(E_)return lf;E_=1;var e=ku(),n="__lodash_hash_undefined__";function r(s,o){var l=this.__data__;return this.size+=this.has(s)?0:1,l[s]=e&&o===void 0?n:o,this}return lf=r,lf}var uf,N_;function tq(){if(N_)return uf;N_=1;var e=XL(),n=QL(),r=ZL(),s=JL(),o=eq();function l(u){var c=-1,p=u==null?0:u.length;for(this.clear();++c<p;){var h=u[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=s,l.prototype.set=o,uf=l,uf}var cf,C_;function nq(){if(C_)return cf;C_=1;var e=tq(),n=Su(),r=Hv();function s(){this.size=0,this.__data__={hash:new e,map:new(r||n),string:new e}}return cf=s,cf}var df,R_;function rq(){if(R_)return df;R_=1;function e(n){var r=typeof n;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null}return df=e,df}var ff,j_;function Eu(){if(j_)return ff;j_=1;var e=rq();function n(r,s){var o=r.__data__;return e(s)?o[typeof s=="string"?"string":"hash"]:o.map}return ff=n,ff}var hf,T_;function iq(){if(T_)return hf;T_=1;var e=Eu();function n(r){var s=e(this,r).delete(r);return this.size-=s?1:0,s}return hf=n,hf}var pf,A_;function sq(){if(A_)return pf;A_=1;var e=Eu();function n(r){return e(this,r).get(r)}return pf=n,pf}var mf,I_;function oq(){if(I_)return mf;I_=1;var e=Eu();function n(r){return e(this,r).has(r)}return mf=n,mf}var gf,M_;function aq(){if(M_)return gf;M_=1;var e=Eu();function n(r,s){var o=e(this,r),l=o.size;return o.set(r,s),this.size+=o.size==l?0:1,this}return gf=n,gf}var vf,P_;function Wv(){if(P_)return vf;P_=1;var e=nq(),n=iq(),r=sq(),s=oq(),o=aq();function l(u){var c=-1,p=u==null?0:u.length;for(this.clear();++c<p;){var h=u[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=s,l.prototype.set=o,vf=l,vf}var yf,O_;function lq(){if(O_)return yf;O_=1;var e=Su(),n=Hv(),r=Wv(),s=200;function o(l,u){var c=this.__data__;if(c instanceof e){var p=c.__data__;if(!n||p.length<s-1)return p.push([l,u]),this.size=++c.size,this;c=this.__data__=new r(p)}return c.set(l,u),this.size=c.size,this}return yf=o,yf}var wf,L_;function Nu(){if(L_)return wf;L_=1;var e=Su(),n=FL(),r=zL(),s=BL(),o=UL(),l=lq();function u(c){var p=this.__data__=new e(c);this.size=p.size}return u.prototype.clear=n,u.prototype.delete=r,u.prototype.get=s,u.prototype.has=o,u.prototype.set=l,wf=u,wf}var xf,q_;function Vv(){if(q_)return xf;q_=1;function e(n,r){for(var s=-1,o=n==null?0:n.length;++s<o&&r(n[s],s,n)!==!1;);return n}return xf=e,xf}var _f,$_;function pC(){if($_)return _f;$_=1;var e=us(),n=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return _f=n,_f}var bf,D_;function Cu(){if(D_)return bf;D_=1;var e=pC();function n(r,s,o){s=="__proto__"&&e?e(r,s,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[s]=o}return bf=n,bf}var Sf,F_;function Ru(){if(F_)return Sf;F_=1;var e=Cu(),n=co(),r=Object.prototype,s=r.hasOwnProperty;function o(l,u,c){var p=l[u];(!(s.call(l,u)&&n(p,c))||c===void 0&&!(u in l))&&e(l,u,c)}return Sf=o,Sf}var kf,z_;function Sa(){if(z_)return kf;z_=1;var e=Ru(),n=Cu();function r(s,o,l,u){var c=!l;l||(l={});for(var p=-1,h=o.length;++p<h;){var f=o[p],g=u?u(l[f],s[f],f,l,s):void 0;g===void 0&&(g=s[f]),c?n(l,f,g):e(l,f,g)}return l}return kf=r,kf}var Ef,B_;function uq(){if(B_)return Ef;B_=1;function e(n,r){for(var s=-1,o=Array(n);++s<n;)o[s]=r(s);return o}return Ef=e,Ef}var Nf,U_;function xr(){if(U_)return Nf;U_=1;function e(n){return n!=null&&typeof n=="object"}return Nf=e,Nf}var Cf,H_;function cq(){if(H_)return Cf;H_=1;var e=ls(),n=xr(),r="[object Arguments]";function s(o){return n(o)&&e(o)==r}return Cf=s,Cf}var Rf,W_;function ka(){if(W_)return Rf;W_=1;var e=cq(),n=xr(),r=Object.prototype,s=r.hasOwnProperty,o=r.propertyIsEnumerable,l=e((function(){return arguments})())?e:function(u){return n(u)&&s.call(u,"callee")&&!o.call(u,"callee")};return Rf=l,Rf}var jf,V_;function bt(){if(V_)return jf;V_=1;var e=Array.isArray;return jf=e,jf}var ia={exports:{}},Tf,G_;function dq(){if(G_)return Tf;G_=1;function e(){return!1}return Tf=e,Tf}ia.exports;var Y_;function ho(){return Y_||(Y_=1,(function(e,n){var r=sr(),s=dq(),o=n&&!n.nodeType&&n,l=o&&!0&&e&&!e.nodeType&&e,u=l&&l.exports===o,c=u?r.Buffer:void 0,p=c?c.isBuffer:void 0,h=p||s;e.exports=h})(ia,ia.exports)),ia.exports}var Af,K_;function ju(){if(K_)return Af;K_=1;var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function r(s,o){var l=typeof s;return o=o??e,!!o&&(l=="number"||l!="symbol"&&n.test(s))&&s>-1&&s%1==0&&s<o}return Af=r,Af}var If,X_;function Gv(){if(X_)return If;X_=1;var e=9007199254740991;function n(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return If=n,If}var Mf,Q_;function fq(){if(Q_)return Mf;Q_=1;var e=ls(),n=Gv(),r=xr(),s="[object Arguments]",o="[object Array]",l="[object Boolean]",u="[object Date]",c="[object Error]",p="[object Function]",h="[object Map]",f="[object Number]",g="[object Object]",y="[object RegExp]",x="[object Set]",N="[object String]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",k="[object Float32Array]",E="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",M="[object Int32Array]",L="[object Uint8Array]",H="[object Uint8ClampedArray]",O="[object Uint16Array]",P="[object Uint32Array]",F={};F[k]=F[E]=F[C]=F[T]=F[M]=F[L]=F[H]=F[O]=F[P]=!0,F[s]=F[o]=F[S]=F[l]=F[b]=F[u]=F[c]=F[p]=F[h]=F[f]=F[g]=F[y]=F[x]=F[N]=F[_]=!1;function G(q){return r(q)&&n(q.length)&&!!F[e(q)]}return Mf=G,Mf}var Pf,Z_;function Tu(){if(Z_)return Pf;Z_=1;function e(n){return function(r){return n(r)}}return Pf=e,Pf}var sa={exports:{}};sa.exports;var J_;function Yv(){return J_||(J_=1,(function(e,n){var r=fC(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===s,u=l&&r.process,c=(function(){try{var p=o&&o.require&&o.require("util").types;return p||u&&u.binding&&u.binding("util")}catch{}})();e.exports=c})(sa,sa.exports)),sa.exports}var Of,e1;function Ea(){if(e1)return Of;e1=1;var e=fq(),n=Tu(),r=Yv(),s=r&&r.isTypedArray,o=s?n(s):e;return Of=o,Of}var Lf,t1;function mC(){if(t1)return Lf;t1=1;var e=uq(),n=ka(),r=bt(),s=ho(),o=ju(),l=Ea(),u=Object.prototype,c=u.hasOwnProperty;function p(h,f){var g=r(h),y=!g&&n(h),x=!g&&!y&&s(h),N=!g&&!y&&!x&&l(h),_=g||y||x||N,S=_?e(h.length,String):[],b=S.length;for(var k in h)(f||c.call(h,k))&&!(_&&(k=="length"||x&&(k=="offset"||k=="parent")||N&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||o(k,b)))&&S.push(k);return S}return Lf=p,Lf}var qf,n1;function Au(){if(n1)return qf;n1=1;var e=Object.prototype;function n(r){var s=r&&r.constructor,o=typeof s=="function"&&s.prototype||e;return r===o}return qf=n,qf}var $f,r1;function gC(){if(r1)return $f;r1=1;function e(n,r){return function(s){return n(r(s))}}return $f=e,$f}var Df,i1;function hq(){if(i1)return Df;i1=1;var e=gC(),n=e(Object.keys,Object);return Df=n,Df}var Ff,s1;function Kv(){if(s1)return Ff;s1=1;var e=Au(),n=hq(),r=Object.prototype,s=r.hasOwnProperty;function o(l){if(!e(l))return n(l);var u=[];for(var c in Object(l))s.call(l,c)&&c!="constructor"&&u.push(c);return u}return Ff=o,Ff}var zf,o1;function Fr(){if(o1)return zf;o1=1;var e=ba(),n=Gv();function r(s){return s!=null&&n(s.length)&&!e(s)}return zf=r,zf}var Bf,a1;function wi(){if(a1)return Bf;a1=1;var e=mC(),n=Kv(),r=Fr();function s(o){return r(o)?e(o):n(o)}return Bf=s,Bf}var Uf,l1;function pq(){if(l1)return Uf;l1=1;var e=Sa(),n=wi();function r(s,o){return s&&e(o,n(o),s)}return Uf=r,Uf}var Hf,u1;function mq(){if(u1)return Hf;u1=1;function e(n){var r=[];if(n!=null)for(var s in Object(n))r.push(s);return r}return Hf=e,Hf}var Wf,c1;function gq(){if(c1)return Wf;c1=1;var e=Ln(),n=Au(),r=mq(),s=Object.prototype,o=s.hasOwnProperty;function l(u){if(!e(u))return r(u);var c=n(u),p=[];for(var h in u)h=="constructor"&&(c||!o.call(u,h))||p.push(h);return p}return Wf=l,Wf}var Vf,d1;function cs(){if(d1)return Vf;d1=1;var e=mC(),n=gq(),r=Fr();function s(o){return r(o)?e(o,!0):n(o)}return Vf=s,Vf}var Gf,f1;function vq(){if(f1)return Gf;f1=1;var e=Sa(),n=cs();function r(s,o){return s&&e(o,n(o),s)}return Gf=r,Gf}var oa={exports:{}};oa.exports;var h1;function vC(){return h1||(h1=1,(function(e,n){var r=sr(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===s,u=l?r.Buffer:void 0,c=u?u.allocUnsafe:void 0;function p(h,f){if(f)return h.slice();var g=h.length,y=c?c(g):new h.constructor(g);return h.copy(y),y}e.exports=p})(oa,oa.exports)),oa.exports}var Yf,p1;function yC(){if(p1)return Yf;p1=1;function e(n,r){var s=-1,o=n.length;for(r||(r=Array(o));++s<o;)r[s]=n[s];return r}return Yf=e,Yf}var Kf,m1;function wC(){if(m1)return Kf;m1=1;function e(n,r){for(var s=-1,o=n==null?0:n.length,l=0,u=[];++s<o;){var c=n[s];r(c,s,n)&&(u[l++]=c)}return u}return Kf=e,Kf}var Xf,g1;function xC(){if(g1)return Xf;g1=1;function e(){return[]}return Xf=e,Xf}var Qf,v1;function Xv(){if(v1)return Qf;v1=1;var e=wC(),n=xC(),r=Object.prototype,s=r.propertyIsEnumerable,o=Object.getOwnPropertySymbols,l=o?function(u){return u==null?[]:(u=Object(u),e(o(u),function(c){return s.call(u,c)}))}:n;return Qf=l,Qf}var Zf,y1;function yq(){if(y1)return Zf;y1=1;var e=Sa(),n=Xv();function r(s,o){return e(s,n(s),o)}return Zf=r,Zf}var Jf,w1;function Qv(){if(w1)return Jf;w1=1;function e(n,r){for(var s=-1,o=r.length,l=n.length;++s<o;)n[l+s]=r[s];return n}return Jf=e,Jf}var eh,x1;function Iu(){if(x1)return eh;x1=1;var e=gC(),n=e(Object.getPrototypeOf,Object);return eh=n,eh}var th,_1;function _C(){if(_1)return th;_1=1;var e=Qv(),n=Iu(),r=Xv(),s=xC(),o=Object.getOwnPropertySymbols,l=o?function(u){for(var c=[];u;)e(c,r(u)),u=n(u);return c}:s;return th=l,th}var nh,b1;function wq(){if(b1)return nh;b1=1;var e=Sa(),n=_C();function r(s,o){return e(s,n(s),o)}return nh=r,nh}var rh,S1;function bC(){if(S1)return rh;S1=1;var e=Qv(),n=bt();function r(s,o,l){var u=o(s);return n(s)?u:e(u,l(s))}return rh=r,rh}var ih,k1;function SC(){if(k1)return ih;k1=1;var e=bC(),n=Xv(),r=wi();function s(o){return e(o,r,n)}return ih=s,ih}var sh,E1;function xq(){if(E1)return sh;E1=1;var e=bC(),n=_C(),r=cs();function s(o){return e(o,r,n)}return sh=s,sh}var oh,N1;function _q(){if(N1)return oh;N1=1;var e=us(),n=sr(),r=e(n,"DataView");return oh=r,oh}var ah,C1;function bq(){if(C1)return ah;C1=1;var e=us(),n=sr(),r=e(n,"Promise");return ah=r,ah}var lh,R1;function kC(){if(R1)return lh;R1=1;var e=us(),n=sr(),r=e(n,"Set");return lh=r,lh}var uh,j1;function Sq(){if(j1)return uh;j1=1;var e=us(),n=sr(),r=e(n,"WeakMap");return uh=r,uh}var ch,T1;function po(){if(T1)return ch;T1=1;var e=_q(),n=Hv(),r=bq(),s=kC(),o=Sq(),l=ls(),u=hC(),c="[object Map]",p="[object Object]",h="[object Promise]",f="[object Set]",g="[object WeakMap]",y="[object DataView]",x=u(e),N=u(n),_=u(r),S=u(s),b=u(o),k=l;return(e&&k(new e(new ArrayBuffer(1)))!=y||n&&k(new n)!=c||r&&k(r.resolve())!=h||s&&k(new s)!=f||o&&k(new o)!=g)&&(k=function(E){var C=l(E),T=C==p?E.constructor:void 0,M=T?u(T):"";if(M)switch(M){case x:return y;case N:return c;case _:return h;case S:return f;case b:return g}return C}),ch=k,ch}var dh,A1;function kq(){if(A1)return dh;A1=1;var e=Object.prototype,n=e.hasOwnProperty;function r(s){var o=s.length,l=new s.constructor(o);return o&&typeof s[0]=="string"&&n.call(s,"index")&&(l.index=s.index,l.input=s.input),l}return dh=r,dh}var fh,I1;function EC(){if(I1)return fh;I1=1;var e=sr(),n=e.Uint8Array;return fh=n,fh}var hh,M1;function Zv(){if(M1)return hh;M1=1;var e=EC();function n(r){var s=new r.constructor(r.byteLength);return new e(s).set(new e(r)),s}return hh=n,hh}var ph,P1;function Eq(){if(P1)return ph;P1=1;var e=Zv();function n(r,s){var o=s?e(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}return ph=n,ph}var mh,O1;function Nq(){if(O1)return mh;O1=1;var e=/\w*$/;function n(r){var s=new r.constructor(r.source,e.exec(r));return s.lastIndex=r.lastIndex,s}return mh=n,mh}var gh,L1;function Cq(){if(L1)return gh;L1=1;var e=fo(),n=e?e.prototype:void 0,r=n?n.valueOf:void 0;function s(o){return r?Object(r.call(o)):{}}return gh=s,gh}var vh,q1;function NC(){if(q1)return vh;q1=1;var e=Zv();function n(r,s){var o=s?e(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}return vh=n,vh}var yh,$1;function Rq(){if($1)return yh;$1=1;var e=Zv(),n=Eq(),r=Nq(),s=Cq(),o=NC(),l="[object Boolean]",u="[object Date]",c="[object Map]",p="[object Number]",h="[object RegExp]",f="[object Set]",g="[object String]",y="[object Symbol]",x="[object ArrayBuffer]",N="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",b="[object Int8Array]",k="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",T="[object Uint8ClampedArray]",M="[object Uint16Array]",L="[object Uint32Array]";function H(O,P,F){var G=O.constructor;switch(P){case x:return e(O);case l:case u:return new G(+O);case N:return n(O,F);case _:case S:case b:case k:case E:case C:case T:case M:case L:return o(O,F);case c:return new G;case p:case g:return new G(O);case h:return r(O);case f:return new G;case y:return s(O)}}return yh=H,yh}var wh,D1;function CC(){if(D1)return wh;D1=1;var e=Ln(),n=Object.create,r=(function(){function s(){}return function(o){if(!e(o))return{};if(n)return n(o);s.prototype=o;var l=new s;return s.prototype=void 0,l}})();return wh=r,wh}var xh,F1;function RC(){if(F1)return xh;F1=1;var e=CC(),n=Iu(),r=Au();function s(o){return typeof o.constructor=="function"&&!r(o)?e(n(o)):{}}return xh=s,xh}var _h,z1;function jq(){if(z1)return _h;z1=1;var e=po(),n=xr(),r="[object Map]";function s(o){return n(o)&&e(o)==r}return _h=s,_h}var bh,B1;function Tq(){if(B1)return bh;B1=1;var e=jq(),n=Tu(),r=Yv(),s=r&&r.isMap,o=s?n(s):e;return bh=o,bh}var Sh,U1;function Aq(){if(U1)return Sh;U1=1;var e=po(),n=xr(),r="[object Set]";function s(o){return n(o)&&e(o)==r}return Sh=s,Sh}var kh,H1;function Iq(){if(H1)return kh;H1=1;var e=Aq(),n=Tu(),r=Yv(),s=r&&r.isSet,o=s?n(s):e;return kh=o,kh}var Eh,W1;function jC(){if(W1)return Eh;W1=1;var e=Nu(),n=Vv(),r=Ru(),s=pq(),o=vq(),l=vC(),u=yC(),c=yq(),p=wq(),h=SC(),f=xq(),g=po(),y=kq(),x=Rq(),N=RC(),_=bt(),S=ho(),b=Tq(),k=Ln(),E=Iq(),C=wi(),T=cs(),M=1,L=2,H=4,O="[object Arguments]",P="[object Array]",F="[object Boolean]",G="[object Date]",q="[object Error]",j="[object Function]",Q="[object GeneratorFunction]",z="[object Map]",ne="[object Number]",Z="[object Object]",$="[object RegExp]",K="[object Set]",I="[object String]",W="[object Symbol]",X="[object WeakMap]",U="[object ArrayBuffer]",J="[object DataView]",re="[object Float32Array]",le="[object Float64Array]",de="[object Int8Array]",te="[object Int16Array]",ce="[object Int32Array]",Ce="[object Uint8Array]",ve="[object Uint8ClampedArray]",Te="[object Uint16Array]",ye="[object Uint32Array]",ke={};ke[O]=ke[P]=ke[U]=ke[J]=ke[F]=ke[G]=ke[re]=ke[le]=ke[de]=ke[te]=ke[ce]=ke[z]=ke[ne]=ke[Z]=ke[$]=ke[K]=ke[I]=ke[W]=ke[Ce]=ke[ve]=ke[Te]=ke[ye]=!0,ke[q]=ke[j]=ke[X]=!1;function Ge(we,_e,Be,Ye,ot,tt){var Fe,Qe=_e&M,ft=_e&L,St=_e&H;if(Be&&(Fe=ot?Be(we,Ye,ot,tt):Be(we)),Fe!==void 0)return Fe;if(!k(we))return we;var nt=_(we);if(nt){if(Fe=y(we),!Qe)return u(we,Fe)}else{var vt=g(we),Kt=vt==j||vt==Q;if(S(we))return l(we,Qe);if(vt==Z||vt==O||Kt&&!ot){if(Fe=ft||Kt?{}:N(we),!Qe)return ft?p(we,o(Fe,we)):c(we,s(Fe,we))}else{if(!ke[vt])return ot?we:{};Fe=x(we,vt,Qe)}}tt||(tt=new e);var Ot=tt.get(we);if(Ot)return Ot;tt.set(we,Fe),E(we)?we.forEach(function(rt){Fe.add(Ge(rt,_e,Be,rt,we,tt))}):b(we)&&we.forEach(function(rt,yt){Fe.set(yt,Ge(rt,_e,Be,yt,we,tt))});var Je=St?ft?f:h:ft?T:C,kt=nt?void 0:Je(we);return n(kt||we,function(rt,yt){kt&&(yt=rt,rt=we[yt]),r(Fe,yt,Ge(rt,_e,Be,yt,we,tt))}),Fe}return Eh=Ge,Eh}var Nh,V1;function Mq(){if(V1)return Nh;V1=1;var e=jC(),n=4;function r(s){return e(s,n)}return Nh=r,Nh}var Ch,G1;function Jv(){if(G1)return Ch;G1=1;function e(n){return function(){return n}}return Ch=e,Ch}var Rh,Y1;function Pq(){if(Y1)return Rh;Y1=1;function e(n){return function(r,s,o){for(var l=-1,u=Object(r),c=o(r),p=c.length;p--;){var h=c[n?p:++l];if(s(u[h],h,u)===!1)break}return r}}return Rh=e,Rh}var jh,K1;function ey(){if(K1)return jh;K1=1;var e=Pq(),n=e();return jh=n,jh}var Th,X1;function ty(){if(X1)return Th;X1=1;var e=ey(),n=wi();function r(s,o){return s&&e(s,o,n)}return Th=r,Th}var Ah,Q1;function Oq(){if(Q1)return Ah;Q1=1;var e=Fr();function n(r,s){return function(o,l){if(o==null)return o;if(!e(o))return r(o,l);for(var u=o.length,c=s?u:-1,p=Object(o);(s?c--:++c<u)&&l(p[c],c,p)!==!1;);return o}}return Ah=n,Ah}var Ih,Z1;function Mu(){if(Z1)return Ih;Z1=1;var e=ty(),n=Oq(),r=n(e);return Ih=r,Ih}var Mh,J1;function ds(){if(J1)return Mh;J1=1;function e(n){return n}return Mh=e,Mh}var Ph,eb;function TC(){if(eb)return Ph;eb=1;var e=ds();function n(r){return typeof r=="function"?r:e}return Ph=n,Ph}var Oh,tb;function AC(){if(tb)return Oh;tb=1;var e=Vv(),n=Mu(),r=TC(),s=bt();function o(l,u){var c=s(l)?e:n;return c(l,r(u))}return Oh=o,Oh}var Lh,nb;function IC(){return nb||(nb=1,Lh=AC()),Lh}var qh,rb;function Lq(){if(rb)return qh;rb=1;var e=Mu();function n(r,s){var o=[];return e(r,function(l,u,c){s(l,u,c)&&o.push(l)}),o}return qh=n,qh}var $h,ib;function qq(){if(ib)return $h;ib=1;var e="__lodash_hash_undefined__";function n(r){return this.__data__.set(r,e),this}return $h=n,$h}var Dh,sb;function $q(){if(sb)return Dh;sb=1;function e(n){return this.__data__.has(n)}return Dh=e,Dh}var Fh,ob;function MC(){if(ob)return Fh;ob=1;var e=Wv(),n=qq(),r=$q();function s(o){var l=-1,u=o==null?0:o.length;for(this.__data__=new e;++l<u;)this.add(o[l])}return s.prototype.add=s.prototype.push=n,s.prototype.has=r,Fh=s,Fh}var zh,ab;function Dq(){if(ab)return zh;ab=1;function e(n,r){for(var s=-1,o=n==null?0:n.length;++s<o;)if(r(n[s],s,n))return!0;return!1}return zh=e,zh}var Bh,lb;function PC(){if(lb)return Bh;lb=1;function e(n,r){return n.has(r)}return Bh=e,Bh}var Uh,ub;function OC(){if(ub)return Uh;ub=1;var e=MC(),n=Dq(),r=PC(),s=1,o=2;function l(u,c,p,h,f,g){var y=p&s,x=u.length,N=c.length;if(x!=N&&!(y&&N>x))return!1;var _=g.get(u),S=g.get(c);if(_&&S)return _==c&&S==u;var b=-1,k=!0,E=p&o?new e:void 0;for(g.set(u,c),g.set(c,u);++b<x;){var C=u[b],T=c[b];if(h)var M=y?h(T,C,b,c,u,g):h(C,T,b,u,c,g);if(M!==void 0){if(M)continue;k=!1;break}if(E){if(!n(c,function(L,H){if(!r(E,H)&&(C===L||f(C,L,p,h,g)))return E.push(H)})){k=!1;break}}else if(!(C===T||f(C,T,p,h,g))){k=!1;break}}return g.delete(u),g.delete(c),k}return Uh=l,Uh}var Hh,cb;function Fq(){if(cb)return Hh;cb=1;function e(n){var r=-1,s=Array(n.size);return n.forEach(function(o,l){s[++r]=[l,o]}),s}return Hh=e,Hh}var Wh,db;function ny(){if(db)return Wh;db=1;function e(n){var r=-1,s=Array(n.size);return n.forEach(function(o){s[++r]=o}),s}return Wh=e,Wh}var Vh,fb;function zq(){if(fb)return Vh;fb=1;var e=fo(),n=EC(),r=co(),s=OC(),o=Fq(),l=ny(),u=1,c=2,p="[object Boolean]",h="[object Date]",f="[object Error]",g="[object Map]",y="[object Number]",x="[object RegExp]",N="[object Set]",_="[object String]",S="[object Symbol]",b="[object ArrayBuffer]",k="[object DataView]",E=e?e.prototype:void 0,C=E?E.valueOf:void 0;function T(M,L,H,O,P,F,G){switch(H){case k:if(M.byteLength!=L.byteLength||M.byteOffset!=L.byteOffset)return!1;M=M.buffer,L=L.buffer;case b:return!(M.byteLength!=L.byteLength||!F(new n(M),new n(L)));case p:case h:case y:return r(+M,+L);case f:return M.name==L.name&&M.message==L.message;case x:case _:return M==L+"";case g:var q=o;case N:var j=O&u;if(q||(q=l),M.size!=L.size&&!j)return!1;var Q=G.get(M);if(Q)return Q==L;O|=c,G.set(M,L);var z=s(q(M),q(L),O,P,F,G);return G.delete(M),z;case S:if(C)return C.call(M)==C.call(L)}return!1}return Vh=T,Vh}var Gh,hb;function Bq(){if(hb)return Gh;hb=1;var e=SC(),n=1,r=Object.prototype,s=r.hasOwnProperty;function o(l,u,c,p,h,f){var g=c&n,y=e(l),x=y.length,N=e(u),_=N.length;if(x!=_&&!g)return!1;for(var S=x;S--;){var b=y[S];if(!(g?b in u:s.call(u,b)))return!1}var k=f.get(l),E=f.get(u);if(k&&E)return k==u&&E==l;var C=!0;f.set(l,u),f.set(u,l);for(var T=g;++S<x;){b=y[S];var M=l[b],L=u[b];if(p)var H=g?p(L,M,b,u,l,f):p(M,L,b,l,u,f);if(!(H===void 0?M===L||h(M,L,c,p,f):H)){C=!1;break}T||(T=b=="constructor")}if(C&&!T){var O=l.constructor,P=u.constructor;O!=P&&"constructor"in l&&"constructor"in u&&!(typeof O=="function"&&O instanceof O&&typeof P=="function"&&P instanceof P)&&(C=!1)}return f.delete(l),f.delete(u),C}return Gh=o,Gh}var Yh,pb;function Uq(){if(pb)return Yh;pb=1;var e=Nu(),n=OC(),r=zq(),s=Bq(),o=po(),l=bt(),u=ho(),c=Ea(),p=1,h="[object Arguments]",f="[object Array]",g="[object Object]",y=Object.prototype,x=y.hasOwnProperty;function N(_,S,b,k,E,C){var T=l(_),M=l(S),L=T?f:o(_),H=M?f:o(S);L=L==h?g:L,H=H==h?g:H;var O=L==g,P=H==g,F=L==H;if(F&&u(_)){if(!u(S))return!1;T=!0,O=!1}if(F&&!O)return C||(C=new e),T||c(_)?n(_,S,b,k,E,C):r(_,S,L,b,k,E,C);if(!(b&p)){var G=O&&x.call(_,"__wrapped__"),q=P&&x.call(S,"__wrapped__");if(G||q){var j=G?_.value():_,Q=q?S.value():S;return C||(C=new e),E(j,Q,b,k,C)}}return F?(C||(C=new e),s(_,S,b,k,E,C)):!1}return Yh=N,Yh}var Kh,mb;function LC(){if(mb)return Kh;mb=1;var e=Uq(),n=xr();function r(s,o,l,u,c){return s===o?!0:s==null||o==null||!n(s)&&!n(o)?s!==s&&o!==o:e(s,o,l,u,r,c)}return Kh=r,Kh}var Xh,gb;function Hq(){if(gb)return Xh;gb=1;var e=Nu(),n=LC(),r=1,s=2;function o(l,u,c,p){var h=c.length,f=h,g=!p;if(l==null)return!f;for(l=Object(l);h--;){var y=c[h];if(g&&y[2]?y[1]!==l[y[0]]:!(y[0]in l))return!1}for(;++h<f;){y=c[h];var x=y[0],N=l[x],_=y[1];if(g&&y[2]){if(N===void 0&&!(x in l))return!1}else{var S=new e;if(p)var b=p(N,_,x,l,u,S);if(!(b===void 0?n(_,N,r|s,p,S):b))return!1}}return!0}return Xh=o,Xh}var Qh,vb;function qC(){if(vb)return Qh;vb=1;var e=Ln();function n(r){return r===r&&!e(r)}return Qh=n,Qh}var Zh,yb;function Wq(){if(yb)return Zh;yb=1;var e=qC(),n=wi();function r(s){for(var o=n(s),l=o.length;l--;){var u=o[l],c=s[u];o[l]=[u,c,e(c)]}return o}return Zh=r,Zh}var Jh,wb;function $C(){if(wb)return Jh;wb=1;function e(n,r){return function(s){return s==null?!1:s[n]===r&&(r!==void 0||n in Object(s))}}return Jh=e,Jh}var ep,xb;function Vq(){if(xb)return ep;xb=1;var e=Hq(),n=Wq(),r=$C();function s(o){var l=n(o);return l.length==1&&l[0][2]?r(l[0][0],l[0][1]):function(u){return u===o||e(u,o,l)}}return ep=s,ep}var tp,_b;function mo(){if(_b)return tp;_b=1;var e=ls(),n=xr(),r="[object Symbol]";function s(o){return typeof o=="symbol"||n(o)&&e(o)==r}return tp=s,tp}var np,bb;function ry(){if(bb)return np;bb=1;var e=bt(),n=mo(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function o(l,u){if(e(l))return!1;var c=typeof l;return c=="number"||c=="symbol"||c=="boolean"||l==null||n(l)?!0:s.test(l)||!r.test(l)||u!=null&&l in Object(u)}return np=o,np}var rp,Sb;function Gq(){if(Sb)return rp;Sb=1;var e=Wv(),n="Expected a function";function r(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new TypeError(n);var l=function(){var u=arguments,c=o?o.apply(this,u):u[0],p=l.cache;if(p.has(c))return p.get(c);var h=s.apply(this,u);return l.cache=p.set(c,h)||p,h};return l.cache=new(r.Cache||e),l}return r.Cache=e,rp=r,rp}var ip,kb;function Yq(){if(kb)return ip;kb=1;var e=Gq(),n=500;function r(s){var o=e(s,function(u){return l.size===n&&l.clear(),u}),l=o.cache;return o}return ip=r,ip}var sp,Eb;function Kq(){if(Eb)return sp;Eb=1;var e=Yq(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,s=e(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(n,function(u,c,p,h){l.push(p?h.replace(r,"$1"):c||u)}),l});return sp=s,sp}var op,Nb;function Pu(){if(Nb)return op;Nb=1;function e(n,r){for(var s=-1,o=n==null?0:n.length,l=Array(o);++s<o;)l[s]=r(n[s],s,n);return l}return op=e,op}var ap,Cb;function Xq(){if(Cb)return ap;Cb=1;var e=fo(),n=Pu(),r=bt(),s=mo(),o=e?e.prototype:void 0,l=o?o.toString:void 0;function u(c){if(typeof c=="string")return c;if(r(c))return n(c,u)+"";if(s(c))return l?l.call(c):"";var p=c+"";return p=="0"&&1/c==-1/0?"-0":p}return ap=u,ap}var lp,Rb;function DC(){if(Rb)return lp;Rb=1;var e=Xq();function n(r){return r==null?"":e(r)}return lp=n,lp}var up,jb;function Ou(){if(jb)return up;jb=1;var e=bt(),n=ry(),r=Kq(),s=DC();function o(l,u){return e(l)?l:n(l,u)?[l]:r(s(l))}return up=o,up}var cp,Tb;function Na(){if(Tb)return cp;Tb=1;var e=mo();function n(r){if(typeof r=="string"||e(r))return r;var s=r+"";return s=="0"&&1/r==-1/0?"-0":s}return cp=n,cp}var dp,Ab;function Lu(){if(Ab)return dp;Ab=1;var e=Ou(),n=Na();function r(s,o){o=e(o,s);for(var l=0,u=o.length;s!=null&&l<u;)s=s[n(o[l++])];return l&&l==u?s:void 0}return dp=r,dp}var fp,Ib;function Qq(){if(Ib)return fp;Ib=1;var e=Lu();function n(r,s,o){var l=r==null?void 0:e(r,s);return l===void 0?o:l}return fp=n,fp}var hp,Mb;function Zq(){if(Mb)return hp;Mb=1;function e(n,r){return n!=null&&r in Object(n)}return hp=e,hp}var pp,Pb;function FC(){if(Pb)return pp;Pb=1;var e=Ou(),n=ka(),r=bt(),s=ju(),o=Gv(),l=Na();function u(c,p,h){p=e(p,c);for(var f=-1,g=p.length,y=!1;++f<g;){var x=l(p[f]);if(!(y=c!=null&&h(c,x)))break;c=c[x]}return y||++f!=g?y:(g=c==null?0:c.length,!!g&&o(g)&&s(x,g)&&(r(c)||n(c)))}return pp=u,pp}var mp,Ob;function zC(){if(Ob)return mp;Ob=1;var e=Zq(),n=FC();function r(s,o){return s!=null&&n(s,o,e)}return mp=r,mp}var gp,Lb;function Jq(){if(Lb)return gp;Lb=1;var e=LC(),n=Qq(),r=zC(),s=ry(),o=qC(),l=$C(),u=Na(),c=1,p=2;function h(f,g){return s(f)&&o(g)?l(u(f),g):function(y){var x=n(y,f);return x===void 0&&x===g?r(y,f):e(g,x,c|p)}}return gp=h,gp}var vp,qb;function BC(){if(qb)return vp;qb=1;function e(n){return function(r){return r==null?void 0:r[n]}}return vp=e,vp}var yp,$b;function e$(){if($b)return yp;$b=1;var e=Lu();function n(r){return function(s){return e(s,r)}}return yp=n,yp}var wp,Db;function t$(){if(Db)return wp;Db=1;var e=BC(),n=e$(),r=ry(),s=Na();function o(l){return r(l)?e(s(l)):n(l)}return wp=o,wp}var xp,Fb;function zr(){if(Fb)return xp;Fb=1;var e=Vq(),n=Jq(),r=ds(),s=bt(),o=t$();function l(u){return typeof u=="function"?u:u==null?r:typeof u=="object"?s(u)?n(u[0],u[1]):e(u):o(u)}return xp=l,xp}var _p,zb;function UC(){if(zb)return _p;zb=1;var e=wC(),n=Lq(),r=zr(),s=bt();function o(l,u){var c=s(l)?e:n;return c(l,r(u,3))}return _p=o,_p}var bp,Bb;function n$(){if(Bb)return bp;Bb=1;var e=Object.prototype,n=e.hasOwnProperty;function r(s,o){return s!=null&&n.call(s,o)}return bp=r,bp}var Sp,Ub;function HC(){if(Ub)return Sp;Ub=1;var e=n$(),n=FC();function r(s,o){return s!=null&&n(s,o,e)}return Sp=r,Sp}var kp,Hb;function r$(){if(Hb)return kp;Hb=1;var e=Kv(),n=po(),r=ka(),s=bt(),o=Fr(),l=ho(),u=Au(),c=Ea(),p="[object Map]",h="[object Set]",f=Object.prototype,g=f.hasOwnProperty;function y(x){if(x==null)return!0;if(o(x)&&(s(x)||typeof x=="string"||typeof x.splice=="function"||l(x)||c(x)||r(x)))return!x.length;var N=n(x);if(N==p||N==h)return!x.size;if(u(x))return!e(x).length;for(var _ in x)if(g.call(x,_))return!1;return!0}return kp=y,kp}var Ep,Wb;function WC(){if(Wb)return Ep;Wb=1;function e(n){return n===void 0}return Ep=e,Ep}var Np,Vb;function VC(){if(Vb)return Np;Vb=1;var e=Mu(),n=Fr();function r(s,o){var l=-1,u=n(s)?Array(s.length):[];return e(s,function(c,p,h){u[++l]=o(c,p,h)}),u}return Np=r,Np}var Cp,Gb;function GC(){if(Gb)return Cp;Gb=1;var e=Pu(),n=zr(),r=VC(),s=bt();function o(l,u){var c=s(l)?e:r;return c(l,n(u,3))}return Cp=o,Cp}var Rp,Yb;function i$(){if(Yb)return Rp;Yb=1;function e(n,r,s,o){var l=-1,u=n==null?0:n.length;for(o&&u&&(s=n[++l]);++l<u;)s=r(s,n[l],l,n);return s}return Rp=e,Rp}var jp,Kb;function s$(){if(Kb)return jp;Kb=1;function e(n,r,s,o,l){return l(n,function(u,c,p){s=o?(o=!1,u):r(s,u,c,p)}),s}return jp=e,jp}var Tp,Xb;function YC(){if(Xb)return Tp;Xb=1;var e=i$(),n=Mu(),r=zr(),s=s$(),o=bt();function l(u,c,p){var h=o(u)?e:s,f=arguments.length<3;return h(u,r(c,4),p,f,n)}return Tp=l,Tp}var Ap,Qb;function o$(){if(Qb)return Ap;Qb=1;var e=ls(),n=bt(),r=xr(),s="[object String]";function o(l){return typeof l=="string"||!n(l)&&r(l)&&e(l)==s}return Ap=o,Ap}var Ip,Zb;function a$(){if(Zb)return Ip;Zb=1;var e=BC(),n=e("length");return Ip=n,Ip}var Mp,Jb;function l$(){if(Jb)return Mp;Jb=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=n+r+s,l="\\ufe0e\\ufe0f",u="\\u200d",c=RegExp("["+u+e+o+l+"]");function p(h){return c.test(h)}return Mp=p,Mp}var Pp,eS;function u$(){if(eS)return Pp;eS=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=n+r+s,l="\\ufe0e\\ufe0f",u="["+e+"]",c="["+o+"]",p="\\ud83c[\\udffb-\\udfff]",h="(?:"+c+"|"+p+")",f="[^"+e+"]",g="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",N=h+"?",_="["+l+"]?",S="(?:"+x+"(?:"+[f,g,y].join("|")+")"+_+N+")*",b=_+N+S,k="(?:"+[f+c+"?",c,g,y,u].join("|")+")",E=RegExp(p+"(?="+p+")|"+k+b,"g");function C(T){for(var M=E.lastIndex=0;E.test(T);)++M;return M}return Pp=C,Pp}var Op,tS;function c$(){if(tS)return Op;tS=1;var e=a$(),n=l$(),r=u$();function s(o){return n(o)?r(o):e(o)}return Op=s,Op}var Lp,nS;function d$(){if(nS)return Lp;nS=1;var e=Kv(),n=po(),r=Fr(),s=o$(),o=c$(),l="[object Map]",u="[object Set]";function c(p){if(p==null)return 0;if(r(p))return s(p)?o(p):p.length;var h=n(p);return h==l||h==u?p.size:e(p).length}return Lp=c,Lp}var qp,rS;function f$(){if(rS)return qp;rS=1;var e=Vv(),n=CC(),r=ty(),s=zr(),o=Iu(),l=bt(),u=ho(),c=ba(),p=Ln(),h=Ea();function f(g,y,x){var N=l(g),_=N||u(g)||h(g);if(y=s(y,4),x==null){var S=g&&g.constructor;_?x=N?new S:[]:p(g)?x=c(S)?n(o(g)):{}:x={}}return(_?e:r)(g,function(b,k,E){return y(x,b,k,E)}),x}return qp=f,qp}var $p,iS;function h$(){if(iS)return $p;iS=1;var e=fo(),n=ka(),r=bt(),s=e?e.isConcatSpreadable:void 0;function o(l){return r(l)||n(l)||!!(s&&l&&l[s])}return $p=o,$p}var Dp,sS;function iy(){if(sS)return Dp;sS=1;var e=Qv(),n=h$();function r(s,o,l,u,c){var p=-1,h=s.length;for(l||(l=n),c||(c=[]);++p<h;){var f=s[p];o>0&&l(f)?o>1?r(f,o-1,l,u,c):e(c,f):u||(c[c.length]=f)}return c}return Dp=r,Dp}var Fp,oS;function p$(){if(oS)return Fp;oS=1;function e(n,r,s){switch(s.length){case 0:return n.call(r);case 1:return n.call(r,s[0]);case 2:return n.call(r,s[0],s[1]);case 3:return n.call(r,s[0],s[1],s[2])}return n.apply(r,s)}return Fp=e,Fp}var zp,aS;function KC(){if(aS)return zp;aS=1;var e=p$(),n=Math.max;function r(s,o,l){return o=n(o===void 0?s.length-1:o,0),function(){for(var u=arguments,c=-1,p=n(u.length-o,0),h=Array(p);++c<p;)h[c]=u[o+c];c=-1;for(var f=Array(o+1);++c<o;)f[c]=u[c];return f[o]=l(h),e(s,this,f)}}return zp=r,zp}var Bp,lS;function m$(){if(lS)return Bp;lS=1;var e=Jv(),n=pC(),r=ds(),s=n?function(o,l){return n(o,"toString",{configurable:!0,enumerable:!1,value:e(l),writable:!0})}:r;return Bp=s,Bp}var Up,uS;function g$(){if(uS)return Up;uS=1;var e=800,n=16,r=Date.now;function s(o){var l=0,u=0;return function(){var c=r(),p=n-(c-u);if(u=c,p>0){if(++l>=e)return arguments[0]}else l=0;return o.apply(void 0,arguments)}}return Up=s,Up}var Hp,cS;function XC(){if(cS)return Hp;cS=1;var e=m$(),n=g$(),r=n(e);return Hp=r,Hp}var Wp,dS;function qu(){if(dS)return Wp;dS=1;var e=ds(),n=KC(),r=XC();function s(o,l){return r(n(o,l,e),o+"")}return Wp=s,Wp}var Vp,fS;function QC(){if(fS)return Vp;fS=1;function e(n,r,s,o){for(var l=n.length,u=s+(o?1:-1);o?u--:++u<l;)if(r(n[u],u,n))return u;return-1}return Vp=e,Vp}var Gp,hS;function v$(){if(hS)return Gp;hS=1;function e(n){return n!==n}return Gp=e,Gp}var Yp,pS;function y$(){if(pS)return Yp;pS=1;function e(n,r,s){for(var o=s-1,l=n.length;++o<l;)if(n[o]===r)return o;return-1}return Yp=e,Yp}var Kp,mS;function w$(){if(mS)return Kp;mS=1;var e=QC(),n=v$(),r=y$();function s(o,l,u){return l===l?r(o,l,u):e(o,n,u)}return Kp=s,Kp}var Xp,gS;function x$(){if(gS)return Xp;gS=1;var e=w$();function n(r,s){var o=r==null?0:r.length;return!!o&&e(r,s,0)>-1}return Xp=n,Xp}var Qp,vS;function _$(){if(vS)return Qp;vS=1;function e(n,r,s){for(var o=-1,l=n==null?0:n.length;++o<l;)if(s(r,n[o]))return!0;return!1}return Qp=e,Qp}var Zp,yS;function b$(){if(yS)return Zp;yS=1;function e(){}return Zp=e,Zp}var Jp,wS;function S$(){if(wS)return Jp;wS=1;var e=kC(),n=b$(),r=ny(),s=1/0,o=e&&1/r(new e([,-0]))[1]==s?function(l){return new e(l)}:n;return Jp=o,Jp}var em,xS;function k$(){if(xS)return em;xS=1;var e=MC(),n=x$(),r=_$(),s=PC(),o=S$(),l=ny(),u=200;function c(p,h,f){var g=-1,y=n,x=p.length,N=!0,_=[],S=_;if(f)N=!1,y=r;else if(x>=u){var b=h?null:o(p);if(b)return l(b);N=!1,y=s,S=new e}else S=h?[]:_;e:for(;++g<x;){var k=p[g],E=h?h(k):k;if(k=f||k!==0?k:0,N&&E===E){for(var C=S.length;C--;)if(S[C]===E)continue e;h&&S.push(E),_.push(k)}else y(S,E,f)||(S!==_&&S.push(E),_.push(k))}return _}return em=c,em}var tm,_S;function ZC(){if(_S)return tm;_S=1;var e=Fr(),n=xr();function r(s){return n(s)&&e(s)}return tm=r,tm}var nm,bS;function E$(){if(bS)return nm;bS=1;var e=iy(),n=qu(),r=k$(),s=ZC(),o=n(function(l){return r(e(l,1,s,!0))});return nm=o,nm}var rm,SS;function N$(){if(SS)return rm;SS=1;var e=Pu();function n(r,s){return e(s,function(o){return r[o]})}return rm=n,rm}var im,kS;function JC(){if(kS)return im;kS=1;var e=N$(),n=wi();function r(s){return s==null?[]:e(s,n(s))}return im=r,im}var sm,ES;function qn(){if(ES)return sm;ES=1;var e;if(typeof Uv=="function")try{e={clone:Mq(),constant:Jv(),each:IC(),filter:UC(),has:HC(),isArray:bt(),isEmpty:r$(),isFunction:ba(),isUndefined:WC(),keys:wi(),map:GC(),reduce:YC(),size:d$(),transform:f$(),union:E$(),values:JC()}}catch{}return e||(e=window._),sm=e,sm}var om,NS;function sy(){if(NS)return om;NS=1;var e=qn();om=o;var n="\0",r="\0",s="";function o(f){this._isDirected=e.has(f,"directed")?f.directed:!0,this._isMultigraph=e.has(f,"multigraph")?f.multigraph:!1,this._isCompound=e.has(f,"compound")?f.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(f){return this._label=f,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(f){return e.isFunction(f)||(f=e.constant(f)),this._defaultNodeLabelFn=f,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var f=this;return e.filter(this.nodes(),function(g){return e.isEmpty(f._in[g])})},o.prototype.sinks=function(){var f=this;return e.filter(this.nodes(),function(g){return e.isEmpty(f._out[g])})},o.prototype.setNodes=function(f,g){var y=arguments,x=this;return e.each(f,function(N){y.length>1?x.setNode(N,g):x.setNode(N)}),this},o.prototype.setNode=function(f,g){return e.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=g),this):(this._nodes[f]=arguments.length>1?g:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=r,this._children[f]={},this._children[r][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},o.prototype.node=function(f){return this._nodes[f]},o.prototype.hasNode=function(f){return e.has(this._nodes,f)},o.prototype.removeNode=function(f){var g=this;if(e.has(this._nodes,f)){var y=function(x){g.removeEdge(g._edgeObjs[x])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],e.each(this.children(f),function(x){g.setParent(x)}),delete this._children[f]),e.each(e.keys(this._in[f]),y),delete this._in[f],delete this._preds[f],e.each(e.keys(this._out[f]),y),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},o.prototype.setParent=function(f,g){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(g))g=r;else{g+="";for(var y=g;!e.isUndefined(y);y=this.parent(y))if(y===f)throw new Error("Setting "+g+" as parent of "+f+" would create a cycle");this.setNode(g)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=g,this._children[g][f]=!0,this},o.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},o.prototype.parent=function(f){if(this._isCompound){var g=this._parent[f];if(g!==r)return g}},o.prototype.children=function(f){if(e.isUndefined(f)&&(f=r),this._isCompound){var g=this._children[f];if(g)return e.keys(g)}else{if(f===r)return this.nodes();if(this.hasNode(f))return[]}},o.prototype.predecessors=function(f){var g=this._preds[f];if(g)return e.keys(g)},o.prototype.successors=function(f){var g=this._sucs[f];if(g)return e.keys(g)},o.prototype.neighbors=function(f){var g=this.predecessors(f);if(g)return e.union(g,this.successors(f))},o.prototype.isLeaf=function(f){var g;return this.isDirected()?g=this.successors(f):g=this.neighbors(f),g.length===0},o.prototype.filterNodes=function(f){var g=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});g.setGraph(this.graph());var y=this;e.each(this._nodes,function(_,S){f(S)&&g.setNode(S,_)}),e.each(this._edgeObjs,function(_){g.hasNode(_.v)&&g.hasNode(_.w)&&g.setEdge(_,y.edge(_))});var x={};function N(_){var S=y.parent(_);return S===void 0||g.hasNode(S)?(x[_]=S,S):S in x?x[S]:N(S)}return this._isCompound&&e.each(g.nodes(),function(_){g.setParent(_,N(_))}),g},o.prototype.setDefaultEdgeLabel=function(f){return e.isFunction(f)||(f=e.constant(f)),this._defaultEdgeLabelFn=f,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(f,g){var y=this,x=arguments;return e.reduce(f,function(N,_){return x.length>1?y.setEdge(N,_,g):y.setEdge(N,_),_}),this},o.prototype.setEdge=function(){var f,g,y,x,N=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(f=_.v,g=_.w,y=_.name,arguments.length===2&&(x=arguments[1],N=!0)):(f=_,g=arguments[1],y=arguments[3],arguments.length>2&&(x=arguments[2],N=!0)),f=""+f,g=""+g,e.isUndefined(y)||(y=""+y);var S=c(this._isDirected,f,g,y);if(e.has(this._edgeLabels,S))return N&&(this._edgeLabels[S]=x),this;if(!e.isUndefined(y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(g),this._edgeLabels[S]=N?x:this._defaultEdgeLabelFn(f,g,y);var b=p(this._isDirected,f,g,y);return f=b.v,g=b.w,Object.freeze(b),this._edgeObjs[S]=b,l(this._preds[g],f),l(this._sucs[f],g),this._in[g][S]=b,this._out[f][S]=b,this._edgeCount++,this},o.prototype.edge=function(f,g,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,f,g,y);return this._edgeLabels[x]},o.prototype.hasEdge=function(f,g,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,f,g,y);return e.has(this._edgeLabels,x)},o.prototype.removeEdge=function(f,g,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,f,g,y),N=this._edgeObjs[x];return N&&(f=N.v,g=N.w,delete this._edgeLabels[x],delete this._edgeObjs[x],u(this._preds[g],f),u(this._sucs[f],g),delete this._in[g][x],delete this._out[f][x],this._edgeCount--),this},o.prototype.inEdges=function(f,g){var y=this._in[f];if(y){var x=e.values(y);return g?e.filter(x,function(N){return N.v===g}):x}},o.prototype.outEdges=function(f,g){var y=this._out[f];if(y){var x=e.values(y);return g?e.filter(x,function(N){return N.w===g}):x}},o.prototype.nodeEdges=function(f,g){var y=this.inEdges(f,g);if(y)return y.concat(this.outEdges(f,g))};function l(f,g){f[g]?f[g]++:f[g]=1}function u(f,g){--f[g]||delete f[g]}function c(f,g,y,x){var N=""+g,_=""+y;if(!f&&N>_){var S=N;N=_,_=S}return N+s+_+s+(e.isUndefined(x)?n:x)}function p(f,g,y,x){var N=""+g,_=""+y;if(!f&&N>_){var S=N;N=_,_=S}var b={v:N,w:_};return x&&(b.name=x),b}function h(f,g){return c(f,g.v,g.w,g.name)}return om}var am,CS;function C$(){return CS||(CS=1,am="2.1.8"),am}var lm,RS;function R$(){return RS||(RS=1,lm={Graph:sy(),version:C$()}),lm}var um,jS;function j$(){if(jS)return um;jS=1;var e=qn(),n=sy();um={write:r,read:l};function r(u){var c={options:{directed:u.isDirected(),multigraph:u.isMultigraph(),compound:u.isCompound()},nodes:s(u),edges:o(u)};return e.isUndefined(u.graph())||(c.value=e.clone(u.graph())),c}function s(u){return e.map(u.nodes(),function(c){var p=u.node(c),h=u.parent(c),f={v:c};return e.isUndefined(p)||(f.value=p),e.isUndefined(h)||(f.parent=h),f})}function o(u){return e.map(u.edges(),function(c){var p=u.edge(c),h={v:c.v,w:c.w};return e.isUndefined(c.name)||(h.name=c.name),e.isUndefined(p)||(h.value=p),h})}function l(u){var c=new n(u.options).setGraph(u.value);return e.each(u.nodes,function(p){c.setNode(p.v,p.value),p.parent&&c.setParent(p.v,p.parent)}),e.each(u.edges,function(p){c.setEdge({v:p.v,w:p.w,name:p.name},p.value)}),c}return um}var cm,TS;function T$(){if(TS)return cm;TS=1;var e=qn();cm=n;function n(r){var s={},o=[],l;function u(c){e.has(s,c)||(s[c]=!0,l.push(c),e.each(r.successors(c),u),e.each(r.predecessors(c),u))}return e.each(r.nodes(),function(c){l=[],u(c),l.length&&o.push(l)}),o}return cm}var dm,AS;function eR(){if(AS)return dm;AS=1;var e=qn();dm=n;function n(){this._arr=[],this._keyIndices={}}return n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(r){return r.key})},n.prototype.has=function(r){return e.has(this._keyIndices,r)},n.prototype.priority=function(r){var s=this._keyIndices[r];if(s!==void 0)return this._arr[s].priority},n.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(r,s){var o=this._keyIndices;if(r=String(r),!e.has(o,r)){var l=this._arr,u=l.length;return o[r]=u,l.push({key:r,priority:s}),this._decrease(u),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},n.prototype.decrease=function(r,s){var o=this._keyIndices[r];if(s>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[o].priority+" New: "+s);this._arr[o].priority=s,this._decrease(o)},n.prototype._heapify=function(r){var s=this._arr,o=2*r,l=o+1,u=r;o<s.length&&(u=s[o].priority<s[u].priority?o:u,l<s.length&&(u=s[l].priority<s[u].priority?l:u),u!==r&&(this._swap(r,u),this._heapify(u)))},n.prototype._decrease=function(r){for(var s=this._arr,o=s[r].priority,l;r!==0&&(l=r>>1,!(s[l].priority<o));)this._swap(r,l),r=l},n.prototype._swap=function(r,s){var o=this._arr,l=this._keyIndices,u=o[r],c=o[s];o[r]=c,o[s]=u,l[c.key]=r,l[u.key]=s},dm}var fm,IS;function tR(){if(IS)return fm;IS=1;var e=qn(),n=eR();fm=s;var r=e.constant(1);function s(l,u,c,p){return o(l,String(u),c||r,p||function(h){return l.outEdges(h)})}function o(l,u,c,p){var h={},f=new n,g,y,x=function(N){var _=N.v!==g?N.v:N.w,S=h[_],b=c(N),k=y.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+N+" Weight: "+b);k<S.distance&&(S.distance=k,S.predecessor=g,f.decrease(_,k))};for(l.nodes().forEach(function(N){var _=N===u?0:Number.POSITIVE_INFINITY;h[N]={distance:_},f.add(N,_)});f.size()>0&&(g=f.removeMin(),y=h[g],y.distance!==Number.POSITIVE_INFINITY);)p(g).forEach(x);return h}return fm}var hm,MS;function A$(){if(MS)return hm;MS=1;var e=tR(),n=qn();hm=r;function r(s,o,l){return n.transform(s.nodes(),function(u,c){u[c]=e(s,c,o,l)},{})}return hm}var pm,PS;function nR(){if(PS)return pm;PS=1;var e=qn();pm=n;function n(r){var s=0,o=[],l={},u=[];function c(p){var h=l[p]={onStack:!0,lowlink:s,index:s++};if(o.push(p),r.successors(p).forEach(function(y){e.has(l,y)?l[y].onStack&&(h.lowlink=Math.min(h.lowlink,l[y].index)):(c(y),h.lowlink=Math.min(h.lowlink,l[y].lowlink))}),h.lowlink===h.index){var f=[],g;do g=o.pop(),l[g].onStack=!1,f.push(g);while(p!==g);u.push(f)}}return r.nodes().forEach(function(p){e.has(l,p)||c(p)}),u}return pm}var mm,OS;function I$(){if(OS)return mm;OS=1;var e=qn(),n=nR();mm=r;function r(s){return e.filter(n(s),function(o){return o.length>1||o.length===1&&s.hasEdge(o[0],o[0])})}return mm}var gm,LS;function M$(){if(LS)return gm;LS=1;var e=qn();gm=r;var n=e.constant(1);function r(o,l,u){return s(o,l||n,u||function(c){return o.outEdges(c)})}function s(o,l,u){var c={},p=o.nodes();return p.forEach(function(h){c[h]={},c[h][h]={distance:0},p.forEach(function(f){h!==f&&(c[h][f]={distance:Number.POSITIVE_INFINITY})}),u(h).forEach(function(f){var g=f.v===h?f.w:f.v,y=l(f);c[h][g]={distance:y,predecessor:h}})}),p.forEach(function(h){var f=c[h];p.forEach(function(g){var y=c[g];p.forEach(function(x){var N=y[h],_=f[x],S=y[x],b=N.distance+_.distance;b<S.distance&&(S.distance=b,S.predecessor=_.predecessor)})})}),c}return gm}var vm,qS;function rR(){if(qS)return vm;qS=1;var e=qn();vm=n,n.CycleException=r;function n(s){var o={},l={},u=[];function c(p){if(e.has(l,p))throw new r;e.has(o,p)||(l[p]=!0,o[p]=!0,e.each(s.predecessors(p),c),delete l[p],u.push(p))}if(e.each(s.sinks(),c),e.size(o)!==s.nodeCount())throw new r;return u}function r(){}return r.prototype=new Error,vm}var ym,$S;function P$(){if($S)return ym;$S=1;var e=rR();ym=n;function n(r){try{e(r)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return ym}var wm,DS;function iR(){if(DS)return wm;DS=1;var e=qn();wm=n;function n(s,o,l){e.isArray(o)||(o=[o]);var u=(s.isDirected()?s.successors:s.neighbors).bind(s),c=[],p={};return e.each(o,function(h){if(!s.hasNode(h))throw new Error("Graph does not have node: "+h);r(s,h,l==="post",p,u,c)}),c}function r(s,o,l,u,c,p){e.has(u,o)||(u[o]=!0,l||p.push(o),e.each(c(o),function(h){r(s,h,l,u,c,p)}),l&&p.push(o))}return wm}var xm,FS;function O$(){if(FS)return xm;FS=1;var e=iR();xm=n;function n(r,s){return e(r,s,"post")}return xm}var _m,zS;function L$(){if(zS)return _m;zS=1;var e=iR();_m=n;function n(r,s){return e(r,s,"pre")}return _m}var bm,BS;function q$(){if(BS)return bm;BS=1;var e=qn(),n=sy(),r=eR();bm=s;function s(o,l){var u=new n,c={},p=new r,h;function f(y){var x=y.v===h?y.w:y.v,N=p.priority(x);if(N!==void 0){var _=l(y);_<N&&(c[x]=h,p.decrease(x,_))}}if(o.nodeCount()===0)return u;e.each(o.nodes(),function(y){p.add(y,Number.POSITIVE_INFINITY),u.setNode(y)}),p.decrease(o.nodes()[0],0);for(var g=!1;p.size()>0;){if(h=p.removeMin(),e.has(c,h))u.setEdge(h,c[h]);else{if(g)throw new Error("Input graph is not connected: "+o);g=!0}o.nodeEdges(h).forEach(f)}return u}return bm}var Sm,US;function $$(){return US||(US=1,Sm={components:T$(),dijkstra:tR(),dijkstraAll:A$(),findCycles:I$(),floydWarshall:M$(),isAcyclic:P$(),postorder:O$(),preorder:L$(),prim:q$(),tarjan:nR(),topsort:rR()}),Sm}var km,HS;function D$(){if(HS)return km;HS=1;var e=R$();return km={Graph:e.Graph,json:j$(),alg:$$(),version:e.version},km}var Em,WS;function rr(){if(WS)return Em;WS=1;var e;if(typeof Uv=="function")try{e=D$()}catch{}return e||(e=window.graphlib),Em=e,Em}var Nm,VS;function F$(){if(VS)return Nm;VS=1;var e=jC(),n=1,r=4;function s(o){return e(o,n|r)}return Nm=s,Nm}var Cm,GS;function $u(){if(GS)return Cm;GS=1;var e=co(),n=Fr(),r=ju(),s=Ln();function o(l,u,c){if(!s(c))return!1;var p=typeof u;return(p=="number"?n(c)&&r(u,c.length):p=="string"&&u in c)?e(c[u],l):!1}return Cm=o,Cm}var Rm,YS;function z$(){if(YS)return Rm;YS=1;var e=qu(),n=co(),r=$u(),s=cs(),o=Object.prototype,l=o.hasOwnProperty,u=e(function(c,p){c=Object(c);var h=-1,f=p.length,g=f>2?p[2]:void 0;for(g&&r(p[0],p[1],g)&&(f=1);++h<f;)for(var y=p[h],x=s(y),N=-1,_=x.length;++N<_;){var S=x[N],b=c[S];(b===void 0||n(b,o[S])&&!l.call(c,S))&&(c[S]=y[S])}return c});return Rm=u,Rm}var jm,KS;function B$(){if(KS)return jm;KS=1;var e=zr(),n=Fr(),r=wi();function s(o){return function(l,u,c){var p=Object(l);if(!n(l)){var h=e(u,3);l=r(l),u=function(g){return h(p[g],g,p)}}var f=o(l,u,c);return f>-1?p[h?l[f]:f]:void 0}}return jm=s,jm}var Tm,XS;function U$(){if(XS)return Tm;XS=1;var e=/\s/;function n(r){for(var s=r.length;s--&&e.test(r.charAt(s)););return s}return Tm=n,Tm}var Am,QS;function H$(){if(QS)return Am;QS=1;var e=U$(),n=/^\s+/;function r(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return Am=r,Am}var Im,ZS;function W$(){if(ZS)return Im;ZS=1;var e=H$(),n=Ln(),r=mo(),s=NaN,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;function p(h){if(typeof h=="number")return h;if(r(h))return s;if(n(h)){var f=typeof h.valueOf=="function"?h.valueOf():h;h=n(f)?f+"":f}if(typeof h!="string")return h===0?h:+h;h=e(h);var g=l.test(h);return g||u.test(h)?c(h.slice(2),g?2:8):o.test(h)?s:+h}return Im=p,Im}var Mm,JS;function sR(){if(JS)return Mm;JS=1;var e=W$(),n=1/0,r=17976931348623157e292;function s(o){if(!o)return o===0?o:0;if(o=e(o),o===n||o===-n){var l=o<0?-1:1;return l*r}return o===o?o:0}return Mm=s,Mm}var Pm,ek;function V$(){if(ek)return Pm;ek=1;var e=sR();function n(r){var s=e(r),o=s%1;return s===s?o?s-o:s:0}return Pm=n,Pm}var Om,tk;function G$(){if(tk)return Om;tk=1;var e=QC(),n=zr(),r=V$(),s=Math.max;function o(l,u,c){var p=l==null?0:l.length;if(!p)return-1;var h=c==null?0:r(c);return h<0&&(h=s(p+h,0)),e(l,n(u,3),h)}return Om=o,Om}var Lm,nk;function Y$(){if(nk)return Lm;nk=1;var e=B$(),n=G$(),r=e(n);return Lm=r,Lm}var qm,rk;function oR(){if(rk)return qm;rk=1;var e=iy();function n(r){var s=r==null?0:r.length;return s?e(r,1):[]}return qm=n,qm}var $m,ik;function K$(){if(ik)return $m;ik=1;var e=ey(),n=TC(),r=cs();function s(o,l){return o==null?o:e(o,n(l),r)}return $m=s,$m}var Dm,sk;function X$(){if(sk)return Dm;sk=1;function e(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}return Dm=e,Dm}var Fm,ok;function Q$(){if(ok)return Fm;ok=1;var e=Cu(),n=ty(),r=zr();function s(o,l){var u={};return l=r(l,3),n(o,function(c,p,h){e(u,p,l(c,p,h))}),u}return Fm=s,Fm}var zm,ak;function oy(){if(ak)return zm;ak=1;var e=mo();function n(r,s,o){for(var l=-1,u=r.length;++l<u;){var c=r[l],p=s(c);if(p!=null&&(h===void 0?p===p&&!e(p):o(p,h)))var h=p,f=c}return f}return zm=n,zm}var Bm,lk;function Z$(){if(lk)return Bm;lk=1;function e(n,r){return n>r}return Bm=e,Bm}var Um,uk;function J$(){if(uk)return Um;uk=1;var e=oy(),n=Z$(),r=ds();function s(o){return o&&o.length?e(o,r,n):void 0}return Um=s,Um}var Hm,ck;function aR(){if(ck)return Hm;ck=1;var e=Cu(),n=co();function r(s,o,l){(l!==void 0&&!n(s[o],l)||l===void 0&&!(o in s))&&e(s,o,l)}return Hm=r,Hm}var Wm,dk;function e4(){if(dk)return Wm;dk=1;var e=ls(),n=Iu(),r=xr(),s="[object Object]",o=Function.prototype,l=Object.prototype,u=o.toString,c=l.hasOwnProperty,p=u.call(Object);function h(f){if(!r(f)||e(f)!=s)return!1;var g=n(f);if(g===null)return!0;var y=c.call(g,"constructor")&&g.constructor;return typeof y=="function"&&y instanceof y&&u.call(y)==p}return Wm=h,Wm}var Vm,fk;function lR(){if(fk)return Vm;fk=1;function e(n,r){if(!(r==="constructor"&&typeof n[r]=="function")&&r!="__proto__")return n[r]}return Vm=e,Vm}var Gm,hk;function t4(){if(hk)return Gm;hk=1;var e=Sa(),n=cs();function r(s){return e(s,n(s))}return Gm=r,Gm}var Ym,pk;function n4(){if(pk)return Ym;pk=1;var e=aR(),n=vC(),r=NC(),s=yC(),o=RC(),l=ka(),u=bt(),c=ZC(),p=ho(),h=ba(),f=Ln(),g=e4(),y=Ea(),x=lR(),N=t4();function _(S,b,k,E,C,T,M){var L=x(S,k),H=x(b,k),O=M.get(H);if(O){e(S,k,O);return}var P=T?T(L,H,k+"",S,b,M):void 0,F=P===void 0;if(F){var G=u(H),q=!G&&p(H),j=!G&&!q&&y(H);P=H,G||q||j?u(L)?P=L:c(L)?P=s(L):q?(F=!1,P=n(H,!0)):j?(F=!1,P=r(H,!0)):P=[]:g(H)||l(H)?(P=L,l(L)?P=N(L):(!f(L)||h(L))&&(P=o(H))):F=!1}F&&(M.set(H,P),C(P,H,E,T,M),M.delete(H)),e(S,k,P)}return Ym=_,Ym}var Km,mk;function r4(){if(mk)return Km;mk=1;var e=Nu(),n=aR(),r=ey(),s=n4(),o=Ln(),l=cs(),u=lR();function c(p,h,f,g,y){p!==h&&r(h,function(x,N){if(y||(y=new e),o(x))s(p,h,N,f,c,g,y);else{var _=g?g(u(p,N),x,N+"",p,h,y):void 0;_===void 0&&(_=x),n(p,N,_)}},l)}return Km=c,Km}var Xm,gk;function i4(){if(gk)return Xm;gk=1;var e=qu(),n=$u();function r(s){return e(function(o,l){var u=-1,c=l.length,p=c>1?l[c-1]:void 0,h=c>2?l[2]:void 0;for(p=s.length>3&&typeof p=="function"?(c--,p):void 0,h&&n(l[0],l[1],h)&&(p=c<3?void 0:p,c=1),o=Object(o);++u<c;){var f=l[u];f&&s(o,f,u,p)}return o})}return Xm=r,Xm}var Qm,vk;function s4(){if(vk)return Qm;vk=1;var e=r4(),n=i4(),r=n(function(s,o,l){e(s,o,l)});return Qm=r,Qm}var Zm,yk;function uR(){if(yk)return Zm;yk=1;function e(n,r){return n<r}return Zm=e,Zm}var Jm,wk;function o4(){if(wk)return Jm;wk=1;var e=oy(),n=uR(),r=ds();function s(o){return o&&o.length?e(o,r,n):void 0}return Jm=s,Jm}var eg,xk;function a4(){if(xk)return eg;xk=1;var e=oy(),n=zr(),r=uR();function s(o,l){return o&&o.length?e(o,n(l,2),r):void 0}return eg=s,eg}var tg,_k;function l4(){if(_k)return tg;_k=1;var e=sr(),n=function(){return e.Date.now()};return tg=n,tg}var ng,bk;function u4(){if(bk)return ng;bk=1;var e=Ru(),n=Ou(),r=ju(),s=Ln(),o=Na();function l(u,c,p,h){if(!s(u))return u;c=n(c,u);for(var f=-1,g=c.length,y=g-1,x=u;x!=null&&++f<g;){var N=o(c[f]),_=p;if(N==="__proto__"||N==="constructor"||N==="prototype")return u;if(f!=y){var S=x[N];_=h?h(S,N,x):void 0,_===void 0&&(_=s(S)?S:r(c[f+1])?[]:{})}e(x,N,_),x=x[N]}return u}return ng=l,ng}var rg,Sk;function c4(){if(Sk)return rg;Sk=1;var e=Lu(),n=u4(),r=Ou();function s(o,l,u){for(var c=-1,p=l.length,h={};++c<p;){var f=l[c],g=e(o,f);u(g,f)&&n(h,r(f,o),g)}return h}return rg=s,rg}var ig,kk;function d4(){if(kk)return ig;kk=1;var e=c4(),n=zC();function r(s,o){return e(s,o,function(l,u){return n(s,u)})}return ig=r,ig}var sg,Ek;function f4(){if(Ek)return sg;Ek=1;var e=oR(),n=KC(),r=XC();function s(o){return r(n(o,void 0,e),o+"")}return sg=s,sg}var og,Nk;function h4(){if(Nk)return og;Nk=1;var e=d4(),n=f4(),r=n(function(s,o){return s==null?{}:e(s,o)});return og=r,og}var ag,Ck;function p4(){if(Ck)return ag;Ck=1;var e=Math.ceil,n=Math.max;function r(s,o,l,u){for(var c=-1,p=n(e((o-s)/(l||1)),0),h=Array(p);p--;)h[u?p:++c]=s,s+=l;return h}return ag=r,ag}var lg,Rk;function m4(){if(Rk)return lg;Rk=1;var e=p4(),n=$u(),r=sR();function s(o){return function(l,u,c){return c&&typeof c!="number"&&n(l,u,c)&&(u=c=void 0),l=r(l),u===void 0?(u=l,l=0):u=r(u),c=c===void 0?l<u?1:-1:r(c),e(l,u,c,o)}}return lg=s,lg}var ug,jk;function g4(){if(jk)return ug;jk=1;var e=m4(),n=e();return ug=n,ug}var cg,Tk;function v4(){if(Tk)return cg;Tk=1;function e(n,r){var s=n.length;for(n.sort(r);s--;)n[s]=n[s].value;return n}return cg=e,cg}var dg,Ak;function y4(){if(Ak)return dg;Ak=1;var e=mo();function n(r,s){if(r!==s){var o=r!==void 0,l=r===null,u=r===r,c=e(r),p=s!==void 0,h=s===null,f=s===s,g=e(s);if(!h&&!g&&!c&&r>s||c&&p&&f&&!h&&!g||l&&p&&f||!o&&f||!u)return 1;if(!l&&!c&&!g&&r<s||g&&o&&u&&!l&&!c||h&&o&&u||!p&&u||!f)return-1}return 0}return dg=n,dg}var fg,Ik;function w4(){if(Ik)return fg;Ik=1;var e=y4();function n(r,s,o){for(var l=-1,u=r.criteria,c=s.criteria,p=u.length,h=o.length;++l<p;){var f=e(u[l],c[l]);if(f){if(l>=h)return f;var g=o[l];return f*(g=="desc"?-1:1)}}return r.index-s.index}return fg=n,fg}var hg,Mk;function x4(){if(Mk)return hg;Mk=1;var e=Pu(),n=Lu(),r=zr(),s=VC(),o=v4(),l=Tu(),u=w4(),c=ds(),p=bt();function h(f,g,y){g.length?g=e(g,function(_){return p(_)?function(S){return n(S,_.length===1?_[0]:_)}:_}):g=[c];var x=-1;g=e(g,l(r));var N=s(f,function(_,S,b){var k=e(g,function(E){return E(_)});return{criteria:k,index:++x,value:_}});return o(N,function(_,S){return u(_,S,y)})}return hg=h,hg}var pg,Pk;function _4(){if(Pk)return pg;Pk=1;var e=iy(),n=x4(),r=qu(),s=$u(),o=r(function(l,u){if(l==null)return[];var c=u.length;return c>1&&s(l,u[0],u[1])?u=[]:c>2&&s(u[0],u[1],u[2])&&(u=[u[0]]),n(l,e(u,1),[])});return pg=o,pg}var mg,Ok;function b4(){if(Ok)return mg;Ok=1;var e=DC(),n=0;function r(s){var o=++n;return e(s)+o}return mg=r,mg}var gg,Lk;function S4(){if(Lk)return gg;Lk=1;function e(n,r,s){for(var o=-1,l=n.length,u=r.length,c={};++o<l;){var p=o<u?r[o]:void 0;s(c,n[o],p)}return c}return gg=e,gg}var vg,qk;function k4(){if(qk)return vg;qk=1;var e=Ru(),n=S4();function r(s,o){return n(s||[],o||[],e)}return vg=r,vg}var yg,$k;function ut(){if($k)return yg;$k=1;var e;if(typeof Uv=="function")try{e={cloneDeep:F$(),constant:Jv(),defaults:z$(),each:IC(),filter:UC(),find:Y$(),flatten:oR(),forEach:AC(),forIn:K$(),has:HC(),isUndefined:WC(),last:X$(),map:GC(),mapValues:Q$(),max:J$(),merge:s4(),min:o4(),minBy:a4(),now:l4(),pick:h4(),range:g4(),reduce:YC(),sortBy:_4(),uniqueId:b4(),values:JC(),zipObject:k4()}}catch{}return e||(e=window._),yg=e,yg}var wg,Dk;function E4(){if(Dk)return wg;Dk=1,wg=e;function e(){var s={};s._next=s._prev=s,this._sentinel=s}e.prototype.dequeue=function(){var s=this._sentinel,o=s._prev;if(o!==s)return n(o),o},e.prototype.enqueue=function(s){var o=this._sentinel;s._prev&&s._next&&n(s),s._next=o._next,o._next._prev=s,o._next=s,s._prev=o},e.prototype.toString=function(){for(var s=[],o=this._sentinel,l=o._prev;l!==o;)s.push(JSON.stringify(l,r)),l=l._prev;return"["+s.join(", ")+"]"};function n(s){s._prev._next=s._next,s._next._prev=s._prev,delete s._next,delete s._prev}function r(s,o){if(s!=="_next"&&s!=="_prev")return o}return wg}var xg,Fk;function N4(){if(Fk)return xg;Fk=1;var e=ut(),n=rr().Graph,r=E4();xg=o;var s=e.constant(1);function o(h,f){if(h.nodeCount()<=1)return[];var g=c(h,f||s),y=l(g.graph,g.buckets,g.zeroIdx);return e.flatten(e.map(y,function(x){return h.outEdges(x.v,x.w)}),!0)}function l(h,f,g){for(var y=[],x=f[f.length-1],N=f[0],_;h.nodeCount();){for(;_=N.dequeue();)u(h,f,g,_);for(;_=x.dequeue();)u(h,f,g,_);if(h.nodeCount()){for(var S=f.length-2;S>0;--S)if(_=f[S].dequeue(),_){y=y.concat(u(h,f,g,_,!0));break}}}return y}function u(h,f,g,y,x){var N=x?[]:void 0;return e.forEach(h.inEdges(y.v),function(_){var S=h.edge(_),b=h.node(_.v);x&&N.push({v:_.v,w:_.w}),b.out-=S,p(f,g,b)}),e.forEach(h.outEdges(y.v),function(_){var S=h.edge(_),b=_.w,k=h.node(b);k.in-=S,p(f,g,k)}),h.removeNode(y.v),N}function c(h,f){var g=new n,y=0,x=0;e.forEach(h.nodes(),function(S){g.setNode(S,{v:S,in:0,out:0})}),e.forEach(h.edges(),function(S){var b=g.edge(S.v,S.w)||0,k=f(S),E=b+k;g.setEdge(S.v,S.w,E),x=Math.max(x,g.node(S.v).out+=k),y=Math.max(y,g.node(S.w).in+=k)});var N=e.range(x+y+3).map(function(){return new r}),_=y+1;return e.forEach(g.nodes(),function(S){p(N,_,g.node(S))}),{graph:g,buckets:N,zeroIdx:_}}function p(h,f,g){g.out?g.in?h[g.out-g.in+f].enqueue(g):h[h.length-1].enqueue(g):h[0].enqueue(g)}return xg}var _g,zk;function C4(){if(zk)return _g;zk=1;var e=ut(),n=N4();_g={run:r,undo:o};function r(l){var u=l.graph().acyclicer==="greedy"?n(l,c(l)):s(l);e.forEach(u,function(p){var h=l.edge(p);l.removeEdge(p),h.forwardName=p.name,h.reversed=!0,l.setEdge(p.w,p.v,h,e.uniqueId("rev"))});function c(p){return function(h){return p.edge(h).weight}}}function s(l){var u=[],c={},p={};function h(f){e.has(p,f)||(p[f]=!0,c[f]=!0,e.forEach(l.outEdges(f),function(g){e.has(c,g.w)?u.push(g):h(g.w)}),delete c[f])}return e.forEach(l.nodes(),h),u}function o(l){e.forEach(l.edges(),function(u){var c=l.edge(u);if(c.reversed){l.removeEdge(u);var p=c.forwardName;delete c.reversed,delete c.forwardName,l.setEdge(u.w,u.v,c,p)}})}return _g}var bg,Bk;function cn(){if(Bk)return bg;Bk=1;var e=ut(),n=rr().Graph;bg={addDummyNode:r,simplify:s,asNonCompoundGraph:o,successorWeights:l,predecessorWeights:u,intersectRect:c,buildLayerMatrix:p,normalizeRanks:h,removeEmptyRanks:f,addBorderNode:g,maxRank:y,partition:x,time:N,notime:_};function r(S,b,k,E){var C;do C=e.uniqueId(E);while(S.hasNode(C));return k.dummy=b,S.setNode(C,k),C}function s(S){var b=new n().setGraph(S.graph());return e.forEach(S.nodes(),function(k){b.setNode(k,S.node(k))}),e.forEach(S.edges(),function(k){var E=b.edge(k.v,k.w)||{weight:0,minlen:1},C=S.edge(k);b.setEdge(k.v,k.w,{weight:E.weight+C.weight,minlen:Math.max(E.minlen,C.minlen)})}),b}function o(S){var b=new n({multigraph:S.isMultigraph()}).setGraph(S.graph());return e.forEach(S.nodes(),function(k){S.children(k).length||b.setNode(k,S.node(k))}),e.forEach(S.edges(),function(k){b.setEdge(k,S.edge(k))}),b}function l(S){var b=e.map(S.nodes(),function(k){var E={};return e.forEach(S.outEdges(k),function(C){E[C.w]=(E[C.w]||0)+S.edge(C).weight}),E});return e.zipObject(S.nodes(),b)}function u(S){var b=e.map(S.nodes(),function(k){var E={};return e.forEach(S.inEdges(k),function(C){E[C.v]=(E[C.v]||0)+S.edge(C).weight}),E});return e.zipObject(S.nodes(),b)}function c(S,b){var k=S.x,E=S.y,C=b.x-k,T=b.y-E,M=S.width/2,L=S.height/2;if(!C&&!T)throw new Error("Not possible to find intersection inside of the rectangle");var H,O;return Math.abs(T)*M>Math.abs(C)*L?(T<0&&(L=-L),H=L*C/T,O=L):(C<0&&(M=-M),H=M,O=M*T/C),{x:k+H,y:E+O}}function p(S){var b=e.map(e.range(y(S)+1),function(){return[]});return e.forEach(S.nodes(),function(k){var E=S.node(k),C=E.rank;e.isUndefined(C)||(b[C][E.order]=k)}),b}function h(S){var b=e.min(e.map(S.nodes(),function(k){return S.node(k).rank}));e.forEach(S.nodes(),function(k){var E=S.node(k);e.has(E,"rank")&&(E.rank-=b)})}function f(S){var b=e.min(e.map(S.nodes(),function(T){return S.node(T).rank})),k=[];e.forEach(S.nodes(),function(T){var M=S.node(T).rank-b;k[M]||(k[M]=[]),k[M].push(T)});var E=0,C=S.graph().nodeRankFactor;e.forEach(k,function(T,M){e.isUndefined(T)&&M%C!==0?--E:E&&e.forEach(T,function(L){S.node(L).rank+=E})})}function g(S,b,k,E){var C={width:0,height:0};return arguments.length>=4&&(C.rank=k,C.order=E),r(S,"border",C,b)}function y(S){return e.max(e.map(S.nodes(),function(b){var k=S.node(b).rank;if(!e.isUndefined(k))return k}))}function x(S,b){var k={lhs:[],rhs:[]};return e.forEach(S,function(E){b(E)?k.lhs.push(E):k.rhs.push(E)}),k}function N(S,b){var k=e.now();try{return b()}finally{console.log(S+" time: "+(e.now()-k)+"ms")}}function _(S,b){return b()}return bg}var Sg,Uk;function R4(){if(Uk)return Sg;Uk=1;var e=ut(),n=cn();Sg={run:r,undo:o};function r(l){l.graph().dummyChains=[],e.forEach(l.edges(),function(u){s(l,u)})}function s(l,u){var c=u.v,p=l.node(c).rank,h=u.w,f=l.node(h).rank,g=u.name,y=l.edge(u),x=y.labelRank;if(f!==p+1){l.removeEdge(u);var N,_,S;for(S=0,++p;p<f;++S,++p)y.points=[],_={width:0,height:0,edgeLabel:y,edgeObj:u,rank:p},N=n.addDummyNode(l,"edge",_,"_d"),p===x&&(_.width=y.width,_.height=y.height,_.dummy="edge-label",_.labelpos=y.labelpos),l.setEdge(c,N,{weight:y.weight},g),S===0&&l.graph().dummyChains.push(N),c=N;l.setEdge(c,h,{weight:y.weight},g)}}function o(l){e.forEach(l.graph().dummyChains,function(u){var c=l.node(u),p=c.edgeLabel,h;for(l.setEdge(c.edgeObj,p);c.dummy;)h=l.successors(u)[0],l.removeNode(u),p.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(p.x=c.x,p.y=c.y,p.width=c.width,p.height=c.height),u=h,c=l.node(u)})}return Sg}var kg,Hk;function hu(){if(Hk)return kg;Hk=1;var e=ut();kg={longestPath:n,slack:r};function n(s){var o={};function l(u){var c=s.node(u);if(e.has(o,u))return c.rank;o[u]=!0;var p=e.min(e.map(s.outEdges(u),function(h){return l(h.w)-s.edge(h).minlen}));return(p===Number.POSITIVE_INFINITY||p===void 0||p===null)&&(p=0),c.rank=p}e.forEach(s.sources(),l)}function r(s,o){return s.node(o.w).rank-s.node(o.v).rank-s.edge(o).minlen}return kg}var Eg,Wk;function cR(){if(Wk)return Eg;Wk=1;var e=ut(),n=rr().Graph,r=hu().slack;Eg=s;function s(c){var p=new n({directed:!1}),h=c.nodes()[0],f=c.nodeCount();p.setNode(h,{});for(var g,y;o(p,c)<f;)g=l(p,c),y=p.hasNode(g.v)?r(c,g):-r(c,g),u(p,c,y);return p}function o(c,p){function h(f){e.forEach(p.nodeEdges(f),function(g){var y=g.v,x=f===y?g.w:y;!c.hasNode(x)&&!r(p,g)&&(c.setNode(x,{}),c.setEdge(f,x,{}),h(x))})}return e.forEach(c.nodes(),h),c.nodeCount()}function l(c,p){return e.minBy(p.edges(),function(h){if(c.hasNode(h.v)!==c.hasNode(h.w))return r(p,h)})}function u(c,p,h){e.forEach(c.nodes(),function(f){p.node(f).rank+=h})}return Eg}var Ng,Vk;function j4(){if(Vk)return Ng;Vk=1;var e=ut(),n=cR(),r=hu().slack,s=hu().longestPath,o=rr().alg.preorder,l=rr().alg.postorder,u=cn().simplify;Ng=c,c.initLowLimValues=g,c.initCutValues=p,c.calcCutValue=f,c.leaveEdge=x,c.enterEdge=N,c.exchangeEdges=_;function c(E){E=u(E),s(E);var C=n(E);g(C),p(C,E);for(var T,M;T=x(C);)M=N(C,E,T),_(C,E,T,M)}function p(E,C){var T=l(E,E.nodes());T=T.slice(0,T.length-1),e.forEach(T,function(M){h(E,C,M)})}function h(E,C,T){var M=E.node(T),L=M.parent;E.edge(T,L).cutvalue=f(E,C,T)}function f(E,C,T){var M=E.node(T),L=M.parent,H=!0,O=C.edge(T,L),P=0;return O||(H=!1,O=C.edge(L,T)),P=O.weight,e.forEach(C.nodeEdges(T),function(F){var G=F.v===T,q=G?F.w:F.v;if(q!==L){var j=G===H,Q=C.edge(F).weight;if(P+=j?Q:-Q,b(E,T,q)){var z=E.edge(T,q).cutvalue;P+=j?-z:z}}}),P}function g(E,C){arguments.length<2&&(C=E.nodes()[0]),y(E,{},1,C)}function y(E,C,T,M,L){var H=T,O=E.node(M);return C[M]=!0,e.forEach(E.neighbors(M),function(P){e.has(C,P)||(T=y(E,C,T,P,M))}),O.low=H,O.lim=T++,L?O.parent=L:delete O.parent,T}function x(E){return e.find(E.edges(),function(C){return E.edge(C).cutvalue<0})}function N(E,C,T){var M=T.v,L=T.w;C.hasEdge(M,L)||(M=T.w,L=T.v);var H=E.node(M),O=E.node(L),P=H,F=!1;H.lim>O.lim&&(P=O,F=!0);var G=e.filter(C.edges(),function(q){return F===k(E,E.node(q.v),P)&&F!==k(E,E.node(q.w),P)});return e.minBy(G,function(q){return r(C,q)})}function _(E,C,T,M){var L=T.v,H=T.w;E.removeEdge(L,H),E.setEdge(M.v,M.w,{}),g(E),p(E,C),S(E,C)}function S(E,C){var T=e.find(E.nodes(),function(L){return!C.node(L).parent}),M=o(E,T);M=M.slice(1),e.forEach(M,function(L){var H=E.node(L).parent,O=C.edge(L,H),P=!1;O||(O=C.edge(H,L),P=!0),C.node(L).rank=C.node(H).rank+(P?O.minlen:-O.minlen)})}function b(E,C,T){return E.hasEdge(C,T)}function k(E,C,T){return T.low<=C.lim&&C.lim<=T.lim}return Ng}var Cg,Gk;function T4(){if(Gk)return Cg;Gk=1;var e=hu(),n=e.longestPath,r=cR(),s=j4();Cg=o;function o(p){switch(p.graph().ranker){case"network-simplex":c(p);break;case"tight-tree":u(p);break;case"longest-path":l(p);break;default:c(p)}}var l=n;function u(p){n(p),r(p)}function c(p){s(p)}return Cg}var Rg,Yk;function A4(){if(Yk)return Rg;Yk=1;var e=ut();Rg=n;function n(o){var l=s(o);e.forEach(o.graph().dummyChains,function(u){for(var c=o.node(u),p=c.edgeObj,h=r(o,l,p.v,p.w),f=h.path,g=h.lca,y=0,x=f[y],N=!0;u!==p.w;){if(c=o.node(u),N){for(;(x=f[y])!==g&&o.node(x).maxRank<c.rank;)y++;x===g&&(N=!1)}if(!N){for(;y<f.length-1&&o.node(x=f[y+1]).minRank<=c.rank;)y++;x=f[y]}o.setParent(u,x),u=o.successors(u)[0]}})}function r(o,l,u,c){var p=[],h=[],f=Math.min(l[u].low,l[c].low),g=Math.max(l[u].lim,l[c].lim),y,x;y=u;do y=o.parent(y),p.push(y);while(y&&(l[y].low>f||g>l[y].lim));for(x=y,y=c;(y=o.parent(y))!==x;)h.push(y);return{path:p.concat(h.reverse()),lca:x}}function s(o){var l={},u=0;function c(p){var h=u;e.forEach(o.children(p),c),l[p]={low:h,lim:u++}}return e.forEach(o.children(),c),l}return Rg}var jg,Kk;function I4(){if(Kk)return jg;Kk=1;var e=ut(),n=cn();jg={run:r,cleanup:u};function r(c){var p=n.addDummyNode(c,"root",{},"_root"),h=o(c),f=e.max(e.values(h))-1,g=2*f+1;c.graph().nestingRoot=p,e.forEach(c.edges(),function(x){c.edge(x).minlen*=g});var y=l(c)+1;e.forEach(c.children(),function(x){s(c,p,g,y,f,h,x)}),c.graph().nodeRankFactor=g}function s(c,p,h,f,g,y,x){var N=c.children(x);if(!N.length){x!==p&&c.setEdge(p,x,{weight:0,minlen:h});return}var _=n.addBorderNode(c,"_bt"),S=n.addBorderNode(c,"_bb"),b=c.node(x);c.setParent(_,x),b.borderTop=_,c.setParent(S,x),b.borderBottom=S,e.forEach(N,function(k){s(c,p,h,f,g,y,k);var E=c.node(k),C=E.borderTop?E.borderTop:k,T=E.borderBottom?E.borderBottom:k,M=E.borderTop?f:2*f,L=C!==T?1:g-y[x]+1;c.setEdge(_,C,{weight:M,minlen:L,nestingEdge:!0}),c.setEdge(T,S,{weight:M,minlen:L,nestingEdge:!0})}),c.parent(x)||c.setEdge(p,_,{weight:0,minlen:g+y[x]})}function o(c){var p={};function h(f,g){var y=c.children(f);y&&y.length&&e.forEach(y,function(x){h(x,g+1)}),p[f]=g}return e.forEach(c.children(),function(f){h(f,1)}),p}function l(c){return e.reduce(c.edges(),function(p,h){return p+c.edge(h).weight},0)}function u(c){var p=c.graph();c.removeNode(p.nestingRoot),delete p.nestingRoot,e.forEach(c.edges(),function(h){var f=c.edge(h);f.nestingEdge&&c.removeEdge(h)})}return jg}var Tg,Xk;function M4(){if(Xk)return Tg;Xk=1;var e=ut(),n=cn();Tg=r;function r(o){function l(u){var c=o.children(u),p=o.node(u);if(c.length&&e.forEach(c,l),e.has(p,"minRank")){p.borderLeft=[],p.borderRight=[];for(var h=p.minRank,f=p.maxRank+1;h<f;++h)s(o,"borderLeft","_bl",u,p,h),s(o,"borderRight","_br",u,p,h)}}e.forEach(o.children(),l)}function s(o,l,u,c,p,h){var f={width:0,height:0,rank:h,borderType:l},g=p[l][h-1],y=n.addDummyNode(o,"border",f,u);p[l][h]=y,o.setParent(y,c),g&&o.setEdge(g,y,{weight:1})}return Tg}var Ag,Qk;function P4(){if(Qk)return Ag;Qk=1;var e=ut();Ag={adjust:n,undo:r};function n(h){var f=h.graph().rankdir.toLowerCase();(f==="lr"||f==="rl")&&s(h)}function r(h){var f=h.graph().rankdir.toLowerCase();(f==="bt"||f==="rl")&&l(h),(f==="lr"||f==="rl")&&(c(h),s(h))}function s(h){e.forEach(h.nodes(),function(f){o(h.node(f))}),e.forEach(h.edges(),function(f){o(h.edge(f))})}function o(h){var f=h.width;h.width=h.height,h.height=f}function l(h){e.forEach(h.nodes(),function(f){u(h.node(f))}),e.forEach(h.edges(),function(f){var g=h.edge(f);e.forEach(g.points,u),e.has(g,"y")&&u(g)})}function u(h){h.y=-h.y}function c(h){e.forEach(h.nodes(),function(f){p(h.node(f))}),e.forEach(h.edges(),function(f){var g=h.edge(f);e.forEach(g.points,p),e.has(g,"x")&&p(g)})}function p(h){var f=h.x;h.x=h.y,h.y=f}return Ag}var Ig,Zk;function O4(){if(Zk)return Ig;Zk=1;var e=ut();Ig=n;function n(r){var s={},o=e.filter(r.nodes(),function(h){return!r.children(h).length}),l=e.max(e.map(o,function(h){return r.node(h).rank})),u=e.map(e.range(l+1),function(){return[]});function c(h){if(!e.has(s,h)){s[h]=!0;var f=r.node(h);u[f.rank].push(h),e.forEach(r.successors(h),c)}}var p=e.sortBy(o,function(h){return r.node(h).rank});return e.forEach(p,c),u}return Ig}var Mg,Jk;function L4(){if(Jk)return Mg;Jk=1;var e=ut();Mg=n;function n(s,o){for(var l=0,u=1;u<o.length;++u)l+=r(s,o[u-1],o[u]);return l}function r(s,o,l){for(var u=e.zipObject(l,e.map(l,function(y,x){return x})),c=e.flatten(e.map(o,function(y){return e.sortBy(e.map(s.outEdges(y),function(x){return{pos:u[x.w],weight:s.edge(x).weight}}),"pos")}),!0),p=1;p<l.length;)p<<=1;var h=2*p-1;p-=1;var f=e.map(new Array(h),function(){return 0}),g=0;return e.forEach(c.forEach(function(y){var x=y.pos+p;f[x]+=y.weight;for(var N=0;x>0;)x%2&&(N+=f[x+1]),x=x-1>>1,f[x]+=y.weight;g+=y.weight*N})),g}return Mg}var Pg,eE;function q4(){if(eE)return Pg;eE=1;var e=ut();Pg=n;function n(r,s){return e.map(s,function(o){var l=r.inEdges(o);if(l.length){var u=e.reduce(l,function(c,p){var h=r.edge(p),f=r.node(p.v);return{sum:c.sum+h.weight*f.order,weight:c.weight+h.weight}},{sum:0,weight:0});return{v:o,barycenter:u.sum/u.weight,weight:u.weight}}else return{v:o}})}return Pg}var Og,tE;function $4(){if(tE)return Og;tE=1;var e=ut();Og=n;function n(o,l){var u={};e.forEach(o,function(p,h){var f=u[p.v]={indegree:0,in:[],out:[],vs:[p.v],i:h};e.isUndefined(p.barycenter)||(f.barycenter=p.barycenter,f.weight=p.weight)}),e.forEach(l.edges(),function(p){var h=u[p.v],f=u[p.w];!e.isUndefined(h)&&!e.isUndefined(f)&&(f.indegree++,h.out.push(u[p.w]))});var c=e.filter(u,function(p){return!p.indegree});return r(c)}function r(o){var l=[];function u(h){return function(f){f.merged||(e.isUndefined(f.barycenter)||e.isUndefined(h.barycenter)||f.barycenter>=h.barycenter)&&s(h,f)}}function c(h){return function(f){f.in.push(h),--f.indegree===0&&o.push(f)}}for(;o.length;){var p=o.pop();l.push(p),e.forEach(p.in.reverse(),u(p)),e.forEach(p.out,c(p))}return e.map(e.filter(l,function(h){return!h.merged}),function(h){return e.pick(h,["vs","i","barycenter","weight"])})}function s(o,l){var u=0,c=0;o.weight&&(u+=o.barycenter*o.weight,c+=o.weight),l.weight&&(u+=l.barycenter*l.weight,c+=l.weight),o.vs=l.vs.concat(o.vs),o.barycenter=u/c,o.weight=c,o.i=Math.min(l.i,o.i),l.merged=!0}return Og}var Lg,nE;function D4(){if(nE)return Lg;nE=1;var e=ut(),n=cn();Lg=r;function r(l,u){var c=n.partition(l,function(_){return e.has(_,"barycenter")}),p=c.lhs,h=e.sortBy(c.rhs,function(_){return-_.i}),f=[],g=0,y=0,x=0;p.sort(o(!!u)),x=s(f,h,x),e.forEach(p,function(_){x+=_.vs.length,f.push(_.vs),g+=_.barycenter*_.weight,y+=_.weight,x=s(f,h,x)});var N={vs:e.flatten(f,!0)};return y&&(N.barycenter=g/y,N.weight=y),N}function s(l,u,c){for(var p;u.length&&(p=e.last(u)).i<=c;)u.pop(),l.push(p.vs),c++;return c}function o(l){return function(u,c){return u.barycenter<c.barycenter?-1:u.barycenter>c.barycenter?1:l?c.i-u.i:u.i-c.i}}return Lg}var qg,rE;function F4(){if(rE)return qg;rE=1;var e=ut(),n=q4(),r=$4(),s=D4();qg=o;function o(c,p,h,f){var g=c.children(p),y=c.node(p),x=y?y.borderLeft:void 0,N=y?y.borderRight:void 0,_={};x&&(g=e.filter(g,function(T){return T!==x&&T!==N}));var S=n(c,g);e.forEach(S,function(T){if(c.children(T.v).length){var M=o(c,T.v,h,f);_[T.v]=M,e.has(M,"barycenter")&&u(T,M)}});var b=r(S,h);l(b,_);var k=s(b,f);if(x&&(k.vs=e.flatten([x,k.vs,N],!0),c.predecessors(x).length)){var E=c.node(c.predecessors(x)[0]),C=c.node(c.predecessors(N)[0]);e.has(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+E.order+C.order)/(k.weight+2),k.weight+=2}return k}function l(c,p){e.forEach(c,function(h){h.vs=e.flatten(h.vs.map(function(f){return p[f]?p[f].vs:f}),!0)})}function u(c,p){e.isUndefined(c.barycenter)?(c.barycenter=p.barycenter,c.weight=p.weight):(c.barycenter=(c.barycenter*c.weight+p.barycenter*p.weight)/(c.weight+p.weight),c.weight+=p.weight)}return qg}var $g,iE;function z4(){if(iE)return $g;iE=1;var e=ut(),n=rr().Graph;$g=r;function r(o,l,u){var c=s(o),p=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(h){return o.node(h)});return e.forEach(o.nodes(),function(h){var f=o.node(h),g=o.parent(h);(f.rank===l||f.minRank<=l&&l<=f.maxRank)&&(p.setNode(h),p.setParent(h,g||c),e.forEach(o[u](h),function(y){var x=y.v===h?y.w:y.v,N=p.edge(x,h),_=e.isUndefined(N)?0:N.weight;p.setEdge(x,h,{weight:o.edge(y).weight+_})}),e.has(f,"minRank")&&p.setNode(h,{borderLeft:f.borderLeft[l],borderRight:f.borderRight[l]}))}),p}function s(o){for(var l;o.hasNode(l=e.uniqueId("_root")););return l}return $g}var Dg,sE;function B4(){if(sE)return Dg;sE=1;var e=ut();Dg=n;function n(r,s,o){var l={},u;e.forEach(o,function(c){for(var p=r.parent(c),h,f;p;){if(h=r.parent(p),h?(f=l[h],l[h]=p):(f=u,u=p),f&&f!==p){s.setEdge(f,p);return}p=h}})}return Dg}var Fg,oE;function U4(){if(oE)return Fg;oE=1;var e=ut(),n=O4(),r=L4(),s=F4(),o=z4(),l=B4(),u=rr().Graph,c=cn();Fg=p;function p(y){var x=c.maxRank(y),N=h(y,e.range(1,x+1),"inEdges"),_=h(y,e.range(x-1,-1,-1),"outEdges"),S=n(y);g(y,S);for(var b=Number.POSITIVE_INFINITY,k,E=0,C=0;C<4;++E,++C){f(E%2?N:_,E%4>=2),S=c.buildLayerMatrix(y);var T=r(y,S);T<b&&(C=0,k=e.cloneDeep(S),b=T)}g(y,k)}function h(y,x,N){return e.map(x,function(_){return o(y,_,N)})}function f(y,x){var N=new u;e.forEach(y,function(_){var S=_.graph().root,b=s(_,S,N,x);e.forEach(b.vs,function(k,E){_.node(k).order=E}),l(_,N,b.vs)})}function g(y,x){e.forEach(x,function(N){e.forEach(N,function(_,S){y.node(_).order=S})})}return Fg}var zg,aE;function H4(){if(aE)return zg;aE=1;var e=ut(),n=rr().Graph,r=cn();zg={positionX:N,findType1Conflicts:s,findType2Conflicts:o,addConflict:u,hasConflict:c,verticalAlignment:p,horizontalCompaction:h,alignCoordinates:y,findSmallestWidthAlignment:g,balance:x};function s(b,k){var E={};function C(T,M){var L=0,H=0,O=T.length,P=e.last(M);return e.forEach(M,function(F,G){var q=l(b,F),j=q?b.node(q).order:O;(q||F===P)&&(e.forEach(M.slice(H,G+1),function(Q){e.forEach(b.predecessors(Q),function(z){var ne=b.node(z),Z=ne.order;(Z<L||j<Z)&&!(ne.dummy&&b.node(Q).dummy)&&u(E,z,Q)})}),H=G+1,L=j)}),M}return e.reduce(k,C),E}function o(b,k){var E={};function C(M,L,H,O,P){var F;e.forEach(e.range(L,H),function(G){F=M[G],b.node(F).dummy&&e.forEach(b.predecessors(F),function(q){var j=b.node(q);j.dummy&&(j.order<O||j.order>P)&&u(E,q,F)})})}function T(M,L){var H=-1,O,P=0;return e.forEach(L,function(F,G){if(b.node(F).dummy==="border"){var q=b.predecessors(F);q.length&&(O=b.node(q[0]).order,C(L,P,G,H,O),P=G,H=O)}C(L,P,L.length,O,M.length)}),L}return e.reduce(k,T),E}function l(b,k){if(b.node(k).dummy)return e.find(b.predecessors(k),function(E){return b.node(E).dummy})}function u(b,k,E){if(k>E){var C=k;k=E,E=C}var T=b[k];T||(b[k]=T={}),T[E]=!0}function c(b,k,E){if(k>E){var C=k;k=E,E=C}return e.has(b[k],E)}function p(b,k,E,C){var T={},M={},L={};return e.forEach(k,function(H){e.forEach(H,function(O,P){T[O]=O,M[O]=O,L[O]=P})}),e.forEach(k,function(H){var O=-1;e.forEach(H,function(P){var F=C(P);if(F.length){F=e.sortBy(F,function(z){return L[z]});for(var G=(F.length-1)/2,q=Math.floor(G),j=Math.ceil(G);q<=j;++q){var Q=F[q];M[P]===P&&O<L[Q]&&!c(E,P,Q)&&(M[Q]=P,M[P]=T[P]=T[Q],O=L[Q])}}})}),{root:T,align:M}}function h(b,k,E,C,T){var M={},L=f(b,k,E,T),H=T?"borderLeft":"borderRight";function O(G,q){for(var j=L.nodes(),Q=j.pop(),z={};Q;)z[Q]?G(Q):(z[Q]=!0,j.push(Q),j=j.concat(q(Q))),Q=j.pop()}function P(G){M[G]=L.inEdges(G).reduce(function(q,j){return Math.max(q,M[j.v]+L.edge(j))},0)}function F(G){var q=L.outEdges(G).reduce(function(Q,z){return Math.min(Q,M[z.w]-L.edge(z))},Number.POSITIVE_INFINITY),j=b.node(G);q!==Number.POSITIVE_INFINITY&&j.borderType!==H&&(M[G]=Math.max(M[G],q))}return O(P,L.predecessors.bind(L)),O(F,L.successors.bind(L)),e.forEach(C,function(G){M[G]=M[E[G]]}),M}function f(b,k,E,C){var T=new n,M=b.graph(),L=_(M.nodesep,M.edgesep,C);return e.forEach(k,function(H){var O;e.forEach(H,function(P){var F=E[P];if(T.setNode(F),O){var G=E[O],q=T.edge(G,F);T.setEdge(G,F,Math.max(L(b,P,O),q||0))}O=P})}),T}function g(b,k){return e.minBy(e.values(k),function(E){var C=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return e.forIn(E,function(M,L){var H=S(b,L)/2;C=Math.max(M+H,C),T=Math.min(M-H,T)}),C-T})}function y(b,k){var E=e.values(k),C=e.min(E),T=e.max(E);e.forEach(["u","d"],function(M){e.forEach(["l","r"],function(L){var H=M+L,O=b[H],P;if(O!==k){var F=e.values(O);P=L==="l"?C-e.min(F):T-e.max(F),P&&(b[H]=e.mapValues(O,function(G){return G+P}))}})})}function x(b,k){return e.mapValues(b.ul,function(E,C){if(k)return b[k.toLowerCase()][C];var T=e.sortBy(e.map(b,C));return(T[1]+T[2])/2})}function N(b){var k=r.buildLayerMatrix(b),E=e.merge(s(b,k),o(b,k)),C={},T;e.forEach(["u","d"],function(L){T=L==="u"?k:e.values(k).reverse(),e.forEach(["l","r"],function(H){H==="r"&&(T=e.map(T,function(G){return e.values(G).reverse()}));var O=(L==="u"?b.predecessors:b.successors).bind(b),P=p(b,T,E,O),F=h(b,T,P.root,P.align,H==="r");H==="r"&&(F=e.mapValues(F,function(G){return-G})),C[L+H]=F})});var M=g(b,C);return y(C,M),x(C,b.graph().align)}function _(b,k,E){return function(C,T,M){var L=C.node(T),H=C.node(M),O=0,P;if(O+=L.width/2,e.has(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":P=-L.width/2;break;case"r":P=L.width/2;break}if(P&&(O+=E?P:-P),P=0,O+=(L.dummy?k:b)/2,O+=(H.dummy?k:b)/2,O+=H.width/2,e.has(H,"labelpos"))switch(H.labelpos.toLowerCase()){case"l":P=H.width/2;break;case"r":P=-H.width/2;break}return P&&(O+=E?P:-P),P=0,O}}function S(b,k){return b.node(k).width}return zg}var Bg,lE;function W4(){if(lE)return Bg;lE=1;var e=ut(),n=cn(),r=H4().positionX;Bg=s;function s(l){l=n.asNonCompoundGraph(l),o(l),e.forEach(r(l),function(u,c){l.node(c).x=u})}function o(l){var u=n.buildLayerMatrix(l),c=l.graph().ranksep,p=0;e.forEach(u,function(h){var f=e.max(e.map(h,function(g){return l.node(g).height}));e.forEach(h,function(g){l.node(g).y=p+f/2}),p+=f+c})}return Bg}var Ug,uE;function V4(){if(uE)return Ug;uE=1;var e=ut(),n=C4(),r=R4(),s=T4(),o=cn().normalizeRanks,l=A4(),u=cn().removeEmptyRanks,c=I4(),p=M4(),h=P4(),f=U4(),g=W4(),y=cn(),x=rr().Graph;Ug=N;function N(U,J){var re=J&&J.debugTiming?y.time:y.notime;re("layout",function(){var le=re(" buildLayoutGraph",function(){return O(U)});re(" runLayout",function(){_(le,re)}),re(" updateInputGraph",function(){S(U,le)})})}function _(U,J){J(" makeSpaceForEdgeLabels",function(){P(U)}),J(" removeSelfEdges",function(){$(U)}),J(" acyclic",function(){n.run(U)}),J(" nestingGraph.run",function(){c.run(U)}),J(" rank",function(){s(y.asNonCompoundGraph(U))}),J(" injectEdgeLabelProxies",function(){F(U)}),J(" removeEmptyRanks",function(){u(U)}),J(" nestingGraph.cleanup",function(){c.cleanup(U)}),J(" normalizeRanks",function(){o(U)}),J(" assignRankMinMax",function(){G(U)}),J(" removeEdgeLabelProxies",function(){q(U)}),J(" normalize.run",function(){r.run(U)}),J(" parentDummyChains",function(){l(U)}),J(" addBorderSegments",function(){p(U)}),J(" order",function(){f(U)}),J(" insertSelfEdges",function(){K(U)}),J(" adjustCoordinateSystem",function(){h.adjust(U)}),J(" position",function(){g(U)}),J(" positionSelfEdges",function(){I(U)}),J(" removeBorderNodes",function(){Z(U)}),J(" normalize.undo",function(){r.undo(U)}),J(" fixupEdgeLabelCoords",function(){z(U)}),J(" undoCoordinateSystem",function(){h.undo(U)}),J(" translateGraph",function(){j(U)}),J(" assignNodeIntersects",function(){Q(U)}),J(" reversePoints",function(){ne(U)}),J(" acyclic.undo",function(){n.undo(U)})}function S(U,J){e.forEach(U.nodes(),function(re){var le=U.node(re),de=J.node(re);le&&(le.x=de.x,le.y=de.y,J.children(re).length&&(le.width=de.width,le.height=de.height))}),e.forEach(U.edges(),function(re){var le=U.edge(re),de=J.edge(re);le.points=de.points,e.has(de,"x")&&(le.x=de.x,le.y=de.y)}),U.graph().width=J.graph().width,U.graph().height=J.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],C=["width","height"],T={width:0,height:0},M=["minlen","weight","width","height","labeloffset"],L={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},H=["labelpos"];function O(U){var J=new x({multigraph:!0,compound:!0}),re=X(U.graph());return J.setGraph(e.merge({},k,W(re,b),e.pick(re,E))),e.forEach(U.nodes(),function(le){var de=X(U.node(le));J.setNode(le,e.defaults(W(de,C),T)),J.setParent(le,U.parent(le))}),e.forEach(U.edges(),function(le){var de=X(U.edge(le));J.setEdge(le,e.merge({},L,W(de,M),e.pick(de,H)))}),J}function P(U){var J=U.graph();J.ranksep/=2,e.forEach(U.edges(),function(re){var le=U.edge(re);le.minlen*=2,le.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?le.width+=le.labeloffset:le.height+=le.labeloffset)})}function F(U){e.forEach(U.edges(),function(J){var re=U.edge(J);if(re.width&&re.height){var le=U.node(J.v),de=U.node(J.w),te={rank:(de.rank-le.rank)/2+le.rank,e:J};y.addDummyNode(U,"edge-proxy",te,"_ep")}})}function G(U){var J=0;e.forEach(U.nodes(),function(re){var le=U.node(re);le.borderTop&&(le.minRank=U.node(le.borderTop).rank,le.maxRank=U.node(le.borderBottom).rank,J=e.max(J,le.maxRank))}),U.graph().maxRank=J}function q(U){e.forEach(U.nodes(),function(J){var re=U.node(J);re.dummy==="edge-proxy"&&(U.edge(re.e).labelRank=re.rank,U.removeNode(J))})}function j(U){var J=Number.POSITIVE_INFINITY,re=0,le=Number.POSITIVE_INFINITY,de=0,te=U.graph(),ce=te.marginx||0,Ce=te.marginy||0;function ve(Te){var ye=Te.x,ke=Te.y,Ge=Te.width,we=Te.height;J=Math.min(J,ye-Ge/2),re=Math.max(re,ye+Ge/2),le=Math.min(le,ke-we/2),de=Math.max(de,ke+we/2)}e.forEach(U.nodes(),function(Te){ve(U.node(Te))}),e.forEach(U.edges(),function(Te){var ye=U.edge(Te);e.has(ye,"x")&&ve(ye)}),J-=ce,le-=Ce,e.forEach(U.nodes(),function(Te){var ye=U.node(Te);ye.x-=J,ye.y-=le}),e.forEach(U.edges(),function(Te){var ye=U.edge(Te);e.forEach(ye.points,function(ke){ke.x-=J,ke.y-=le}),e.has(ye,"x")&&(ye.x-=J),e.has(ye,"y")&&(ye.y-=le)}),te.width=re-J+ce,te.height=de-le+Ce}function Q(U){e.forEach(U.edges(),function(J){var re=U.edge(J),le=U.node(J.v),de=U.node(J.w),te,ce;re.points?(te=re.points[0],ce=re.points[re.points.length-1]):(re.points=[],te=de,ce=le),re.points.unshift(y.intersectRect(le,te)),re.points.push(y.intersectRect(de,ce))})}function z(U){e.forEach(U.edges(),function(J){var re=U.edge(J);if(e.has(re,"x"))switch((re.labelpos==="l"||re.labelpos==="r")&&(re.width-=re.labeloffset),re.labelpos){case"l":re.x-=re.width/2+re.labeloffset;break;case"r":re.x+=re.width/2+re.labeloffset;break}})}function ne(U){e.forEach(U.edges(),function(J){var re=U.edge(J);re.reversed&&re.points.reverse()})}function Z(U){e.forEach(U.nodes(),function(J){if(U.children(J).length){var re=U.node(J),le=U.node(re.borderTop),de=U.node(re.borderBottom),te=U.node(e.last(re.borderLeft)),ce=U.node(e.last(re.borderRight));re.width=Math.abs(ce.x-te.x),re.height=Math.abs(de.y-le.y),re.x=te.x+re.width/2,re.y=le.y+re.height/2}}),e.forEach(U.nodes(),function(J){U.node(J).dummy==="border"&&U.removeNode(J)})}function $(U){e.forEach(U.edges(),function(J){if(J.v===J.w){var re=U.node(J.v);re.selfEdges||(re.selfEdges=[]),re.selfEdges.push({e:J,label:U.edge(J)}),U.removeEdge(J)}})}function K(U){var J=y.buildLayerMatrix(U);e.forEach(J,function(re){var le=0;e.forEach(re,function(de,te){var ce=U.node(de);ce.order=te+le,e.forEach(ce.selfEdges,function(Ce){y.addDummyNode(U,"selfedge",{width:Ce.label.width,height:Ce.label.height,rank:ce.rank,order:te+ ++le,e:Ce.e,label:Ce.label},"_se")}),delete ce.selfEdges})})}function I(U){e.forEach(U.nodes(),function(J){var re=U.node(J);if(re.dummy==="selfedge"){var le=U.node(re.e.v),de=le.x+le.width/2,te=le.y,ce=re.x-de,Ce=le.height/2;U.setEdge(re.e,re.label),U.removeNode(J),re.label.points=[{x:de+2*ce/3,y:te-Ce},{x:de+5*ce/6,y:te-Ce},{x:de+ce,y:te},{x:de+5*ce/6,y:te+Ce},{x:de+2*ce/3,y:te+Ce}],re.label.x=re.x,re.label.y=re.y}})}function W(U,J){return e.mapValues(e.pick(U,J),Number)}function X(U){var J={};return e.forEach(U,function(re,le){J[le.toLowerCase()]=re}),J}return Ug}var Hg,cE;function G4(){if(cE)return Hg;cE=1;var e=ut(),n=cn(),r=rr().Graph;Hg={debugOrdering:s};function s(o){var l=n.buildLayerMatrix(o),u=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(o.nodes(),function(c){u.setNode(c,{label:c}),u.setParent(c,"layer"+o.node(c).rank)}),e.forEach(o.edges(),function(c){u.setEdge(c.v,c.w,{},c.name)}),e.forEach(l,function(c,p){var h="layer"+p;u.setNode(h,{rank:"same"}),e.reduce(c,function(f,g){return u.setEdge(f,g,{style:"invis"}),g})}),u}return Hg}var Wg,dE;function Y4(){return dE||(dE=1,Wg="0.8.5"),Wg}var Vg,fE;function K4(){return fE||(fE=1,Vg={graphlib:rr(),layout:V4(),debug:G4(),util:{time:cn().time,notime:cn().notime},version:Y4()}),Vg}var X4=K4();const hE=_v(X4),lo=240,pu=130,no=74,Du=72,pE=no+Du;function Q4(e,n){var s;let r=lo;for(const o of e)r=Math.max(r,((s=n.get(o.id))==null?void 0:s.width)??lo);return r}const dR=420,Z4=2;function ma(e){var r;return((r=e.data)==null?void 0:r.sessionId)??"_default"}function J4(e,n){return((n==null?void 0:n.get(e))??0)>0?dR:0}function eD(e,n){const r=(n==null?void 0:n.get(e))??0;return r>0?6+r*36:0}function ga(e,n,r){const s=n.get(e);return{w:((s==null?void 0:s.width)??lo)+J4(e,r),h:Math.max((s==null?void 0:s.height)??pu,eD(e,r))}}function tD(e){return[...e.keys()].sort().map(n=>`${n}:${e.get(n)}`).join("|")}function nD(e,n,r,s,o,l){const u=new hE.graphlib.Graph;u.setDefaultEdgeLabel(()=>({})),u.setGraph({rankdir:r,marginx:0,marginy:0,nodesep:70,ranksep:160,edgesep:30});const c=e.filter(b=>!o.has(b)),p=new Set(c);for(const b of c){const{w:k,h:E}=ga(b,s,l);u.setNode(b,{width:k,height:E})}for(const b of n)p.has(b.source)&&p.has(b.target)&&u.setEdge(b.source,b.target);hE.layout(u);const h=new Map;let f=1/0,g=1/0,y=-1/0,x=-1/0;for(const b of c){const k=u.node(b);if(!k)continue;const E=s.get(b),C=(E==null?void 0:E.width)??lo,T=(E==null?void 0:E.height)??pu,M=ga(b,s,l),L=k.x-M.w/2,H=k.y-M.h/2;h.set(b,{x:L,y:H}),L<f&&(f=L),H<g&&(g=H),L+C>y&&(y=L+C),H+T>x&&(x=H+T)}if(Number.isFinite(f)&&Number.isFinite(g))for(const[b,k]of h)h.set(b,{x:k.x-f,y:k.y-g});const N=Number.isFinite(y)?y-f:0,_=Number.isFinite(x)?x-g:0;let S=null;for(const b of e){const k=o.get(b);if(!k)continue;const E=s.get(b),C=(E==null?void 0:E.width)??lo,T=(E==null?void 0:E.height)??pu;S=S===null?{minX:k.x,minY:k.y,maxX:k.x+C,maxY:k.y+T}:{minX:Math.min(S.minX,k.x),minY:Math.min(S.minY,k.y),maxX:Math.max(S.maxX,k.x+C),maxY:Math.max(S.maxY,k.y+T)}}return{positions:h,width:N,height:_,pinnedBox:S}}function rD(e,n,r={}){const s=r.direction??"LR",o=r.pinned??new Map,l=r.measured??new Map,u=r.lanes,c=new Map;for(const b of e){const k=ma(b),E=c.get(k);E?E.push(b.id):c.set(k,[b.id])}const h=Array.from(c.keys()).sort().map(b=>({sid:b,...nD(c.get(b),n,s,l,o,u)})),f=Q4(e,l),g=r.availableHeight&&r.availableHeight>0?r.availableHeight:Number.POSITIVE_INFINITY,y=b=>{const k=[[]];let E=0;for(const C of h)k.length<b&&E>0&&E+C.height>g&&(k.push([]),E=0),k[k.length-1].push(C),E+=C.height+pE;return k},x=b=>b.reduce((k,E)=>Math.max(k,E.width),0)+dR;let N=y(r.availableWidth?Z4:1);N.length>1&&N.reduce((k,E)=>k+x(E),0)+f*(N.length-1)>(r.availableWidth??0)&&(N=y(1));const _=new Map;let S=0;for(const b of N){const k=x(b);let E=0;for(const{positions:C,height:T,pinnedBox:M}of b){for(const[H,O]of C)_.set(H,{x:O.x+S,y:O.y+E});let L=E+T;M&&M.maxY>L&&M.minX<S+k&&S<M.maxX&&(L=M.maxY),E=L+pE}S+=k+f}return e.map(b=>{const k=o.get(b.id);if(k)return{...b,position:k};const E=_.get(b.id);return E?{...b,position:E}:b})}function iD(e,n,r,s,o){const u=no+Du,c=60,p=x=>ga(x,s,o),h=new Map(e.map(x=>[x.id,ma(x)])),f=[],g=e.map(x=>({id:x.id,pos:r.get(x.id)??n.get(x.id)})).filter(x=>x.pos!=null).sort((x,N)=>x.pos.y-N.pos.y||x.pos.x-N.pos.x||x.id.localeCompare(N.id)),y=[];for(const{id:x,pos:N}of g){const{w:_,h:S}=p(x),b=h.get(x)??"_default";if(r.has(x)){f.push({x:N.x,y:N.y,w:_,h:S,sid:b});continue}let k=N.y;for(let E=0;E<f.length+1;E++){const C=f.find(T=>{const M=T.sid===b?24:c,L=T.sid===b?24:u;return N.x<T.x+T.w+M&&T.x<N.x+_+M&&k<T.y+T.h+L&&T.y<k+S+L});if(!C)break;k=C.y+C.h+(C.sid===b?24:u)}k!==N.y&&(n.set(x,{x:N.x,y:k}),y.push(x)),f.push({x:N.x,y:k,w:_,h:S,sid:b})}return y}function sD(e,n,r,s,o,l){const u=_=>ga(_,s,l),c=_=>r.get(_)??n.get(_),p=new Map;for(const _ of e){if(!c(_.id))continue;const S=ma(_),b=p.get(S);b?b.push(_):p.set(S,[_])}const h=new Set;for(const[_,S]of p)S.every(b=>o.has(b.id)&&!r.has(b.id))&&h.add(_);const f=new Map,g=[];for(const _ of e){const S=c(_.id);if(!S)continue;const{w:b,h:k}=u(_.id),E=ma(_);h.has(E)?(f.get(E)??f.set(E,[]).get(E)).push(_):g.push({x:S.x,y:S.y,w:b,h:k})}if(f.size===0)return[];const y=no+Du,x=(_,S,b,k)=>g.some(E=>_<E.x+E.w+no&&E.x<_+b+no&&S<E.y+E.h+y&&E.y<S+k+y),N=[];for(const _ of[...f.keys()].sort()){const S=f.get(_);let b=1/0,k=1/0,E=-1/0,C=-1/0;for(const F of S){const G=c(F.id),{w:q,h:j}=u(F.id);b=Math.min(b,G.x),k=Math.min(k,G.y),E=Math.max(E,G.x+q),C=Math.max(C,G.y+j)}const T=E-b,M=C-k,L=[...new Set(g.map(F=>Math.round(F.x)))].sort((F,G)=>F-G),H=L.length?L:[b],O=[0,...g.map(F=>F.y+F.h+y)].sort((F,G)=>F-G);let P=null;e:for(const F of H)for(const G of O){if(G>=k)break;if(!x(F,G,T,M)){P={x:F,y:G};break e}}if(P){const F=P.x-b,G=P.y-k;for(const q of S){const j=c(q.id);n.set(q.id,{x:j.x+F,y:j.y+G})}N.push(_)}for(const F of S){const G=c(F.id),{w:q,h:j}=u(F.id);g.push({x:G.x,y:G.y,w:q,h:j})}}return N}function oD(e,n,r,s,o,l=!1,u){const h=no+Du+1,f=8,g=1.75,y=200,x=.7,N=.01,_=P=>ga(P,s,u),S=P=>r.get(P)??n.get(P),b=new Map;for(const P of e){if(!S(P.id))continue;const F=ma(P),G=b.get(F);G?G.push(P):b.set(F,[P])}const k=[],E=new Set,C=new Set,T=o.size===0;for(const P of[...b.keys()].sort()){const F=b.get(P);let G=1/0,q=1/0,j=-1/0,Q=-1/0,z=!1;for(const K of F){const I=S(K.id),{w:W,h:X}=_(K.id);G=Math.min(G,I.x),q=Math.min(q,I.y),j=Math.max(j,I.x+W),Q=Math.max(Q,I.y+X),r.has(K.id)&&(z=!0)}const ne=j-G,Z=Q-q;C.add(P);const $=o.get(P);$&&(ne>$.w+f||Z>$.h+f)&&E.add(P),o.set(P,{w:ne,h:Z}),k.push({sid:P,members:F.map(K=>K.id),x:G,y:q,w:ne,h:Z,anchored:z,mass:1})}for(const P of[...o.keys()])C.has(P)||o.delete(P);if(l||T)return[];let M=!1;for(let P=0;P<k.length&&!M;P++)for(let F=P+1;F<k.length;F++){const G=k[P],q=k[F];if(!(G.anchored&&q.anchored)&&Math.abs(G.x+G.w/2-(q.x+q.w/2))<(G.w+q.w)/2+61&&Math.abs(G.y+G.h/2-(q.y+q.h/2))<(G.h+q.h)/2+h){M=!0;break}}if(E.size===0&&!M)return[];if(E.size>0)for(const P of k)E.has(P.sid)&&(P.mass=8);else for(const P of k)P.mass=Math.max(1,P.w*P.h/(lo*pu));const L=new Map(k.map(P=>[P.sid,P.x])),H=new Map(k.map(P=>[P.sid,P.y]));for(let P=0;P<y;P++){const F=new Map,G=new Map;let q=0;for(let j=0;j<k.length;j++)for(let Q=j+1;Q<k.length;Q++){const z=k[j],ne=k[Q];if(z.anchored&&ne.anchored)continue;const Z=z.x+z.w/2,$=z.y+z.h/2,K=ne.x+ne.w/2,I=ne.y+ne.h/2,W=(z.w+ne.w)/2+61-Math.abs(Z-K),X=(z.h+ne.h)/2+h-Math.abs($-I);if(W<=0||X<=0)continue;const U=(Fe,Qe)=>!Fe.anchored&&!(Qe<0&&Fe.x<=0),J=(Fe,Qe)=>!Fe.anchored&&!(Qe<0&&Fe.y<=0),re=(Fe,Qe,ft)=>{const St=Fe===Qe,nt=St?z.sid<ne.sid?-1:1:Math.sign(Fe-Qe);return ft(z,nt)||ft(ne,-nt)?nt:St&&(ft(z,-nt)||ft(ne,nt))?-nt:0},le=re(Z,K,U),de=re($,I,J),te=le!==0,ce=de!==0;if(!te&&!ce)continue;const Ce=te&&(!ce||W*g<X),[ve,Te,ye,ke]=Ce?[le,W,F,U]:[de,X,G,J],Ge=ke(z,ve),we=ke(ne,-ve),_e=z.mass,Be=ne.mass,Ye=Ge?we?Be/(_e+Be):1:0,ot=we?Ge?_e/(_e+Be):1:0,tt=Te*x;ye.set(z.sid,(ye.get(z.sid)??0)+ve*tt*Ye),ye.set(ne.sid,(ye.get(ne.sid)??0)-ve*tt*ot),q+=tt}for(const j of k)j.anchored||(j.x=Math.max(0,j.x+(F.get(j.sid)??0)),j.y=Math.max(0,j.y+(G.get(j.sid)??0)));if(q<N)break}const O=[];for(const P of k){const F=P.x-L.get(P.sid),G=P.y-H.get(P.sid);if(!(Math.abs(F)<1&&Math.abs(G)<1)){for(const q of P.members){if(r.has(q))continue;const j=n.get(q);j&&n.set(q,{x:j.x+F,y:j.y+G})}O.push(P.sid)}}return O}const aD=600;function vv(e,n){return!(e.exitAt!=null&&n-e.exitAt>aD||e.kind==="root"&&e.state==="done"&&e.tools.length===0&&e.endedAt!=null&&e.endedAt-e.startedAt<3e3)}function lD(e,n){const r=new Set;for(const s of e.agents.values())vv(s,n)&&r.add(s.id);return r}function uD(e,n,r=0){return e.right+r>n.left&&e.left-r<n.right&&e.bottom+r>n.top&&e.top-r<n.bottom}function cD(e,n,r=0){if(!e)return!1;for(const s of n)if(uD(e,s,r))return!0;return!1}const fR="sessionGroup";function dD(e,n){var s;if(e.type===fR)return"transparent";const r=(s=e.data)==null?void 0:s.state;return n(r==="err"?"--err":r==="active"?"--inflight":"--ok")}const fD="Update checks are off (AGENTS_DECK_NO_UPDATE_CHECK=1).";function hD(e){if(e.checkDisabled)return fD;if(e.checking)return"Asking npm for the newest release…";const n=e.latest?`npm has v${e.latest}`:e.latestPending?`npm's latest tag names v${e.latestPending}, which it cannot serve yet`:"npm not reached yet",r=e.checkedAgo?` · checked ${e.checkedAgo}`:"";return`${n}${r} · re-checked periodically · click to check npm now`}function pD(e){const n=`Version v${e.running}`;return e.checkDisabled?`${n}, update checks are off`:e.checking?`${n}, checking npm for a newer release`:`${n}, check npm for a newer release`}function mD(e){if(e==null)return{kind:"unknown",lead:"No data yet. Start a Claude Code or Codex session — it appears here as soon as its first hook fires.",workspace:null,tail:""};const n=e.trim();return n===""?{kind:"machine",lead:"No data yet. Start a Claude Code or Codex session anywhere on this machine — this deck is unscoped and captures every workspace.",workspace:null,tail:""}:{kind:"scoped",lead:"No data yet. This deck only captures sessions running under",workspace:n,tail:" — start one there, or restart it without --workspace/--scope to watch the whole machine."}}function hR(e){const n=Math.max(0,Math.floor(e));return`${n} event${n===1?"":"s"}`}function gD(e){return e.connected?e.paused?{tone:"paused",label:"paused",title:e.held>0?`Connected — ${hR(e.held)} held until you resume (Space)`:"Connected — updates held until you resume (Space)"}:{tone:"live",label:"live",title:"Receiving events"}:{tone:"dead",label:"offline",title:e.paused?"SSE disconnected — and the canvas is paused, so resuming will not bring events back until it reconnects":"SSE disconnected"}}function vD(e){return e.paused?e.held<=0?{label:"Resume",title:"Nothing has arrived since you paused. Resume to follow the canvas again (Space)"}:{label:`Resume · ${e.held} held`,title:`${hR(e.held)} arrived while paused and will be applied in order when you resume (Space)`}:{label:"Pause",title:"Pause live updates — events keep arriving and are applied when you resume (Space)"}}function pR(e,n){return e!==""&&n>0}function yD(e,n,r){return e===""?{active:!1,matched:n,total:r,count:null,empty:!1,message:null,dim:!1}:{active:!0,matched:n,total:r,count:`${n} of ${r}`,empty:n===0,message:n===0?`No agents match “${e}”`:null,dim:pR(e,n)}}function yv(e){const n=Math.max(0,Math.floor(e/1e3));return n<60?"just now":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function wD(e,n){return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()}function xD(e,n,r){const s=new Date(e),o=yv(n-e);return{label:wD(s,new Date(n))?o:`${o} · ${s.toLocaleDateString(r,{month:"short",day:"numeric"})}`,title:s.toLocaleString(r,{dateStyle:"medium",timeStyle:"medium"})}}function ta(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}const _D={agent:xO,sessionGroup:MO},bD=420,Xl=18,SD=9e4,kD=200,ED=5*6e4,ND=6,CD=2*6e4,ay="agent-dag.layout",ly="agent-dag.viewport",mR="agent-dag.summariesDismissed",gR="agent-dag.sessionListOpen",vR="agent-dag.detailOpen",yR="agent-dag.usagePanelOpen",mE="agent-dag.accountsPanelOpen",gE="agent-dag.versionNoticeDismissed",RD=15*6e4,vE={git_checkout:"this deck runs from a git checkout — pull instead:",npx:"npx runs from a cache that cannot be upgraded in place — run:",not_writable:"the install directory is not writable by this user — run:",opted_out:"installs are off (AGENTS_DECK_NO_INSTALL=1) — run:"},yE="agent-dag.autoRestart",wE="agent-dag.bundleReloadedFor";function jD(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(gR)==="1"}catch{return!1}}function TD(e){if(!(typeof window>"u"))try{window.localStorage.setItem(gR,e?"1":"0")}catch{}}function AD(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(vR)==="1"}catch{return!1}}function ID(e){if(!(typeof window>"u"))try{window.localStorage.setItem(vR,e?"1":"0")}catch{}}function MD(){const e=cC(yR);return e===null?!0:e==="1"}function PD(e){if(!(typeof window>"u"))try{window.localStorage.setItem(yR,e?"1":"0")}catch{}}function OD(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(mR);if(!e)return new Set;const n=JSON.parse(e);return new Set(Array.isArray(n)?n.filter(r=>typeof r=="string"):[])}catch{return new Set}}function xE(e){if(!(typeof window>"u"))try{const n=Array.from(e),r=n.length>200?n.slice(-200):n;window.localStorage.setItem(mR,JSON.stringify(r))}catch{}}function LD(){const e={positions:[],pins:[]};if(typeof window>"u")return e;try{const n=window.localStorage.getItem(ay);if(!n)return e;const r=JSON.parse(n);if(!("v"in r)){const o=Object.entries(r).filter(([,l])=>l&&typeof l.x=="number"&&typeof l.y=="number");return{positions:o,pins:o.map(([l])=>l)}}return{positions:Object.entries(r.positions??{}).filter(([,o])=>o&&typeof o.x=="number"&&typeof o.y=="number"),pins:Array.isArray(r.pins)?r.pins:[]}}catch{return e}}function Gg(e,n){if(!(typeof window>"u"))try{const r={};for(const[s,o]of e)r[s]=o;for(const[s,o]of n)r[s]=o;window.localStorage.setItem(ay,JSON.stringify({v:2,positions:r,pins:Array.from(n.keys())}))}catch{}}function qD(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(ly);if(!e)return null;const n=JSON.parse(e);return typeof(n==null?void 0:n.x)!="number"||typeof(n==null?void 0:n.y)!="number"||typeof(n==null?void 0:n.zoom)!="number"?null:n}catch{return null}}function $D(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ly,JSON.stringify(e))}catch{}}function _E(){if(!(typeof window>"u")){try{window.localStorage.removeItem(ay)}catch{}try{window.localStorage.removeItem(ly)}catch{}}}function DD(e,n){const r=e.agents.get(n);if(!r)return;const s=[];for(const f of e.agents.values())f.sessionId===n&&s.push(f);const o={schemaVersion:1,exportedAt:new Date().toISOString(),sessionId:n,label:r.label,cwd:r.cwd,startedAt:r.startedAt,endedAt:r.endedAt,model:r.model,agents:s.map(f=>({id:f.id,kind:f.kind,label:f.label,parentId:f.parentId,state:f.state,startedAt:f.startedAt,endedAt:f.endedAt,model:f.model,cwd:f.cwd,usage:f.usage,prompts:f.prompts,tools:f.tools.map(g=>({id:g.id,name:g.name,inputPreview:g.inputPreview,startedAt:g.startedAt,endedAt:g.endedAt,ok:g.ok,errorPreview:g.errorPreview,usage:g.usage}))}))},l=JSON.stringify(o,null,2),u=new Blob([l],{type:"application/json"}),c=URL.createObjectURL(u),p=document.createElement("a"),h=(r.label||"session").replace(/[^a-z0-9._-]/gi,"_");p.href=c,p.download=`${mn}-${h}-${n.slice(0,8)}.json`,document.body.appendChild(p),p.click(),document.body.removeChild(p),setTimeout(()=>URL.revokeObjectURL(c),1e3)}const wv={file:"📁",shell:"⚡",web:"🌐",agent:"🤖",task:"📋",plan:"🧭",mcp:"🔌",other:"✨"},xv={file:"file",shell:"shell",web:"web",agent:"agent",task:"task",plan:"plan",mcp:"mcp",other:"other"},FD={Read:"file",Write:"file",Edit:"file",MultiEdit:"file",Glob:"file",Grep:"file",LS:"file",NotebookEdit:"file",Bash:"shell",PowerShell:"shell",shell:"shell",exec_command:"shell",shell_command:"shell",write_stdin:"shell",wait:"shell",apply_patch:"file",update_plan:"task",WebFetch:"web",WebSearch:"web",Task:"agent",Agent:"agent",TodoWrite:"task",TaskCreate:"task",TaskUpdate:"task",TaskList:"task",TaskGet:"task",TaskOutput:"task",TaskStop:"task",EnterPlanMode:"plan",ExitPlanMode:"plan",AskUserQuestion:"plan",Skill:"plan",Workflow:"plan"};function wR(e){return e.startsWith("mcp__")?"mcp":FD[e]??"other"}function xR(e,n){var s,o,l;if(!n)return!0;const r=n.toLowerCase();if(e.label.toLowerCase().includes(r)||(s=e.cwd)!=null&&s.toLowerCase().includes(r)||(o=e.cwdBasename)!=null&&o.toLowerCase().includes(r)||e.sessionId.toLowerCase().includes(r)||(l=e.firstPrompt)!=null&&l.toLowerCase().includes(r))return!0;for(const u of e.tools)if(u.name.toLowerCase().includes(r))return!0;return!1}function zD(e,n){if(!n)return null;const r=new Set([n]);let s=n;for(;s;){const l=e.agents.get(s);if(!(l!=null&&l.parentId)||r.has(l.parentId))break;r.add(l.parentId),s=l.parentId}let o=!0;for(;o;){o=!1;for(const l of e.agents.values())l.parentId&&r.has(l.parentId)&&!r.has(l.id)&&(r.add(l.id),o=!0)}return r}function BD(e,n,r,s,o,l,u,c,p,h,f,g,y,x,N,_,S,b,k){const E=[],C=[],T=new Set;if(l)for(const q of e.agents.values())b.has(q.id)&&xR(q,l)&&T.add(q.id);const M=pR(l,T.size);for(const q of e.agents.values()){if(!b.has(q.id))continue;const j=M&&!T.has(q.id),Q=q.exitAt!=null,z=S!=null&&!S.has(q.id),ne=[j?"rf-dim":"",Q?"rf-exiting":"",z?"rf-spotlit-out":""].filter(Boolean).join(" ")||void 0,Z=u.get(q.id);if(E.push({id:q.id,type:"agent",position:{x:0,y:0},data:{...q,now:n,onOpenContext:k},className:ne,...Z?{width:Z.width,height:Z.height}:null}),q.parentId&&b.has(q.parentId)){const $=Fv(q.sessionId),K=l&&!T.has(q.id)&&!T.has(q.parentId),I=Q,W=_.size>0&&(_.has(q.id)||_.has(q.parentId)),X=S!=null&&!S.has(q.id)&&!S.has(q.parentId),U=q.state==="active"?2:1.5,J=W?U+1.5:U,re=K||I?.2:X?.12:1,le=["sess-edge",q.state==="active"?"sess-live":"sess-idle",I?"rf-edge-exiting":"",W?"rf-edge-selected":""].filter(Boolean).join(" ");C.push({id:`e:${q.parentId}->${q.id}`,source:q.parentId,target:q.id,animated:(q.state==="active"||W)&&!K&&!I,type:"smoothstep",style:{"--session-hue":$,strokeWidth:J,opacity:re,transition:"opacity 500ms ease, stroke-width 200ms ease"},className:le})}}const L=new Map;for(const q of e.agents.values())q.tools.length>0&&L.set(q.id,Math.min(4,q.tools.length));const H=`${x}#lanes:${tD(L)}`,O=E.filter(q=>mL(q.id,o,g,y));if(O.length>0||H!==N.current){if(O.length>0){const q=rD(E,C,{direction:"LR",pinned:o,measured:u,availableWidth:r,availableHeight:s,lanes:L});for(const j of q)uC(j.id,g,y)&&vL(j.id,j.position,g,y);sD(E,g,o,u,new Set(O.map(j=>j.id)),L)}iD(E,g,o,u,L),N.current=H}const P=oD(E,g,o,u,c,!h||f,L);P.length>0&&p(P),Vl(g,e.agents),Vl(y,e.agents),Vl(o,e.agents),Vl(u,pL(e.agents.values()));const F=[];let G=!1;for(const q of E){let j=o.get(q.id)??g.get(q.id);j||(j=gL(q.id,g,y),G=!0),F.push({...q,position:j})}return G&&(N.current=""),{nodes:F,edges:C}}function UD(){return m.jsx($v,{children:m.jsx(HD,{})})}function HD(){var Xr,qa,bs,Ss;const e=_a(),n=A.useRef(cv()),[,r]=A.useState(0),s=A.useCallback(()=>r(B=>B+1),[]),[o,l]=A.useState(()=>new Set),[u,c]=A.useState(null),[p,h]=A.useState(null),f=A.useCallback((B,V)=>{l(ae=>{if(!V)return new Set([B]);const fe=new Set(ae);return fe.has(B)?fe.delete(B):fe.add(B),fe}),c(ae=>V&&ae===B?ae:B)},[]),g=A.useCallback(()=>{l(new Set),c(null)},[]),[y,x]=A.useState(null),[N,_]=A.useState(null),S=A.useCallback(B=>_(B),[]),[b,k]=A.useState(!1),E=A.useRef(OD()),[C,T]=A.useState(jD);A.useEffect(()=>{TD(C)},[C]);const[M,L]=A.useState(AD);A.useEffect(()=>{ID(M)},[M]);const[H,O]=A.useState(MD);A.useEffect(()=>{PD(H)},[H]);const[P,F]=A.useState(()=>{try{const B=window.localStorage.getItem(mE);return B===null?!0:B==="1"}catch{return!0}});A.useEffect(()=>{try{window.localStorage.setItem(mE,P?"1":"0")}catch{}},[P]);const[G,q]=A.useState(null),[j,Q]=A.useState(!1),[z,ne]=A.useState(0),[Z,$]=A.useState(0);A.useEffect(()=>{fetch("/api/sound-hook").then(B=>B.ok?B.json():null).then(B=>{B!=null&&B.ok&&(q(B.enabled===!0),ne((B.foreign??[]).filter(V=>V.worksHere).length),$(typeof B.parked=="number"?B.parked:0))}).catch(()=>{})},[]);const K=A.useCallback(async()=>{Q(!0);try{const V=await(await fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!G})})).json().catch(()=>null);V!=null&&V.ok&&q(V.enabled===!0),fetch("/api/sound-hook").then(ae=>ae.ok?ae.json():null).then(ae=>{ae!=null&&ae.ok&&(ne((ae.foreign??[]).filter(fe=>fe.worksHere).length),$(typeof ae.parked=="number"?ae.parked:0))}).catch(()=>{})}catch{}finally{Q(!1)}},[G]),[I,W]=A.useState(!1),[X,U]=A.useState(null),[J,re]=A.useState(()=>{if(typeof window>"u")return"";try{return window.localStorage.getItem(gE)??""}catch{return""}}),[le,de]=A.useState(!1),te=A.useRef(0),[ce,Ce]=A.useState(!1),ve=A.useCallback((B=!1)=>{B&&(te.current=Date.now(),Ce(!0)),fetch(B?"/api/version?refresh=1":"/api/version").then(V=>V.ok?V.json():null).then(V=>{V&&U(V)}).catch(()=>{}).finally(()=>{B&&Ce(!1)})},[]),Te=A.useCallback(()=>{ve(Date.now()-te.current>=RD)},[ve]);A.useEffect(()=>{ve();const B=window.setInterval(Te,5*6e4),V=()=>{document.visibilityState==="visible"&&Te()};return document.addEventListener("visibilitychange",V),()=>{window.clearInterval(B),document.removeEventListener("visibilitychange",V)}},[ve,Te]),A.useEffect(()=>{I&&ve()},[I,ve]);const ye=(X==null?void 0:X.notice)??null,[ke,Ge]=A.useState(null);A.useEffect(()=>{let B=!1;return fetch("/api/health").then(V=>V.ok?V.json():null).then(V=>{B||!V||typeof V.workspace!="string"||Ge(V.workspace)}).catch(()=>{}),()=>{B=!0}},[I]);const we=ye?`${ye.kind}:${ye.to}`:"",_e=ye!=null&&J!==we,Be=A.useCallback(()=>{if(!ye)return;const B=J===we?"":we;re(B);try{window.localStorage.setItem(gE,B)}catch{}},[ye,we,J]),Ye=((Xr=X==null?void 0:X.upgrade)==null?void 0:Xr.state)??"idle",ot=iL(X==null?void 0:X.upgrade),tt=A.useCallback(async()=>{try{await fetch("/api/upgrade",{method:"POST"})}catch{}ve()},[ve]);A.useEffect(()=>{if(Ye!=="running")return;const B=window.setInterval(ve,3e3);return()=>window.clearInterval(B)},[Ye,ve]);const Fe=A.useCallback(async()=>{var ae;const B=X==null?void 0:X.command;if(!B)return;let V=!1;try{V=await Promise.race([((ae=navigator.clipboard)==null?void 0:ae.writeText(B).then(()=>!0))??Promise.resolve(!1),new Promise(fe=>window.setTimeout(()=>fe(!1),500))])}catch{V=!1}if(!V)try{const fe=document.createElement("textarea");fe.value=B,fe.setAttribute("readonly",""),fe.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(fe),fe.select(),V=document.execCommand("copy"),fe.remove()}catch{V=!1}V&&(de(!0),window.setTimeout(()=>de(!1),1600))},[X==null?void 0:X.command]),Qe=A.useCallback(()=>{T(B=>(B||F(!1),!B))},[]),ft=A.useCallback(()=>{F(B=>(B||T(!1),!B))},[]),[St,nt]=A.useState(!1),[vt,Kt]=A.useState(0),Ot=A.useRef(null),[Je,kt]=A.useState(!1),rt=A.useRef(null),[yt,vn]=A.useState(0),Tt=A.useRef(_L()),[At,$n]=A.useState(!1),Dn=A.useCallback(()=>{const B=Tt.current,V=B.setPaused(!B.paused);for(const ae of V)n.current=Sx(n.current,ae);$n(B.paused)},[]),[Ze,yn]=A.useState(Date.now()),[Xt,wn]=A.useState(()=>{if(typeof window>"u")return!0;try{return window.localStorage.getItem(yE)!=="0"}catch{return!0}}),fs=A.useCallback(()=>{wn(B=>{const V=!B;try{window.localStorage.setItem(yE,V?"1":"0")}catch{}return V})},[]),[xn,_r]=A.useState(!1),[hs,xi]=A.useState("restart"),[_i,or]=A.useState(null),_n=A.useRef(!1),ar=A.useRef(null),ps=A.useRef(0),bn=A.useCallback(async B=>{if(_n.current)return;const V=(B==null?void 0:B.upgrade)===!0;_n.current=!0,ar.current=ot;const ae=++ps.current;xi(V?"npx":"restart"),_r(!0);try{window.sessionStorage.setItem("agent-dag.restartPending",(ye==null?void 0:ye.to)??"")}catch{}try{await fetch("/api/restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({upgrade:V})})}catch{}window.setTimeout(()=>{if(ps.current===ae&&_n.current){_n.current=!1,_r(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},V?18e4:3e4)},[ye==null?void 0:ye.to,ot]),br=A.useRef(null);A.useEffect(()=>{let B=!1;for(const ae of n.current.agents.values())if(ae.state==="active"){B=!0;break}const V=oL({enabled:Xt,kind:ye==null?void 0:ye.kind,canRestart:(X==null?void 0:X.canRestart)===!0,busy:B,idleSince:br.current,now:Ze});br.current=V.idleSince,V.restart&&bn()},[Xt,ye==null?void 0:ye.kind,X==null?void 0:X.canRestart,Ze,bn]),A.useEffect(()=>{const B=X==null?void 0:X.running;let V=null,ae=null;try{V=window.sessionStorage.getItem("agent-dag.restartPending"),ae=window.sessionStorage.getItem(wE)}catch{return}const fe=rL({bundle:"1.33.139",running:B,pending:V,lastTried:ae});if(fe==="reload"){try{window.sessionStorage.setItem(wE,B??"")}catch{return}window.location.reload();return}if(fe!=="confirm")return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}_n.current=!1,_r(!1),or(B??null);const xe=window.setTimeout(()=>or(null),6e3);return()=>window.clearTimeout(xe)},[X==null?void 0:X.running]),A.useEffect(()=>{if(xn&&sL({asked:ar.current,reported:ot})){try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}_n.current=!1,_r(!1)}},[xn,ot]);const lr=A.useRef(LD()).current;A.useRef(!1);const Et=A.useRef(new Map(lr.positions.filter(([B])=>lr.pins.includes(B)))),Br=A.useRef(null),Ur=A.useState(()=>qD())[0],[Qt,dn]=A.useState(""),[bi,ms]=A.useState(()=>new Set),[Sr,Si]=A.useState(NL),[ki,gs]=A.useState(!1),Hr=A.useRef(null);A.useEffect(()=>{document.documentElement.dataset.theme=Sr;try{window.localStorage.setItem(dC,Sr)}catch{}},[Sr]),A.useEffect(()=>{if(!Ur)return;const B=window.setTimeout(()=>{try{e.setViewport(Ur,{duration:0})}catch{}},60);return()=>window.clearTimeout(B)},[e,Ur]);const Ei=A.useRef(!0);A.useEffect(()=>{const B=new EventSource("/events"),V=xL(s,{now:()=>Date.now(),setTimeout:(ae,fe)=>window.setTimeout(ae,fe),clearTimeout:ae=>window.clearTimeout(ae)});return B.addEventListener("open",()=>{W(!0),gs(!0)}),B.addEventListener("error",()=>W(!1)),B.addEventListener("replay-end",()=>{Ei.current=!1,V.flush()}),B.addEventListener("hook",ae=>{try{const fe=JSON.parse(ae.data);if(!Tt.current.accept(fe))return;n.current=Sx(n.current,fe),fe.replay===!0||Ei.current||Date.now()-fe.receivedAt>3e4?V.replay():V.live()}catch{}}),()=>{B.close(),V.cancel()}},[s]),A.useEffect(()=>{const B=setInterval(()=>{const V=Date.now();yn(V);let ae=JP(n.current,V,SD);QP(n.current,V,kD,ED)&&(ae=!0),ZP(n.current,V,ND,CD)&&(ae=!0),ae&&s()},250);return()=>clearInterval(B)},[s]);const Ni=A.useRef(null),We=A.useRef(0),go=420,zt=A.useCallback((B=500)=>{try{const Ne=document.querySelector(".canvas-wrap"),Ie=Array.from(document.querySelectorAll(".react-flow__node")).filter(xt=>xt.offsetWidth>0);if(!Ne||Ie.length===0)return;const De=Ne.getBoundingClientRect(),Ve=e.getViewport();if(!Number.isFinite(Ve.zoom)||Ve.zoom<=0)return;const Xe=xt=>(xt-De.left-Ve.x)/Ve.zoom,at=xt=>(xt-De.top-Ve.y)/Ve.zoom,Nn=Ie.map(xt=>xt.getBoundingClientRect()),Qr=Math.min(...Nn.map(xt=>Xe(xt.left))),So=Math.max(...Nn.map(xt=>Xe(xt.right))),Fi=Math.min(...Nn.map(xt=>at(xt.top))),ko=Math.max(...Nn.map(xt=>at(xt.bottom))),$a=So-Qr,Zr=ko-Fi;if(!($a>0&&Zr>0))return;const Vn=Math.max(.2,Math.min(1,(De.width-160)/($a+go)*.86,(De.height-160)/Zr*.86));e.setViewport({x:80-Qr*Vn,y:Math.max(80,(De.height-Zr*Vn)/2)-Fi*Vn,zoom:Vn},{duration:B}),We.current=Date.now(),window.setTimeout(()=>{try{const xt={x:80-Qr*Vn,y:Math.max(80,(De.height-Zr*Vn)/2)-Fi*Vn,zoom:Vn},Da=e.getViewport();(Math.abs(Da.zoom-Vn)>.01||Math.abs(Da.x-xt.x)>2)&&e.setViewport(xt,{duration:0})}catch{}},B+60)}catch{}},[e]),Wr=A.useRef(""),ur=A.useRef(null),Ci=A.useRef(0),kr=A.useCallback(()=>{Ci.current=Date.now()},[]),cr="agent-dag.autoFitDisabled",wt=A.useRef((()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(cr)==="1"}catch{return!1}})()),[Vr,en]=A.useState(wt.current),Ca=A.useCallback(()=>{if(!wt.current){wt.current=!0,en(!0);try{window.localStorage.setItem(cr,"1")}catch{}}},[]),Fu=A.useCallback(()=>{wt.current=!1,en(!1);try{window.localStorage.removeItem(cr)}catch{}zt(400)},[e,zt]);A.useEffect(()=>{const B=setInterval(()=>{if(wt.current||Date.now()-Ci.current<800)return;const V=n.current,ae=Date.now(),fe=[];for(const Xe of V.agents.values())vv(Xe,ae)&&fe.push({id:Xe.id});if(fe.length===0)return;const xe=e.getViewport(),Ne=window.innerWidth-360,Ie=window.innerHeight-52;let De=!1,Ve=!1;for(const{id:Xe}of fe){const at=Fn.current.get(Xe),Nn=Et.current.get(Xe)??Bt.current.get(Xe);if(!at||!Nn)continue;Ve=!0;const Qr=Nn.x*xe.zoom+xe.x,So=Nn.y*xe.zoom+xe.y,Fi=(Nn.x+at.width)*xe.zoom+xe.x,ko=(Nn.y+at.height)*xe.zoom+xe.y;if(Fi>0&&Qr<Ne&&ko>0&&So<Ie){De=!0;break}}Ve&&!De&&zt(600)},1500);return()=>clearInterval(B)},[e]);const vo=A.useRef(!1),Fn=A.useRef(new Map),Ri=A.useRef(0),ji=A.useCallback(B=>{const V=Fn.current;let ae=!1;for(const fe of B.nodeInternals.values()){const xe=fe.width,Ne=fe.height;if(xe==null||Ne==null)continue;const Ie=V.get(fe.id);Ie?(Math.abs(Ie.height-Ne)>4||Math.abs(Ie.width-xe)>4)&&(V.set(fe.id,{width:xe,height:Ne}),ae=!0):(V.set(fe.id,{width:xe,height:Ne}),ae=!0)}return ae&&(Ri.current+=1),Ri.current},[]),Ti=Ke(ji),[Ra,zu]=A.useState(0);A.useEffect(()=>{let B=0;const V=()=>{const fe=Fn.current;let xe=!1;for(const Ne of document.querySelectorAll(".react-flow__node[data-id]")){const Ie=Ne.getAttribute("data-id");if(!Ie)continue;const De=Ne.offsetWidth,Ve=Ne.offsetHeight;if(!De||!Ve)continue;const Xe=fe.get(Ie);(!Xe||Math.abs(Xe.width-De)>4||Math.abs(Xe.height-Ve)>4)&&(fe.set(Ie,{width:De,height:Ve}),xe=!0)}xe&&zu(Ne=>Ne+1)};if(vo.current)return;let ae=0;return document.visibilityState==="hidden"?ae=window.setTimeout(V,32):B=requestAnimationFrame(V),()=>{cancelAnimationFrame(B),window.clearTimeout(ae)}});const Bt=A.useRef(new Map(lr.positions)),ja=A.useRef(new Set),Ai=A.useRef(""),Sn=A.useMemo(()=>{const B=[];for(const V of n.current.agents.values())vv(V,Ze)&&B.push(V.id+(V.parentId?`>${V.parentId}`:""));return B.sort(),`${B.join("|")}#sv${Ti}.${Ra}`},[n.current,n.current.lastSeq,Ze,Ti,Ra]),Ii=A.useRef(null);A.useEffect(()=>(Ii.current!=null&&window.clearTimeout(Ii.current),Ii.current=window.setTimeout(()=>{Gg(Bt.current,Et.current)},1500),()=>{Ii.current!=null&&window.clearTimeout(Ii.current)}),[Sn]),A.useEffect(()=>{if(Wr.current===Sn)return;const B=Wr.current;if(Wr.current=Sn,!B||wt.current)return;Date.now()-We.current>1200&&zt(400),Ni.current&&window.clearTimeout(Ni.current),Ni.current=window.setTimeout(()=>{wt.current||zt(500)},280)},[Sn,e,zt]);const Mi=A.useMemo(()=>{if(o.size===0)return null;const B=new Set;for(const V of o){const ae=zD(n.current,V);if(ae)for(const fe of ae)B.add(fe)}return B.size>0?B:null},[n.current,n.current.lastSeq,o]),$e=A.useMemo(()=>lD(n.current,Ze),[n.current,n.current.lastSeq,Ze]),yo=A.useRef(null),[Pi,vs]=A.useState({w:0,h:0});A.useEffect(()=>{const B=yo.current;if(!B||typeof ResizeObserver>"u")return;const V=new ResizeObserver(ae=>{var xe;const fe=(xe=ae[0])==null?void 0:xe.contentRect;fe&&vs(Ne=>Math.abs(Ne.w-fe.width)>40||Math.abs(Ne.h-fe.height)>40?{w:fe.width,h:fe.height}:Ne)});return V.observe(B),vs({w:B.clientWidth,h:B.clientHeight}),()=>V.disconnect()},[]);const Ta=A.useRef(new Map),[wo,Aa]=A.useState(!1);A.useEffect(()=>{const B=window.setTimeout(()=>Aa(!0),2500);return()=>window.clearTimeout(B)},[]);const[xo,Gr]=A.useState(!1),Lt=A.useRef(null),[kn,zn]=A.useState(!1),Oi=A.useCallback(()=>{Lt.current&&(window.clearTimeout(Lt.current),Lt.current=null),Gr(!1)},[]),Li=A.useCallback(B=>{B.length!==0&&queueMicrotask(()=>{Gr(!0),Lt.current&&window.clearTimeout(Lt.current),Lt.current=window.setTimeout(()=>Gr(!1),bD+80)})},[]);A.useEffect(()=>()=>{Lt.current&&window.clearTimeout(Lt.current)},[]);const Bn=Pi.w>0?Pi.w*.92:0,Ia=Pi.h>0?Pi.h:0,{nodes:Un,edges:qi}=A.useMemo(()=>BD(n.current,Ze,Bn,Ia,Et.current,Qt,Fn.current,Ta.current,Li,wo,kn,Bt.current,ja.current,Sn,Ai,o,Mi,$e,S),[n.current,n.current.lastSeq,Ze,Bn,Ia,wo,kn,Qt,Sn,o,Mi,$e,S,vt]),Ma=A.useMemo(()=>{const B=new Map;for(const ae of Un){const fe=ae.data;if(!(fe!=null&&fe.sessionId)||fe.exitAt!=null)continue;const xe=ae.width,Ne=ae.height;if(xe==null||Ne==null)continue;const Ie=ae.position.x,De=ae.position.y,Ve=Ie+xe,Xe=De+Ne,at=B.get(fe.sessionId);at?(at.minX=Math.min(at.minX,Ie),at.minY=Math.min(at.minY,De),at.maxX=Math.max(at.maxX,Ve),at.maxY=Math.max(at.maxY,Xe)):B.set(fe.sessionId,{minX:Ie,minY:De,maxX:Ve,maxY:Xe})}const V=[];for(const[ae,fe]of B){const xe=fe.maxX-fe.minX+Xl*2,Ne=fe.maxY-fe.minY+Xl*2;V.push({id:`group:${ae}`,type:fR,position:{x:fe.minX-Xl,y:fe.minY-Xl},data:{sessionId:ae,w:xe,h:Ne},width:xe,height:Ne,style:{width:xe,height:Ne},zIndex:-1,draggable:!0,selectable:!1,focusable:!1,deletable:!1,connectable:!1})}return V},[Un,Ze]),Pa=A.useMemo(()=>{const B=[...Ma,...Un],V=rt.current;return!V||V.size===0?B:B.map(ae=>{const fe=V.get(ae.id);return fe?{...ae,position:fe}:ae})},[Ma,Un,yt]),dr=A.useMemo(()=>{if(!Qt)return null;const B=new Set;for(const V of n.current.agents.values())$e.has(V.id)&&xR(V,Qt)&&B.add(V.id);return B},[n.current,n.current.lastSeq,Qt,$e]),fr=A.useMemo(()=>yD(Qt,(dr==null?void 0:dr.size)??0,$e.size),[Qt,dr,$e]),ys=A.useMemo(()=>{const B=new Set;for(const V of n.current.agents.values())for(const ae of V.tools)B.add(wR(ae.name));return Object.keys(wv).filter(V=>B.has(V))},[n.current,n.current.lastSeq]);A.useEffect(()=>{if(ys.length<=1){kt(!1);return}let B=0;const V=()=>{const ae=Ot.current;if(ae&&!document.hidden){const fe=ae.getBoundingClientRect(),xe=Array.from(document.querySelectorAll(".react-flow__node, .tool-burst")).map(Ie=>Ie.getBoundingClientRect()),Ne=cD(fe,xe,8);kt(Ie=>Ie===Ne?Ie:Ne)}B=window.setTimeout(V,300)};return V(),()=>window.clearTimeout(B)},[ys.length]);const Hn=A.useMemo(()=>{const B=new Map;for(const ae of n.current.agents.values())for(const fe of ae.tools){if(!fe.name.startsWith("mcp__"))continue;const xe=fe.name.slice(5),Ne=xe.indexOf("__"),Ie=Ne>0?xe.slice(0,Ne):xe;B.set(Ie,(B.get(Ie)??0)+1)}const V=[];for(const[ae,fe]of B){let xe=5381;for(let Ne=0;Ne<ae.length;Ne++)xe=(xe<<5)+xe^ae.charCodeAt(Ne);V.push({server:ae,count:fe,hue:Math.abs(xe)%360})}return V.sort((ae,fe)=>fe.count-ae.count),V},[n.current,n.current.lastSeq]),$i=A.useCallback(B=>{ms(V=>{const ae=new Set(V);return ae.has(B)?ae.delete(B):ae.add(B),ae})},[]),mt=u?n.current.agents.get(u):null,Yr=p?Array.from(n.current.agents.values()).flatMap(B=>B.tools).find(B=>B.id===p)??null:null,Oa=A.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}n.current=cv(),Et.current.clear(),Fn.current.clear(),Bt.current.clear(),Ai.current="",_E(),g(),s()},[s,g]),La=A.useRef(b);La.current=b;const ws=A.useRef(!1);ws.current=Yr!=null||St||N!=null||y!=null;const Er=A.useCallback(B=>{const V=hL(B,{confirmOpen:La.current,modalOpen:ws.current});V==="confirm"?k(!0):V==="clear"&&(k(!1),Oa())},[Oa]),Di=A.useCallback(()=>{Et.current.clear(),Bt.current.clear(),Ai.current="",_E(),s(),window.setTimeout(()=>zt(500),80)},[s,e,zt]),_o=A.useCallback(()=>zt(500),[zt]),En=A.useRef(Un);En.current=Un;const xs=A.useRef(u);xs.current=u;const Kr=A.useCallback(B=>{const V=En.current;if(V.length===0)return;const ae=V.slice().sort((De,Ve)=>De.position.y-Ve.position.y||De.position.x-Ve.position.x),fe=xs.current,xe=fe?ae.findIndex(De=>De.id===fe):-1;let Ne;xe===-1?Ne=B===1?0:ae.length-1:Ne=(xe+B+ae.length)%ae.length;const Ie=ae[Ne];Ie&&(f(Ie.id,!1),window.setTimeout(()=>{try{e.fitView({padding:.35,duration:350,nodes:[Ie]})}catch{}We.current=Date.now()},30))},[f,e]),bo=A.useCallback(B=>{f(B,!1),window.setTimeout(()=>{try{const V=En.current.find(ae=>ae.id===B);V&&e.fitView({padding:.3,duration:500,nodes:[V]}),We.current=Date.now()}catch{}},60)},[f,e]);A.useEffect(()=>{const B=V=>{var xe,Ne;const ae=V.target,fe={tagName:ae==null?void 0:ae.tagName,isContentEditable:ae==null?void 0:ae.isContentEditable,role:(xe=ae==null?void 0:ae.getAttribute)==null?void 0:xe.call(ae,"role"),type:ae==null?void 0:ae.type};if(V.key==="Escape"){const Ie=fO({overlayOpen:fv.depth()>0,typing:lC(fe)});Ie==="dismiss"?fv.dismissTop():Ie==="blur"?ae==null||ae.blur():g();return}if(!dL(fe)&&!aL(V)){if(V.key==="/"){V.preventDefault(),(Ne=Hr.current)==null||Ne.focus();return}V.key===" "&&(V.preventDefault(),Dn()),(V.key==="c"||V.key==="C")&&Er("shortcut"),(V.key==="r"||V.key==="R")&&Di(),(V.key==="f"||V.key==="F")&&_o(),(V.key==="l"||V.key==="L")&&Qe(),(V.key==="h"||V.key==="H")&&nt(Ie=>!Ie),(V.key==="u"||V.key==="U")&&O(Ie=>!Ie),(V.key==="a"||V.key==="A")&&ft(),(V.key==="j"||V.key==="J")&&Kr(1),(V.key==="k"||V.key==="K")&&Kr(-1),(V.key==="t"||V.key==="T")&&Si(Ie=>Ie==="dark"?"light":"dark")}};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[Er,Di,_o,g,Kr,Dn]);const hr=n.current.agents.size,_s=new Set(Array.from(n.current.agents.values()).map(B=>B.sessionId)).size,Wn=A.useMemo(()=>{const B=[];for(const V of n.current.agents.values())V.kind==="root"&&V.waiting&&B.push({id:V.id,label:V.label,waiting:V.waiting});return B.sort((V,ae)=>V.waiting.since-ae.waiting.since)},[n.current,n.current.lastSeq]),Ut=A.useMemo(()=>{const B=new Set;for(const V of n.current.agents.values())V.state==="active"&&B.add(V.sessionId);return B.size},[n.current,n.current.lastSeq]),Nr=A.useRef(null);A.useEffect(()=>{const B=CL({waiting:Wn.length,running:Ut}),V=Nr.current;if(Nr.current=B,(V==null?void 0:V.title)!==B.title&&(document.title=B.title),(V==null?void 0:V.icon)!==B.icon){const ae=document.querySelector('link[rel="icon"]');ae&&(ae.href=RL[B.icon])}},[Wn.length,Ut]);const Ht=A.useMemo(()=>{let B=0,V=0,ae=0,fe=0,xe=0,Ne=0,Ie=0,De=0,Ve=0;for(const Xe of n.current.agents.values()){B+=Xe.usage.inputTokens,V+=Xe.usage.outputTokens,ae+=Xe.usage.cacheReadTokens,fe+=Xe.usage.cacheCreateTokens;const at=un(Xe.usage,Xe.model);xe+=at.total,Ne+=at.input,Ie+=at.output,De+=at.cacheRead,Ve+=at.cacheWrite}return{inT:B,outT:V,cacheR:ae,cacheC:fe,sum:B+V,cost:{total:xe,input:Ne,output:Ie,cacheRead:De,cacheWrite:Ve}}},[n.current,n.current.lastSeq]);return m.jsxs("div",{className:"app",children:[m.jsxs("header",{className:"topbar",children:[m.jsxs("div",{className:"brand",children:[m.jsx("span",{className:"logo"}),mn,ye?m.jsxs("button",{type:"button",className:"v stale",onClick:Be,title:ye.kind==="restart"?`Running v${ye.from}; v${ye.to} is installed on disk. Restart to pick it up.`:`Running v${ye.from}; v${ye.to} is on npm.`,children:["v",ye.from,m.jsx("span",{className:"v-dot","aria-hidden":!0})]}):(()=>{const B={running:(X==null?void 0:X.running)??"1.33.139",latest:X==null?void 0:X.latest,latestPending:X==null?void 0:X.latestPending,checkedAgo:X!=null&&X.checkedAt?yv(Ze-X.checkedAt):null,checkDisabled:X==null?void 0:X.checkDisabled,checking:ce};return m.jsxs("button",{type:"button",className:ce?"v checking":"v",onClick:()=>ve(!0),"aria-busy":ce||void 0,"aria-label":pD(B),title:hD(B),children:["v",B.running]})})()]}),mt&&(()=>{const B=un(mt.usage,mt.model),V=Math.max(0,((mt.endedAt??Ze)-mt.startedAt)/1e3),ae=mt.state==="active"?fu(B.total,V):null,fe=o.size-1;return m.jsxs("button",{type:"button",className:"selected-ribbon",title:`Fit view to ${mt.label}`,onClick:()=>{try{const xe=Un.find(Ne=>Ne.id===mt.id);xe&&e.fitView({padding:.35,duration:500,nodes:[xe]}),We.current=Date.now()}catch{}},children:[m.jsx("span",{className:`state-pill state-${mt.state}`,children:mt.state==="active"?"live":mt.state}),m.jsx("span",{className:"selected-label",children:mt.label}),B.total>0&&m.jsxs("span",{className:"selected-cost",children:[ze(B.total),ae?m.jsxs("span",{className:"selected-rate",children:[" · ",ae]}):null]}),fe>0&&m.jsxs("span",{className:"selected-extra",children:["+",fe]}),m.jsx("span",{role:"button","aria-label":"Deselect",className:"selected-close",onClick:xe=>{xe.stopPropagation(),g()},children:"×"})]})})(),m.jsxs("div",{className:"actions",children:[m.jsxs("div",{className:"search",children:[m.jsx("span",{className:"search-icon","aria-hidden":!0,children:"⌕"}),m.jsx("input",{ref:Hr,type:"text",placeholder:"Search agents, cwd, tools…",value:Qt,onChange:B=>dn(B.target.value),spellCheck:!1,"aria-label":"Filter the graph"}),Qt?m.jsx("button",{className:"search-clear","aria-label":"Clear search",onClick:()=>dn(""),children:"×"}):m.jsx("kbd",{className:"search-kbd","aria-hidden":!0,children:"/"}),fr.count&&m.jsx("span",{className:`search-count${fr.empty?" none":""}`,"aria-live":"polite",title:`${fr.count} agents on the canvas match “${Qt}”`,children:fr.count})]}),m.jsxs("span",{className:"status",role:"status",children:[(()=>{const B=gD({connected:I,paused:At,held:Tt.current.size});return m.jsx("span",{className:`pill ${B.tone}`,title:B.title,children:B.label})})(),m.jsxs("span",{className:"stat",title:"Distinct CC sessions",children:[m.jsx("span",{className:"count",children:_s}),m.jsx("span",{className:"lbl",children:"sessions"})]}),m.jsxs("span",{className:"stat",title:"Total agents (root + subagents)",children:[m.jsx("span",{className:"count",children:hr}),m.jsx("span",{className:"lbl",children:"agents"})]}),m.jsxs("span",{className:"stat",title:"Total hook events received",children:[m.jsx("span",{className:"count",children:n.current.totalEvents}),m.jsx("span",{className:"lbl",children:"events"})]}),Ht.sum>0&&m.jsxs("span",{className:"stat",title:`in:${Ht.inT.toLocaleString()} out:${Ht.outT.toLocaleString()} cache-r:${Ht.cacheR.toLocaleString()} cache-c:${Ht.cacheC.toLocaleString()}`,children:[m.jsx("span",{className:"count",children:Dt(Ht.sum)}),m.jsx("span",{className:"lbl",children:"tokens"})]}),Hn.length>0&&m.jsxs("span",{className:"stat mcp-legend",title:`MCP servers seen this session:
|
|
62
|
+
${Hn.map(B=>` ${B.server}: ${B.count} call${B.count===1?"":"s"}`).join(`
|
|
63
|
+
`)}`,children:[Hn.slice(0,6).map(B=>m.jsx("span",{className:"mcp-dot",style:{"--mcp-hue":B.hue}},B.server)),Hn.length>6&&m.jsxs("span",{className:"mcp-more",children:["+",Hn.length-6]}),m.jsx("span",{className:"lbl",children:"mcp"})]}),Ht.cost.total>0&&(()=>{let B=0,V=0;for(const xe of n.current.agents.values()){if(xe.state!=="active")continue;const Ne=un(xe.usage,xe.model);B+=Ne.total,V=Math.max(V,((xe.endedAt??Ze)-xe.startedAt)/1e3)}const ae=V>0?fu(B,V):null,fe=`input ${ze(Ht.cost.input)} + output ${ze(Ht.cost.output)} + cache r ${ze(Ht.cost.cacheRead)} + cache w ${ze(Ht.cost.cacheWrite)}${ae?`
|
|
64
|
+
active burn: ${ae}`:""}`;return m.jsxs("span",{className:"stat",title:fe,children:[m.jsx("span",{className:"count",children:ze(Ht.cost.total)}),m.jsxs("span",{className:"lbl",children:["cost",ae?` · ${ae}`:""]})]})})()]}),Wn.length>0&&m.jsxs("button",{type:"button",className:"waiting-stat",onClick:()=>bo(Wn[0].id),title:`Blocked waiting for you — click to go to the one that has been stuck longest:
|
|
65
|
+
${Wn.map(B=>` ${B.label}: ${Bv(B.waiting)} (${yv(Ze-B.waiting.since)})`).join(`
|
|
66
|
+
`)}`,"aria-label":`${Wn.length} session${Wn.length===1?"":"s"} waiting for you`,children:[m.jsx("span",{className:"ap-pulse","aria-hidden":!0}),m.jsx("b",{children:Wn.length})," waiting"]}),(()=>{const B=vD({paused:At,held:Tt.current.size});return m.jsx("button",{className:`btn ${At?"warn":""}`,onClick:Dn,title:B.title,children:B.label})})(),m.jsx("button",{className:`btn icon-btn ${H?"primary":""}`,onClick:()=>O(B=>!B),title:`${H?"Hide":"Show"} usage panel (U)`,"aria-label":"Toggle usage panel",children:"$"}),G!==null&&m.jsx("button",{className:`btn icon-btn ${G?"primary":""}`,onClick:B=>{if(B.shiftKey&&Z>0){Q(!0),fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restore"})}).then(()=>fetch("/api/sound-hook")).then(V=>V.ok?V.json():null).then(V=>{V!=null&&V.ok&&(q(V.enabled===!0),$(V.parked??0))}).catch(()=>{}).finally(()=>Q(!1));return}K()},disabled:j,title:(G?"Sound on turn finish: on — click to remove the hook":"Sound on turn finish: off — click to add a Stop hook")+(z>0?`
|
|
67
|
+
|
|
68
|
+
${z} sound hook${z>1?"s":""} of your own in settings.json also run${z>1?"":"s"} here.`:"")+(Z>0?`
|
|
69
|
+
|
|
70
|
+
${Z} of your own sound hook${Z>1?"s were":" was"} set aside so this switch actually controls the sound. Nothing was deleted — shift-click to put ${Z>1?"them":"it"} back.`:""),"aria-label":"Toggle finish sound","aria-pressed":G,children:m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[m.jsx("path",{d:"M3.2 5.2h2L7.8 3v8L5.2 8.8h-2z"}),G?m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M9.8 5.4a2.4 2.4 0 0 1 0 3.2"}),m.jsx("path",{d:"M11.3 3.9a4.6 4.6 0 0 1 0 6.2"})]}):m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M10 5.6l2.6 2.8"}),m.jsx("path",{d:"M12.6 5.6L10 8.4"})]})]})}),m.jsx("button",{className:`btn icon-btn ${P?"primary":""}`,onClick:ft,title:`${P?"Hide":"Show"} accounts (A)`,"aria-label":"Toggle accounts panel",children:m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[m.jsx("circle",{cx:"7",cy:"4.6",r:"2.4"}),m.jsx("path",{d:"M2.4 12c0-2.3 2.1-3.7 4.6-3.7s4.6 1.4 4.6 3.7"})]})}),m.jsx("button",{className:`btn icon-btn ${C?"primary":""}`,onClick:Qe,title:`${C?"Hide":"Show"} session list (L)`,"aria-label":"Toggle session list",children:"☰"}),m.jsx("button",{className:`btn icon-btn ${St?"primary":""}`,onClick:()=>nt(B=>!B),title:"Usage history — ccusage (H)","aria-label":"Open usage history",children:m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":!0,children:[m.jsx("line",{x1:"3",y1:"11.5",x2:"3",y2:"7"}),m.jsx("line",{x1:"7",y1:"11.5",x2:"7",y2:"3"}),m.jsx("line",{x1:"11",y1:"11.5",x2:"11",y2:"8.5"})]})}),m.jsx("button",{className:"btn",onClick:Di,title:"Auto-arrange — clear pins (R)",children:"Re-layout"}),m.jsx("button",{className:"btn",onClick:()=>Er("button"),title:"Clear the canvas and the server's event log — asks first (C)",children:"Clear"}),m.jsx("button",{className:"btn icon-btn",onClick:()=>Si(B=>B==="dark"?"light":"dark"),title:`Switch to ${Sr==="dark"?"light":"dark"} mode (T)`,"aria-label":"Toggle theme",children:Sr==="dark"?"☀":"☾"})]})]}),_i?m.jsxs("div",{className:"ver-banner done",role:"status",children:[m.jsx("span",{className:"ver-dot"}),m.jsxs("strong",{children:["Restarted — now running v",_i,"."]}),m.jsx("span",{className:"ver-sub",children:"The canvas replayed from the event log."})]}):ki&&!I?m.jsxs("div",{className:"conn-banner",role:"alert",children:[m.jsx("span",{className:"conn-dot"}),xn?hs==="npx"?"Fetching the new version with npx — this can take a minute…":`Restarting ${mn}…`:`Lost connection to the ${mn} server. Reconnecting…`]}):_e&&ye&&m.jsxs("div",{className:`ver-banner ${ye.kind}`,role:"status",children:[m.jsx("span",{className:"ver-dot"}),ye.kind==="restart"?m.jsxs(m.Fragment,{children:[m.jsxs("strong",{children:["v",ye.to," is installed — this deck still runs v",ye.from,"."]}),X!=null&&X.canRestart?m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"ver-act",onClick:()=>bn(),disabled:xn,title:"Stop this process and bring it back on the same port. The canvas replays from the event log.",children:xn?"restarting…":"Restart now"}),m.jsxs("button",{type:"button",className:`ver-auto${Xt?" on":""}`,role:"switch","aria-checked":Xt,onClick:fs,title:Xt?"Restarts on its own once nothing has been running for 30 seconds. Click to require a click instead.":"Only restarts when you click. Click to let it restart itself while idle.",children:[m.jsx("i",{"aria-hidden":!0}),"auto when idle"]})]}):m.jsx("span",{className:"ver-sub",title:"Node loads every module once, at startup. An upgrade replaces the files on disk but not the code already in memory, so this process keeps running the old version until it is restarted.",children:"Restart it to pick up the new code."})]}):m.jsxs(m.Fragment,{children:[m.jsxs("strong",{children:[mn," v",ye.to," is out — you are on v",ye.from,"."]}),(X==null?void 0:X.upgradeMode)==="install"&&Ye!=="failed"&&m.jsx("button",{type:"button",className:"ver-act",onClick:tt,disabled:Ye==="running"||Ye==="done",title:`Runs ${((qa=X==null?void 0:X.upgrade)==null?void 0:qa.command)??"npm install -g agents-deck@latest"} here, then restarts once nothing is running.`,children:Ye==="running"?"installing…":Ye==="done"?"installed":"Update now"}),(X==null?void 0:X.upgradeMode)==="npx"&&(X==null?void 0:X.canRestart)&&m.jsx("button",{type:"button",className:"ver-act",onClick:()=>bn({upgrade:!0}),disabled:xn,title:`Runs ${X==null?void 0:X.command} and hands it this port. Nothing is installed globally — npx unpacks its own copy.`,children:xn?"fetching…":Ye==="failed"?"Retry update":"Update & restart"}),Ye==="failed"?m.jsxs("span",{className:"ver-sub fail",title:((bs=X==null?void 0:X.upgrade)==null?void 0:bs.error)??"",children:[(X==null?void 0:X.upgradeMode)==="npx"?"update failed":"install failed",": ",((Ss=X==null?void 0:X.upgrade)==null?void 0:Ss.error)??"unknown error"," — run it yourself:"]}):(X==null?void 0:X.upgradeMode)==="npx"?m.jsx("span",{className:"ver-sub",children:X!=null&&X.canRestart?"npx cannot upgrade in place, so the deck re-runs:":vE.npx}):X!=null&&X.upgradeBlocked?m.jsx("span",{className:"ver-sub",children:vE[X.upgradeBlocked]??"cannot install from here"}):null,m.jsxs("button",{type:"button",className:"ver-cmd",onClick:Fe,title:"Copy to clipboard",children:[m.jsx("code",{children:X==null?void 0:X.command}),m.jsx("span",{className:"ver-cmd-hint",children:le?"copied":"copy"})]})]}),m.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:Be,children:"×"})]}),H&&m.jsx(k3,{state:n.current,now:Ze,onClose:()=>O(!1)}),P&&m.jsx(eL,{onClose:()=>F(!1)}),C&&m.jsx(p3,{state:n.current,now:Ze,selectedIds:o,onSelect:bo,onClose:()=>T(!1)}),m.jsxs("div",{className:`canvas-wrap${xo?" bubbling":""}${kn?" dragging-any":""}`,ref:yo,children:[hr===0&&m.jsx(WD,{live:I,everConnected:ki}),fr.empty&&hr>0&&m.jsxs("div",{className:"search-empty",role:"status",children:[m.jsx("span",{className:"search-empty-text",children:fr.message}),m.jsx("button",{type:"button",className:"btn",onClick:()=>{var B;dn(""),(B=Hr.current)==null||B.focus()},children:"Clear search"})]}),ys.length>1&&m.jsx("div",{ref:Ot,className:`cat-filter-bar${Je?" occluded":""}`,role:"toolbar","aria-label":"Filter tools by category",children:ys.map(B=>{const V=bi.has(B);return m.jsxs("button",{type:"button",className:`cat-filter${V?" off":""}`,onClick:()=>$i(B),title:`${V?"Show":"Hide"} ${xv[B]} tools`,children:[m.jsx("span",{className:"cat-emoji",children:wv[B]}),m.jsx("span",{className:"cat-name",children:xv[B]})]},B)})}),m.jsxs(FN,{nodes:Pa,edges:qi,nodeTypes:_D,fitView:!Ur,fitViewOptions:{padding:.25,duration:400},minZoom:.2,maxZoom:1.6,panOnScroll:!0,nodesDraggable:!0,nodesConnectable:!1,selectionOnDrag:!1,nodeDragThreshold:5,onNodeClick:(B,V)=>{if(V.type==="sessionGroup"){g();return}f(V.id,B.shiftKey)},onPaneClick:()=>g(),onMoveStart:()=>{Date.now()-We.current<1200||Ca()},onMove:(B,V)=>{kr(),ur.current&&window.clearTimeout(ur.current),ur.current=window.setTimeout(()=>$D(V),250)},onNodeDragStart:(B,V)=>{var ae;if(Oi(),vo.current=!0,rt.current=new Map,zn(!0),kr(),Ca(),V.type==="sessionGroup"){const fe=(ae=V.data)==null?void 0:ae.sessionId,xe=new Map;if(fe)for(const Ne of Un){const Ie=Ne.data;(Ie==null?void 0:Ie.sessionId)===fe&&xe.set(Ne.id,{x:Ne.position.x,y:Ne.position.y})}Br.current={start:{x:V.position.x,y:V.position.y},members:xe};return}Et.current.set(V.id,{x:V.position.x,y:V.position.y})},onNodeDrag:(B,V)=>{var ae;if(kr(),V.type==="sessionGroup"){const fe=Br.current;if(!fe)return;const xe=V.position.x-fe.start.x,Ne=V.position.y-fe.start.y;for(const[De,Ve]of fe.members){const Xe={x:Ve.x+xe,y:Ve.y+Ne};Et.current.set(De,Xe),Bt.current.set(De,Xe)}const Ie=rt.current;if(Ie){for(const[De,Ve]of fe.members)Ie.set(De,{x:Ve.x+xe,y:Ve.y+Ne});Ie.set(V.id,{x:V.position.x,y:V.position.y})}vn(De=>De+1);return}Et.current.set(V.id,{x:V.position.x,y:V.position.y}),Bt.current.set(V.id,{x:V.position.x,y:V.position.y}),(ae=rt.current)==null||ae.set(V.id,{x:V.position.x,y:V.position.y}),vn(fe=>fe+1)},onNodeDragStop:(B,V)=>{if(kr(),vo.current=!1,rt.current=null,zn(!1),Kt(ae=>ae+1),V.type==="sessionGroup"){const ae=Br.current;if(ae){const fe=V.position.x-ae.start.x,xe=V.position.y-ae.start.y;for(const[Ne,Ie]of ae.members){const De={x:Ie.x+fe,y:Ie.y+xe};Et.current.set(Ne,De),Bt.current.set(Ne,De)}}Br.current=null,Gg(Bt.current,Et.current),Kt(fe=>fe+1);return}Et.current.set(V.id,{x:V.position.x,y:V.position.y}),Bt.current.set(V.id,{x:V.position.x,y:V.position.y}),Gg(Bt.current,Et.current)},children:[m.jsx(zP,{gap:28,size:1,color:ta("--grid-line")}),m.jsx(AO,{}),m.jsx(l3,{agents:n.current.agents,visibleAgentIds:$e,positions:Bt.current,pinned:Et.current,measured:Fn.current,dimUnmatched:fr.dim?dr:null,spotlight:Mi,hiddenCategories:bi,now:Ze,onOpenTool:h}),m.jsx(OP,{showInteractive:!1,children:m.jsx(Qs,{onClick:Fu,title:Vr?"Recenter view + re-enable autofit":"Recenter view (autofit already on)","aria-label":"Recenter view",style:Vr?{color:"var(--accent)"}:void 0,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("circle",{cx:"12",cy:"12",r:"3.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("path",{d:"M12 2v4M12 18v4M2 12h4M18 12h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})})}),m.jsx(RP,{zoomable:!0,pannable:!0,nodeColor:B=>dD(B,ta),nodeStrokeWidth:2,maskColor:ta("--minimap-mask"),style:{background:ta("--panel"),border:`1px solid ${ta("--line")}`,borderRadius:8}})]})]}),M?m.jsxs("aside",{className:"detail",children:[m.jsx("button",{type:"button",className:"detail-close",title:"Close panel","aria-label":"Close detail panel",onClick:()=>L(!1),children:"×"}),mt?m.jsx(YD,{agent:mt,now:Ze,onOpenTool:h,onShowSummary:B=>{E.current.has(B)&&(E.current.delete(B),xE(E.current)),x(B)},onExportSession:B=>DD(n.current,B)}):m.jsx(GD,{count:hr,workspace:ke})]}):m.jsx("button",{type:"button",className:"detail-reopen",title:"Show detail panel","aria-label":"Show detail panel",onClick:()=>L(!0),children:"‹"}),Yr&&m.jsx(NO,{tool:Yr,onClose:()=>h(null)}),St&&m.jsx(PL,{onClose:()=>nt(!1)}),N&&(()=>{const B=n.current.agents.get(N);return B?m.jsx(vO,{agent:B,onClose:()=>_(null)}):null})(),y&&m.jsx(c3,{state:n.current,sessionId:y,onClose:()=>{E.current.add(y),xE(E.current),x(null)}}),b&&m.jsx(fL,{agentCount:hr,onConfirm:()=>Er("confirmation"),onCancel:()=>k(!1)})]})}function WD({live:e,everConnected:n}){const r=!e;return m.jsxs("div",{className:"empty-hero",children:[m.jsxs("div",{className:"orbit-stack","aria-hidden":!0,children:[m.jsx("div",{className:"core"}),m.jsxs("div",{className:"orbit r1",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]}),m.jsxs("div",{className:"orbit r2",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]}),m.jsxs("div",{className:"orbit r3",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]})]}),r?m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:n?"Disconnected from server":"Server unreachable"}),m.jsxs("p",{children:["The browser cannot reach ",m.jsx("code",{children:"/events"}),". Check that",m.jsx("code",{children:mn})," is still running in your terminal, then this page will resume automatically."]})]}):VD()]})}function VD(){return m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Waiting for Claude Code or Codex"}),m.jsxs("p",{children:["Run ",m.jsx("code",{children:"claude"})," or ",m.jsx("code",{children:"codex"})," in any folder. As soon as a session sends an event, a node appears here and grows as subagents fork and tools are called."]}),m.jsxs("p",{className:"hint-row",children:["Not seeing anything? Make sure ",m.jsx("code",{children:mn})," is running and that hooks are installed in your Claude settings (",m.jsx("code",{children:"$CLAUDE_CONFIG_DIR"})," ","if you set it, otherwise ",m.jsx("code",{children:"~/.claude/settings.json"}),") and"," ",m.jsx("code",{children:"~/.codex/hooks.json"}),". (Codex requires"," ",m.jsx("code",{children:"/hooks"})," trust on first run.)"]})]})}function GD({count:e,workspace:n}){const r=mD(n);return m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Detail"}),e===0?m.jsxs("div",{className:"hint",children:[r.lead,r.workspace!==null&&m.jsxs(m.Fragment,{children:[" ",m.jsx("code",{children:r.workspace}),r.tail]})]}):m.jsx("div",{className:"empty",children:"Click an agent to see its tools."}),m.jsx("h3",{style:{marginTop:4},children:"Shortcuts"}),m.jsxs("div",{className:"shortcuts",children:[m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"drag"}),m.jsx("span",{children:"move a node"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"/"}),m.jsx("span",{children:"focus search"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"space"}),m.jsx("span",{children:"pause / resume"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"J"}),m.jsx("span",{children:"next agent"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"K"}),m.jsx("span",{children:"previous agent"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"R"}),m.jsx("span",{children:"re-arrange"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"F"}),m.jsx("span",{children:"fit view"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"L"}),m.jsx("span",{children:"session list"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"H"}),m.jsx("span",{children:"usage history"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"U"}),m.jsx("span",{children:"usage panel"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"C"}),m.jsx("span",{children:"clear canvas"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"T"}),m.jsx("span",{children:"toggle theme"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"Esc"}),m.jsx("span",{children:"deselect"})]})]})]})}function YD({agent:e,now:n,onOpenTool:r,onShowSummary:s,onExportSession:o}){const l=(e.endedAt??n)-e.startedAt,u=Math.max(0,Math.floor(l/1e3)),c=u<60?`${u}s`:`${Math.floor(u/60)}m ${String(u%60).padStart(2,"0")}s`,p=un(e.usage,e.model),h=p.total>0,f=e.usage.inputTokens+e.usage.outputTokens,g=new Map;for(const _ of e.tools){const S=wR(_.name);g.set(S,(g.get(S)??0)+1)}const y=e.tools.filter(_=>_.ok===!1).length,x=e.tools.filter(_=>!_.endedAt).length,N=Array.from(g.entries()).sort((_,S)=>S[1]-_[1]);return m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:"detail-hero",children:[m.jsxs("div",{className:"hero-line",children:[m.jsx("span",{className:`state-pill state-${e.state}`,children:e.state==="active"?"live":e.state}),m.jsx("h2",{className:"hero-title",title:e.cwd??e.label,children:e.label})]}),m.jsxs("div",{className:"hero-meta",children:[m.jsx("span",{className:"hero-meta-item",children:e.kind}),m.jsx("span",{className:"hero-sep",children:"·"}),m.jsx("span",{className:"hero-meta-item",title:`started ${new Date(e.startedAt).toLocaleString()}`,children:c}),e.model&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"hero-sep",children:"·"}),m.jsx("span",{className:"model-chip",title:e.model,children:as(e.model)})]})]}),h&&m.jsxs("div",{className:"hero-cost",children:[m.jsxs("div",{className:"hero-cost-headline",children:[m.jsx("span",{className:"hero-cost-value",children:ze(p.total)}),m.jsx("span",{className:"hero-cost-label",children:"spend"})]}),m.jsx(KD,{cost:p})]}),m.jsxs("div",{className:"hero-actions",children:[e.kind==="root"&&e.state==="done"&&s&&m.jsx("button",{type:"button",className:"btn hero-action-btn",onClick:()=>s(e.sessionId),title:"Reopen the end-of-session recap modal",children:"Show recap"}),o&&m.jsx("button",{type:"button",className:"btn hero-action-btn",onClick:()=>o(e.sessionId),title:"Download this session as JSON",children:"Export JSON"})]})]}),e.tools.length>0&&m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Activity"}),m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{className:"activity-counters",children:[m.jsxs("span",{className:"ac-item",children:[m.jsx("b",{children:e.toolCount})," calls"]}),x>0&&m.jsxs("span",{className:"ac-item ac-live",children:[m.jsx("b",{children:x})," live"]}),y>0&&m.jsxs("span",{className:"ac-item ac-err",children:[m.jsx("b",{children:y})," err"]})]}),m.jsx("div",{className:"cat-strip",children:N.map(([_,S])=>m.jsxs("span",{className:`cat-chip cat-${_}`,title:`${S} ${xv[_]} call${S===1?"":"s"}`,children:[m.jsx("span",{className:"cat-emoji",children:wv[_]}),m.jsx("span",{className:"cat-count",children:S})]},_))})]})]}),f>0&&m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Tokens"}),m.jsxs("div",{className:"tokens-grid",children:[m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"in"}),m.jsx("b",{children:e.usage.inputTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"out"}),m.jsx("b",{children:e.usage.outputTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"cache r"}),m.jsx("b",{children:e.usage.cacheReadTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"cache c"}),m.jsx("b",{children:e.usage.cacheCreateTokens.toLocaleString()})]})]})]}),m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Identity"}),m.jsxs("div",{children:[e.cwd&&m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"cwd"}),m.jsx("span",{className:"v",title:e.cwd,children:e.cwd})]}),m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"session"}),m.jsxs("span",{className:"v",children:[e.sessionId.slice(0,12),"…"]})]}),e.parentId&&m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"parent"}),m.jsxs("span",{className:"v",children:[e.parentId.slice(0,12),"…"]})]})]})]}),e.prompts.length>0&&m.jsxs("section",{className:"detail-section",children:[m.jsxs("h3",{children:["Prompts ",m.jsx("span",{className:"section-count",children:e.prompts.length})]}),m.jsx("div",{className:"prompts",children:e.prompts.slice().reverse().map((_,S)=>{const b=xD(_.at,n);return m.jsxs("div",{className:"prompt-entry",children:[m.jsx("div",{className:"prompt-time",title:b.title,children:b.label}),m.jsx("div",{className:"prompt-text",children:_.text})]},S)})})]}),m.jsxs("section",{className:"detail-section",children:[m.jsxs("h3",{children:["Tool calls ",m.jsx("span",{className:"section-count",children:e.tools.length})]}),e.tools.length===0&&m.jsx("div",{className:"empty",children:"No tool calls yet."}),m.jsx("div",{children:e.tools.slice().reverse().map(_=>m.jsx(XD,{t:_,now:n,onClick:()=>r(_.id)},_.id))})]})]})}function KD({cost:e}){const n=e.total;if(n<=0)return null;const r=(s,o,l)=>{if(s<=0)return null;const u=s/n*100;return m.jsx("span",{className:`cb-seg ${o}`,style:{width:`${u}%`},title:`${l}: ${ze(s)} (${u.toFixed(0)}%)`},o)};return m.jsxs("div",{className:"cost-bar","aria-label":"Cost breakdown",children:[r(e.input,"cb-input","input"),r(e.output,"cb-output","output"),r(e.cacheRead,"cb-cache-r","cache read"),r(e.cacheWrite,"cb-cache-w","cache write")]})}function XD({t:e,now:n,onClick:r}){const s=e.endedAt==null?"inflight":e.ok===!1?"err":"done",o=(e.endedAt??n)-e.startedAt,l=e.endedAt==null?"…":o<1e3?`${o}ms`:`${(o/1e3).toFixed(1)}s`;return m.jsxs("button",{className:"tool clickable",title:e.inputPreview||e.name,onClick:r,children:[m.jsxs("span",{className:"name",children:[m.jsx("span",{className:`status-dot ${s}`}),e.name]}),m.jsx("span",{style:{color:"var(--muted)"},children:l})]})}try{kL(window.localStorage)}catch{}const QD=Dj.createRoot(document.getElementById("root"));QD.render(m.jsx(UD,{}));
|