cognetivy 0.1.33 → 0.1.34

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,112 @@
1
+ function fA(e,t){for(var r=0;r<t.length;r++){const i=t[r];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in e)){const s=Object.getOwnPropertyDescriptor(i,l);s&&Object.defineProperty(e,l,s.get?s:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function r(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=r(l);fetch(l.href,s)}})();var v7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Us(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rm={exports:{}},is={};var yb;function dA(){if(yb)return is;yb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,l,s){var c=null;if(s!==void 0&&(c=""+s),l.key!==void 0&&(c=""+l.key),"key"in l){s={};for(var f in l)f!=="key"&&(s[f]=l[f])}else s=l;return l=s.ref,{$$typeof:e,type:i,key:c,ref:l!==void 0?l:null,props:s}}return is.Fragment=t,is.jsx=r,is.jsxs=r,is}var xb;function hA(){return xb||(xb=1,Rm.exports=dA()),Rm.exports}var p=hA(),jm={exports:{}},Re={};var vb;function mA(){if(vb)return Re;vb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function b(B){return B===null||typeof B!="object"?null:(B=x&&B[x]||B["@@iterator"],typeof B=="function"?B:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function N(B,G,D){this.props=B,this.context=G,this.refs=_,this.updater=D||E}N.prototype.isReactComponent={},N.prototype.setState=function(B,G){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,G,"setState")},N.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function k(){}k.prototype=N.prototype;function C(B,G,D){this.props=B,this.context=G,this.refs=_,this.updater=D||E}var A=C.prototype=new k;A.constructor=C,S(A,N.prototype),A.isPureReactComponent=!0;var z=Array.isArray;function j(){}var L={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function H(B,G,D){var oe=D.ref;return{$$typeof:e,type:B,key:G,ref:oe!==void 0?oe:null,props:D}}function X(B,G){return H(B.type,G,B.props)}function q(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function Y(B){var G={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(D){return G[D]})}var F=/\/+/g;function O(B,G){return typeof B=="object"&&B!==null&&B.key!=null?Y(""+B.key):G.toString(36)}function U(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(j,j):(B.status="pending",B.then(function(G){B.status==="pending"&&(B.status="fulfilled",B.value=G)},function(G){B.status==="pending"&&(B.status="rejected",B.reason=G)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function R(B,G,D,oe,K){var J=typeof B;(J==="undefined"||J==="boolean")&&(B=null);var te=!1;if(B===null)te=!0;else switch(J){case"bigint":case"string":case"number":te=!0;break;case"object":switch(B.$$typeof){case e:case t:te=!0;break;case m:return te=B._init,R(te(B._payload),G,D,oe,K)}}if(te)return K=K(B),te=oe===""?"."+O(B,0):oe,z(K)?(D="",te!=null&&(D=te.replace(F,"$&/")+"/"),R(K,G,D,"",function(he){return he})):K!=null&&(q(K)&&(K=X(K,D+(K.key==null||B&&B.key===K.key?"":(""+K.key).replace(F,"$&/")+"/")+te)),G.push(K)),1;te=0;var ne=oe===""?".":oe+":";if(z(B))for(var se=0;se<B.length;se++)oe=B[se],J=ne+O(oe,se),te+=R(oe,G,D,J,K);else if(se=b(B),typeof se=="function")for(B=se.call(B),se=0;!(oe=B.next()).done;)oe=oe.value,J=ne+O(oe,se++),te+=R(oe,G,D,J,K);else if(J==="object"){if(typeof B.then=="function")return R(U(B),G,D,oe,K);throw G=String(B),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return te}function V(B,G,D){if(B==null)return B;var oe=[],K=0;return R(B,oe,"","",function(J){return G.call(D,J,K++)}),oe}function $(B){if(B._status===-1){var G=B._result;G=G(),G.then(function(D){(B._status===0||B._status===-1)&&(B._status=1,B._result=D)},function(D){(B._status===0||B._status===-1)&&(B._status=2,B._result=D)}),B._status===-1&&(B._status=0,B._result=G)}if(B._status===1)return B._result.default;throw B._result}var W=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},M={map:V,forEach:function(B,G,D){V(B,function(){G.apply(this,arguments)},D)},count:function(B){var G=0;return V(B,function(){G++}),G},toArray:function(B){return V(B,function(G){return G})||[]},only:function(B){if(!q(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Re.Activity=g,Re.Children=M,Re.Component=N,Re.Fragment=r,Re.Profiler=l,Re.PureComponent=C,Re.StrictMode=i,Re.Suspense=h,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Re.__COMPILER_RUNTIME={__proto__:null,c:function(B){return L.H.useMemoCache(B)}},Re.cache=function(B){return function(){return B.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(B,G,D){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var oe=S({},B.props),K=B.key;if(G!=null)for(J in G.key!==void 0&&(K=""+G.key),G)!P.call(G,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&G.ref===void 0||(oe[J]=G[J]);var J=arguments.length-2;if(J===1)oe.children=D;else if(1<J){for(var te=Array(J),ne=0;ne<J;ne++)te[ne]=arguments[ne+2];oe.children=te}return H(B.type,K,oe)},Re.createContext=function(B){return B={$$typeof:c,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:s,_context:B},B},Re.createElement=function(B,G,D){var oe,K={},J=null;if(G!=null)for(oe in G.key!==void 0&&(J=""+G.key),G)P.call(G,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(K[oe]=G[oe]);var te=arguments.length-2;if(te===1)K.children=D;else if(1<te){for(var ne=Array(te),se=0;se<te;se++)ne[se]=arguments[se+2];K.children=ne}if(B&&B.defaultProps)for(oe in te=B.defaultProps,te)K[oe]===void 0&&(K[oe]=te[oe]);return H(B,J,K)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(B){return{$$typeof:f,render:B}},Re.isValidElement=q,Re.lazy=function(B){return{$$typeof:m,_payload:{_status:-1,_result:B},_init:$}},Re.memo=function(B,G){return{$$typeof:d,type:B,compare:G===void 0?null:G}},Re.startTransition=function(B){var G=L.T,D={};L.T=D;try{var oe=B(),K=L.S;K!==null&&K(D,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(j,W)}catch(J){W(J)}finally{G!==null&&D.types!==null&&(G.types=D.types),L.T=G}},Re.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Re.use=function(B){return L.H.use(B)},Re.useActionState=function(B,G,D){return L.H.useActionState(B,G,D)},Re.useCallback=function(B,G){return L.H.useCallback(B,G)},Re.useContext=function(B){return L.H.useContext(B)},Re.useDebugValue=function(){},Re.useDeferredValue=function(B,G){return L.H.useDeferredValue(B,G)},Re.useEffect=function(B,G){return L.H.useEffect(B,G)},Re.useEffectEvent=function(B){return L.H.useEffectEvent(B)},Re.useId=function(){return L.H.useId()},Re.useImperativeHandle=function(B,G,D){return L.H.useImperativeHandle(B,G,D)},Re.useInsertionEffect=function(B,G){return L.H.useInsertionEffect(B,G)},Re.useLayoutEffect=function(B,G){return L.H.useLayoutEffect(B,G)},Re.useMemo=function(B,G){return L.H.useMemo(B,G)},Re.useOptimistic=function(B,G){return L.H.useOptimistic(B,G)},Re.useReducer=function(B,G,D){return L.H.useReducer(B,G,D)},Re.useRef=function(B){return L.H.useRef(B)},Re.useState=function(B){return L.H.useState(B)},Re.useSyncExternalStore=function(B,G,D){return L.H.useSyncExternalStore(B,G,D)},Re.useTransition=function(){return L.H.useTransition()},Re.version="19.2.4",Re}var bb;function Vs(){return bb||(bb=1,jm.exports=mA()),jm.exports}var w=Vs();const no=Us(w),vS=fA({__proto__:null,default:no},[w]);var Mm={exports:{}},ls={},Om={exports:{}},Dm={};var wb;function pA(){return wb||(wb=1,(function(e){function t(R,V){var $=R.length;R.push(V);e:for(;0<$;){var W=$-1>>>1,M=R[W];if(0<l(M,V))R[W]=V,R[$]=M,$=W;else break e}}function r(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var V=R[0],$=R.pop();if($!==V){R[0]=$;e:for(var W=0,M=R.length,B=M>>>1;W<B;){var G=2*(W+1)-1,D=R[G],oe=G+1,K=R[oe];if(0>l(D,$))oe<M&&0>l(K,D)?(R[W]=K,R[oe]=$,W=oe):(R[W]=D,R[G]=$,W=G);else if(oe<M&&0>l(K,$))R[W]=K,R[oe]=$,W=oe;else break e}}return V}function l(R,V){var $=R.sortIndex-V.sortIndex;return $!==0?$:R.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],d=[],m=1,g=null,x=3,b=!1,E=!1,S=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(R){for(var V=r(d);V!==null;){if(V.callback===null)i(d);else if(V.startTime<=R)i(d),V.sortIndex=V.expirationTime,t(h,V);else break;V=r(d)}}function z(R){if(S=!1,A(R),!E)if(r(h)!==null)E=!0,j||(j=!0,Y());else{var V=r(d);V!==null&&U(z,V.startTime-R)}}var j=!1,L=-1,P=5,H=-1;function X(){return _?!0:!(e.unstable_now()-H<P)}function q(){if(_=!1,j){var R=e.unstable_now();H=R;var V=!0;try{e:{E=!1,S&&(S=!1,k(L),L=-1),b=!0;var $=x;try{t:{for(A(R),g=r(h);g!==null&&!(g.expirationTime>R&&X());){var W=g.callback;if(typeof W=="function"){g.callback=null,x=g.priorityLevel;var M=W(g.expirationTime<=R);if(R=e.unstable_now(),typeof M=="function"){g.callback=M,A(R),V=!0;break t}g===r(h)&&i(h),A(R)}else i(h);g=r(h)}if(g!==null)V=!0;else{var B=r(d);B!==null&&U(z,B.startTime-R),V=!1}}break e}finally{g=null,x=$,b=!1}V=void 0}}finally{V?Y():j=!1}}}var Y;if(typeof C=="function")Y=function(){C(q)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,O=F.port2;F.port1.onmessage=q,Y=function(){O.postMessage(null)}}else Y=function(){N(q,0)};function U(R,V){L=N(function(){R(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(R){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var $=x;x=V;try{return R()}finally{x=$}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(R,V){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var $=x;x=R;try{return V()}finally{x=$}},e.unstable_scheduleCallback=function(R,V,$){var W=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?W+$:W):$=W,R){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=$+M,R={id:m++,callback:V,priorityLevel:R,startTime:$,expirationTime:M,sortIndex:-1},$>W?(R.sortIndex=$,t(d,R),r(h)===null&&R===r(d)&&(S?(k(L),L=-1):S=!0,U(z,$-W))):(R.sortIndex=M,t(h,R),E||b||(E=!0,j||(j=!0,Y()))),R},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(R){var V=x;return function(){var $=x;x=V;try{return R.apply(this,arguments)}finally{x=$}}}})(Dm)),Dm}var Sb;function gA(){return Sb||(Sb=1,Om.exports=pA()),Om.exports}var zm={exports:{}},qt={};var Eb;function yA(){if(Eb)return qt;Eb=1;var e=Vs();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function s(h,d,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:h,containerInfo:d,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,qt.createPortal=function(h,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return s(h,d,null,m)},qt.flushSync=function(h){var d=c.T,m=i.p;try{if(c.T=null,i.p=2,h)return h()}finally{c.T=d,i.p=m,i.d.f()}},qt.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(h,d))},qt.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},qt.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var m=d.as,g=f(m,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?i.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:b}):m==="script"&&i.d.X(h,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},qt.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=f(d.as,d.crossOrigin);i.d.M(h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(h)},qt.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,g=f(m,d.crossOrigin);i.d.L(h,m,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},qt.preloadModule=function(h,d){if(typeof h=="string")if(d){var m=f(d.as,d.crossOrigin);i.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(h)},qt.requestFormReset=function(h){i.d.r(h)},qt.unstable_batchedUpdates=function(h,d){return h(d)},qt.useFormState=function(h,d,m){return c.H.useFormState(h,d,m)},qt.useFormStatus=function(){return c.H.useHostTransitionStatus()},qt.version="19.2.4",qt}var Cb;function bS(){if(Cb)return zm.exports;Cb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zm.exports=yA(),zm.exports}var Nb;function xA(){if(Nb)return ls;Nb=1;var e=gA(),t=Vs(),r=bS();function i(n){var o="https://react.dev/errors/"+n;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)o+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function s(n){var o=n,a=n;if(n.alternate)for(;o.return;)o=o.return;else{n=o;do o=n,(o.flags&4098)!==0&&(a=o.return),n=o.return;while(n)}return o.tag===3?a:null}function c(n){if(n.tag===13){var o=n.memoizedState;if(o===null&&(n=n.alternate,n!==null&&(o=n.memoizedState)),o!==null)return o.dehydrated}return null}function f(n){if(n.tag===31){var o=n.memoizedState;if(o===null&&(n=n.alternate,n!==null&&(o=n.memoizedState)),o!==null)return o.dehydrated}return null}function h(n){if(s(n)!==n)throw Error(i(188))}function d(n){var o=n.alternate;if(!o){if(o=s(n),o===null)throw Error(i(188));return o!==n?null:n}for(var a=n,u=o;;){var y=a.return;if(y===null)break;var v=y.alternate;if(v===null){if(u=y.return,u!==null){a=u;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===a)return h(y),n;if(v===u)return h(y),o;v=v.sibling}throw Error(i(188))}if(a.return!==u.return)a=y,u=v;else{for(var T=!1,I=y.child;I;){if(I===a){T=!0,a=y,u=v;break}if(I===u){T=!0,u=y,a=v;break}I=I.sibling}if(!T){for(I=v.child;I;){if(I===a){T=!0,a=v,u=y;break}if(I===u){T=!0,u=v,a=y;break}I=I.sibling}if(!T)throw Error(i(189))}}if(a.alternate!==u)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?n:o}function m(n){var o=n.tag;if(o===5||o===26||o===27||o===6)return n;for(n=n.child;n!==null;){if(o=m(n),o!==null)return o;n=n.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function Y(n){return n===null||typeof n!="object"?null:(n=q&&n[q]||n["@@iterator"],typeof n=="function"?n:null)}var F=Symbol.for("react.client.reference");function O(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===F?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case N:return"Profiler";case _:return"StrictMode";case z:return"Suspense";case j:return"SuspenseList";case H:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case E:return"Portal";case C:return n.displayName||"Context";case k:return(n._context.displayName||"Context")+".Consumer";case A:var o=n.render;return n=n.displayName,n||(n=o.displayName||o.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return o=n.displayName||null,o!==null?o:O(n.type)||"Memo";case P:o=n._payload,n=n._init;try{return O(n(o))}catch{}}return null}var U=Array.isArray,R=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},W=[],M=-1;function B(n){return{current:n}}function G(n){0>M||(n.current=W[M],W[M]=null,M--)}function D(n,o){M++,W[M]=n.current,n.current=o}var oe=B(null),K=B(null),J=B(null),te=B(null);function ne(n,o){switch(D(J,o),D(K,n),D(oe,null),o.nodeType){case 9:case 11:n=(n=o.documentElement)&&(n=n.namespaceURI)?Pv(n):0;break;default:if(n=o.tagName,o=o.namespaceURI)o=Pv(o),n=Uv(o,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(oe),D(oe,n)}function se(){G(oe),G(K),G(J)}function he(n){n.memoizedState!==null&&D(te,n);var o=oe.current,a=Uv(o,n.type);o!==a&&(D(K,n),D(oe,a))}function me(n){K.current===n&&(G(oe),G(K)),te.current===n&&(G(te),ts._currentValue=$)}var ge,xe;function _e(n){if(ge===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);ge=o&&o[1]||"",xe=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ge+n+xe}var $e=!1;function Pe(n,o){if(!n||$e)return"";$e=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(o){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var le=ae}Reflect.construct(n,[],de)}else{try{de.call()}catch(ae){le=ae}n.call(de.prototype)}}else{try{throw Error()}catch(ae){le=ae}(de=n())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&le&&typeof ae.stack=="string")return[ae.stack,le.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),T=v[0],I=v[1];if(T&&I){var Z=T.split(`
4
+ `),ie=I.split(`
5
+ `);for(y=u=0;u<Z.length&&!Z[u].includes("DetermineComponentFrameRoot");)u++;for(;y<ie.length&&!ie[y].includes("DetermineComponentFrameRoot");)y++;if(u===Z.length||y===ie.length)for(u=Z.length-1,y=ie.length-1;1<=u&&0<=y&&Z[u]!==ie[y];)y--;for(;1<=u&&0<=y;u--,y--)if(Z[u]!==ie[y]){if(u!==1||y!==1)do if(u--,y--,0>y||Z[u]!==ie[y]){var ue=`
6
+ `+Z[u].replace(" at new "," at ");return n.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",n.displayName)),ue}while(1<=u&&0<=y);break}}}finally{$e=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?_e(a):""}function st(n,o){switch(n.tag){case 26:case 27:case 5:return _e(n.type);case 16:return _e("Lazy");case 13:return n.child!==o&&o!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return Pe(n.type,!1);case 11:return Pe(n.type.render,!1);case 1:return Pe(n.type,!0);case 31:return _e("Activity");default:return""}}function fn(n){try{var o="",a=null;do o+=st(n,a),a=n,n=n.return;while(n);return o}catch(u){return`
7
+ Error generating stack: `+u.message+`
8
+ `+u.stack}}var Vt=Object.prototype.hasOwnProperty,Kt=e.unstable_scheduleCallback,Vn=e.unstable_cancelCallback,jr=e.unstable_shouldYield,Mr=e.unstable_requestPaint,Rt=e.unstable_now,mo=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,Le=e.unstable_LowPriority,qe=e.unstable_IdlePriority,Xt=e.log,$n=e.unstable_setDisableYieldValue,Lt=null,vt=null;function $t(n){if(typeof Xt=="function"&&$n(n),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(Lt,n)}catch{}}var Qe=Math.clz32?Math.clz32:xd,ar=Math.log,dn=Math.LN2;function xd(n){return n>>>=0,n===0?32:31-(ar(n)/dn|0)|0}var Yi=256,qi=262144,Fi=4194304;function Or(n){var o=n&42;if(o!==0)return o;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Xi(n,o,a){var u=n.pendingLanes;if(u===0)return 0;var y=0,v=n.suspendedLanes,T=n.pingedLanes;n=n.warmLanes;var I=u&134217727;return I!==0?(u=I&~v,u!==0?y=Or(u):(T&=I,T!==0?y=Or(T):a||(a=I&~n,a!==0&&(y=Or(a))))):(I=u&~v,I!==0?y=Or(I):T!==0?y=Or(T):a||(a=u&~n,a!==0&&(y=Or(a)))),y===0?0:o!==0&&o!==y&&(o&v)===0&&(v=y&-y,a=o&-o,v>=a||v===32&&(a&4194048)!==0)?o:y}function ii(n,o){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&o)===0}function vd(n,o){switch(n){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rc(){var n=Fi;return Fi<<=1,(Fi&62914560)===0&&(Fi=4194304),n}function da(n){for(var o=[],a=0;31>a;a++)o.push(n);return o}function li(n,o){n.pendingLanes|=o,o!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function bd(n,o,a,u,y,v){var T=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var I=n.entanglements,Z=n.expirationTimes,ie=n.hiddenUpdates;for(a=T&~a;0<a;){var ue=31-Qe(a),de=1<<ue;I[ue]=0,Z[ue]=-1;var le=ie[ue];if(le!==null)for(ie[ue]=null,ue=0;ue<le.length;ue++){var ae=le[ue];ae!==null&&(ae.lane&=-536870913)}a&=~de}u!==0&&oc(n,u,0),v!==0&&y===0&&n.tag!==0&&(n.suspendedLanes|=v&~(T&~o))}function oc(n,o,a){n.pendingLanes|=o,n.suspendedLanes&=~o;var u=31-Qe(o);n.entangledLanes|=o,n.entanglements[u]=n.entanglements[u]|1073741824|a&261930}function ic(n,o){var a=n.entangledLanes|=o;for(n=n.entanglements;a;){var u=31-Qe(a),y=1<<u;y&o|n[u]&o&&(n[u]|=o),a&=~y}}function lc(n,o){var a=o&-o;return a=(a&42)!==0?1:ha(a),(a&(n.suspendedLanes|o))!==0?0:a}function ha(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ma(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function ac(){var n=V.p;return n!==0?n:(n=window.event,n===void 0?32:ub(n.type))}function sc(n,o){var a=V.p;try{return V.p=n,o()}finally{V.p=a}}var sr=Math.random().toString(36).slice(2),jt="__reactFiber$"+sr,Yt="__reactProps$"+sr,Dr="__reactContainer$"+sr,Gi="__reactEvents$"+sr,cc="__reactListeners$"+sr,wd="__reactHandles$"+sr,uc="__reactResources$"+sr,ai="__reactMarker$"+sr;function pa(n){delete n[jt],delete n[Yt],delete n[Gi],delete n[cc],delete n[wd]}function po(n){var o=n[jt];if(o)return o;for(var a=n.parentNode;a;){if(o=a[Dr]||a[jt]){if(a=o.alternate,o.child!==null||a!==null&&a.child!==null)for(n=Gv(n);n!==null;){if(a=n[jt])return a;n=Gv(n)}return o}n=a,a=n.parentNode}return null}function go(n){if(n=n[jt]||n[Dr]){var o=n.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return n}return null}function yo(n){var o=n.tag;if(o===5||o===26||o===27||o===6)return n.stateNode;throw Error(i(33))}function xo(n){var o=n[uc];return o||(o=n[uc]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Et(n){n[ai]=!0}var fc=new Set,dc={};function zr(n,o){vo(n,o),vo(n+"Capture",o)}function vo(n,o){for(dc[n]=o,n=0;n<o.length;n++)fc.add(o[n])}var Sd=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ga={},hc={};function Ed(n){return Vt.call(hc,n)?!0:Vt.call(ga,n)?!1:Sd.test(n)?hc[n]=!0:(ga[n]=!0,!1)}function Wi(n,o,a){if(Ed(o))if(a===null)n.removeAttribute(o);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(o);return}}n.setAttribute(o,""+a)}}function Zi(n,o,a){if(a===null)n.removeAttribute(o);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttribute(o,""+a)}}function Yn(n,o,a,u){if(u===null)n.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(o,a,""+u)}}function Qt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function mc(n){var o=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Cd(n,o,a){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,o);if(!n.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,v=u.set;return Object.defineProperty(n,o,{configurable:!0,get:function(){return y.call(this)},set:function(T){a=""+T,v.call(this,T)}}),Object.defineProperty(n,o,{enumerable:u.enumerable}),{getValue:function(){return a},setValue:function(T){a=""+T},stopTracking:function(){n._valueTracker=null,delete n[o]}}}}function Ki(n){if(!n._valueTracker){var o=mc(n)?"checked":"value";n._valueTracker=Cd(n,o,""+n[o])}}function pc(n){if(!n)return!1;var o=n._valueTracker;if(!o)return!0;var a=o.getValue(),u="";return n&&(u=mc(n)?n.checked?"true":"false":n.value),n=u,n!==a?(o.setValue(n),!0):!1}function si(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Nd=/[\n"\\]/g;function Jt(n){return n.replace(Nd,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function ci(n,o,a,u,y,v,T,I){n.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.type=T:n.removeAttribute("type"),o!=null?T==="number"?(o===0&&n.value===""||n.value!=o)&&(n.value=""+Qt(o)):n.value!==""+Qt(o)&&(n.value=""+Qt(o)):T!=="submit"&&T!=="reset"||n.removeAttribute("value"),o!=null?ya(n,T,Qt(o)):a!=null?ya(n,T,Qt(a)):u!=null&&n.removeAttribute("value"),y==null&&v!=null&&(n.defaultChecked=!!v),y!=null&&(n.checked=y&&typeof y!="function"&&typeof y!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?n.name=""+Qt(I):n.removeAttribute("name")}function gc(n,o,a,u,y,v,T,I){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.type=v),o!=null||a!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Ki(n);return}a=a!=null?""+Qt(a):"",o=o!=null?""+Qt(o):a,I||o===n.value||(n.value=o),n.defaultValue=o}u=u??y,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=I?n.checked:!!u,n.defaultChecked=!!u,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(n.name=T),Ki(n)}function ya(n,o,a){o==="number"&&si(n.ownerDocument)===n||n.defaultValue===""+a||(n.defaultValue=""+a)}function Lr(n,o,a,u){if(n=n.options,o){o={};for(var y=0;y<a.length;y++)o["$"+a[y]]=!0;for(a=0;a<n.length;a++)y=o.hasOwnProperty("$"+n[a].value),n[a].selected!==y&&(n[a].selected=y),y&&u&&(n[a].defaultSelected=!0)}else{for(a=""+Qt(a),o=null,y=0;y<n.length;y++){if(n[y].value===a){n[y].selected=!0,u&&(n[y].defaultSelected=!0);return}o!==null||n[y].disabled||(o=n[y])}o!==null&&(o.selected=!0)}}function zy(n,o,a){if(o!=null&&(o=""+Qt(o),o!==n.value&&(n.value=o),a==null)){n.defaultValue!==o&&(n.defaultValue=o);return}n.defaultValue=a!=null?""+Qt(a):""}function Ly(n,o,a,u){if(o==null){if(u!=null){if(a!=null)throw Error(i(92));if(U(u)){if(1<u.length)throw Error(i(93));u=u[0]}a=u}a==null&&(a=""),o=a}a=Qt(o),n.defaultValue=a,u=n.textContent,u===a&&u!==""&&u!==null&&(n.value=u),Ki(n)}function Qi(n,o){if(o){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=o;return}}n.textContent=o}var lk=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Iy(n,o,a){var u=o.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?n.setProperty(o,""):o==="float"?n.cssFloat="":n[o]="":u?n.setProperty(o,a):typeof a!="number"||a===0||lk.has(o)?o==="float"?n.cssFloat=a:n[o]=(""+a).trim():n[o]=a+"px"}function By(n,o,a){if(o!=null&&typeof o!="object")throw Error(i(62));if(n=n.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var y in o)u=o[y],o.hasOwnProperty(y)&&a[y]!==u&&Iy(n,y,u)}else for(var v in o)o.hasOwnProperty(v)&&Iy(n,v,o[v])}function _d(n){if(n.indexOf("-")===-1)return!1;switch(n){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 ak=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),sk=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function yc(n){return sk.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Ir(){}var kd=null;function Td(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ji=null,el=null;function Hy(n){var o=go(n);if(o&&(n=o.stateNode)){var a=n[Yt]||null;e:switch(n=o.stateNode,o.type){case"input":if(ci(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),o=a.name,a.type==="radio"&&o!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Jt(""+o)+'"][type="radio"]'),o=0;o<a.length;o++){var u=a[o];if(u!==n&&u.form===n.form){var y=u[Yt]||null;if(!y)throw Error(i(90));ci(u,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(o=0;o<a.length;o++)u=a[o],u.form===n.form&&pc(u)}break e;case"textarea":zy(n,a.value,a.defaultValue);break e;case"select":o=a.value,o!=null&&Lr(n,!!a.multiple,o,!1)}}}var Ad=!1;function Py(n,o,a){if(Ad)return n(o,a);Ad=!0;try{var u=n(o);return u}finally{if(Ad=!1,(Ji!==null||el!==null)&&(ou(),Ji&&(o=Ji,n=el,el=Ji=null,Hy(o),n)))for(o=0;o<n.length;o++)Hy(n[o])}}function xa(n,o){var a=n.stateNode;if(a===null)return null;var u=a[Yt]||null;if(u===null)return null;a=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(i(231,o,typeof a));return a}var Br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rd=!1;if(Br)try{var va={};Object.defineProperty(va,"passive",{get:function(){Rd=!0}}),window.addEventListener("test",va,va),window.removeEventListener("test",va,va)}catch{Rd=!1}var bo=null,jd=null,xc=null;function Uy(){if(xc)return xc;var n,o=jd,a=o.length,u,y="value"in bo?bo.value:bo.textContent,v=y.length;for(n=0;n<a&&o[n]===y[n];n++);var T=a-n;for(u=1;u<=T&&o[a-u]===y[v-u];u++);return xc=y.slice(n,1<u?1-u:void 0)}function vc(n){var o=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&o===13&&(n=13)):n=o,n===10&&(n=13),32<=n||n===13?n:0}function bc(){return!0}function Vy(){return!1}function en(n){function o(a,u,y,v,T){this._reactName=a,this._targetInst=y,this.type=u,this.nativeEvent=v,this.target=T,this.currentTarget=null;for(var I in n)n.hasOwnProperty(I)&&(a=n[I],this[I]=a?a(v):v[I]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?bc:Vy,this.isPropagationStopped=Vy,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=bc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=bc)},persist:function(){},isPersistent:bc}),o}var ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wc=en(ui),ba=g({},ui,{view:0,detail:0}),ck=en(ba),Md,Od,wa,Sc=g({},ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==wa&&(wa&&n.type==="mousemove"?(Md=n.screenX-wa.screenX,Od=n.screenY-wa.screenY):Od=Md=0,wa=n),Md)},movementY:function(n){return"movementY"in n?n.movementY:Od}}),$y=en(Sc),uk=g({},Sc,{dataTransfer:0}),fk=en(uk),dk=g({},ba,{relatedTarget:0}),Dd=en(dk),hk=g({},ui,{animationName:0,elapsedTime:0,pseudoElement:0}),mk=en(hk),pk=g({},ui,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),gk=en(pk),yk=g({},ui,{data:0}),Yy=en(yk),xk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vk={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"},bk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wk(n){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(n):(n=bk[n])?!!o[n]:!1}function zd(){return wk}var Sk=g({},ba,{key:function(n){if(n.key){var o=xk[n.key]||n.key;if(o!=="Unidentified")return o}return n.type==="keypress"?(n=vc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?vk[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(n){return n.type==="keypress"?vc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?vc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Ek=en(Sk),Ck=g({},Sc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qy=en(Ck),Nk=g({},ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),_k=en(Nk),kk=g({},ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tk=en(kk),Ak=g({},Sc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Rk=en(Ak),jk=g({},ui,{newState:0,oldState:0}),Mk=en(jk),Ok=[9,13,27,32],Ld=Br&&"CompositionEvent"in window,Sa=null;Br&&"documentMode"in document&&(Sa=document.documentMode);var Dk=Br&&"TextEvent"in window&&!Sa,Fy=Br&&(!Ld||Sa&&8<Sa&&11>=Sa),Xy=" ",Gy=!1;function Wy(n,o){switch(n){case"keyup":return Ok.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zy(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var tl=!1;function zk(n,o){switch(n){case"compositionend":return Zy(o);case"keypress":return o.which!==32?null:(Gy=!0,Xy);case"textInput":return n=o.data,n===Xy&&Gy?null:n;default:return null}}function Lk(n,o){if(tl)return n==="compositionend"||!Ld&&Wy(n,o)?(n=Uy(),xc=jd=bo=null,tl=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Fy&&o.locale!=="ko"?null:o.data;default:return null}}var Ik={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 Ky(n){var o=n&&n.nodeName&&n.nodeName.toLowerCase();return o==="input"?!!Ik[n.type]:o==="textarea"}function Qy(n,o,a,u){Ji?el?el.push(u):el=[u]:Ji=u,o=fu(o,"onChange"),0<o.length&&(a=new wc("onChange","change",null,a,u),n.push({event:a,listeners:o}))}var Ea=null,Ca=null;function Bk(n){Dv(n,0)}function Ec(n){var o=yo(n);if(pc(o))return n}function Jy(n,o){if(n==="change")return o}var ex=!1;if(Br){var Id;if(Br){var Bd="oninput"in document;if(!Bd){var tx=document.createElement("div");tx.setAttribute("oninput","return;"),Bd=typeof tx.oninput=="function"}Id=Bd}else Id=!1;ex=Id&&(!document.documentMode||9<document.documentMode)}function nx(){Ea&&(Ea.detachEvent("onpropertychange",rx),Ca=Ea=null)}function rx(n){if(n.propertyName==="value"&&Ec(Ca)){var o=[];Qy(o,Ca,n,Td(n)),Py(Bk,o)}}function Hk(n,o,a){n==="focusin"?(nx(),Ea=o,Ca=a,Ea.attachEvent("onpropertychange",rx)):n==="focusout"&&nx()}function Pk(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ec(Ca)}function Uk(n,o){if(n==="click")return Ec(o)}function Vk(n,o){if(n==="input"||n==="change")return Ec(o)}function $k(n,o){return n===o&&(n!==0||1/n===1/o)||n!==n&&o!==o}var hn=typeof Object.is=="function"?Object.is:$k;function Na(n,o){if(hn(n,o))return!0;if(typeof n!="object"||n===null||typeof o!="object"||o===null)return!1;var a=Object.keys(n),u=Object.keys(o);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var y=a[u];if(!Vt.call(o,y)||!hn(n[y],o[y]))return!1}return!0}function ox(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function ix(n,o){var a=ox(n);n=0;for(var u;a;){if(a.nodeType===3){if(u=n+a.textContent.length,n<=o&&u>=o)return{node:a,offset:o-n};n=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ox(a)}}function lx(n,o){return n&&o?n===o?!0:n&&n.nodeType===3?!1:o&&o.nodeType===3?lx(n,o.parentNode):"contains"in n?n.contains(o):n.compareDocumentPosition?!!(n.compareDocumentPosition(o)&16):!1:!1}function ax(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var o=si(n.document);o instanceof n.HTMLIFrameElement;){try{var a=typeof o.contentWindow.location.href=="string"}catch{a=!1}if(a)n=o.contentWindow;else break;o=si(n.document)}return o}function Hd(n){var o=n&&n.nodeName&&n.nodeName.toLowerCase();return o&&(o==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||o==="textarea"||n.contentEditable==="true")}var Yk=Br&&"documentMode"in document&&11>=document.documentMode,nl=null,Pd=null,_a=null,Ud=!1;function sx(n,o,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ud||nl==null||nl!==si(u)||(u=nl,"selectionStart"in u&&Hd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),_a&&Na(_a,u)||(_a=u,u=fu(Pd,"onSelect"),0<u.length&&(o=new wc("onSelect","select",null,o,a),n.push({event:o,listeners:u}),o.target=nl)))}function fi(n,o){var a={};return a[n.toLowerCase()]=o.toLowerCase(),a["Webkit"+n]="webkit"+o,a["Moz"+n]="moz"+o,a}var rl={animationend:fi("Animation","AnimationEnd"),animationiteration:fi("Animation","AnimationIteration"),animationstart:fi("Animation","AnimationStart"),transitionrun:fi("Transition","TransitionRun"),transitionstart:fi("Transition","TransitionStart"),transitioncancel:fi("Transition","TransitionCancel"),transitionend:fi("Transition","TransitionEnd")},Vd={},cx={};Br&&(cx=document.createElement("div").style,"AnimationEvent"in window||(delete rl.animationend.animation,delete rl.animationiteration.animation,delete rl.animationstart.animation),"TransitionEvent"in window||delete rl.transitionend.transition);function di(n){if(Vd[n])return Vd[n];if(!rl[n])return n;var o=rl[n],a;for(a in o)if(o.hasOwnProperty(a)&&a in cx)return Vd[n]=o[a];return n}var ux=di("animationend"),fx=di("animationiteration"),dx=di("animationstart"),qk=di("transitionrun"),Fk=di("transitionstart"),Xk=di("transitioncancel"),hx=di("transitionend"),mx=new Map,$d="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$d.push("scrollEnd");function qn(n,o){mx.set(n,o),zr(o,[n])}var Cc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Rn=[],ol=0,Yd=0;function Nc(){for(var n=ol,o=Yd=ol=0;o<n;){var a=Rn[o];Rn[o++]=null;var u=Rn[o];Rn[o++]=null;var y=Rn[o];Rn[o++]=null;var v=Rn[o];if(Rn[o++]=null,u!==null&&y!==null){var T=u.pending;T===null?y.next=y:(y.next=T.next,T.next=y),u.pending=y}v!==0&&px(a,y,v)}}function _c(n,o,a,u){Rn[ol++]=n,Rn[ol++]=o,Rn[ol++]=a,Rn[ol++]=u,Yd|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function qd(n,o,a,u){return _c(n,o,a,u),kc(n)}function hi(n,o){return _c(n,null,null,o),kc(n)}function px(n,o,a){n.lanes|=a;var u=n.alternate;u!==null&&(u.lanes|=a);for(var y=!1,v=n.return;v!==null;)v.childLanes|=a,u=v.alternate,u!==null&&(u.childLanes|=a),v.tag===22&&(n=v.stateNode,n===null||n._visibility&1||(y=!0)),n=v,v=v.return;return n.tag===3?(v=n.stateNode,y&&o!==null&&(y=31-Qe(a),n=v.hiddenUpdates,u=n[y],u===null?n[y]=[o]:u.push(o),o.lane=a|536870912),v):null}function kc(n){if(50<Ga)throw Ga=0,em=null,Error(i(185));for(var o=n.return;o!==null;)n=o,o=n.return;return n.tag===3?n.stateNode:null}var il={};function Gk(n,o,a,u){this.tag=n,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(n,o,a,u){return new Gk(n,o,a,u)}function Fd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Hr(n,o){var a=n.alternate;return a===null?(a=mn(n.tag,o,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=o,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&65011712,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,o=n.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function gx(n,o){n.flags&=65011714;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=o,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,o=a.dependencies,n.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),n}function Tc(n,o,a,u,y,v){var T=0;if(u=n,typeof n=="function")Fd(n)&&(T=1);else if(typeof n=="string")T=JT(n,a,oe.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case H:return n=mn(31,a,o,y),n.elementType=H,n.lanes=v,n;case S:return mi(a.children,y,v,o);case _:T=8,y|=24;break;case N:return n=mn(12,a,o,y|2),n.elementType=N,n.lanes=v,n;case z:return n=mn(13,a,o,y),n.elementType=z,n.lanes=v,n;case j:return n=mn(19,a,o,y),n.elementType=j,n.lanes=v,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case C:T=10;break e;case k:T=9;break e;case A:T=11;break e;case L:T=14;break e;case P:T=16,u=null;break e}T=29,a=Error(i(130,n===null?"null":typeof n,"")),u=null}return o=mn(T,a,o,y),o.elementType=n,o.type=u,o.lanes=v,o}function mi(n,o,a,u){return n=mn(7,n,u,o),n.lanes=a,n}function Xd(n,o,a){return n=mn(6,n,null,o),n.lanes=a,n}function yx(n){var o=mn(18,null,null,0);return o.stateNode=n,o}function Gd(n,o,a){return o=mn(4,n.children!==null?n.children:[],n.key,o),o.lanes=a,o.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},o}var xx=new WeakMap;function jn(n,o){if(typeof n=="object"&&n!==null){var a=xx.get(n);return a!==void 0?a:(o={value:n,source:o,stack:fn(o)},xx.set(n,o),o)}return{value:n,source:o,stack:fn(o)}}var ll=[],al=0,Ac=null,ka=0,Mn=[],On=0,wo=null,cr=1,ur="";function Pr(n,o){ll[al++]=ka,ll[al++]=Ac,Ac=n,ka=o}function vx(n,o,a){Mn[On++]=cr,Mn[On++]=ur,Mn[On++]=wo,wo=n;var u=cr;n=ur;var y=32-Qe(u)-1;u&=~(1<<y),a+=1;var v=32-Qe(o)+y;if(30<v){var T=y-y%5;v=(u&(1<<T)-1).toString(32),u>>=T,y-=T,cr=1<<32-Qe(o)+y|a<<y|u,ur=v+n}else cr=1<<v|a<<y|u,ur=n}function Wd(n){n.return!==null&&(Pr(n,1),vx(n,1,0))}function Zd(n){for(;n===Ac;)Ac=ll[--al],ll[al]=null,ka=ll[--al],ll[al]=null;for(;n===wo;)wo=Mn[--On],Mn[On]=null,ur=Mn[--On],Mn[On]=null,cr=Mn[--On],Mn[On]=null}function bx(n,o){Mn[On++]=cr,Mn[On++]=ur,Mn[On++]=wo,cr=o.id,ur=o.overflow,wo=n}var It=null,ct=null,Ye=!1,So=null,Dn=!1,Kd=Error(i(519));function Eo(n){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ta(jn(o,n)),Kd}function wx(n){var o=n.stateNode,a=n.type,u=n.memoizedProps;switch(o[jt]=n,o[Yt]=u,a){case"dialog":He("cancel",o),He("close",o);break;case"iframe":case"object":case"embed":He("load",o);break;case"video":case"audio":for(a=0;a<Za.length;a++)He(Za[a],o);break;case"source":He("error",o);break;case"img":case"image":case"link":He("error",o),He("load",o);break;case"details":He("toggle",o);break;case"input":He("invalid",o),gc(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":He("invalid",o);break;case"textarea":He("invalid",o),Ly(o,u.value,u.defaultValue,u.children)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||o.textContent===""+a||u.suppressHydrationWarning===!0||Bv(o.textContent,a)?(u.popover!=null&&(He("beforetoggle",o),He("toggle",o)),u.onScroll!=null&&He("scroll",o),u.onScrollEnd!=null&&He("scrollend",o),u.onClick!=null&&(o.onclick=Ir),o=!0):o=!1,o||Eo(n,!0)}function Sx(n){for(It=n.return;It;)switch(It.tag){case 5:case 31:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:It=It.return}}function sl(n){if(n!==It)return!1;if(!Ye)return Sx(n),Ye=!0,!1;var o=n.tag,a;if((a=o!==3&&o!==27)&&((a=o===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||pm(n.type,n.memoizedProps)),a=!a),a&&ct&&Eo(n),Sx(n),o===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));ct=Xv(n)}else if(o===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));ct=Xv(n)}else o===27?(o=ct,Io(n.type)?(n=bm,bm=null,ct=n):ct=o):ct=It?Ln(n.stateNode.nextSibling):null;return!0}function pi(){ct=It=null,Ye=!1}function Qd(){var n=So;return n!==null&&(on===null?on=n:on.push.apply(on,n),So=null),n}function Ta(n){So===null?So=[n]:So.push(n)}var Jd=B(null),gi=null,Ur=null;function Co(n,o,a){D(Jd,o._currentValue),o._currentValue=a}function Vr(n){n._currentValue=Jd.current,G(Jd)}function eh(n,o,a){for(;n!==null;){var u=n.alternate;if((n.childLanes&o)!==o?(n.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),n===a)break;n=n.return}}function th(n,o,a,u){var y=n.child;for(y!==null&&(y.return=n);y!==null;){var v=y.dependencies;if(v!==null){var T=y.child;v=v.firstContext;e:for(;v!==null;){var I=v;v=y;for(var Z=0;Z<o.length;Z++)if(I.context===o[Z]){v.lanes|=a,I=v.alternate,I!==null&&(I.lanes|=a),eh(v.return,a,n),u||(T=null);break e}v=I.next}}else if(y.tag===18){if(T=y.return,T===null)throw Error(i(341));T.lanes|=a,v=T.alternate,v!==null&&(v.lanes|=a),eh(T,a,n),T=null}else T=y.child;if(T!==null)T.return=y;else for(T=y;T!==null;){if(T===n){T=null;break}if(y=T.sibling,y!==null){y.return=T.return,T=y;break}T=T.return}y=T}}function cl(n,o,a,u){n=null;for(var y=o,v=!1;y!==null;){if(!v){if((y.flags&524288)!==0)v=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var T=y.alternate;if(T===null)throw Error(i(387));if(T=T.memoizedProps,T!==null){var I=y.type;hn(y.pendingProps.value,T.value)||(n!==null?n.push(I):n=[I])}}else if(y===te.current){if(T=y.alternate,T===null)throw Error(i(387));T.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(n!==null?n.push(ts):n=[ts])}y=y.return}n!==null&&th(o,n,a,u),o.flags|=262144}function Rc(n){for(n=n.firstContext;n!==null;){if(!hn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function yi(n){gi=n,Ur=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Bt(n){return Ex(gi,n)}function jc(n,o){return gi===null&&yi(n),Ex(n,o)}function Ex(n,o){var a=o._currentValue;if(o={context:o,memoizedValue:a,next:null},Ur===null){if(n===null)throw Error(i(308));Ur=o,n.dependencies={lanes:0,firstContext:o},n.flags|=524288}else Ur=Ur.next=o;return a}var Wk=typeof AbortController<"u"?AbortController:function(){var n=[],o=this.signal={aborted:!1,addEventListener:function(a,u){n.push(u)}};this.abort=function(){o.aborted=!0,n.forEach(function(a){return a()})}},Zk=e.unstable_scheduleCallback,Kk=e.unstable_NormalPriority,Ct={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nh(){return{controller:new Wk,data:new Map,refCount:0}}function Aa(n){n.refCount--,n.refCount===0&&Zk(Kk,function(){n.controller.abort()})}var Ra=null,rh=0,ul=0,fl=null;function Qk(n,o){if(Ra===null){var a=Ra=[];rh=0,ul=lm(),fl={status:"pending",value:void 0,then:function(u){a.push(u)}}}return rh++,o.then(Cx,Cx),o}function Cx(){if(--rh===0&&Ra!==null){fl!==null&&(fl.status="fulfilled");var n=Ra;Ra=null,ul=0,fl=null;for(var o=0;o<n.length;o++)(0,n[o])()}}function Jk(n,o){var a=[],u={status:"pending",value:null,reason:null,then:function(y){a.push(y)}};return n.then(function(){u.status="fulfilled",u.value=o;for(var y=0;y<a.length;y++)(0,a[y])(o)},function(y){for(u.status="rejected",u.reason=y,y=0;y<a.length;y++)(0,a[y])(void 0)}),u}var Nx=R.S;R.S=function(n,o){sv=Rt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&Qk(n,o),Nx!==null&&Nx(n,o)};var xi=B(null);function oh(){var n=xi.current;return n!==null?n:ot.pooledCache}function Mc(n,o){o===null?D(xi,xi.current):D(xi,o.pool)}function _x(){var n=oh();return n===null?null:{parent:Ct._currentValue,pool:n}}var dl=Error(i(460)),ih=Error(i(474)),Oc=Error(i(542)),Dc={then:function(){}};function kx(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Tx(n,o,a){switch(a=n[a],a===void 0?n.push(o):a!==o&&(o.then(Ir,Ir),o=a),o.status){case"fulfilled":return o.value;case"rejected":throw n=o.reason,Rx(n),n;default:if(typeof o.status=="string")o.then(Ir,Ir);else{if(n=ot,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=o,n.status="pending",n.then(function(u){if(o.status==="pending"){var y=o;y.status="fulfilled",y.value=u}},function(u){if(o.status==="pending"){var y=o;y.status="rejected",y.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw n=o.reason,Rx(n),n}throw bi=o,dl}}function vi(n){try{var o=n._init;return o(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(bi=a,dl):a}}var bi=null;function Ax(){if(bi===null)throw Error(i(459));var n=bi;return bi=null,n}function Rx(n){if(n===dl||n===Oc)throw Error(i(483))}var hl=null,ja=0;function zc(n){var o=ja;return ja+=1,hl===null&&(hl=[]),Tx(hl,n,o)}function Ma(n,o){o=o.props.ref,n.ref=o!==void 0?o:null}function Lc(n,o){throw o.$$typeof===x?Error(i(525)):(n=Object.prototype.toString.call(o),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":n)))}function jx(n){function o(ee,Q){if(n){var re=ee.deletions;re===null?(ee.deletions=[Q],ee.flags|=16):re.push(Q)}}function a(ee,Q){if(!n)return null;for(;Q!==null;)o(ee,Q),Q=Q.sibling;return null}function u(ee){for(var Q=new Map;ee!==null;)ee.key!==null?Q.set(ee.key,ee):Q.set(ee.index,ee),ee=ee.sibling;return Q}function y(ee,Q){return ee=Hr(ee,Q),ee.index=0,ee.sibling=null,ee}function v(ee,Q,re){return ee.index=re,n?(re=ee.alternate,re!==null?(re=re.index,re<Q?(ee.flags|=67108866,Q):re):(ee.flags|=67108866,Q)):(ee.flags|=1048576,Q)}function T(ee){return n&&ee.alternate===null&&(ee.flags|=67108866),ee}function I(ee,Q,re,fe){return Q===null||Q.tag!==6?(Q=Xd(re,ee.mode,fe),Q.return=ee,Q):(Q=y(Q,re),Q.return=ee,Q)}function Z(ee,Q,re,fe){var Ne=re.type;return Ne===S?ue(ee,Q,re.props.children,fe,re.key):Q!==null&&(Q.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===P&&vi(Ne)===Q.type)?(Q=y(Q,re.props),Ma(Q,re),Q.return=ee,Q):(Q=Tc(re.type,re.key,re.props,null,ee.mode,fe),Ma(Q,re),Q.return=ee,Q)}function ie(ee,Q,re,fe){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==re.containerInfo||Q.stateNode.implementation!==re.implementation?(Q=Gd(re,ee.mode,fe),Q.return=ee,Q):(Q=y(Q,re.children||[]),Q.return=ee,Q)}function ue(ee,Q,re,fe,Ne){return Q===null||Q.tag!==7?(Q=mi(re,ee.mode,fe,Ne),Q.return=ee,Q):(Q=y(Q,re),Q.return=ee,Q)}function de(ee,Q,re){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Xd(""+Q,ee.mode,re),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return re=Tc(Q.type,Q.key,Q.props,null,ee.mode,re),Ma(re,Q),re.return=ee,re;case E:return Q=Gd(Q,ee.mode,re),Q.return=ee,Q;case P:return Q=vi(Q),de(ee,Q,re)}if(U(Q)||Y(Q))return Q=mi(Q,ee.mode,re,null),Q.return=ee,Q;if(typeof Q.then=="function")return de(ee,zc(Q),re);if(Q.$$typeof===C)return de(ee,jc(ee,Q),re);Lc(ee,Q)}return null}function le(ee,Q,re,fe){var Ne=Q!==null?Q.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ne!==null?null:I(ee,Q,""+re,fe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===Ne?Z(ee,Q,re,fe):null;case E:return re.key===Ne?ie(ee,Q,re,fe):null;case P:return re=vi(re),le(ee,Q,re,fe)}if(U(re)||Y(re))return Ne!==null?null:ue(ee,Q,re,fe,null);if(typeof re.then=="function")return le(ee,Q,zc(re),fe);if(re.$$typeof===C)return le(ee,Q,jc(ee,re),fe);Lc(ee,re)}return null}function ae(ee,Q,re,fe,Ne){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return ee=ee.get(re)||null,I(Q,ee,""+fe,Ne);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case b:return ee=ee.get(fe.key===null?re:fe.key)||null,Z(Q,ee,fe,Ne);case E:return ee=ee.get(fe.key===null?re:fe.key)||null,ie(Q,ee,fe,Ne);case P:return fe=vi(fe),ae(ee,Q,re,fe,Ne)}if(U(fe)||Y(fe))return ee=ee.get(re)||null,ue(Q,ee,fe,Ne,null);if(typeof fe.then=="function")return ae(ee,Q,re,zc(fe),Ne);if(fe.$$typeof===C)return ae(ee,Q,re,jc(Q,fe),Ne);Lc(Q,fe)}return null}function be(ee,Q,re,fe){for(var Ne=null,Xe=null,Ee=Q,De=Q=0,Ve=null;Ee!==null&&De<re.length;De++){Ee.index>De?(Ve=Ee,Ee=null):Ve=Ee.sibling;var Ge=le(ee,Ee,re[De],fe);if(Ge===null){Ee===null&&(Ee=Ve);break}n&&Ee&&Ge.alternate===null&&o(ee,Ee),Q=v(Ge,Q,De),Xe===null?Ne=Ge:Xe.sibling=Ge,Xe=Ge,Ee=Ve}if(De===re.length)return a(ee,Ee),Ye&&Pr(ee,De),Ne;if(Ee===null){for(;De<re.length;De++)Ee=de(ee,re[De],fe),Ee!==null&&(Q=v(Ee,Q,De),Xe===null?Ne=Ee:Xe.sibling=Ee,Xe=Ee);return Ye&&Pr(ee,De),Ne}for(Ee=u(Ee);De<re.length;De++)Ve=ae(Ee,ee,De,re[De],fe),Ve!==null&&(n&&Ve.alternate!==null&&Ee.delete(Ve.key===null?De:Ve.key),Q=v(Ve,Q,De),Xe===null?Ne=Ve:Xe.sibling=Ve,Xe=Ve);return n&&Ee.forEach(function(Vo){return o(ee,Vo)}),Ye&&Pr(ee,De),Ne}function Te(ee,Q,re,fe){if(re==null)throw Error(i(151));for(var Ne=null,Xe=null,Ee=Q,De=Q=0,Ve=null,Ge=re.next();Ee!==null&&!Ge.done;De++,Ge=re.next()){Ee.index>De?(Ve=Ee,Ee=null):Ve=Ee.sibling;var Vo=le(ee,Ee,Ge.value,fe);if(Vo===null){Ee===null&&(Ee=Ve);break}n&&Ee&&Vo.alternate===null&&o(ee,Ee),Q=v(Vo,Q,De),Xe===null?Ne=Vo:Xe.sibling=Vo,Xe=Vo,Ee=Ve}if(Ge.done)return a(ee,Ee),Ye&&Pr(ee,De),Ne;if(Ee===null){for(;!Ge.done;De++,Ge=re.next())Ge=de(ee,Ge.value,fe),Ge!==null&&(Q=v(Ge,Q,De),Xe===null?Ne=Ge:Xe.sibling=Ge,Xe=Ge);return Ye&&Pr(ee,De),Ne}for(Ee=u(Ee);!Ge.done;De++,Ge=re.next())Ge=ae(Ee,ee,De,Ge.value,fe),Ge!==null&&(n&&Ge.alternate!==null&&Ee.delete(Ge.key===null?De:Ge.key),Q=v(Ge,Q,De),Xe===null?Ne=Ge:Xe.sibling=Ge,Xe=Ge);return n&&Ee.forEach(function(uA){return o(ee,uA)}),Ye&&Pr(ee,De),Ne}function rt(ee,Q,re,fe){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case b:e:{for(var Ne=re.key;Q!==null;){if(Q.key===Ne){if(Ne=re.type,Ne===S){if(Q.tag===7){a(ee,Q.sibling),fe=y(Q,re.props.children),fe.return=ee,ee=fe;break e}}else if(Q.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===P&&vi(Ne)===Q.type){a(ee,Q.sibling),fe=y(Q,re.props),Ma(fe,re),fe.return=ee,ee=fe;break e}a(ee,Q);break}else o(ee,Q);Q=Q.sibling}re.type===S?(fe=mi(re.props.children,ee.mode,fe,re.key),fe.return=ee,ee=fe):(fe=Tc(re.type,re.key,re.props,null,ee.mode,fe),Ma(fe,re),fe.return=ee,ee=fe)}return T(ee);case E:e:{for(Ne=re.key;Q!==null;){if(Q.key===Ne)if(Q.tag===4&&Q.stateNode.containerInfo===re.containerInfo&&Q.stateNode.implementation===re.implementation){a(ee,Q.sibling),fe=y(Q,re.children||[]),fe.return=ee,ee=fe;break e}else{a(ee,Q);break}else o(ee,Q);Q=Q.sibling}fe=Gd(re,ee.mode,fe),fe.return=ee,ee=fe}return T(ee);case P:return re=vi(re),rt(ee,Q,re,fe)}if(U(re))return be(ee,Q,re,fe);if(Y(re)){if(Ne=Y(re),typeof Ne!="function")throw Error(i(150));return re=Ne.call(re),Te(ee,Q,re,fe)}if(typeof re.then=="function")return rt(ee,Q,zc(re),fe);if(re.$$typeof===C)return rt(ee,Q,jc(ee,re),fe);Lc(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Q!==null&&Q.tag===6?(a(ee,Q.sibling),fe=y(Q,re),fe.return=ee,ee=fe):(a(ee,Q),fe=Xd(re,ee.mode,fe),fe.return=ee,ee=fe),T(ee)):a(ee,Q)}return function(ee,Q,re,fe){try{ja=0;var Ne=rt(ee,Q,re,fe);return hl=null,Ne}catch(Ee){if(Ee===dl||Ee===Oc)throw Ee;var Xe=mn(29,Ee,null,ee.mode);return Xe.lanes=fe,Xe.return=ee,Xe}}}var wi=jx(!0),Mx=jx(!1),No=!1;function lh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ah(n,o){n=n.updateQueue,o.updateQueue===n&&(o.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function _o(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ko(n,o,a){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Ze&2)!==0){var y=u.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),u.pending=o,o=kc(n),px(n,null,a),o}return _c(n,u,o,a),kc(n)}function Oa(n,o,a){if(o=o.updateQueue,o!==null&&(o=o.shared,(a&4194048)!==0)){var u=o.lanes;u&=n.pendingLanes,a|=u,o.lanes=a,ic(n,a)}}function sh(n,o){var a=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var y=null,v=null;if(a=a.firstBaseUpdate,a!==null){do{var T={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};v===null?y=v=T:v=v.next=T,a=a.next}while(a!==null);v===null?y=v=o:v=v.next=o}else y=v=o;a={baseState:u.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=o:n.next=o,a.lastBaseUpdate=o}var ch=!1;function Da(){if(ch){var n=fl;if(n!==null)throw n}}function za(n,o,a,u){ch=!1;var y=n.updateQueue;No=!1;var v=y.firstBaseUpdate,T=y.lastBaseUpdate,I=y.shared.pending;if(I!==null){y.shared.pending=null;var Z=I,ie=Z.next;Z.next=null,T===null?v=ie:T.next=ie,T=Z;var ue=n.alternate;ue!==null&&(ue=ue.updateQueue,I=ue.lastBaseUpdate,I!==T&&(I===null?ue.firstBaseUpdate=ie:I.next=ie,ue.lastBaseUpdate=Z))}if(v!==null){var de=y.baseState;T=0,ue=ie=Z=null,I=v;do{var le=I.lane&-536870913,ae=le!==I.lane;if(ae?(Ue&le)===le:(u&le)===le){le!==0&&le===ul&&(ch=!0),ue!==null&&(ue=ue.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var be=n,Te=I;le=o;var rt=a;switch(Te.tag){case 1:if(be=Te.payload,typeof be=="function"){de=be.call(rt,de,le);break e}de=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Te.payload,le=typeof be=="function"?be.call(rt,de,le):be,le==null)break e;de=g({},de,le);break e;case 2:No=!0}}le=I.callback,le!==null&&(n.flags|=64,ae&&(n.flags|=8192),ae=y.callbacks,ae===null?y.callbacks=[le]:ae.push(le))}else ae={lane:le,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ue===null?(ie=ue=ae,Z=de):ue=ue.next=ae,T|=le;if(I=I.next,I===null){if(I=y.shared.pending,I===null)break;ae=I,I=ae.next,ae.next=null,y.lastBaseUpdate=ae,y.shared.pending=null}}while(!0);ue===null&&(Z=de),y.baseState=Z,y.firstBaseUpdate=ie,y.lastBaseUpdate=ue,v===null&&(y.shared.lanes=0),Mo|=T,n.lanes=T,n.memoizedState=de}}function Ox(n,o){if(typeof n!="function")throw Error(i(191,n));n.call(o)}function Dx(n,o){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)Ox(a[n],o)}var ml=B(null),Ic=B(0);function zx(n,o){n=Kr,D(Ic,n),D(ml,o),Kr=n|o.baseLanes}function uh(){D(Ic,Kr),D(ml,ml.current)}function fh(){Kr=Ic.current,G(ml),G(Ic)}var pn=B(null),zn=null;function To(n){var o=n.alternate;D(bt,bt.current&1),D(pn,n),zn===null&&(o===null||ml.current!==null||o.memoizedState!==null)&&(zn=n)}function dh(n){D(bt,bt.current),D(pn,n),zn===null&&(zn=n)}function Lx(n){n.tag===22?(D(bt,bt.current),D(pn,n),zn===null&&(zn=n)):Ao()}function Ao(){D(bt,bt.current),D(pn,pn.current)}function gn(n){G(pn),zn===n&&(zn=null),G(bt)}var bt=B(0);function Bc(n){for(var o=n;o!==null;){if(o.tag===13){var a=o.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xm(a)||vm(a)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var $r=0,Me=null,tt=null,Nt=null,Hc=!1,pl=!1,Si=!1,Pc=0,La=0,gl=null,eT=0;function yt(){throw Error(i(321))}function hh(n,o){if(o===null)return!1;for(var a=0;a<o.length&&a<n.length;a++)if(!hn(n[a],o[a]))return!1;return!0}function mh(n,o,a,u,y,v){return $r=v,Me=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,R.H=n===null||n.memoizedState===null?v0:Ah,Si=!1,v=a(u,y),Si=!1,pl&&(v=Bx(o,a,u,y)),Ix(n),v}function Ix(n){R.H=Ha;var o=tt!==null&&tt.next!==null;if($r=0,Nt=tt=Me=null,Hc=!1,La=0,gl=null,o)throw Error(i(300));n===null||_t||(n=n.dependencies,n!==null&&Rc(n)&&(_t=!0))}function Bx(n,o,a,u){Me=n;var y=0;do{if(pl&&(gl=null),La=0,pl=!1,25<=y)throw Error(i(301));if(y+=1,Nt=tt=null,n.updateQueue!=null){var v=n.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}R.H=b0,v=o(a,u)}while(pl);return v}function tT(){var n=R.H,o=n.useState()[0];return o=typeof o.then=="function"?Ia(o):o,n=n.useState()[0],(tt!==null?tt.memoizedState:null)!==n&&(Me.flags|=1024),o}function ph(){var n=Pc!==0;return Pc=0,n}function gh(n,o,a){o.updateQueue=n.updateQueue,o.flags&=-2053,n.lanes&=~a}function yh(n){if(Hc){for(n=n.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Hc=!1}$r=0,Nt=tt=Me=null,pl=!1,La=Pc=0,gl=null}function Gt(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Me.memoizedState=Nt=n:Nt=Nt.next=n,Nt}function wt(){if(tt===null){var n=Me.alternate;n=n!==null?n.memoizedState:null}else n=tt.next;var o=Nt===null?Me.memoizedState:Nt.next;if(o!==null)Nt=o,tt=n;else{if(n===null)throw Me.alternate===null?Error(i(467)):Error(i(310));tt=n,n={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Nt===null?Me.memoizedState=Nt=n:Nt=Nt.next=n}return Nt}function Uc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ia(n){var o=La;return La+=1,gl===null&&(gl=[]),n=Tx(gl,n,o),o=Me,(Nt===null?o.memoizedState:Nt.next)===null&&(o=o.alternate,R.H=o===null||o.memoizedState===null?v0:Ah),n}function Vc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Ia(n);if(n.$$typeof===C)return Bt(n)}throw Error(i(438,String(n)))}function xh(n){var o=null,a=Me.updateQueue;if(a!==null&&(o=a.memoCache),o==null){var u=Me.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(y){return y.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),a===null&&(a=Uc(),Me.updateQueue=a),a.memoCache=o,a=o.data[o.index],a===void 0)for(a=o.data[o.index]=Array(n),u=0;u<n;u++)a[u]=X;return o.index++,a}function Yr(n,o){return typeof o=="function"?o(n):o}function $c(n){var o=wt();return vh(o,tt,n)}function vh(n,o,a){var u=n.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=a;var y=n.baseQueue,v=u.pending;if(v!==null){if(y!==null){var T=y.next;y.next=v.next,v.next=T}o.baseQueue=y=v,u.pending=null}if(v=n.baseState,y===null)n.memoizedState=v;else{o=y.next;var I=T=null,Z=null,ie=o,ue=!1;do{var de=ie.lane&-536870913;if(de!==ie.lane?(Ue&de)===de:($r&de)===de){var le=ie.revertLane;if(le===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),de===ul&&(ue=!0);else if(($r&le)===le){ie=ie.next,le===ul&&(ue=!0);continue}else de={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(I=Z=de,T=v):Z=Z.next=de,Me.lanes|=le,Mo|=le;de=ie.action,Si&&a(v,de),v=ie.hasEagerState?ie.eagerState:a(v,de)}else le={lane:de,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(I=Z=le,T=v):Z=Z.next=le,Me.lanes|=de,Mo|=de;ie=ie.next}while(ie!==null&&ie!==o);if(Z===null?T=v:Z.next=I,!hn(v,n.memoizedState)&&(_t=!0,ue&&(a=fl,a!==null)))throw a;n.memoizedState=v,n.baseState=T,n.baseQueue=Z,u.lastRenderedState=v}return y===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function bh(n){var o=wt(),a=o.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=n;var u=a.dispatch,y=a.pending,v=o.memoizedState;if(y!==null){a.pending=null;var T=y=y.next;do v=n(v,T.action),T=T.next;while(T!==y);hn(v,o.memoizedState)||(_t=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),a.lastRenderedState=v}return[v,u]}function Hx(n,o,a){var u=Me,y=wt(),v=Ye;if(v){if(a===void 0)throw Error(i(407));a=a()}else a=o();var T=!hn((tt||y).memoizedState,a);if(T&&(y.memoizedState=a,_t=!0),y=y.queue,Eh(Vx.bind(null,u,y,n),[n]),y.getSnapshot!==o||T||Nt!==null&&Nt.memoizedState.tag&1){if(u.flags|=2048,yl(9,{destroy:void 0},Ux.bind(null,u,y,a,o),null),ot===null)throw Error(i(349));v||($r&127)!==0||Px(u,o,a)}return a}function Px(n,o,a){n.flags|=16384,n={getSnapshot:o,value:a},o=Me.updateQueue,o===null?(o=Uc(),Me.updateQueue=o,o.stores=[n]):(a=o.stores,a===null?o.stores=[n]:a.push(n))}function Ux(n,o,a,u){o.value=a,o.getSnapshot=u,$x(o)&&Yx(n)}function Vx(n,o,a){return a(function(){$x(o)&&Yx(n)})}function $x(n){var o=n.getSnapshot;n=n.value;try{var a=o();return!hn(n,a)}catch{return!0}}function Yx(n){var o=hi(n,2);o!==null&&ln(o,n,2)}function wh(n){var o=Gt();if(typeof n=="function"){var a=n;if(n=a(),Si){$t(!0);try{a()}finally{$t(!1)}}}return o.memoizedState=o.baseState=n,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:n},o}function qx(n,o,a,u){return n.baseState=a,vh(n,tt,typeof u=="function"?u:Yr)}function nT(n,o,a,u,y){if(Fc(n))throw Error(i(485));if(n=o.action,n!==null){var v={payload:y,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){v.listeners.push(T)}};R.T!==null?a(!0):v.isTransition=!1,u(v),a=o.pending,a===null?(v.next=o.pending=v,Fx(o,v)):(v.next=a.next,o.pending=a.next=v)}}function Fx(n,o){var a=o.action,u=o.payload,y=n.state;if(o.isTransition){var v=R.T,T={};R.T=T;try{var I=a(y,u),Z=R.S;Z!==null&&Z(T,I),Xx(n,o,I)}catch(ie){Sh(n,o,ie)}finally{v!==null&&T.types!==null&&(v.types=T.types),R.T=v}}else try{v=a(y,u),Xx(n,o,v)}catch(ie){Sh(n,o,ie)}}function Xx(n,o,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){Gx(n,o,u)},function(u){return Sh(n,o,u)}):Gx(n,o,a)}function Gx(n,o,a){o.status="fulfilled",o.value=a,Wx(o),n.state=a,o=n.pending,o!==null&&(a=o.next,a===o?n.pending=null:(a=a.next,o.next=a,Fx(n,a)))}function Sh(n,o,a){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=a,Wx(o),o=o.next;while(o!==u)}n.action=null}function Wx(n){n=n.listeners;for(var o=0;o<n.length;o++)(0,n[o])()}function Zx(n,o){return o}function Kx(n,o){if(Ye){var a=ot.formState;if(a!==null){e:{var u=Me;if(Ye){if(ct){t:{for(var y=ct,v=Dn;y.nodeType!==8;){if(!v){y=null;break t}if(y=Ln(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){ct=Ln(y.nextSibling),u=y.data==="F!";break e}}Eo(u)}u=!1}u&&(o=a[0])}}return a=Gt(),a.memoizedState=a.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zx,lastRenderedState:o},a.queue=u,a=g0.bind(null,Me,u),u.dispatch=a,u=wh(!1),v=Th.bind(null,Me,!1,u.queue),u=Gt(),y={state:o,dispatch:null,action:n,pending:null},u.queue=y,a=nT.bind(null,Me,y,v,a),y.dispatch=a,u.memoizedState=n,[o,a,!1]}function Qx(n){var o=wt();return Jx(o,tt,n)}function Jx(n,o,a){if(o=vh(n,o,Zx)[0],n=$c(Yr)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Ia(o)}catch(T){throw T===dl?Oc:T}else u=o;o=wt();var y=o.queue,v=y.dispatch;return a!==o.memoizedState&&(Me.flags|=2048,yl(9,{destroy:void 0},rT.bind(null,y,a),null)),[u,v,n]}function rT(n,o){n.action=o}function e0(n){var o=wt(),a=tt;if(a!==null)return Jx(o,a,n);wt(),o=o.memoizedState,a=wt();var u=a.queue.dispatch;return a.memoizedState=n,[o,u,!1]}function yl(n,o,a,u){return n={tag:n,create:a,deps:u,inst:o,next:null},o=Me.updateQueue,o===null&&(o=Uc(),Me.updateQueue=o),a=o.lastEffect,a===null?o.lastEffect=n.next=n:(u=a.next,a.next=n,n.next=u,o.lastEffect=n),n}function t0(){return wt().memoizedState}function Yc(n,o,a,u){var y=Gt();Me.flags|=n,y.memoizedState=yl(1|o,{destroy:void 0},a,u===void 0?null:u)}function qc(n,o,a,u){var y=wt();u=u===void 0?null:u;var v=y.memoizedState.inst;tt!==null&&u!==null&&hh(u,tt.memoizedState.deps)?y.memoizedState=yl(o,v,a,u):(Me.flags|=n,y.memoizedState=yl(1|o,v,a,u))}function n0(n,o){Yc(8390656,8,n,o)}function Eh(n,o){qc(2048,8,n,o)}function oT(n){Me.flags|=4;var o=Me.updateQueue;if(o===null)o=Uc(),Me.updateQueue=o,o.events=[n];else{var a=o.events;a===null?o.events=[n]:a.push(n)}}function r0(n){var o=wt().memoizedState;return oT({ref:o,nextImpl:n}),function(){if((Ze&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function o0(n,o){return qc(4,2,n,o)}function i0(n,o){return qc(4,4,n,o)}function l0(n,o){if(typeof o=="function"){n=n();var a=o(n);return function(){typeof a=="function"?a():o(null)}}if(o!=null)return n=n(),o.current=n,function(){o.current=null}}function a0(n,o,a){a=a!=null?a.concat([n]):null,qc(4,4,l0.bind(null,o,n),a)}function Ch(){}function s0(n,o){var a=wt();o=o===void 0?null:o;var u=a.memoizedState;return o!==null&&hh(o,u[1])?u[0]:(a.memoizedState=[n,o],n)}function c0(n,o){var a=wt();o=o===void 0?null:o;var u=a.memoizedState;if(o!==null&&hh(o,u[1]))return u[0];if(u=n(),Si){$t(!0);try{n()}finally{$t(!1)}}return a.memoizedState=[u,o],u}function Nh(n,o,a){return a===void 0||($r&1073741824)!==0&&(Ue&261930)===0?n.memoizedState=o:(n.memoizedState=a,n=uv(),Me.lanes|=n,Mo|=n,a)}function u0(n,o,a,u){return hn(a,o)?a:ml.current!==null?(n=Nh(n,a,u),hn(n,o)||(_t=!0),n):($r&42)===0||($r&1073741824)!==0&&(Ue&261930)===0?(_t=!0,n.memoizedState=a):(n=uv(),Me.lanes|=n,Mo|=n,o)}function f0(n,o,a,u,y){var v=V.p;V.p=v!==0&&8>v?v:8;var T=R.T,I={};R.T=I,Th(n,!1,o,a);try{var Z=y(),ie=R.S;if(ie!==null&&ie(I,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ue=Jk(Z,u);Ba(n,o,ue,vn(n))}else Ba(n,o,u,vn(n))}catch(de){Ba(n,o,{then:function(){},status:"rejected",reason:de},vn())}finally{V.p=v,T!==null&&I.types!==null&&(T.types=I.types),R.T=T}}function iT(){}function _h(n,o,a,u){if(n.tag!==5)throw Error(i(476));var y=d0(n).queue;f0(n,y,o,$,a===null?iT:function(){return h0(n),a(u)})}function d0(n){var o=n.memoizedState;if(o!==null)return o;o={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:$},next:null};var a={};return o.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:a},next:null},n.memoizedState=o,n=n.alternate,n!==null&&(n.memoizedState=o),o}function h0(n){var o=d0(n);o.next===null&&(o=n.alternate.memoizedState),Ba(n,o.next.queue,{},vn())}function kh(){return Bt(ts)}function m0(){return wt().memoizedState}function p0(){return wt().memoizedState}function lT(n){for(var o=n.return;o!==null;){switch(o.tag){case 24:case 3:var a=vn();n=_o(a);var u=ko(o,n,a);u!==null&&(ln(u,o,a),Oa(u,o,a)),o={cache:nh()},n.payload=o;return}o=o.return}}function aT(n,o,a){var u=vn();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Fc(n)?y0(o,a):(a=qd(n,o,a,u),a!==null&&(ln(a,n,u),x0(a,o,u)))}function g0(n,o,a){var u=vn();Ba(n,o,a,u)}function Ba(n,o,a,u){var y={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Fc(n))y0(o,y);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var T=o.lastRenderedState,I=v(T,a);if(y.hasEagerState=!0,y.eagerState=I,hn(I,T))return _c(n,o,y,0),ot===null&&Nc(),!1}catch{}if(a=qd(n,o,y,u),a!==null)return ln(a,n,u),x0(a,o,u),!0}return!1}function Th(n,o,a,u){if(u={lane:2,revertLane:lm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Fc(n)){if(o)throw Error(i(479))}else o=qd(n,a,u,2),o!==null&&ln(o,n,2)}function Fc(n){var o=n.alternate;return n===Me||o!==null&&o===Me}function y0(n,o){pl=Hc=!0;var a=n.pending;a===null?o.next=o:(o.next=a.next,a.next=o),n.pending=o}function x0(n,o,a){if((a&4194048)!==0){var u=o.lanes;u&=n.pendingLanes,a|=u,o.lanes=a,ic(n,a)}}var Ha={readContext:Bt,use:Vc,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};Ha.useEffectEvent=yt;var v0={readContext:Bt,use:Vc,useCallback:function(n,o){return Gt().memoizedState=[n,o===void 0?null:o],n},useContext:Bt,useEffect:n0,useImperativeHandle:function(n,o,a){a=a!=null?a.concat([n]):null,Yc(4194308,4,l0.bind(null,o,n),a)},useLayoutEffect:function(n,o){return Yc(4194308,4,n,o)},useInsertionEffect:function(n,o){Yc(4,2,n,o)},useMemo:function(n,o){var a=Gt();o=o===void 0?null:o;var u=n();if(Si){$t(!0);try{n()}finally{$t(!1)}}return a.memoizedState=[u,o],u},useReducer:function(n,o,a){var u=Gt();if(a!==void 0){var y=a(o);if(Si){$t(!0);try{a(o)}finally{$t(!1)}}}else y=o;return u.memoizedState=u.baseState=y,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:y},u.queue=n,n=n.dispatch=aT.bind(null,Me,n),[u.memoizedState,n]},useRef:function(n){var o=Gt();return n={current:n},o.memoizedState=n},useState:function(n){n=wh(n);var o=n.queue,a=g0.bind(null,Me,o);return o.dispatch=a,[n.memoizedState,a]},useDebugValue:Ch,useDeferredValue:function(n,o){var a=Gt();return Nh(a,n,o)},useTransition:function(){var n=wh(!1);return n=f0.bind(null,Me,n.queue,!0,!1),Gt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,o,a){var u=Me,y=Gt();if(Ye){if(a===void 0)throw Error(i(407));a=a()}else{if(a=o(),ot===null)throw Error(i(349));(Ue&127)!==0||Px(u,o,a)}y.memoizedState=a;var v={value:a,getSnapshot:o};return y.queue=v,n0(Vx.bind(null,u,v,n),[n]),u.flags|=2048,yl(9,{destroy:void 0},Ux.bind(null,u,v,a,o),null),a},useId:function(){var n=Gt(),o=ot.identifierPrefix;if(Ye){var a=ur,u=cr;a=(u&~(1<<32-Qe(u)-1)).toString(32)+a,o="_"+o+"R_"+a,a=Pc++,0<a&&(o+="H"+a.toString(32)),o+="_"}else a=eT++,o="_"+o+"r_"+a.toString(32)+"_";return n.memoizedState=o},useHostTransitionStatus:kh,useFormState:Kx,useActionState:Kx,useOptimistic:function(n){var o=Gt();o.memoizedState=o.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=a,o=Th.bind(null,Me,!0,a),a.dispatch=o,[n,o]},useMemoCache:xh,useCacheRefresh:function(){return Gt().memoizedState=lT.bind(null,Me)},useEffectEvent:function(n){var o=Gt(),a={impl:n};return o.memoizedState=a,function(){if((Ze&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Ah={readContext:Bt,use:Vc,useCallback:s0,useContext:Bt,useEffect:Eh,useImperativeHandle:a0,useInsertionEffect:o0,useLayoutEffect:i0,useMemo:c0,useReducer:$c,useRef:t0,useState:function(){return $c(Yr)},useDebugValue:Ch,useDeferredValue:function(n,o){var a=wt();return u0(a,tt.memoizedState,n,o)},useTransition:function(){var n=$c(Yr)[0],o=wt().memoizedState;return[typeof n=="boolean"?n:Ia(n),o]},useSyncExternalStore:Hx,useId:m0,useHostTransitionStatus:kh,useFormState:Qx,useActionState:Qx,useOptimistic:function(n,o){var a=wt();return qx(a,tt,n,o)},useMemoCache:xh,useCacheRefresh:p0};Ah.useEffectEvent=r0;var b0={readContext:Bt,use:Vc,useCallback:s0,useContext:Bt,useEffect:Eh,useImperativeHandle:a0,useInsertionEffect:o0,useLayoutEffect:i0,useMemo:c0,useReducer:bh,useRef:t0,useState:function(){return bh(Yr)},useDebugValue:Ch,useDeferredValue:function(n,o){var a=wt();return tt===null?Nh(a,n,o):u0(a,tt.memoizedState,n,o)},useTransition:function(){var n=bh(Yr)[0],o=wt().memoizedState;return[typeof n=="boolean"?n:Ia(n),o]},useSyncExternalStore:Hx,useId:m0,useHostTransitionStatus:kh,useFormState:e0,useActionState:e0,useOptimistic:function(n,o){var a=wt();return tt!==null?qx(a,tt,n,o):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:xh,useCacheRefresh:p0};b0.useEffectEvent=r0;function Rh(n,o,a,u){o=n.memoizedState,a=a(u,o),a=a==null?o:g({},o,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var jh={enqueueSetState:function(n,o,a){n=n._reactInternals;var u=vn(),y=_o(u);y.payload=o,a!=null&&(y.callback=a),o=ko(n,y,u),o!==null&&(ln(o,n,u),Oa(o,n,u))},enqueueReplaceState:function(n,o,a){n=n._reactInternals;var u=vn(),y=_o(u);y.tag=1,y.payload=o,a!=null&&(y.callback=a),o=ko(n,y,u),o!==null&&(ln(o,n,u),Oa(o,n,u))},enqueueForceUpdate:function(n,o){n=n._reactInternals;var a=vn(),u=_o(a);u.tag=2,o!=null&&(u.callback=o),o=ko(n,u,a),o!==null&&(ln(o,n,a),Oa(o,n,a))}};function w0(n,o,a,u,y,v,T){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,v,T):o.prototype&&o.prototype.isPureReactComponent?!Na(a,u)||!Na(y,v):!0}function S0(n,o,a,u){n=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(a,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(a,u),o.state!==n&&jh.enqueueReplaceState(o,o.state,null)}function Ei(n,o){var a=o;if("ref"in o){a={};for(var u in o)u!=="ref"&&(a[u]=o[u])}if(n=n.defaultProps){a===o&&(a=g({},a));for(var y in n)a[y]===void 0&&(a[y]=n[y])}return a}function E0(n){Cc(n)}function C0(n){console.error(n)}function N0(n){Cc(n)}function Xc(n,o){try{var a=n.onUncaughtError;a(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function _0(n,o,a){try{var u=n.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Mh(n,o,a){return a=_o(a),a.tag=3,a.payload={element:null},a.callback=function(){Xc(n,o)},a}function k0(n){return n=_o(n),n.tag=3,n}function T0(n,o,a,u){var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var v=u.value;n.payload=function(){return y(v)},n.callback=function(){_0(o,a,u)}}var T=a.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(n.callback=function(){_0(o,a,u),typeof y!="function"&&(Oo===null?Oo=new Set([this]):Oo.add(this));var I=u.stack;this.componentDidCatch(u.value,{componentStack:I!==null?I:""})})}function sT(n,o,a,u,y){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=a.alternate,o!==null&&cl(o,a,y,!0),a=pn.current,a!==null){switch(a.tag){case 31:case 13:return zn===null?iu():a.alternate===null&&xt===0&&(xt=3),a.flags&=-257,a.flags|=65536,a.lanes=y,u===Dc?a.flags|=16384:(o=a.updateQueue,o===null?a.updateQueue=new Set([u]):o.add(u),rm(n,u,y)),!1;case 22:return a.flags|=65536,u===Dc?a.flags|=16384:(o=a.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=o):(a=o.retryQueue,a===null?o.retryQueue=new Set([u]):a.add(u)),rm(n,u,y)),!1}throw Error(i(435,a.tag))}return rm(n,u,y),iu(),!1}if(Ye)return o=pn.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=y,u!==Kd&&(n=Error(i(422),{cause:u}),Ta(jn(n,a)))):(u!==Kd&&(o=Error(i(423),{cause:u}),Ta(jn(o,a))),n=n.current.alternate,n.flags|=65536,y&=-y,n.lanes|=y,u=jn(u,a),y=Mh(n.stateNode,u,y),sh(n,y),xt!==4&&(xt=2)),!1;var v=Error(i(520),{cause:u});if(v=jn(v,a),Xa===null?Xa=[v]:Xa.push(v),xt!==4&&(xt=2),o===null)return!0;u=jn(u,a),a=o;do{switch(a.tag){case 3:return a.flags|=65536,n=y&-y,a.lanes|=n,n=Mh(a.stateNode,u,n),sh(a,n),!1;case 1:if(o=a.type,v=a.stateNode,(a.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Oo===null||!Oo.has(v))))return a.flags|=65536,y&=-y,a.lanes|=y,y=k0(y),T0(y,n,a,u),sh(a,y),!1}a=a.return}while(a!==null);return!1}var Oh=Error(i(461)),_t=!1;function Ht(n,o,a,u){o.child=n===null?Mx(o,null,a,u):wi(o,n.child,a,u)}function A0(n,o,a,u,y){a=a.render;var v=o.ref;if("ref"in u){var T={};for(var I in u)I!=="ref"&&(T[I]=u[I])}else T=u;return yi(o),u=mh(n,o,a,T,v,y),I=ph(),n!==null&&!_t?(gh(n,o,y),qr(n,o,y)):(Ye&&I&&Wd(o),o.flags|=1,Ht(n,o,u,y),o.child)}function R0(n,o,a,u,y){if(n===null){var v=a.type;return typeof v=="function"&&!Fd(v)&&v.defaultProps===void 0&&a.compare===null?(o.tag=15,o.type=v,j0(n,o,v,u,y)):(n=Tc(a.type,null,u,o,o.mode,y),n.ref=o.ref,n.return=o,o.child=n)}if(v=n.child,!Uh(n,y)){var T=v.memoizedProps;if(a=a.compare,a=a!==null?a:Na,a(T,u)&&n.ref===o.ref)return qr(n,o,y)}return o.flags|=1,n=Hr(v,u),n.ref=o.ref,n.return=o,o.child=n}function j0(n,o,a,u,y){if(n!==null){var v=n.memoizedProps;if(Na(v,u)&&n.ref===o.ref)if(_t=!1,o.pendingProps=u=v,Uh(n,y))(n.flags&131072)!==0&&(_t=!0);else return o.lanes=n.lanes,qr(n,o,y)}return Dh(n,o,a,u,y)}function M0(n,o,a,u){var y=u.children,v=n!==null?n.memoizedState:null;if(n===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|a:a,n!==null){for(u=o.child=n.child,y=0;u!==null;)y=y|u.lanes|u.childLanes,u=u.sibling;u=y&~v}else u=0,o.child=null;return O0(n,o,v,a,u)}if((a&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},n!==null&&Mc(o,v!==null?v.cachePool:null),v!==null?zx(o,v):uh(),Lx(o);else return u=o.lanes=536870912,O0(n,o,v!==null?v.baseLanes|a:a,a,u)}else v!==null?(Mc(o,v.cachePool),zx(o,v),Ao(),o.memoizedState=null):(n!==null&&Mc(o,null),uh(),Ao());return Ht(n,o,y,a),o.child}function Pa(n,o){return n!==null&&n.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function O0(n,o,a,u,y){var v=oh();return v=v===null?null:{parent:Ct._currentValue,pool:v},o.memoizedState={baseLanes:a,cachePool:v},n!==null&&Mc(o,null),uh(),Lx(o),n!==null&&cl(n,o,u,!0),o.childLanes=y,null}function Gc(n,o){return o=Zc({mode:o.mode,children:o.children},n.mode),o.ref=n.ref,n.child=o,o.return=n,o}function D0(n,o,a){return wi(o,n.child,null,a),n=Gc(o,o.pendingProps),n.flags|=2,gn(o),o.memoizedState=null,n}function cT(n,o,a){var u=o.pendingProps,y=(o.flags&128)!==0;if(o.flags&=-129,n===null){if(Ye){if(u.mode==="hidden")return n=Gc(o,u),o.lanes=536870912,Pa(null,n);if(dh(o),(n=ct)?(n=Fv(n,Dn),n=n!==null&&n.data==="&"?n:null,n!==null&&(o.memoizedState={dehydrated:n,treeContext:wo!==null?{id:cr,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},a=yx(n),a.return=o,o.child=a,It=o,ct=null)):n=null,n===null)throw Eo(o);return o.lanes=536870912,null}return Gc(o,u)}var v=n.memoizedState;if(v!==null){var T=v.dehydrated;if(dh(o),y)if(o.flags&256)o.flags&=-257,o=D0(n,o,a);else if(o.memoizedState!==null)o.child=n.child,o.flags|=128,o=null;else throw Error(i(558));else if(_t||cl(n,o,a,!1),y=(a&n.childLanes)!==0,_t||y){if(u=ot,u!==null&&(T=lc(u,a),T!==0&&T!==v.retryLane))throw v.retryLane=T,hi(n,T),ln(u,n,T),Oh;iu(),o=D0(n,o,a)}else n=v.treeContext,ct=Ln(T.nextSibling),It=o,Ye=!0,So=null,Dn=!1,n!==null&&bx(o,n),o=Gc(o,u),o.flags|=4096;return o}return n=Hr(n.child,{mode:u.mode,children:u.children}),n.ref=o.ref,o.child=n,n.return=o,n}function Wc(n,o){var a=o.ref;if(a===null)n!==null&&n.ref!==null&&(o.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(n===null||n.ref!==a)&&(o.flags|=4194816)}}function Dh(n,o,a,u,y){return yi(o),a=mh(n,o,a,u,void 0,y),u=ph(),n!==null&&!_t?(gh(n,o,y),qr(n,o,y)):(Ye&&u&&Wd(o),o.flags|=1,Ht(n,o,a,y),o.child)}function z0(n,o,a,u,y,v){return yi(o),o.updateQueue=null,a=Bx(o,u,a,y),Ix(n),u=ph(),n!==null&&!_t?(gh(n,o,v),qr(n,o,v)):(Ye&&u&&Wd(o),o.flags|=1,Ht(n,o,a,v),o.child)}function L0(n,o,a,u,y){if(yi(o),o.stateNode===null){var v=il,T=a.contextType;typeof T=="object"&&T!==null&&(v=Bt(T)),v=new a(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=jh,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},lh(o),T=a.contextType,v.context=typeof T=="object"&&T!==null?Bt(T):il,v.state=o.memoizedState,T=a.getDerivedStateFromProps,typeof T=="function"&&(Rh(o,a,T,u),v.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(T=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),T!==v.state&&jh.enqueueReplaceState(v,v.state,null),za(o,u,v,y),Da(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(n===null){v=o.stateNode;var I=o.memoizedProps,Z=Ei(a,I);v.props=Z;var ie=v.context,ue=a.contextType;T=il,typeof ue=="object"&&ue!==null&&(T=Bt(ue));var de=a.getDerivedStateFromProps;ue=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",I=o.pendingProps!==I,ue||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(I||ie!==T)&&S0(o,v,u,T),No=!1;var le=o.memoizedState;v.state=le,za(o,u,v,y),Da(),ie=o.memoizedState,I||le!==ie||No?(typeof de=="function"&&(Rh(o,a,de,u),ie=o.memoizedState),(Z=No||w0(o,a,Z,u,le,ie,T))?(ue||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=ie),v.props=u,v.state=ie,v.context=T,u=Z):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,ah(n,o),T=o.memoizedProps,ue=Ei(a,T),v.props=ue,de=o.pendingProps,le=v.context,ie=a.contextType,Z=il,typeof ie=="object"&&ie!==null&&(Z=Bt(ie)),I=a.getDerivedStateFromProps,(ie=typeof I=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==de||le!==Z)&&S0(o,v,u,Z),No=!1,le=o.memoizedState,v.state=le,za(o,u,v,y),Da();var ae=o.memoizedState;T!==de||le!==ae||No||n!==null&&n.dependencies!==null&&Rc(n.dependencies)?(typeof I=="function"&&(Rh(o,a,I,u),ae=o.memoizedState),(ue=No||w0(o,a,ue,u,le,ae,Z)||n!==null&&n.dependencies!==null&&Rc(n.dependencies))?(ie||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ae,Z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ae,Z)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||T===n.memoizedProps&&le===n.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&le===n.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ae),v.props=u,v.state=ae,v.context=Z,u=ue):(typeof v.componentDidUpdate!="function"||T===n.memoizedProps&&le===n.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&le===n.memoizedState||(o.flags|=1024),u=!1)}return v=u,Wc(n,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,n!==null&&u?(o.child=wi(o,n.child,null,y),o.child=wi(o,null,a,y)):Ht(n,o,a,y),o.memoizedState=v.state,n=o.child):n=qr(n,o,y),n}function I0(n,o,a,u){return pi(),o.flags|=256,Ht(n,o,a,u),o.child}var zh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lh(n){return{baseLanes:n,cachePool:_x()}}function Ih(n,o,a){return n=n!==null?n.childLanes&~a:0,o&&(n|=xn),n}function B0(n,o,a){var u=o.pendingProps,y=!1,v=(o.flags&128)!==0,T;if((T=v)||(T=n!==null&&n.memoizedState===null?!1:(bt.current&2)!==0),T&&(y=!0,o.flags&=-129),T=(o.flags&32)!==0,o.flags&=-33,n===null){if(Ye){if(y?To(o):Ao(),(n=ct)?(n=Fv(n,Dn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(o.memoizedState={dehydrated:n,treeContext:wo!==null?{id:cr,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},a=yx(n),a.return=o,o.child=a,It=o,ct=null)):n=null,n===null)throw Eo(o);return vm(n)?o.lanes=32:o.lanes=536870912,null}var I=u.children;return u=u.fallback,y?(Ao(),y=o.mode,I=Zc({mode:"hidden",children:I},y),u=mi(u,y,a,null),I.return=o,u.return=o,I.sibling=u,o.child=I,u=o.child,u.memoizedState=Lh(a),u.childLanes=Ih(n,T,a),o.memoizedState=zh,Pa(null,u)):(To(o),Bh(o,I))}var Z=n.memoizedState;if(Z!==null&&(I=Z.dehydrated,I!==null)){if(v)o.flags&256?(To(o),o.flags&=-257,o=Hh(n,o,a)):o.memoizedState!==null?(Ao(),o.child=n.child,o.flags|=128,o=null):(Ao(),I=u.fallback,y=o.mode,u=Zc({mode:"visible",children:u.children},y),I=mi(I,y,a,null),I.flags|=2,u.return=o,I.return=o,u.sibling=I,o.child=u,wi(o,n.child,null,a),u=o.child,u.memoizedState=Lh(a),u.childLanes=Ih(n,T,a),o.memoizedState=zh,o=Pa(null,u));else if(To(o),vm(I)){if(T=I.nextSibling&&I.nextSibling.dataset,T)var ie=T.dgst;T=ie,u=Error(i(419)),u.stack="",u.digest=T,Ta({value:u,source:null,stack:null}),o=Hh(n,o,a)}else if(_t||cl(n,o,a,!1),T=(a&n.childLanes)!==0,_t||T){if(T=ot,T!==null&&(u=lc(T,a),u!==0&&u!==Z.retryLane))throw Z.retryLane=u,hi(n,u),ln(T,n,u),Oh;xm(I)||iu(),o=Hh(n,o,a)}else xm(I)?(o.flags|=192,o.child=n.child,o=null):(n=Z.treeContext,ct=Ln(I.nextSibling),It=o,Ye=!0,So=null,Dn=!1,n!==null&&bx(o,n),o=Bh(o,u.children),o.flags|=4096);return o}return y?(Ao(),I=u.fallback,y=o.mode,Z=n.child,ie=Z.sibling,u=Hr(Z,{mode:"hidden",children:u.children}),u.subtreeFlags=Z.subtreeFlags&65011712,ie!==null?I=Hr(ie,I):(I=mi(I,y,a,null),I.flags|=2),I.return=o,u.return=o,u.sibling=I,o.child=u,Pa(null,u),u=o.child,I=n.child.memoizedState,I===null?I=Lh(a):(y=I.cachePool,y!==null?(Z=Ct._currentValue,y=y.parent!==Z?{parent:Z,pool:Z}:y):y=_x(),I={baseLanes:I.baseLanes|a,cachePool:y}),u.memoizedState=I,u.childLanes=Ih(n,T,a),o.memoizedState=zh,Pa(n.child,u)):(To(o),a=n.child,n=a.sibling,a=Hr(a,{mode:"visible",children:u.children}),a.return=o,a.sibling=null,n!==null&&(T=o.deletions,T===null?(o.deletions=[n],o.flags|=16):T.push(n)),o.child=a,o.memoizedState=null,a)}function Bh(n,o){return o=Zc({mode:"visible",children:o},n.mode),o.return=n,n.child=o}function Zc(n,o){return n=mn(22,n,null,o),n.lanes=0,n}function Hh(n,o,a){return wi(o,n.child,null,a),n=Bh(o,o.pendingProps.children),n.flags|=2,o.memoizedState=null,n}function H0(n,o,a){n.lanes|=o;var u=n.alternate;u!==null&&(u.lanes|=o),eh(n.return,o,a)}function Ph(n,o,a,u,y,v){var T=n.memoizedState;T===null?n.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:y,treeForkCount:v}:(T.isBackwards=o,T.rendering=null,T.renderingStartTime=0,T.last=u,T.tail=a,T.tailMode=y,T.treeForkCount=v)}function P0(n,o,a){var u=o.pendingProps,y=u.revealOrder,v=u.tail;u=u.children;var T=bt.current,I=(T&2)!==0;if(I?(T=T&1|2,o.flags|=128):T&=1,D(bt,T),Ht(n,o,u,a),u=Ye?ka:0,!I&&n!==null&&(n.flags&128)!==0)e:for(n=o.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&H0(n,a,o);else if(n.tag===19)H0(n,a,o);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===o)break e;for(;n.sibling===null;){if(n.return===null||n.return===o)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(y){case"forwards":for(a=o.child,y=null;a!==null;)n=a.alternate,n!==null&&Bc(n)===null&&(y=a),a=a.sibling;a=y,a===null?(y=o.child,o.child=null):(y=a.sibling,a.sibling=null),Ph(o,!1,y,a,v,u);break;case"backwards":case"unstable_legacy-backwards":for(a=null,y=o.child,o.child=null;y!==null;){if(n=y.alternate,n!==null&&Bc(n)===null){o.child=y;break}n=y.sibling,y.sibling=a,a=y,y=n}Ph(o,!0,a,null,v,u);break;case"together":Ph(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function qr(n,o,a){if(n!==null&&(o.dependencies=n.dependencies),Mo|=o.lanes,(a&o.childLanes)===0)if(n!==null){if(cl(n,o,a,!1),(a&o.childLanes)===0)return null}else return null;if(n!==null&&o.child!==n.child)throw Error(i(153));if(o.child!==null){for(n=o.child,a=Hr(n,n.pendingProps),o.child=a,a.return=o;n.sibling!==null;)n=n.sibling,a=a.sibling=Hr(n,n.pendingProps),a.return=o;a.sibling=null}return o.child}function Uh(n,o){return(n.lanes&o)!==0?!0:(n=n.dependencies,!!(n!==null&&Rc(n)))}function uT(n,o,a){switch(o.tag){case 3:ne(o,o.stateNode.containerInfo),Co(o,Ct,n.memoizedState.cache),pi();break;case 27:case 5:he(o);break;case 4:ne(o,o.stateNode.containerInfo);break;case 10:Co(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,dh(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(To(o),o.flags|=128,null):(a&o.child.childLanes)!==0?B0(n,o,a):(To(o),n=qr(n,o,a),n!==null?n.sibling:null);To(o);break;case 19:var y=(n.flags&128)!==0;if(u=(a&o.childLanes)!==0,u||(cl(n,o,a,!1),u=(a&o.childLanes)!==0),y){if(u)return P0(n,o,a);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),D(bt,bt.current),u)break;return null;case 22:return o.lanes=0,M0(n,o,a,o.pendingProps);case 24:Co(o,Ct,n.memoizedState.cache)}return qr(n,o,a)}function U0(n,o,a){if(n!==null)if(n.memoizedProps!==o.pendingProps)_t=!0;else{if(!Uh(n,a)&&(o.flags&128)===0)return _t=!1,uT(n,o,a);_t=(n.flags&131072)!==0}else _t=!1,Ye&&(o.flags&1048576)!==0&&vx(o,ka,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(n=vi(o.elementType),o.type=n,typeof n=="function")Fd(n)?(u=Ei(n,u),o.tag=1,o=L0(null,o,n,u,a)):(o.tag=0,o=Dh(null,o,n,u,a));else{if(n!=null){var y=n.$$typeof;if(y===A){o.tag=11,o=A0(null,o,n,u,a);break e}else if(y===L){o.tag=14,o=R0(null,o,n,u,a);break e}}throw o=O(n)||n,Error(i(306,o,""))}}return o;case 0:return Dh(n,o,o.type,o.pendingProps,a);case 1:return u=o.type,y=Ei(u,o.pendingProps),L0(n,o,u,y,a);case 3:e:{if(ne(o,o.stateNode.containerInfo),n===null)throw Error(i(387));u=o.pendingProps;var v=o.memoizedState;y=v.element,ah(n,o),za(o,u,null,a);var T=o.memoizedState;if(u=T.cache,Co(o,Ct,u),u!==v.cache&&th(o,[Ct],a,!0),Da(),u=T.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:T.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=I0(n,o,u,a);break e}else if(u!==y){y=jn(Error(i(424)),o),Ta(y),o=I0(n,o,u,a);break e}else for(n=o.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,ct=Ln(n.firstChild),It=o,Ye=!0,So=null,Dn=!0,a=Mx(o,null,u,a),o.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(pi(),u===y){o=qr(n,o,a);break e}Ht(n,o,u,a)}o=o.child}return o;case 26:return Wc(n,o),n===null?(a=Qv(o.type,null,o.pendingProps,null))?o.memoizedState=a:Ye||(a=o.type,n=o.pendingProps,u=du(J.current).createElement(a),u[jt]=o,u[Yt]=n,Pt(u,a,n),Et(u),o.stateNode=u):o.memoizedState=Qv(o.type,n.memoizedProps,o.pendingProps,n.memoizedState),null;case 27:return he(o),n===null&&Ye&&(u=o.stateNode=Wv(o.type,o.pendingProps,J.current),It=o,Dn=!0,y=ct,Io(o.type)?(bm=y,ct=Ln(u.firstChild)):ct=y),Ht(n,o,o.pendingProps.children,a),Wc(n,o),n===null&&(o.flags|=4194304),o.child;case 5:return n===null&&Ye&&((y=u=ct)&&(u=PT(u,o.type,o.pendingProps,Dn),u!==null?(o.stateNode=u,It=o,ct=Ln(u.firstChild),Dn=!1,y=!0):y=!1),y||Eo(o)),he(o),y=o.type,v=o.pendingProps,T=n!==null?n.memoizedProps:null,u=v.children,pm(y,v)?u=null:T!==null&&pm(y,T)&&(o.flags|=32),o.memoizedState!==null&&(y=mh(n,o,tT,null,null,a),ts._currentValue=y),Wc(n,o),Ht(n,o,u,a),o.child;case 6:return n===null&&Ye&&((n=a=ct)&&(a=UT(a,o.pendingProps,Dn),a!==null?(o.stateNode=a,It=o,ct=null,n=!0):n=!1),n||Eo(o)),null;case 13:return B0(n,o,a);case 4:return ne(o,o.stateNode.containerInfo),u=o.pendingProps,n===null?o.child=wi(o,null,u,a):Ht(n,o,u,a),o.child;case 11:return A0(n,o,o.type,o.pendingProps,a);case 7:return Ht(n,o,o.pendingProps,a),o.child;case 8:return Ht(n,o,o.pendingProps.children,a),o.child;case 12:return Ht(n,o,o.pendingProps.children,a),o.child;case 10:return u=o.pendingProps,Co(o,o.type,u.value),Ht(n,o,u.children,a),o.child;case 9:return y=o.type._context,u=o.pendingProps.children,yi(o),y=Bt(y),u=u(y),o.flags|=1,Ht(n,o,u,a),o.child;case 14:return R0(n,o,o.type,o.pendingProps,a);case 15:return j0(n,o,o.type,o.pendingProps,a);case 19:return P0(n,o,a);case 31:return cT(n,o,a);case 22:return M0(n,o,a,o.pendingProps);case 24:return yi(o),u=Bt(Ct),n===null?(y=oh(),y===null&&(y=ot,v=nh(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=a),y=v),o.memoizedState={parent:u,cache:y},lh(o),Co(o,Ct,y)):((n.lanes&a)!==0&&(ah(n,o),za(o,null,null,a),Da()),y=n.memoizedState,v=o.memoizedState,y.parent!==u?(y={parent:u,cache:u},o.memoizedState=y,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=y),Co(o,Ct,u)):(u=v.cache,Co(o,Ct,u),u!==y.cache&&th(o,[Ct],a,!0))),Ht(n,o,o.pendingProps.children,a),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function Fr(n){n.flags|=4}function Vh(n,o,a,u,y){if((o=(n.mode&32)!==0)&&(o=!1),o){if(n.flags|=16777216,(y&335544128)===y)if(n.stateNode.complete)n.flags|=8192;else if(mv())n.flags|=8192;else throw bi=Dc,ih}else n.flags&=-16777217}function V0(n,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!rb(o))if(mv())n.flags|=8192;else throw bi=Dc,ih}function Kc(n,o){o!==null&&(n.flags|=4),n.flags&16384&&(o=n.tag!==22?rc():536870912,n.lanes|=o,wl|=o)}function Ua(n,o){if(!Ye)switch(n.tailMode){case"hidden":o=n.tail;for(var a=null;o!==null;)o.alternate!==null&&(a=o),o=o.sibling;a===null?n.tail=null:a.sibling=null;break;case"collapsed":a=n.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?o||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function ut(n){var o=n.alternate!==null&&n.alternate.child===n.child,a=0,u=0;if(o)for(var y=n.child;y!==null;)a|=y.lanes|y.childLanes,u|=y.subtreeFlags&65011712,u|=y.flags&65011712,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)a|=y.lanes|y.childLanes,u|=y.subtreeFlags,u|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=u,n.childLanes=a,o}function fT(n,o,a){var u=o.pendingProps;switch(Zd(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(o),null;case 1:return ut(o),null;case 3:return a=o.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Vr(Ct),se(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(sl(o)?Fr(o):n===null||n.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Qd())),ut(o),null;case 26:var y=o.type,v=o.memoizedState;return n===null?(Fr(o),v!==null?(ut(o),V0(o,v)):(ut(o),Vh(o,y,null,u,a))):v?v!==n.memoizedState?(Fr(o),ut(o),V0(o,v)):(ut(o),o.flags&=-16777217):(n=n.memoizedProps,n!==u&&Fr(o),ut(o),Vh(o,y,n,u,a)),null;case 27:if(me(o),a=J.current,y=o.type,n!==null&&o.stateNode!=null)n.memoizedProps!==u&&Fr(o);else{if(!u){if(o.stateNode===null)throw Error(i(166));return ut(o),null}n=oe.current,sl(o)?wx(o):(n=Wv(y,u,a),o.stateNode=n,Fr(o))}return ut(o),null;case 5:if(me(o),y=o.type,n!==null&&o.stateNode!=null)n.memoizedProps!==u&&Fr(o);else{if(!u){if(o.stateNode===null)throw Error(i(166));return ut(o),null}if(v=oe.current,sl(o))wx(o);else{var T=du(J.current);switch(v){case 1:v=T.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:v=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":v=T.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":v=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":v=T.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?T.createElement("select",{is:u.is}):T.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?T.createElement(y,{is:u.is}):T.createElement(y)}}v[jt]=o,v[Yt]=u;e:for(T=o.child;T!==null;){if(T.tag===5||T.tag===6)v.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===o)break e;for(;T.sibling===null;){if(T.return===null||T.return===o)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}o.stateNode=v;e:switch(Pt(v,y,u),y){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Fr(o)}}return ut(o),Vh(o,o.type,n===null?null:n.memoizedProps,o.pendingProps,a),null;case 6:if(n&&o.stateNode!=null)n.memoizedProps!==u&&Fr(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(i(166));if(n=J.current,sl(o)){if(n=o.stateNode,a=o.memoizedProps,u=null,y=It,y!==null)switch(y.tag){case 27:case 5:u=y.memoizedProps}n[jt]=o,n=!!(n.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||Bv(n.nodeValue,a)),n||Eo(o,!0)}else n=du(n).createTextNode(u),n[jt]=o,o.stateNode=n}return ut(o),null;case 31:if(a=o.memoizedState,n===null||n.memoizedState!==null){if(u=sl(o),a!==null){if(n===null){if(!u)throw Error(i(318));if(n=o.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[jt]=o}else pi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ut(o),n=!1}else a=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return o.flags&256?(gn(o),o):(gn(o),null);if((o.flags&128)!==0)throw Error(i(558))}return ut(o),null;case 13:if(u=o.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(y=sl(o),u!==null&&u.dehydrated!==null){if(n===null){if(!y)throw Error(i(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[jt]=o}else pi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ut(o),y=!1}else y=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(gn(o),o):(gn(o),null)}return gn(o),(o.flags&128)!==0?(o.lanes=a,o):(a=u!==null,n=n!==null&&n.memoizedState!==null,a&&(u=o.child,y=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(y=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==y&&(u.flags|=2048)),a!==n&&a&&(o.child.flags|=8192),Kc(o,o.updateQueue),ut(o),null);case 4:return se(),n===null&&um(o.stateNode.containerInfo),ut(o),null;case 10:return Vr(o.type),ut(o),null;case 19:if(G(bt),u=o.memoizedState,u===null)return ut(o),null;if(y=(o.flags&128)!==0,v=u.rendering,v===null)if(y)Ua(u,!1);else{if(xt!==0||n!==null&&(n.flags&128)!==0)for(n=o.child;n!==null;){if(v=Bc(n),v!==null){for(o.flags|=128,Ua(u,!1),n=v.updateQueue,o.updateQueue=n,Kc(o,n),o.subtreeFlags=0,n=a,a=o.child;a!==null;)gx(a,n),a=a.sibling;return D(bt,bt.current&1|2),Ye&&Pr(o,u.treeForkCount),o.child}n=n.sibling}u.tail!==null&&Rt()>nu&&(o.flags|=128,y=!0,Ua(u,!1),o.lanes=4194304)}else{if(!y)if(n=Bc(v),n!==null){if(o.flags|=128,y=!0,n=n.updateQueue,o.updateQueue=n,Kc(o,n),Ua(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Ye)return ut(o),null}else 2*Rt()-u.renderingStartTime>nu&&a!==536870912&&(o.flags|=128,y=!0,Ua(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(n=u.last,n!==null?n.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Rt(),n.sibling=null,a=bt.current,D(bt,y?a&1|2:a&1),Ye&&Pr(o,u.treeForkCount),n):(ut(o),null);case 22:case 23:return gn(o),fh(),u=o.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(a&536870912)!==0&&(o.flags&128)===0&&(ut(o),o.subtreeFlags&6&&(o.flags|=8192)):ut(o),a=o.updateQueue,a!==null&&Kc(o,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==a&&(o.flags|=2048),n!==null&&G(xi),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),o.memoizedState.cache!==a&&(o.flags|=2048),Vr(Ct),ut(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function dT(n,o){switch(Zd(o),o.tag){case 1:return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 3:return Vr(Ct),se(),n=o.flags,(n&65536)!==0&&(n&128)===0?(o.flags=n&-65537|128,o):null;case 26:case 27:case 5:return me(o),null;case 31:if(o.memoizedState!==null){if(gn(o),o.alternate===null)throw Error(i(340));pi()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 13:if(gn(o),n=o.memoizedState,n!==null&&n.dehydrated!==null){if(o.alternate===null)throw Error(i(340));pi()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 19:return G(bt),null;case 4:return se(),null;case 10:return Vr(o.type),null;case 22:case 23:return gn(o),fh(),n!==null&&G(xi),n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 24:return Vr(Ct),null;case 25:return null;default:return null}}function $0(n,o){switch(Zd(o),o.tag){case 3:Vr(Ct),se();break;case 26:case 27:case 5:me(o);break;case 4:se();break;case 31:o.memoizedState!==null&&gn(o);break;case 13:gn(o);break;case 19:G(bt);break;case 10:Vr(o.type);break;case 22:case 23:gn(o),fh(),n!==null&&G(xi);break;case 24:Vr(Ct)}}function Va(n,o){try{var a=o.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var y=u.next;a=y;do{if((a.tag&n)===n){u=void 0;var v=a.create,T=a.inst;u=v(),T.destroy=u}a=a.next}while(a!==y)}}catch(I){et(o,o.return,I)}}function Ro(n,o,a){try{var u=o.updateQueue,y=u!==null?u.lastEffect:null;if(y!==null){var v=y.next;u=v;do{if((u.tag&n)===n){var T=u.inst,I=T.destroy;if(I!==void 0){T.destroy=void 0,y=o;var Z=a,ie=I;try{ie()}catch(ue){et(y,Z,ue)}}}u=u.next}while(u!==v)}}catch(ue){et(o,o.return,ue)}}function Y0(n){var o=n.updateQueue;if(o!==null){var a=n.stateNode;try{Dx(o,a)}catch(u){et(n,n.return,u)}}}function q0(n,o,a){a.props=Ei(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(u){et(n,o,u)}}function $a(n,o){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof a=="function"?n.refCleanup=a(u):a.current=u}}catch(y){et(n,o,y)}}function fr(n,o){var a=n.ref,u=n.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(y){et(n,o,y)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(y){et(n,o,y)}else a.current=null}function F0(n){var o=n.type,a=n.memoizedProps,u=n.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(y){et(n,n.return,y)}}function $h(n,o,a){try{var u=n.stateNode;DT(u,n.type,a,o),u[Yt]=o}catch(y){et(n,n.return,y)}}function X0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Io(n.type)||n.tag===4}function Yh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||X0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Io(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function qh(n,o,a){var u=n.tag;if(u===5||u===6)n=n.stateNode,o?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(n,o):(o=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,o.appendChild(n),a=a._reactRootContainer,a!=null||o.onclick!==null||(o.onclick=Ir));else if(u!==4&&(u===27&&Io(n.type)&&(a=n.stateNode,o=null),n=n.child,n!==null))for(qh(n,o,a),n=n.sibling;n!==null;)qh(n,o,a),n=n.sibling}function Qc(n,o,a){var u=n.tag;if(u===5||u===6)n=n.stateNode,o?a.insertBefore(n,o):a.appendChild(n);else if(u!==4&&(u===27&&Io(n.type)&&(a=n.stateNode),n=n.child,n!==null))for(Qc(n,o,a),n=n.sibling;n!==null;)Qc(n,o,a),n=n.sibling}function G0(n){var o=n.stateNode,a=n.memoizedProps;try{for(var u=n.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);Pt(o,u,a),o[jt]=n,o[Yt]=a}catch(v){et(n,n.return,v)}}var Xr=!1,kt=!1,Fh=!1,W0=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function hT(n,o){if(n=n.containerInfo,hm=vu,n=ax(n),Hd(n)){if("selectionStart"in n)var a={start:n.selectionStart,end:n.selectionEnd};else e:{a=(a=n.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var y=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{a.nodeType,v.nodeType}catch{a=null;break e}var T=0,I=-1,Z=-1,ie=0,ue=0,de=n,le=null;t:for(;;){for(var ae;de!==a||y!==0&&de.nodeType!==3||(I=T+y),de!==v||u!==0&&de.nodeType!==3||(Z=T+u),de.nodeType===3&&(T+=de.nodeValue.length),(ae=de.firstChild)!==null;)le=de,de=ae;for(;;){if(de===n)break t;if(le===a&&++ie===y&&(I=T),le===v&&++ue===u&&(Z=T),(ae=de.nextSibling)!==null)break;de=le,le=de.parentNode}de=ae}a=I===-1||Z===-1?null:{start:I,end:Z}}else a=null}a=a||{start:0,end:0}}else a=null;for(mm={focusedElem:n,selectionRange:a},vu=!1,Dt=o;Dt!==null;)if(o=Dt,n=o.child,(o.subtreeFlags&1028)!==0&&n!==null)n.return=o,Dt=n;else for(;Dt!==null;){switch(o=Dt,v=o.alternate,n=o.flags,o.tag){case 0:if((n&4)!==0&&(n=o.updateQueue,n=n!==null?n.events:null,n!==null))for(a=0;a<n.length;a++)y=n[a],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&v!==null){n=void 0,a=o,y=v.memoizedProps,v=v.memoizedState,u=a.stateNode;try{var be=Ei(a.type,y);n=u.getSnapshotBeforeUpdate(be,v),u.__reactInternalSnapshotBeforeUpdate=n}catch(Te){et(a,a.return,Te)}}break;case 3:if((n&1024)!==0){if(n=o.stateNode.containerInfo,a=n.nodeType,a===9)ym(n);else if(a===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ym(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=o.sibling,n!==null){n.return=o.return,Dt=n;break}Dt=o.return}}function Z0(n,o,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Wr(n,a),u&4&&Va(5,a);break;case 1:if(Wr(n,a),u&4)if(n=a.stateNode,o===null)try{n.componentDidMount()}catch(T){et(a,a.return,T)}else{var y=Ei(a.type,o.memoizedProps);o=o.memoizedState;try{n.componentDidUpdate(y,o,n.__reactInternalSnapshotBeforeUpdate)}catch(T){et(a,a.return,T)}}u&64&&Y0(a),u&512&&$a(a,a.return);break;case 3:if(Wr(n,a),u&64&&(n=a.updateQueue,n!==null)){if(o=null,a.child!==null)switch(a.child.tag){case 27:case 5:o=a.child.stateNode;break;case 1:o=a.child.stateNode}try{Dx(n,o)}catch(T){et(a,a.return,T)}}break;case 27:o===null&&u&4&&G0(a);case 26:case 5:Wr(n,a),o===null&&u&4&&F0(a),u&512&&$a(a,a.return);break;case 12:Wr(n,a);break;case 31:Wr(n,a),u&4&&J0(n,a);break;case 13:Wr(n,a),u&4&&ev(n,a),u&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=ST.bind(null,a),VT(n,a))));break;case 22:if(u=a.memoizedState!==null||Xr,!u){o=o!==null&&o.memoizedState!==null||kt,y=Xr;var v=kt;Xr=u,(kt=o)&&!v?Zr(n,a,(a.subtreeFlags&8772)!==0):Wr(n,a),Xr=y,kt=v}break;case 30:break;default:Wr(n,a)}}function K0(n){var o=n.alternate;o!==null&&(n.alternate=null,K0(o)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(o=n.stateNode,o!==null&&pa(o)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var ft=null,tn=!1;function Gr(n,o,a){for(a=a.child;a!==null;)Q0(n,o,a),a=a.sibling}function Q0(n,o,a){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Lt,a)}catch{}switch(a.tag){case 26:kt||fr(a,o),Gr(n,o,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:kt||fr(a,o);var u=ft,y=tn;Io(a.type)&&(ft=a.stateNode,tn=!1),Gr(n,o,a),Qa(a.stateNode),ft=u,tn=y;break;case 5:kt||fr(a,o);case 6:if(u=ft,y=tn,ft=null,Gr(n,o,a),ft=u,tn=y,ft!==null)if(tn)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(a.stateNode)}catch(v){et(a,o,v)}else try{ft.removeChild(a.stateNode)}catch(v){et(a,o,v)}break;case 18:ft!==null&&(tn?(n=ft,Yv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),Al(n)):Yv(ft,a.stateNode));break;case 4:u=ft,y=tn,ft=a.stateNode.containerInfo,tn=!0,Gr(n,o,a),ft=u,tn=y;break;case 0:case 11:case 14:case 15:Ro(2,a,o),kt||Ro(4,a,o),Gr(n,o,a);break;case 1:kt||(fr(a,o),u=a.stateNode,typeof u.componentWillUnmount=="function"&&q0(a,o,u)),Gr(n,o,a);break;case 21:Gr(n,o,a);break;case 22:kt=(u=kt)||a.memoizedState!==null,Gr(n,o,a),kt=u;break;default:Gr(n,o,a)}}function J0(n,o){if(o.memoizedState===null&&(n=o.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Al(n)}catch(a){et(o,o.return,a)}}}function ev(n,o){if(o.memoizedState===null&&(n=o.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Al(n)}catch(a){et(o,o.return,a)}}function mT(n){switch(n.tag){case 31:case 13:case 19:var o=n.stateNode;return o===null&&(o=n.stateNode=new W0),o;case 22:return n=n.stateNode,o=n._retryCache,o===null&&(o=n._retryCache=new W0),o;default:throw Error(i(435,n.tag))}}function Jc(n,o){var a=mT(n);o.forEach(function(u){if(!a.has(u)){a.add(u);var y=ET.bind(null,n,u);u.then(y,y)}})}function nn(n,o){var a=o.deletions;if(a!==null)for(var u=0;u<a.length;u++){var y=a[u],v=n,T=o,I=T;e:for(;I!==null;){switch(I.tag){case 27:if(Io(I.type)){ft=I.stateNode,tn=!1;break e}break;case 5:ft=I.stateNode,tn=!1;break e;case 3:case 4:ft=I.stateNode.containerInfo,tn=!0;break e}I=I.return}if(ft===null)throw Error(i(160));Q0(v,T,y),ft=null,tn=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)tv(o,n),o=o.sibling}var Fn=null;function tv(n,o){var a=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:nn(o,n),rn(n),u&4&&(Ro(3,n,n.return),Va(3,n),Ro(5,n,n.return));break;case 1:nn(o,n),rn(n),u&512&&(kt||a===null||fr(a,a.return)),u&64&&Xr&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?u:a.concat(u))));break;case 26:var y=Fn;if(nn(o,n),rn(n),u&512&&(kt||a===null||fr(a,a.return)),u&4){var v=a!==null?a.memoizedState:null;if(u=n.memoizedState,a===null)if(u===null)if(n.stateNode===null){e:{u=n.type,a=n.memoizedProps,y=y.ownerDocument||y;t:switch(u){case"title":v=y.getElementsByTagName("title")[0],(!v||v[ai]||v[jt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=y.createElement(u),y.head.insertBefore(v,y.querySelector("head > title"))),Pt(v,u,a),v[jt]=n,Et(v),u=v;break e;case"link":var T=tb("link","href",y).get(u+(a.href||""));if(T){for(var I=0;I<T.length;I++)if(v=T[I],v.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&v.getAttribute("rel")===(a.rel==null?null:a.rel)&&v.getAttribute("title")===(a.title==null?null:a.title)&&v.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){T.splice(I,1);break t}}v=y.createElement(u),Pt(v,u,a),y.head.appendChild(v);break;case"meta":if(T=tb("meta","content",y).get(u+(a.content||""))){for(I=0;I<T.length;I++)if(v=T[I],v.getAttribute("content")===(a.content==null?null:""+a.content)&&v.getAttribute("name")===(a.name==null?null:a.name)&&v.getAttribute("property")===(a.property==null?null:a.property)&&v.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&v.getAttribute("charset")===(a.charSet==null?null:a.charSet)){T.splice(I,1);break t}}v=y.createElement(u),Pt(v,u,a),y.head.appendChild(v);break;default:throw Error(i(468,u))}v[jt]=n,Et(v),u=v}n.stateNode=u}else nb(y,n.type,n.stateNode);else n.stateNode=eb(y,u,n.memoizedProps);else v!==u?(v===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):v.count--,u===null?nb(y,n.type,n.stateNode):eb(y,u,n.memoizedProps)):u===null&&n.stateNode!==null&&$h(n,n.memoizedProps,a.memoizedProps)}break;case 27:nn(o,n),rn(n),u&512&&(kt||a===null||fr(a,a.return)),a!==null&&u&4&&$h(n,n.memoizedProps,a.memoizedProps);break;case 5:if(nn(o,n),rn(n),u&512&&(kt||a===null||fr(a,a.return)),n.flags&32){y=n.stateNode;try{Qi(y,"")}catch(be){et(n,n.return,be)}}u&4&&n.stateNode!=null&&(y=n.memoizedProps,$h(n,y,a!==null?a.memoizedProps:y)),u&1024&&(Fh=!0);break;case 6:if(nn(o,n),rn(n),u&4){if(n.stateNode===null)throw Error(i(162));u=n.memoizedProps,a=n.stateNode;try{a.nodeValue=u}catch(be){et(n,n.return,be)}}break;case 3:if(pu=null,y=Fn,Fn=hu(o.containerInfo),nn(o,n),Fn=y,rn(n),u&4&&a!==null&&a.memoizedState.isDehydrated)try{Al(o.containerInfo)}catch(be){et(n,n.return,be)}Fh&&(Fh=!1,nv(n));break;case 4:u=Fn,Fn=hu(n.stateNode.containerInfo),nn(o,n),rn(n),Fn=u;break;case 12:nn(o,n),rn(n);break;case 31:nn(o,n),rn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Jc(n,u)));break;case 13:nn(o,n),rn(n),n.child.flags&8192&&n.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(tu=Rt()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Jc(n,u)));break;case 22:y=n.memoizedState!==null;var Z=a!==null&&a.memoizedState!==null,ie=Xr,ue=kt;if(Xr=ie||y,kt=ue||Z,nn(o,n),kt=ue,Xr=ie,rn(n),u&8192)e:for(o=n.stateNode,o._visibility=y?o._visibility&-2:o._visibility|1,y&&(a===null||Z||Xr||kt||Ci(n)),a=null,o=n;;){if(o.tag===5||o.tag===26){if(a===null){Z=a=o;try{if(v=Z.stateNode,y)T=v.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{I=Z.stateNode;var de=Z.memoizedProps.style,le=de!=null&&de.hasOwnProperty("display")?de.display:null;I.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(be){et(Z,Z.return,be)}}}else if(o.tag===6){if(a===null){Z=o;try{Z.stateNode.nodeValue=y?"":Z.memoizedProps}catch(be){et(Z,Z.return,be)}}}else if(o.tag===18){if(a===null){Z=o;try{var ae=Z.stateNode;y?qv(ae,!0):qv(Z.stateNode,!1)}catch(be){et(Z,Z.return,be)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===n)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break e;for(;o.sibling===null;){if(o.return===null||o.return===n)break e;a===o&&(a=null),o=o.return}a===o&&(a=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=n.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,Jc(n,a))));break;case 19:nn(o,n),rn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Jc(n,u)));break;case 30:break;case 21:break;default:nn(o,n),rn(n)}}function rn(n){var o=n.flags;if(o&2){try{for(var a,u=n.return;u!==null;){if(X0(u)){a=u;break}u=u.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var y=a.stateNode,v=Yh(n);Qc(n,v,y);break;case 5:var T=a.stateNode;a.flags&32&&(Qi(T,""),a.flags&=-33);var I=Yh(n);Qc(n,I,T);break;case 3:case 4:var Z=a.stateNode.containerInfo,ie=Yh(n);qh(n,ie,Z);break;default:throw Error(i(161))}}catch(ue){et(n,n.return,ue)}n.flags&=-3}o&4096&&(n.flags&=-4097)}function nv(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var o=n;nv(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),n=n.sibling}}function Wr(n,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Z0(n,o.alternate,o),o=o.sibling}function Ci(n){for(n=n.child;n!==null;){var o=n;switch(o.tag){case 0:case 11:case 14:case 15:Ro(4,o,o.return),Ci(o);break;case 1:fr(o,o.return);var a=o.stateNode;typeof a.componentWillUnmount=="function"&&q0(o,o.return,a),Ci(o);break;case 27:Qa(o.stateNode);case 26:case 5:fr(o,o.return),Ci(o);break;case 22:o.memoizedState===null&&Ci(o);break;case 30:Ci(o);break;default:Ci(o)}n=n.sibling}}function Zr(n,o,a){for(a=a&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,y=n,v=o,T=v.flags;switch(v.tag){case 0:case 11:case 15:Zr(y,v,a),Va(4,v);break;case 1:if(Zr(y,v,a),u=v,y=u.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ie){et(u,u.return,ie)}if(u=v,y=u.updateQueue,y!==null){var I=u.stateNode;try{var Z=y.shared.hiddenCallbacks;if(Z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Z.length;y++)Ox(Z[y],I)}catch(ie){et(u,u.return,ie)}}a&&T&64&&Y0(v),$a(v,v.return);break;case 27:G0(v);case 26:case 5:Zr(y,v,a),a&&u===null&&T&4&&F0(v),$a(v,v.return);break;case 12:Zr(y,v,a);break;case 31:Zr(y,v,a),a&&T&4&&J0(y,v);break;case 13:Zr(y,v,a),a&&T&4&&ev(y,v);break;case 22:v.memoizedState===null&&Zr(y,v,a),$a(v,v.return);break;case 30:break;default:Zr(y,v,a)}o=o.sibling}}function Xh(n,o){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(n=o.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&Aa(a))}function Gh(n,o){n=null,o.alternate!==null&&(n=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==n&&(o.refCount++,n!=null&&Aa(n))}function Xn(n,o,a,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)rv(n,o,a,u),o=o.sibling}function rv(n,o,a,u){var y=o.flags;switch(o.tag){case 0:case 11:case 15:Xn(n,o,a,u),y&2048&&Va(9,o);break;case 1:Xn(n,o,a,u);break;case 3:Xn(n,o,a,u),y&2048&&(n=null,o.alternate!==null&&(n=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==n&&(o.refCount++,n!=null&&Aa(n)));break;case 12:if(y&2048){Xn(n,o,a,u),n=o.stateNode;try{var v=o.memoizedProps,T=v.id,I=v.onPostCommit;typeof I=="function"&&I(T,o.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(Z){et(o,o.return,Z)}}else Xn(n,o,a,u);break;case 31:Xn(n,o,a,u);break;case 13:Xn(n,o,a,u);break;case 23:break;case 22:v=o.stateNode,T=o.alternate,o.memoizedState!==null?v._visibility&2?Xn(n,o,a,u):Ya(n,o):v._visibility&2?Xn(n,o,a,u):(v._visibility|=2,xl(n,o,a,u,(o.subtreeFlags&10256)!==0||!1)),y&2048&&Xh(T,o);break;case 24:Xn(n,o,a,u),y&2048&&Gh(o.alternate,o);break;default:Xn(n,o,a,u)}}function xl(n,o,a,u,y){for(y=y&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=n,T=o,I=a,Z=u,ie=T.flags;switch(T.tag){case 0:case 11:case 15:xl(v,T,I,Z,y),Va(8,T);break;case 23:break;case 22:var ue=T.stateNode;T.memoizedState!==null?ue._visibility&2?xl(v,T,I,Z,y):Ya(v,T):(ue._visibility|=2,xl(v,T,I,Z,y)),y&&ie&2048&&Xh(T.alternate,T);break;case 24:xl(v,T,I,Z,y),y&&ie&2048&&Gh(T.alternate,T);break;default:xl(v,T,I,Z,y)}o=o.sibling}}function Ya(n,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var a=n,u=o,y=u.flags;switch(u.tag){case 22:Ya(a,u),y&2048&&Xh(u.alternate,u);break;case 24:Ya(a,u),y&2048&&Gh(u.alternate,u);break;default:Ya(a,u)}o=o.sibling}}var qa=8192;function vl(n,o,a){if(n.subtreeFlags&qa)for(n=n.child;n!==null;)ov(n,o,a),n=n.sibling}function ov(n,o,a){switch(n.tag){case 26:vl(n,o,a),n.flags&qa&&n.memoizedState!==null&&eA(a,Fn,n.memoizedState,n.memoizedProps);break;case 5:vl(n,o,a);break;case 3:case 4:var u=Fn;Fn=hu(n.stateNode.containerInfo),vl(n,o,a),Fn=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=qa,qa=16777216,vl(n,o,a),qa=u):vl(n,o,a));break;default:vl(n,o,a)}}function iv(n){var o=n.alternate;if(o!==null&&(n=o.child,n!==null)){o.child=null;do o=n.sibling,n.sibling=null,n=o;while(n!==null)}}function Fa(n){var o=n.deletions;if((n.flags&16)!==0){if(o!==null)for(var a=0;a<o.length;a++){var u=o[a];Dt=u,av(u,n)}iv(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)lv(n),n=n.sibling}function lv(n){switch(n.tag){case 0:case 11:case 15:Fa(n),n.flags&2048&&Ro(9,n,n.return);break;case 3:Fa(n);break;case 12:Fa(n);break;case 22:var o=n.stateNode;n.memoizedState!==null&&o._visibility&2&&(n.return===null||n.return.tag!==13)?(o._visibility&=-3,eu(n)):Fa(n);break;default:Fa(n)}}function eu(n){var o=n.deletions;if((n.flags&16)!==0){if(o!==null)for(var a=0;a<o.length;a++){var u=o[a];Dt=u,av(u,n)}iv(n)}for(n=n.child;n!==null;){switch(o=n,o.tag){case 0:case 11:case 15:Ro(8,o,o.return),eu(o);break;case 22:a=o.stateNode,a._visibility&2&&(a._visibility&=-3,eu(o));break;default:eu(o)}n=n.sibling}}function av(n,o){for(;Dt!==null;){var a=Dt;switch(a.tag){case 0:case 11:case 15:Ro(8,a,o);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var u=a.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Aa(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,Dt=u;else e:for(a=n;Dt!==null;){u=Dt;var y=u.sibling,v=u.return;if(K0(u),u===a){Dt=null;break e}if(y!==null){y.return=v,Dt=y;break e}Dt=v}}}var pT={getCacheForType:function(n){var o=Bt(Ct),a=o.data.get(n);return a===void 0&&(a=n(),o.data.set(n,a)),a},cacheSignal:function(){return Bt(Ct).controller.signal}},gT=typeof WeakMap=="function"?WeakMap:Map,Ze=0,ot=null,Be=null,Ue=0,Je=0,yn=null,jo=!1,bl=!1,Wh=!1,Kr=0,xt=0,Mo=0,Ni=0,Zh=0,xn=0,wl=0,Xa=null,on=null,Kh=!1,tu=0,sv=0,nu=1/0,ru=null,Oo=null,Mt=0,Do=null,Sl=null,Qr=0,Qh=0,Jh=null,cv=null,Ga=0,em=null;function vn(){return(Ze&2)!==0&&Ue!==0?Ue&-Ue:R.T!==null?lm():ac()}function uv(){if(xn===0)if((Ue&536870912)===0||Ye){var n=qi;qi<<=1,(qi&3932160)===0&&(qi=262144),xn=n}else xn=536870912;return n=pn.current,n!==null&&(n.flags|=32),xn}function ln(n,o,a){(n===ot&&(Je===2||Je===9)||n.cancelPendingCommit!==null)&&(El(n,0),zo(n,Ue,xn,!1)),li(n,a),((Ze&2)===0||n!==ot)&&(n===ot&&((Ze&2)===0&&(Ni|=a),xt===4&&zo(n,Ue,xn,!1)),dr(n))}function fv(n,o,a){if((Ze&6)!==0)throw Error(i(327));var u=!a&&(o&127)===0&&(o&n.expiredLanes)===0||ii(n,o),y=u?vT(n,o):nm(n,o,!0),v=u;do{if(y===0){bl&&!u&&zo(n,o,0,!1);break}else{if(a=n.current.alternate,v&&!yT(a)){y=nm(n,o,!1),v=!1;continue}if(y===2){if(v=o,n.errorRecoveryDisabledLanes&v)var T=0;else T=n.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){o=T;e:{var I=n;y=Xa;var Z=I.current.memoizedState.isDehydrated;if(Z&&(El(I,T).flags|=256),T=nm(I,T,!1),T!==2){if(Wh&&!Z){I.errorRecoveryDisabledLanes|=v,Ni|=v,y=4;break e}v=on,on=y,v!==null&&(on===null?on=v:on.push.apply(on,v))}y=T}if(v=!1,y!==2)continue}}if(y===1){El(n,0),zo(n,o,0,!0);break}e:{switch(u=n,v=y,v){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:zo(u,o,xn,!jo);break e;case 2:on=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(y=tu+300-Rt(),10<y)){if(zo(u,o,xn,!jo),Xi(u,0,!0)!==0)break e;Qr=o,u.timeoutHandle=Vv(dv.bind(null,u,a,on,ru,Kh,o,xn,Ni,wl,jo,v,"Throttled",-0,0),y);break e}dv(u,a,on,ru,Kh,o,xn,Ni,wl,jo,v,null,-0,0)}}break}while(!0);dr(n)}function dv(n,o,a,u,y,v,T,I,Z,ie,ue,de,le,ae){if(n.timeoutHandle=-1,de=o.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ir},ov(o,v,de);var be=(v&62914560)===v?tu-Rt():(v&4194048)===v?sv-Rt():0;if(be=tA(de,be),be!==null){Qr=v,n.cancelPendingCommit=be(bv.bind(null,n,o,v,a,u,y,T,I,Z,ue,de,null,le,ae)),zo(n,v,T,!ie);return}}bv(n,o,v,a,u,y,T,I,Z)}function yT(n){for(var o=n;;){var a=o.tag;if((a===0||a===11||a===15)&&o.flags&16384&&(a=o.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var u=0;u<a.length;u++){var y=a[u],v=y.getSnapshot;y=y.value;try{if(!hn(v(),y))return!1}catch{return!1}}if(a=o.child,o.subtreeFlags&16384&&a!==null)a.return=o,o=a;else{if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function zo(n,o,a,u){o&=~Zh,o&=~Ni,n.suspendedLanes|=o,n.pingedLanes&=~o,u&&(n.warmLanes|=o),u=n.expirationTimes;for(var y=o;0<y;){var v=31-Qe(y),T=1<<v;u[v]=-1,y&=~T}a!==0&&oc(n,a,o)}function ou(){return(Ze&6)===0?(Wa(0),!1):!0}function tm(){if(Be!==null){if(Je===0)var n=Be.return;else n=Be,Ur=gi=null,yh(n),hl=null,ja=0,n=Be;for(;n!==null;)$0(n.alternate,n),n=n.return;Be=null}}function El(n,o){var a=n.timeoutHandle;a!==-1&&(n.timeoutHandle=-1,IT(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),Qr=0,tm(),ot=n,Be=a=Hr(n.current,null),Ue=o,Je=0,yn=null,jo=!1,bl=ii(n,o),Wh=!1,wl=xn=Zh=Ni=Mo=xt=0,on=Xa=null,Kh=!1,(o&8)!==0&&(o|=o&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=o;0<u;){var y=31-Qe(u),v=1<<y;o|=n[y],u&=~v}return Kr=o,Nc(),a}function hv(n,o){Me=null,R.H=Ha,o===dl||o===Oc?(o=Ax(),Je=3):o===ih?(o=Ax(),Je=4):Je=o===Oh?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,yn=o,Be===null&&(xt=1,Xc(n,jn(o,n.current)))}function mv(){var n=pn.current;return n===null?!0:(Ue&4194048)===Ue?zn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?n===zn:!1}function pv(){var n=R.H;return R.H=Ha,n===null?Ha:n}function gv(){var n=R.A;return R.A=pT,n}function iu(){xt=4,jo||(Ue&4194048)!==Ue&&pn.current!==null||(bl=!0),(Mo&134217727)===0&&(Ni&134217727)===0||ot===null||zo(ot,Ue,xn,!1)}function nm(n,o,a){var u=Ze;Ze|=2;var y=pv(),v=gv();(ot!==n||Ue!==o)&&(ru=null,El(n,o)),o=!1;var T=xt;e:do try{if(Je!==0&&Be!==null){var I=Be,Z=yn;switch(Je){case 8:tm(),T=6;break e;case 3:case 2:case 9:case 6:pn.current===null&&(o=!0);var ie=Je;if(Je=0,yn=null,Cl(n,I,Z,ie),a&&bl){T=0;break e}break;default:ie=Je,Je=0,yn=null,Cl(n,I,Z,ie)}}xT(),T=xt;break}catch(ue){hv(n,ue)}while(!0);return o&&n.shellSuspendCounter++,Ur=gi=null,Ze=u,R.H=y,R.A=v,Be===null&&(ot=null,Ue=0,Nc()),T}function xT(){for(;Be!==null;)yv(Be)}function vT(n,o){var a=Ze;Ze|=2;var u=pv(),y=gv();ot!==n||Ue!==o?(ru=null,nu=Rt()+500,El(n,o)):bl=ii(n,o);e:do try{if(Je!==0&&Be!==null){o=Be;var v=yn;t:switch(Je){case 1:Je=0,yn=null,Cl(n,o,v,1);break;case 2:case 9:if(kx(v)){Je=0,yn=null,xv(o);break}o=function(){Je!==2&&Je!==9||ot!==n||(Je=7),dr(n)},v.then(o,o);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:kx(v)?(Je=0,yn=null,xv(o)):(Je=0,yn=null,Cl(n,o,v,7));break;case 5:var T=null;switch(Be.tag){case 26:T=Be.memoizedState;case 5:case 27:var I=Be;if(T?rb(T):I.stateNode.complete){Je=0,yn=null;var Z=I.sibling;if(Z!==null)Be=Z;else{var ie=I.return;ie!==null?(Be=ie,lu(ie)):Be=null}break t}}Je=0,yn=null,Cl(n,o,v,5);break;case 6:Je=0,yn=null,Cl(n,o,v,6);break;case 8:tm(),xt=6;break e;default:throw Error(i(462))}}bT();break}catch(ue){hv(n,ue)}while(!0);return Ur=gi=null,R.H=u,R.A=y,Ze=a,Be!==null?0:(ot=null,Ue=0,Nc(),xt)}function bT(){for(;Be!==null&&!jr();)yv(Be)}function yv(n){var o=U0(n.alternate,n,Kr);n.memoizedProps=n.pendingProps,o===null?lu(n):Be=o}function xv(n){var o=n,a=o.alternate;switch(o.tag){case 15:case 0:o=z0(a,o,o.pendingProps,o.type,void 0,Ue);break;case 11:o=z0(a,o,o.pendingProps,o.type.render,o.ref,Ue);break;case 5:yh(o);default:$0(a,o),o=Be=gx(o,Kr),o=U0(a,o,Kr)}n.memoizedProps=n.pendingProps,o===null?lu(n):Be=o}function Cl(n,o,a,u){Ur=gi=null,yh(o),hl=null,ja=0;var y=o.return;try{if(sT(n,y,o,a,Ue)){xt=1,Xc(n,jn(a,n.current)),Be=null;return}}catch(v){if(y!==null)throw Be=y,v;xt=1,Xc(n,jn(a,n.current)),Be=null;return}o.flags&32768?(Ye||u===1?n=!0:bl||(Ue&536870912)!==0?n=!1:(jo=n=!0,(u===2||u===9||u===3||u===6)&&(u=pn.current,u!==null&&u.tag===13&&(u.flags|=16384))),vv(o,n)):lu(o)}function lu(n){var o=n;do{if((o.flags&32768)!==0){vv(o,jo);return}n=o.return;var a=fT(o.alternate,o,Kr);if(a!==null){Be=a;return}if(o=o.sibling,o!==null){Be=o;return}Be=o=n}while(o!==null);xt===0&&(xt=5)}function vv(n,o){do{var a=dT(n.alternate,n);if(a!==null){a.flags&=32767,Be=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!o&&(n=n.sibling,n!==null)){Be=n;return}Be=n=a}while(n!==null);xt=6,Be=null}function bv(n,o,a,u,y,v,T,I,Z){n.cancelPendingCommit=null;do au();while(Mt!==0);if((Ze&6)!==0)throw Error(i(327));if(o!==null){if(o===n.current)throw Error(i(177));if(v=o.lanes|o.childLanes,v|=Yd,bd(n,a,v,T,I,Z),n===ot&&(Be=ot=null,Ue=0),Sl=o,Do=n,Qr=a,Qh=v,Jh=y,cv=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,CT(ke,function(){return Nv(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=R.T,R.T=null,y=V.p,V.p=2,T=Ze,Ze|=4;try{hT(n,o,a)}finally{Ze=T,V.p=y,R.T=u}}Mt=1,wv(),Sv(),Ev()}}function wv(){if(Mt===1){Mt=0;var n=Do,o=Sl,a=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||a){a=R.T,R.T=null;var u=V.p;V.p=2;var y=Ze;Ze|=4;try{tv(o,n);var v=mm,T=ax(n.containerInfo),I=v.focusedElem,Z=v.selectionRange;if(T!==I&&I&&I.ownerDocument&&lx(I.ownerDocument.documentElement,I)){if(Z!==null&&Hd(I)){var ie=Z.start,ue=Z.end;if(ue===void 0&&(ue=ie),"selectionStart"in I)I.selectionStart=ie,I.selectionEnd=Math.min(ue,I.value.length);else{var de=I.ownerDocument||document,le=de&&de.defaultView||window;if(le.getSelection){var ae=le.getSelection(),be=I.textContent.length,Te=Math.min(Z.start,be),rt=Z.end===void 0?Te:Math.min(Z.end,be);!ae.extend&&Te>rt&&(T=rt,rt=Te,Te=T);var ee=ix(I,Te),Q=ix(I,rt);if(ee&&Q&&(ae.rangeCount!==1||ae.anchorNode!==ee.node||ae.anchorOffset!==ee.offset||ae.focusNode!==Q.node||ae.focusOffset!==Q.offset)){var re=de.createRange();re.setStart(ee.node,ee.offset),ae.removeAllRanges(),Te>rt?(ae.addRange(re),ae.extend(Q.node,Q.offset)):(re.setEnd(Q.node,Q.offset),ae.addRange(re))}}}}for(de=[],ae=I;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<de.length;I++){var fe=de[I];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}vu=!!hm,mm=hm=null}finally{Ze=y,V.p=u,R.T=a}}n.current=o,Mt=2}}function Sv(){if(Mt===2){Mt=0;var n=Do,o=Sl,a=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||a){a=R.T,R.T=null;var u=V.p;V.p=2;var y=Ze;Ze|=4;try{Z0(n,o.alternate,o)}finally{Ze=y,V.p=u,R.T=a}}Mt=3}}function Ev(){if(Mt===4||Mt===3){Mt=0,Mr();var n=Do,o=Sl,a=Qr,u=cv;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Mt=5:(Mt=0,Sl=Do=null,Cv(n,n.pendingLanes));var y=n.pendingLanes;if(y===0&&(Oo=null),ma(a),o=o.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Lt,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=R.T,y=V.p,V.p=2,R.T=null;try{for(var v=n.onRecoverableError,T=0;T<u.length;T++){var I=u[T];v(I.value,{componentStack:I.stack})}}finally{R.T=o,V.p=y}}(Qr&3)!==0&&au(),dr(n),y=n.pendingLanes,(a&261930)!==0&&(y&42)!==0?n===em?Ga++:(Ga=0,em=n):Ga=0,Wa(0)}}function Cv(n,o){(n.pooledCacheLanes&=o)===0&&(o=n.pooledCache,o!=null&&(n.pooledCache=null,Aa(o)))}function au(){return wv(),Sv(),Ev(),Nv()}function Nv(){if(Mt!==5)return!1;var n=Do,o=Qh;Qh=0;var a=ma(Qr),u=R.T,y=V.p;try{V.p=32>a?32:a,R.T=null,a=Jh,Jh=null;var v=Do,T=Qr;if(Mt=0,Sl=Do=null,Qr=0,(Ze&6)!==0)throw Error(i(331));var I=Ze;if(Ze|=4,lv(v.current),rv(v,v.current,T,a),Ze=I,Wa(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Lt,v)}catch{}return!0}finally{V.p=y,R.T=u,Cv(n,o)}}function _v(n,o,a){o=jn(a,o),o=Mh(n.stateNode,o,2),n=ko(n,o,2),n!==null&&(li(n,2),dr(n))}function et(n,o,a){if(n.tag===3)_v(n,n,a);else for(;o!==null;){if(o.tag===3){_v(o,n,a);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Oo===null||!Oo.has(u))){n=jn(a,n),a=k0(2),u=ko(o,a,2),u!==null&&(T0(a,u,o,n),li(u,2),dr(u));break}}o=o.return}}function rm(n,o,a){var u=n.pingCache;if(u===null){u=n.pingCache=new gT;var y=new Set;u.set(o,y)}else y=u.get(o),y===void 0&&(y=new Set,u.set(o,y));y.has(a)||(Wh=!0,y.add(a),n=wT.bind(null,n,o,a),o.then(n,n))}function wT(n,o,a){var u=n.pingCache;u!==null&&u.delete(o),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,ot===n&&(Ue&a)===a&&(xt===4||xt===3&&(Ue&62914560)===Ue&&300>Rt()-tu?(Ze&2)===0&&El(n,0):Zh|=a,wl===Ue&&(wl=0)),dr(n)}function kv(n,o){o===0&&(o=rc()),n=hi(n,o),n!==null&&(li(n,o),dr(n))}function ST(n){var o=n.memoizedState,a=0;o!==null&&(a=o.retryLane),kv(n,a)}function ET(n,o){var a=0;switch(n.tag){case 31:case 13:var u=n.stateNode,y=n.memoizedState;y!==null&&(a=y.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(o),kv(n,a)}function CT(n,o){return Kt(n,o)}var su=null,Nl=null,om=!1,cu=!1,im=!1,Lo=0;function dr(n){n!==Nl&&n.next===null&&(Nl===null?su=Nl=n:Nl=Nl.next=n),cu=!0,om||(om=!0,_T())}function Wa(n,o){if(!im&&cu){im=!0;do for(var a=!1,u=su;u!==null;){if(n!==0){var y=u.pendingLanes;if(y===0)var v=0;else{var T=u.suspendedLanes,I=u.pingedLanes;v=(1<<31-Qe(42|n)+1)-1,v&=y&~(T&~I),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(a=!0,jv(u,v))}else v=Ue,v=Xi(u,u===ot?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||ii(u,v)||(a=!0,jv(u,v));u=u.next}while(a);im=!1}}function NT(){Tv()}function Tv(){cu=om=!1;var n=0;Lo!==0&&LT()&&(n=Lo);for(var o=Rt(),a=null,u=su;u!==null;){var y=u.next,v=Av(u,o);v===0?(u.next=null,a===null?su=y:a.next=y,y===null&&(Nl=a)):(a=u,(n!==0||(v&3)!==0)&&(cu=!0)),u=y}Mt!==0&&Mt!==5||Wa(n),Lo!==0&&(Lo=0)}function Av(n,o){for(var a=n.suspendedLanes,u=n.pingedLanes,y=n.expirationTimes,v=n.pendingLanes&-62914561;0<v;){var T=31-Qe(v),I=1<<T,Z=y[T];Z===-1?((I&a)===0||(I&u)!==0)&&(y[T]=vd(I,o)):Z<=o&&(n.expiredLanes|=I),v&=~I}if(o=ot,a=Ue,a=Xi(n,n===o?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,a===0||n===o&&(Je===2||Je===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&Vn(u),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||ii(n,a)){if(o=a&-a,o===n.callbackPriority)return o;switch(u!==null&&Vn(u),ma(a)){case 2:case 8:a=ye;break;case 32:a=ke;break;case 268435456:a=qe;break;default:a=ke}return u=Rv.bind(null,n),a=Kt(a,u),n.callbackPriority=o,n.callbackNode=a,o}return u!==null&&u!==null&&Vn(u),n.callbackPriority=2,n.callbackNode=null,2}function Rv(n,o){if(Mt!==0&&Mt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(au()&&n.callbackNode!==a)return null;var u=Ue;return u=Xi(n,n===ot?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(fv(n,u,o),Av(n,Rt()),n.callbackNode!=null&&n.callbackNode===a?Rv.bind(null,n):null)}function jv(n,o){if(au())return null;fv(n,o,!0)}function _T(){BT(function(){(Ze&6)!==0?Kt(ce,NT):Tv()})}function lm(){if(Lo===0){var n=ul;n===0&&(n=Yi,Yi<<=1,(Yi&261888)===0&&(Yi=256)),Lo=n}return Lo}function Mv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:yc(""+n)}function Ov(n,o){var a=o.ownerDocument.createElement("input");return a.name=o.name,a.value=o.value,n.id&&a.setAttribute("form",n.id),o.parentNode.insertBefore(a,o),n=new FormData(n),a.parentNode.removeChild(a),n}function kT(n,o,a,u,y){if(o==="submit"&&a&&a.stateNode===y){var v=Mv((y[Yt]||null).action),T=u.submitter;T&&(o=(o=T[Yt]||null)?Mv(o.formAction):T.getAttribute("formAction"),o!==null&&(v=o,T=null));var I=new wc("action","action",null,u,y);n.push({event:I,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Lo!==0){var Z=T?Ov(y,T):new FormData(y);_h(a,{pending:!0,data:Z,method:y.method,action:v},null,Z)}}else typeof v=="function"&&(I.preventDefault(),Z=T?Ov(y,T):new FormData(y),_h(a,{pending:!0,data:Z,method:y.method,action:v},v,Z))},currentTarget:y}]})}}for(var am=0;am<$d.length;am++){var sm=$d[am],TT=sm.toLowerCase(),AT=sm[0].toUpperCase()+sm.slice(1);qn(TT,"on"+AT)}qn(ux,"onAnimationEnd"),qn(fx,"onAnimationIteration"),qn(dx,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(qk,"onTransitionRun"),qn(Fk,"onTransitionStart"),qn(Xk,"onTransitionCancel"),qn(hx,"onTransitionEnd"),vo("onMouseEnter",["mouseout","mouseover"]),vo("onMouseLeave",["mouseout","mouseover"]),vo("onPointerEnter",["pointerout","pointerover"]),vo("onPointerLeave",["pointerout","pointerover"]),zr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zr("onBeforeInput",["compositionend","keypress","textInput","paste"]),zr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Za="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(" "),RT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Za));function Dv(n,o){o=(o&4)!==0;for(var a=0;a<n.length;a++){var u=n[a],y=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var T=u.length-1;0<=T;T--){var I=u[T],Z=I.instance,ie=I.currentTarget;if(I=I.listener,Z!==v&&y.isPropagationStopped())break e;v=I,y.currentTarget=ie;try{v(y)}catch(ue){Cc(ue)}y.currentTarget=null,v=Z}else for(T=0;T<u.length;T++){if(I=u[T],Z=I.instance,ie=I.currentTarget,I=I.listener,Z!==v&&y.isPropagationStopped())break e;v=I,y.currentTarget=ie;try{v(y)}catch(ue){Cc(ue)}y.currentTarget=null,v=Z}}}}function He(n,o){var a=o[Gi];a===void 0&&(a=o[Gi]=new Set);var u=n+"__bubble";a.has(u)||(zv(o,n,2,!1),a.add(u))}function cm(n,o,a){var u=0;o&&(u|=4),zv(a,n,u,o)}var uu="_reactListening"+Math.random().toString(36).slice(2);function um(n){if(!n[uu]){n[uu]=!0,fc.forEach(function(a){a!=="selectionchange"&&(RT.has(a)||cm(a,!1,n),cm(a,!0,n))});var o=n.nodeType===9?n:n.ownerDocument;o===null||o[uu]||(o[uu]=!0,cm("selectionchange",!1,o))}}function zv(n,o,a,u){switch(ub(o)){case 2:var y=oA;break;case 8:y=iA;break;default:y=Nm}a=y.bind(null,o,a,n),y=void 0,!Rd||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),u?y!==void 0?n.addEventListener(o,a,{capture:!0,passive:y}):n.addEventListener(o,a,!0):y!==void 0?n.addEventListener(o,a,{passive:y}):n.addEventListener(o,a,!1)}function fm(n,o,a,u,y){var v=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var T=u.tag;if(T===3||T===4){var I=u.stateNode.containerInfo;if(I===y)break;if(T===4)for(T=u.return;T!==null;){var Z=T.tag;if((Z===3||Z===4)&&T.stateNode.containerInfo===y)return;T=T.return}for(;I!==null;){if(T=po(I),T===null)return;if(Z=T.tag,Z===5||Z===6||Z===26||Z===27){u=v=T;continue e}I=I.parentNode}}u=u.return}Py(function(){var ie=v,ue=Td(a),de=[];e:{var le=mx.get(n);if(le!==void 0){var ae=wc,be=n;switch(n){case"keypress":if(vc(a)===0)break e;case"keydown":case"keyup":ae=Ek;break;case"focusin":be="focus",ae=Dd;break;case"focusout":be="blur",ae=Dd;break;case"beforeblur":case"afterblur":ae=Dd;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":ae=$y;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=fk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=_k;break;case ux:case fx:case dx:ae=mk;break;case hx:ae=Tk;break;case"scroll":case"scrollend":ae=ck;break;case"wheel":ae=Rk;break;case"copy":case"cut":case"paste":ae=gk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=qy;break;case"toggle":case"beforetoggle":ae=Mk}var Te=(o&4)!==0,rt=!Te&&(n==="scroll"||n==="scrollend"),ee=Te?le!==null?le+"Capture":null:le;Te=[];for(var Q=ie,re;Q!==null;){var fe=Q;if(re=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||re===null||ee===null||(fe=xa(Q,ee),fe!=null&&Te.push(Ka(Q,fe,re))),rt)break;Q=Q.return}0<Te.length&&(le=new ae(le,be,null,a,ue),de.push({event:le,listeners:Te}))}}if((o&7)===0){e:{if(le=n==="mouseover"||n==="pointerover",ae=n==="mouseout"||n==="pointerout",le&&a!==kd&&(be=a.relatedTarget||a.fromElement)&&(po(be)||be[Dr]))break e;if((ae||le)&&(le=ue.window===ue?ue:(le=ue.ownerDocument)?le.defaultView||le.parentWindow:window,ae?(be=a.relatedTarget||a.toElement,ae=ie,be=be?po(be):null,be!==null&&(rt=s(be),Te=be.tag,be!==rt||Te!==5&&Te!==27&&Te!==6)&&(be=null)):(ae=null,be=ie),ae!==be)){if(Te=$y,fe="onMouseLeave",ee="onMouseEnter",Q="mouse",(n==="pointerout"||n==="pointerover")&&(Te=qy,fe="onPointerLeave",ee="onPointerEnter",Q="pointer"),rt=ae==null?le:yo(ae),re=be==null?le:yo(be),le=new Te(fe,Q+"leave",ae,a,ue),le.target=rt,le.relatedTarget=re,fe=null,po(ue)===ie&&(Te=new Te(ee,Q+"enter",be,a,ue),Te.target=re,Te.relatedTarget=rt,fe=Te),rt=fe,ae&&be)t:{for(Te=jT,ee=ae,Q=be,re=0,fe=ee;fe;fe=Te(fe))re++;fe=0;for(var Ne=Q;Ne;Ne=Te(Ne))fe++;for(;0<re-fe;)ee=Te(ee),re--;for(;0<fe-re;)Q=Te(Q),fe--;for(;re--;){if(ee===Q||Q!==null&&ee===Q.alternate){Te=ee;break t}ee=Te(ee),Q=Te(Q)}Te=null}else Te=null;ae!==null&&Lv(de,le,ae,Te,!1),be!==null&&rt!==null&&Lv(de,rt,be,Te,!0)}}e:{if(le=ie?yo(ie):window,ae=le.nodeName&&le.nodeName.toLowerCase(),ae==="select"||ae==="input"&&le.type==="file")var Xe=Jy;else if(Ky(le))if(ex)Xe=Vk;else{Xe=Pk;var Ee=Hk}else ae=le.nodeName,!ae||ae.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ie&&_d(ie.elementType)&&(Xe=Jy):Xe=Uk;if(Xe&&(Xe=Xe(n,ie))){Qy(de,Xe,a,ue);break e}Ee&&Ee(n,le,ie),n==="focusout"&&ie&&le.type==="number"&&ie.memoizedProps.value!=null&&ya(le,"number",le.value)}switch(Ee=ie?yo(ie):window,n){case"focusin":(Ky(Ee)||Ee.contentEditable==="true")&&(nl=Ee,Pd=ie,_a=null);break;case"focusout":_a=Pd=nl=null;break;case"mousedown":Ud=!0;break;case"contextmenu":case"mouseup":case"dragend":Ud=!1,sx(de,a,ue);break;case"selectionchange":if(Yk)break;case"keydown":case"keyup":sx(de,a,ue)}var De;if(Ld)e:{switch(n){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else tl?Wy(n,a)&&(Ve="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(Fy&&a.locale!=="ko"&&(tl||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&tl&&(De=Uy()):(bo=ue,jd="value"in bo?bo.value:bo.textContent,tl=!0)),Ee=fu(ie,Ve),0<Ee.length&&(Ve=new Yy(Ve,n,null,a,ue),de.push({event:Ve,listeners:Ee}),De?Ve.data=De:(De=Zy(a),De!==null&&(Ve.data=De)))),(De=Dk?zk(n,a):Lk(n,a))&&(Ve=fu(ie,"onBeforeInput"),0<Ve.length&&(Ee=new Yy("onBeforeInput","beforeinput",null,a,ue),de.push({event:Ee,listeners:Ve}),Ee.data=De)),kT(de,n,ie,a,ue)}Dv(de,o)})}function Ka(n,o,a){return{instance:n,listener:o,currentTarget:a}}function fu(n,o){for(var a=o+"Capture",u=[];n!==null;){var y=n,v=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||v===null||(y=xa(n,a),y!=null&&u.unshift(Ka(n,y,v)),y=xa(n,o),y!=null&&u.push(Ka(n,y,v))),n.tag===3)return u;n=n.return}return[]}function jT(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Lv(n,o,a,u,y){for(var v=o._reactName,T=[];a!==null&&a!==u;){var I=a,Z=I.alternate,ie=I.stateNode;if(I=I.tag,Z!==null&&Z===u)break;I!==5&&I!==26&&I!==27||ie===null||(Z=ie,y?(ie=xa(a,v),ie!=null&&T.unshift(Ka(a,ie,Z))):y||(ie=xa(a,v),ie!=null&&T.push(Ka(a,ie,Z)))),a=a.return}T.length!==0&&n.push({event:o,listeners:T})}var MT=/\r\n?/g,OT=/\u0000|\uFFFD/g;function Iv(n){return(typeof n=="string"?n:""+n).replace(MT,`
9
+ `).replace(OT,"")}function Bv(n,o){return o=Iv(o),Iv(n)===o}function nt(n,o,a,u,y,v){switch(a){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||Qi(n,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&Qi(n,""+u);break;case"className":Zi(n,"class",u);break;case"tabIndex":Zi(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Zi(n,a,u);break;case"style":By(n,u,v);break;case"data":if(o!=="object"){Zi(n,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||a!=="href")){n.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(a);break}u=yc(""+u),n.setAttribute(a,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(a==="formAction"?(o!=="input"&&nt(n,o,"name",y.name,y,null),nt(n,o,"formEncType",y.formEncType,y,null),nt(n,o,"formMethod",y.formMethod,y,null),nt(n,o,"formTarget",y.formTarget,y,null)):(nt(n,o,"encType",y.encType,y,null),nt(n,o,"method",y.method,y,null),nt(n,o,"target",y.target,y,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(a);break}u=yc(""+u),n.setAttribute(a,u);break;case"onClick":u!=null&&(n.onclick=Ir);break;case"onScroll":u!=null&&He("scroll",n);break;case"onScrollEnd":u!=null&&He("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(a=u.__html,a!=null){if(y.children!=null)throw Error(i(60));n.innerHTML=a}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}a=yc(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(a,""+u):n.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":u===!0?n.setAttribute(a,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(a,u):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(a,u):n.removeAttribute(a);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(a):n.setAttribute(a,u);break;case"popover":He("beforetoggle",n),He("toggle",n),Wi(n,"popover",u);break;case"xlinkActuate":Yn(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Yn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Yn(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Yn(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Yn(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Yn(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Wi(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ak.get(a)||a,Wi(n,a,u))}}function dm(n,o,a,u,y,v){switch(a){case"style":By(n,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(a=u.__html,a!=null){if(y.children!=null)throw Error(i(60));n.innerHTML=a}}break;case"children":typeof u=="string"?Qi(n,u):(typeof u=="number"||typeof u=="bigint")&&Qi(n,""+u);break;case"onScroll":u!=null&&He("scroll",n);break;case"onScrollEnd":u!=null&&He("scrollend",n);break;case"onClick":u!=null&&(n.onclick=Ir);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(y=a.endsWith("Capture"),o=a.slice(2,y?a.length-7:void 0),v=n[Yt]||null,v=v!=null?v[a]:null,typeof v=="function"&&n.removeEventListener(o,v,y),typeof u=="function")){typeof v!="function"&&v!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(o,u,y);break e}a in n?n[a]=u:u===!0?n.setAttribute(a,""):Wi(n,a,u)}}}function Pt(n,o,a){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",n),He("load",n);var u=!1,y=!1,v;for(v in a)if(a.hasOwnProperty(v)){var T=a[v];if(T!=null)switch(v){case"src":u=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:nt(n,o,v,T,a,null)}}y&&nt(n,o,"srcSet",a.srcSet,a,null),u&&nt(n,o,"src",a.src,a,null);return;case"input":He("invalid",n);var I=v=T=y=null,Z=null,ie=null;for(u in a)if(a.hasOwnProperty(u)){var ue=a[u];if(ue!=null)switch(u){case"name":y=ue;break;case"type":T=ue;break;case"checked":Z=ue;break;case"defaultChecked":ie=ue;break;case"value":v=ue;break;case"defaultValue":I=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,o));break;default:nt(n,o,u,ue,a,null)}}gc(n,v,I,Z,ie,T,y,!1);return;case"select":He("invalid",n),u=T=v=null;for(y in a)if(a.hasOwnProperty(y)&&(I=a[y],I!=null))switch(y){case"value":v=I;break;case"defaultValue":T=I;break;case"multiple":u=I;default:nt(n,o,y,I,a,null)}o=v,a=T,n.multiple=!!u,o!=null?Lr(n,!!u,o,!1):a!=null&&Lr(n,!!u,a,!0);return;case"textarea":He("invalid",n),v=y=u=null;for(T in a)if(a.hasOwnProperty(T)&&(I=a[T],I!=null))switch(T){case"value":u=I;break;case"defaultValue":y=I;break;case"children":v=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(i(91));break;default:nt(n,o,T,I,a,null)}Ly(n,u,y,v);return;case"option":for(Z in a)a.hasOwnProperty(Z)&&(u=a[Z],u!=null)&&(Z==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":nt(n,o,Z,u,a,null));return;case"dialog":He("beforetoggle",n),He("toggle",n),He("cancel",n),He("close",n);break;case"iframe":case"object":He("load",n);break;case"video":case"audio":for(u=0;u<Za.length;u++)He(Za[u],n);break;case"image":He("error",n),He("load",n);break;case"details":He("toggle",n);break;case"embed":case"source":case"link":He("error",n),He("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in a)if(a.hasOwnProperty(ie)&&(u=a[ie],u!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:nt(n,o,ie,u,a,null)}return;default:if(_d(o)){for(ue in a)a.hasOwnProperty(ue)&&(u=a[ue],u!==void 0&&dm(n,o,ue,u,a,void 0));return}}for(I in a)a.hasOwnProperty(I)&&(u=a[I],u!=null&&nt(n,o,I,u,a,null))}function DT(n,o,a,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,v=null,T=null,I=null,Z=null,ie=null,ue=null;for(ae in a){var de=a[ae];if(a.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":Z=de;default:u.hasOwnProperty(ae)||nt(n,o,ae,null,u,de)}}for(var le in u){var ae=u[le];if(de=a[le],u.hasOwnProperty(le)&&(ae!=null||de!=null))switch(le){case"type":v=ae;break;case"name":y=ae;break;case"checked":ie=ae;break;case"defaultChecked":ue=ae;break;case"value":T=ae;break;case"defaultValue":I=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,o));break;default:ae!==de&&nt(n,o,le,ae,u,de)}}ci(n,T,I,Z,ie,ue,v,y);return;case"select":ae=T=I=le=null;for(v in a)if(Z=a[v],a.hasOwnProperty(v)&&Z!=null)switch(v){case"value":break;case"multiple":ae=Z;default:u.hasOwnProperty(v)||nt(n,o,v,null,u,Z)}for(y in u)if(v=u[y],Z=a[y],u.hasOwnProperty(y)&&(v!=null||Z!=null))switch(y){case"value":le=v;break;case"defaultValue":I=v;break;case"multiple":T=v;default:v!==Z&&nt(n,o,y,v,u,Z)}o=I,a=T,u=ae,le!=null?Lr(n,!!a,le,!1):!!u!=!!a&&(o!=null?Lr(n,!!a,o,!0):Lr(n,!!a,a?[]:"",!1));return;case"textarea":ae=le=null;for(I in a)if(y=a[I],a.hasOwnProperty(I)&&y!=null&&!u.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:nt(n,o,I,null,u,y)}for(T in u)if(y=u[T],v=a[T],u.hasOwnProperty(T)&&(y!=null||v!=null))switch(T){case"value":le=y;break;case"defaultValue":ae=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==v&&nt(n,o,T,y,u,v)}zy(n,le,ae);return;case"option":for(var be in a)le=a[be],a.hasOwnProperty(be)&&le!=null&&!u.hasOwnProperty(be)&&(be==="selected"?n.selected=!1:nt(n,o,be,null,u,le));for(Z in u)le=u[Z],ae=a[Z],u.hasOwnProperty(Z)&&le!==ae&&(le!=null||ae!=null)&&(Z==="selected"?n.selected=le&&typeof le!="function"&&typeof le!="symbol":nt(n,o,Z,le,u,ae));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in a)le=a[Te],a.hasOwnProperty(Te)&&le!=null&&!u.hasOwnProperty(Te)&&nt(n,o,Te,null,u,le);for(ie in u)if(le=u[ie],ae=a[ie],u.hasOwnProperty(ie)&&le!==ae&&(le!=null||ae!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(i(137,o));break;default:nt(n,o,ie,le,u,ae)}return;default:if(_d(o)){for(var rt in a)le=a[rt],a.hasOwnProperty(rt)&&le!==void 0&&!u.hasOwnProperty(rt)&&dm(n,o,rt,void 0,u,le);for(ue in u)le=u[ue],ae=a[ue],!u.hasOwnProperty(ue)||le===ae||le===void 0&&ae===void 0||dm(n,o,ue,le,u,ae);return}}for(var ee in a)le=a[ee],a.hasOwnProperty(ee)&&le!=null&&!u.hasOwnProperty(ee)&&nt(n,o,ee,null,u,le);for(de in u)le=u[de],ae=a[de],!u.hasOwnProperty(de)||le===ae||le==null&&ae==null||nt(n,o,de,le,u,ae)}function Hv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zT(){if(typeof performance.getEntriesByType=="function"){for(var n=0,o=0,a=performance.getEntriesByType("resource"),u=0;u<a.length;u++){var y=a[u],v=y.transferSize,T=y.initiatorType,I=y.duration;if(v&&I&&Hv(T)){for(T=0,I=y.responseEnd,u+=1;u<a.length;u++){var Z=a[u],ie=Z.startTime;if(ie>I)break;var ue=Z.transferSize,de=Z.initiatorType;ue&&Hv(de)&&(Z=Z.responseEnd,T+=ue*(Z<I?1:(I-ie)/(Z-ie)))}if(--u,o+=8*(v+T)/(y.duration/1e3),n++,10<n)break}}if(0<n)return o/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var hm=null,mm=null;function du(n){return n.nodeType===9?n:n.ownerDocument}function Pv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Uv(n,o){if(n===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&o==="foreignObject"?0:n}function pm(n,o){return n==="textarea"||n==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var gm=null;function LT(){var n=window.event;return n&&n.type==="popstate"?n===gm?!1:(gm=n,!0):(gm=null,!1)}var Vv=typeof setTimeout=="function"?setTimeout:void 0,IT=typeof clearTimeout=="function"?clearTimeout:void 0,$v=typeof Promise=="function"?Promise:void 0,BT=typeof queueMicrotask=="function"?queueMicrotask:typeof $v<"u"?function(n){return $v.resolve(null).then(n).catch(HT)}:Vv;function HT(n){setTimeout(function(){throw n})}function Io(n){return n==="head"}function Yv(n,o){var a=o,u=0;do{var y=a.nextSibling;if(n.removeChild(a),y&&y.nodeType===8)if(a=y.data,a==="/$"||a==="/&"){if(u===0){n.removeChild(y),Al(o);return}u--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")u++;else if(a==="html")Qa(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,Qa(a);for(var v=a.firstChild;v;){var T=v.nextSibling,I=v.nodeName;v[ai]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&v.rel.toLowerCase()==="stylesheet"||a.removeChild(v),v=T}}else a==="body"&&Qa(n.ownerDocument.body);a=y}while(a);Al(o)}function qv(n,o){var a=n;n=0;do{var u=a.nextSibling;if(a.nodeType===1?o?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(o?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=u}while(a)}function ym(n){var o=n.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var a=o;switch(o=o.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ym(a),pa(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function PT(n,o,a,u){for(;n.nodeType===1;){var y=a;if(n.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[ai])switch(o){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(v=n.getAttribute("rel"),v==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(v!==y.rel||n.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||n.getAttribute("title")!==(y.title==null?null:y.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(v=n.getAttribute("src"),(v!==(y.src==null?null:y.src)||n.getAttribute("type")!==(y.type==null?null:y.type)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&v&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(o==="input"&&n.type==="hidden"){var v=y.name==null?null:""+y.name;if(y.type==="hidden"&&n.getAttribute("name")===v)return n}else return n;if(n=Ln(n.nextSibling),n===null)break}return null}function UT(n,o,a){if(o==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Ln(n.nextSibling),n===null))return null;return n}function Fv(n,o){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Ln(n.nextSibling),n===null))return null;return n}function xm(n){return n.data==="$?"||n.data==="$~"}function vm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function VT(n,o){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=o;else if(n.data!=="$?"||a.readyState!=="loading")o();else{var u=function(){o(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function Ln(n){for(;n!=null;n=n.nextSibling){var o=n.nodeType;if(o===1||o===3)break;if(o===8){if(o=n.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return n}var bm=null;function Xv(n){n=n.nextSibling;for(var o=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(o===0)return Ln(n.nextSibling);o--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||o++}n=n.nextSibling}return null}function Gv(n){n=n.previousSibling;for(var o=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(o===0)return n;o--}else a!=="/$"&&a!=="/&"||o++}n=n.previousSibling}return null}function Wv(n,o,a){switch(o=du(a),n){case"html":if(n=o.documentElement,!n)throw Error(i(452));return n;case"head":if(n=o.head,!n)throw Error(i(453));return n;case"body":if(n=o.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function Qa(n){for(var o=n.attributes;o.length;)n.removeAttributeNode(o[0]);pa(n)}var In=new Map,Zv=new Set;function hu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Jr=V.d;V.d={f:$T,r:YT,D:qT,C:FT,L:XT,m:GT,X:ZT,S:WT,M:KT};function $T(){var n=Jr.f(),o=ou();return n||o}function YT(n){var o=go(n);o!==null&&o.tag===5&&o.type==="form"?h0(o):Jr.r(n)}var _l=typeof document>"u"?null:document;function Kv(n,o,a){var u=_l;if(u&&typeof o=="string"&&o){var y=Jt(o);y='link[rel="'+n+'"][href="'+y+'"]',typeof a=="string"&&(y+='[crossorigin="'+a+'"]'),Zv.has(y)||(Zv.add(y),n={rel:n,crossOrigin:a,href:o},u.querySelector(y)===null&&(o=u.createElement("link"),Pt(o,"link",n),Et(o),u.head.appendChild(o)))}}function qT(n){Jr.D(n),Kv("dns-prefetch",n,null)}function FT(n,o){Jr.C(n,o),Kv("preconnect",n,o)}function XT(n,o,a){Jr.L(n,o,a);var u=_l;if(u&&n&&o){var y='link[rel="preload"][as="'+Jt(o)+'"]';o==="image"&&a&&a.imageSrcSet?(y+='[imagesrcset="'+Jt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(y+='[imagesizes="'+Jt(a.imageSizes)+'"]')):y+='[href="'+Jt(n)+'"]';var v=y;switch(o){case"style":v=kl(n);break;case"script":v=Tl(n)}In.has(v)||(n=g({rel:"preload",href:o==="image"&&a&&a.imageSrcSet?void 0:n,as:o},a),In.set(v,n),u.querySelector(y)!==null||o==="style"&&u.querySelector(Ja(v))||o==="script"&&u.querySelector(es(v))||(o=u.createElement("link"),Pt(o,"link",n),Et(o),u.head.appendChild(o)))}}function GT(n,o){Jr.m(n,o);var a=_l;if(a&&n){var u=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Jt(u)+'"][href="'+Jt(n)+'"]',v=y;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Tl(n)}if(!In.has(v)&&(n=g({rel:"modulepreload",href:n},o),In.set(v,n),a.querySelector(y)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(es(v)))return}u=a.createElement("link"),Pt(u,"link",n),Et(u),a.head.appendChild(u)}}}function WT(n,o,a){Jr.S(n,o,a);var u=_l;if(u&&n){var y=xo(u).hoistableStyles,v=kl(n);o=o||"default";var T=y.get(v);if(!T){var I={loading:0,preload:null};if(T=u.querySelector(Ja(v)))I.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":o},a),(a=In.get(v))&&wm(n,a);var Z=T=u.createElement("link");Et(Z),Pt(Z,"link",n),Z._p=new Promise(function(ie,ue){Z.onload=ie,Z.onerror=ue}),Z.addEventListener("load",function(){I.loading|=1}),Z.addEventListener("error",function(){I.loading|=2}),I.loading|=4,mu(T,o,u)}T={type:"stylesheet",instance:T,count:1,state:I},y.set(v,T)}}}function ZT(n,o){Jr.X(n,o);var a=_l;if(a&&n){var u=xo(a).hoistableScripts,y=Tl(n),v=u.get(y);v||(v=a.querySelector(es(y)),v||(n=g({src:n,async:!0},o),(o=In.get(y))&&Sm(n,o),v=a.createElement("script"),Et(v),Pt(v,"link",n),a.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(y,v))}}function KT(n,o){Jr.M(n,o);var a=_l;if(a&&n){var u=xo(a).hoistableScripts,y=Tl(n),v=u.get(y);v||(v=a.querySelector(es(y)),v||(n=g({src:n,async:!0,type:"module"},o),(o=In.get(y))&&Sm(n,o),v=a.createElement("script"),Et(v),Pt(v,"link",n),a.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(y,v))}}function Qv(n,o,a,u){var y=(y=J.current)?hu(y):null;if(!y)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(o=kl(a.href),a=xo(y).hoistableStyles,u=a.get(o),u||(u={type:"style",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=kl(a.href);var v=xo(y).hoistableStyles,T=v.get(n);if(T||(y=y.ownerDocument||y,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(n,T),(v=y.querySelector(Ja(n)))&&!v._p&&(T.instance=v,T.state.loading=5),In.has(n)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},In.set(n,a),v||QT(y,n,a,T.state))),o&&u===null)throw Error(i(528,""));return T}if(o&&u!==null)throw Error(i(529,""));return null;case"script":return o=a.async,a=a.src,typeof a=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Tl(a),a=xo(y).hoistableScripts,u=a.get(o),u||(u={type:"script",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function kl(n){return'href="'+Jt(n)+'"'}function Ja(n){return'link[rel="stylesheet"]['+n+"]"}function Jv(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function QT(n,o,a,u){n.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=n.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),Pt(o,"link",a),Et(o),n.head.appendChild(o))}function Tl(n){return'[src="'+Jt(n)+'"]'}function es(n){return"script[async]"+n}function eb(n,o,a){if(o.count++,o.instance===null)switch(o.type){case"style":var u=n.querySelector('style[data-href~="'+Jt(a.href)+'"]');if(u)return o.instance=u,Et(u),u;var y=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Et(u),Pt(u,"style",y),mu(u,a.precedence,n),o.instance=u;case"stylesheet":y=kl(a.href);var v=n.querySelector(Ja(y));if(v)return o.state.loading|=4,o.instance=v,Et(v),v;u=Jv(a),(y=In.get(y))&&wm(u,y),v=(n.ownerDocument||n).createElement("link"),Et(v);var T=v;return T._p=new Promise(function(I,Z){T.onload=I,T.onerror=Z}),Pt(v,"link",u),o.state.loading|=4,mu(v,a.precedence,n),o.instance=v;case"script":return v=Tl(a.src),(y=n.querySelector(es(v)))?(o.instance=y,Et(y),y):(u=a,(y=In.get(v))&&(u=g({},a),Sm(u,y)),n=n.ownerDocument||n,y=n.createElement("script"),Et(y),Pt(y,"link",u),n.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,mu(u,a.precedence,n));return o.instance}function mu(n,o,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=u.length?u[u.length-1]:null,v=y,T=0;T<u.length;T++){var I=u[T];if(I.dataset.precedence===o)v=I;else if(v!==y)break}v?v.parentNode.insertBefore(n,v.nextSibling):(o=a.nodeType===9?a.head:a,o.insertBefore(n,o.firstChild))}function wm(n,o){n.crossOrigin==null&&(n.crossOrigin=o.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=o.referrerPolicy),n.title==null&&(n.title=o.title)}function Sm(n,o){n.crossOrigin==null&&(n.crossOrigin=o.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=o.referrerPolicy),n.integrity==null&&(n.integrity=o.integrity)}var pu=null;function tb(n,o,a){if(pu===null){var u=new Map,y=pu=new Map;y.set(a,u)}else y=pu,u=y.get(a),u||(u=new Map,y.set(a,u));if(u.has(n))return u;for(u.set(n,null),a=a.getElementsByTagName(n),y=0;y<a.length;y++){var v=a[y];if(!(v[ai]||v[jt]||n==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var T=v.getAttribute(o)||"";T=n+T;var I=u.get(T);I?I.push(v):u.set(T,[v])}}return u}function nb(n,o,a){n=n.ownerDocument||n,n.head.insertBefore(a,o==="title"?n.querySelector("head > title"):null)}function JT(n,o,a){if(a===1||o.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(n=o.disabled,typeof o.precedence=="string"&&n==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function rb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function eA(n,o,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var y=kl(u.href),v=o.querySelector(Ja(y));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(n.count++,n=gu.bind(n),o.then(n,n)),a.state.loading|=4,a.instance=v,Et(v);return}v=o.ownerDocument||o,u=Jv(u),(y=In.get(y))&&wm(u,y),v=v.createElement("link"),Et(v);var T=v;T._p=new Promise(function(I,Z){T.onload=I,T.onerror=Z}),Pt(v,"link",u),a.instance=v}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,o),(o=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=gu.bind(n),o.addEventListener("load",a),o.addEventListener("error",a))}}var Em=0;function tA(n,o){return n.stylesheets&&n.count===0&&xu(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var u=setTimeout(function(){if(n.stylesheets&&xu(n,n.stylesheets),n.unsuspend){var v=n.unsuspend;n.unsuspend=null,v()}},6e4+o);0<n.imgBytes&&Em===0&&(Em=62500*zT());var y=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&xu(n,n.stylesheets),n.unsuspend)){var v=n.unsuspend;n.unsuspend=null,v()}},(n.imgBytes>Em?50:800)+o);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(y)}}:null}function gu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xu(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var yu=null;function xu(n,o){n.stylesheets=null,n.unsuspend!==null&&(n.count++,yu=new Map,o.forEach(nA,n),yu=null,gu.call(n))}function nA(n,o){if(!(o.state.loading&4)){var a=yu.get(n);if(a)var u=a.get(null);else{a=new Map,yu.set(n,a);for(var y=n.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var T=y[v];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(a.set(T.dataset.precedence,T),u=T)}u&&a.set(null,u)}y=o.instance,T=y.getAttribute("data-precedence"),v=a.get(T)||u,v===u&&a.set(null,y),a.set(T,y),this.count++,u=gu.bind(this),y.addEventListener("load",u),y.addEventListener("error",u),v?v.parentNode.insertBefore(y,v.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(y,n.firstChild)),o.state.loading|=4}}var ts={$$typeof:C,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function rA(n,o,a,u,y,v,T,I,Z){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=da(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=da(0),this.hiddenUpdates=da(null),this.identifierPrefix=u,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function ob(n,o,a,u,y,v,T,I,Z,ie,ue,de){return n=new rA(n,o,a,T,Z,ie,ue,de,I),o=1,v===!0&&(o|=24),v=mn(3,null,null,o),n.current=v,v.stateNode=n,o=nh(),o.refCount++,n.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:a,cache:o},lh(v),n}function ib(n){return n?(n=il,n):il}function lb(n,o,a,u,y,v){y=ib(y),u.context===null?u.context=y:u.pendingContext=y,u=_o(o),u.payload={element:a},v=v===void 0?null:v,v!==null&&(u.callback=v),a=ko(n,u,o),a!==null&&(ln(a,n,o),Oa(a,n,o))}function ab(n,o){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<o?a:o}}function Cm(n,o){ab(n,o),(n=n.alternate)&&ab(n,o)}function sb(n){if(n.tag===13||n.tag===31){var o=hi(n,67108864);o!==null&&ln(o,n,67108864),Cm(n,67108864)}}function cb(n){if(n.tag===13||n.tag===31){var o=vn();o=ha(o);var a=hi(n,o);a!==null&&ln(a,n,o),Cm(n,o)}}var vu=!0;function oA(n,o,a,u){var y=R.T;R.T=null;var v=V.p;try{V.p=2,Nm(n,o,a,u)}finally{V.p=v,R.T=y}}function iA(n,o,a,u){var y=R.T;R.T=null;var v=V.p;try{V.p=8,Nm(n,o,a,u)}finally{V.p=v,R.T=y}}function Nm(n,o,a,u){if(vu){var y=_m(u);if(y===null)fm(n,o,u,bu,a),fb(n,u);else if(aA(y,n,o,a,u))u.stopPropagation();else if(fb(n,u),o&4&&-1<lA.indexOf(n)){for(;y!==null;){var v=go(y);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var T=Or(v.pendingLanes);if(T!==0){var I=v;for(I.pendingLanes|=2,I.entangledLanes|=2;T;){var Z=1<<31-Qe(T);I.entanglements[1]|=Z,T&=~Z}dr(v),(Ze&6)===0&&(nu=Rt()+500,Wa(0))}}break;case 31:case 13:I=hi(v,2),I!==null&&ln(I,v,2),ou(),Cm(v,2)}if(v=_m(u),v===null&&fm(n,o,u,bu,a),v===y)break;y=v}y!==null&&u.stopPropagation()}else fm(n,o,u,null,a)}}function _m(n){return n=Td(n),km(n)}var bu=null;function km(n){if(bu=null,n=po(n),n!==null){var o=s(n);if(o===null)n=null;else{var a=o.tag;if(a===13){if(n=c(o),n!==null)return n;n=null}else if(a===31){if(n=f(o),n!==null)return n;n=null}else if(a===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;n=null}else o!==n&&(n=null)}}return bu=n,null}function ub(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(mo()){case ce:return 2;case ye:return 8;case ke:case Le:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Tm=!1,Bo=null,Ho=null,Po=null,ns=new Map,rs=new Map,Uo=[],lA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function fb(n,o){switch(n){case"focusin":case"focusout":Bo=null;break;case"dragenter":case"dragleave":Ho=null;break;case"mouseover":case"mouseout":Po=null;break;case"pointerover":case"pointerout":ns.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":rs.delete(o.pointerId)}}function os(n,o,a,u,y,v){return n===null||n.nativeEvent!==v?(n={blockedOn:o,domEventName:a,eventSystemFlags:u,nativeEvent:v,targetContainers:[y]},o!==null&&(o=go(o),o!==null&&sb(o)),n):(n.eventSystemFlags|=u,o=n.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),n)}function aA(n,o,a,u,y){switch(o){case"focusin":return Bo=os(Bo,n,o,a,u,y),!0;case"dragenter":return Ho=os(Ho,n,o,a,u,y),!0;case"mouseover":return Po=os(Po,n,o,a,u,y),!0;case"pointerover":var v=y.pointerId;return ns.set(v,os(ns.get(v)||null,n,o,a,u,y)),!0;case"gotpointercapture":return v=y.pointerId,rs.set(v,os(rs.get(v)||null,n,o,a,u,y)),!0}return!1}function db(n){var o=po(n.target);if(o!==null){var a=s(o);if(a!==null){if(o=a.tag,o===13){if(o=c(a),o!==null){n.blockedOn=o,sc(n.priority,function(){cb(a)});return}}else if(o===31){if(o=f(a),o!==null){n.blockedOn=o,sc(n.priority,function(){cb(a)});return}}else if(o===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function wu(n){if(n.blockedOn!==null)return!1;for(var o=n.targetContainers;0<o.length;){var a=_m(n.nativeEvent);if(a===null){a=n.nativeEvent;var u=new a.constructor(a.type,a);kd=u,a.target.dispatchEvent(u),kd=null}else return o=go(a),o!==null&&sb(o),n.blockedOn=a,!1;o.shift()}return!0}function hb(n,o,a){wu(n)&&a.delete(o)}function sA(){Tm=!1,Bo!==null&&wu(Bo)&&(Bo=null),Ho!==null&&wu(Ho)&&(Ho=null),Po!==null&&wu(Po)&&(Po=null),ns.forEach(hb),rs.forEach(hb)}function Su(n,o){n.blockedOn===o&&(n.blockedOn=null,Tm||(Tm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sA)))}var Eu=null;function mb(n){Eu!==n&&(Eu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Eu===n&&(Eu=null);for(var o=0;o<n.length;o+=3){var a=n[o],u=n[o+1],y=n[o+2];if(typeof u!="function"){if(km(u||a)===null)continue;break}var v=go(a);v!==null&&(n.splice(o,3),o-=3,_h(v,{pending:!0,data:y,method:a.method,action:u},u,y))}}))}function Al(n){function o(Z){return Su(Z,n)}Bo!==null&&Su(Bo,n),Ho!==null&&Su(Ho,n),Po!==null&&Su(Po,n),ns.forEach(o),rs.forEach(o);for(var a=0;a<Uo.length;a++){var u=Uo[a];u.blockedOn===n&&(u.blockedOn=null)}for(;0<Uo.length&&(a=Uo[0],a.blockedOn===null);)db(a),a.blockedOn===null&&Uo.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(u=0;u<a.length;u+=3){var y=a[u],v=a[u+1],T=y[Yt]||null;if(typeof v=="function")T||mb(a);else if(T){var I=null;if(v&&v.hasAttribute("formAction")){if(y=v,T=v[Yt]||null)I=T.formAction;else if(km(y)!==null)continue}else I=T.action;typeof I=="function"?a[u+1]=I:(a.splice(u,3),u-=3),mb(a)}}}function pb(){function n(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(T){return y=T})},focusReset:"manual",scroll:"manual"})}function o(){y!==null&&(y(),y=null),u||setTimeout(a,20)}function a(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,y=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(a,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),y!==null&&(y(),y=null)}}}function Am(n){this._internalRoot=n}Cu.prototype.render=Am.prototype.render=function(n){var o=this._internalRoot;if(o===null)throw Error(i(409));var a=o.current,u=vn();lb(a,u,n,o,null,null)},Cu.prototype.unmount=Am.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var o=n.containerInfo;lb(n.current,2,null,n,null,null),ou(),o[Dr]=null}};function Cu(n){this._internalRoot=n}Cu.prototype.unstable_scheduleHydration=function(n){if(n){var o=ac();n={blockedOn:null,target:n,priority:o};for(var a=0;a<Uo.length&&o!==0&&o<Uo[a].priority;a++);Uo.splice(a,0,n),a===0&&db(n)}};var gb=t.version;if(gb!=="19.2.4")throw Error(i(527,gb,"19.2.4"));V.findDOMNode=function(n){var o=n._reactInternals;if(o===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=d(o),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var cA={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nu.isDisabled&&Nu.supportsFiber)try{Lt=Nu.inject(cA),vt=Nu}catch{}}return ls.createRoot=function(n,o){if(!l(n))throw Error(i(299));var a=!1,u="",y=E0,v=C0,T=N0;return o!=null&&(o.unstable_strictMode===!0&&(a=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(T=o.onRecoverableError)),o=ob(n,1,!1,null,null,a,u,null,y,v,T,pb),n[Dr]=o.current,um(n),new Am(o)},ls.hydrateRoot=function(n,o,a){if(!l(n))throw Error(i(299));var u=!1,y="",v=E0,T=C0,I=N0,Z=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(y=a.identifierPrefix),a.onUncaughtError!==void 0&&(v=a.onUncaughtError),a.onCaughtError!==void 0&&(T=a.onCaughtError),a.onRecoverableError!==void 0&&(I=a.onRecoverableError),a.formState!==void 0&&(Z=a.formState)),o=ob(n,1,!0,o,a??null,u,y,Z,v,T,I,pb),o.context=ib(null),a=o.current,u=vn(),u=ha(u),y=_o(u),y.callback=null,ko(a,y,u),a=u,o.current.lanes=a,li(o,a),dr(o),n[Dr]=o.current,um(n),new Cu(o)},ls.version="19.2.4",ls}var _b;function vA(){if(_b)return Mm.exports;_b=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Mm.exports=xA(),Mm.exports}var bA=vA();var kb="popstate";function wA(e={}){function t(i,l){let{pathname:s,search:c,hash:f}=i.location;return Tp("",{pathname:s,search:c,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function r(i,l){return typeof l=="string"?l:Es(l)}return EA(t,r,null,e)}function dt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function SA(){return Math.random().toString(36).substring(2,10)}function Tb(e,t){return{usr:e.state,key:e.key,idx:t}}function Tp(e,t,r=null,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?na(t):t,state:r,key:t&&t.key||i||SA()}}function Es({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function na(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function EA(e,t,r,i={}){let{window:l=document.defaultView,v5Compat:s=!1}=i,c=l.history,f="POP",h=null,d=m();d==null&&(d=0,c.replaceState({...c.state,idx:d},""));function m(){return(c.state||{idx:null}).idx}function g(){f="POP";let _=m(),N=_==null?null:_-d;d=_,h&&h({action:f,location:S.location,delta:N})}function x(_,N){f="PUSH";let k=Tp(S.location,_,N);d=m()+1;let C=Tb(k,d),A=S.createHref(k);try{c.pushState(C,"",A)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;l.location.assign(A)}s&&h&&h({action:f,location:S.location,delta:1})}function b(_,N){f="REPLACE";let k=Tp(S.location,_,N);d=m();let C=Tb(k,d),A=S.createHref(k);c.replaceState(C,"",A),s&&h&&h({action:f,location:S.location,delta:0})}function E(_){return CA(_)}let S={get action(){return f},get location(){return e(l,c)},listen(_){if(h)throw new Error("A history only accepts one active listener");return l.addEventListener(kb,g),h=_,()=>{l.removeEventListener(kb,g),h=null}},createHref(_){return t(l,_)},createURL:E,encodeLocation(_){let N=E(_);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:x,replace:b,go(_){return c.go(_)}};return S}function CA(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),dt(r,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Es(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function wS(e,t,r="/"){return NA(e,t,r,!1)}function NA(e,t,r,i){let l=typeof t=="string"?na(t):t,s=ao(l.pathname||"/",r);if(s==null)return null;let c=SS(e);_A(c);let f=null;for(let h=0;f==null&&h<c.length;++h){let d=IA(s);f=zA(c[h],d,i)}return f}function SS(e,t=[],r=[],i="",l=!1){let s=(c,f,h=l,d)=>{let m={relativePath:d===void 0?c.path||"":d,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&h)return;dt(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let g=io([i,m.relativePath]),x=r.concat(m);c.children&&c.children.length>0&&(dt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),SS(c.children,t,x,g,h)),!(c.path==null&&!c.index)&&t.push({path:g,score:OA(g,c.index),routesMeta:x})};return e.forEach((c,f)=>{if(c.path===""||!c.path?.includes("?"))s(c,f);else for(let h of ES(c.path))s(c,f,!0,h)}),t}function ES(e){let t=e.split("/");if(t.length===0)return[];let[r,...i]=t,l=r.endsWith("?"),s=r.replace(/\?$/,"");if(i.length===0)return l?[s,""]:[s];let c=ES(i.join("/")),f=[];return f.push(...c.map(h=>h===""?s:[s,h].join("/"))),l&&f.push(...c),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function _A(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:DA(t.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var kA=/^:[\w-]+$/,TA=3,AA=2,RA=1,jA=10,MA=-2,Ab=e=>e==="*";function OA(e,t){let r=e.split("/"),i=r.length;return r.some(Ab)&&(i+=MA),t&&(i+=AA),r.filter(l=>!Ab(l)).reduce((l,s)=>l+(kA.test(s)?TA:s===""?RA:jA),i)}function DA(e,t){return e.length===t.length&&e.slice(0,-1).every((i,l)=>i===t[l])?e[e.length-1]-t[t.length-1]:0}function zA(e,t,r=!1){let{routesMeta:i}=e,l={},s="/",c=[];for(let f=0;f<i.length;++f){let h=i[f],d=f===i.length-1,m=s==="/"?t:t.slice(s.length)||"/",g=sf({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},m),x=h.route;if(!g&&d&&r&&!i[i.length-1].route.index&&(g=sf({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!g)return null;Object.assign(l,g.params),c.push({params:l,pathname:io([s,g.pathname]),pathnameBase:UA(io([s,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(s=io([s,g.pathnameBase]))}return c}function sf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,i]=LA(e.path,e.caseSensitive,e.end),l=t.match(r);if(!l)return null;let s=l[0],c=s.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:i.reduce((d,{paramName:m,isOptional:g},x)=>{if(m==="*"){let E=f[x]||"";c=s.slice(0,s.length-E.length).replace(/(.)\/+$/,"$1")}const b=f[x];return g&&!b?d[m]=void 0:d[m]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:c,pattern:e}}function LA(e,t=!1,r=!0){Hn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,h)=>(i.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),i]}function IA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ao(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}var BA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function HA(e,t="/"){let{pathname:r,search:i="",hash:l=""}=typeof e=="string"?na(e):e,s;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?s=Rb(r.substring(1),"/"):s=Rb(r,t)):s=t,{pathname:s,search:VA(i),hash:$A(l)}}function Rb(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function Lm(e,t,r,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function PA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function wg(e){let t=PA(e);return t.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase)}function Sg(e,t,r,i=!1){let l;typeof e=="string"?l=na(e):(l={...e},dt(!l.pathname||!l.pathname.includes("?"),Lm("?","pathname","search",l)),dt(!l.pathname||!l.pathname.includes("#"),Lm("#","pathname","hash",l)),dt(!l.search||!l.search.includes("#"),Lm("#","search","hash",l)));let s=e===""||l.pathname==="",c=s?"/":l.pathname,f;if(c==null)f=r;else{let g=t.length-1;if(!i&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;l.pathname=x.join("/")}f=g>=0?t[g]:"/"}let h=HA(l,f),d=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(d||m)&&(h.pathname+="/"),h}var io=e=>e.join("/").replace(/\/\/+/g,"/"),UA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),VA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$A=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,YA=class{constructor(e,t,r,i=!1){this.status=e,this.statusText=t||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function qA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function FA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var CS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function NS(e,t){let r=e;if(typeof r!="string"||!BA.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,l=!1;if(CS)try{let s=new URL(window.location.href),c=r.startsWith("//")?new URL(s.protocol+r):new URL(r),f=ao(c.pathname,t);c.origin===s.origin&&f!=null?r=f+c.search+c.hash:l=!0}catch{Hn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:l,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _S=["POST","PUT","PATCH","DELETE"];new Set(_S);var XA=["GET",..._S];new Set(XA);var ra=w.createContext(null);ra.displayName="DataRouter";var Df=w.createContext(null);Df.displayName="DataRouterState";var GA=w.createContext(!1),kS=w.createContext({isTransitioning:!1});kS.displayName="ViewTransition";var WA=w.createContext(new Map);WA.displayName="Fetchers";var ZA=w.createContext(null);ZA.displayName="Await";var An=w.createContext(null);An.displayName="Navigation";var $s=w.createContext(null);$s.displayName="Location";var Pn=w.createContext({outlet:null,matches:[],isDataRoute:!1});Pn.displayName="Route";var Eg=w.createContext(null);Eg.displayName="RouteError";var TS="REACT_ROUTER_ERROR",KA="REDIRECT",QA="ROUTE_ERROR_RESPONSE";function JA(e){if(e.startsWith(`${TS}:${KA}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function eR(e){if(e.startsWith(`${TS}:${QA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new YA(t.status,t.statusText,t.data)}catch{}}function tR(e,{relative:t}={}){dt(oa(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=w.useContext(An),{hash:l,pathname:s,search:c}=Ys(e,{relative:t}),f=s;return r!=="/"&&(f=s==="/"?r:io([r,s])),i.createHref({pathname:f,search:c,hash:l})}function oa(){return w.useContext($s)!=null}function _r(){return dt(oa(),"useLocation() may be used only in the context of a <Router> component."),w.useContext($s).location}var AS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function RS(e){w.useContext(An).static||w.useLayoutEffect(e)}function zf(){let{isDataRoute:e}=w.useContext(Pn);return e?gR():nR()}function nR(){dt(oa(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(ra),{basename:t,navigator:r}=w.useContext(An),{matches:i}=w.useContext(Pn),{pathname:l}=_r(),s=JSON.stringify(wg(i)),c=w.useRef(!1);return RS(()=>{c.current=!0}),w.useCallback((h,d={})=>{if(Hn(c.current,AS),!c.current)return;if(typeof h=="number"){r.go(h);return}let m=Sg(h,JSON.parse(s),l,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:io([t,m.pathname])),(d.replace?r.replace:r.push)(m,d.state,d)},[t,r,s,l,e])}var rR=w.createContext(null);function oR(e){let t=w.useContext(Pn).outlet;return w.useMemo(()=>t&&w.createElement(rR.Provider,{value:e},t),[t,e])}function Cg(){let{matches:e}=w.useContext(Pn),t=e[e.length-1];return t?t.params:{}}function Ys(e,{relative:t}={}){let{matches:r}=w.useContext(Pn),{pathname:i}=_r(),l=JSON.stringify(wg(r));return w.useMemo(()=>Sg(e,JSON.parse(l),i,t==="path"),[e,l,i,t])}function iR(e,t){return jS(e,t)}function jS(e,t,r,i,l){dt(oa(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=w.useContext(An),{matches:c}=w.useContext(Pn),f=c[c.length-1],h=f?f.params:{},d=f?f.pathname:"/",m=f?f.pathnameBase:"/",g=f&&f.route;{let k=g&&g.path||"";OS(d,!g||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
+
11
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let x=_r(),b;if(t){let k=typeof t=="string"?na(t):t;dt(m==="/"||k.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=x;let E=b.pathname||"/",S=E;if(m!=="/"){let k=m.replace(/^\//,"").split("/");S="/"+E.replace(/^\//,"").split("/").slice(k.length).join("/")}let _=wS(e,{pathname:S});Hn(g||_!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Hn(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=uR(_&&_.map(k=>Object.assign({},k,{params:Object.assign({},h,k.params),pathname:io([m,s.encodeLocation?s.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?m:io([m,s.encodeLocation?s.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,r,i,l);return t&&N?w.createElement($s.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},N):N}function lR(){let e=pR(),t=qA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:s},"ErrorBoundary")," or"," ",w.createElement("code",{style:s},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:l},r):null,c)}var aR=w.createElement(lR,null),MS=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=eR(e.digest);r&&(e=r)}let t=e!==void 0?w.createElement(Pn.Provider,{value:this.props.routeContext},w.createElement(Eg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(sR,{error:e},t):t}};MS.contextType=GA;var Im=new WeakMap;function sR({children:e,error:t}){let{basename:r}=w.useContext(An);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=JA(t.digest);if(i){let l=Im.get(t);if(l)throw l;let s=NS(i.location,r);if(CS&&!Im.get(t))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw Im.set(t,c),c}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function cR({routeContext:e,match:t,children:r}){let i=w.useContext(ra);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Pn.Provider,{value:e},r)}function uR(e,t=[],r=null,i=null,l=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,c=r?.errors;if(c!=null){let m=s.findIndex(g=>g.route.id&&c?.[g.route.id]!==void 0);dt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let f=!1,h=-1;if(r)for(let m=0;m<s.length;m++){let g=s[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(h=m),g.route.id){let{loaderData:x,errors:b}=r,E=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||E){f=!0,h>=0?s=s.slice(0,h+1):s=[s[0]];break}}}let d=r&&i?(m,g)=>{i(m,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:FA(r.matches),errorInfo:g})}:void 0;return s.reduceRight((m,g,x)=>{let b,E=!1,S=null,_=null;r&&(b=c&&g.route.id?c[g.route.id]:void 0,S=g.route.errorElement||aR,f&&(h<0&&x===0?(OS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,_=null):h===x&&(E=!0,_=g.route.hydrateFallbackElement||null)));let N=t.concat(s.slice(0,x+1)),k=()=>{let C;return b?C=S:E?C=_:g.route.Component?C=w.createElement(g.route.Component,null):g.route.element?C=g.route.element:C=m,w.createElement(cR,{match:g,routeContext:{outlet:m,matches:N,isDataRoute:r!=null},children:C})};return r&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?w.createElement(MS,{location:r.location,revalidation:r.revalidation,component:S,error:b,children:k(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:d}):k()},null)}function Ng(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fR(e){let t=w.useContext(ra);return dt(t,Ng(e)),t}function dR(e){let t=w.useContext(Df);return dt(t,Ng(e)),t}function hR(e){let t=w.useContext(Pn);return dt(t,Ng(e)),t}function _g(e){let t=hR(e),r=t.matches[t.matches.length-1];return dt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function mR(){return _g("useRouteId")}function pR(){let e=w.useContext(Eg),t=dR("useRouteError"),r=_g("useRouteError");return e!==void 0?e:t.errors?.[r]}function gR(){let{router:e}=fR("useNavigate"),t=_g("useNavigate"),r=w.useRef(!1);return RS(()=>{r.current=!0}),w.useCallback(async(l,s={})=>{Hn(r.current,AS),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...s}))},[e,t])}var jb={};function OS(e,t,r){!t&&!jb[e]&&(jb[e]=!0,Hn(!1,r))}w.memo(yR);function yR({routes:e,future:t,state:r,onError:i}){return jS(e,void 0,r,i,t)}function xR({to:e,replace:t,state:r,relative:i}){dt(oa(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=w.useContext(An);Hn(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=w.useContext(Pn),{pathname:c}=_r(),f=zf(),h=Sg(e,wg(s),c,i==="path"),d=JSON.stringify(h);return w.useEffect(()=>{f(JSON.parse(d),{replace:t,state:r,relative:i})},[f,d,i,t,r]),null}function vR(e){return oR(e.context)}function Gn(e){dt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function bR({basename:e="/",children:t=null,location:r,navigationType:i="POP",navigator:l,static:s=!1,unstable_useTransitions:c}){dt(!oa(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=w.useMemo(()=>({basename:f,navigator:l,static:s,unstable_useTransitions:c,future:{}}),[f,l,s,c]);typeof r=="string"&&(r=na(r));let{pathname:d="/",search:m="",hash:g="",state:x=null,key:b="default"}=r,E=w.useMemo(()=>{let S=ao(d,f);return S==null?null:{location:{pathname:S,search:m,hash:g,state:x,key:b},navigationType:i}},[f,d,m,g,x,b,i]);return Hn(E!=null,`<Router basename="${f}"> is not able to match the URL "${d}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:w.createElement(An.Provider,{value:h},w.createElement($s.Provider,{children:t,value:E}))}function wR({children:e,location:t}){return iR(Ap(e),t)}function Ap(e,t=[]){let r=[];return w.Children.forEach(e,(i,l)=>{if(!w.isValidElement(i))return;let s=[...t,l];if(i.type===w.Fragment){r.push.apply(r,Ap(i.props.children,s));return}dt(i.type===Gn,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),dt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let c={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(c.children=Ap(i.props.children,s)),r.push(c)}),r}var Zu="get",Ku="application/x-www-form-urlencoded";function Lf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function SR(e){return Lf(e)&&e.tagName.toLowerCase()==="button"}function ER(e){return Lf(e)&&e.tagName.toLowerCase()==="form"}function CR(e){return Lf(e)&&e.tagName.toLowerCase()==="input"}function NR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _R(e,t){return e.button===0&&(!t||t==="_self")&&!NR(e)}function Rp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let i=e[r];return t.concat(Array.isArray(i)?i.map(l=>[r,l]):[[r,i]])},[]))}function kR(e,t){let r=Rp(e);return t&&t.forEach((i,l)=>{r.has(l)||t.getAll(l).forEach(s=>{r.append(l,s)})}),r}var _u=null;function TR(){if(_u===null)try{new FormData(document.createElement("form"),0),_u=!1}catch{_u=!0}return _u}var AR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bm(e){return e!=null&&!AR.has(e)?(Hn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ku}"`),null):e}function RR(e,t){let r,i,l,s,c;if(ER(e)){let f=e.getAttribute("action");i=f?ao(f,t):null,r=e.getAttribute("method")||Zu,l=Bm(e.getAttribute("enctype"))||Ku,s=new FormData(e)}else if(SR(e)||CR(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(i=h?ao(h,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||Zu,l=Bm(e.getAttribute("formenctype"))||Bm(f.getAttribute("enctype"))||Ku,s=new FormData(f,e),!TR()){let{name:d,type:m,value:g}=e;if(m==="image"){let x=d?`${d}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else d&&s.append(d,g)}}else{if(Lf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Zu,i=null,l=Ku,c=e}return s&&l==="text/plain"&&(c=s,s=void 0),{action:i,method:r.toLowerCase(),encType:l,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function kg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function jR(e,t,r,i){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${i}`:l.pathname=`${l.pathname}.${i}`:l.pathname==="/"?l.pathname=`_root.${i}`:t&&ao(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${i}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${i}`,l}async function MR(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function OR(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function DR(e,t,r){let i=await Promise.all(e.map(async l=>{let s=t.routes[l.route.id];if(s){let c=await MR(s,r);return c.links?c.links():[]}return[]}));return BR(i.flat(1).filter(OR).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function Mb(e,t,r,i,l,s){let c=(h,d)=>r[d]?h.route.id!==r[d].route.id:!0,f=(h,d)=>r[d].pathname!==h.pathname||r[d].route.path?.endsWith("*")&&r[d].params["*"]!==h.params["*"];return s==="assets"?t.filter((h,d)=>c(h,d)||f(h,d)):s==="data"?t.filter((h,d)=>{let m=i.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(c(h,d)||f(h,d))return!0;if(h.route.shouldRevalidate){let g=h.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function zR(e,t,{includeHydrateFallback:r}={}){return LR(e.map(i=>{let l=t.routes[i.route.id];if(!l)return[];let s=[l.module];return l.clientActionModule&&(s=s.concat(l.clientActionModule)),l.clientLoaderModule&&(s=s.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(s=s.concat(l.hydrateFallbackModule)),l.imports&&(s=s.concat(l.imports)),s}).flat(1))}function LR(e){return[...new Set(e)]}function IR(e){let t={},r=Object.keys(e).sort();for(let i of r)t[i]=e[i];return t}function BR(e,t){let r=new Set;return new Set(t),e.reduce((i,l)=>{let s=JSON.stringify(IR(l));return r.has(s)||(r.add(s),i.push({key:s,link:l})),i},[])}function DS(){let e=w.useContext(ra);return kg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function HR(){let e=w.useContext(Df);return kg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Tg=w.createContext(void 0);Tg.displayName="FrameworkContext";function zS(){let e=w.useContext(Tg);return kg(e,"You must render this element inside a <HydratedRouter> element"),e}function PR(e,t){let r=w.useContext(Tg),[i,l]=w.useState(!1),[s,c]=w.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:d,onMouseLeave:m,onTouchStart:g}=t,x=w.useRef(null);w.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=N=>{N.forEach(k=>{c(k.isIntersecting)})},_=new IntersectionObserver(S,{threshold:.5});return x.current&&_.observe(x.current),()=>{_.disconnect()}}},[e]),w.useEffect(()=>{if(i){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[i]);let b=()=>{l(!0)},E=()=>{l(!1),c(!1)};return r?e!=="intent"?[s,x,{}]:[s,x,{onFocus:as(f,b),onBlur:as(h,E),onMouseEnter:as(d,b),onMouseLeave:as(m,E),onTouchStart:as(g,b)}]:[!1,x,{}]}function as(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function UR({page:e,...t}){let{router:r}=DS(),i=w.useMemo(()=>wS(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?w.createElement($R,{page:e,matches:i,...t}):null}function VR(e){let{manifest:t,routeModules:r}=zS(),[i,l]=w.useState([]);return w.useEffect(()=>{let s=!1;return DR(e,t,r).then(c=>{s||l(c)}),()=>{s=!0}},[e,t,r]),i}function $R({page:e,matches:t,...r}){let i=_r(),{future:l,manifest:s,routeModules:c}=zS(),{basename:f}=DS(),{loaderData:h,matches:d}=HR(),m=w.useMemo(()=>Mb(e,t,d,s,i,"data"),[e,t,d,s,i]),g=w.useMemo(()=>Mb(e,t,d,s,i,"assets"),[e,t,d,s,i]),x=w.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let S=new Set,_=!1;if(t.forEach(k=>{let C=s.routes[k.route.id];!C||!C.hasLoader||(!m.some(A=>A.route.id===k.route.id)&&k.route.id in h&&c[k.route.id]?.shouldRevalidate||C.hasClientLoader?_=!0:S.add(k.route.id))}),S.size===0)return[];let N=jR(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return _&&S.size>0&&N.searchParams.set("_routes",t.filter(k=>S.has(k.route.id)).map(k=>k.route.id).join(",")),[N.pathname+N.search]},[f,l.unstable_trailingSlashAwareDataRequests,h,i,s,m,t,e,c]),b=w.useMemo(()=>zR(g,s),[g,s]),E=VR(g);return w.createElement(w.Fragment,null,x.map(S=>w.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),b.map(S=>w.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),E.map(({key:S,link:_})=>w.createElement("link",{key:S,nonce:r.nonce,..._,crossOrigin:_.crossOrigin??r.crossOrigin})))}function YR(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var qR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{qR&&(window.__reactRouterVersion="7.13.0")}catch{}function FR({basename:e,children:t,unstable_useTransitions:r,window:i}){let l=w.useRef();l.current==null&&(l.current=wA({window:i,v5Compat:!0}));let s=l.current,[c,f]=w.useState({action:s.action,location:s.location}),h=w.useCallback(d=>{r===!1?f(d):w.startTransition(()=>f(d))},[r]);return w.useLayoutEffect(()=>s.listen(h),[s,h]),w.createElement(bR,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:s,unstable_useTransitions:r})}var LS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gt=w.forwardRef(function({onClick:t,discover:r="render",prefetch:i="none",relative:l,reloadDocument:s,replace:c,state:f,target:h,to:d,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:x,...b},E){let{basename:S,unstable_useTransitions:_}=w.useContext(An),N=typeof d=="string"&&LS.test(d),k=NS(d,S);d=k.to;let C=tR(d,{relative:l}),[A,z,j]=PR(i,b),L=ZR(d,{replace:c,state:f,target:h,preventScrollReset:m,relative:l,viewTransition:g,unstable_defaultShouldRevalidate:x,unstable_useTransitions:_});function P(X){t&&t(X),X.defaultPrevented||L(X)}let H=w.createElement("a",{...b,...j,href:k.absoluteURL||C,onClick:k.isExternal||s?t:P,ref:YR(E,z),target:h,"data-discover":!N&&r==="render"?"true":void 0});return A&&!N?w.createElement(w.Fragment,null,H,w.createElement(UR,{page:C})):H});gt.displayName="Link";var XR=w.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:i="",end:l=!1,style:s,to:c,viewTransition:f,children:h,...d},m){let g=Ys(c,{relative:d.relative}),x=_r(),b=w.useContext(Df),{navigator:E,basename:S}=w.useContext(An),_=b!=null&&tj(g)&&f===!0,N=E.encodeLocation?E.encodeLocation(g).pathname:g.pathname,k=x.pathname,C=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(k=k.toLowerCase(),C=C?C.toLowerCase():null,N=N.toLowerCase()),C&&S&&(C=ao(C,S)||C);const A=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let z=k===N||!l&&k.startsWith(N)&&k.charAt(A)==="/",j=C!=null&&(C===N||!l&&C.startsWith(N)&&C.charAt(N.length)==="/"),L={isActive:z,isPending:j,isTransitioning:_},P=z?t:void 0,H;typeof i=="function"?H=i(L):H=[i,z?"active":null,j?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let X=typeof s=="function"?s(L):s;return w.createElement(gt,{...d,"aria-current":P,className:H,ref:m,style:X,to:c,viewTransition:f},typeof h=="function"?h(L):h)});XR.displayName="NavLink";var GR=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:i,replace:l,state:s,method:c=Zu,action:f,onSubmit:h,relative:d,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:x,...b},E)=>{let{unstable_useTransitions:S}=w.useContext(An),_=JR(),N=ej(f,{relative:d}),k=c.toLowerCase()==="get"?"get":"post",C=typeof f=="string"&&LS.test(f),A=z=>{if(h&&h(z),z.defaultPrevented)return;z.preventDefault();let j=z.nativeEvent.submitter,L=j?.getAttribute("formmethod")||c,P=()=>_(j||z.currentTarget,{fetcherKey:t,method:L,navigate:r,replace:l,state:s,relative:d,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:x});S&&r!==!1?w.startTransition(()=>P()):P()};return w.createElement("form",{ref:E,method:k,action:N,onSubmit:i?h:A,...b,"data-discover":!C&&e==="render"?"true":void 0})});GR.displayName="Form";function WR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function IS(e){let t=w.useContext(ra);return dt(t,WR(e)),t}function ZR(e,{target:t,replace:r,state:i,preventScrollReset:l,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let d=zf(),m=_r(),g=Ys(e,{relative:s});return w.useCallback(x=>{if(_R(x,t)){x.preventDefault();let b=r!==void 0?r:Es(m)===Es(g),E=()=>d(e,{replace:b,state:i,preventScrollReset:l,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:f});h?w.startTransition(()=>E()):E()}},[m,d,g,r,i,t,e,l,s,c,f,h])}function qs(e){Hn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(Rp(e)),r=w.useRef(!1),i=_r(),l=w.useMemo(()=>kR(i.search,r.current?null:t.current),[i.search]),s=zf(),c=w.useCallback((f,h)=>{const d=Rp(typeof f=="function"?f(new URLSearchParams(l)):f);r.current=!0,s("?"+d,h)},[s,l]);return[l,c]}var KR=0,QR=()=>`__${String(++KR)}__`;function JR(){let{router:e}=IS("useSubmit"),{basename:t}=w.useContext(An),r=mR(),i=e.fetch,l=e.navigate;return w.useCallback(async(s,c={})=>{let{action:f,method:h,encType:d,formData:m,body:g}=RR(s,t);if(c.navigate===!1){let x=c.fetcherKey||QR();await i(x,r,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:g,formMethod:c.method||h,formEncType:c.encType||d,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:g,formMethod:c.method||h,formEncType:c.encType||d,replace:c.replace,state:c.state,fromRouteId:r,flushSync:c.flushSync,viewTransition:c.viewTransition})},[i,l,t,r])}function ej(e,{relative:t}={}){let{basename:r}=w.useContext(An),i=w.useContext(Pn);dt(i,"useFormAction must be used inside a RouteContext");let[l]=i.matches.slice(-1),s={...Ys(e||".",{relative:t})},c=_r();if(e==null){s.search=c.search;let f=new URLSearchParams(s.search),h=f.getAll("index");if(h.some(m=>m==="")){f.delete("index"),h.filter(g=>g).forEach(g=>f.append("index",g));let m=f.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&l.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:io([r,s.pathname])),Es(s)}function tj(e,{relative:t}={}){let r=w.useContext(kS);dt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=IS("useViewTransitionState"),l=Ys(e,{relative:t});if(!r.isTransitioning)return!1;let s=ao(r.currentLocation.pathname,i)||r.currentLocation.pathname,c=ao(r.nextLocation.pathname,i)||r.nextLocation.pathname;return sf(l.pathname,c)!=null||sf(l.pathname,s)!=null}var Fs=bS();const nj=Us(Fs),BS="studio-theme",HS=w.createContext(null);function rj(){if(typeof window>"u")return"light";const e=localStorage.getItem(BS);return e==="light"||e==="dark"?e:"light"}function oj({children:e}){const[t,r]=w.useState(rj);w.useEffect(()=>{const s=document.documentElement;s.classList.remove("light","dark"),s.classList.add(t),localStorage.setItem(BS,t)},[t]);const i=s=>r(s),l=()=>r(s=>s==="dark"?"light":"dark");return p.jsx(HS.Provider,{value:{theme:t,setTheme:i,toggleTheme:l},children:e})}function PS(){const e=w.useContext(HS);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function US(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=US(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function VS(){for(var e,t,r=0,i="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=US(e))&&(i&&(i+=" "),i+=t);return i}const ij=(e,t)=>{const r=new Array(e.length+t.length);for(let i=0;i<e.length;i++)r[i]=e[i];for(let i=0;i<t.length;i++)r[e.length+i]=t[i];return r},lj=(e,t)=>({classGroupId:e,validator:t}),$S=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),cf="-",Ob=[],aj="arbitrary..",sj=e=>{const t=uj(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return cj(c);const f=c.split(cf),h=f[0]===""&&f.length>1?1:0;return YS(f,h,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const h=i[c],d=r[c];return h?d?ij(d,h):h:d||Ob}return r[c]||Ob}}},YS=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const l=e[t],s=r.nextPart.get(l);if(s){const d=YS(e,t+1,s);if(d)return d}const c=r.validators;if(c===null)return;const f=t===0?e.join(cf):e.slice(t).join(cf),h=c.length;for(let d=0;d<h;d++){const m=c[d];if(m.validator(f))return m.classGroupId}},cj=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),i=t.slice(0,r);return i?aj+i:void 0})(),uj=e=>{const{theme:t,classGroups:r}=e;return fj(r,t)},fj=(e,t)=>{const r=$S();for(const i in e){const l=e[i];Ag(l,r,i,t)}return r},Ag=(e,t,r,i)=>{const l=e.length;for(let s=0;s<l;s++){const c=e[s];dj(c,t,r,i)}},dj=(e,t,r,i)=>{if(typeof e=="string"){hj(e,t,r);return}if(typeof e=="function"){mj(e,t,r,i);return}pj(e,t,r,i)},hj=(e,t,r)=>{const i=e===""?t:qS(t,e);i.classGroupId=r},mj=(e,t,r,i)=>{if(gj(e)){Ag(e(i),t,r,i);return}t.validators===null&&(t.validators=[]),t.validators.push(lj(r,e))},pj=(e,t,r,i)=>{const l=Object.entries(e),s=l.length;for(let c=0;c<s;c++){const[f,h]=l[c];Ag(h,qS(t,f),r,i)}},qS=(e,t)=>{let r=e;const i=t.split(cf),l=i.length;for(let s=0;s<l;s++){const c=i[s];let f=r.nextPart.get(c);f||(f=$S(),r.nextPart.set(c,f)),r=f}return r},gj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,yj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),i=Object.create(null);const l=(s,c)=>{r[s]=c,t++,t>e&&(t=0,i=r,r=Object.create(null))};return{get(s){let c=r[s];if(c!==void 0)return c;if((c=i[s])!==void 0)return l(s,c),c},set(s,c){s in r?r[s]=c:l(s,c)}}},jp="!",Db=":",xj=[],zb=(e,t,r,i,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:i,isExternal:l}),vj=e=>{const{prefix:t,experimentalParseClassName:r}=e;let i=l=>{const s=[];let c=0,f=0,h=0,d;const m=l.length;for(let S=0;S<m;S++){const _=l[S];if(c===0&&f===0){if(_===Db){s.push(l.slice(h,S)),h=S+1;continue}if(_==="/"){d=S;continue}}_==="["?c++:_==="]"?c--:_==="("?f++:_===")"&&f--}const g=s.length===0?l:l.slice(h);let x=g,b=!1;g.endsWith(jp)?(x=g.slice(0,-1),b=!0):g.startsWith(jp)&&(x=g.slice(1),b=!0);const E=d&&d>h?d-h:void 0;return zb(s,b,x,E)};if(t){const l=t+Db,s=i;i=c=>c.startsWith(l)?s(c.slice(l.length)):zb(xj,!1,c,void 0,!0)}if(r){const l=i;i=s=>r({className:s,parseClassName:l})}return i},bj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{t.set(r,1e6+i)}),r=>{const i=[];let l=[];for(let s=0;s<r.length;s++){const c=r[s],f=c[0]==="[",h=t.has(c);f||h?(l.length>0&&(l.sort(),i.push(...l),l=[]),i.push(c)):l.push(c)}return l.length>0&&(l.sort(),i.push(...l)),i}},wj=e=>({cache:yj(e.cacheSize),parseClassName:vj(e),sortModifiers:bj(e),...sj(e)}),Sj=/\s+/,Ej=(e,t)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:l,sortModifiers:s}=t,c=[],f=e.trim().split(Sj);let h="";for(let d=f.length-1;d>=0;d-=1){const m=f[d],{isExternal:g,modifiers:x,hasImportantModifier:b,baseClassName:E,maybePostfixModifierPosition:S}=r(m);if(g){h=m+(h.length>0?" "+h:h);continue}let _=!!S,N=i(_?E.substring(0,S):E);if(!N){if(!_){h=m+(h.length>0?" "+h:h);continue}if(N=i(E),!N){h=m+(h.length>0?" "+h:h);continue}_=!1}const k=x.length===0?"":x.length===1?x[0]:s(x).join(":"),C=b?k+jp:k,A=C+N;if(c.indexOf(A)>-1)continue;c.push(A);const z=l(N,_);for(let j=0;j<z.length;++j){const L=z[j];c.push(C+L)}h=m+(h.length>0?" "+h:h)}return h},Cj=(...e)=>{let t=0,r,i,l="";for(;t<e.length;)(r=e[t++])&&(i=FS(r))&&(l&&(l+=" "),l+=i);return l},FS=e=>{if(typeof e=="string")return e;let t,r="";for(let i=0;i<e.length;i++)e[i]&&(t=FS(e[i]))&&(r&&(r+=" "),r+=t);return r},Nj=(e,...t)=>{let r,i,l,s;const c=h=>{const d=t.reduce((m,g)=>g(m),e());return r=wj(d),i=r.cache.get,l=r.cache.set,s=f,f(h)},f=h=>{const d=i(h);if(d)return d;const m=Ej(h,r);return l(h,m),m};return s=c,(...h)=>s(Cj(...h))},_j=[],Ot=e=>{const t=r=>r[e]||_j;return t.isThemeGetter=!0,t},XS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,GS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Tj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Aj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Rj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$o=e=>kj.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),Yo=e=>!!e&&Number.isInteger(Number(e)),Hm=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),eo=e=>Tj.test(e),WS=()=>!0,Oj=e=>Aj.test(e)&&!Rj.test(e),Rg=()=>!1,Dj=e=>jj.test(e),zj=e=>Mj.test(e),Lj=e=>!we(e)&&!Se(e),Ij=e=>ti(e,QS,Rg),we=e=>XS.test(e),_i=e=>ti(e,JS,Oj),Lb=e=>ti(e,qj,Ie),Bj=e=>ti(e,tE,WS),Hj=e=>ti(e,eE,Rg),Ib=e=>ti(e,ZS,Rg),Pj=e=>ti(e,KS,zj),ku=e=>ti(e,nE,Dj),Se=e=>GS.test(e),ss=e=>Vi(e,JS),Uj=e=>Vi(e,eE),Bb=e=>Vi(e,ZS),Vj=e=>Vi(e,QS),$j=e=>Vi(e,KS),Tu=e=>Vi(e,nE,!0),Yj=e=>Vi(e,tE,!0),ti=(e,t,r)=>{const i=XS.exec(e);return i?i[1]?t(i[1]):r(i[2]):!1},Vi=(e,t,r=!1)=>{const i=GS.exec(e);return i?i[1]?t(i[1]):r:!1},ZS=e=>e==="position"||e==="percentage",KS=e=>e==="image"||e==="url",QS=e=>e==="length"||e==="size"||e==="bg-size",JS=e=>e==="length",qj=e=>e==="number",eE=e=>e==="family-name",tE=e=>e==="number"||e==="weight",nE=e=>e==="shadow",Fj=()=>{const e=Ot("color"),t=Ot("font"),r=Ot("text"),i=Ot("font-weight"),l=Ot("tracking"),s=Ot("leading"),c=Ot("breakpoint"),f=Ot("container"),h=Ot("spacing"),d=Ot("radius"),m=Ot("shadow"),g=Ot("inset-shadow"),x=Ot("text-shadow"),b=Ot("drop-shadow"),E=Ot("blur"),S=Ot("perspective"),_=Ot("aspect"),N=Ot("ease"),k=Ot("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...A(),Se,we],j=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],P=()=>[Se,we,h],H=()=>[$o,"full","auto",...P()],X=()=>[Yo,"none","subgrid",Se,we],q=()=>["auto",{span:["full",Yo,Se,we]},Yo,Se,we],Y=()=>[Yo,"auto",Se,we],F=()=>["auto","min","max","fr",Se,we],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...P()],V=()=>[$o,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],$=()=>[$o,"screen","full","dvw","lvw","svw","min","max","fit",...P()],W=()=>[$o,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],M=()=>[e,Se,we],B=()=>[...A(),Bb,Ib,{position:[Se,we]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Vj,Ij,{size:[Se,we]}],oe=()=>[Hm,ss,_i],K=()=>["","none","full",d,Se,we],J=()=>["",Ie,ss,_i],te=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Ie,Hm,Bb,Ib],he=()=>["","none",E,Se,we],me=()=>["none",Ie,Se,we],ge=()=>["none",Ie,Se,we],xe=()=>[Ie,Se,we],_e=()=>[$o,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[eo],breakpoint:[eo],color:[WS],container:[eo],"drop-shadow":[eo],ease:["in","out","in-out"],font:[Lj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[eo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[eo],shadow:[eo],spacing:["px",Ie],text:[eo],"text-shadow":[eo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$o,we,Se,_]}],container:["container"],columns:[{columns:[Ie,we,Se,f]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:z()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[Yo,"auto",Se,we]}],basis:[{basis:[$o,"full","auto",f,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,$o,"auto","initial","none",we]}],grow:[{grow:["",Ie,Se,we]}],shrink:[{shrink:["",Ie,Se,we]}],order:[{order:[Yo,"first","last","none",Se,we]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",r,ss,_i]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Yj,Bj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hm,we]}],"font-family":[{font:[Uj,Hj,t]}],"font-features":[{"font-features":[we]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Se,we]}],"line-clamp":[{"line-clamp":[Ie,"none",Se,Lb]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",Se,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",Se,_i]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Ie,"auto",Se,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yo,Se,we],radial:["",Se,we],conic:[Yo,Se,we]},$j,Pj]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,Se,we]}],"outline-w":[{outline:["",Ie,ss,_i]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",m,Tu,ku]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",g,Tu,ku]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Ie,_i]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",x,Tu,ku]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Ie,Se,we]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Se,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,we]}],filter:[{filter:["","none",Se,we]}],blur:[{blur:he()}],brightness:[{brightness:[Ie,Se,we]}],contrast:[{contrast:[Ie,Se,we]}],"drop-shadow":[{"drop-shadow":["","none",b,Tu,ku]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Ie,Se,we]}],"hue-rotate":[{"hue-rotate":[Ie,Se,we]}],invert:[{invert:["",Ie,Se,we]}],saturate:[{saturate:[Ie,Se,we]}],sepia:[{sepia:["",Ie,Se,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,we]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,Se,we]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,Se,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,Se,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,Se,we]}],"backdrop-invert":[{"backdrop-invert":["",Ie,Se,we]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,Se,we]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,Se,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,Se,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",Se,we]}],ease:[{ease:["linear","initial",N,Se,we]}],delay:[{delay:[Ie,Se,we]}],animate:[{animate:["none",k,Se,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Se,we]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Se,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se,we]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Ie,ss,_i,Lb]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Xj=Nj(Fj);function ve(...e){return Xj(VS(e))}const En="text-primary/90 hover:text-primary",Hb=["#3b82f6","#10b981","#f59e0b","#8b5cf6","#f43f5e","#06b6d4","#f97316","#d946ef","#14b8a6","#6366f1","#ec4899","#84cc16","#0ea5e9","#a855f7","#eab308","#22c55e","#ef4444","#64748b"];function xr(e){let t=0;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;const r=Math.abs(t)%Hb.length;return Hb[r]}function Pb(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function uf(e,t,r,i="export.csv"){const l=(r??t).map(Pb).join(","),s=g=>g==null?"":typeof g=="string"?g:typeof g=="number"||typeof g=="boolean"?String(g):Array.isArray(g)?g.map(s).join("; "):typeof g=="object"?JSON.stringify(g):String(g),c=e.map(g=>t.map(x=>Pb(s(g[x]))).join(",")),f=[l,...c].join(`
12
+ `),h=new Blob([f],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(h),m=document.createElement("a");m.href=d,m.download=i,m.click(),URL.revokeObjectURL(d)}function ji(e){if(!e)return"-";try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"medium"})}catch{return e}}function Gj(e){if(e)return e.step??e.step_id??e.node_id}function Ub(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rE(...e){return t=>{let r=!1;const i=e.map(l=>{const s=Ub(l,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let l=0;l<i.length;l++){const s=i[l];typeof s=="function"?s():Ub(e[l],null)}}}}function We(...e){return w.useCallback(rE(...e),e)}function ql(e){const t=Zj(e),r=w.forwardRef((i,l)=>{const{children:s,...c}=i,f=w.Children.toArray(s),h=f.find(Qj);if(h){const d=h.props.children,m=f.map(g=>g===h?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:g);return p.jsx(t,{...c,ref:l,children:w.isValidElement(d)?w.cloneElement(d,void 0,m):null})}return p.jsx(t,{...c,ref:l,children:s})});return r.displayName=`${e}.Slot`,r}var Wj=ql("Slot");function Zj(e){const t=w.forwardRef((r,i)=>{const{children:l,...s}=r;if(w.isValidElement(l)){const c=eM(l),f=Jj(s,l.props);return l.type!==w.Fragment&&(f.ref=i?rE(i,c):c),w.cloneElement(l,f)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kj=Symbol("radix.slottable");function Qj(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kj}function Jj(e,t){const r={...t};for(const i in t){const l=e[i],s=t[i];/^on[A-Z]/.test(i)?l&&s?r[i]=(...f)=>{const h=s(...f);return l(...f),h}:l&&(r[i]=l):i==="style"?r[i]={...l,...s}:i==="className"&&(r[i]=[l,s].filter(Boolean).join(" "))}return{...e,...r}}function eM(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var tM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oe=tM.reduce((e,t)=>{const r=ql(`Primitive.${t}`),i=w.forwardRef((l,s)=>{const{asChild:c,...f}=l,h=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(h,{...f,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function nM(e,t){e&&Fs.flushSync(()=>e.dispatchEvent(t))}var oE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),rM="VisuallyHidden",oM=w.forwardRef((e,t)=>p.jsx(Oe.span,{...e,ref:t,style:{...oE,...e.style}}));oM.displayName=rM;function iM(e,t){const r=w.createContext(t),i=s=>{const{children:c,...f}=s,h=w.useMemo(()=>f,Object.values(f));return p.jsx(r.Provider,{value:h,children:c})};i.displayName=e+"Provider";function l(s){const c=w.useContext(r);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[i,l]}function fo(e,t=[]){let r=[];function i(s,c){const f=w.createContext(c),h=r.length;r=[...r,c];const d=g=>{const{scope:x,children:b,...E}=g,S=x?.[e]?.[h]||f,_=w.useMemo(()=>E,Object.values(E));return p.jsx(S.Provider,{value:_,children:b})};d.displayName=s+"Provider";function m(g,x){const b=x?.[e]?.[h]||f,E=w.useContext(b);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[d,m]}const l=()=>{const s=r.map(c=>w.createContext(c));return function(f){const h=f?.[e]||s;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return l.scopeName=e,[i,lM(l,...t)]}function lM(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(s){const c=i.reduce((f,{useScope:h,scopeName:d})=>{const g=h(s)[`__scope${d}`];return{...f,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}function iE(e){const t=e+"CollectionProvider",[r,i]=fo(t),[l,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:_,children:N}=S,k=no.useRef(null),C=no.useRef(new Map).current;return p.jsx(l,{scope:_,itemMap:C,collectionRef:k,children:N})};c.displayName=t;const f=e+"CollectionSlot",h=ql(f),d=no.forwardRef((S,_)=>{const{scope:N,children:k}=S,C=s(f,N),A=We(_,C.collectionRef);return p.jsx(h,{ref:A,children:k})});d.displayName=f;const m=e+"CollectionItemSlot",g="data-radix-collection-item",x=ql(m),b=no.forwardRef((S,_)=>{const{scope:N,children:k,...C}=S,A=no.useRef(null),z=We(_,A),j=s(m,N);return no.useEffect(()=>(j.itemMap.set(A,{ref:A,...C}),()=>{j.itemMap.delete(A)})),p.jsx(x,{[g]:"",ref:z,children:k})});b.displayName=m;function E(S){const _=s(e+"CollectionConsumer",S);return no.useCallback(()=>{const k=_.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${g}]`));return Array.from(_.itemMap.values()).sort((j,L)=>C.indexOf(j.ref.current)-C.indexOf(L.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:c,Slot:d,ItemSlot:b},E,i]}function je(e,t,{checkForDefaultPrevented:r=!0}={}){return function(l){if(e?.(l),r===!1||!l.defaultPrevented)return t?.(l)}}var Ut=globalThis?.document?w.useLayoutEffect:()=>{},aM=vS[" useInsertionEffect ".trim().toString()]||Ut;function Mi({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){const[l,s,c]=sM({defaultProp:t,onChange:r}),f=e!==void 0,h=f?e:l;{const m=w.useRef(e!==void 0);w.useEffect(()=>{const g=m.current;g!==f&&console.warn(`${i} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=f},[f,i])}const d=w.useCallback(m=>{if(f){const g=cM(m)?m(e):m;g!==e&&c.current?.(g)}else s(m)},[f,e,s,c]);return[h,d]}function sM({defaultProp:e,onChange:t}){const[r,i]=w.useState(e),l=w.useRef(r),s=w.useRef(t);return aM(()=>{s.current=t},[t]),w.useEffect(()=>{l.current!==r&&(s.current?.(r),l.current=r)},[r,l]),[r,i,s]}function cM(e){return typeof e=="function"}function uM(e,t){return w.useReducer((r,i)=>t[r][i]??r,e)}var kr=e=>{const{present:t,children:r}=e,i=fM(t),l=typeof r=="function"?r({present:i.isPresent}):w.Children.only(r),s=We(i.ref,dM(l));return typeof r=="function"||i.isPresent?w.cloneElement(l,{ref:s}):null};kr.displayName="Presence";function fM(e){const[t,r]=w.useState(),i=w.useRef(null),l=w.useRef(e),s=w.useRef("none"),c=e?"mounted":"unmounted",[f,h]=uM(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Au(i.current);s.current=f==="mounted"?d:"none"},[f]),Ut(()=>{const d=i.current,m=l.current;if(m!==e){const x=s.current,b=Au(d);e?h("MOUNT"):b==="none"||d?.display==="none"?h("UNMOUNT"):h(m&&x!==b?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,h]),Ut(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,g=b=>{const S=Au(i.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(h("ANIMATION_END"),!l.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},x=b=>{b.target===t&&(s.current=Au(i.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:w.useCallback(d=>{i.current=d?getComputedStyle(d):null,r(d)},[])}}function Au(e){return e?.animationName||"none"}function dM(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var hM=vS[" useId ".trim().toString()]||(()=>{}),mM=0;function Zo(e){const[t,r]=w.useState(hM());return Ut(()=>{r(i=>i??String(mM++))},[e]),e||(t?`radix-${t}`:"")}var pM=w.createContext(void 0);function If(e){const t=w.useContext(pM);return e||t||"ltr"}function Zt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>t.current?.(...r),[])}function gM(e,t=globalThis?.document){const r=Zt(e);w.useEffect(()=>{const i=l=>{l.key==="Escape"&&r(l)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[r,t])}var yM="DismissableLayer",Mp="dismissableLayer.update",xM="dismissableLayer.pointerDownOutside",vM="dismissableLayer.focusOutside",Vb,lE=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jg=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:s,onInteractOutside:c,onDismiss:f,...h}=e,d=w.useContext(lE),[m,g]=w.useState(null),x=m?.ownerDocument??globalThis?.document,[,b]=w.useState({}),E=We(t,L=>g(L)),S=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(_),k=m?S.indexOf(m):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,A=k>=N,z=SM(L=>{const P=L.target,H=[...d.branches].some(X=>X.contains(P));!A||H||(l?.(L),c?.(L),L.defaultPrevented||f?.())},x),j=EM(L=>{const P=L.target;[...d.branches].some(X=>X.contains(P))||(s?.(L),c?.(L),L.defaultPrevented||f?.())},x);return gM(L=>{k===d.layers.size-1&&(i?.(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},x),w.useEffect(()=>{if(m)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Vb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),$b(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Vb)}},[m,x,r,d]),w.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),$b())},[m,d]),w.useEffect(()=>{const L=()=>b({});return document.addEventListener(Mp,L),()=>document.removeEventListener(Mp,L)},[]),p.jsx(Oe.div,{...h,ref:E,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,j.onFocusCapture),onBlurCapture:je(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,z.onPointerDownCapture)})});jg.displayName=yM;var bM="DismissableLayerBranch",wM=w.forwardRef((e,t)=>{const r=w.useContext(lE),i=w.useRef(null),l=We(t,i);return w.useEffect(()=>{const s=i.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),p.jsx(Oe.div,{...e,ref:l})});wM.displayName=bM;function SM(e,t=globalThis?.document){const r=Zt(e),i=w.useRef(!1),l=w.useRef(()=>{});return w.useEffect(()=>{const s=f=>{if(f.target&&!i.current){let h=function(){aE(xM,r,d,{discrete:!0})};const d={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=h,t.addEventListener("click",l.current,{once:!0})):h()}else t.removeEventListener("click",l.current);i.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",l.current)}},[t,r]),{onPointerDownCapture:()=>i.current=!0}}function EM(e,t=globalThis?.document){const r=Zt(e),i=w.useRef(!1);return w.useEffect(()=>{const l=s=>{s.target&&!i.current&&aE(vM,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function $b(){const e=new CustomEvent(Mp);document.dispatchEvent(e)}function aE(e,t,r,{discrete:i}){const l=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),i?nM(l,s):l.dispatchEvent(s)}var Pm="focusScope.autoFocusOnMount",Um="focusScope.autoFocusOnUnmount",Yb={bubbles:!1,cancelable:!0},CM="FocusScope",Mg=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:s,...c}=e,[f,h]=w.useState(null),d=Zt(l),m=Zt(s),g=w.useRef(null),x=We(t,S=>h(S)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(i){let S=function(C){if(b.paused||!f)return;const A=C.target;f.contains(A)?g.current=A:Go(g.current,{select:!0})},_=function(C){if(b.paused||!f)return;const A=C.relatedTarget;A!==null&&(f.contains(A)||Go(g.current,{select:!0}))},N=function(C){if(document.activeElement===document.body)for(const z of C)z.removedNodes.length>0&&Go(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",_);const k=new MutationObserver(N);return f&&k.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",_),k.disconnect()}}},[i,f,b.paused]),w.useEffect(()=>{if(f){Fb.add(b);const S=document.activeElement;if(!f.contains(S)){const N=new CustomEvent(Pm,Yb);f.addEventListener(Pm,d),f.dispatchEvent(N),N.defaultPrevented||(NM(RM(sE(f)),{select:!0}),document.activeElement===S&&Go(f))}return()=>{f.removeEventListener(Pm,d),setTimeout(()=>{const N=new CustomEvent(Um,Yb);f.addEventListener(Um,m),f.dispatchEvent(N),N.defaultPrevented||Go(S??document.body,{select:!0}),f.removeEventListener(Um,m),Fb.remove(b)},0)}}},[f,d,m,b]);const E=w.useCallback(S=>{if(!r&&!i||b.paused)return;const _=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(_&&N){const k=S.currentTarget,[C,A]=_M(k);C&&A?!S.shiftKey&&N===A?(S.preventDefault(),r&&Go(C,{select:!0})):S.shiftKey&&N===C&&(S.preventDefault(),r&&Go(A,{select:!0})):N===k&&S.preventDefault()}},[r,i,b.paused]);return p.jsx(Oe.div,{tabIndex:-1,...c,ref:x,onKeyDown:E})});Mg.displayName=CM;function NM(e,{select:t=!1}={}){const r=document.activeElement;for(const i of e)if(Go(i,{select:t}),document.activeElement!==r)return}function _M(e){const t=sE(e),r=qb(t,e),i=qb(t.reverse(),e);return[r,i]}function sE(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function qb(e,t){for(const r of e)if(!kM(r,{upTo:t}))return r}function kM(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TM(e){return e instanceof HTMLInputElement&&"select"in e}function Go(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&TM(e)&&t&&e.select()}}var Fb=AM();function AM(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Xb(e,t),e.unshift(t)},remove(t){e=Xb(e,t),e[0]?.resume()}}}function Xb(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function RM(e){return e.filter(t=>t.tagName!=="A")}var jM="Portal",Og=w.forwardRef((e,t)=>{const{container:r,...i}=e,[l,s]=w.useState(!1);Ut(()=>s(!0),[]);const c=r||l&&globalThis?.document?.body;return c?nj.createPortal(p.jsx(Oe.div,{...i,ref:t}),c):null});Og.displayName=jM;var Vm=0;function cE(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gb()),document.body.insertAdjacentElement("beforeend",e[1]??Gb()),Vm++,()=>{Vm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Vm--}},[])}function Gb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gr=function(){return gr=Object.assign||function(t){for(var r,i=1,l=arguments.length;i<l;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},gr.apply(this,arguments)};function uE(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(r[i[l]]=e[i[l]]);return r}function MM(e,t,r){if(r||arguments.length===2)for(var i=0,l=t.length,s;i<l;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))}var Qu="right-scroll-bar-position",Ju="width-before-scroll-bar",OM="with-scroll-bars-hidden",DM="--removed-body-scroll-bar-size";function $m(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zM(e,t){var r=w.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(i){var l=r.value;l!==i&&(r.value=i,r.callback(i,l))}}}})[0];return r.callback=t,r.facade}var LM=typeof window<"u"?w.useLayoutEffect:w.useEffect,Wb=new WeakMap;function IM(e,t){var r=zM(null,function(i){return e.forEach(function(l){return $m(l,i)})});return LM(function(){var i=Wb.get(r);if(i){var l=new Set(i),s=new Set(e),c=r.current;l.forEach(function(f){s.has(f)||$m(f,null)}),s.forEach(function(f){l.has(f)||$m(f,c)})}Wb.set(r,e)},[e]),r}function BM(e){return e}function HM(e,t){t===void 0&&(t=BM);var r=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var c=t(s,i);return r.push(c),function(){r=r.filter(function(f){return f!==c})}},assignSyncMedium:function(s){for(i=!0;r.length;){var c=r;r=[],c.forEach(s)}r={push:function(f){return s(f)},filter:function(){return r}}},assignMedium:function(s){i=!0;var c=[];if(r.length){var f=r;r=[],f.forEach(s),c=r}var h=function(){var m=c;c=[],m.forEach(s)},d=function(){return Promise.resolve().then(h)};d(),r={push:function(m){c.push(m),d()},filter:function(m){return c=c.filter(m),r}}}};return l}function PM(e){e===void 0&&(e={});var t=HM(null);return t.options=gr({async:!0,ssr:!1},e),t}var fE=function(e){var t=e.sideCar,r=uE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return w.createElement(i,gr({},r))};fE.isSideCarExport=!0;function UM(e,t){return e.useMedium(t),fE}var dE=PM(),Ym=function(){},Bf=w.forwardRef(function(e,t){var r=w.useRef(null),i=w.useState({onScrollCapture:Ym,onWheelCapture:Ym,onTouchMoveCapture:Ym}),l=i[0],s=i[1],c=e.forwardProps,f=e.children,h=e.className,d=e.removeScrollBar,m=e.enabled,g=e.shards,x=e.sideCar,b=e.noRelative,E=e.noIsolation,S=e.inert,_=e.allowPinchZoom,N=e.as,k=N===void 0?"div":N,C=e.gapMode,A=uE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=x,j=IM([r,t]),L=gr(gr({},A),l);return w.createElement(w.Fragment,null,m&&w.createElement(z,{sideCar:dE,removeScrollBar:d,shards:g,noRelative:b,noIsolation:E,inert:S,setCallbacks:s,allowPinchZoom:!!_,lockRef:r,gapMode:C}),c?w.cloneElement(w.Children.only(f),gr(gr({},L),{ref:j})):w.createElement(k,gr({},L,{className:h,ref:j}),f))});Bf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bf.classNames={fullWidth:Ju,zeroRight:Qu};var VM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $M(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=VM();return t&&e.setAttribute("nonce",t),e}function YM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var FM=function(){var e=0,t=null;return{add:function(r){e==0&&(t=$M())&&(YM(t,r),qM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},XM=function(){var e=FM();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},hE=function(){var e=XM(),t=function(r){var i=r.styles,l=r.dynamic;return e(i,l),null};return t},GM={left:0,top:0,right:0,gap:0},qm=function(e){return parseInt(e||"",10)||0},WM=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[qm(r),qm(i),qm(l)]},ZM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GM;var t=WM(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-r+t[2]-t[0])}},KM=hE(),Bl="data-scroll-locked",QM=function(e,t,r,i){var l=e.left,s=e.top,c=e.right,f=e.gap;return r===void 0&&(r="margin"),`
13
+ .`.concat(OM,` {
14
+ overflow: hidden `).concat(i,`;
15
+ padding-right: `).concat(f,"px ").concat(i,`;
16
+ }
17
+ body[`).concat(Bl,`] {
18
+ overflow: hidden `).concat(i,`;
19
+ overscroll-behavior: contain;
20
+ `).concat([t&&"position: relative ".concat(i,";"),r==="margin"&&`
21
+ padding-left: `.concat(l,`px;
22
+ padding-top: `).concat(s,`px;
23
+ padding-right: `).concat(c,`px;
24
+ margin-left:0;
25
+ margin-top:0;
26
+ margin-right: `).concat(f,"px ").concat(i,`;
27
+ `),r==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
28
+ }
29
+
30
+ .`).concat(Qu,` {
31
+ right: `).concat(f,"px ").concat(i,`;
32
+ }
33
+
34
+ .`).concat(Ju,` {
35
+ margin-right: `).concat(f,"px ").concat(i,`;
36
+ }
37
+
38
+ .`).concat(Qu," .").concat(Qu,` {
39
+ right: 0 `).concat(i,`;
40
+ }
41
+
42
+ .`).concat(Ju," .").concat(Ju,` {
43
+ margin-right: 0 `).concat(i,`;
44
+ }
45
+
46
+ body[`).concat(Bl,`] {
47
+ `).concat(DM,": ").concat(f,`px;
48
+ }
49
+ `)},Zb=function(){var e=parseInt(document.body.getAttribute(Bl)||"0",10);return isFinite(e)?e:0},JM=function(){w.useEffect(function(){return document.body.setAttribute(Bl,(Zb()+1).toString()),function(){var e=Zb()-1;e<=0?document.body.removeAttribute(Bl):document.body.setAttribute(Bl,e.toString())}},[])},eO=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,l=i===void 0?"margin":i;JM();var s=w.useMemo(function(){return ZM(l)},[l]);return w.createElement(KM,{styles:QM(s,!t,l,r?"":"!important")})},Op=!1;if(typeof window<"u")try{var Ru=Object.defineProperty({},"passive",{get:function(){return Op=!0,!0}});window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Op=!1}var Rl=Op?{passive:!1}:!1,tO=function(e){return e.tagName==="TEXTAREA"},mE=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!tO(e)&&r[t]==="visible")},nO=function(e){return mE(e,"overflowY")},rO=function(e){return mE(e,"overflowX")},Kb=function(e,t){var r=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=pE(e,i);if(l){var s=gE(e,i),c=s[1],f=s[2];if(c>f)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},oO=function(e){var t=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[t,r,i]},iO=function(e){var t=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[t,r,i]},pE=function(e,t){return e==="v"?nO(t):rO(t)},gE=function(e,t){return e==="v"?oO(t):iO(t)},lO=function(e,t){return e==="h"&&t==="rtl"?-1:1},aO=function(e,t,r,i,l){var s=lO(e,window.getComputedStyle(t).direction),c=s*i,f=r.target,h=t.contains(f),d=!1,m=c>0,g=0,x=0;do{if(!f)break;var b=gE(e,f),E=b[0],S=b[1],_=b[2],N=S-_-s*E;(E||N)&&pE(e,f)&&(g+=N,x+=E);var k=f.parentNode;f=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!h&&f!==document.body||h&&(t.contains(f)||t===f));return(m&&Math.abs(g)<1||!m&&Math.abs(x)<1)&&(d=!0),d},ju=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qb=function(e){return[e.deltaX,e.deltaY]},Jb=function(e){return e&&"current"in e?e.current:e},sO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cO=function(e){return`
50
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
51
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
+ `)},uO=0,jl=[];function fO(e){var t=w.useRef([]),r=w.useRef([0,0]),i=w.useRef(),l=w.useState(uO++)[0],s=w.useState(hE)[0],c=w.useRef(e);w.useEffect(function(){c.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var S=MM([e.lockRef.current],(e.shards||[]).map(Jb),!0).filter(Boolean);return S.forEach(function(_){return _.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),S.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(S,_){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var N=ju(S),k=r.current,C="deltaX"in S?S.deltaX:k[0]-N[0],A="deltaY"in S?S.deltaY:k[1]-N[1],z,j=S.target,L=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in S&&L==="h"&&j.type==="range")return!1;var P=window.getSelection(),H=P&&P.anchorNode,X=H?H===j||H.contains(j):!1;if(X)return!1;var q=Kb(L,j);if(!q)return!0;if(q?z=L:(z=L==="v"?"h":"v",q=Kb(L,j)),!q)return!1;if(!i.current&&"changedTouches"in S&&(C||A)&&(i.current=z),!z)return!0;var Y=i.current||z;return aO(Y,_,S,Y==="h"?C:A)},[]),h=w.useCallback(function(S){var _=S;if(!(!jl.length||jl[jl.length-1]!==s)){var N="deltaY"in _?Qb(_):ju(_),k=t.current.filter(function(z){return z.name===_.type&&(z.target===_.target||_.target===z.shadowParent)&&sO(z.delta,N)})[0];if(k&&k.should){_.cancelable&&_.preventDefault();return}if(!k){var C=(c.current.shards||[]).map(Jb).filter(Boolean).filter(function(z){return z.contains(_.target)}),A=C.length>0?f(_,C[0]):!c.current.noIsolation;A&&_.cancelable&&_.preventDefault()}}},[]),d=w.useCallback(function(S,_,N,k){var C={name:S,delta:_,target:N,should:k,shadowParent:dO(N)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),m=w.useCallback(function(S){r.current=ju(S),i.current=void 0},[]),g=w.useCallback(function(S){d(S.type,Qb(S),S.target,f(S,e.lockRef.current))},[]),x=w.useCallback(function(S){d(S.type,ju(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return jl.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",h,Rl),document.addEventListener("touchmove",h,Rl),document.addEventListener("touchstart",m,Rl),function(){jl=jl.filter(function(S){return S!==s}),document.removeEventListener("wheel",h,Rl),document.removeEventListener("touchmove",h,Rl),document.removeEventListener("touchstart",m,Rl)}},[]);var b=e.removeScrollBar,E=e.inert;return w.createElement(w.Fragment,null,E?w.createElement(s,{styles:cO(l)}):null,b?w.createElement(eO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hO=UM(dE,fO);var Dg=w.forwardRef(function(e,t){return w.createElement(Bf,gr({},e,{ref:t,sideCar:hO}))});Dg.classNames=Bf.classNames;var mO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ml=new WeakMap,Mu=new WeakMap,Ou={},Fm=0,yE=function(e){return e&&(e.host||yE(e.parentNode))},pO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var i=yE(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},gO=function(e,t,r,i){var l=pO(t,Array.isArray(e)?e:[e]);Ou[r]||(Ou[r]=new WeakMap);var s=Ou[r],c=[],f=new Set,h=new Set(l),d=function(g){!g||f.has(g)||(f.add(g),d(g.parentNode))};l.forEach(d);var m=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(x){if(f.has(x))m(x);else try{var b=x.getAttribute(i),E=b!==null&&b!=="false",S=(Ml.get(x)||0)+1,_=(s.get(x)||0)+1;Ml.set(x,S),s.set(x,_),c.push(x),S===1&&E&&Mu.set(x,!0),_===1&&x.setAttribute(r,"true"),E||x.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return m(t),f.clear(),Fm++,function(){c.forEach(function(g){var x=Ml.get(g)-1,b=s.get(g)-1;Ml.set(g,x),s.set(g,b),x||(Mu.has(g)||g.removeAttribute(i),Mu.delete(g)),b||g.removeAttribute(r)}),Fm--,Fm||(Ml=new WeakMap,Ml=new WeakMap,Mu=new WeakMap,Ou={})}},xE=function(e,t,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),l=mO(e);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),gO(i,l,r,"aria-hidden")):function(){return null}},Hf="Dialog",[vE]=fo(Hf),[yO,ir]=vE(Hf),bE=e=>{const{__scopeDialog:t,children:r,open:i,defaultOpen:l,onOpenChange:s,modal:c=!0}=e,f=w.useRef(null),h=w.useRef(null),[d,m]=Mi({prop:i,defaultProp:l??!1,onChange:s,caller:Hf});return p.jsx(yO,{scope:t,triggerRef:f,contentRef:h,contentId:Zo(),titleId:Zo(),descriptionId:Zo(),open:d,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(g=>!g),[m]),modal:c,children:r})};bE.displayName=Hf;var wE="DialogTrigger",xO=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(wE,r),s=We(t,l.triggerRef);return p.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Ig(l.open),...i,ref:s,onClick:je(e.onClick,l.onOpenToggle)})});xO.displayName=wE;var zg="DialogPortal",[vO,SE]=vE(zg,{forceMount:void 0}),EE=e=>{const{__scopeDialog:t,forceMount:r,children:i,container:l}=e,s=ir(zg,t);return p.jsx(vO,{scope:t,forceMount:r,children:w.Children.map(i,c=>p.jsx(kr,{present:r||s.open,children:p.jsx(Og,{asChild:!0,container:l,children:c})}))})};EE.displayName=zg;var ff="DialogOverlay",CE=w.forwardRef((e,t)=>{const r=SE(ff,e.__scopeDialog),{forceMount:i=r.forceMount,...l}=e,s=ir(ff,e.__scopeDialog);return s.modal?p.jsx(kr,{present:i||s.open,children:p.jsx(wO,{...l,ref:t})}):null});CE.displayName=ff;var bO=ql("DialogOverlay.RemoveScroll"),wO=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(ff,r);return p.jsx(Dg,{as:bO,allowPinchZoom:!0,shards:[l.contentRef],children:p.jsx(Oe.div,{"data-state":Ig(l.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),Oi="DialogContent",NE=w.forwardRef((e,t)=>{const r=SE(Oi,e.__scopeDialog),{forceMount:i=r.forceMount,...l}=e,s=ir(Oi,e.__scopeDialog);return p.jsx(kr,{present:i||s.open,children:s.modal?p.jsx(SO,{...l,ref:t}):p.jsx(EO,{...l,ref:t})})});NE.displayName=Oi;var SO=w.forwardRef((e,t)=>{const r=ir(Oi,e.__scopeDialog),i=w.useRef(null),l=We(t,r.contentRef,i);return w.useEffect(()=>{const s=i.current;if(s)return xE(s)},[]),p.jsx(_E,{...e,ref:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&s.preventDefault()}),onFocusOutside:je(e.onFocusOutside,s=>s.preventDefault())})}),EO=w.forwardRef((e,t)=>{const r=ir(Oi,e.__scopeDialog),i=w.useRef(!1),l=w.useRef(!1);return p.jsx(_E,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(i.current||r.triggerRef.current?.focus(),s.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=s.target;r.triggerRef.current?.contains(c)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&l.current&&s.preventDefault()}})}),_E=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:s,...c}=e,f=ir(Oi,r),h=w.useRef(null),d=We(t,h);return cE(),p.jsxs(p.Fragment,{children:[p.jsx(Mg,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:s,children:p.jsx(jg,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Ig(f.open),...c,ref:d,onDismiss:()=>f.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(CO,{titleId:f.titleId}),p.jsx(_O,{contentRef:h,descriptionId:f.descriptionId})]})]})}),Lg="DialogTitle",kE=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(Lg,r);return p.jsx(Oe.h2,{id:l.titleId,...i,ref:t})});kE.displayName=Lg;var TE="DialogDescription",AE=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(TE,r);return p.jsx(Oe.p,{id:l.descriptionId,...i,ref:t})});AE.displayName=TE;var RE="DialogClose",jE=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(RE,r);return p.jsx(Oe.button,{type:"button",...i,ref:t,onClick:je(e.onClick,()=>l.onOpenChange(!1))})});jE.displayName=RE;function Ig(e){return e?"open":"closed"}var ME="DialogTitleWarning",[b7,OE]=iM(ME,{contentName:Oi,titleName:Lg,docsSlug:"dialog"}),CO=({titleId:e})=>{const t=OE(ME),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
53
+
54
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
55
+
56
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},NO="DialogDescriptionWarning",_O=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${OE(NO).contentName}}.`;return w.useEffect(()=>{const l=e.current?.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},DE=bE,zE=EE,LE=CE,IE=NE,BE=kE,HE=AE,PE=jE,Xm={exports:{}},Gm={};var ew;function kO(){if(ew)return Gm;ew=1;var e=Vs();function t(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var r=typeof Object.is=="function"?Object.is:t,i=e.useState,l=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function f(g,x){var b=x(),E=i({inst:{value:b,getSnapshot:x}}),S=E[0].inst,_=E[1];return s(function(){S.value=b,S.getSnapshot=x,h(S)&&_({inst:S})},[g,b,x]),l(function(){return h(S)&&_({inst:S}),g(function(){h(S)&&_({inst:S})})},[g]),c(b),b}function h(g){var x=g.getSnapshot;g=g.value;try{var b=x();return!r(g,b)}catch{return!0}}function d(g,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Gm}var tw;function TO(){return tw||(tw=1,Xm.exports=kO()),Xm.exports}function Bg(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Hg(e){const[t,r]=w.useState(void 0);return Ut(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const s=l[0];let c,f;if("borderBoxSize"in s){const h=s.borderBoxSize,d=Array.isArray(h)?h[0]:h;c=d.inlineSize,f=d.blockSize}else c=e.offsetWidth,f=e.offsetHeight;r({width:c,height:f})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),t}var Pf="Checkbox",[AO]=fo(Pf),[RO,Pg]=AO(Pf);function jO(e){const{__scopeCheckbox:t,checked:r,children:i,defaultChecked:l,disabled:s,form:c,name:f,onCheckedChange:h,required:d,value:m="on",internal_do_not_use_render:g}=e,[x,b]=Mi({prop:r,defaultProp:l??!1,onChange:h,caller:Pf}),[E,S]=w.useState(null),[_,N]=w.useState(null),k=w.useRef(!1),C=E?!!c||!!E.closest("form"):!0,A={checked:x,disabled:s,setChecked:b,control:E,setControl:S,name:f,form:c,value:m,hasConsumerStoppedPropagationRef:k,required:d,defaultChecked:Ko(l)?!1:l,isFormControl:C,bubbleInput:_,setBubbleInput:N};return p.jsx(RO,{scope:t,...A,children:MO(g)?g(A):i})}var UE="CheckboxTrigger",VE=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...i},l)=>{const{control:s,value:c,disabled:f,checked:h,required:d,setControl:m,setChecked:g,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:E}=Pg(UE,e),S=We(l,m),_=w.useRef(h);return w.useEffect(()=>{const N=s?.form;if(N){const k=()=>g(_.current);return N.addEventListener("reset",k),()=>N.removeEventListener("reset",k)}},[s,g]),p.jsx(Oe.button,{type:"button",role:"checkbox","aria-checked":Ko(h)?"mixed":h,"aria-required":d,"data-state":GE(h),"data-disabled":f?"":void 0,disabled:f,value:c,...i,ref:S,onKeyDown:je(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:je(r,N=>{g(k=>Ko(k)?!0:!k),E&&b&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})})});VE.displayName=UE;var $E=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:i,checked:l,defaultChecked:s,required:c,disabled:f,value:h,onCheckedChange:d,form:m,...g}=e;return p.jsx(jO,{__scopeCheckbox:r,checked:l,defaultChecked:s,disabled:f,required:c,onCheckedChange:d,name:i,form:m,value:h,internal_do_not_use_render:({isFormControl:x})=>p.jsxs(p.Fragment,{children:[p.jsx(VE,{...g,ref:t,__scopeCheckbox:r}),x&&p.jsx(XE,{__scopeCheckbox:r})]})})});$E.displayName=Pf;var YE="CheckboxIndicator",qE=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:i,...l}=e,s=Pg(YE,r);return p.jsx(kr,{present:i||Ko(s.checked)||s.checked===!0,children:p.jsx(Oe.span,{"data-state":GE(s.checked),"data-disabled":s.disabled?"":void 0,...l,ref:t,style:{pointerEvents:"none",...e.style}})})});qE.displayName=YE;var FE="CheckboxBubbleInput",XE=w.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:i,hasConsumerStoppedPropagationRef:l,checked:s,defaultChecked:c,required:f,disabled:h,name:d,value:m,form:g,bubbleInput:x,setBubbleInput:b}=Pg(FE,e),E=We(r,b),S=Bg(s),_=Hg(i);w.useEffect(()=>{const k=x;if(!k)return;const C=window.HTMLInputElement.prototype,z=Object.getOwnPropertyDescriptor(C,"checked").set,j=!l.current;if(S!==s&&z){const L=new Event("click",{bubbles:j});k.indeterminate=Ko(s),z.call(k,Ko(s)?!1:s),k.dispatchEvent(L)}},[x,S,s,l]);const N=w.useRef(Ko(s)?!1:s);return p.jsx(Oe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??N.current,required:f,disabled:h,name:d,value:m,form:g,...t,tabIndex:-1,ref:E,style:{...t.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});XE.displayName=FE;function MO(e){return typeof e=="function"}function Ko(e){return e==="indeterminate"}function GE(e){return Ko(e)?"indeterminate":e?"checked":"unchecked"}const OO=["top","right","bottom","left"],Qo=Math.min,wn=Math.max,df=Math.round,Du=Math.floor,br=e=>({x:e,y:e}),DO={left:"right",right:"left",bottom:"top",top:"bottom"},zO={start:"end",end:"start"};function Dp(e,t,r){return wn(e,Qo(t,r))}function so(e,t){return typeof e=="function"?e(t):e}function co(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function Ug(e){return e==="x"?"y":"x"}function Vg(e){return e==="y"?"height":"width"}const LO=new Set(["top","bottom"]);function vr(e){return LO.has(co(e))?"y":"x"}function $g(e){return Ug(vr(e))}function IO(e,t,r){r===void 0&&(r=!1);const i=ia(e),l=$g(e),s=Vg(l);let c=l==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=hf(c)),[c,hf(c)]}function BO(e){const t=hf(e);return[zp(e),t,zp(t)]}function zp(e){return e.replace(/start|end/g,t=>zO[t])}const nw=["left","right"],rw=["right","left"],HO=["top","bottom"],PO=["bottom","top"];function UO(e,t,r){switch(e){case"top":case"bottom":return r?t?rw:nw:t?nw:rw;case"left":case"right":return t?HO:PO;default:return[]}}function VO(e,t,r,i){const l=ia(e);let s=UO(co(e),r==="start",i);return l&&(s=s.map(c=>c+"-"+l),t&&(s=s.concat(s.map(zp)))),s}function hf(e){return e.replace(/left|right|bottom|top/g,t=>DO[t])}function $O(e){return{top:0,right:0,bottom:0,left:0,...e}}function WE(e){return typeof e!="number"?$O(e):{top:e,right:e,bottom:e,left:e}}function mf(e){const{x:t,y:r,width:i,height:l}=e;return{width:i,height:l,top:r,left:t,right:t+i,bottom:r+l,x:t,y:r}}function ow(e,t,r){let{reference:i,floating:l}=e;const s=vr(t),c=$g(t),f=Vg(c),h=co(t),d=s==="y",m=i.x+i.width/2-l.width/2,g=i.y+i.height/2-l.height/2,x=i[f]/2-l[f]/2;let b;switch(h){case"top":b={x:m,y:i.y-l.height};break;case"bottom":b={x:m,y:i.y+i.height};break;case"right":b={x:i.x+i.width,y:g};break;case"left":b={x:i.x-l.width,y:g};break;default:b={x:i.x,y:i.y}}switch(ia(t)){case"start":b[c]-=x*(r&&d?-1:1);break;case"end":b[c]+=x*(r&&d?-1:1);break}return b}async function YO(e,t){var r;t===void 0&&(t={});const{x:i,y:l,platform:s,rects:c,elements:f,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:x=!1,padding:b=0}=so(t,e),E=WE(b),_=f[x?g==="floating"?"reference":"floating":g],N=mf(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(_)))==null||r?_:_.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(f.floating)),boundary:d,rootBoundary:m,strategy:h})),k=g==="floating"?{x:i,y:l,width:c.floating.width,height:c.floating.height}:c.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f.floating)),A=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},z=mf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:C,strategy:h}):k);return{top:(N.top-z.top+E.top)/A.y,bottom:(z.bottom-N.bottom+E.bottom)/A.y,left:(N.left-z.left+E.left)/A.x,right:(z.right-N.right+E.right)/A.x}}const qO=async(e,t,r)=>{const{placement:i="bottom",strategy:l="absolute",middleware:s=[],platform:c}=r,f=s.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let d=await c.getElementRects({reference:e,floating:t,strategy:l}),{x:m,y:g}=ow(d,i,h),x=i,b={},E=0;for(let _=0;_<f.length;_++){var S;const{name:N,fn:k}=f[_],{x:C,y:A,data:z,reset:j}=await k({x:m,y:g,initialPlacement:i,placement:x,strategy:l,middlewareData:b,rects:d,platform:{...c,detectOverflow:(S=c.detectOverflow)!=null?S:YO},elements:{reference:e,floating:t}});m=C??m,g=A??g,b={...b,[N]:{...b[N],...z}},j&&E<=50&&(E++,typeof j=="object"&&(j.placement&&(x=j.placement),j.rects&&(d=j.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:l}):j.rects),{x:m,y:g}=ow(d,x,h)),_=-1)}return{x:m,y:g,placement:x,strategy:l,middlewareData:b}},FO=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:i,placement:l,rects:s,platform:c,elements:f,middlewareData:h}=t,{element:d,padding:m=0}=so(e,t)||{};if(d==null)return{};const g=WE(m),x={x:r,y:i},b=$g(l),E=Vg(b),S=await c.getDimensions(d),_=b==="y",N=_?"top":"left",k=_?"bottom":"right",C=_?"clientHeight":"clientWidth",A=s.reference[E]+s.reference[b]-x[b]-s.floating[E],z=x[b]-s.reference[b],j=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let L=j?j[C]:0;(!L||!await(c.isElement==null?void 0:c.isElement(j)))&&(L=f.floating[C]||s.floating[E]);const P=A/2-z/2,H=L/2-S[E]/2-1,X=Qo(g[N],H),q=Qo(g[k],H),Y=X,F=L-S[E]-q,O=L/2-S[E]/2+P,U=Dp(Y,O,F),R=!h.arrow&&ia(l)!=null&&O!==U&&s.reference[E]/2-(O<Y?X:q)-S[E]/2<0,V=R?O<Y?O-Y:O-F:0;return{[b]:x[b]+V,data:{[b]:U,centerOffset:O-U-V,...R&&{alignmentOffset:V}},reset:R}}}),XO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,i;const{placement:l,middlewareData:s,rects:c,initialPlacement:f,platform:h,elements:d}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,..._}=so(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const N=co(l),k=vr(f),C=co(f)===f,A=await(h.isRTL==null?void 0:h.isRTL(d.floating)),z=x||(C||!S?[hf(f)]:BO(f)),j=E!=="none";!x&&j&&z.push(...VO(f,S,E,A));const L=[f,...z],P=await h.detectOverflow(t,_),H=[];let X=((i=s.flip)==null?void 0:i.overflows)||[];if(m&&H.push(P[N]),g){const O=IO(l,c,A);H.push(P[O[0]],P[O[1]])}if(X=[...X,{placement:l,overflows:H}],!H.every(O=>O<=0)){var q,Y;const O=(((q=s.flip)==null?void 0:q.index)||0)+1,U=L[O];if(U&&(!(g==="alignment"?k!==vr(U):!1)||X.every($=>vr($.placement)===k?$.overflows[0]>0:!0)))return{data:{index:O,overflows:X},reset:{placement:U}};let R=(Y=X.filter(V=>V.overflows[0]<=0).sort((V,$)=>V.overflows[1]-$.overflows[1])[0])==null?void 0:Y.placement;if(!R)switch(b){case"bestFit":{var F;const V=(F=X.filter($=>{if(j){const W=vr($.placement);return W===k||W==="y"}return!0}).map($=>[$.placement,$.overflows.filter(W=>W>0).reduce((W,M)=>W+M,0)]).sort(($,W)=>$[1]-W[1])[0])==null?void 0:F[0];V&&(R=V);break}case"initialPlacement":R=f;break}if(l!==R)return{reset:{placement:R}}}return{}}}};function iw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lw(e){return OO.some(t=>e[t]>=0)}const GO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:i}=t,{strategy:l="referenceHidden",...s}=so(e,t);switch(l){case"referenceHidden":{const c=await i.detectOverflow(t,{...s,elementContext:"reference"}),f=iw(c,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:lw(f)}}}case"escaped":{const c=await i.detectOverflow(t,{...s,altBoundary:!0}),f=iw(c,r.floating);return{data:{escapedOffsets:f,escaped:lw(f)}}}default:return{}}}}},ZE=new Set(["left","top"]);async function WO(e,t){const{placement:r,platform:i,elements:l}=e,s=await(i.isRTL==null?void 0:i.isRTL(l.floating)),c=co(r),f=ia(r),h=vr(r)==="y",d=ZE.has(c)?-1:1,m=s&&h?-1:1,g=so(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:E}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof E=="number"&&(b=f==="end"?E*-1:E),h?{x:b*m,y:x*d}:{x:x*d,y:b*m}}const ZO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,i;const{x:l,y:s,placement:c,middlewareData:f}=t,h=await WO(t,e);return c===((r=f.offset)==null?void 0:r.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:l+h.x,y:s+h.y,data:{...h,placement:c}}}}},KO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:i,placement:l,platform:s}=t,{mainAxis:c=!0,crossAxis:f=!1,limiter:h={fn:N=>{let{x:k,y:C}=N;return{x:k,y:C}}},...d}=so(e,t),m={x:r,y:i},g=await s.detectOverflow(t,d),x=vr(co(l)),b=Ug(x);let E=m[b],S=m[x];if(c){const N=b==="y"?"top":"left",k=b==="y"?"bottom":"right",C=E+g[N],A=E-g[k];E=Dp(C,E,A)}if(f){const N=x==="y"?"top":"left",k=x==="y"?"bottom":"right",C=S+g[N],A=S-g[k];S=Dp(C,S,A)}const _=h.fn({...t,[b]:E,[x]:S});return{..._,data:{x:_.x-r,y:_.y-i,enabled:{[b]:c,[x]:f}}}}}},QO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:i,placement:l,rects:s,middlewareData:c}=t,{offset:f=0,mainAxis:h=!0,crossAxis:d=!0}=so(e,t),m={x:r,y:i},g=vr(l),x=Ug(g);let b=m[x],E=m[g];const S=so(f,t),_=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const C=x==="y"?"height":"width",A=s.reference[x]-s.floating[C]+_.mainAxis,z=s.reference[x]+s.reference[C]-_.mainAxis;b<A?b=A:b>z&&(b=z)}if(d){var N,k;const C=x==="y"?"width":"height",A=ZE.has(co(l)),z=s.reference[g]-s.floating[C]+(A&&((N=c.offset)==null?void 0:N[g])||0)+(A?0:_.crossAxis),j=s.reference[g]+s.reference[C]+(A?0:((k=c.offset)==null?void 0:k[g])||0)-(A?_.crossAxis:0);E<z?E=z:E>j&&(E=j)}return{[x]:b,[g]:E}}}},JO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,i;const{placement:l,rects:s,platform:c,elements:f}=t,{apply:h=()=>{},...d}=so(e,t),m=await c.detectOverflow(t,d),g=co(l),x=ia(l),b=vr(l)==="y",{width:E,height:S}=s.floating;let _,N;g==="top"||g==="bottom"?(_=g,N=x===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(N=g,_=x==="end"?"top":"bottom");const k=S-m.top-m.bottom,C=E-m.left-m.right,A=Qo(S-m[_],k),z=Qo(E-m[N],C),j=!t.middlewareData.shift;let L=A,P=z;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=C),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(L=k),j&&!x){const X=wn(m.left,0),q=wn(m.right,0),Y=wn(m.top,0),F=wn(m.bottom,0);b?P=E-2*(X!==0||q!==0?X+q:wn(m.left,m.right)):L=S-2*(Y!==0||F!==0?Y+F:wn(m.top,m.bottom))}await h({...t,availableWidth:P,availableHeight:L});const H=await c.getDimensions(f.floating);return E!==H.width||S!==H.height?{reset:{rects:!0}}:{}}}};function Uf(){return typeof window<"u"}function la(e){return KE(e)?(e.nodeName||"").toLowerCase():"#document"}function Nn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Tr(e){var t;return(t=(KE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function KE(e){return Uf()?e instanceof Node||e instanceof Nn(e).Node:!1}function rr(e){return Uf()?e instanceof Element||e instanceof Nn(e).Element:!1}function Er(e){return Uf()?e instanceof HTMLElement||e instanceof Nn(e).HTMLElement:!1}function aw(e){return!Uf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nn(e).ShadowRoot}const eD=new Set(["inline","contents"]);function Xs(e){const{overflow:t,overflowX:r,overflowY:i,display:l}=or(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+r)&&!eD.has(l)}const tD=new Set(["table","td","th"]);function nD(e){return tD.has(la(e))}const rD=[":popover-open",":modal"];function Vf(e){return rD.some(t=>{try{return e.matches(t)}catch{return!1}})}const oD=["transform","translate","scale","rotate","perspective"],iD=["transform","translate","scale","rotate","perspective","filter"],lD=["paint","layout","strict","content"];function Yg(e){const t=qg(),r=rr(e)?or(e):e;return oD.some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||iD.some(i=>(r.willChange||"").includes(i))||lD.some(i=>(r.contain||"").includes(i))}function aD(e){let t=Jo(e);for(;Er(t)&&!Fl(t);){if(Yg(t))return t;if(Vf(t))return null;t=Jo(t)}return null}function qg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sD=new Set(["html","body","#document"]);function Fl(e){return sD.has(la(e))}function or(e){return Nn(e).getComputedStyle(e)}function $f(e){return rr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jo(e){if(la(e)==="html")return e;const t=e.assignedSlot||e.parentNode||aw(e)&&e.host||Tr(e);return aw(t)?t.host:t}function QE(e){const t=Jo(e);return Fl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Er(t)&&Xs(t)?t:QE(t)}function Cs(e,t,r){var i;t===void 0&&(t=[]),r===void 0&&(r=!0);const l=QE(e),s=l===((i=e.ownerDocument)==null?void 0:i.body),c=Nn(l);if(s){const f=Lp(c);return t.concat(c,c.visualViewport||[],Xs(l)?l:[],f&&r?Cs(f):[])}return t.concat(l,Cs(l,[],r))}function Lp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function JE(e){const t=or(e);let r=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const l=Er(e),s=l?e.offsetWidth:r,c=l?e.offsetHeight:i,f=df(r)!==s||df(i)!==c;return f&&(r=s,i=c),{width:r,height:i,$:f}}function Fg(e){return rr(e)?e:e.contextElement}function Hl(e){const t=Fg(e);if(!Er(t))return br(1);const r=t.getBoundingClientRect(),{width:i,height:l,$:s}=JE(t);let c=(s?df(r.width):r.width)/i,f=(s?df(r.height):r.height)/l;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const cD=br(0);function eC(e){const t=Nn(e);return!qg()||!t.visualViewport?cD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uD(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Nn(e)?!1:t}function Di(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),s=Fg(e);let c=br(1);t&&(i?rr(i)&&(c=Hl(i)):c=Hl(e));const f=uD(s,r,i)?eC(s):br(0);let h=(l.left+f.x)/c.x,d=(l.top+f.y)/c.y,m=l.width/c.x,g=l.height/c.y;if(s){const x=Nn(s),b=i&&rr(i)?Nn(i):i;let E=x,S=Lp(E);for(;S&&i&&b!==E;){const _=Hl(S),N=S.getBoundingClientRect(),k=or(S),C=N.left+(S.clientLeft+parseFloat(k.paddingLeft))*_.x,A=N.top+(S.clientTop+parseFloat(k.paddingTop))*_.y;h*=_.x,d*=_.y,m*=_.x,g*=_.y,h+=C,d+=A,E=Nn(S),S=Lp(E)}}return mf({width:m,height:g,x:h,y:d})}function Yf(e,t){const r=$f(e).scrollLeft;return t?t.left+r:Di(Tr(e)).left+r}function tC(e,t){const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-Yf(e,r),l=r.top+t.scrollTop;return{x:i,y:l}}function fD(e){let{elements:t,rect:r,offsetParent:i,strategy:l}=e;const s=l==="fixed",c=Tr(i),f=t?Vf(t.floating):!1;if(i===c||f&&s)return r;let h={scrollLeft:0,scrollTop:0},d=br(1);const m=br(0),g=Er(i);if((g||!g&&!s)&&((la(i)!=="body"||Xs(c))&&(h=$f(i)),Er(i))){const b=Di(i);d=Hl(i),m.x=b.x+i.clientLeft,m.y=b.y+i.clientTop}const x=c&&!g&&!s?tC(c,h):br(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-h.scrollLeft*d.x+m.x+x.x,y:r.y*d.y-h.scrollTop*d.y+m.y+x.y}}function dD(e){return Array.from(e.getClientRects())}function hD(e){const t=Tr(e),r=$f(e),i=e.ownerDocument.body,l=wn(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=wn(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let c=-r.scrollLeft+Yf(e);const f=-r.scrollTop;return or(i).direction==="rtl"&&(c+=wn(t.clientWidth,i.clientWidth)-l),{width:l,height:s,x:c,y:f}}const sw=25;function mD(e,t){const r=Nn(e),i=Tr(e),l=r.visualViewport;let s=i.clientWidth,c=i.clientHeight,f=0,h=0;if(l){s=l.width,c=l.height;const m=qg();(!m||m&&t==="fixed")&&(f=l.offsetLeft,h=l.offsetTop)}const d=Yf(i);if(d<=0){const m=i.ownerDocument,g=m.body,x=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,E=Math.abs(i.clientWidth-g.clientWidth-b);E<=sw&&(s-=E)}else d<=sw&&(s+=d);return{width:s,height:c,x:f,y:h}}const pD=new Set(["absolute","fixed"]);function gD(e,t){const r=Di(e,!0,t==="fixed"),i=r.top+e.clientTop,l=r.left+e.clientLeft,s=Er(e)?Hl(e):br(1),c=e.clientWidth*s.x,f=e.clientHeight*s.y,h=l*s.x,d=i*s.y;return{width:c,height:f,x:h,y:d}}function cw(e,t,r){let i;if(t==="viewport")i=mD(e,r);else if(t==="document")i=hD(Tr(e));else if(rr(t))i=gD(t,r);else{const l=eC(e);i={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return mf(i)}function nC(e,t){const r=Jo(e);return r===t||!rr(r)||Fl(r)?!1:or(r).position==="fixed"||nC(r,t)}function yD(e,t){const r=t.get(e);if(r)return r;let i=Cs(e,[],!1).filter(f=>rr(f)&&la(f)!=="body"),l=null;const s=or(e).position==="fixed";let c=s?Jo(e):e;for(;rr(c)&&!Fl(c);){const f=or(c),h=Yg(c);!h&&f.position==="fixed"&&(l=null),(s?!h&&!l:!h&&f.position==="static"&&!!l&&pD.has(l.position)||Xs(c)&&!h&&nC(e,c))?i=i.filter(m=>m!==c):l=f,c=Jo(c)}return t.set(e,i),i}function xD(e){let{element:t,boundary:r,rootBoundary:i,strategy:l}=e;const c=[...r==="clippingAncestors"?Vf(t)?[]:yD(t,this._c):[].concat(r),i],f=c[0],h=c.reduce((d,m)=>{const g=cw(t,m,l);return d.top=wn(g.top,d.top),d.right=Qo(g.right,d.right),d.bottom=Qo(g.bottom,d.bottom),d.left=wn(g.left,d.left),d},cw(t,f,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function vD(e){const{width:t,height:r}=JE(e);return{width:t,height:r}}function bD(e,t,r){const i=Er(t),l=Tr(t),s=r==="fixed",c=Di(e,!0,s,t);let f={scrollLeft:0,scrollTop:0};const h=br(0);function d(){h.x=Yf(l)}if(i||!i&&!s)if((la(t)!=="body"||Xs(l))&&(f=$f(t)),i){const b=Di(t,!0,s,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}else l&&d();s&&!i&&l&&d();const m=l&&!i&&!s?tC(l,f):br(0),g=c.left+f.scrollLeft-h.x-m.x,x=c.top+f.scrollTop-h.y-m.y;return{x:g,y:x,width:c.width,height:c.height}}function Wm(e){return or(e).position==="static"}function uw(e,t){if(!Er(e)||or(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Tr(e)===r&&(r=r.ownerDocument.body),r}function rC(e,t){const r=Nn(e);if(Vf(e))return r;if(!Er(e)){let l=Jo(e);for(;l&&!Fl(l);){if(rr(l)&&!Wm(l))return l;l=Jo(l)}return r}let i=uw(e,t);for(;i&&nD(i)&&Wm(i);)i=uw(i,t);return i&&Fl(i)&&Wm(i)&&!Yg(i)?r:i||aD(e)||r}const wD=async function(e){const t=this.getOffsetParent||rC,r=this.getDimensions,i=await r(e.floating);return{reference:bD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function SD(e){return or(e).direction==="rtl"}const ED={convertOffsetParentRelativeRectToViewportRelativeRect:fD,getDocumentElement:Tr,getClippingRect:xD,getOffsetParent:rC,getElementRects:wD,getClientRects:dD,getDimensions:vD,getScale:Hl,isElement:rr,isRTL:SD};function oC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function CD(e,t){let r=null,i;const l=Tr(e);function s(){var f;clearTimeout(i),(f=r)==null||f.disconnect(),r=null}function c(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),s();const d=e.getBoundingClientRect(),{left:m,top:g,width:x,height:b}=d;if(f||t(),!x||!b)return;const E=Du(g),S=Du(l.clientWidth-(m+x)),_=Du(l.clientHeight-(g+b)),N=Du(m),C={rootMargin:-E+"px "+-S+"px "+-_+"px "+-N+"px",threshold:wn(0,Qo(1,h))||1};let A=!0;function z(j){const L=j[0].intersectionRatio;if(L!==h){if(!A)return c();L?c(!1,L):i=setTimeout(()=>{c(!1,1e-7)},1e3)}L===1&&!oC(d,e.getBoundingClientRect())&&c(),A=!1}try{r=new IntersectionObserver(z,{...C,root:l.ownerDocument})}catch{r=new IntersectionObserver(z,C)}r.observe(e)}return c(!0),s}function ND(e,t,r,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,d=Fg(e),m=l||s?[...d?Cs(d):[],...Cs(t)]:[];m.forEach(N=>{l&&N.addEventListener("scroll",r,{passive:!0}),s&&N.addEventListener("resize",r)});const g=d&&f?CD(d,r):null;let x=-1,b=null;c&&(b=new ResizeObserver(N=>{let[k]=N;k&&k.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var C;(C=b)==null||C.observe(t)})),r()}),d&&!h&&b.observe(d),b.observe(t));let E,S=h?Di(e):null;h&&_();function _(){const N=Di(e);S&&!oC(S,N)&&r(),S=N,E=requestAnimationFrame(_)}return r(),()=>{var N;m.forEach(k=>{l&&k.removeEventListener("scroll",r),s&&k.removeEventListener("resize",r)}),g?.(),(N=b)==null||N.disconnect(),b=null,h&&cancelAnimationFrame(E)}}const _D=ZO,kD=KO,TD=XO,AD=JO,RD=GO,fw=FO,jD=QO,MD=(e,t,r)=>{const i=new Map,l={platform:ED,...r},s={...l.platform,_c:i};return qO(e,t,{...l,platform:s})};var OD=typeof document<"u",DD=function(){},ef=OD?w.useLayoutEffect:DD;function pf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,i,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;i--!==0;)if(!pf(e[i],t[i]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(t,l[i]))return!1;for(i=r;i--!==0;){const s=l[i];if(!(s==="_owner"&&e.$$typeof)&&!pf(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function iC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dw(e,t){const r=iC(e);return Math.round(t*r)/r}function Zm(e){const t=w.useRef(e);return ef(()=>{t.current=e}),t}function zD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:l,elements:{reference:s,floating:c}={},transform:f=!0,whileElementsMounted:h,open:d}=e,[m,g]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=w.useState(i);pf(x,i)||b(i);const[E,S]=w.useState(null),[_,N]=w.useState(null),k=w.useCallback($=>{$!==j.current&&(j.current=$,S($))},[]),C=w.useCallback($=>{$!==L.current&&(L.current=$,N($))},[]),A=s||E,z=c||_,j=w.useRef(null),L=w.useRef(null),P=w.useRef(m),H=h!=null,X=Zm(h),q=Zm(l),Y=Zm(d),F=w.useCallback(()=>{if(!j.current||!L.current)return;const $={placement:t,strategy:r,middleware:x};q.current&&($.platform=q.current),MD(j.current,L.current,$).then(W=>{const M={...W,isPositioned:Y.current!==!1};O.current&&!pf(P.current,M)&&(P.current=M,Fs.flushSync(()=>{g(M)}))})},[x,t,r,q,Y]);ef(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[d]);const O=w.useRef(!1);ef(()=>(O.current=!0,()=>{O.current=!1}),[]),ef(()=>{if(A&&(j.current=A),z&&(L.current=z),A&&z){if(X.current)return X.current(A,z,F);F()}},[A,z,F,X,H]);const U=w.useMemo(()=>({reference:j,floating:L,setReference:k,setFloating:C}),[k,C]),R=w.useMemo(()=>({reference:A,floating:z}),[A,z]),V=w.useMemo(()=>{const $={position:r,left:0,top:0};if(!R.floating)return $;const W=dw(R.floating,m.x),M=dw(R.floating,m.y);return f?{...$,transform:"translate("+W+"px, "+M+"px)",...iC(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:M}},[r,f,R.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:F,refs:U,elements:R,floatingStyles:V}),[m,F,U,R,V])}const LD=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:l}=typeof e=="function"?e(r):e;return i&&t(i)?i.current!=null?fw({element:i.current,padding:l}).fn(r):{}:i?fw({element:i,padding:l}).fn(r):{}}}},ID=(e,t)=>({..._D(e),options:[e,t]}),BD=(e,t)=>({...kD(e),options:[e,t]}),HD=(e,t)=>({...jD(e),options:[e,t]}),PD=(e,t)=>({...TD(e),options:[e,t]}),UD=(e,t)=>({...AD(e),options:[e,t]}),VD=(e,t)=>({...RD(e),options:[e,t]}),$D=(e,t)=>({...LD(e),options:[e,t]});var YD="Arrow",lC=w.forwardRef((e,t)=>{const{children:r,width:i=10,height:l=5,...s}=e;return p.jsx(Oe.svg,{...s,ref:t,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});lC.displayName=YD;var qD=lC,Xg="Popper",[aC,sC]=fo(Xg),[FD,cC]=aC(Xg),uC=e=>{const{__scopePopper:t,children:r}=e,[i,l]=w.useState(null);return p.jsx(FD,{scope:t,anchor:i,onAnchorChange:l,children:r})};uC.displayName=Xg;var fC="PopperAnchor",dC=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:i,...l}=e,s=cC(fC,r),c=w.useRef(null),f=We(t,c),h=w.useRef(null);return w.useEffect(()=>{const d=h.current;h.current=i?.current||c.current,d!==h.current&&s.onAnchorChange(h.current)}),i?null:p.jsx(Oe.div,{...l,ref:f})});dC.displayName=fC;var Gg="PopperContent",[XD,GD]=aC(Gg),hC=w.forwardRef((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:l=0,align:s="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:x=!1,updatePositionStrategy:b="optimized",onPlaced:E,...S}=e,_=cC(Gg,r),[N,k]=w.useState(null),C=We(t,te=>k(te)),[A,z]=w.useState(null),j=Hg(A),L=j?.width??0,P=j?.height??0,H=i+(s!=="center"?"-"+s:""),X=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},q=Array.isArray(d)?d:[d],Y=q.length>0,F={padding:X,boundary:q.filter(ZD),altBoundary:Y},{refs:O,floatingStyles:U,placement:R,isPositioned:V,middlewareData:$}=zD({strategy:"fixed",placement:H,whileElementsMounted:(...te)=>ND(...te,{animationFrame:b==="always"}),elements:{reference:_.anchor},middleware:[ID({mainAxis:l+P,alignmentAxis:c}),h&&BD({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?HD():void 0,...F}),h&&PD({...F}),UD({...F,apply:({elements:te,rects:ne,availableWidth:se,availableHeight:he})=>{const{width:me,height:ge}=ne.reference,xe=te.floating.style;xe.setProperty("--radix-popper-available-width",`${se}px`),xe.setProperty("--radix-popper-available-height",`${he}px`),xe.setProperty("--radix-popper-anchor-width",`${me}px`),xe.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),A&&$D({element:A,padding:f}),KD({arrowWidth:L,arrowHeight:P}),x&&VD({strategy:"referenceHidden",...F})]}),[W,M]=gC(R),B=Zt(E);Ut(()=>{V&&B?.()},[V,B]);const G=$.arrow?.x,D=$.arrow?.y,oe=$.arrow?.centerOffset!==0,[K,J]=w.useState();return Ut(()=>{N&&J(window.getComputedStyle(N).zIndex)},[N]),p.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:V?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(XD,{scope:r,placedSide:W,onArrowChange:z,arrowX:G,arrowY:D,shouldHideArrow:oe,children:p.jsx(Oe.div,{"data-side":W,"data-align":M,...S,ref:C,style:{...S.style,animation:V?void 0:"none"}})})})});hC.displayName=Gg;var mC="PopperArrow",WD={top:"bottom",right:"left",bottom:"top",left:"right"},pC=w.forwardRef(function(t,r){const{__scopePopper:i,...l}=t,s=GD(mC,i),c=WD[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(qD,{...l,ref:r,style:{...l.style,display:"block"}})})});pC.displayName=mC;function ZD(e){return e!==null}var KD=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:i,middlewareData:l}=t,c=l.arrow?.centerOffset!==0,f=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[d,m]=gC(r),g={start:"0%",center:"50%",end:"100%"}[m],x=(l.arrow?.x??0)+f/2,b=(l.arrow?.y??0)+h/2;let E="",S="";return d==="bottom"?(E=c?g:`${x}px`,S=`${-h}px`):d==="top"?(E=c?g:`${x}px`,S=`${i.floating.height+h}px`):d==="right"?(E=`${-h}px`,S=c?g:`${b}px`):d==="left"&&(E=`${i.floating.width+h}px`,S=c?g:`${b}px`),{data:{x:E,y:S}}}});function gC(e){const[t,r="center"]=e.split("-");return[t,r]}var QD=uC,JD=dC,ez=hC,tz=pC,Km="rovingFocusGroup.onEntryFocus",nz={bubbles:!1,cancelable:!0},Gs="RovingFocusGroup",[Ip,yC,rz]=iE(Gs),[oz,xC]=fo(Gs,[rz]),[iz,lz]=oz(Gs),vC=w.forwardRef((e,t)=>p.jsx(Ip.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Ip.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(az,{...e,ref:t})})}));vC.displayName=Gs;var az=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:l=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...g}=e,x=w.useRef(null),b=We(t,x),E=If(s),[S,_]=Mi({prop:c,defaultProp:f??null,onChange:h,caller:Gs}),[N,k]=w.useState(!1),C=Zt(d),A=yC(r),z=w.useRef(!1),[j,L]=w.useState(0);return w.useEffect(()=>{const P=x.current;if(P)return P.addEventListener(Km,C),()=>P.removeEventListener(Km,C)},[C]),p.jsx(iz,{scope:r,orientation:i,dir:E,loop:l,currentTabStopId:S,onItemFocus:w.useCallback(P=>_(P),[_]),onItemShiftTab:w.useCallback(()=>k(!0),[]),onFocusableItemAdd:w.useCallback(()=>L(P=>P+1),[]),onFocusableItemRemove:w.useCallback(()=>L(P=>P-1),[]),children:p.jsx(Oe.div,{tabIndex:N||j===0?-1:0,"data-orientation":i,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{z.current=!0}),onFocus:je(e.onFocus,P=>{const H=!z.current;if(P.target===P.currentTarget&&H&&!N){const X=new CustomEvent(Km,nz);if(P.currentTarget.dispatchEvent(X),!X.defaultPrevented){const q=A().filter(R=>R.focusable),Y=q.find(R=>R.active),F=q.find(R=>R.id===S),U=[Y,F,...q].filter(Boolean).map(R=>R.ref.current);SC(U,m)}}z.current=!1}),onBlur:je(e.onBlur,()=>k(!1))})})}),bC="RovingFocusGroupItem",wC=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:l=!1,tabStopId:s,children:c,...f}=e,h=Zo(),d=s||h,m=lz(bC,r),g=m.currentTabStopId===d,x=yC(r),{onFocusableItemAdd:b,onFocusableItemRemove:E,currentTabStopId:S}=m;return w.useEffect(()=>{if(i)return b(),()=>E()},[i,b,E]),p.jsx(Ip.ItemSlot,{scope:r,id:d,focusable:i,active:l,children:p.jsx(Oe.span,{tabIndex:g?0:-1,"data-orientation":m.orientation,...f,ref:t,onMouseDown:je(e.onMouseDown,_=>{i?m.onItemFocus(d):_.preventDefault()}),onFocus:je(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:je(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){m.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const N=uz(_,m.orientation,m.dir);if(N!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let C=x().filter(A=>A.focusable).map(A=>A.ref.current);if(N==="last")C.reverse();else if(N==="prev"||N==="next"){N==="prev"&&C.reverse();const A=C.indexOf(_.currentTarget);C=m.loop?fz(C,A+1):C.slice(A+1)}setTimeout(()=>SC(C))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:S!=null}):c})})});wC.displayName=bC;var sz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function uz(e,t,r){const i=cz(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return sz[i]}function SC(e,t=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:t}),document.activeElement!==r))return}function fz(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var dz=vC,hz=wC;function Bp(e,[t,r]){return Math.min(r,Math.max(t,e))}function mz(e,t){return w.useReducer((r,i)=>t[r][i]??r,e)}var Wg="ScrollArea",[EC]=fo(Wg),[pz,Un]=EC(Wg),CC=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:i="hover",dir:l,scrollHideDelay:s=600,...c}=e,[f,h]=w.useState(null),[d,m]=w.useState(null),[g,x]=w.useState(null),[b,E]=w.useState(null),[S,_]=w.useState(null),[N,k]=w.useState(0),[C,A]=w.useState(0),[z,j]=w.useState(!1),[L,P]=w.useState(!1),H=We(t,q=>h(q)),X=If(l);return p.jsx(pz,{scope:r,type:i,dir:X,scrollHideDelay:s,scrollArea:f,viewport:d,onViewportChange:m,content:g,onContentChange:x,scrollbarX:b,onScrollbarXChange:E,scrollbarXEnabled:z,onScrollbarXEnabledChange:j,scrollbarY:S,onScrollbarYChange:_,scrollbarYEnabled:L,onScrollbarYEnabledChange:P,onCornerWidthChange:k,onCornerHeightChange:A,children:p.jsx(Oe.div,{dir:X,...c,ref:H,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});CC.displayName=Wg;var NC="ScrollAreaViewport",_C=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:i,nonce:l,...s}=e,c=Un(NC,r),f=w.useRef(null),h=We(t,f,c.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),p.jsx(Oe.div,{"data-radix-scroll-area-viewport":"",...s,ref:h,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});_C.displayName=NC;var Ar="ScrollAreaScrollbar",kC=w.forwardRef((e,t)=>{const{forceMount:r,...i}=e,l=Un(Ar,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=l,f=e.orientation==="horizontal";return w.useEffect(()=>(f?s(!0):c(!0),()=>{f?s(!1):c(!1)}),[f,s,c]),l.type==="hover"?p.jsx(gz,{...i,ref:t,forceMount:r}):l.type==="scroll"?p.jsx(yz,{...i,ref:t,forceMount:r}):l.type==="auto"?p.jsx(TC,{...i,ref:t,forceMount:r}):l.type==="always"?p.jsx(Zg,{...i,ref:t}):null});kC.displayName=Ar;var gz=w.forwardRef((e,t)=>{const{forceMount:r,...i}=e,l=Un(Ar,e.__scopeScrollArea),[s,c]=w.useState(!1);return w.useEffect(()=>{const f=l.scrollArea;let h=0;if(f){const d=()=>{window.clearTimeout(h),c(!0)},m=()=>{h=window.setTimeout(()=>c(!1),l.scrollHideDelay)};return f.addEventListener("pointerenter",d),f.addEventListener("pointerleave",m),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",d),f.removeEventListener("pointerleave",m)}}},[l.scrollArea,l.scrollHideDelay]),p.jsx(kr,{present:r||s,children:p.jsx(TC,{"data-state":s?"visible":"hidden",...i,ref:t})})}),yz=w.forwardRef((e,t)=>{const{forceMount:r,...i}=e,l=Un(Ar,e.__scopeScrollArea),s=e.orientation==="horizontal",c=Ff(()=>h("SCROLL_END"),100),[f,h]=mz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(f==="idle"){const d=window.setTimeout(()=>h("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(d)}},[f,l.scrollHideDelay,h]),w.useEffect(()=>{const d=l.viewport,m=s?"scrollLeft":"scrollTop";if(d){let g=d[m];const x=()=>{const b=d[m];g!==b&&(h("SCROLL"),c()),g=b};return d.addEventListener("scroll",x),()=>d.removeEventListener("scroll",x)}},[l.viewport,s,h,c]),p.jsx(kr,{present:r||f!=="hidden",children:p.jsx(Zg,{"data-state":f==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:je(e.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:je(e.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),TC=w.forwardRef((e,t)=>{const r=Un(Ar,e.__scopeScrollArea),{forceMount:i,...l}=e,[s,c]=w.useState(!1),f=e.orientation==="horizontal",h=Ff(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,m=r.viewport.offsetHeight<r.viewport.scrollHeight;c(f?d:m)}},10);return Xl(r.viewport,h),Xl(r.content,h),p.jsx(kr,{present:i||s,children:p.jsx(Zg,{"data-state":s?"visible":"hidden",...l,ref:t})})}),Zg=w.forwardRef((e,t)=>{const{orientation:r="vertical",...i}=e,l=Un(Ar,e.__scopeScrollArea),s=w.useRef(null),c=w.useRef(0),[f,h]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=OC(f.viewport,f.content),m={...i,sizes:f,onSizesChange:h,hasThumb:d>0&&d<1,onThumbChange:x=>s.current=x,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:x=>c.current=x};function g(x,b){return Ez(x,c.current,f,b)}return r==="horizontal"?p.jsx(xz,{...m,ref:t,onThumbPositionChange:()=>{if(l.viewport&&s.current){const x=l.viewport.scrollLeft,b=hw(x,f,l.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:x=>{l.viewport&&(l.viewport.scrollLeft=x)},onDragScroll:x=>{l.viewport&&(l.viewport.scrollLeft=g(x,l.dir))}}):r==="vertical"?p.jsx(vz,{...m,ref:t,onThumbPositionChange:()=>{if(l.viewport&&s.current){const x=l.viewport.scrollTop,b=hw(x,f);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:x=>{l.viewport&&(l.viewport.scrollTop=x)},onDragScroll:x=>{l.viewport&&(l.viewport.scrollTop=g(x))}}):null}),xz=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:i,...l}=e,s=Un(Ar,e.__scopeScrollArea),[c,f]=w.useState(),h=w.useRef(null),d=We(t,h,s.onScrollbarXChange);return w.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),p.jsx(RC,{"data-orientation":"horizontal",...l,ref:d,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":qf(r)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,g)=>{if(s.viewport){const x=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(x),zC(x,g)&&m.preventDefault()}},onResize:()=>{h.current&&s.viewport&&c&&i({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:yf(c.paddingLeft),paddingEnd:yf(c.paddingRight)}})}})}),vz=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:i,...l}=e,s=Un(Ar,e.__scopeScrollArea),[c,f]=w.useState(),h=w.useRef(null),d=We(t,h,s.onScrollbarYChange);return w.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),p.jsx(RC,{"data-orientation":"vertical",...l,ref:d,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":qf(r)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,g)=>{if(s.viewport){const x=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(x),zC(x,g)&&m.preventDefault()}},onResize:()=>{h.current&&s.viewport&&c&&i({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:yf(c.paddingTop),paddingEnd:yf(c.paddingBottom)}})}})}),[bz,AC]=EC(Ar),RC=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:i,hasThumb:l,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:d,onWheelScroll:m,onResize:g,...x}=e,b=Un(Ar,r),[E,S]=w.useState(null),_=We(t,H=>S(H)),N=w.useRef(null),k=w.useRef(""),C=b.viewport,A=i.content-i.viewport,z=Zt(m),j=Zt(h),L=Ff(g,10);function P(H){if(N.current){const X=H.clientX-N.current.left,q=H.clientY-N.current.top;d({x:X,y:q})}}return w.useEffect(()=>{const H=X=>{const q=X.target;E?.contains(q)&&z(X,A)};return document.addEventListener("wheel",H,{passive:!1}),()=>document.removeEventListener("wheel",H,{passive:!1})},[C,E,A,z]),w.useEffect(j,[i,j]),Xl(E,L),Xl(b.content,L),p.jsx(bz,{scope:r,scrollbar:E,hasThumb:l,onThumbChange:Zt(s),onThumbPointerUp:Zt(c),onThumbPositionChange:j,onThumbPointerDown:Zt(f),children:p.jsx(Oe.div,{...x,ref:_,style:{position:"absolute",...x.style},onPointerDown:je(e.onPointerDown,H=>{H.button===0&&(H.target.setPointerCapture(H.pointerId),N.current=E.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),P(H))}),onPointerMove:je(e.onPointerMove,P),onPointerUp:je(e.onPointerUp,H=>{const X=H.target;X.hasPointerCapture(H.pointerId)&&X.releasePointerCapture(H.pointerId),document.body.style.webkitUserSelect=k.current,b.viewport&&(b.viewport.style.scrollBehavior=""),N.current=null})})})}),gf="ScrollAreaThumb",jC=w.forwardRef((e,t)=>{const{forceMount:r,...i}=e,l=AC(gf,e.__scopeScrollArea);return p.jsx(kr,{present:r||l.hasThumb,children:p.jsx(wz,{ref:t,...i})})}),wz=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:i,...l}=e,s=Un(gf,r),c=AC(gf,r),{onThumbPositionChange:f}=c,h=We(t,g=>c.onThumbChange(g)),d=w.useRef(void 0),m=Ff(()=>{d.current&&(d.current(),d.current=void 0)},100);return w.useEffect(()=>{const g=s.viewport;if(g){const x=()=>{if(m(),!d.current){const b=Cz(g,f);d.current=b,f()}};return f(),g.addEventListener("scroll",x),()=>g.removeEventListener("scroll",x)}},[s.viewport,m,f]),p.jsx(Oe.div,{"data-state":c.hasThumb?"visible":"hidden",...l,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:je(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),E=g.clientX-b.left,S=g.clientY-b.top;c.onThumbPointerDown({x:E,y:S})}),onPointerUp:je(e.onPointerUp,c.onThumbPointerUp)})});jC.displayName=gf;var Kg="ScrollAreaCorner",MC=w.forwardRef((e,t)=>{const r=Un(Kg,e.__scopeScrollArea),i=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&i?p.jsx(Sz,{...e,ref:t}):null});MC.displayName=Kg;var Sz=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,...i}=e,l=Un(Kg,r),[s,c]=w.useState(0),[f,h]=w.useState(0),d=!!(s&&f);return Xl(l.scrollbarX,()=>{const m=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(m),h(m)}),Xl(l.scrollbarY,()=>{const m=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(m),c(m)}),d?p.jsx(Oe.div,{...i,ref:t,style:{width:s,height:f,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function yf(e){return e?parseInt(e,10):0}function OC(e,t){const r=e/t;return isNaN(r)?0:r}function qf(e){const t=OC(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-r)*t;return Math.max(i,18)}function Ez(e,t,r,i="ltr"){const l=qf(r),s=l/2,c=t||s,f=l-c,h=r.scrollbar.paddingStart+c,d=r.scrollbar.size-r.scrollbar.paddingEnd-f,m=r.content-r.viewport,g=i==="ltr"?[0,m]:[m*-1,0];return DC([h,d],g)(e)}function hw(e,t,r="ltr"){const i=qf(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-l,c=t.content-t.viewport,f=s-i,h=r==="ltr"?[0,c]:[c*-1,0],d=Bp(e,h);return DC([0,c],[0,f])(d)}function DC(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(r-e[0])}}function zC(e,t){return e>0&&e<t}var Cz=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},i=0;return(function l(){const s={left:e.scrollLeft,top:e.scrollTop},c=r.left!==s.left,f=r.top!==s.top;(c||f)&&t(),r=s,i=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(i)};function Ff(e,t){const r=Zt(e),i=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(i.current),[]),w.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(r,t)},[r,t])}function Xl(e,t){const r=Zt(t);Ut(()=>{let i=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(r)});return l.observe(e),()=>{window.cancelAnimationFrame(i),l.unobserve(e)}}},[e,r])}var Nz=CC,_z=_C,kz=MC,Tz=[" ","Enter","ArrowUp","ArrowDown"],Az=[" ","Enter"],zi="Select",[Xf,Gf,Rz]=iE(zi),[aa]=fo(zi,[Rz,sC]),Wf=sC(),[jz,ni]=aa(zi),[Mz,Oz]=aa(zi),LC=e=>{const{__scopeSelect:t,children:r,open:i,defaultOpen:l,onOpenChange:s,value:c,defaultValue:f,onValueChange:h,dir:d,name:m,autoComplete:g,disabled:x,required:b,form:E}=e,S=Wf(t),[_,N]=w.useState(null),[k,C]=w.useState(null),[A,z]=w.useState(!1),j=If(d),[L,P]=Mi({prop:i,defaultProp:l??!1,onChange:s,caller:zi}),[H,X]=Mi({prop:c,defaultProp:f,onChange:h,caller:zi}),q=w.useRef(null),Y=_?E||!!_.closest("form"):!0,[F,O]=w.useState(new Set),U=Array.from(F).map(R=>R.props.value).join(";");return p.jsx(QD,{...S,children:p.jsxs(jz,{required:b,scope:t,trigger:_,onTriggerChange:N,valueNode:k,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:z,contentId:Zo(),value:H,onValueChange:X,open:L,onOpenChange:P,dir:j,triggerPointerDownPosRef:q,disabled:x,children:[p.jsx(Xf.Provider,{scope:t,children:p.jsx(Mz,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(R=>{O(V=>new Set(V).add(R))},[]),onNativeOptionRemove:w.useCallback(R=>{O(V=>{const $=new Set(V);return $.delete(R),$})},[]),children:r})}),Y?p.jsxs(oN,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:g,value:H,onChange:R=>X(R.target.value),disabled:x,form:E,children:[H===void 0?p.jsx("option",{value:""}):null,Array.from(F)]},U):null]})})};LC.displayName=zi;var IC="SelectTrigger",BC=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:i=!1,...l}=e,s=Wf(r),c=ni(IC,r),f=c.disabled||i,h=We(t,c.onTriggerChange),d=Gf(r),m=w.useRef("touch"),[g,x,b]=lN(S=>{const _=d().filter(C=>!C.disabled),N=_.find(C=>C.value===c.value),k=aN(_,S,N);k!==void 0&&c.onValueChange(k.value)}),E=S=>{f||(c.onOpenChange(!0),b()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return p.jsx(JD,{asChild:!0,...s,children:p.jsx(Oe.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":iN(c.value)?"":void 0,...l,ref:h,onClick:je(l.onClick,S=>{S.currentTarget.focus(),m.current!=="mouse"&&E(S)}),onPointerDown:je(l.onPointerDown,S=>{m.current=S.pointerType;const _=S.target;_.hasPointerCapture(S.pointerId)&&_.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(E(S),S.preventDefault())}),onKeyDown:je(l.onKeyDown,S=>{const _=g.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&x(S.key),!(_&&S.key===" ")&&Tz.includes(S.key)&&(E(),S.preventDefault())})})})});BC.displayName=IC;var HC="SelectValue",PC=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:l,children:s,placeholder:c="",...f}=e,h=ni(HC,r),{onValueNodeHasChildrenChange:d}=h,m=s!==void 0,g=We(t,h.onValueNodeChange);return Ut(()=>{d(m)},[d,m]),p.jsx(Oe.span,{...f,ref:g,style:{pointerEvents:"none"},children:iN(h.value)?p.jsx(p.Fragment,{children:c}):s})});PC.displayName=HC;var Dz="SelectIcon",UC=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,...l}=e;return p.jsx(Oe.span,{"aria-hidden":!0,...l,ref:t,children:i||"▼"})});UC.displayName=Dz;var zz="SelectPortal",VC=e=>p.jsx(Og,{asChild:!0,...e});VC.displayName=zz;var Li="SelectContent",$C=w.forwardRef((e,t)=>{const r=ni(Li,e.__scopeSelect),[i,l]=w.useState();if(Ut(()=>{l(new DocumentFragment)},[]),!r.open){const s=i;return s?Fs.createPortal(p.jsx(YC,{scope:e.__scopeSelect,children:p.jsx(Xf.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(qC,{...e,ref:t})});$C.displayName=Li;var Wn=10,[YC,ri]=aa(Li),Lz="SelectContentImpl",Iz=ql("SelectContent.RemoveScroll"),qC=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:i="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:s,onPointerDownOutside:c,side:f,sideOffset:h,align:d,alignOffset:m,arrowPadding:g,collisionBoundary:x,collisionPadding:b,sticky:E,hideWhenDetached:S,avoidCollisions:_,...N}=e,k=ni(Li,r),[C,A]=w.useState(null),[z,j]=w.useState(null),L=We(t,te=>A(te)),[P,H]=w.useState(null),[X,q]=w.useState(null),Y=Gf(r),[F,O]=w.useState(!1),U=w.useRef(!1);w.useEffect(()=>{if(C)return xE(C)},[C]),cE();const R=w.useCallback(te=>{const[ne,...se]=Y().map(ge=>ge.ref.current),[he]=se.slice(-1),me=document.activeElement;for(const ge of te)if(ge===me||(ge?.scrollIntoView({block:"nearest"}),ge===ne&&z&&(z.scrollTop=0),ge===he&&z&&(z.scrollTop=z.scrollHeight),ge?.focus(),document.activeElement!==me))return},[Y,z]),V=w.useCallback(()=>R([P,C]),[R,P,C]);w.useEffect(()=>{F&&V()},[F,V]);const{onOpenChange:$,triggerPointerDownPosRef:W}=k;w.useEffect(()=>{if(C){let te={x:0,y:0};const ne=he=>{te={x:Math.abs(Math.round(he.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(he.pageY)-(W.current?.y??0))}},se=he=>{te.x<=10&&te.y<=10?he.preventDefault():C.contains(he.target)||$(!1),document.removeEventListener("pointermove",ne),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",se,{capture:!0})}}},[C,$,W]),w.useEffect(()=>{const te=()=>$(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[$]);const[M,B]=lN(te=>{const ne=Y().filter(me=>!me.disabled),se=ne.find(me=>me.ref.current===document.activeElement),he=aN(ne,te,se);he&&setTimeout(()=>he.ref.current.focus())}),G=w.useCallback((te,ne,se)=>{const he=!U.current&&!se;(k.value!==void 0&&k.value===ne||he)&&(H(te),he&&(U.current=!0))},[k.value]),D=w.useCallback(()=>C?.focus(),[C]),oe=w.useCallback((te,ne,se)=>{const he=!U.current&&!se;(k.value!==void 0&&k.value===ne||he)&&q(te)},[k.value]),K=i==="popper"?Hp:FC,J=K===Hp?{side:f,sideOffset:h,align:d,alignOffset:m,arrowPadding:g,collisionBoundary:x,collisionPadding:b,sticky:E,hideWhenDetached:S,avoidCollisions:_}:{};return p.jsx(YC,{scope:r,content:C,viewport:z,onViewportChange:j,itemRefCallback:G,selectedItem:P,onItemLeave:D,itemTextRefCallback:oe,focusSelectedItem:V,selectedItemText:X,position:i,isPositioned:F,searchRef:M,children:p.jsx(Dg,{as:Iz,allowPinchZoom:!0,children:p.jsx(Mg,{asChild:!0,trapped:k.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:je(l,te=>{k.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:p.jsx(jg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:p.jsx(K,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:te=>te.preventDefault(),...N,...J,onPlaced:()=>O(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:je(N.onKeyDown,te=>{const ne=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!ne&&te.key.length===1&&B(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let he=Y().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(te.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const me=te.target,ge=he.indexOf(me);he=he.slice(ge+1)}setTimeout(()=>R(he)),te.preventDefault()}})})})})})})});qC.displayName=Lz;var Bz="SelectItemAlignedPosition",FC=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:i,...l}=e,s=ni(Li,r),c=ri(Li,r),[f,h]=w.useState(null),[d,m]=w.useState(null),g=We(t,L=>m(L)),x=Gf(r),b=w.useRef(!1),E=w.useRef(!0),{viewport:S,selectedItem:_,selectedItemText:N,focusSelectedItem:k}=c,C=w.useCallback(()=>{if(s.trigger&&s.valueNode&&f&&d&&S&&_&&N){const L=s.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),X=N.getBoundingClientRect();if(s.dir!=="rtl"){const me=X.left-P.left,ge=H.left-me,xe=L.left-ge,_e=L.width+xe,$e=Math.max(_e,P.width),Pe=window.innerWidth-Wn,st=Bp(ge,[Wn,Math.max(Wn,Pe-$e)]);f.style.minWidth=_e+"px",f.style.left=st+"px"}else{const me=P.right-X.right,ge=window.innerWidth-H.right-me,xe=window.innerWidth-L.right-ge,_e=L.width+xe,$e=Math.max(_e,P.width),Pe=window.innerWidth-Wn,st=Bp(ge,[Wn,Math.max(Wn,Pe-$e)]);f.style.minWidth=_e+"px",f.style.right=st+"px"}const q=x(),Y=window.innerHeight-Wn*2,F=S.scrollHeight,O=window.getComputedStyle(d),U=parseInt(O.borderTopWidth,10),R=parseInt(O.paddingTop,10),V=parseInt(O.borderBottomWidth,10),$=parseInt(O.paddingBottom,10),W=U+R+F+$+V,M=Math.min(_.offsetHeight*5,W),B=window.getComputedStyle(S),G=parseInt(B.paddingTop,10),D=parseInt(B.paddingBottom,10),oe=L.top+L.height/2-Wn,K=Y-oe,J=_.offsetHeight/2,te=_.offsetTop+J,ne=U+R+te,se=W-ne;if(ne<=oe){const me=q.length>0&&_===q[q.length-1].ref.current;f.style.bottom="0px";const ge=d.clientHeight-S.offsetTop-S.offsetHeight,xe=Math.max(K,J+(me?D:0)+ge+V),_e=ne+xe;f.style.height=_e+"px"}else{const me=q.length>0&&_===q[0].ref.current;f.style.top="0px";const xe=Math.max(oe,U+S.offsetTop+(me?G:0)+J)+se;f.style.height=xe+"px",S.scrollTop=ne-oe+S.offsetTop}f.style.margin=`${Wn}px 0`,f.style.minHeight=M+"px",f.style.maxHeight=Y+"px",i?.(),requestAnimationFrame(()=>b.current=!0)}},[x,s.trigger,s.valueNode,f,d,S,_,N,s.dir,i]);Ut(()=>C(),[C]);const[A,z]=w.useState();Ut(()=>{d&&z(window.getComputedStyle(d).zIndex)},[d]);const j=w.useCallback(L=>{L&&E.current===!0&&(C(),k?.(),E.current=!1)},[C,k]);return p.jsx(Pz,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:b,onScrollButtonChange:j,children:p.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:p.jsx(Oe.div,{...l,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});FC.displayName=Bz;var Hz="SelectPopperPosition",Hp=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:i="start",collisionPadding:l=Wn,...s}=e,c=Wf(r);return p.jsx(ez,{...c,...s,ref:t,align:i,collisionPadding:l,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Hp.displayName=Hz;var[Pz,Qg]=aa(Li,{}),Pp="SelectViewport",XC=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:i,...l}=e,s=ri(Pp,r),c=Qg(Pp,r),f=We(t,s.onViewportChange),h=w.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),p.jsx(Xf.Slot,{scope:r,children:p.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:je(l.onScroll,d=>{const m=d.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:x}=c;if(x?.current&&g){const b=Math.abs(h.current-m.scrollTop);if(b>0){const E=window.innerHeight-Wn*2,S=parseFloat(g.style.minHeight),_=parseFloat(g.style.height),N=Math.max(S,_);if(N<E){const k=N+b,C=Math.min(E,k),A=k-C;g.style.height=C+"px",g.style.bottom==="0px"&&(m.scrollTop=A>0?A:0,g.style.justifyContent="flex-end")}}}h.current=m.scrollTop})})})]})});XC.displayName=Pp;var GC="SelectGroup",[Uz,Vz]=aa(GC),$z=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=Zo();return p.jsx(Uz,{scope:r,id:l,children:p.jsx(Oe.div,{role:"group","aria-labelledby":l,...i,ref:t})})});$z.displayName=GC;var WC="SelectLabel",Yz=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=Vz(WC,r);return p.jsx(Oe.div,{id:l.id,...i,ref:t})});Yz.displayName=WC;var xf="SelectItem",[qz,ZC]=aa(xf),KC=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:i,disabled:l=!1,textValue:s,...c}=e,f=ni(xf,r),h=ri(xf,r),d=f.value===i,[m,g]=w.useState(s??""),[x,b]=w.useState(!1),E=We(t,k=>h.itemRefCallback?.(k,i,l)),S=Zo(),_=w.useRef("touch"),N=()=>{l||(f.onValueChange(i),f.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(qz,{scope:r,value:i,disabled:l,textId:S,isSelected:d,onItemTextChange:w.useCallback(k=>{g(C=>C||(k?.textContent??"").trim())},[]),children:p.jsx(Xf.ItemSlot,{scope:r,value:i,disabled:l,textValue:m,children:p.jsx(Oe.div,{role:"option","aria-labelledby":S,"data-highlighted":x?"":void 0,"aria-selected":d&&x,"data-state":d?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...c,ref:E,onFocus:je(c.onFocus,()=>b(!0)),onBlur:je(c.onBlur,()=>b(!1)),onClick:je(c.onClick,()=>{_.current!=="mouse"&&N()}),onPointerUp:je(c.onPointerUp,()=>{_.current==="mouse"&&N()}),onPointerDown:je(c.onPointerDown,k=>{_.current=k.pointerType}),onPointerMove:je(c.onPointerMove,k=>{_.current=k.pointerType,l?h.onItemLeave?.():_.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(c.onPointerLeave,k=>{k.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:je(c.onKeyDown,k=>{h.searchRef?.current!==""&&k.key===" "||(Az.includes(k.key)&&N(),k.key===" "&&k.preventDefault())})})})})});KC.displayName=xf;var ps="SelectItemText",QC=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:l,...s}=e,c=ni(ps,r),f=ri(ps,r),h=ZC(ps,r),d=Oz(ps,r),[m,g]=w.useState(null),x=We(t,N=>g(N),h.onItemTextChange,N=>f.itemTextRefCallback?.(N,h.value,h.disabled)),b=m?.textContent,E=w.useMemo(()=>p.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:_}=d;return Ut(()=>(S(E),()=>_(E)),[S,_,E]),p.jsxs(p.Fragment,{children:[p.jsx(Oe.span,{id:h.textId,...s,ref:x}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Fs.createPortal(s.children,c.valueNode):null]})});QC.displayName=ps;var JC="SelectItemIndicator",eN=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return ZC(JC,r).isSelected?p.jsx(Oe.span,{"aria-hidden":!0,...i,ref:t}):null});eN.displayName=JC;var Up="SelectScrollUpButton",tN=w.forwardRef((e,t)=>{const r=ri(Up,e.__scopeSelect),i=Qg(Up,e.__scopeSelect),[l,s]=w.useState(!1),c=We(t,i.onScrollButtonChange);return Ut(()=>{if(r.viewport&&r.isPositioned){let f=function(){const d=h.scrollTop>0;s(d)};const h=r.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),l?p.jsx(rN,{...e,ref:c,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=r;f&&h&&(f.scrollTop=f.scrollTop-h.offsetHeight)}}):null});tN.displayName=Up;var Vp="SelectScrollDownButton",nN=w.forwardRef((e,t)=>{const r=ri(Vp,e.__scopeSelect),i=Qg(Vp,e.__scopeSelect),[l,s]=w.useState(!1),c=We(t,i.onScrollButtonChange);return Ut(()=>{if(r.viewport&&r.isPositioned){let f=function(){const d=h.scrollHeight-h.clientHeight,m=Math.ceil(h.scrollTop)<d;s(m)};const h=r.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),l?p.jsx(rN,{...e,ref:c,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=r;f&&h&&(f.scrollTop=f.scrollTop+h.offsetHeight)}}):null});nN.displayName=Vp;var rN=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:i,...l}=e,s=ri("SelectScrollButton",r),c=w.useRef(null),f=Gf(r),h=w.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return w.useEffect(()=>()=>h(),[h]),Ut(()=>{f().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),p.jsx(Oe.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:je(l.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:je(l.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:je(l.onPointerLeave,()=>{h()})})}),Fz="SelectSeparator",Xz=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return p.jsx(Oe.div,{"aria-hidden":!0,...i,ref:t})});Xz.displayName=Fz;var $p="SelectArrow",Gz=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=Wf(r),s=ni($p,r),c=ri($p,r);return s.open&&c.position==="popper"?p.jsx(tz,{...l,...i,ref:t}):null});Gz.displayName=$p;var Wz="SelectBubbleInput",oN=w.forwardRef(({__scopeSelect:e,value:t,...r},i)=>{const l=w.useRef(null),s=We(i,l),c=Bg(t);return w.useEffect(()=>{const f=l.current;if(!f)return;const h=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==t&&m){const g=new Event("change",{bubbles:!0});m.call(f,t),f.dispatchEvent(g)}},[c,t]),p.jsx(Oe.select,{...r,style:{...oE,...r.style},ref:s,defaultValue:t})});oN.displayName=Wz;function iN(e){return e===""||e===void 0}function lN(e){const t=Zt(e),r=w.useRef(""),i=w.useRef(0),l=w.useCallback(c=>{const f=r.current+c;t(f),(function h(d){r.current=d,window.clearTimeout(i.current),d!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(f)},[t]),s=w.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,l,s]}function aN(e,t,r){const l=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let c=Zz(e,Math.max(s,0));l.length===1&&(c=c.filter(d=>d!==r));const h=c.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return h!==r?h:void 0}function Zz(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var Kz=LC,Qz=BC,Jz=PC,e5=UC,t5=VC,n5=$C,r5=XC,o5=KC,i5=QC,l5=eN,a5=tN,s5=nN,Zf="Switch",[c5]=fo(Zf),[u5,f5]=c5(Zf),sN=w.forwardRef((e,t)=>{const{__scopeSwitch:r,name:i,checked:l,defaultChecked:s,required:c,disabled:f,value:h="on",onCheckedChange:d,form:m,...g}=e,[x,b]=w.useState(null),E=We(t,C=>b(C)),S=w.useRef(!1),_=x?m||!!x.closest("form"):!0,[N,k]=Mi({prop:l,defaultProp:s??!1,onChange:d,caller:Zf});return p.jsxs(u5,{scope:r,checked:N,disabled:f,children:[p.jsx(Oe.button,{type:"button",role:"switch","aria-checked":N,"aria-required":c,"data-state":dN(N),"data-disabled":f?"":void 0,disabled:f,value:h,...g,ref:E,onClick:je(e.onClick,C=>{k(A=>!A),_&&(S.current=C.isPropagationStopped(),S.current||C.stopPropagation())})}),_&&p.jsx(fN,{control:x,bubbles:!S.current,name:i,value:h,checked:N,required:c,disabled:f,form:m,style:{transform:"translateX(-100%)"}})]})});sN.displayName=Zf;var cN="SwitchThumb",uN=w.forwardRef((e,t)=>{const{__scopeSwitch:r,...i}=e,l=f5(cN,r);return p.jsx(Oe.span,{"data-state":dN(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t})});uN.displayName=cN;var d5="SwitchBubbleInput",fN=w.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:i=!0,...l},s)=>{const c=w.useRef(null),f=We(c,s),h=Bg(r),d=Hg(t);return w.useEffect(()=>{const m=c.current;if(!m)return;const g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(h!==r&&b){const E=new Event("click",{bubbles:i});b.call(m,r),m.dispatchEvent(E)}},[h,r,i]),p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...l,tabIndex:-1,ref:f,style:{...l.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});fN.displayName=d5;function dN(e){return e?"checked":"unchecked"}var h5=sN,m5=uN,Kf="Tabs",[p5]=fo(Kf,[xC]),hN=xC(),[g5,Jg]=p5(Kf),mN=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,onValueChange:l,defaultValue:s,orientation:c="horizontal",dir:f,activationMode:h="automatic",...d}=e,m=If(f),[g,x]=Mi({prop:i,onChange:l,defaultProp:s??"",caller:Kf});return p.jsx(g5,{scope:r,baseId:Zo(),value:g,onValueChange:x,orientation:c,dir:m,activationMode:h,children:p.jsx(Oe.div,{dir:m,"data-orientation":c,...d,ref:t})})});mN.displayName=Kf;var pN="TabsList",gN=w.forwardRef((e,t)=>{const{__scopeTabs:r,loop:i=!0,...l}=e,s=Jg(pN,r),c=hN(r);return p.jsx(dz,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:i,children:p.jsx(Oe.div,{role:"tablist","aria-orientation":s.orientation,...l,ref:t})})});gN.displayName=pN;var yN="TabsTrigger",xN=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,disabled:l=!1,...s}=e,c=Jg(yN,r),f=hN(r),h=wN(c.baseId,i),d=SN(c.baseId,i),m=i===c.value;return p.jsx(hz,{asChild:!0,...f,focusable:!l,active:m,children:p.jsx(Oe.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:h,...s,ref:t,onMouseDown:je(e.onMouseDown,g=>{!l&&g.button===0&&g.ctrlKey===!1?c.onValueChange(i):g.preventDefault()}),onKeyDown:je(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(i)}),onFocus:je(e.onFocus,()=>{const g=c.activationMode!=="manual";!m&&!l&&g&&c.onValueChange(i)})})})});xN.displayName=yN;var vN="TabsContent",bN=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,forceMount:l,children:s,...c}=e,f=Jg(vN,r),h=wN(f.baseId,i),d=SN(f.baseId,i),m=i===f.value,g=w.useRef(m);return w.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),p.jsx(kr,{present:l||m,children:({present:x})=>p.jsx(Oe.div,{"data-state":m?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":h,hidden:!x,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:x&&s})})});bN.displayName=vN;function wN(e,t){return`${e}-trigger-${t}`}function SN(e,t){return`${e}-content-${t}`}var y5=mN,x5=gN,v5=xN,b5=bN;function EN({className:e,children:t,...r}){return p.jsxs(Nz,{"data-slot":"scroll-area",className:ve("relative",e),...r,children:[p.jsx(_z,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),p.jsx(w5,{}),p.jsx(kz,{})]})}function w5({className:e,orientation:t="vertical",...r}){return p.jsx(kC,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ve("flex touch-none p-px transition-colors select-none bg-[var(--scrollbar-track)]",t==="vertical"&&"h-full w-1.5 border-l border-l-transparent",t==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent",e),...r,children:p.jsx(jC,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-[var(--scrollbar-thumb)] hover:bg-[var(--scrollbar-thumb-hover)] transition-colors"})})}const CN="cognetivy-onboarding-dismissed";function S5(){try{return localStorage.getItem(CN)==="true"}catch{return!1}}function E5(){try{localStorage.setItem(CN,"true")}catch{}}function C5(){const[e,t]=w.useState(S5),[r,i]=w.useState(!1),l=!e,s=l&&!r,c=w.useCallback(function(){i(!0)},[]),f=w.useCallback(function(){t(!0),i(!0),E5()},[]),h=w.useCallback(function(){i(!0)},[]);return{shouldShow:l,dismiss:c,dismissPermanently:f,open:s,closeForSession:h}}const N5=DE,_5=zE,k5=LE,T5=IE,A5=BE,R5=HE,j5=PE;function M5({className:e,children:t,showCloseButton:r=!0,...i}){return p.jsxs(_5,{children:[p.jsx(k5,{className:"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),p.jsxs(T5,{className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...i,children:[p.jsx("div",{className:"pr-8",children:t}),r&&p.jsxs(j5,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[p.jsx("span",{className:"sr-only",children:"Close"}),p.jsx("span",{"aria-hidden":!0,className:"text-lg",children:"×"})]})]})]})}function O5({className:e,...t}){return p.jsx("div",{className:ve("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function D5({className:e,...t}){return p.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const NN=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();const z5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const L5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase());const mw=e=>{const t=L5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var I5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const B5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const H5=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:l="",children:s,iconNode:c,...f},h)=>w.createElement("svg",{ref:h,...I5,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:NN("lucide",l),...!s&&!B5(f)&&{"aria-hidden":"true"},...f},[...c.map(([d,m])=>w.createElement(d,m)),...Array.isArray(s)?s:[s]]));const zt=(e,t)=>{const r=w.forwardRef(({className:i,...l},s)=>w.createElement(H5,{ref:s,iconNode:t,className:NN(`lucide-${z5(mw(e))}`,`lucide-${e}`,i),...l}));return r.displayName=mw(e),r};const P5=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],U5=zt("arrow-down-to-line",P5);const V5=[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]],$5=zt("arrow-up-from-line",V5);const Y5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ey=zt("check",Y5);const q5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ty=zt("chevron-down",q5);const F5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],X5=zt("chevron-left",F5);const G5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pw=zt("chevron-right",G5);const W5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Z5=zt("chevron-up",W5);const K5=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Q5=zt("circle-play",K5);const J5=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],e3=zt("clipboard",J5);const t3=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],_N=zt("copy",t3);const n3=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],vf=zt("database",n3);const r3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],kN=zt("external-link",r3);const o3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],i3=zt("file-down",o3);const l3=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],a3=zt("git-branch",l3);const s3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],c3=zt("info",s3);const u3=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],f3=zt("list-checks",u3);const d3=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],h3=zt("plug",d3);const m3=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],p3=zt("sparkles",m3),g3=w.forwardRef(function({className:t,...r},i){return p.jsx($E,{ref:i,className:ve("peer size-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...r,children:p.jsx(qE,{className:"flex items-center justify-center text-current",children:p.jsx(ey,{className:"size-2.5"})})})}),zu="You: ",Lu="Coding Agent: ",Qm=[{type:"you",text:"Create a workflow for competitor analysis: research from external sources, extract key points, then write a comparison report."},{type:"thinking"},{type:"ai",text:"I've created the workflow and set it as current. You'll see it in the Workflow tab in Studio."},{type:"you",text:"Start a run with input topic 'SaaS productivity tools'."},{type:"thinking"},{type:"ai",text:"Run started. Check the Runs tab in Studio to watch progress."},{type:"you",text:"Add a new version of this workflow that also pulls in pricing from their websites."},{type:"thinking"},{type:"ai",text:"New version is ready with the pricing step. Would you like me to run it?"}],y3=35,x3=400,v3=1200,b3=530;function w3(){return p.jsxs("span",{className:"inline-flex gap-0.5","aria-hidden":!0,children:[p.jsx("span",{className:"size-1.5 rounded-full bg-zinc-500 animate-bounce [animation-delay:0ms]"}),p.jsx("span",{className:"size-1.5 rounded-full bg-zinc-500 animate-bounce [animation-delay:150ms]"}),p.jsx("span",{className:"size-1.5 rounded-full bg-zinc-500 animate-bounce [animation-delay:300ms]"})]})}function S3(){const[e,t]=w.useState(0),[r,i]=w.useState(0),[l,s]=w.useState(!0),c=Qm[e],f=c&&(c.type==="you"||c.type==="ai"),h=f?(c.type==="you"?zu:Lu)+c.text:"",d=f&&r>=h.length;w.useEffect(function(){if(c){if(c.type==="thinking"){const E=setTimeout(()=>{t(S=>S+1),i(0)},v3);return()=>clearTimeout(E)}if(c.type==="you"||c.type==="ai"){const E=(c.type==="you"?zu:Lu)+c.text;if(r<E.length){const _=setTimeout(()=>i(N=>N+1),y3);return()=>clearTimeout(_)}const S=setTimeout(()=>{t(_=>_+1),i(0)},x3);return()=>clearTimeout(S)}}},[e,r,c]),w.useEffect(function(){const E=setInterval(()=>s(S=>!S),b3);return()=>clearInterval(E)},[]);const m=Qm.slice(0,e).filter(b=>b.type!=="thinking"),g=Qm[e],x=g&&(g.type==="you"||g.type==="ai");return p.jsxs("div",{className:"rounded-lg border border-border/80 bg-[#0d1117] overflow-hidden shadow-inner",role:"img","aria-label":"Simulated chat: you ask your coding agent to create a workflow, run it, and add a new version; the agent responds in plain language; workflows and runs appear in Studio.",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-2.5 border-b-2 border-amber-500/50 bg-amber-500/20",children:[p.jsx("span",{className:"size-2.5 rounded-full bg-[#ff5f57]","aria-hidden":!0}),p.jsx("span",{className:"size-2.5 rounded-full bg-[#febc2e]","aria-hidden":!0}),p.jsx("span",{className:"size-2.5 rounded-full bg-[#28c840]","aria-hidden":!0}),p.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-amber-200/95 ml-1",children:"Simulation"}),p.jsx("span",{className:"text-xs font-medium text-amber-100/90",children:"Do not type here. Use your editor's chat to talk to your AI."})]}),p.jsx("div",{className:"p-5 min-h-[12rem] flex flex-col text-[13px] leading-relaxed font-sans",children:p.jsxs("div",{className:"flex flex-col min-h-0 flex-1 overflow-hidden",children:[p.jsxs("div",{className:"space-y-4 overflow-y-auto overflow-x-auto flex-1 min-h-0",children:[m.map((b,E)=>b.type==="you"?p.jsxs("div",{className:"space-y-0.5",children:[p.jsx("span",{className:"text-blue-400/95 font-medium",children:"You:"}),p.jsxs("span",{className:"text-zinc-300",children:[" ",b.text]})]},E):b.type==="ai"?p.jsxs("div",{className:"space-y-0.5",children:[p.jsx("span",{className:"text-emerald-400/95 font-medium",children:"Coding Agent:"}),p.jsxs("span",{className:"text-zinc-300",children:[" ",b.text]})]},E):null),x&&g&&(()=>{const b=g.type==="you"?zu:Lu,E=b.length,S=(g.type==="you"?zu+g.text:Lu+g.text).slice(0,r),_=r>E?S.slice(E):"",N=r<=E?S:b,k=g.type==="you"?"You:":"Coding Agent:",C=g.type==="you"?"text-blue-400/95":"text-emerald-400/95";return p.jsxs("div",{className:"space-y-0.5",children:[p.jsx("span",{className:`font-medium ${C}`,children:r<=E?N||b:k}),_&&p.jsxs("span",{className:"text-zinc-300",children:[" ",_]}),!d&&p.jsx("span",{className:l?"inline-block w-0.5 h-4 align-middle bg-emerald-400/90 ml-0.5":"inline-block w-0.5 h-4 align-middle bg-transparent ml-0.5","aria-hidden":!0})]})})()]}),g?.type==="thinking"&&p.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs pt-3 mt-2 border-t border-white/10 shrink-0",children:[p.jsx(w3,{}),p.jsx("span",{children:"Thinking…"})]})]})})]})}function E3({open:e,onOpenChange:t,onClose:r}){const[i,l]=w.useState(!1);function s(f){f||r(!1),t(f)}function c(){r(i),t(!1)}return p.jsx(N5,{open:e,onOpenChange:s,children:p.jsxs(M5,{className:"max-w-2xl gap-8 p-8",showCloseButton:!0,children:[p.jsxs(O5,{className:"space-y-2",children:[p.jsx(A5,{className:"text-xl font-semibold",children:"Get started with Cognetivy Studio"}),p.jsx(R5,{className:"text-muted-foreground text-sm",children:"This Studio shows your workflows and runs. To see data here, talk to the AI that already lives in your editor - Claude Code, Cursor, OpenClaw, or another AI assistant - and ask it to create workflows and start runs."}),p.jsx("p",{className:"text-xs text-foreground font-medium pl-2.5 py-1 mt-2"})]}),p.jsx("div",{className:"space-y-6",children:p.jsx(S3,{})}),p.jsxs(D5,{className:"flex flex-col-reverse gap-4 sm:flex-row sm:justify-between sm:items-center pt-2",children:[p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:[p.jsx(g3,{checked:i,onCheckedChange:f=>l(f===!0),"aria-label":"Don't show this again"}),p.jsx("span",{children:"Don't show this again"})]}),p.jsx("button",{type:"button",onClick:c,className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:"Got it"})]})]})})}function TN({className:e,size:t="default",...r}){return p.jsx(h5,{"data-slot":"switch","data-size":t,className:ve("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...r,children:p.jsx(m5,{"data-slot":"switch-thumb",className:ve("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const C3="/api";async function Wt(e){const t=await fetch(`${C3}${e}`);if(!t.ok){const r=await t.json().catch(()=>({error:t.statusText}));throw new Error(r.error??t.statusText)}return t.json()}const AN=new Set(["citations","derived_from","reasoning"]),lt={getWorkspace:()=>Wt("/workspace"),getWorkflows:()=>Wt("/workflows"),getWorkflow:e=>Wt(`/workflows/${encodeURIComponent(e)}`),getWorkflowVersions:e=>Wt(`/workflows/${encodeURIComponent(e)}/versions`),getWorkflowVersion:(e,t,r)=>{const i=new URLSearchParams;r?.includePrompts===!1&&i.set("include_prompts","false");const l=i.toString();return Wt(`/workflows/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}${l?`?${l}`:""}`)},getWorkflowNodePrompt:(e,t,r)=>Wt(`/workflows/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}/nodes/${encodeURIComponent(r)}`),getWorkflowTemplates:()=>Wt("/workflow-templates"),getRuns:()=>Wt("/runs"),getRun:e=>Wt(`/runs/${encodeURIComponent(e)}`),getRunEvents:e=>Wt(`/runs/${encodeURIComponent(e)}/events`),getNodeResults:e=>Wt(`/runs/${encodeURIComponent(e)}/node-results`),getCollectionSchema:e=>Wt(`/workflows/${encodeURIComponent(e)}/collections/schema`),getCollectionKinds:e=>Wt(`/collections/${encodeURIComponent(e)}`),getCollections:(e,t)=>Wt(`/collections/${encodeURIComponent(e)}/${encodeURIComponent(t)}`),getEntityData:(e,t)=>{const r=new URLSearchParams;t?.runId&&r.set("run_id",t.runId),t?.workflowId&&r.set("workflow_id",t.workflowId);const i=r.toString();return Wt(`/entities/${encodeURIComponent(e)}${i?`?${i}`:""}`)}},RN="cognetivy-selected-workflow-id",N3=2e3,jN=w.createContext(null);function _3(){try{return localStorage.getItem(RN)}catch{return null}}function gw(e){try{localStorage.setItem(RN,e)}catch{}}function k3({children:e}){const[t,r]=w.useState([]),[i,l]=w.useState(_3()),s=w.useCallback(async()=>{const d=await lt.getWorkflows();r(d),l(m=>{if(m!==null)return m;const b=d.find(E=>E.current)?.workflow_id??d[0]?.workflow_id??null;return b&&gw(b),b})},[]);w.useEffect(()=>{s().catch(()=>r([]));const d=setInterval(()=>{s().catch(()=>r([]))},N3);return()=>clearInterval(d)},[s]);const c=w.useCallback(d=>{l(d),gw(d)},[]),f=w.useMemo(()=>i?t.find(d=>d.workflow_id===i)??null:null,[t,i]),h={workflows:t,selectedWorkflowId:i,setSelectedWorkflowId:c,selectedWorkflow:f,reloadWorkflows:s};return p.jsx(jN.Provider,{value:h,children:e})}function sa(){const e=w.useContext(jN);if(!e)throw new Error("useWorkflowSelection must be used within WorkflowSelectionProvider");return e}function Ns({...e}){return p.jsx(Kz,{"data-slot":"select",...e})}function _s({...e}){return p.jsx(Jz,{"data-slot":"select-value",...e})}function ks({className:e,size:t="default",children:r,...i}){return p.jsxs(Qz,{"data-slot":"select-trigger","data-size":t,className:ve("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i,children:[r,p.jsx(e5,{asChild:!0,children:p.jsx(ty,{className:"size-4 opacity-50"})})]})}function Ts({className:e,children:t,position:r="popper",align:i="start",sideOffset:l=4,collisionPadding:s=8,onCloseAutoFocus:c,...f}){return p.jsx(t5,{children:p.jsxs(n5,{"data-slot":"select-content",className:ve("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-hidden rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:i,sideOffset:l,collisionPadding:s,sticky:"partial",onCloseAutoFocus:h=>{h.preventDefault(),c?.(h)},...f,children:[p.jsx(T3,{}),p.jsx(r5,{className:ve("max-h-80 p-1 overscroll-contain",r==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),p.jsx(A3,{})]})})}function ro({className:e,children:t,...r}){return p.jsxs(o5,{"data-slot":"select-item",className:ve("focus:bg-accent focus:text-accent-foreground data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=checked]:font-medium [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[p.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:p.jsx(l5,{children:p.jsx(ey,{className:"size-4"})})}),p.jsx(i5,{children:t})]})}function T3({className:e,...t}){return p.jsx(a5,{"data-slot":"select-scroll-up-button",className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(Z5,{className:"size-4"})})}function A3({className:e,...t}){return p.jsx(s5,{"data-slot":"select-scroll-down-button",className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(ty,{className:"size-4"})})}const MN="cognetivy-sidebar-open",R3=2e3,j3=[{to:"/",label:"Workflow",icon:a3},{to:"/runs",label:"Runs",icon:Q5}];function M3(){try{return localStorage.getItem(MN)!=="false"}catch{return!0}}function O3(e){try{localStorage.setItem(MN,String(e))}catch{}}function D3(){const e=_r(),{theme:t,setTheme:r}=PS(),{open:i,closeForSession:l,dismissPermanently:s}=C5(),{workflows:c,selectedWorkflowId:f,setSelectedWorkflowId:h}=sa(),[d,m]=w.useState(null),[g,x]=w.useState([]),[b,E]=w.useState(null),[S,_]=w.useState(!0),[N,k]=w.useState(M3),C=g.filter(Y=>Y.status==="running").length;w.useEffect(()=>{lt.getWorkspace().then(E).catch(()=>E(null))},[]),w.useEffect(()=>{if(!f){m(null);return}const Y=f;function F(){lt.getCollectionSchema(Y).then(m).catch(()=>m(null))}F();const O=setInterval(F,R3);return()=>clearInterval(O)},[f]),w.useEffect(()=>{function Y(){lt.getRuns().then(x).catch(()=>x([]))}Y();const F=setInterval(Y,5e3);return()=>clearInterval(F)},[]);function A(){k(Y=>{const F=!Y;return O3(F),F})}const z=w.useMemo(()=>d?Object.keys(d.kinds):[],[d]);function j(Y){r(Y?"light":"dark")}function L(Y){h(Y)}function P(){_(Y=>!Y)}function H(Y){Y?s():l()}function X(Y){const F=Y.icon,O=e.pathname===Y.to||Y.to!=="/"&&e.pathname.startsWith(Y.to),U=Y.to==="/runs"&&C>0;return p.jsxs(gt,{to:Y.to,title:Y.label+(U?` (${C} running)`:""),className:ve("flex items-center rounded-md text-xs font-medium transition-colors",N?"gap-2 px-2.5 py-1.5 w-full":"p-2 justify-center",O?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[p.jsx(F,{className:"size-3.5 shrink-0"}),N&&p.jsxs(p.Fragment,{children:[Y.label,U&&p.jsxs("span",{className:"ml-auto text-amber-600 dark:text-amber-400 font-medium flex items-center gap-1",children:[p.jsx("span",{className:"size-1 rounded-full bg-amber-500 animate-pulse","aria-hidden":!0}),C]})]})]},Y.to)}function q(Y){return p.jsx(gt,{to:`/data/${encodeURIComponent(Y)}`,className:ve("block px-2 py-1 rounded-md text-xs font-medium transition-colors border-l-4",e.pathname===`/data/${Y}`?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),style:{borderLeftColor:xr(Y)},children:Y},Y)}return p.jsxs("div",{className:"flex h-screen bg-background",children:[p.jsx(E3,{open:i,onOpenChange:()=>{},onClose:H}),p.jsxs("aside",{className:ve("border-r border-border flex flex-col bg-sidebar shrink-0 min-h-0 transition-[width] duration-200",N?"w-48":"w-14"),children:[p.jsx("div",{className:"p-2.5 border-b border-border flex items-center gap-2 min-w-0",children:N?p.jsxs(p.Fragment,{children:[p.jsx("img",{src:"/favicon.png",alt:"",className:"h-10 w-10 rounded object-contain shrink-0","aria-hidden":!0}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("h1",{className:"font-semibold text-sm truncate",children:"Cognetivy Studio"}),p.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Read-only"}),b?.path&&p.jsx("p",{className:"text-[10px] text-muted-foreground truncate mt-0.5",title:b.path,children:b.path.split("/").slice(-2).join("/")||b.path})]})]}):p.jsx("img",{src:"/icon.jpg",alt:"Cognetivy",className:"h-8 w-8 rounded object-contain mx-auto","aria-hidden":!0})}),N&&p.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-2 border-b border-border",children:[p.jsx("span",{className:"text-xs text-muted-foreground",children:"Dark"}),p.jsx(TN,{checked:t==="light",onCheckedChange:j}),p.jsx("span",{className:"text-xs text-muted-foreground",children:"Light"})]}),N&&(c.length>0||f)&&p.jsxs("div",{className:"px-2.5 py-2 border-b border-border",children:[p.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:"Select a workflow"}),p.jsxs(Ns,{value:f??"",onValueChange:L,children:[p.jsx(ks,{className:"h-8 w-full text-xs",children:p.jsx(_s,{placeholder:"Select workflow"})}),p.jsxs(Ts,{children:[f&&!c.some(Y=>Y.workflow_id===f)&&p.jsx(ro,{value:f,children:p.jsx("span",{className:"text-muted-foreground",children:"Unknown workflow"})}),c.map(Y=>p.jsx(ro,{value:Y.workflow_id,children:Y.name},Y.workflow_id))]})]})]}),p.jsx(EN,{className:"flex-1 min-h-0",children:p.jsxs("nav",{className:ve("p-1.5 space-y-0.5",N&&"h-full flex flex-col",!N&&"flex flex-col items-center gap-1"),children:[j3.map(X),z.length>0&&p.jsx("div",{className:ve("pt-1",N&&"min-h-0 flex-1 flex flex-col",!N&&"w-full flex flex-col items-center"),children:N?p.jsxs("div",{className:"min-h-0 flex-1 flex flex-col",children:[p.jsxs("div",{className:"flex items-center gap-0.5 w-full",children:[p.jsx("button",{type:"button",onClick:P,className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":S?"Collapse collections":"Expand collections",children:S?p.jsx(ty,{className:"size-3 shrink-0"}):p.jsx(pw,{className:"size-3 shrink-0"})}),p.jsxs(gt,{to:"/collections",className:ve("flex items-center gap-2 flex-1 px-2 py-1.5 rounded-md text-xs font-medium transition-colors",e.pathname==="/collections"||e.pathname.startsWith("/data/")?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[p.jsx(vf,{className:"size-3.5 shrink-0"}),"Collections"]})]}),S&&p.jsx("div",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-border pl-2 pr-1 min-h-0 flex-1 max-h-[calc(100vh-16rem)] overflow-y-auto",children:z.map(q)})]}):z.length>0&&p.jsx(gt,{to:"/collections",title:"Collections",className:ve("p-2 rounded-md flex justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground",(e.pathname==="/collections"||e.pathname.startsWith("/data/"))&&"bg-accent text-accent-foreground"),children:p.jsx(vf,{className:"size-3.5"})})})]})}),p.jsx("button",{type:"button",onClick:A,className:"p-2 border-t border-border flex items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground rounded-none w-full","aria-label":N?"Collapse sidebar":"Expand sidebar",children:N?p.jsx(X5,{className:"size-4"}):p.jsx(pw,{className:"size-4"})})]}),p.jsx("main",{className:"flex-1 overflow-auto min-w-0",children:p.jsx(vR,{})})]})}function ca({items:e,className:t}){return e.length===0?null:p.jsx("nav",{"aria-label":"Breadcrumb",className:ve("flex items-center gap-1.5 text-xs text-muted-foreground",t),children:e.map((r,i)=>{const l=i===e.length-1;return p.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[i>0&&p.jsx("span",{className:"shrink-0 text-muted-foreground/70","aria-hidden":!0,children:"/"}),r.to&&!l?p.jsx(gt,{to:r.to,className:ve(En,"truncate","focus:outline-none focus:underline"),children:r.label}):p.jsx("span",{className:ve(l&&"font-medium text-foreground","truncate"),children:r.label})]},i)})})}function _n({className:e,...t}){return p.jsx("div",{"data-slot":"card",className:ve("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function tr({className:e,...t}){return p.jsx("div",{"data-slot":"card-header",className:ve("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function nr({className:e,...t}){return p.jsx("div",{"data-slot":"card-title",className:ve("leading-none font-semibold",e),...t})}function kn({className:e,...t}){return p.jsx("div",{"data-slot":"card-content",className:ve("px-6",e),...t})}const ny=DE,z3=zE;function L3({className:e,...t}){return p.jsx(LE,{className:ve("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function ry({className:e,children:t,showCloseButton:r=!0,side:i="right",onOpenAutoFocus:l,...s}){const c=l??(f=>f.preventDefault());return p.jsxs(z3,{children:[p.jsx(L3,{}),p.jsxs(IE,{onOpenAutoFocus:c,className:ve("fixed z-50 flex h-full flex-col gap-4 border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out",i==="right"&&"right-0 top-0 w-full max-w-md data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",i==="left"&&"left-0 top-0 w-full max-w-md data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",e),...s,children:[p.jsx("div",{className:"flex-1 overflow-y-auto p-6 pr-10",children:t}),r&&p.jsxs(PE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[p.jsx("span",{className:"sr-only",children:"Close"}),p.jsx("span",{"aria-hidden":!0,className:"text-lg leading-none",children:"×"})]})]})]})}function bf({className:e,...t}){return p.jsx("div",{className:ve("flex flex-col space-y-1.5 text-left",e),...t})}const As=w.forwardRef(({className:e,...t},r)=>p.jsx(BE,{ref:r,className:ve("text-lg font-semibold",e),...t}));As.displayName="SheetTitle";const wf=w.forwardRef(({className:e,...t},r)=>p.jsx(HE,{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));wf.displayName="SheetDescription";function At(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,i;r<e.length;r++)(i=At(e[r]))!==""&&(t+=(t&&" ")+i);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var I3={value:()=>{}};function Qf(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new tf(r)}function tf(e){this._=e}function B3(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",l=r.indexOf(".");if(l>=0&&(i=r.slice(l+1),r=r.slice(0,l)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}tf.prototype=Qf.prototype={constructor:tf,on:function(e,t){var r=this._,i=B3(e+"",r),l,s=-1,c=i.length;if(arguments.length<2){for(;++s<c;)if((l=(e=i[s]).type)&&(l=H3(r[l],e.name)))return l;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<c;)if(l=(e=i[s]).type)r[l]=yw(r[l],e.name,t);else if(t==null)for(l in r)r[l]=yw(r[l],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new tf(e)},call:function(e,t){if((l=arguments.length-2)>0)for(var r=new Array(l),i=0,l,s;i<l;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,l=s.length;i<l;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],l=0,s=i.length;l<s;++l)i[l].value.apply(t,r)}};function H3(e,t){for(var r=0,i=e.length,l;r<i;++r)if((l=e[r]).name===t)return l.value}function yw(e,t,r){for(var i=0,l=e.length;i<l;++i)if(e[i].name===t){e[i]=I3,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Yp="http://www.w3.org/1999/xhtml";const xw={svg:"http://www.w3.org/2000/svg",xhtml:Yp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jf(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),xw.hasOwnProperty(t)?{space:xw[t],local:e}:e}function P3(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Yp&&t.documentElement.namespaceURI===Yp?t.createElement(e):t.createElementNS(r,e)}}function U3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ON(e){var t=Jf(e);return(t.local?U3:P3)(t)}function V3(){}function oy(e){return e==null?V3:function(){return this.querySelector(e)}}function $3(e){typeof e!="function"&&(e=oy(e));for(var t=this._groups,r=t.length,i=new Array(r),l=0;l<r;++l)for(var s=t[l],c=s.length,f=i[l]=new Array(c),h,d,m=0;m<c;++m)(h=s[m])&&(d=e.call(h,h.__data__,m,s))&&("__data__"in h&&(d.__data__=h.__data__),f[m]=d);return new Tn(i,this._parents)}function Y3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function q3(){return[]}function DN(e){return e==null?q3:function(){return this.querySelectorAll(e)}}function F3(e){return function(){return Y3(e.apply(this,arguments))}}function X3(e){typeof e=="function"?e=F3(e):e=DN(e);for(var t=this._groups,r=t.length,i=[],l=[],s=0;s<r;++s)for(var c=t[s],f=c.length,h,d=0;d<f;++d)(h=c[d])&&(i.push(e.call(h,h.__data__,d,c)),l.push(h));return new Tn(i,l)}function zN(e){return function(){return this.matches(e)}}function LN(e){return function(t){return t.matches(e)}}var G3=Array.prototype.find;function W3(e){return function(){return G3.call(this.children,e)}}function Z3(){return this.firstElementChild}function K3(e){return this.select(e==null?Z3:W3(typeof e=="function"?e:LN(e)))}var Q3=Array.prototype.filter;function J3(){return Array.from(this.children)}function eL(e){return function(){return Q3.call(this.children,e)}}function tL(e){return this.selectAll(e==null?J3:eL(typeof e=="function"?e:LN(e)))}function nL(e){typeof e!="function"&&(e=zN(e));for(var t=this._groups,r=t.length,i=new Array(r),l=0;l<r;++l)for(var s=t[l],c=s.length,f=i[l]=[],h,d=0;d<c;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new Tn(i,this._parents)}function IN(e){return new Array(e.length)}function rL(){return new Tn(this._enter||this._groups.map(IN),this._parents)}function Sf(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sf.prototype={constructor:Sf,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function oL(e){return function(){return e}}function iL(e,t,r,i,l,s){for(var c=0,f,h=t.length,d=s.length;c<d;++c)(f=t[c])?(f.__data__=s[c],i[c]=f):r[c]=new Sf(e,s[c]);for(;c<h;++c)(f=t[c])&&(l[c]=f)}function lL(e,t,r,i,l,s,c){var f,h,d=new Map,m=t.length,g=s.length,x=new Array(m),b;for(f=0;f<m;++f)(h=t[f])&&(x[f]=b=c.call(h,h.__data__,f,t)+"",d.has(b)?l[f]=h:d.set(b,h));for(f=0;f<g;++f)b=c.call(e,s[f],f,s)+"",(h=d.get(b))?(i[f]=h,h.__data__=s[f],d.delete(b)):r[f]=new Sf(e,s[f]);for(f=0;f<m;++f)(h=t[f])&&d.get(x[f])===h&&(l[f]=h)}function aL(e){return e.__data__}function sL(e,t){if(!arguments.length)return Array.from(this,aL);var r=t?lL:iL,i=this._parents,l=this._groups;typeof e!="function"&&(e=oL(e));for(var s=l.length,c=new Array(s),f=new Array(s),h=new Array(s),d=0;d<s;++d){var m=i[d],g=l[d],x=g.length,b=cL(e.call(m,m&&m.__data__,d,i)),E=b.length,S=f[d]=new Array(E),_=c[d]=new Array(E),N=h[d]=new Array(x);r(m,g,S,_,N,b,t);for(var k=0,C=0,A,z;k<E;++k)if(A=S[k]){for(k>=C&&(C=k+1);!(z=_[C])&&++C<E;);A._next=z||null}}return c=new Tn(c,i),c._enter=f,c._exit=h,c}function cL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uL(){return new Tn(this._exit||this._groups.map(IN),this._parents)}function fL(e,t,r){var i=this.enter(),l=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(l=t(l),l&&(l=l.selection())),r==null?s.remove():r(s),i&&l?i.merge(l).order():l}function dL(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,l=r.length,s=i.length,c=Math.min(l,s),f=new Array(l),h=0;h<c;++h)for(var d=r[h],m=i[h],g=d.length,x=f[h]=new Array(g),b,E=0;E<g;++E)(b=d[E]||m[E])&&(x[E]=b);for(;h<l;++h)f[h]=r[h];return new Tn(f,this._parents)}function hL(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],l=i.length-1,s=i[l],c;--l>=0;)(c=i[l])&&(s&&c.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(c,s),s=c);return this}function mL(e){e||(e=pL);function t(g,x){return g&&x?e(g.__data__,x.__data__):!g-!x}for(var r=this._groups,i=r.length,l=new Array(i),s=0;s<i;++s){for(var c=r[s],f=c.length,h=l[s]=new Array(f),d,m=0;m<f;++m)(d=c[m])&&(h[m]=d);h.sort(t)}return new Tn(l,this._parents).order()}function pL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function yL(){return Array.from(this)}function xL(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],l=0,s=i.length;l<s;++l){var c=i[l];if(c)return c}return null}function vL(){let e=0;for(const t of this)++e;return e}function bL(){return!this.node()}function wL(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var l=t[r],s=0,c=l.length,f;s<c;++s)(f=l[s])&&e.call(f,f.__data__,s,l);return this}function SL(e){return function(){this.removeAttribute(e)}}function EL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function CL(e,t){return function(){this.setAttribute(e,t)}}function NL(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function _L(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function kL(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function TL(e,t){var r=Jf(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?EL:SL:typeof t=="function"?r.local?kL:_L:r.local?NL:CL)(r,t))}function BN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function AL(e){return function(){this.style.removeProperty(e)}}function RL(e,t,r){return function(){this.style.setProperty(e,t,r)}}function jL(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function ML(e,t,r){return arguments.length>1?this.each((t==null?AL:typeof t=="function"?jL:RL)(e,t,r??"")):Gl(this.node(),e)}function Gl(e,t){return e.style.getPropertyValue(t)||BN(e).getComputedStyle(e,null).getPropertyValue(t)}function OL(e){return function(){delete this[e]}}function DL(e,t){return function(){this[e]=t}}function zL(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function LL(e,t){return arguments.length>1?this.each((t==null?OL:typeof t=="function"?zL:DL)(e,t)):this.node()[e]}function HN(e){return e.trim().split(/^|\s+/)}function iy(e){return e.classList||new PN(e)}function PN(e){this._node=e,this._names=HN(e.getAttribute("class")||"")}PN.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function UN(e,t){for(var r=iy(e),i=-1,l=t.length;++i<l;)r.add(t[i])}function VN(e,t){for(var r=iy(e),i=-1,l=t.length;++i<l;)r.remove(t[i])}function IL(e){return function(){UN(this,e)}}function BL(e){return function(){VN(this,e)}}function HL(e,t){return function(){(t.apply(this,arguments)?UN:VN)(this,e)}}function PL(e,t){var r=HN(e+"");if(arguments.length<2){for(var i=iy(this.node()),l=-1,s=r.length;++l<s;)if(!i.contains(r[l]))return!1;return!0}return this.each((typeof t=="function"?HL:t?IL:BL)(r,t))}function UL(){this.textContent=""}function VL(e){return function(){this.textContent=e}}function $L(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function YL(e){return arguments.length?this.each(e==null?UL:(typeof e=="function"?$L:VL)(e)):this.node().textContent}function qL(){this.innerHTML=""}function FL(e){return function(){this.innerHTML=e}}function XL(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function GL(e){return arguments.length?this.each(e==null?qL:(typeof e=="function"?XL:FL)(e)):this.node().innerHTML}function WL(){this.nextSibling&&this.parentNode.appendChild(this)}function ZL(){return this.each(WL)}function KL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function QL(){return this.each(KL)}function JL(e){var t=typeof e=="function"?e:ON(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function e4(){return null}function t4(e,t){var r=typeof e=="function"?e:ON(e),i=t==null?e4:typeof t=="function"?t:oy(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function n4(){var e=this.parentNode;e&&e.removeChild(this)}function r4(){return this.each(n4)}function o4(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function i4(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function l4(e){return this.select(e?i4:o4)}function a4(e){return arguments.length?this.property("__data__",e):this.node().__data__}function s4(e){return function(t){e.call(this,t,this.__data__)}}function c4(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function u4(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,l=t.length,s;r<l;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function f4(e,t,r){return function(){var i=this.__on,l,s=s4(t);if(i){for(var c=0,f=i.length;c<f;++c)if((l=i[c]).type===e.type&&l.name===e.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=s,l.options=r),l.value=t;return}}this.addEventListener(e.type,s,r),l={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(l):this.__on=[l]}}function d4(e,t,r){var i=c4(e+""),l,s=i.length,c;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,m;h<d;++h)for(l=0,m=f[h];l<s;++l)if((c=i[l]).type===m.type&&c.name===m.name)return m.value}return}for(f=t?f4:u4,l=0;l<s;++l)this.each(f(i[l],t,r));return this}function $N(e,t,r){var i=BN(e),l=i.CustomEvent;typeof l=="function"?l=new l(t,r):(l=i.document.createEvent("Event"),r?(l.initEvent(t,r.bubbles,r.cancelable),l.detail=r.detail):l.initEvent(t,!1,!1)),e.dispatchEvent(l)}function h4(e,t){return function(){return $N(this,e,t)}}function m4(e,t){return function(){return $N(this,e,t.apply(this,arguments))}}function p4(e,t){return this.each((typeof t=="function"?m4:h4)(e,t))}function*g4(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],l=0,s=i.length,c;l<s;++l)(c=i[l])&&(yield c)}var YN=[null];function Tn(e,t){this._groups=e,this._parents=t}function Ws(){return new Tn([[document.documentElement]],YN)}function y4(){return this}Tn.prototype=Ws.prototype={constructor:Tn,select:$3,selectAll:X3,selectChild:K3,selectChildren:tL,filter:nL,data:sL,enter:rL,exit:uL,join:fL,merge:dL,selection:y4,order:hL,sort:mL,call:gL,nodes:yL,node:xL,size:vL,empty:bL,each:wL,attr:TL,style:ML,property:LL,classed:PL,text:YL,html:GL,raise:ZL,lower:QL,append:JL,insert:t4,remove:r4,clone:l4,datum:a4,on:d4,dispatch:p4,[Symbol.iterator]:g4};function Sn(e){return typeof e=="string"?new Tn([[document.querySelector(e)]],[document.documentElement]):new Tn([[e]],YN)}function x4(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Zn(e,t){if(e=x4(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var l=t.getBoundingClientRect();return[e.clientX-l.left-t.clientLeft,e.clientY-l.top-t.clientTop]}}return[e.pageX,e.pageY]}const v4={passive:!1},Rs={capture:!0,passive:!1};function Jm(e){e.stopImmediatePropagation()}function Pl(e){e.preventDefault(),e.stopImmediatePropagation()}function qN(e){var t=e.document.documentElement,r=Sn(e).on("dragstart.drag",Pl,Rs);"onselectstart"in t?r.on("selectstart.drag",Pl,Rs):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function FN(e,t){var r=e.document.documentElement,i=Sn(e).on("dragstart.drag",null);t&&(i.on("click.drag",Pl,Rs),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Iu=e=>()=>e;function qp(e,{sourceEvent:t,subject:r,target:i,identifier:l,active:s,x:c,y:f,dx:h,dy:d,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}qp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function b4(e){return!e.ctrlKey&&!e.button}function w4(){return this.parentNode}function S4(e,t){return t??{x:e.x,y:e.y}}function E4(){return navigator.maxTouchPoints||"ontouchstart"in this}function XN(){var e=b4,t=w4,r=S4,i=E4,l={},s=Qf("start","drag","end"),c=0,f,h,d,m,g=0;function x(A){A.on("mousedown.drag",b).filter(i).on("touchstart.drag",_).on("touchmove.drag",N,v4).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(A,z){if(!(m||!e.call(this,A,z))){var j=C(this,t.call(this,A,z),A,z,"mouse");j&&(Sn(A.view).on("mousemove.drag",E,Rs).on("mouseup.drag",S,Rs),qN(A.view),Jm(A),d=!1,f=A.clientX,h=A.clientY,j("start",A))}}function E(A){if(Pl(A),!d){var z=A.clientX-f,j=A.clientY-h;d=z*z+j*j>g}l.mouse("drag",A)}function S(A){Sn(A.view).on("mousemove.drag mouseup.drag",null),FN(A.view,d),Pl(A),l.mouse("end",A)}function _(A,z){if(e.call(this,A,z)){var j=A.changedTouches,L=t.call(this,A,z),P=j.length,H,X;for(H=0;H<P;++H)(X=C(this,L,A,z,j[H].identifier,j[H]))&&(Jm(A),X("start",A,j[H]))}}function N(A){var z=A.changedTouches,j=z.length,L,P;for(L=0;L<j;++L)(P=l[z[L].identifier])&&(Pl(A),P("drag",A,z[L]))}function k(A){var z=A.changedTouches,j=z.length,L,P;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),L=0;L<j;++L)(P=l[z[L].identifier])&&(Jm(A),P("end",A,z[L]))}function C(A,z,j,L,P,H){var X=s.copy(),q=Zn(H||j,z),Y,F,O;if((O=r.call(A,new qp("beforestart",{sourceEvent:j,target:x,identifier:P,active:c,x:q[0],y:q[1],dx:0,dy:0,dispatch:X}),L))!=null)return Y=O.x-q[0]||0,F=O.y-q[1]||0,function U(R,V,$){var W=q,M;switch(R){case"start":l[P]=U,M=c++;break;case"end":delete l[P],--c;case"drag":q=Zn($||V,z),M=c;break}X.call(R,A,new qp(R,{sourceEvent:V,subject:O,target:x,identifier:P,active:M,x:q[0]+Y,y:q[1]+F,dx:q[0]-W[0],dy:q[1]-W[1],dispatch:X}),L)}}return x.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Iu(!!A),x):e},x.container=function(A){return arguments.length?(t=typeof A=="function"?A:Iu(A),x):t},x.subject=function(A){return arguments.length?(r=typeof A=="function"?A:Iu(A),x):r},x.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Iu(!!A),x):i},x.on=function(){var A=s.on.apply(s,arguments);return A===s?x:A},x.clickDistance=function(A){return arguments.length?(g=(A=+A)*A,x):Math.sqrt(g)},x}function ly(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function GN(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Zs(){}var js=.7,Ef=1/js,Ul="\\s*([+-]?\\d+)\\s*",Ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",C4=/^#([0-9a-f]{3,8})$/,N4=new RegExp(`^rgb\\(${Ul},${Ul},${Ul}\\)$`),_4=new RegExp(`^rgb\\(${wr},${wr},${wr}\\)$`),k4=new RegExp(`^rgba\\(${Ul},${Ul},${Ul},${Ms}\\)$`),T4=new RegExp(`^rgba\\(${wr},${wr},${wr},${Ms}\\)$`),A4=new RegExp(`^hsl\\(${Ms},${wr},${wr}\\)$`),R4=new RegExp(`^hsla\\(${Ms},${wr},${wr},${Ms}\\)$`),vw={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};ly(Zs,Ii,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bw,formatHex:bw,formatHex8:j4,formatHsl:M4,formatRgb:ww,toString:ww});function bw(){return this.rgb().formatHex()}function j4(){return this.rgb().formatHex8()}function M4(){return WN(this).formatHsl()}function ww(){return this.rgb().formatRgb()}function Ii(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=C4.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Sw(t):r===3?new sn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Bu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Bu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=N4.exec(e))?new sn(t[1],t[2],t[3],1):(t=_4.exec(e))?new sn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=k4.exec(e))?Bu(t[1],t[2],t[3],t[4]):(t=T4.exec(e))?Bu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=A4.exec(e))?Nw(t[1],t[2]/100,t[3]/100,1):(t=R4.exec(e))?Nw(t[1],t[2]/100,t[3]/100,t[4]):vw.hasOwnProperty(e)?Sw(vw[e]):e==="transparent"?new sn(NaN,NaN,NaN,0):null}function Sw(e){return new sn(e>>16&255,e>>8&255,e&255,1)}function Bu(e,t,r,i){return i<=0&&(e=t=r=NaN),new sn(e,t,r,i)}function O4(e){return e instanceof Zs||(e=Ii(e)),e?(e=e.rgb(),new sn(e.r,e.g,e.b,e.opacity)):new sn}function Fp(e,t,r,i){return arguments.length===1?O4(e):new sn(e,t,r,i??1)}function sn(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}ly(sn,Fp,GN(Zs,{brighter(e){return e=e==null?Ef:Math.pow(Ef,e),new sn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?js:Math.pow(js,e),new sn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sn(Ai(this.r),Ai(this.g),Ai(this.b),Cf(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:Ew,formatHex:Ew,formatHex8:D4,formatRgb:Cw,toString:Cw}));function Ew(){return`#${Ti(this.r)}${Ti(this.g)}${Ti(this.b)}`}function D4(){return`#${Ti(this.r)}${Ti(this.g)}${Ti(this.b)}${Ti((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cw(){const e=Cf(this.opacity);return`${e===1?"rgb(":"rgba("}${Ai(this.r)}, ${Ai(this.g)}, ${Ai(this.b)}${e===1?")":`, ${e})`}`}function Cf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ai(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ti(e){return e=Ai(e),(e<16?"0":"")+e.toString(16)}function Nw(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Qn(e,t,r,i)}function WN(e){if(e instanceof Qn)return new Qn(e.h,e.s,e.l,e.opacity);if(e instanceof Zs||(e=Ii(e)),!e)return new Qn;if(e instanceof Qn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,l=Math.min(t,r,i),s=Math.max(t,r,i),c=NaN,f=s-l,h=(s+l)/2;return f?(t===s?c=(r-i)/f+(r<i)*6:r===s?c=(i-t)/f+2:c=(t-r)/f+4,f/=h<.5?s+l:2-s-l,c*=60):f=h>0&&h<1?0:c,new Qn(c,f,h,e.opacity)}function z4(e,t,r,i){return arguments.length===1?WN(e):new Qn(e,t,r,i??1)}function Qn(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}ly(Qn,z4,GN(Zs,{brighter(e){return e=e==null?Ef:Math.pow(Ef,e),new Qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?js:Math.pow(js,e),new Qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,l=2*r-i;return new sn(ep(e>=240?e-240:e+120,l,i),ep(e,l,i),ep(e<120?e+240:e-120,l,i),this.opacity)},clamp(){return new Qn(_w(this.h),Hu(this.s),Hu(this.l),Cf(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=Cf(this.opacity);return`${e===1?"hsl(":"hsla("}${_w(this.h)}, ${Hu(this.s)*100}%, ${Hu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _w(e){return e=(e||0)%360,e<0?e+360:e}function Hu(e){return Math.max(0,Math.min(1,e||0))}function ep(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ay=e=>()=>e;function L4(e,t){return function(r){return e+r*t}}function I4(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function B4(e){return(e=+e)==1?ZN:function(t,r){return r-t?I4(t,r,e):ay(isNaN(t)?r:t)}}function ZN(e,t){var r=t-e;return r?L4(e,r):ay(isNaN(e)?t:e)}const Nf=(function e(t){var r=B4(t);function i(l,s){var c=r((l=Fp(l)).r,(s=Fp(s)).r),f=r(l.g,s.g),h=r(l.b,s.b),d=ZN(l.opacity,s.opacity);return function(m){return l.r=c(m),l.g=f(m),l.b=h(m),l.opacity=d(m),l+""}}return i.gamma=e,i})(1);function H4(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,i=t.slice(),l;return function(s){for(l=0;l<r;++l)i[l]=e[l]*(1-s)+t[l]*s;return i}}function P4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function U4(e,t){var r=t?t.length:0,i=e?Math.min(r,e.length):0,l=new Array(i),s=new Array(r),c;for(c=0;c<i;++c)l[c]=xs(e[c],t[c]);for(;c<r;++c)s[c]=t[c];return function(f){for(c=0;c<i;++c)s[c]=l[c](f);return s}}function V4(e,t){var r=new Date;return e=+e,t=+t,function(i){return r.setTime(e*(1-i)+t*i),r}}function pr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function $4(e,t){var r={},i={},l;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(l in t)l in e?r[l]=xs(e[l],t[l]):i[l]=t[l];return function(s){for(l in r)i[l]=r[l](s);return i}}var Xp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tp=new RegExp(Xp.source,"g");function Y4(e){return function(){return e}}function q4(e){return function(t){return e(t)+""}}function KN(e,t){var r=Xp.lastIndex=tp.lastIndex=0,i,l,s,c=-1,f=[],h=[];for(e=e+"",t=t+"";(i=Xp.exec(e))&&(l=tp.exec(t));)(s=l.index)>r&&(s=t.slice(r,s),f[c]?f[c]+=s:f[++c]=s),(i=i[0])===(l=l[0])?f[c]?f[c]+=l:f[++c]=l:(f[++c]=null,h.push({i:c,x:pr(i,l)})),r=tp.lastIndex;return r<t.length&&(s=t.slice(r),f[c]?f[c]+=s:f[++c]=s),f.length<2?h[0]?q4(h[0].x):Y4(t):(t=h.length,function(d){for(var m=0,g;m<t;++m)f[(g=h[m]).i]=g.x(d);return f.join("")})}function xs(e,t){var r=typeof t,i;return t==null||r==="boolean"?ay(t):(r==="number"?pr:r==="string"?(i=Ii(t))?(t=i,Nf):KN:t instanceof Ii?Nf:t instanceof Date?V4:P4(t)?H4:Array.isArray(t)?U4:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?$4:pr)(e,t)}var kw=180/Math.PI,Gp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function QN(e,t,r,i,l,s){var c,f,h;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(h=e*r+t*i)&&(r-=e*h,i-=t*h),(f=Math.sqrt(r*r+i*i))&&(r/=f,i/=f,h/=f),e*i<t*r&&(e=-e,t=-t,h=-h,c=-c),{translateX:l,translateY:s,rotate:Math.atan2(t,e)*kw,skewX:Math.atan(h)*kw,scaleX:c,scaleY:f}}var Pu;function F4(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Gp:QN(t.a,t.b,t.c,t.d,t.e,t.f)}function X4(e){return e==null||(Pu||(Pu=document.createElementNS("http://www.w3.org/2000/svg","g")),Pu.setAttribute("transform",e),!(e=Pu.transform.baseVal.consolidate()))?Gp:(e=e.matrix,QN(e.a,e.b,e.c,e.d,e.e,e.f))}function JN(e,t,r,i){function l(d){return d.length?d.pop()+" ":""}function s(d,m,g,x,b,E){if(d!==g||m!==x){var S=b.push("translate(",null,t,null,r);E.push({i:S-4,x:pr(d,g)},{i:S-2,x:pr(m,x)})}else(g||x)&&b.push("translate("+g+t+x+r)}function c(d,m,g,x){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),x.push({i:g.push(l(g)+"rotate(",null,i)-2,x:pr(d,m)})):m&&g.push(l(g)+"rotate("+m+i)}function f(d,m,g,x){d!==m?x.push({i:g.push(l(g)+"skewX(",null,i)-2,x:pr(d,m)}):m&&g.push(l(g)+"skewX("+m+i)}function h(d,m,g,x,b,E){if(d!==g||m!==x){var S=b.push(l(b)+"scale(",null,",",null,")");E.push({i:S-4,x:pr(d,g)},{i:S-2,x:pr(m,x)})}else(g!==1||x!==1)&&b.push(l(b)+"scale("+g+","+x+")")}return function(d,m){var g=[],x=[];return d=e(d),m=e(m),s(d.translateX,d.translateY,m.translateX,m.translateY,g,x),c(d.rotate,m.rotate,g,x),f(d.skewX,m.skewX,g,x),h(d.scaleX,d.scaleY,m.scaleX,m.scaleY,g,x),d=m=null,function(b){for(var E=-1,S=x.length,_;++E<S;)g[(_=x[E]).i]=_.x(b);return g.join("")}}}var G4=JN(F4,"px, ","px)","deg)"),W4=JN(X4,", ",")",")"),Z4=1e-12;function Tw(e){return((e=Math.exp(e))+1/e)/2}function K4(e){return((e=Math.exp(e))-1/e)/2}function Q4(e){return((e=Math.exp(2*e))-1)/(e+1)}const nf=(function e(t,r,i){function l(s,c){var f=s[0],h=s[1],d=s[2],m=c[0],g=c[1],x=c[2],b=m-f,E=g-h,S=b*b+E*E,_,N;if(S<Z4)N=Math.log(x/d)/t,_=function(L){return[f+L*b,h+L*E,d*Math.exp(t*L*N)]};else{var k=Math.sqrt(S),C=(x*x-d*d+i*S)/(2*d*r*k),A=(x*x-d*d-i*S)/(2*x*r*k),z=Math.log(Math.sqrt(C*C+1)-C),j=Math.log(Math.sqrt(A*A+1)-A);N=(j-z)/t,_=function(L){var P=L*N,H=Tw(z),X=d/(r*k)*(H*Q4(t*P+z)-K4(z));return[f+X*b,h+X*E,d*H/Tw(t*P+z)]}}return _.duration=N*1e3*t/Math.SQRT2,_}return l.rho=function(s){var c=Math.max(.001,+s),f=c*c,h=f*f;return e(c,f,h)},l})(Math.SQRT2,2,4);var Wl=0,gs=0,cs=0,e_=1e3,_f,ys,kf=0,Bi=0,ed=0,Os=typeof performance=="object"&&performance.now?performance:Date,t_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sy(){return Bi||(t_(J4),Bi=Os.now()+ed)}function J4(){Bi=0}function Tf(){this._call=this._time=this._next=null}Tf.prototype=n_.prototype={constructor:Tf,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?sy():+r)+(t==null?0:+t),!this._next&&ys!==this&&(ys?ys._next=this:_f=this,ys=this),this._call=e,this._time=r,Wp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wp())}};function n_(e,t,r){var i=new Tf;return i.restart(e,t,r),i}function eI(){sy(),++Wl;for(var e=_f,t;e;)(t=Bi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wl}function Aw(){Bi=(kf=Os.now())+ed,Wl=gs=0;try{eI()}finally{Wl=0,nI(),Bi=0}}function tI(){var e=Os.now(),t=e-kf;t>e_&&(ed-=t,kf=e)}function nI(){for(var e,t=_f,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:_f=r);ys=e,Wp(i)}function Wp(e){if(!Wl){gs&&(gs=clearTimeout(gs));var t=e-Bi;t>24?(e<1/0&&(gs=setTimeout(Aw,e-Os.now()-ed)),cs&&(cs=clearInterval(cs))):(cs||(kf=Os.now(),cs=setInterval(tI,e_)),Wl=1,t_(Aw))}}function Rw(e,t,r){var i=new Tf;return t=t==null?0:+t,i.restart(l=>{i.stop(),e(l+t)},t,r),i}var rI=Qf("start","end","cancel","interrupt"),oI=[],r_=0,jw=1,Zp=2,rf=3,Mw=4,Kp=5,of=6;function td(e,t,r,i,l,s){var c=e.__transition;if(!c)e.__transition={};else if(r in c)return;iI(e,r,{name:t,index:i,group:l,on:rI,tween:oI,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:r_})}function cy(e,t){var r=lr(e,t);if(r.state>r_)throw new Error("too late; already scheduled");return r}function Rr(e,t){var r=lr(e,t);if(r.state>rf)throw new Error("too late; already running");return r}function lr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function iI(e,t,r){var i=e.__transition,l;i[t]=r,r.timer=n_(s,0,r.time);function s(d){r.state=jw,r.timer.restart(c,r.delay,r.time),r.delay<=d&&c(d-r.delay)}function c(d){var m,g,x,b;if(r.state!==jw)return h();for(m in i)if(b=i[m],b.name===r.name){if(b.state===rf)return Rw(c);b.state===Mw?(b.state=of,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete i[m]):+m<t&&(b.state=of,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete i[m])}if(Rw(function(){r.state===rf&&(r.state=Mw,r.timer.restart(f,r.delay,r.time),f(d))}),r.state=Zp,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Zp){for(r.state=rf,l=new Array(x=r.tween.length),m=0,g=-1;m<x;++m)(b=r.tween[m].value.call(e,e.__data__,r.index,r.group))&&(l[++g]=b);l.length=g+1}}function f(d){for(var m=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(h),r.state=Kp,1),g=-1,x=l.length;++g<x;)l[g].call(e,m);r.state===Kp&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=of,r.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function lf(e,t){var r=e.__transition,i,l,s=!0,c;if(r){t=t==null?null:t+"";for(c in r){if((i=r[c]).name!==t){s=!1;continue}l=i.state>Zp&&i.state<Kp,i.state=of,i.timer.stop(),i.on.call(l?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[c]}s&&delete e.__transition}}function lI(e){return this.each(function(){lf(this,e)})}function aI(e,t){var r,i;return function(){var l=Rr(this,e),s=l.tween;if(s!==r){i=r=s;for(var c=0,f=i.length;c<f;++c)if(i[c].name===t){i=i.slice(),i.splice(c,1);break}}l.tween=i}}function sI(e,t,r){var i,l;if(typeof r!="function")throw new Error;return function(){var s=Rr(this,e),c=s.tween;if(c!==i){l=(i=c).slice();for(var f={name:t,value:r},h=0,d=l.length;h<d;++h)if(l[h].name===t){l[h]=f;break}h===d&&l.push(f)}s.tween=l}}function cI(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=lr(this.node(),r).tween,l=0,s=i.length,c;l<s;++l)if((c=i[l]).name===e)return c.value;return null}return this.each((t==null?aI:sI)(r,e,t))}function uy(e,t,r){var i=e._id;return e.each(function(){var l=Rr(this,i);(l.value||(l.value={}))[t]=r.apply(this,arguments)}),function(l){return lr(l,i).value[t]}}function o_(e,t){var r;return(typeof t=="number"?pr:t instanceof Ii?Nf:(r=Ii(t))?(t=r,Nf):KN)(e,t)}function uI(e){return function(){this.removeAttribute(e)}}function fI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dI(e,t,r){var i,l=r+"",s;return function(){var c=this.getAttribute(e);return c===l?null:c===i?s:s=t(i=c,r)}}function hI(e,t,r){var i,l=r+"",s;return function(){var c=this.getAttributeNS(e.space,e.local);return c===l?null:c===i?s:s=t(i=c,r)}}function mI(e,t,r){var i,l,s;return function(){var c,f=r(this),h;return f==null?void this.removeAttribute(e):(c=this.getAttribute(e),h=f+"",c===h?null:c===i&&h===l?s:(l=h,s=t(i=c,f)))}}function pI(e,t,r){var i,l,s;return function(){var c,f=r(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),h=f+"",c===h?null:c===i&&h===l?s:(l=h,s=t(i=c,f)))}}function gI(e,t){var r=Jf(e),i=r==="transform"?W4:o_;return this.attrTween(e,typeof t=="function"?(r.local?pI:mI)(r,i,uy(this,"attr."+e,t)):t==null?(r.local?fI:uI)(r):(r.local?hI:dI)(r,i,t))}function yI(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function xI(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function vI(e,t){var r,i;function l(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&xI(e,s)),r}return l._value=t,l}function bI(e,t){var r,i;function l(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&yI(e,s)),r}return l._value=t,l}function wI(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=Jf(e);return this.tween(r,(i.local?vI:bI)(i,t))}function SI(e,t){return function(){cy(this,e).delay=+t.apply(this,arguments)}}function EI(e,t){return t=+t,function(){cy(this,e).delay=t}}function CI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?SI:EI)(t,e)):lr(this.node(),t).delay}function NI(e,t){return function(){Rr(this,e).duration=+t.apply(this,arguments)}}function _I(e,t){return t=+t,function(){Rr(this,e).duration=t}}function kI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?NI:_I)(t,e)):lr(this.node(),t).duration}function TI(e,t){if(typeof t!="function")throw new Error;return function(){Rr(this,e).ease=t}}function AI(e){var t=this._id;return arguments.length?this.each(TI(t,e)):lr(this.node(),t).ease}function RI(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Rr(this,e).ease=r}}function jI(e){if(typeof e!="function")throw new Error;return this.each(RI(this._id,e))}function MI(e){typeof e!="function"&&(e=zN(e));for(var t=this._groups,r=t.length,i=new Array(r),l=0;l<r;++l)for(var s=t[l],c=s.length,f=i[l]=[],h,d=0;d<c;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new uo(i,this._parents,this._name,this._id)}function OI(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,l=r.length,s=Math.min(i,l),c=new Array(i),f=0;f<s;++f)for(var h=t[f],d=r[f],m=h.length,g=c[f]=new Array(m),x,b=0;b<m;++b)(x=h[b]||d[b])&&(g[b]=x);for(;f<i;++f)c[f]=t[f];return new uo(c,this._parents,this._name,this._id)}function DI(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function zI(e,t,r){var i,l,s=DI(t)?cy:Rr;return function(){var c=s(this,e),f=c.on;f!==i&&(l=(i=f).copy()).on(t,r),c.on=l}}function LI(e,t){var r=this._id;return arguments.length<2?lr(this.node(),r).on.on(e):this.each(zI(r,e,t))}function II(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function BI(){return this.on("end.remove",II(this._id))}function HI(e){var t=this._name,r=this._id;typeof e!="function"&&(e=oy(e));for(var i=this._groups,l=i.length,s=new Array(l),c=0;c<l;++c)for(var f=i[c],h=f.length,d=s[c]=new Array(h),m,g,x=0;x<h;++x)(m=f[x])&&(g=e.call(m,m.__data__,x,f))&&("__data__"in m&&(g.__data__=m.__data__),d[x]=g,td(d[x],t,r,x,d,lr(m,r)));return new uo(s,this._parents,t,r)}function PI(e){var t=this._name,r=this._id;typeof e!="function"&&(e=DN(e));for(var i=this._groups,l=i.length,s=[],c=[],f=0;f<l;++f)for(var h=i[f],d=h.length,m,g=0;g<d;++g)if(m=h[g]){for(var x=e.call(m,m.__data__,g,h),b,E=lr(m,r),S=0,_=x.length;S<_;++S)(b=x[S])&&td(b,t,r,S,x,E);s.push(x),c.push(m)}return new uo(s,c,t,r)}var UI=Ws.prototype.constructor;function VI(){return new UI(this._groups,this._parents)}function $I(e,t){var r,i,l;return function(){var s=Gl(this,e),c=(this.style.removeProperty(e),Gl(this,e));return s===c?null:s===r&&c===i?l:l=t(r=s,i=c)}}function i_(e){return function(){this.style.removeProperty(e)}}function YI(e,t,r){var i,l=r+"",s;return function(){var c=Gl(this,e);return c===l?null:c===i?s:s=t(i=c,r)}}function qI(e,t,r){var i,l,s;return function(){var c=Gl(this,e),f=r(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),Gl(this,e))),c===h?null:c===i&&h===l?s:(l=h,s=t(i=c,f))}}function FI(e,t){var r,i,l,s="style."+t,c="end."+s,f;return function(){var h=Rr(this,e),d=h.on,m=h.value[s]==null?f||(f=i_(t)):void 0;(d!==r||l!==m)&&(i=(r=d).copy()).on(c,l=m),h.on=i}}function XI(e,t,r){var i=(e+="")=="transform"?G4:o_;return t==null?this.styleTween(e,$I(e,i)).on("end.style."+e,i_(e)):typeof t=="function"?this.styleTween(e,qI(e,i,uy(this,"style."+e,t))).each(FI(this._id,e)):this.styleTween(e,YI(e,i,t),r).on("end.style."+e,null)}function GI(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function WI(e,t,r){var i,l;function s(){var c=t.apply(this,arguments);return c!==l&&(i=(l=c)&&GI(e,c,r)),i}return s._value=t,s}function ZI(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,WI(e,t,r??""))}function KI(e){return function(){this.textContent=e}}function QI(e){return function(){var t=e(this);this.textContent=t??""}}function JI(e){return this.tween("text",typeof e=="function"?QI(uy(this,"text",e)):KI(e==null?"":e+""))}function e6(e){return function(t){this.textContent=e.call(this,t)}}function t6(e){var t,r;function i(){var l=e.apply(this,arguments);return l!==r&&(t=(r=l)&&e6(l)),t}return i._value=e,i}function n6(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,t6(e))}function r6(){for(var e=this._name,t=this._id,r=l_(),i=this._groups,l=i.length,s=0;s<l;++s)for(var c=i[s],f=c.length,h,d=0;d<f;++d)if(h=c[d]){var m=lr(h,t);td(h,e,r,d,c,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new uo(i,this._parents,e,r)}function o6(){var e,t,r=this,i=r._id,l=r.size();return new Promise(function(s,c){var f={value:c},h={value:function(){--l===0&&s()}};r.each(function(){var d=Rr(this,i),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),d.on=t}),l===0&&s()})}var i6=0;function uo(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function l_(){return++i6}var to=Ws.prototype;uo.prototype={constructor:uo,select:HI,selectAll:PI,selectChild:to.selectChild,selectChildren:to.selectChildren,filter:MI,merge:OI,selection:VI,transition:r6,call:to.call,nodes:to.nodes,node:to.node,size:to.size,empty:to.empty,each:to.each,on:LI,attr:gI,attrTween:wI,style:XI,styleTween:ZI,text:JI,textTween:n6,remove:BI,tween:cI,delay:CI,duration:kI,ease:AI,easeVarying:jI,end:o6,[Symbol.iterator]:to[Symbol.iterator]};function l6(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var a6={time:null,delay:0,duration:250,ease:l6};function s6(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function c6(e){var t,r;e instanceof uo?(t=e._id,e=e._name):(t=l_(),(r=a6).time=sy(),e=e==null?null:e+"");for(var i=this._groups,l=i.length,s=0;s<l;++s)for(var c=i[s],f=c.length,h,d=0;d<f;++d)(h=c[d])&&td(h,e,t,d,c,r||s6(h,t));return new uo(i,this._parents,e,t)}Ws.prototype.interrupt=lI;Ws.prototype.transition=c6;const Uu=e=>()=>e;function u6(e,{sourceEvent:t,target:r,transform:i,dispatch:l}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:l}})}function oo(e,t,r){this.k=e,this.x=t,this.y=r}oo.prototype={constructor:oo,scale:function(e){return e===1?this:new oo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new oo(this.k,this.x+this.k*e,this.y+this.k*t)},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 nd=new oo(1,0,0);a_.prototype=oo.prototype;function a_(e){for(;!e.__zoom;)if(!(e=e.parentNode))return nd;return e.__zoom}function np(e){e.stopImmediatePropagation()}function us(e){e.preventDefault(),e.stopImmediatePropagation()}function f6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function d6(){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 Ow(){return this.__zoom||nd}function h6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function m6(){return navigator.maxTouchPoints||"ontouchstart"in this}function p6(e,t,r){var i=e.invertX(t[0][0])-r[0][0],l=e.invertX(t[1][0])-r[1][0],s=e.invertY(t[0][1])-r[0][1],c=e.invertY(t[1][1])-r[1][1];return e.translate(l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l),c>s?(s+c)/2:Math.min(0,s)||Math.max(0,c))}function s_(){var e=f6,t=d6,r=p6,i=h6,l=m6,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,h=nf,d=Qf("start","zoom","end"),m,g,x,b=500,E=150,S=0,_=10;function N(O){O.property("__zoom",Ow).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",X).filter(l).on("touchstart.zoom",q).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(O,U,R,V){var $=O.selection?O.selection():O;$.property("__zoom",Ow),O!==$?z(O,U,R,V):$.interrupt().each(function(){j(this,arguments).event(V).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},N.scaleBy=function(O,U,R,V){N.scaleTo(O,function(){var $=this.__zoom.k,W=typeof U=="function"?U.apply(this,arguments):U;return $*W},R,V)},N.scaleTo=function(O,U,R,V){N.transform(O,function(){var $=t.apply(this,arguments),W=this.__zoom,M=R==null?A($):typeof R=="function"?R.apply(this,arguments):R,B=W.invert(M),G=typeof U=="function"?U.apply(this,arguments):U;return r(C(k(W,G),M,B),$,c)},R,V)},N.translateBy=function(O,U,R,V){N.transform(O,function(){return r(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),c)},null,V)},N.translateTo=function(O,U,R,V,$){N.transform(O,function(){var W=t.apply(this,arguments),M=this.__zoom,B=V==null?A(W):typeof V=="function"?V.apply(this,arguments):V;return r(nd.translate(B[0],B[1]).scale(M.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof R=="function"?-R.apply(this,arguments):-R),W,c)},V,$)};function k(O,U){return U=Math.max(s[0],Math.min(s[1],U)),U===O.k?O:new oo(U,O.x,O.y)}function C(O,U,R){var V=U[0]-R[0]*O.k,$=U[1]-R[1]*O.k;return V===O.x&&$===O.y?O:new oo(O.k,V,$)}function A(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function z(O,U,R,V){O.on("start.zoom",function(){j(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){j(this,arguments).event(V).end()}).tween("zoom",function(){var $=this,W=arguments,M=j($,W).event(V),B=t.apply($,W),G=R==null?A(B):typeof R=="function"?R.apply($,W):R,D=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),oe=$.__zoom,K=typeof U=="function"?U.apply($,W):U,J=h(oe.invert(G).concat(D/oe.k),K.invert(G).concat(D/K.k));return function(te){if(te===1)te=K;else{var ne=J(te),se=D/ne[2];te=new oo(se,G[0]-ne[0]*se,G[1]-ne[1]*se)}M.zoom(null,te)}})}function j(O,U,R){return!R&&O.__zooming||new L(O,U)}function L(O,U){this.that=O,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,U),this.taps=0}L.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,U){return this.mouse&&O!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var U=Sn(this.that).datum();d.call(O,this.that,new u6(O,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:d}),U)}};function P(O,...U){if(!e.apply(this,arguments))return;var R=j(this,U).event(O),V=this.__zoom,$=Math.max(s[0],Math.min(s[1],V.k*Math.pow(2,i.apply(this,arguments)))),W=Zn(O);if(R.wheel)(R.mouse[0][0]!==W[0]||R.mouse[0][1]!==W[1])&&(R.mouse[1]=V.invert(R.mouse[0]=W)),clearTimeout(R.wheel);else{if(V.k===$)return;R.mouse=[W,V.invert(W)],lf(this),R.start()}us(O),R.wheel=setTimeout(M,E),R.zoom("mouse",r(C(k(V,$),R.mouse[0],R.mouse[1]),R.extent,c));function M(){R.wheel=null,R.end()}}function H(O,...U){if(x||!e.apply(this,arguments))return;var R=O.currentTarget,V=j(this,U,!0).event(O),$=Sn(O.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",D,!0),W=Zn(O,R),M=O.clientX,B=O.clientY;qN(O.view),np(O),V.mouse=[W,this.__zoom.invert(W)],lf(this),V.start();function G(oe){if(us(oe),!V.moved){var K=oe.clientX-M,J=oe.clientY-B;V.moved=K*K+J*J>S}V.event(oe).zoom("mouse",r(C(V.that.__zoom,V.mouse[0]=Zn(oe,R),V.mouse[1]),V.extent,c))}function D(oe){$.on("mousemove.zoom mouseup.zoom",null),FN(oe.view,V.moved),us(oe),V.event(oe).end()}}function X(O,...U){if(e.apply(this,arguments)){var R=this.__zoom,V=Zn(O.changedTouches?O.changedTouches[0]:O,this),$=R.invert(V),W=R.k*(O.shiftKey?.5:2),M=r(C(k(R,W),V,$),t.apply(this,U),c);us(O),f>0?Sn(this).transition().duration(f).call(z,M,V,O):Sn(this).call(N.transform,M,V,O)}}function q(O,...U){if(e.apply(this,arguments)){var R=O.touches,V=R.length,$=j(this,U,O.changedTouches.length===V).event(O),W,M,B,G;for(np(O),M=0;M<V;++M)B=R[M],G=Zn(B,this),G=[G,this.__zoom.invert(G),B.identifier],$.touch0?!$.touch1&&$.touch0[2]!==G[2]&&($.touch1=G,$.taps=0):($.touch0=G,W=!0,$.taps=1+!!m);m&&(m=clearTimeout(m)),W&&($.taps<2&&(g=G[0],m=setTimeout(function(){m=null},b)),lf(this),$.start())}}function Y(O,...U){if(this.__zooming){var R=j(this,U).event(O),V=O.changedTouches,$=V.length,W,M,B,G;for(us(O),W=0;W<$;++W)M=V[W],B=Zn(M,this),R.touch0&&R.touch0[2]===M.identifier?R.touch0[0]=B:R.touch1&&R.touch1[2]===M.identifier&&(R.touch1[0]=B);if(M=R.that.__zoom,R.touch1){var D=R.touch0[0],oe=R.touch0[1],K=R.touch1[0],J=R.touch1[1],te=(te=K[0]-D[0])*te+(te=K[1]-D[1])*te,ne=(ne=J[0]-oe[0])*ne+(ne=J[1]-oe[1])*ne;M=k(M,Math.sqrt(te/ne)),B=[(D[0]+K[0])/2,(D[1]+K[1])/2],G=[(oe[0]+J[0])/2,(oe[1]+J[1])/2]}else if(R.touch0)B=R.touch0[0],G=R.touch0[1];else return;R.zoom("touch",r(C(M,B,G),R.extent,c))}}function F(O,...U){if(this.__zooming){var R=j(this,U).event(O),V=O.changedTouches,$=V.length,W,M;for(np(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),W=0;W<$;++W)M=V[W],R.touch0&&R.touch0[2]===M.identifier?delete R.touch0:R.touch1&&R.touch1[2]===M.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(M=Zn(M,this),Math.hypot(g[0]-M[0],g[1]-M[1])<_)){var B=Sn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return N.wheelDelta=function(O){return arguments.length?(i=typeof O=="function"?O:Uu(+O),N):i},N.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Uu(!!O),N):e},N.touchable=function(O){return arguments.length?(l=typeof O=="function"?O:Uu(!!O),N):l},N.extent=function(O){return arguments.length?(t=typeof O=="function"?O:Uu([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),N):t},N.scaleExtent=function(O){return arguments.length?(s[0]=+O[0],s[1]=+O[1],N):[s[0],s[1]]},N.translateExtent=function(O){return arguments.length?(c[0][0]=+O[0][0],c[1][0]=+O[1][0],c[0][1]=+O[0][1],c[1][1]=+O[1][1],N):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},N.constrain=function(O){return arguments.length?(r=O,N):r},N.duration=function(O){return arguments.length?(f=+O,N):f},N.interpolate=function(O){return arguments.length?(h=O,N):h},N.on=function(){var O=d.on.apply(d,arguments);return O===d?N:O},N.clickDistance=function(O){return arguments.length?(S=(O=+O)*O,N):Math.sqrt(S)},N.tapDistance=function(O){return arguments.length?(_=+O,N):_},N}const Cr={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,{id:t,sourceHandle:r,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:i}", edge id: ${t}.`,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.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Ds=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],c_=["Enter"," ","Escape"],u_={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Zl;(function(e){e.Strict="strict",e.Loose="loose"})(Zl||(Zl={}));var Ri;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ri||(Ri={}));var zs;(function(e){e.Partial="partial",e.Full="full"})(zs||(zs={}));const f_={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Wo;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Wo||(Wo={}));var Ls;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ls||(Ls={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));const Dw={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top};function d_(e){return e===null?null:e?"valid":"invalid"}const h_=e=>"id"in e&&"source"in e&&"target"in e,g6=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),fy=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ks=(e,t=[0,0])=>{const{width:r,height:i}=ho(e),l=e.origin??t,s=r*l[0],c=i*l[1];return{x:e.position.x-s,y:e.position.y-c}},y6=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((i,l)=>{const s=typeof l=="string";let c=!t.nodeLookup&&!s?l:void 0;t.nodeLookup&&(c=s?t.nodeLookup.get(l):fy(l)?l:t.nodeLookup.get(l.id));const f=c?Af(c,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return rd(i,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return od(r)},Qs=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(l=>{(t.filter===void 0||t.filter(l))&&(r=rd(r,Af(l)),i=!0)}),i?od(r):{x:0,y:0,width:0,height:0}},dy=(e,t,[r,i,l]=[0,0,1],s=!1,c=!1)=>{const f={...ec(t,[r,i,l]),width:t.width/l,height:t.height/l},h=[];for(const d of e.values()){const{measured:m,selectable:g=!0,hidden:x=!1}=d;if(c&&!g||x)continue;const b=m.width??d.width??d.initialWidth??null,E=m.height??d.height??d.initialHeight??null,S=Is(f,Ql(d)),_=(b??0)*(E??0),N=s&&S>0;(!d.internals.handleBounds||N||S>=_||d.dragging)&&h.push(d)}return h},x6=(e,t)=>{const r=new Set;return e.forEach(i=>{r.add(i.id)}),t.filter(i=>r.has(i.source)||r.has(i.target))};function v6(e,t){const r=new Map,i=t?.nodes?new Set(t.nodes.map(l=>l.id)):null;return e.forEach(l=>{l.measured.width&&l.measured.height&&(t?.includeHiddenNodes||!l.hidden)&&(!i||i.has(l.id))&&r.set(l.id,l)}),r}async function b6({nodes:e,width:t,height:r,panZoom:i,minZoom:l,maxZoom:s},c){if(e.size===0)return Promise.resolve(!0);const f=v6(e,c),h=Qs(f),d=hy(h,t,r,c?.minZoom??l,c?.maxZoom??s,c?.padding??.1);return await i.setViewport(d,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),Promise.resolve(!0)}function m_({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:i=[0,0],nodeExtent:l,onError:s}){const c=r.get(e),f=c.parentId?r.get(c.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},m=c.origin??i;let g=c.extent||l;if(c.extent==="parent"&&!c.expandParent)if(!f)s?.("005",Cr.error005());else{const b=f.measured.width,E=f.measured.height;b&&E&&(g=[[h,d],[h+b,d+E]])}else f&&Jl(c.extent)&&(g=[[c.extent[0][0]+h,c.extent[0][1]+d],[c.extent[1][0]+h,c.extent[1][1]+d]]);const x=Jl(g)?Hi(t,g,c.measured):t;return(c.measured.width===void 0||c.measured.height===void 0)&&s?.("015",Cr.error015()),{position:{x:x.x-h+(c.measured.width??0)*m[0],y:x.y-d+(c.measured.height??0)*m[1]},positionAbsolute:x}}async function w6({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:i,onBeforeDelete:l}){const s=new Set(e.map(x=>x.id)),c=[];for(const x of r){if(x.deletable===!1)continue;const b=s.has(x.id),E=!b&&x.parentId&&c.find(S=>S.id===x.parentId);(b||E)&&c.push(x)}const f=new Set(t.map(x=>x.id)),h=i.filter(x=>x.deletable!==!1),m=x6(c,h);for(const x of h)f.has(x.id)&&!m.find(E=>E.id===x.id)&&m.push(x);if(!l)return{edges:m,nodes:c};const g=await l({nodes:c,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:c}:{edges:[],nodes:[]}:g}const Kl=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),Hi=(e={x:0,y:0},t,r)=>({x:Kl(e.x,t[0][0],t[1][0]-(r?.width??0)),y:Kl(e.y,t[0][1],t[1][1]-(r?.height??0))});function p_(e,t,r){const{width:i,height:l}=ho(r),{x:s,y:c}=r.internals.positionAbsolute;return Hi(e,[[s,c],[s+i,c+l]],t)}const zw=(e,t,r)=>e<t?Kl(Math.abs(e-t),1,t)/t:e>r?-Kl(Math.abs(e-r),1,t)/t:0,g_=(e,t,r=15,i=40)=>{const l=zw(e.x,i,t.width-i)*r,s=zw(e.y,i,t.height-i)*r;return[l,s]},rd=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Qp=({x:e,y:t,width:r,height:i})=>({x:e,y:t,x2:e+r,y2:t+i}),od=({x:e,y:t,x2:r,y2:i})=>({x:e,y:t,width:r-e,height:i-t}),Ql=(e,t=[0,0])=>{const{x:r,y:i}=fy(e)?e.internals.positionAbsolute:Ks(e,t);return{x:r,y:i,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Af=(e,t=[0,0])=>{const{x:r,y:i}=fy(e)?e.internals.positionAbsolute:Ks(e,t);return{x:r,y:i,x2:r+(e.measured?.width??e.width??e.initialWidth??0),y2:i+(e.measured?.height??e.height??e.initialHeight??0)}},y_=(e,t)=>od(rd(Qp(e),Qp(t))),Is=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*i)},Lw=e=>Jn(e.width)&&Jn(e.height)&&Jn(e.x)&&Jn(e.y),Jn=e=>!isNaN(e)&&isFinite(e),S6=(e,t)=>{},Js=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ec=({x:e,y:t},[r,i,l],s=!1,c=[1,1])=>{const f={x:(e-r)/l,y:(t-i)/l};return s?Js(f,c):f},Rf=({x:e,y:t},[r,i,l])=>({x:e*l+r,y:t*l+i});function Ol(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function E6(e,t,r){if(typeof e=="string"||typeof e=="number"){const i=Ol(e,r),l=Ol(e,t);return{top:i,right:l,bottom:i,left:l,x:l*2,y:i*2}}if(typeof e=="object"){const i=Ol(e.top??e.y??0,r),l=Ol(e.bottom??e.y??0,r),s=Ol(e.left??e.x??0,t),c=Ol(e.right??e.x??0,t);return{top:i,right:c,bottom:l,left:s,x:s+c,y:i+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function C6(e,t,r,i,l,s){const{x:c,y:f}=Rf(e,[t,r,i]),{x:h,y:d}=Rf({x:e.x+e.width,y:e.y+e.height},[t,r,i]),m=l-h,g=s-d;return{left:Math.floor(c),top:Math.floor(f),right:Math.floor(m),bottom:Math.floor(g)}}const hy=(e,t,r,i,l,s)=>{const c=E6(s,t,r),f=(t-c.x)/e.width,h=(r-c.y)/e.height,d=Math.min(f,h),m=Kl(d,i,l),g=e.x+e.width/2,x=e.y+e.height/2,b=t/2-g*m,E=r/2-x*m,S=C6(e,b,E,m,t,r),_={left:Math.min(S.left-c.left,0),top:Math.min(S.top-c.top,0),right:Math.min(S.right-c.right,0),bottom:Math.min(S.bottom-c.bottom,0)};return{x:b-_.left+_.right,y:E-_.top+_.bottom,zoom:m}},Bs=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Jl(e){return e!=null&&e!=="parent"}function ho(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function x_(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function v_(e,t={width:0,height:0},r,i,l){const s={...e},c=i.get(r);if(c){const f=c.origin||l;s.x+=c.internals.positionAbsolute.x-(t.width??0)*f[0],s.y+=c.internals.positionAbsolute.y-(t.height??0)*f[1]}return s}function Iw(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function N6(){let e,t;return{promise:new Promise((i,l)=>{e=i,t=l}),resolve:e,reject:t}}function _6(e){return{...u_,...e||{}}}function vs(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:i,containerBounds:l}){const{x:s,y:c}=er(e),f=ec({x:s-(l?.left??0),y:c-(l?.top??0)},i),{x:h,y:d}=r?Js(f,t):f;return{xSnapped:h,ySnapped:d,...f}}const my=e=>({width:e.offsetWidth,height:e.offsetHeight}),b_=e=>e?.getRootNode?.()||window?.document,k6=["INPUT","SELECT","TEXTAREA"];function w_(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:k6.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const S_=e=>"clientX"in e,er=(e,t)=>{const r=S_(e),i=r?e.clientX:e.touches?.[0].clientX,l=r?e.clientY:e.touches?.[0].clientY;return{x:i-(t?.left??0),y:l-(t?.top??0)}},Bw=(e,t,r,i,l)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(c=>{const f=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:l,position:c.getAttribute("data-handlepos"),x:(f.left-r.left)/i,y:(f.top-r.top)/i,...my(c)}})};function E_({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:f}){const h=e*.125+l*.375+c*.375+r*.125,d=t*.125+s*.375+f*.375+i*.125,m=Math.abs(h-e),g=Math.abs(d-t);return[h,d,m,g]}function Vu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Hw({pos:e,x1:t,y1:r,x2:i,y2:l,c:s}){switch(e){case Ce.Left:return[t-Vu(t-i,s),r];case Ce.Right:return[t+Vu(i-t,s),r];case Ce.Top:return[t,r-Vu(r-l,s)];case Ce.Bottom:return[t,r+Vu(l-r,s)]}}function C_({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:i,targetY:l,targetPosition:s=Ce.Top,curvature:c=.25}){const[f,h]=Hw({pos:r,x1:e,y1:t,x2:i,y2:l,c}),[d,m]=Hw({pos:s,x1:i,y1:l,x2:e,y2:t,c}),[g,x,b,E]=E_({sourceX:e,sourceY:t,targetX:i,targetY:l,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:m});return[`M${e},${t} C${f},${h} ${d},${m} ${i},${l}`,g,x,b,E]}function N_({sourceX:e,sourceY:t,targetX:r,targetY:i}){const l=Math.abs(r-e)/2,s=r<e?r+l:r-l,c=Math.abs(i-t)/2,f=i<t?i+c:i-c;return[s,f,l,c]}function T6({sourceNode:e,targetNode:t,selected:r=!1,zIndex:i=0,elevateOnSelect:l=!1,zIndexMode:s="basic"}){if(s==="manual")return i;const c=l&&r?i+1e3:i,f=Math.max(e.parentId||l&&e.selected?e.internals.z:0,t.parentId||l&&t.selected?t.internals.z:0);return c+f}function A6({sourceNode:e,targetNode:t,width:r,height:i,transform:l}){const s=rd(Af(e),Af(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const c={x:-l[0]/l[2],y:-l[1]/l[2],width:r/l[2],height:i/l[2]};return Is(c,od(s))>0}const R6=({source:e,sourceHandle:t,target:r,targetHandle:i})=>`xy-edge__${e}${t||""}-${r}${i||""}`,j6=(e,t)=>t.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)),M6=(e,t,r={})=>{if(!e.source||!e.target)return t;const i=r.getEdgeId||R6;let l;return h_(e)?l={...e}:l={...e,id:i(e)},j6(l,t)?t:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,t.concat(l))};function __({sourceX:e,sourceY:t,targetX:r,targetY:i}){const[l,s,c,f]=N_({sourceX:e,sourceY:t,targetX:r,targetY:i});return[`M ${e},${t}L ${r},${i}`,l,s,c,f]}const Pw={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},O6=({source:e,sourcePosition:t=Ce.Bottom,target:r})=>t===Ce.Left||t===Ce.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},Uw=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function D6({source:e,sourcePosition:t=Ce.Bottom,target:r,targetPosition:i=Ce.Top,center:l,offset:s,stepPosition:c}){const f=Pw[t],h=Pw[i],d={x:e.x+f.x*s,y:e.y+f.y*s},m={x:r.x+h.x*s,y:r.y+h.y*s},g=O6({source:d,sourcePosition:t,target:m}),x=g.x!==0?"x":"y",b=g[x];let E=[],S,_;const N={x:0,y:0},k={x:0,y:0},[,,C,A]=N_({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(f[x]*h[x]===-1){x==="x"?(S=l.x??d.x+(m.x-d.x)*c,_=l.y??(d.y+m.y)/2):(S=l.x??(d.x+m.x)/2,_=l.y??d.y+(m.y-d.y)*c);const j=[{x:S,y:d.y},{x:S,y:m.y}],L=[{x:d.x,y:_},{x:m.x,y:_}];f[x]===b?E=x==="x"?j:L:E=x==="x"?L:j}else{const j=[{x:d.x,y:m.y}],L=[{x:m.x,y:d.y}];if(x==="x"?E=f.x===b?L:j:E=f.y===b?j:L,t===i){const Y=Math.abs(e[x]-r[x]);if(Y<=s){const F=Math.min(s-1,s-Y);f[x]===b?N[x]=(d[x]>e[x]?-1:1)*F:k[x]=(m[x]>r[x]?-1:1)*F}}if(t!==i){const Y=x==="x"?"y":"x",F=f[x]===h[Y],O=d[Y]>m[Y],U=d[Y]<m[Y];(f[x]===1&&(!F&&O||F&&U)||f[x]!==1&&(!F&&U||F&&O))&&(E=x==="x"?j:L)}const P={x:d.x+N.x,y:d.y+N.y},H={x:m.x+k.x,y:m.y+k.y},X=Math.max(Math.abs(P.x-E[0].x),Math.abs(H.x-E[0].x)),q=Math.max(Math.abs(P.y-E[0].y),Math.abs(H.y-E[0].y));X>=q?(S=(P.x+H.x)/2,_=E[0].y):(S=E[0].x,_=(P.y+H.y)/2)}return[[e,{x:d.x+N.x,y:d.y+N.y},...E,{x:m.x+k.x,y:m.y+k.y},r],S,_,C,A]}function z6(e,t,r,i){const l=Math.min(Uw(e,t)/2,Uw(t,r)/2,i),{x:s,y:c}=t;if(e.x===s&&s===r.x||e.y===c&&c===r.y)return`L${s} ${c}`;if(e.y===c){const d=e.x<r.x?-1:1,m=e.y<r.y?1:-1;return`L ${s+l*d},${c}Q ${s},${c} ${s},${c+l*m}`}const f=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${s},${c+l*h}Q ${s},${c} ${s+l*f},${c}`}function Jp({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:i,targetY:l,targetPosition:s=Ce.Top,borderRadius:c=5,centerX:f,centerY:h,offset:d=20,stepPosition:m=.5}){const[g,x,b,E,S]=D6({source:{x:e,y:t},sourcePosition:r,target:{x:i,y:l},targetPosition:s,center:{x:f,y:h},offset:d,stepPosition:m});return[g.reduce((N,k,C)=>{let A="";return C>0&&C<g.length-1?A=z6(g[C-1],k,g[C+1],c):A=`${C===0?"M":"L"}${k.x} ${k.y}`,N+=A,N},""),x,b,E,S]}function Vw(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function L6(e){const{sourceNode:t,targetNode:r}=e;if(!Vw(t)||!Vw(r))return null;const i=t.internals.handleBounds||$w(t.handles),l=r.internals.handleBounds||$w(r.handles),s=Yw(i?.source??[],e.sourceHandle),c=Yw(e.connectionMode===Zl.Strict?l?.target??[]:(l?.target??[]).concat(l?.source??[]),e.targetHandle);if(!s||!c)return e.onError?.("008",Cr.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=s?.position||Ce.Bottom,h=c?.position||Ce.Top,d=Pi(t,s,f),m=Pi(r,c,h);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:f,targetPosition:h}}function $w(e){if(!e)return null;const t=[],r=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&r.push(i);return{source:t,target:r}}function Pi(e,t,r=Ce.Left,i=!1){const l=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:c,height:f}=t??ho(e);if(i)return{x:l+c/2,y:s+f/2};switch(t?.position??r){case Ce.Top:return{x:l+c/2,y:s};case Ce.Right:return{x:l+c,y:s+f/2};case Ce.Bottom:return{x:l+c/2,y:s+f};case Ce.Left:return{x:l,y:s+f/2}}}function Yw(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function eg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function I6(e,{id:t,defaultColor:r,defaultMarkerStart:i,defaultMarkerEnd:l}){const s=new Set;return e.reduce((c,f)=>([f.markerStart||i,f.markerEnd||l].forEach(h=>{if(h&&typeof h=="object"){const d=eg(h,t);s.has(d)||(c.push({id:d,color:h.color||r,...h}),s.add(d))}}),c),[]).sort((c,f)=>c.id.localeCompare(f.id))}const k_=1e3,B6=10,py={nodeOrigin:[0,0],nodeExtent:Ds,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},H6={...py,checkEquality:!0};function gy(e,t){const r={...e};for(const i in t)t[i]!==void 0&&(r[i]=t[i]);return r}function P6(e,t,r){const i=gy(py,r);for(const l of e.values())if(l.parentId)xy(l,e,t,i);else{const s=Ks(l,i.nodeOrigin),c=Jl(l.extent)?l.extent:i.nodeExtent,f=Hi(s,c,ho(l));l.internals.positionAbsolute=f}}function U6(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const r=[],i=[];for(const l of e.handles){const s={id:l.id,width:l.width??1,height:l.height??1,nodeId:e.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?r.push(s):l.type==="target"&&i.push(s)}return{source:r,target:i}}function yy(e){return e==="manual"}function tg(e,t,r,i={}){const l=gy(H6,i),s={i:0},c=new Map(t),f=l?.elevateNodesOnSelect&&!yy(l.zIndexMode)?k_:0;let h=e.length>0;t.clear(),r.clear();for(const d of e){let m=c.get(d.id);if(l.checkEquality&&d===m?.internals.userNode)t.set(d.id,m);else{const g=Ks(d,l.nodeOrigin),x=Jl(d.extent)?d.extent:l.nodeExtent,b=Hi(g,x,ho(d));m={...l.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:b,handleBounds:U6(d,m),z:T_(d,f,l.zIndexMode),userNode:d}},t.set(d.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(h=!1),d.parentId&&xy(m,t,r,i,s)}return h}function V6(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function xy(e,t,r,i,l){const{elevateNodesOnSelect:s,nodeOrigin:c,nodeExtent:f,zIndexMode:h}=gy(py,i),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}V6(e,r),l&&!m.parentId&&m.internals.rootParentIndex===void 0&&h==="auto"&&(m.internals.rootParentIndex=++l.i,m.internals.z=m.internals.z+l.i*B6),l&&m.internals.rootParentIndex!==void 0&&(l.i=m.internals.rootParentIndex);const g=s&&!yy(h)?k_:0,{x,y:b,z:E}=$6(e,m,c,f,g,h),{positionAbsolute:S}=e.internals,_=x!==S.x||b!==S.y;(_||E!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:_?{x,y:b}:S,z:E}})}function T_(e,t,r){const i=Jn(e.zIndex)?e.zIndex:0;return yy(r)?i:i+(e.selected?t:0)}function $6(e,t,r,i,l,s){const{x:c,y:f}=t.internals.positionAbsolute,h=ho(e),d=Ks(e,r),m=Jl(e.extent)?Hi(d,e.extent,h):d;let g=Hi({x:c+m.x,y:f+m.y},i,h);e.extent==="parent"&&(g=p_(g,h,t));const x=T_(e,l,s),b=t.internals.z??0;return{x:g.x,y:g.y,z:b>=x?b+1:x}}function vy(e,t,r,i=[0,0]){const l=[],s=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const h=s.get(c.parentId)?.expandedRect??Ql(f),d=y_(h,c.rect);s.set(c.parentId,{expandedRect:d,parent:f})}return s.size>0&&s.forEach(({expandedRect:c,parent:f},h)=>{const d=f.internals.positionAbsolute,m=ho(f),g=f.origin??i,x=c.x<d.x?Math.round(Math.abs(d.x-c.x)):0,b=c.y<d.y?Math.round(Math.abs(d.y-c.y)):0,E=Math.max(m.width,Math.round(c.width)),S=Math.max(m.height,Math.round(c.height)),_=(E-m.width)*g[0],N=(S-m.height)*g[1];(x>0||b>0||_||N)&&(l.push({id:h,type:"position",position:{x:f.position.x-x+_,y:f.position.y-b+N}}),r.get(h)?.forEach(k=>{e.some(C=>C.id===k.id)||l.push({id:k.id,type:"position",position:{x:k.position.x+x,y:k.position.y+b}})})),(m.width<c.width||m.height<c.height||x||b)&&l.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:E+(x?g[0]*x-_:0),height:S+(b?g[1]*b-N:0)}})}),l}function Y6(e,t,r,i,l,s,c){const f=i?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],m=window.getComputedStyle(f),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=[];for(const b of e.values()){const E=t.get(b.id);if(!E)continue;if(E.hidden){t.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const S=my(b.nodeElement),_=E.measured.width!==S.width||E.measured.height!==S.height;if(!!(S.width&&S.height&&(_||!E.internals.handleBounds||b.force))){const k=b.nodeElement.getBoundingClientRect(),C=Jl(E.extent)?E.extent:s;let{positionAbsolute:A}=E.internals;E.parentId&&E.extent==="parent"?A=p_(A,S,t.get(E.parentId)):C&&(A=Hi(A,C,S));const z={...E,measured:S,internals:{...E.internals,positionAbsolute:A,handleBounds:{source:Bw("source",b.nodeElement,k,g,E.id),target:Bw("target",b.nodeElement,k,g,E.id)}}};t.set(E.id,z),E.parentId&&xy(z,t,r,{nodeOrigin:l,zIndexMode:c}),h=!0,_&&(d.push({id:E.id,type:"dimensions",dimensions:S}),E.expandParent&&E.parentId&&x.push({id:E.id,parentId:E.parentId,rect:Ql(z,l)}))}}if(x.length>0){const b=vy(x,t,r,l);d.push(...b)}return{changes:d,updatedInternals:h}}async function q6({delta:e,panZoom:t,transform:r,translateExtent:i,width:l,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const c=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[l,s]],i),f=!!c&&(c.x!==r[0]||c.y!==r[1]||c.k!==r[2]);return Promise.resolve(f)}function qw(e,t,r,i,l,s){let c=l;const f=i.get(c)||new Map;i.set(c,f.set(r,t)),c=`${l}-${e}`;const h=i.get(c)||new Map;if(i.set(c,h.set(r,t)),s){c=`${l}-${e}-${s}`;const d=i.get(c)||new Map;i.set(c,d.set(r,t))}}function A_(e,t,r){e.clear(),t.clear();for(const i of r){const{source:l,target:s,sourceHandle:c=null,targetHandle:f=null}=i,h={edgeId:i.id,source:l,target:s,sourceHandle:c,targetHandle:f},d=`${l}-${c}--${s}-${f}`,m=`${s}-${f}--${l}-${c}`;qw("source",h,m,e,l,c),qw("target",h,d,e,s,f),t.set(i.id,i)}}function R_(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:R_(r,t):!1}function Fw(e,t,r){let i=e;do{if(i?.matches?.(t))return!0;if(i===r)return!1;i=i?.parentElement}while(i);return!1}function F6(e,t,r,i){const l=new Map;for(const[s,c]of e)if((c.selected||c.id===i)&&(!c.parentId||!R_(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){const f=e.get(s);f&&l.set(s,{id:s,position:f.position||{x:0,y:0},distance:{x:r.x-f.internals.positionAbsolute.x,y:r.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return l}function rp({nodeId:e,dragItems:t,nodeLookup:r,dragging:i=!0}){const l=[];for(const[c,f]of t){const h=r.get(c)?.internals.userNode;h&&l.push({...h,position:f.position,dragging:i})}if(!e)return[l[0],l];const s=r.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:i}:l[0],l]}function X6({dragItems:e,snapGrid:t,x:r,y:i}){const l=e.values().next().value;if(!l)return null;const s={x:r-l.distance.x,y:i-l.distance.y},c=Js(s,t);return{x:c.x-s.x,y:c.y-s.y}}function G6({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:i,onDragStop:l}){let s={x:null,y:null},c=0,f=new Map,h=!1,d={x:0,y:0},m=null,g=!1,x=null,b=!1,E=!1,S=null;function _({noDragClassName:k,handleSelector:C,domNode:A,isSelectable:z,nodeId:j,nodeClickDistance:L=0}){x=Sn(A);function P({x:Y,y:F}){const{nodeLookup:O,nodeExtent:U,snapGrid:R,snapToGrid:V,nodeOrigin:$,onNodeDrag:W,onSelectionDrag:M,onError:B,updateNodePositions:G}=t();s={x:Y,y:F};let D=!1;const oe=f.size>1,K=oe&&U?Qp(Qs(f)):null,J=oe&&V?X6({dragItems:f,snapGrid:R,x:Y,y:F}):null;for(const[te,ne]of f){if(!O.has(te))continue;let se={x:Y-ne.distance.x,y:F-ne.distance.y};V&&(se=J?{x:Math.round(se.x+J.x),y:Math.round(se.y+J.y)}:Js(se,R));let he=null;if(oe&&U&&!ne.extent&&K){const{positionAbsolute:xe}=ne.internals,_e=xe.x-K.x+U[0][0],$e=xe.x+ne.measured.width-K.x2+U[1][0],Pe=xe.y-K.y+U[0][1],st=xe.y+ne.measured.height-K.y2+U[1][1];he=[[_e,Pe],[$e,st]]}const{position:me,positionAbsolute:ge}=m_({nodeId:te,nextPosition:se,nodeLookup:O,nodeExtent:he||U,nodeOrigin:$,onError:B});D=D||ne.position.x!==me.x||ne.position.y!==me.y,ne.position=me,ne.internals.positionAbsolute=ge}if(E=E||D,!!D&&(G(f,!0),S&&(i||W||!j&&M))){const[te,ne]=rp({nodeId:j,dragItems:f,nodeLookup:O});i?.(S,f,te,ne),W?.(S,te,ne),j||M?.(S,ne)}}async function H(){if(!m)return;const{transform:Y,panBy:F,autoPanSpeed:O,autoPanOnNodeDrag:U}=t();if(!U){h=!1,cancelAnimationFrame(c);return}const[R,V]=g_(d,m,O);(R!==0||V!==0)&&(s.x=(s.x??0)-R/Y[2],s.y=(s.y??0)-V/Y[2],await F({x:R,y:V})&&P(s)),c=requestAnimationFrame(H)}function X(Y){const{nodeLookup:F,multiSelectionActive:O,nodesDraggable:U,transform:R,snapGrid:V,snapToGrid:$,selectNodesOnDrag:W,onNodeDragStart:M,onSelectionDragStart:B,unselectNodesAndEdges:G}=t();g=!0,(!W||!z)&&!O&&j&&(F.get(j)?.selected||G()),z&&W&&j&&e?.(j);const D=vs(Y.sourceEvent,{transform:R,snapGrid:V,snapToGrid:$,containerBounds:m});if(s=D,f=F6(F,U,D,j),f.size>0&&(r||M||!j&&B)){const[oe,K]=rp({nodeId:j,dragItems:f,nodeLookup:F});r?.(Y.sourceEvent,f,oe,K),M?.(Y.sourceEvent,oe,K),j||B?.(Y.sourceEvent,K)}}const q=XN().clickDistance(L).on("start",Y=>{const{domNode:F,nodeDragThreshold:O,transform:U,snapGrid:R,snapToGrid:V}=t();m=F?.getBoundingClientRect()||null,b=!1,E=!1,S=Y.sourceEvent,O===0&&X(Y),s=vs(Y.sourceEvent,{transform:U,snapGrid:R,snapToGrid:V,containerBounds:m}),d=er(Y.sourceEvent,m)}).on("drag",Y=>{const{autoPanOnNodeDrag:F,transform:O,snapGrid:U,snapToGrid:R,nodeDragThreshold:V,nodeLookup:$}=t(),W=vs(Y.sourceEvent,{transform:O,snapGrid:U,snapToGrid:R,containerBounds:m});if(S=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||j&&!$.has(j))&&(b=!0),!b){if(!h&&F&&g&&(h=!0,H()),!g){const M=er(Y.sourceEvent,m),B=M.x-d.x,G=M.y-d.y;Math.sqrt(B*B+G*G)>V&&X(Y)}(s.x!==W.xSnapped||s.y!==W.ySnapped)&&f&&g&&(d=er(Y.sourceEvent,m),P(W))}}).on("end",Y=>{if(!(!g||b)&&(h=!1,g=!1,cancelAnimationFrame(c),f.size>0)){const{nodeLookup:F,updateNodePositions:O,onNodeDragStop:U,onSelectionDragStop:R}=t();if(E&&(O(f,!1),E=!1),l||U||!j&&R){const[V,$]=rp({nodeId:j,dragItems:f,nodeLookup:F,dragging:!1});l?.(Y.sourceEvent,f,V,$),U?.(Y.sourceEvent,V,$),j||R?.(Y.sourceEvent,$)}}}).filter(Y=>{const F=Y.target;return!Y.button&&(!k||!Fw(F,`.${k}`,A))&&(!C||Fw(F,C,A))});x.call(q)}function N(){x?.on(".drag",null)}return{update:_,destroy:N}}function W6(e,t,r){const i=[],l={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const s of t.values())Is(l,Ql(s))>0&&i.push(s);return i}const Z6=250;function K6(e,t,r,i){let l=[],s=1/0;const c=W6(e,r,t+Z6);for(const f of c){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(i.nodeId===d.nodeId&&i.type===d.type&&i.id===d.id)continue;const{x:m,y:g}=Pi(f,d,d.position,!0),x=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(g-e.y,2));x>t||(x<s?(l=[{...d,x:m,y:g}],s=x):x===s&&l.push({...d,x:m,y:g}))}}if(!l.length)return null;if(l.length>1){const f=i.type==="source"?"target":"source";return l.find(h=>h.type===f)??l[0]}return l[0]}function j_(e,t,r,i,l,s=!1){const c=i.get(e);if(!c)return null;const f=l==="strict"?c.internals.handleBounds?.[t]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],h=(r?f?.find(d=>d.id===r):f?.[0])??null;return h&&s?{...h,...Pi(c,h,h.position,!0)}:h}function M_(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Q6(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const O_=()=>!0;function J6(e,{connectionMode:t,connectionRadius:r,handleId:i,nodeId:l,edgeUpdaterType:s,isTarget:c,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:m,flowId:g,panBy:x,cancelConnection:b,onConnectStart:E,onConnect:S,onConnectEnd:_,isValidConnection:N=O_,onReconnectEnd:k,updateConnection:C,getTransform:A,getFromHandle:z,autoPanSpeed:j,dragThreshold:L=1,handleDomNode:P}){const H=b_(e.target);let X=0,q;const{x:Y,y:F}=er(e),O=M_(s,P),U=f?.getBoundingClientRect();let R=!1;if(!U||!O)return;const V=j_(l,O,i,h,t);if(!V)return;let $=er(e,U),W=!1,M=null,B=!1,G=null;function D(){if(!m||!U)return;const[me,ge]=g_($,U,j);x({x:me,y:ge}),X=requestAnimationFrame(D)}const oe={...V,nodeId:l,type:O,position:V.position},K=h.get(l);let te={inProgress:!0,isValid:null,from:Pi(K,oe,Ce.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:K,to:$,toHandle:null,toPosition:Dw[oe.position],toNode:null,pointer:$};function ne(){R=!0,C(te),E?.(e,{nodeId:l,handleId:i,handleType:O})}L===0&&ne();function se(me){if(!R){const{x:st,y:fn}=er(me),Vt=st-Y,Kt=fn-F;if(!(Vt*Vt+Kt*Kt>L*L))return;ne()}if(!z()||!oe){he(me);return}const ge=A();$=er(me,U),q=K6(ec($,ge,!1,[1,1]),r,h,oe),W||(D(),W=!0);const xe=D_(me,{handle:q,connectionMode:t,fromNodeId:l,fromHandleId:i,fromType:c?"target":"source",isValidConnection:N,doc:H,lib:d,flowId:g,nodeLookup:h});G=xe.handleDomNode,M=xe.connection,B=Q6(!!q,xe.isValid);const _e=h.get(l),$e=_e?Pi(_e,oe,Ce.Left,!0):te.from,Pe={...te,from:$e,isValid:B,to:xe.toHandle&&B?Rf({x:xe.toHandle.x,y:xe.toHandle.y},ge):$,toHandle:xe.toHandle,toPosition:B&&xe.toHandle?xe.toHandle.position:Dw[oe.position],toNode:xe.toHandle?h.get(xe.toHandle.nodeId):null,pointer:$};C(Pe),te=Pe}function he(me){if(!("touches"in me&&me.touches.length>0)){if(R){(q||G)&&M&&B&&S?.(M);const{inProgress:ge,...xe}=te,_e={...xe,toPosition:te.toHandle?te.toPosition:null};_?.(me,_e),s&&k?.(me,_e)}b(),cancelAnimationFrame(X),W=!1,B=!1,M=null,G=null,H.removeEventListener("mousemove",se),H.removeEventListener("mouseup",he),H.removeEventListener("touchmove",se),H.removeEventListener("touchend",he)}}H.addEventListener("mousemove",se),H.addEventListener("mouseup",he),H.addEventListener("touchmove",se),H.addEventListener("touchend",he)}function D_(e,{handle:t,connectionMode:r,fromNodeId:i,fromHandleId:l,fromType:s,doc:c,lib:f,flowId:h,isValidConnection:d=O_,nodeLookup:m}){const g=s==="target",x=t?c.querySelector(`.${f}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:b,y:E}=er(e),S=c.elementFromPoint(b,E),_=S?.classList.contains(`${f}-flow__handle`)?S:x,N={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const k=M_(void 0,_),C=_.getAttribute("data-nodeid"),A=_.getAttribute("data-handleid"),z=_.classList.contains("connectable"),j=_.classList.contains("connectableend");if(!C||!k)return N;const L={source:g?C:i,sourceHandle:g?A:l,target:g?i:C,targetHandle:g?l:A};N.connection=L;const H=z&&j&&(r===Zl.Strict?g&&k==="source"||!g&&k==="target":C!==i||A!==l);N.isValid=H&&d(L),N.toHandle=j_(C,k,A,m,r,!0)}return N}const ng={onPointerDown:J6,isValid:D_};function eB({domNode:e,panZoom:t,getTransform:r,getViewScale:i}){const l=Sn(e);function s({translateExtent:f,width:h,height:d,zoomStep:m=1,pannable:g=!0,zoomable:x=!0,inversePan:b=!1}){const E=C=>{if(C.sourceEvent.type!=="wheel"||!t)return;const A=r(),z=C.sourceEvent.ctrlKey&&Bs()?10:1,j=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*m,L=A[2]*Math.pow(2,j*z);t.scaleTo(L)};let S=[0,0];const _=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(S=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},N=C=>{const A=r();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!t)return;const z=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],j=[z[0]-S[0],z[1]-S[1]];S=z;const L=i()*Math.max(A[2],Math.log(A[2]))*(b?-1:1),P={x:A[0]-j[0]*L,y:A[1]-j[1]*L},H=[[0,0],[h,d]];t.setViewportConstrained({x:P.x,y:P.y,zoom:A[2]},H,f)},k=s_().on("start",_).on("zoom",g?N:null).on("zoom.wheel",x?E:null);l.call(k,{})}function c(){l.on("zoom",null)}return{update:s,destroy:c,pointer:Zn}}const id=e=>({x:e.x,y:e.y,zoom:e.k}),op=({x:e,y:t,zoom:r})=>nd.translate(e,t).scale(r),Ll=(e,t)=>e.target.closest(`.${t}`),z_=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),tB=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ip=(e,t=0,r=tB,i=()=>{})=>{const l=typeof t=="number"&&t>0;return l||i(),l?e.transition().duration(t).ease(r).on("end",i):e},L_=e=>{const t=e.ctrlKey&&Bs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function nB({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:i,panOnScrollMode:l,panOnScrollSpeed:s,zoomOnPinch:c,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return m=>{if(Ll(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=r.property("__zoom").k||1;if(m.ctrlKey&&c){const _=Zn(m),N=L_(m),k=g*Math.pow(2,N);i.scaleTo(r,k,_,m);return}const x=m.deltaMode===1?20:1;let b=l===Ri.Vertical?0:m.deltaX*x,E=l===Ri.Horizontal?0:m.deltaY*x;!Bs()&&m.shiftKey&&l!==Ri.Vertical&&(b=m.deltaY*x,E=0),i.translateBy(r,-(b/g)*s,-(E/g)*s,{internal:!0});const S=id(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(m,S),e.panScrollTimeout=setTimeout(()=>{d?.(m,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(m,S))}}function rB({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(i,l){const s=i.type==="wheel",c=!t&&s&&!i.ctrlKey,f=Ll(i,e);if(i.ctrlKey&&s&&f&&i.preventDefault(),c||f)return null;i.preventDefault(),r.call(this,i,l)}}function oB({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return i=>{if(i.sourceEvent?.internal)return;const l=id(i.transform);e.mouseButton=i.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=l,i.sourceEvent?.type==="mousedown"&&t(!0),r&&r?.(i.sourceEvent,l)}}function iB({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:i,onPanZoom:l}){return s=>{e.usedRightMouseButton=!!(r&&z_(t,e.mouseButton??0)),s.sourceEvent?.sync||i([s.transform.x,s.transform.y,s.transform.k]),l&&!s.sourceEvent?.internal&&l?.(s.sourceEvent,id(s.transform))}}function lB({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:i,onPanZoomEnd:l,onPaneContextMenu:s}){return c=>{if(!c.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&z_(t,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&s(c.sourceEvent),e.usedRightMouseButton=!1,i(!1),l)){const f=id(c.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{l?.(c.sourceEvent,f)},r?150:0)}}}function aB({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:i,panOnScroll:l,zoomOnDoubleClick:s,userSelectionActive:c,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:m}){return g=>{const x=e||t,b=r&&g.ctrlKey,E=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Ll(g,`${d}-flow__node`)||Ll(g,`${d}-flow__edge`)))return!0;if(!i&&!x&&!l&&!s&&!r||c||m&&!E||Ll(g,f)&&E||Ll(g,h)&&(!E||l&&E&&!e)||!r&&g.ctrlKey&&E)return!1;if(!r&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!x&&!l&&!b&&E||!i&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(i)&&!i.includes(g.button)&&g.type==="mousedown")return!1;const S=Array.isArray(i)&&i.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||E)&&S}}function sB({domNode:e,minZoom:t,maxZoom:r,translateExtent:i,viewport:l,onPanZoom:s,onPanZoomStart:c,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),g=s_().scaleExtent([t,r]).translateExtent(i),x=Sn(e).call(g);k({x:l.x,y:l.y,zoom:Kl(l.zoom,t,r)},[[0,0],[m.width,m.height]],i);const b=x.on("wheel.zoom"),E=x.on("dblclick.zoom");g.wheelDelta(L_);function S(q,Y){return x?new Promise(F=>{g?.interpolate(Y?.interpolate==="linear"?xs:nf).transform(ip(x,Y?.duration,Y?.ease,()=>F(!0)),q)}):Promise.resolve(!1)}function _({noWheelClassName:q,noPanClassName:Y,onPaneContextMenu:F,userSelectionActive:O,panOnScroll:U,panOnDrag:R,panOnScrollMode:V,panOnScrollSpeed:$,preventScrolling:W,zoomOnPinch:M,zoomOnScroll:B,zoomOnDoubleClick:G,zoomActivationKeyPressed:D,lib:oe,onTransformChange:K,connectionInProgress:J,paneClickDistance:te,selectionOnDrag:ne}){O&&!d.isZoomingOrPanning&&N();const se=U&&!D&&!O;g.clickDistance(ne?1/0:!Jn(te)||te<0?0:te);const he=se?nB({zoomPanValues:d,noWheelClassName:q,d3Selection:x,d3Zoom:g,panOnScrollMode:V,panOnScrollSpeed:$,zoomOnPinch:M,onPanZoomStart:c,onPanZoom:s,onPanZoomEnd:f}):rB({noWheelClassName:q,preventScrolling:W,d3ZoomHandler:b});if(x.on("wheel.zoom",he,{passive:!1}),!O){const ge=oB({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:c});g.on("start",ge);const xe=iB({zoomPanValues:d,panOnDrag:R,onPaneContextMenu:!!F,onPanZoom:s,onTransformChange:K});g.on("zoom",xe);const _e=lB({zoomPanValues:d,panOnDrag:R,panOnScroll:U,onPaneContextMenu:F,onPanZoomEnd:f,onDraggingChange:h});g.on("end",_e)}const me=aB({zoomActivationKeyPressed:D,panOnDrag:R,zoomOnScroll:B,panOnScroll:U,zoomOnDoubleClick:G,zoomOnPinch:M,userSelectionActive:O,noPanClassName:Y,noWheelClassName:q,lib:oe,connectionInProgress:J});g.filter(me),G?x.on("dblclick.zoom",E):x.on("dblclick.zoom",null)}function N(){g.on("zoom",null)}async function k(q,Y,F){const O=op(q),U=g?.constrain()(O,Y,F);return U&&await S(U),new Promise(R=>R(U))}async function C(q,Y){const F=op(q);return await S(F,Y),new Promise(O=>O(F))}function A(q){if(x){const Y=op(q),F=x.property("__zoom");(F.k!==q.zoom||F.x!==q.x||F.y!==q.y)&&g?.transform(x,Y,null,{sync:!0})}}function z(){const q=x?a_(x.node()):{x:0,y:0,k:1};return{x:q.x,y:q.y,zoom:q.k}}function j(q,Y){return x?new Promise(F=>{g?.interpolate(Y?.interpolate==="linear"?xs:nf).scaleTo(ip(x,Y?.duration,Y?.ease,()=>F(!0)),q)}):Promise.resolve(!1)}function L(q,Y){return x?new Promise(F=>{g?.interpolate(Y?.interpolate==="linear"?xs:nf).scaleBy(ip(x,Y?.duration,Y?.ease,()=>F(!0)),q)}):Promise.resolve(!1)}function P(q){g?.scaleExtent(q)}function H(q){g?.translateExtent(q)}function X(q){const Y=!Jn(q)||q<0?0:q;g?.clickDistance(Y)}return{update:_,destroy:N,setViewport:C,setViewportConstrained:k,getViewport:z,scaleTo:j,scaleBy:L,setScaleExtent:P,setTranslateExtent:H,syncViewport:A,setClickDistance:X}}var ea;(function(e){e.Line="line",e.Handle="handle"})(ea||(ea={}));function cB({width:e,prevWidth:t,height:r,prevHeight:i,affectsX:l,affectsY:s}){const c=e-t,f=r-i,h=[c>0?1:c<0?-1:0,f>0?1:f<0?-1:0];return c&&l&&(h[0]=h[0]*-1),f&&s&&(h[1]=h[1]*-1),h}function Xw(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),i=e.includes("left"),l=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:i,affectsY:l}}function qo(e,t){return Math.max(0,t-e)}function Fo(e,t){return Math.max(0,e-t)}function $u(e,t,r){return Math.max(0,t-e,e-r)}function Gw(e,t){return e?!t:t}function uB(e,t,r,i,l,s,c,f){let{affectsX:h,affectsY:d}=t;const{isHorizontal:m,isVertical:g}=t,x=m&&g,{xSnapped:b,ySnapped:E}=r,{minWidth:S,maxWidth:_,minHeight:N,maxHeight:k}=i,{x:C,y:A,width:z,height:j,aspectRatio:L}=e;let P=Math.floor(m?b-e.pointerX:0),H=Math.floor(g?E-e.pointerY:0);const X=z+(h?-P:P),q=j+(d?-H:H),Y=-s[0]*z,F=-s[1]*j;let O=$u(X,S,_),U=$u(q,N,k);if(c){let $=0,W=0;h&&P<0?$=qo(C+P+Y,c[0][0]):!h&&P>0&&($=Fo(C+X+Y,c[1][0])),d&&H<0?W=qo(A+H+F,c[0][1]):!d&&H>0&&(W=Fo(A+q+F,c[1][1])),O=Math.max(O,$),U=Math.max(U,W)}if(f){let $=0,W=0;h&&P>0?$=Fo(C+P,f[0][0]):!h&&P<0&&($=qo(C+X,f[1][0])),d&&H>0?W=Fo(A+H,f[0][1]):!d&&H<0&&(W=qo(A+q,f[1][1])),O=Math.max(O,$),U=Math.max(U,W)}if(l){if(m){const $=$u(X/L,N,k)*L;if(O=Math.max(O,$),c){let W=0;!h&&!d||h&&!d&&x?W=Fo(A+F+X/L,c[1][1])*L:W=qo(A+F+(h?P:-P)/L,c[0][1])*L,O=Math.max(O,W)}if(f){let W=0;!h&&!d||h&&!d&&x?W=qo(A+X/L,f[1][1])*L:W=Fo(A+(h?P:-P)/L,f[0][1])*L,O=Math.max(O,W)}}if(g){const $=$u(q*L,S,_)/L;if(U=Math.max(U,$),c){let W=0;!h&&!d||d&&!h&&x?W=Fo(C+q*L+Y,c[1][0])/L:W=qo(C+(d?H:-H)*L+Y,c[0][0])/L,U=Math.max(U,W)}if(f){let W=0;!h&&!d||d&&!h&&x?W=qo(C+q*L,f[1][0])/L:W=Fo(C+(d?H:-H)*L,f[0][0])/L,U=Math.max(U,W)}}}H=H+(H<0?U:-U),P=P+(P<0?O:-O),l&&(x?X>q*L?H=(Gw(h,d)?-P:P)/L:P=(Gw(h,d)?-H:H)*L:m?(H=P/L,d=h):(P=H*L,h=d));const R=h?C+P:C,V=d?A+H:A;return{width:z+(h?-P:P),height:j+(d?-H:H),x:s[0]*P*(h?-1:1)+R,y:s[1]*H*(d?-1:1)+V}}const I_={width:0,height:0,x:0,y:0},fB={...I_,pointerX:0,pointerY:0,aspectRatio:1};function dB(e){return[[0,0],[e.measured.width,e.measured.height]]}function hB(e,t,r){const i=t.position.x+e.position.x,l=t.position.y+e.position.y,s=e.measured.width??0,c=e.measured.height??0,f=r[0]*s,h=r[1]*c;return[[i-f,l-h],[i+s-f,l+c-h]]}function mB({domNode:e,nodeId:t,getStoreItems:r,onChange:i,onEnd:l}){const s=Sn(e);let c={controlDirection:Xw("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:m,keepAspectRatio:g,resizeDirection:x,onResizeStart:b,onResize:E,onResizeEnd:S,shouldResize:_}){let N={...I_},k={...fB};c={boundaries:m,resizeDirection:x,keepAspectRatio:g,controlDirection:Xw(d)};let C,A=null,z=[],j,L,P,H=!1;const X=XN().on("start",q=>{const{nodeLookup:Y,transform:F,snapGrid:O,snapToGrid:U,nodeOrigin:R,paneDomNode:V}=r();if(C=Y.get(t),!C)return;A=V?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:W}=vs(q.sourceEvent,{transform:F,snapGrid:O,snapToGrid:U,containerBounds:A});N={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},k={...N,pointerX:$,pointerY:W,aspectRatio:N.width/N.height},j=void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(j=Y.get(C.parentId),L=j&&C.extent==="parent"?dB(j):void 0),z=[],P=void 0;for(const[M,B]of Y)if(B.parentId===t&&(z.push({id:M,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const G=hB(B,C,B.origin??R);P?P=[[Math.min(G[0][0],P[0][0]),Math.min(G[0][1],P[0][1])],[Math.max(G[1][0],P[1][0]),Math.max(G[1][1],P[1][1])]]:P=G}b?.(q,{...N})}).on("drag",q=>{const{transform:Y,snapGrid:F,snapToGrid:O,nodeOrigin:U}=r(),R=vs(q.sourceEvent,{transform:Y,snapGrid:F,snapToGrid:O,containerBounds:A}),V=[];if(!C)return;const{x:$,y:W,width:M,height:B}=N,G={},D=C.origin??U,{width:oe,height:K,x:J,y:te}=uB(k,c.controlDirection,R,c.boundaries,c.keepAspectRatio,D,L,P),ne=oe!==M,se=K!==B,he=J!==$&&ne,me=te!==W&&se;if(!he&&!me&&!ne&&!se)return;if((he||me||D[0]===1||D[1]===1)&&(G.x=he?J:N.x,G.y=me?te:N.y,N.x=G.x,N.y=G.y,z.length>0)){const $e=J-$,Pe=te-W;for(const st of z)st.position={x:st.position.x-$e+D[0]*(oe-M),y:st.position.y-Pe+D[1]*(K-B)},V.push(st)}if((ne||se)&&(G.width=ne&&(!c.resizeDirection||c.resizeDirection==="horizontal")?oe:N.width,G.height=se&&(!c.resizeDirection||c.resizeDirection==="vertical")?K:N.height,N.width=G.width,N.height=G.height),j&&C.expandParent){const $e=D[0]*(G.width??0);G.x&&G.x<$e&&(N.x=$e,k.x=k.x-(G.x-$e));const Pe=D[1]*(G.height??0);G.y&&G.y<Pe&&(N.y=Pe,k.y=k.y-(G.y-Pe))}const ge=cB({width:N.width,prevWidth:M,height:N.height,prevHeight:B,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),xe={...N,direction:ge};_?.(q,xe)!==!1&&(H=!0,E?.(q,xe),i(G,V))}).on("end",q=>{H&&(S?.(q,{...N}),l?.({...N}),H=!1)});s.call(X)}function h(){s.on(".drag",null)}return{update:f,destroy:h}}var lp={exports:{}},ap={};var Ww;function pB(){if(Ww)return ap;Ww=1;var e=Vs(),t=TO();function r(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var i=typeof Object.is=="function"?Object.is:r,l=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,f=e.useMemo,h=e.useDebugValue;return ap.useSyncExternalStoreWithSelector=function(d,m,g,x,b){var E=s(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=f(function(){function N(j){if(!k){if(k=!0,C=j,j=x(j),b!==void 0&&S.hasValue){var L=S.value;if(b(L,j))return A=L}return A=j}if(L=A,i(C,j))return L;var P=x(j);return b!==void 0&&b(L,P)?(C=j,L):(C=j,A=P)}var k=!1,C,A,z=g===void 0?null:g;return[function(){return N(m())},z===null?void 0:function(){return N(z())}]},[m,g,x,b]);var _=l(d,E[0],E[1]);return c(function(){S.hasValue=!0,S.value=_},[_]),h(_),_},ap}var Zw;function gB(){return Zw||(Zw=1,lp.exports=pB()),lp.exports}var yB=gB();const xB=Us(yB),vB={},Kw=e=>{let t;const r=new Set,i=(m,g)=>{const x=typeof m=="function"?m(t):m;if(!Object.is(x,t)){const b=t;t=g??(typeof x!="object"||x===null)?x:Object.assign({},t,x),r.forEach(E=>E(t,b))}},l=()=>t,h={setState:i,getState:l,getInitialState:()=>d,subscribe:m=>(r.add(m),()=>r.delete(m)),destroy:()=>{(vB?"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()}},d=t=e(i,l,h);return h},bB=e=>e?Kw(e):Kw,{useDebugValue:wB}=no,{useSyncExternalStoreWithSelector:SB}=xB,EB=e=>e;function B_(e,t=EB,r){const i=SB(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return wB(i),i}const Qw=(e,t)=>{const r=bB(e),i=(l,s=t)=>B_(r,l,s);return Object.assign(i,r),i},CB=(e,t)=>e?Qw(e,t):Qw;function ht(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,l]of e)if(!Object.is(l,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const i of r)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const ld=w.createContext(null),NB=ld.Provider,H_=Cr.error001();function Fe(e,t){const r=w.useContext(ld);if(r===null)throw new Error(H_);return B_(r,e,t)}function mt(){const e=w.useContext(ld);if(e===null)throw new Error(H_);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Jw={display:"none"},_B={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},P_="react-flow__node-desc",U_="react-flow__edge-desc",kB="react-flow__aria-live",TB=e=>e.ariaLiveMessage,AB=e=>e.ariaLabelConfig;function RB({rfId:e}){const t=Fe(TB);return p.jsx("div",{id:`${kB}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_B,children:t})}function jB({rfId:e,disableKeyboardA11y:t}){const r=Fe(AB);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${P_}-${e}`,style:Jw,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${U_}-${e}`,style:Jw,children:r["edge.a11yDescription.default"]}),!t&&p.jsx(RB,{rfId:e})]})}const ad=w.forwardRef(({position:e="top-left",children:t,className:r,style:i,...l},s)=>{const c=`${e}`.split("-");return p.jsx("div",{className:At(["react-flow__panel",r,...c]),style:i,ref:s,...l,children:t})});ad.displayName="Panel";function MB({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:p.jsx(ad,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:p.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const OB=e=>{const t=[],r=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&r.push(i);return{selectedNodes:t,selectedEdges:r}},Yu=e=>e.id;function DB(e,t){return ht(e.selectedNodes.map(Yu),t.selectedNodes.map(Yu))&&ht(e.selectedEdges.map(Yu),t.selectedEdges.map(Yu))}function zB({onSelectionChange:e}){const t=mt(),{selectedNodes:r,selectedEdges:i}=Fe(OB,DB);return w.useEffect(()=>{const l={nodes:r,edges:i};e?.(l),t.getState().onSelectionChangeHandlers.forEach(s=>s(l))},[r,i,e]),null}const LB=e=>!!e.onSelectionChangeHandlers;function IB({onSelectionChange:e}){const t=Fe(LB);return e||t?p.jsx(zB,{onSelectionChange:e}):null}const V_=[0,0],BB={x:0,y:0,zoom:1},HB=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],e1=[...HB,"rfId"],PB=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),t1={translateExtent:Ds,nodeOrigin:V_,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function UB(e){const{setNodes:t,setEdges:r,setMinZoom:i,setMaxZoom:l,setTranslateExtent:s,setNodeExtent:c,reset:f,setDefaultNodesAndEdges:h}=Fe(PB,ht),d=mt();w.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{m.current=t1,f()}),[]);const m=w.useRef(t1);return w.useEffect(()=>{for(const g of e1){const x=e[g],b=m.current[g];x!==b&&(typeof e[g]>"u"||(g==="nodes"?t(x):g==="edges"?r(x):g==="minZoom"?i(x):g==="maxZoom"?l(x):g==="translateExtent"?s(x):g==="nodeExtent"?c(x):g==="ariaLabelConfig"?d.setState({ariaLabelConfig:_6(x)}):g==="fitView"?d.setState({fitViewQueued:x}):g==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[g]:x})))}m.current=e},e1.map(g=>e[g])),null}function n1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function VB(e){const[t,r]=w.useState(e==="system"?null:e);return w.useEffect(()=>{if(e!=="system"){r(e);return}const i=n1(),l=()=>r(i?.matches?"dark":"light");return l(),i?.addEventListener("change",l),()=>{i?.removeEventListener("change",l)}},[e]),t!==null?t:n1()?.matches?"dark":"light"}const r1=typeof document<"u"?document:null;function Hs(e=null,t={target:r1,actInsideInputWithModifier:!0}){const[r,i]=w.useState(!1),l=w.useRef(!1),s=w.useRef(new Set([])),[c,f]=w.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),m=d.reduce((g,x)=>g.concat(...x),[]);return[d,m]}return[[],[]]},[e]);return w.useEffect(()=>{const h=t?.target??r1,d=t?.actInsideInputWithModifier??!0;if(e!==null){const m=b=>{if(l.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!l.current||l.current&&!d)&&w_(b))return!1;const S=i1(b.code,f);if(s.current.add(b[S]),o1(c,s.current,!1)){const _=b.composedPath?.()?.[0]||b.target,N=_?.nodeName==="BUTTON"||_?.nodeName==="A";t.preventDefault!==!1&&(l.current||!N)&&b.preventDefault(),i(!0)}},g=b=>{const E=i1(b.code,f);o1(c,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(b[E]),b.key==="Meta"&&s.current.clear(),l.current=!1},x=()=>{s.current.clear(),i(!1)};return h?.addEventListener("keydown",m),h?.addEventListener("keyup",g),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",m),h?.removeEventListener("keyup",g),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,i]),r}function o1(e,t,r){return e.filter(i=>r||i.length===t.size).some(i=>i.every(l=>t.has(l)))}function i1(e,t){return t.includes(e)?"code":"key"}const $B=()=>{const e=mt();return w.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,{duration:r?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[i,l,s],panZoom:c}=e.getState();return c?(await c.setViewport({x:t.x??i,y:t.y??l,zoom:t.zoom??s},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,i]=e.getState().transform;return{x:t,y:r,zoom:i}},setCenter:async(t,r,i)=>e.getState().setCenter(t,r,i),fitBounds:async(t,r)=>{const{width:i,height:l,minZoom:s,maxZoom:c,panZoom:f}=e.getState(),h=hy(t,i,l,s,c,r?.padding??.1);return f?(await f.setViewport(h,{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:i,snapGrid:l,snapToGrid:s,domNode:c}=e.getState();if(!c)return t;const{x:f,y:h}=c.getBoundingClientRect(),d={x:t.x-f,y:t.y-h},m=r.snapGrid??l,g=r.snapToGrid??s;return ec(d,i,g,m)},flowToScreenPosition:t=>{const{transform:r,domNode:i}=e.getState();if(!i)return t;const{x:l,y:s}=i.getBoundingClientRect(),c=Rf(t,r);return{x:c.x+l,y:c.y+s}}}),[])};function $_(e,t){const r=[],i=new Map,l=[];for(const s of e)if(s.type==="add"){l.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const c=i.get(s.id);c?c.push(s):i.set(s.id,[s])}for(const s of t){const c=i.get(s.id);if(!c){r.push(s);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){r.push({...c[0].item});continue}const f={...s};for(const h of c)YB(h,f);r.push(f)}return l.length&&l.forEach(s=>{s.index!==void 0?r.splice(s.index,0,{...s.item}):r.push({...s.item})}),r}function YB(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Y_(e,t){return $_(e,t)}function q_(e,t){return $_(e,t)}function ki(e,t){return{id:e,type:"select",selected:t}}function Il(e,t=new Set,r=!1){const i=[];for(const[l,s]of e){const c=t.has(l);!(s.selected===void 0&&!c)&&s.selected!==c&&(r&&(s.selected=c),i.push(ki(s.id,c)))}return i}function l1({items:e=[],lookup:t}){const r=[],i=new Map(e.map(l=>[l.id,l]));for(const[l,s]of e.entries()){const c=t.get(s.id),f=c?.internals?.userNode??c;f!==void 0&&f!==s&&r.push({id:s.id,item:s,type:"replace"}),f===void 0&&r.push({item:s,type:"add",index:l})}for(const[l]of t)i.get(l)===void 0&&r.push({id:l,type:"remove"});return r}function a1(e){return{id:e.id,type:"remove"}}const s1=e=>g6(e),qB=e=>h_(e);function F_(e){return w.forwardRef(e)}const FB=typeof window<"u"?w.useLayoutEffect:w.useEffect;function c1(e){const[t,r]=w.useState(BigInt(0)),[i]=w.useState(()=>XB(()=>r(l=>l+BigInt(1))));return FB(()=>{const l=i.get();l.length&&(e(l),i.reset())},[t]),i}function XB(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const X_=w.createContext(null);function GB({children:e}){const t=mt(),r=w.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:m,onNodesChange:g,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:E}=t.getState();let S=h;for(const N of f)S=typeof N=="function"?N(S):N;let _=l1({items:S,lookup:x});for(const N of E.values())_=N(_);m&&d(S),_.length>0?g?.(_):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:k,setNodes:C}=t.getState();N&&C(k)})},[]),i=c1(r),l=w.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:x}=t.getState();let b=h;for(const E of f)b=typeof E=="function"?E(b):E;m?d(b):g&&g(l1({items:b,lookup:x}))},[]),s=c1(l),c=w.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return p.jsx(X_.Provider,{value:c,children:e})}function WB(){const e=w.useContext(X_);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const ZB=e=>!!e.panZoom;function sd(){const e=$B(),t=mt(),r=WB(),i=Fe(ZB),l=w.useMemo(()=>{const s=g=>t.getState().nodeLookup.get(g),c=g=>{r.nodeQueue.push(g)},f=g=>{r.edgeQueue.push(g)},h=g=>{const{nodeLookup:x,nodeOrigin:b}=t.getState(),E=s1(g)?g:x.get(g.id),S=E.parentId?v_(E.position,E.measured,E.parentId,x,b):E.position,_={...E,position:S,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return Ql(_)},d=(g,x,b={replace:!1})=>{c(E=>E.map(S=>{if(S.id===g){const _=typeof x=="function"?x(S):x;return b.replace&&s1(_)?_:{...S,..._}}return S}))},m=(g,x,b={replace:!1})=>{f(E=>E.map(S=>{if(S.id===g){const _=typeof x=="function"?x(S):x;return b.replace&&qB(_)?_:{...S,..._}}return S}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>s(g)?.internals.userNode,getInternalNode:s,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(x=>({...x}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:c,setEdges:f,addNodes:g=>{const x=Array.isArray(g)?g:[g];r.nodeQueue.push(b=>[...b,...x])},addEdges:g=>{const x=Array.isArray(g)?g:[g];r.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:g=[],edges:x=[],transform:b}=t.getState(),[E,S,_]=b;return{nodes:g.map(N=>({...N})),edges:x.map(N=>({...N})),viewport:{x:E,y:S,zoom:_}}},deleteElements:async({nodes:g=[],edges:x=[]})=>{const{nodes:b,edges:E,onNodesDelete:S,onEdgesDelete:_,triggerNodeChanges:N,triggerEdgeChanges:k,onDelete:C,onBeforeDelete:A}=t.getState(),{nodes:z,edges:j}=await w6({nodesToRemove:g,edgesToRemove:x,nodes:b,edges:E,onBeforeDelete:A}),L=j.length>0,P=z.length>0;if(L){const H=j.map(a1);_?.(j),k(H)}if(P){const H=z.map(a1);S?.(z),N(H)}return(P||L)&&C?.({nodes:z,edges:j}),{deletedNodes:z,deletedEdges:j}},getIntersectingNodes:(g,x=!0,b)=>{const E=Lw(g),S=E?g:h(g),_=b!==void 0;return S?(b||t.getState().nodes).filter(N=>{const k=t.getState().nodeLookup.get(N.id);if(k&&!E&&(N.id===g.id||!k.internals.positionAbsolute))return!1;const C=Ql(_?N:k),A=Is(C,S);return x&&A>0||A>=C.width*C.height||A>=S.width*S.height}):[]},isNodeIntersecting:(g,x,b=!0)=>{const S=Lw(g)?g:h(g);if(!S)return!1;const _=Is(S,x);return b&&_>0||_>=x.width*x.height||_>=S.width*S.height},updateNode:d,updateNodeData:(g,x,b={replace:!1})=>{d(g,E=>{const S=typeof x=="function"?x(E):x;return b.replace?{...E,data:S}:{...E,data:{...E.data,...S}}},b)},updateEdge:m,updateEdgeData:(g,x,b={replace:!1})=>{m(g,E=>{const S=typeof x=="function"?x(E):x;return b.replace?{...E,data:S}:{...E,data:{...E.data,...S}}},b)},getNodesBounds:g=>{const{nodeLookup:x,nodeOrigin:b}=t.getState();return y6(g,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:g,id:x,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}-${g}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:x,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}${g?x?`-${g}-${x}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const x=t.getState().fitViewResolver??N6();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:x}),r.nodeQueue.push(b=>[...b]),x.promise}}},[]);return w.useMemo(()=>({...l,...e,viewportInitialized:i}),[i])}const u1=e=>e.selected,KB=typeof window<"u"?window:void 0;function QB({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=mt(),{deleteElements:i}=sd(),l=Hs(e,{actInsideInputWithModifier:!1}),s=Hs(t,{target:KB});w.useEffect(()=>{if(l){const{edges:c,nodes:f}=r.getState();i({nodes:f.filter(u1),edges:c.filter(u1)}),r.setState({nodesSelectionActive:!1})}},[l]),w.useEffect(()=>{r.setState({multiSelectionActive:s})},[s])}function JB(e){const t=mt();w.useEffect(()=>{const r=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const i=my(e.current);(i.height===0||i.width===0)&&t.getState().onError?.("004",Cr.error004()),t.setState({width:i.width||500,height:i.height||500})};if(e.current){r(),window.addEventListener("resize",r);const i=new ResizeObserver(()=>r());return i.observe(e.current),()=>{window.removeEventListener("resize",r),i&&e.current&&i.unobserve(e.current)}}},[])}const cd={position:"absolute",width:"100%",height:"100%",top:0,left:0},eH=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function tH({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:i=!1,panOnScrollSpeed:l=.5,panOnScrollMode:s=Ri.Free,zoomOnDoubleClick:c=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:m,maxZoom:g,zoomActivationKeyCode:x,preventScrolling:b=!0,children:E,noWheelClassName:S,noPanClassName:_,onViewportChange:N,isControlledViewport:k,paneClickDistance:C,selectionOnDrag:A}){const z=mt(),j=w.useRef(null),{userSelectionActive:L,lib:P,connectionInProgress:H}=Fe(eH,ht),X=Hs(x),q=w.useRef();JB(j);const Y=w.useCallback(F=>{N?.({x:F[0],y:F[1],zoom:F[2]}),k||z.setState({transform:F})},[N,k]);return w.useEffect(()=>{if(j.current){q.current=sB({domNode:j.current,minZoom:m,maxZoom:g,translateExtent:d,viewport:h,onDraggingChange:R=>z.setState(V=>V.paneDragging===R?V:{paneDragging:R}),onPanZoomStart:(R,V)=>{const{onViewportChangeStart:$,onMoveStart:W}=z.getState();W?.(R,V),$?.(V)},onPanZoom:(R,V)=>{const{onViewportChange:$,onMove:W}=z.getState();W?.(R,V),$?.(V)},onPanZoomEnd:(R,V)=>{const{onViewportChangeEnd:$,onMoveEnd:W}=z.getState();W?.(R,V),$?.(V)}});const{x:F,y:O,zoom:U}=q.current.getViewport();return z.setState({panZoom:q.current,transform:[F,O,U],domNode:j.current.closest(".react-flow")}),()=>{q.current?.destroy()}}},[]),w.useEffect(()=>{q.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:i,panOnScrollSpeed:l,panOnScrollMode:s,zoomOnDoubleClick:c,panOnDrag:f,zoomActivationKeyPressed:X,preventScrolling:b,noPanClassName:_,userSelectionActive:L,noWheelClassName:S,lib:P,onTransformChange:Y,connectionInProgress:H,selectionOnDrag:A,paneClickDistance:C})},[e,t,r,i,l,s,c,f,X,b,_,L,S,P,Y,H,A,C]),p.jsx("div",{className:"react-flow__renderer",ref:j,style:cd,children:E})}const nH=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function rH(){const{userSelectionActive:e,userSelectionRect:t}=Fe(nH,ht);return e&&t?p.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const sp=(e,t)=>r=>{r.target===t.current&&e?.(r)},oH=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function iH({isSelecting:e,selectionKeyPressed:t,selectionMode:r=zs.Full,panOnDrag:i,paneClickDistance:l,selectionOnDrag:s,onSelectionStart:c,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:x,onPaneMouseLeave:b,children:E}){const S=mt(),{userSelectionActive:_,elementsSelectable:N,dragging:k,connectionInProgress:C}=Fe(oH,ht),A=N&&(e||_),z=w.useRef(null),j=w.useRef(),L=w.useRef(new Set),P=w.useRef(new Set),H=w.useRef(!1),X=$=>{if(H.current||C){H.current=!1;return}h?.($),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},q=$=>{if(Array.isArray(i)&&i?.includes(2)){$.preventDefault();return}d?.($)},Y=m?$=>m($):void 0,F=$=>{H.current&&($.stopPropagation(),H.current=!1)},O=$=>{const{domNode:W}=S.getState();if(j.current=W?.getBoundingClientRect(),!j.current)return;const M=$.target===z.current;if(!M&&!!$.target.closest(".nokey")||!e||!(s&&M||t)||$.button!==0||!$.isPrimary)return;$.target?.setPointerCapture?.($.pointerId),H.current=!1;const{x:D,y:oe}=er($.nativeEvent,j.current);S.setState({userSelectionRect:{width:0,height:0,startX:D,startY:oe,x:D,y:oe}}),M||($.stopPropagation(),$.preventDefault())},U=$=>{const{userSelectionRect:W,transform:M,nodeLookup:B,edgeLookup:G,connectionLookup:D,triggerNodeChanges:oe,triggerEdgeChanges:K,defaultEdgeOptions:J,resetSelectedElements:te}=S.getState();if(!j.current||!W)return;const{x:ne,y:se}=er($.nativeEvent,j.current),{startX:he,startY:me}=W;if(!H.current){const Pe=t?0:l;if(Math.hypot(ne-he,se-me)<=Pe)return;te(),c?.($)}H.current=!0;const ge={startX:he,startY:me,x:ne<he?ne:he,y:se<me?se:me,width:Math.abs(ne-he),height:Math.abs(se-me)},xe=L.current,_e=P.current;L.current=new Set(dy(B,ge,M,r===zs.Partial,!0).map(Pe=>Pe.id)),P.current=new Set;const $e=J?.selectable??!0;for(const Pe of L.current){const st=D.get(Pe);if(st)for(const{edgeId:fn}of st.values()){const Vt=G.get(fn);Vt&&(Vt.selectable??$e)&&P.current.add(fn)}}if(!Iw(xe,L.current)){const Pe=Il(B,L.current,!0);oe(Pe)}if(!Iw(_e,P.current)){const Pe=Il(G,P.current);K(Pe)}S.setState({userSelectionRect:ge,userSelectionActive:!0,nodesSelectionActive:!1})},R=$=>{$.button===0&&($.target?.releasePointerCapture?.($.pointerId),!_&&$.target===z.current&&S.getState().userSelectionRect&&X?.($),S.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(f?.($),S.setState({nodesSelectionActive:L.current.size>0})))},V=i===!0||Array.isArray(i)&&i.includes(0);return p.jsxs("div",{className:At(["react-flow__pane",{draggable:V,dragging:k,selection:e}]),onClick:A?void 0:sp(X,z),onContextMenu:sp(q,z),onWheel:sp(Y,z),onPointerEnter:A?void 0:g,onPointerMove:A?U:x,onPointerUp:A?R:void 0,onPointerDownCapture:A?O:void 0,onClickCapture:A?F:void 0,onPointerLeave:b,ref:z,style:cd,children:[E,p.jsx(rH,{})]})}function rg({id:e,store:t,unselect:r=!1,nodeRef:i}){const{addSelectedNodes:l,unselectNodesAndEdges:s,multiSelectionActive:c,nodeLookup:f,onError:h}=t.getState(),d=f.get(e);if(!d){h?.("012",Cr.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(r||d.selected&&c)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>i?.current?.blur())):l([e])}function G_({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:i,nodeId:l,isSelectable:s,nodeClickDistance:c}){const f=mt(),[h,d]=w.useState(!1),m=w.useRef();return w.useEffect(()=>{m.current=G6({getStoreItems:()=>f.getState(),onNodeMouseDown:g=>{rg({id:g,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),w.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:r,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:l,nodeClickDistance:c}),()=>{m.current?.destroy()}},[r,i,t,s,e,l,c]),h}const lH=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function W_(){const e=mt();return w.useCallback(r=>{const{nodeExtent:i,snapToGrid:l,snapGrid:s,nodesDraggable:c,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:m}=e.getState(),g=new Map,x=lH(c),b=l?s[0]:5,E=l?s[1]:5,S=r.direction.x*b*r.factor,_=r.direction.y*E*r.factor;for(const[,N]of d){if(!x(N))continue;let k={x:N.internals.positionAbsolute.x+S,y:N.internals.positionAbsolute.y+_};l&&(k=Js(k,s));const{position:C,positionAbsolute:A}=m_({nodeId:N.id,nextPosition:k,nodeLookup:d,nodeExtent:i,nodeOrigin:m,onError:f});N.position=C,N.internals.positionAbsolute=A,g.set(N.id,N)}h(g)},[])}const by=w.createContext(null),aH=by.Provider;by.Consumer;const Z_=()=>w.useContext(by),sH=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),cH=(e,t,r)=>i=>{const{connectionClickStartHandle:l,connectionMode:s,connection:c}=i,{fromHandle:f,toHandle:h,isValid:d}=c,m=h?.nodeId===e&&h?.id===t&&h?.type===r;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===r,connectingTo:m,clickConnecting:l?.nodeId===e&&l?.id===t&&l?.type===r,isPossibleEndHandle:s===Zl.Strict?f?.type!==r:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!l,valid:m&&d}};function uH({type:e="source",position:t=Ce.Top,isValidConnection:r,isConnectable:i=!0,isConnectableStart:l=!0,isConnectableEnd:s=!0,id:c,onConnect:f,children:h,className:d,onMouseDown:m,onTouchStart:g,...x},b){const E=c||null,S=e==="target",_=mt(),N=Z_(),{connectOnClick:k,noPanClassName:C,rfId:A}=Fe(sH,ht),{connectingFrom:z,connectingTo:j,clickConnecting:L,isPossibleEndHandle:P,connectionInProcess:H,clickConnectionInProcess:X,valid:q}=Fe(cH(N,E,e),ht);N||_.getState().onError?.("010",Cr.error010());const Y=U=>{const{defaultEdgeOptions:R,onConnect:V,hasDefaultEdges:$}=_.getState(),W={...R,...U};if($){const{edges:M,setEdges:B}=_.getState();B(M6(W,M))}V?.(W),f?.(W)},F=U=>{if(!N)return;const R=S_(U.nativeEvent);if(l&&(R&&U.button===0||!R)){const V=_.getState();ng.onPointerDown(U.nativeEvent,{handleDomNode:U.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:S,handleId:E,nodeId:N,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:(...$)=>_.getState().onConnectEnd?.(...$),updateConnection:V.updateConnection,onConnect:Y,isValidConnection:r||((...$)=>_.getState().isValidConnection?.(...$)??!0),getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}R?m?.(U):g?.(U)},O=U=>{const{onClickConnectStart:R,onClickConnectEnd:V,connectionClickStartHandle:$,connectionMode:W,isValidConnection:M,lib:B,rfId:G,nodeLookup:D,connection:oe}=_.getState();if(!N||!$&&!l)return;if(!$){R?.(U.nativeEvent,{nodeId:N,handleId:E,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:N,type:e,id:E}});return}const K=b_(U.target),J=r||M,{connection:te,isValid:ne}=ng.isValid(U.nativeEvent,{handle:{nodeId:N,id:E,type:e},connectionMode:W,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:J,flowId:G,doc:K,lib:B,nodeLookup:D});ne&&te&&Y(te);const se=structuredClone(oe);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,V?.(U,se),_.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":E,"data-nodeid":N,"data-handlepos":t,"data-id":`${A}-${N}-${E}-${e}`,className:At(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,d,{source:!S,target:S,connectable:i,connectablestart:l,connectableend:s,clickconnecting:L,connectingfrom:z,connectingto:j,valid:q,connectionindicator:i&&(!H||P)&&(H||X?s:l)}]),onMouseDown:F,onTouchStart:F,onClick:k?O:void 0,ref:b,...x,children:h})}const ei=w.memo(F_(uH));function fH({data:e,isConnectable:t,sourcePosition:r=Ce.Bottom}){return p.jsxs(p.Fragment,{children:[e?.label,p.jsx(ei,{type:"source",position:r,isConnectable:t})]})}function dH({data:e,isConnectable:t,targetPosition:r=Ce.Top,sourcePosition:i=Ce.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(ei,{type:"target",position:r,isConnectable:t}),e?.label,p.jsx(ei,{type:"source",position:i,isConnectable:t})]})}function hH(){return null}function mH({data:e,isConnectable:t,targetPosition:r=Ce.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(ei,{type:"target",position:r,isConnectable:t}),e?.label]})}const jf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},f1={input:fH,default:dH,output:mH,group:hH};function pH(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const gH=e=>{const{width:t,height:r,x:i,y:l}=Qs(e.nodeLookup,{filter:s=>!!s.selected});return{width:Jn(t)?t:null,height:Jn(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${l}px)`}};function yH({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const i=mt(),{width:l,height:s,transformString:c,userSelectionActive:f}=Fe(gH,ht),h=W_(),d=w.useRef(null);w.useEffect(()=>{r||d.current?.focus({preventScroll:!0})},[r]);const m=!f&&l!==null&&s!==null;if(G_({nodeRef:d,disabled:!m}),!m)return null;const g=e?b=>{const E=i.getState().nodes.filter(S=>S.selected);e(b,E)}:void 0,x=b=>{Object.prototype.hasOwnProperty.call(jf,b.key)&&(b.preventDefault(),h({direction:jf[b.key],factor:b.shiftKey?4:1}))};return p.jsx("div",{className:At(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c},children:p.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:r?void 0:-1,onKeyDown:r?void 0:x,style:{width:l,height:s}})})}const d1=typeof window<"u"?window:void 0,xH=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function K_({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:s,onPaneScroll:c,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:m,selectionMode:g,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:E,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:N,zoomOnScroll:k,zoomOnPinch:C,panOnScroll:A,panOnScrollSpeed:z,panOnScrollMode:j,zoomOnDoubleClick:L,panOnDrag:P,defaultViewport:H,translateExtent:X,minZoom:q,maxZoom:Y,preventScrolling:F,onSelectionContextMenu:O,noWheelClassName:U,noPanClassName:R,disableKeyboardA11y:V,onViewportChange:$,isControlledViewport:W}){const{nodesSelectionActive:M,userSelectionActive:B}=Fe(xH,ht),G=Hs(d,{target:d1}),D=Hs(S,{target:d1}),oe=D||P,K=D||A,J=m&&oe!==!0,te=G||B||J;return QB({deleteKeyCode:h,multiSelectionKeyCode:E}),p.jsx(tH,{onPaneContextMenu:s,elementsSelectable:N,zoomOnScroll:k,zoomOnPinch:C,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:j,zoomOnDoubleClick:L,panOnDrag:!G&&oe,defaultViewport:H,translateExtent:X,minZoom:q,maxZoom:Y,zoomActivationKeyCode:_,preventScrolling:F,noWheelClassName:U,noPanClassName:R,onViewportChange:$,isControlledViewport:W,paneClickDistance:f,selectionOnDrag:J,children:p.jsxs(iH,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:s,onPaneScroll:c,panOnDrag:oe,isSelecting:!!te,selectionMode:g,selectionKeyPressed:G,paneClickDistance:f,selectionOnDrag:J,children:[e,M&&p.jsx(yH,{onSelectionContextMenu:O,noPanClassName:R,disableKeyboardA11y:V})]})})}K_.displayName="FlowRenderer";const vH=w.memo(K_),bH=e=>t=>e?dy(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function wH(e){return Fe(w.useCallback(bH(e),[e]),ht)}const SH=e=>e.updateNodeInternals;function EH(){const e=Fe(SH),[t]=w.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const i=new Map;r.forEach(l=>{const s=l.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:l.target,force:!0})}),e(i)}));return w.useEffect(()=>()=>{t?.disconnect()},[t]),t}function CH({node:e,nodeType:t,hasDimensions:r,resizeObserver:i}){const l=mt(),s=w.useRef(null),c=w.useRef(null),f=w.useRef(e.sourcePosition),h=w.useRef(e.targetPosition),d=w.useRef(t),m=r&&!!e.internals.handleBounds;return w.useEffect(()=>{s.current&&!e.hidden&&(!m||c.current!==s.current)&&(c.current&&i?.unobserve(c.current),i?.observe(s.current),c.current=s.current)},[m,e.hidden]),w.useEffect(()=>()=>{c.current&&(i?.unobserve(c.current),c.current=null)},[]),w.useEffect(()=>{if(s.current){const g=d.current!==t,x=f.current!==e.sourcePosition,b=h.current!==e.targetPosition;(g||x||b)&&(d.current=t,f.current=e.sourcePosition,h.current=e.targetPosition,l.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function NH({id:e,onClick:t,onMouseEnter:r,onMouseMove:i,onMouseLeave:l,onContextMenu:s,onDoubleClick:c,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:m,resizeObserver:g,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:E,rfId:S,nodeTypes:_,nodeClickDistance:N,onError:k}){const{node:C,internals:A,isParent:z}=Fe(ne=>{const se=ne.nodeLookup.get(e),he=ne.parentLookup.has(e);return{node:se,internals:se.internals,isParent:he}},ht);let j=C.type||"default",L=_?.[j]||f1[j];L===void 0&&(k?.("003",Cr.error003(j)),j="default",L=_?.default||f1.default);const P=!!(C.draggable||f&&typeof C.draggable>"u"),H=!!(C.selectable||h&&typeof C.selectable>"u"),X=!!(C.connectable||d&&typeof C.connectable>"u"),q=!!(C.focusable||m&&typeof C.focusable>"u"),Y=mt(),F=x_(C),O=CH({node:C,nodeType:j,hasDimensions:F,resizeObserver:g}),U=G_({nodeRef:O,disabled:C.hidden||!P,noDragClassName:x,handleSelector:C.dragHandle,nodeId:e,isSelectable:H,nodeClickDistance:N}),R=W_();if(C.hidden)return null;const V=ho(C),$=pH(C),W=H||P||t||r||i||l,M=r?ne=>r(ne,{...A.userNode}):void 0,B=i?ne=>i(ne,{...A.userNode}):void 0,G=l?ne=>l(ne,{...A.userNode}):void 0,D=s?ne=>s(ne,{...A.userNode}):void 0,oe=c?ne=>c(ne,{...A.userNode}):void 0,K=ne=>{const{selectNodesOnDrag:se,nodeDragThreshold:he}=Y.getState();H&&(!se||!P||he>0)&&rg({id:e,store:Y,nodeRef:O}),t&&t(ne,{...A.userNode})},J=ne=>{if(!(w_(ne.nativeEvent)||E)){if(c_.includes(ne.key)&&H){const se=ne.key==="Escape";rg({id:e,store:Y,unselect:se,nodeRef:O})}else if(P&&C.selected&&Object.prototype.hasOwnProperty.call(jf,ne.key)){ne.preventDefault();const{ariaLabelConfig:se}=Y.getState();Y.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:ne.key.replace("Arrow","").toLowerCase(),x:~~A.positionAbsolute.x,y:~~A.positionAbsolute.y})}),R({direction:jf[ne.key],factor:ne.shiftKey?4:1})}}},te=()=>{if(E||!O.current?.matches(":focus-visible"))return;const{transform:ne,width:se,height:he,autoPanOnNodeFocus:me,setCenter:ge}=Y.getState();if(!me)return;dy(new Map([[e,C]]),{x:0,y:0,width:se,height:he},ne,!0).length>0||ge(C.position.x+V.width/2,C.position.y+V.height/2,{zoom:ne[2]})};return p.jsx("div",{className:At(["react-flow__node",`react-flow__node-${j}`,{[b]:P},C.className,{selected:C.selected,selectable:H,parent:z,draggable:P,dragging:U}]),ref:O,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:W?"all":"none",visibility:F?"visible":"hidden",...C.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:B,onMouseLeave:G,onContextMenu:D,onClick:K,onDoubleClick:oe,onKeyDown:q?J:void 0,tabIndex:q?0:void 0,onFocus:q?te:void 0,role:C.ariaRole??(q?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${P_}-${S}`,"aria-label":C.ariaLabel,...C.domAttributes,children:p.jsx(aH,{value:e,children:p.jsx(L,{id:e,data:C.data,type:j,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:C.selected??!1,selectable:H,draggable:P,deletable:C.deletable??!0,isConnectable:X,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:U,dragHandle:C.dragHandle,zIndex:A.z,parentId:C.parentId,...V})})})}var _H=w.memo(NH);const kH=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Q_(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:i,elementsSelectable:l,onError:s}=Fe(kH,ht),c=wH(e.onlyRenderVisibleElements),f=EH();return p.jsx("div",{className:"react-flow__nodes",style:cd,children:c.map(h=>p.jsx(_H,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:t,nodesConnectable:r,nodesFocusable:i,elementsSelectable:l,nodeClickDistance:e.nodeClickDistance,onError:s},h))})}Q_.displayName="NodeRenderer";const TH=w.memo(Q_);function AH(e){return Fe(w.useCallback(r=>{if(!e)return r.edges.map(l=>l.id);const i=[];if(r.width&&r.height)for(const l of r.edges){const s=r.nodeLookup.get(l.source),c=r.nodeLookup.get(l.target);s&&c&&A6({sourceNode:s,targetNode:c,width:r.width,height:r.height,transform:r.transform})&&i.push(l.id)}return i},[e]),ht)}const RH=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return p.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},jH=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return p.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},h1={[Ls.Arrow]:RH,[Ls.ArrowClosed]:jH};function MH(e){const t=mt();return w.useMemo(()=>Object.prototype.hasOwnProperty.call(h1,e)?h1[e]:(t.getState().onError?.("009",Cr.error009(e)),null),[e])}const OH=({id:e,type:t,color:r,width:i=12.5,height:l=12.5,markerUnits:s="strokeWidth",strokeWidth:c,orient:f="auto-start-reverse"})=>{const h=MH(t);return h?p.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:f,refX:"0",refY:"0",children:p.jsx(h,{color:r,strokeWidth:c})}):null},J_=({defaultColor:e,rfId:t})=>{const r=Fe(s=>s.edges),i=Fe(s=>s.defaultEdgeOptions),l=w.useMemo(()=>I6(r,{id:t,defaultColor:e,defaultMarkerStart:i?.markerStart,defaultMarkerEnd:i?.markerEnd}),[r,i,t,e]);return l.length?p.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:p.jsx("defs",{children:l.map(s=>p.jsx(OH,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};J_.displayName="MarkerDefinitions";var DH=w.memo(J_);function e2({x:e,y:t,label:r,labelStyle:i,labelShowBg:l=!0,labelBgStyle:s,labelBgPadding:c=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...m}){const[g,x]=w.useState({x:1,y:0,width:0,height:0}),b=At(["react-flow__edge-textwrapper",d]),E=w.useRef(null);return w.useEffect(()=>{if(E.current){const S=E.current.getBBox();x({x:S.x,y:S.y,width:S.width,height:S.height})}},[r]),r?p.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...m,children:[l&&p.jsx("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:s,rx:f,ry:f}),p.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:E,style:i,children:r}),h]}):null}e2.displayName="EdgeText";const zH=w.memo(e2);function ud({path:e,labelX:t,labelY:r,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...m}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...m,d:e,fill:"none",className:At(["react-flow__edge-path",m.className])}),d?p.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,i&&Jn(t)&&Jn(r)?p.jsx(zH,{x:t,y:r,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function m1({pos:e,x1:t,y1:r,x2:i,y2:l}){return e===Ce.Left||e===Ce.Right?[.5*(t+i),r]:[t,.5*(r+l)]}function t2({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:i,targetY:l,targetPosition:s=Ce.Top}){const[c,f]=m1({pos:r,x1:e,y1:t,x2:i,y2:l}),[h,d]=m1({pos:s,x1:i,y1:l,x2:e,y2:t}),[m,g,x,b]=E_({sourceX:e,sourceY:t,targetX:i,targetY:l,sourceControlX:c,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${t} C${c},${f} ${h},${d} ${i},${l}`,m,g,x,b]}function n2(e){return w.memo(({id:t,sourceX:r,sourceY:i,targetX:l,targetY:s,sourcePosition:c,targetPosition:f,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:_,interactionWidth:N})=>{const[k,C,A]=t2({sourceX:r,sourceY:i,sourcePosition:c,targetX:l,targetY:s,targetPosition:f}),z=e.isInternal?void 0:t;return p.jsx(ud,{id:z,path:k,labelX:C,labelY:A,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:_,interactionWidth:N})})}const LH=n2({isInternal:!1}),r2=n2({isInternal:!0});LH.displayName="SimpleBezierEdge";r2.displayName="SimpleBezierEdgeInternal";function o2(e){return w.memo(({id:t,sourceX:r,sourceY:i,targetX:l,targetY:s,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:x,sourcePosition:b=Ce.Bottom,targetPosition:E=Ce.Top,markerEnd:S,markerStart:_,pathOptions:N,interactionWidth:k})=>{const[C,A,z]=Jp({sourceX:r,sourceY:i,sourcePosition:b,targetX:l,targetY:s,targetPosition:E,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),j=e.isInternal?void 0:t;return p.jsx(ud,{id:j,path:C,labelX:A,labelY:z,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:S,markerStart:_,interactionWidth:k})})}const i2=o2({isInternal:!1}),l2=o2({isInternal:!0});i2.displayName="SmoothStepEdge";l2.displayName="SmoothStepEdgeInternal";function a2(e){return w.memo(({id:t,...r})=>{const i=e.isInternal?void 0:t;return p.jsx(i2,{...r,id:i,pathOptions:w.useMemo(()=>({borderRadius:0,offset:r.pathOptions?.offset}),[r.pathOptions?.offset])})})}const IH=a2({isInternal:!1}),s2=a2({isInternal:!0});IH.displayName="StepEdge";s2.displayName="StepEdgeInternal";function c2(e){return w.memo(({id:t,sourceX:r,sourceY:i,targetX:l,targetY:s,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:b,markerStart:E,interactionWidth:S})=>{const[_,N,k]=__({sourceX:r,sourceY:i,targetX:l,targetY:s}),C=e.isInternal?void 0:t;return p.jsx(ud,{id:C,path:_,labelX:N,labelY:k,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:b,markerStart:E,interactionWidth:S})})}const BH=c2({isInternal:!1}),u2=c2({isInternal:!0});BH.displayName="StraightEdge";u2.displayName="StraightEdgeInternal";function f2(e){return w.memo(({id:t,sourceX:r,sourceY:i,targetX:l,targetY:s,sourcePosition:c=Ce.Bottom,targetPosition:f=Ce.Top,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:_,pathOptions:N,interactionWidth:k})=>{const[C,A,z]=C_({sourceX:r,sourceY:i,sourcePosition:c,targetX:l,targetY:s,targetPosition:f,curvature:N?.curvature}),j=e.isInternal?void 0:t;return p.jsx(ud,{id:j,path:C,labelX:A,labelY:z,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:_,interactionWidth:k})})}const HH=f2({isInternal:!1}),d2=f2({isInternal:!0});HH.displayName="BezierEdge";d2.displayName="BezierEdgeInternal";const p1={default:d2,straight:u2,step:s2,smoothstep:l2,simplebezier:r2},g1={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},PH=(e,t,r)=>r===Ce.Left?e-t:r===Ce.Right?e+t:e,UH=(e,t,r)=>r===Ce.Top?e-t:r===Ce.Bottom?e+t:e,y1="react-flow__edgeupdater";function x1({position:e,centerX:t,centerY:r,radius:i=10,onMouseDown:l,onMouseEnter:s,onMouseOut:c,type:f}){return p.jsx("circle",{onMouseDown:l,onMouseEnter:s,onMouseOut:c,className:At([y1,`${y1}-${f}`]),cx:PH(t,i,e),cy:UH(r,i,e),r:i,stroke:"transparent",fill:"transparent"})}function VH({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:i,sourceY:l,targetX:s,targetY:c,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:m,onReconnectEnd:g,setReconnecting:x,setUpdateHover:b}){const E=mt(),S=(A,z)=>{if(A.button!==0)return;const{autoPanOnConnect:j,domNode:L,connectionMode:P,connectionRadius:H,lib:X,onConnectStart:q,cancelConnection:Y,nodeLookup:F,rfId:O,panBy:U,updateConnection:R}=E.getState(),V=z.type==="target",$=(B,G)=>{x(!1),g?.(B,r,z.type,G)},W=B=>d?.(r,B),M=(B,G)=>{x(!0),m?.(A,r,z.type),q?.(B,G)};ng.onPointerDown(A.nativeEvent,{autoPanOnConnect:j,connectionMode:P,connectionRadius:H,domNode:L,handleId:z.id,nodeId:z.nodeId,nodeLookup:F,isTarget:V,edgeUpdaterType:z.type,lib:X,flowId:O,cancelConnection:Y,panBy:U,isValidConnection:(...B)=>E.getState().isValidConnection?.(...B)??!0,onConnect:W,onConnectStart:M,onConnectEnd:(...B)=>E.getState().onConnectEnd?.(...B),onReconnectEnd:$,updateConnection:R,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:A.currentTarget})},_=A=>S(A,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),N=A=>S(A,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),k=()=>b(!0),C=()=>b(!1);return p.jsxs(p.Fragment,{children:[(e===!0||e==="source")&&p.jsx(x1,{position:f,centerX:i,centerY:l,radius:t,onMouseDown:_,onMouseEnter:k,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&p.jsx(x1,{position:h,centerX:s,centerY:c,radius:t,onMouseDown:N,onMouseEnter:k,onMouseOut:C,type:"target"})]})}function $H({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:i,onClick:l,onDoubleClick:s,onContextMenu:c,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:b,rfId:E,edgeTypes:S,noPanClassName:_,onError:N,disableKeyboardA11y:k}){let C=Fe(ge=>ge.edgeLookup.get(e));const A=Fe(ge=>ge.defaultEdgeOptions);C=A?{...A,...C}:C;let z=C.type||"default",j=S?.[z]||p1[z];j===void 0&&(N?.("011",Cr.error011(z)),z="default",j=S?.default||p1.default);const L=!!(C.focusable||t&&typeof C.focusable>"u"),P=typeof g<"u"&&(C.reconnectable||r&&typeof C.reconnectable>"u"),H=!!(C.selectable||i&&typeof C.selectable>"u"),X=w.useRef(null),[q,Y]=w.useState(!1),[F,O]=w.useState(!1),U=mt(),{zIndex:R,sourceX:V,sourceY:$,targetX:W,targetY:M,sourcePosition:B,targetPosition:G}=Fe(w.useCallback(ge=>{const xe=ge.nodeLookup.get(C.source),_e=ge.nodeLookup.get(C.target);if(!xe||!_e)return{zIndex:C.zIndex,...g1};const $e=L6({id:e,sourceNode:xe,targetNode:_e,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:ge.connectionMode,onError:N});return{zIndex:T6({selected:C.selected,zIndex:C.zIndex,sourceNode:xe,targetNode:_e,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...$e||g1}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),ht),D=w.useMemo(()=>C.markerStart?`url('#${eg(C.markerStart,E)}')`:void 0,[C.markerStart,E]),oe=w.useMemo(()=>C.markerEnd?`url('#${eg(C.markerEnd,E)}')`:void 0,[C.markerEnd,E]);if(C.hidden||V===null||$===null||W===null||M===null)return null;const K=ge=>{const{addSelectedEdges:xe,unselectNodesAndEdges:_e,multiSelectionActive:$e}=U.getState();H&&(U.setState({nodesSelectionActive:!1}),C.selected&&$e?(_e({nodes:[],edges:[C]}),X.current?.blur()):xe([e])),l&&l(ge,C)},J=s?ge=>{s(ge,{...C})}:void 0,te=c?ge=>{c(ge,{...C})}:void 0,ne=f?ge=>{f(ge,{...C})}:void 0,se=h?ge=>{h(ge,{...C})}:void 0,he=d?ge=>{d(ge,{...C})}:void 0,me=ge=>{if(!k&&c_.includes(ge.key)&&H){const{unselectNodesAndEdges:xe,addSelectedEdges:_e}=U.getState();ge.key==="Escape"?(X.current?.blur(),xe({edges:[C]})):_e([e])}};return p.jsx("svg",{style:{zIndex:R},children:p.jsxs("g",{className:At(["react-flow__edge",`react-flow__edge-${z}`,C.className,_,{selected:C.selected,animated:C.animated,inactive:!H&&!l,updating:q,selectable:H}]),onClick:K,onDoubleClick:J,onContextMenu:te,onMouseEnter:ne,onMouseMove:se,onMouseLeave:he,onKeyDown:L?me:void 0,tabIndex:L?0:void 0,role:C.ariaRole??(L?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":L?`${U_}-${E}`:void 0,ref:X,...C.domAttributes,children:[!F&&p.jsx(j,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:H,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:V,sourceY:$,targetX:W,targetY:M,sourcePosition:B,targetPosition:G,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:D,markerEnd:oe,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),P&&p.jsx(VH,{edge:C,isReconnectable:P,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:b,sourceX:V,sourceY:$,targetX:W,targetY:M,sourcePosition:B,targetPosition:G,setUpdateHover:Y,setReconnecting:O})]})})}var YH=w.memo($H);const qH=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function h2({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:i,noPanClassName:l,onReconnect:s,onEdgeContextMenu:c,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:E,disableKeyboardA11y:S}){const{edgesFocusable:_,edgesReconnectable:N,elementsSelectable:k,onError:C}=Fe(qH,ht),A=AH(t);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(DH,{defaultColor:e,rfId:r}),A.map(z=>p.jsx(YH,{id:z,edgesFocusable:_,edgesReconnectable:N,elementsSelectable:k,noPanClassName:l,onReconnect:s,onContextMenu:c,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:m,reconnectRadius:g,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:E,rfId:r,onError:C,edgeTypes:i,disableKeyboardA11y:S},z))]})}h2.displayName="EdgeRenderer";const FH=w.memo(h2),XH=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function GH({children:e}){const t=Fe(XH);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function WH(e){const t=sd(),r=w.useRef(!1);w.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const ZH=e=>e.panZoom?.syncViewport;function KH(e){const t=Fe(ZH),r=mt();return w.useEffect(()=>{e&&(t?.(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function QH(e){return e.connection.inProgress?{...e.connection,to:ec(e.connection.to,e.transform)}:{...e.connection}}function JH(e){return QH}function eP(e){const t=JH();return Fe(t,ht)}const tP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function nP({containerStyle:e,style:t,type:r,component:i}){const{nodesConnectable:l,width:s,height:c,isValid:f,inProgress:h}=Fe(tP,ht);return!(s&&l&&h)?null:p.jsx("svg",{style:e,width:s,height:c,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:At(["react-flow__connection",d_(f)]),children:p.jsx(m2,{style:t,type:r,CustomComponent:i,isValid:f})})})}const m2=({style:e,type:t=Wo.Bezier,CustomComponent:r,isValid:i})=>{const{inProgress:l,from:s,fromNode:c,fromHandle:f,fromPosition:h,to:d,toNode:m,toHandle:g,toPosition:x,pointer:b}=eP();if(!l)return;if(r)return p.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:c,fromHandle:f,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:d_(i),toNode:m,toHandle:g,pointer:b});let E="";const S={sourceX:s.x,sourceY:s.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(t){case Wo.Bezier:[E]=C_(S);break;case Wo.SimpleBezier:[E]=t2(S);break;case Wo.Step:[E]=Jp({...S,borderRadius:0});break;case Wo.SmoothStep:[E]=Jp(S);break;default:[E]=__(S)}return p.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:e})};m2.displayName="ConnectionLine";const rP={};function v1(e=rP){w.useRef(e),mt(),w.useEffect(()=>{},[e])}function oP(){mt(),w.useRef(!1),w.useEffect(()=>{},[])}function p2({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:i,onEdgeClick:l,onNodeDoubleClick:s,onEdgeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:b,connectionLineType:E,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:N,selectionKeyCode:k,selectionOnDrag:C,selectionMode:A,multiSelectionKeyCode:z,panActivationKeyCode:j,zoomActivationKeyCode:L,deleteKeyCode:P,onlyRenderVisibleElements:H,elementsSelectable:X,defaultViewport:q,translateExtent:Y,minZoom:F,maxZoom:O,preventScrolling:U,defaultMarkerColor:R,zoomOnScroll:V,zoomOnPinch:$,panOnScroll:W,panOnScrollSpeed:M,panOnScrollMode:B,zoomOnDoubleClick:G,panOnDrag:D,onPaneClick:oe,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:te,onPaneScroll:ne,onPaneContextMenu:se,paneClickDistance:he,nodeClickDistance:me,onEdgeContextMenu:ge,onEdgeMouseEnter:xe,onEdgeMouseMove:_e,onEdgeMouseLeave:$e,reconnectRadius:Pe,onReconnect:st,onReconnectStart:fn,onReconnectEnd:Vt,noDragClassName:Kt,noWheelClassName:Vn,noPanClassName:jr,disableKeyboardA11y:Mr,nodeExtent:Rt,rfId:mo,viewport:ce,onViewportChange:ye}){return v1(e),v1(t),oP(),WH(r),KH(ce),p.jsx(vH,{onPaneClick:oe,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:te,onPaneContextMenu:se,onPaneScroll:ne,paneClickDistance:he,deleteKeyCode:P,selectionKeyCode:k,selectionOnDrag:C,selectionMode:A,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:z,panActivationKeyCode:j,zoomActivationKeyCode:L,elementsSelectable:X,zoomOnScroll:V,zoomOnPinch:$,zoomOnDoubleClick:G,panOnScroll:W,panOnScrollSpeed:M,panOnScrollMode:B,panOnDrag:D,defaultViewport:q,translateExtent:Y,minZoom:F,maxZoom:O,onSelectionContextMenu:g,preventScrolling:U,noDragClassName:Kt,noWheelClassName:Vn,noPanClassName:jr,disableKeyboardA11y:Mr,onViewportChange:ye,isControlledViewport:!!ce,children:p.jsxs(GH,{children:[p.jsx(FH,{edgeTypes:t,onEdgeClick:l,onEdgeDoubleClick:c,onReconnect:st,onReconnectStart:fn,onReconnectEnd:Vt,onlyRenderVisibleElements:H,onEdgeContextMenu:ge,onEdgeMouseEnter:xe,onEdgeMouseMove:_e,onEdgeMouseLeave:$e,reconnectRadius:Pe,defaultMarkerColor:R,noPanClassName:jr,disableKeyboardA11y:Mr,rfId:mo}),p.jsx(nP,{style:S,type:E,component:_,containerStyle:N}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(TH,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:me,onlyRenderVisibleElements:H,noPanClassName:jr,noDragClassName:Kt,disableKeyboardA11y:Mr,nodeExtent:Rt,rfId:mo}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}p2.displayName="GraphView";const iP=w.memo(p2),b1=({nodes:e,edges:t,defaultNodes:r,defaultEdges:i,width:l,height:s,fitView:c,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:g,zIndexMode:x="basic"}={})=>{const b=new Map,E=new Map,S=new Map,_=new Map,N=i??t??[],k=r??e??[],C=m??[0,0],A=g??Ds;A_(S,_,N);const z=tg(k,b,E,{nodeOrigin:C,nodeExtent:A,zIndexMode:x});let j=[0,0,1];if(c&&l&&s){const L=Qs(b,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:P,y:H,zoom:X}=hy(L,l,s,h,d,f?.padding??.1);j=[P,H,X]}return{rfId:"1",width:l??0,height:s??0,transform:j,nodes:k,nodesInitialized:z,nodeLookup:b,parentLookup:E,edges:N,edgeLookup:_,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:Ds,nodeExtent:A,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Zl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:f,fitViewResolver:null,connection:{...f_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:S6,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:u_,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},lP=({nodes:e,edges:t,defaultNodes:r,defaultEdges:i,width:l,height:s,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:m,nodeExtent:g,zIndexMode:x})=>CB((b,E)=>{async function S(){const{nodeLookup:_,panZoom:N,fitViewOptions:k,fitViewResolver:C,width:A,height:z,minZoom:j,maxZoom:L}=E();N&&(await b6({nodes:_,width:A,height:z,panZoom:N,minZoom:j,maxZoom:L},k),C?.resolve(!0),b({fitViewResolver:null}))}return{...b1({nodes:e,edges:t,width:l,height:s,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:m,nodeExtent:g,defaultNodes:r,defaultEdges:i,zIndexMode:x}),setNodes:_=>{const{nodeLookup:N,parentLookup:k,nodeOrigin:C,elevateNodesOnSelect:A,fitViewQueued:z,zIndexMode:j}=E(),L=tg(_,N,k,{nodeOrigin:C,nodeExtent:g,elevateNodesOnSelect:A,checkEquality:!0,zIndexMode:j});z&&L?(S(),b({nodes:_,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:_,nodesInitialized:L})},setEdges:_=>{const{connectionLookup:N,edgeLookup:k}=E();A_(N,k,_),b({edges:_})},setDefaultNodesAndEdges:(_,N)=>{if(_){const{setNodes:k}=E();k(_),b({hasDefaultNodes:!0})}if(N){const{setEdges:k}=E();k(N),b({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:N,nodeLookup:k,parentLookup:C,domNode:A,nodeOrigin:z,nodeExtent:j,debug:L,fitViewQueued:P,zIndexMode:H}=E(),{changes:X,updatedInternals:q}=Y6(_,k,C,A,z,j,H);q&&(P6(k,C,{nodeOrigin:z,nodeExtent:j,zIndexMode:H}),P?(S(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),X?.length>0&&(L&&console.log("React Flow: trigger node changes",X),N?.(X)))},updateNodePositions:(_,N=!1)=>{const k=[];let C=[];const{nodeLookup:A,triggerNodeChanges:z,connection:j,updateConnection:L,onNodesChangeMiddlewareMap:P}=E();for(const[H,X]of _){const q=A.get(H),Y=!!(q?.expandParent&&q?.parentId&&X?.position),F={id:H,type:"position",position:Y?{x:Math.max(0,X.position.x),y:Math.max(0,X.position.y)}:X.position,dragging:N};if(q&&j.inProgress&&j.fromNode.id===q.id){const O=Pi(q,j.fromHandle,Ce.Left,!0);L({...j,from:O})}Y&&q.parentId&&k.push({id:H,parentId:q.parentId,rect:{...X.internals.positionAbsolute,width:X.measured.width??0,height:X.measured.height??0}}),C.push(F)}if(k.length>0){const{parentLookup:H,nodeOrigin:X}=E(),q=vy(k,A,H,X);C.push(...q)}for(const H of P.values())C=H(C);z(C)},triggerNodeChanges:_=>{const{onNodesChange:N,setNodes:k,nodes:C,hasDefaultNodes:A,debug:z}=E();if(_?.length){if(A){const j=Y_(_,C);k(j)}z&&console.log("React Flow: trigger node changes",_),N?.(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:N,setEdges:k,edges:C,hasDefaultEdges:A,debug:z}=E();if(_?.length){if(A){const j=q_(_,C);k(j)}z&&console.log("React Flow: trigger edge changes",_),N?.(_)}},addSelectedNodes:_=>{const{multiSelectionActive:N,edgeLookup:k,nodeLookup:C,triggerNodeChanges:A,triggerEdgeChanges:z}=E();if(N){const j=_.map(L=>ki(L,!0));A(j);return}A(Il(C,new Set([..._]),!0)),z(Il(k))},addSelectedEdges:_=>{const{multiSelectionActive:N,edgeLookup:k,nodeLookup:C,triggerNodeChanges:A,triggerEdgeChanges:z}=E();if(N){const j=_.map(L=>ki(L,!0));z(j);return}z(Il(k,new Set([..._]))),A(Il(C,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:N}={})=>{const{edges:k,nodes:C,nodeLookup:A,triggerNodeChanges:z,triggerEdgeChanges:j}=E(),L=_||C,P=N||k,H=[];for(const q of L){if(!q.selected)continue;const Y=A.get(q.id);Y&&(Y.selected=!1),H.push(ki(q.id,!1))}const X=[];for(const q of P)q.selected&&X.push(ki(q.id,!1));z(H),j(X)},setMinZoom:_=>{const{panZoom:N,maxZoom:k}=E();N?.setScaleExtent([_,k]),b({minZoom:_})},setMaxZoom:_=>{const{panZoom:N,minZoom:k}=E();N?.setScaleExtent([k,_]),b({maxZoom:_})},setTranslateExtent:_=>{E().panZoom?.setTranslateExtent(_),b({translateExtent:_})},resetSelectedElements:()=>{const{edges:_,nodes:N,triggerNodeChanges:k,triggerEdgeChanges:C,elementsSelectable:A}=E();if(!A)return;const z=N.reduce((L,P)=>P.selected?[...L,ki(P.id,!1)]:L,[]),j=_.reduce((L,P)=>P.selected?[...L,ki(P.id,!1)]:L,[]);k(z),C(j)},setNodeExtent:_=>{const{nodes:N,nodeLookup:k,parentLookup:C,nodeOrigin:A,elevateNodesOnSelect:z,nodeExtent:j,zIndexMode:L}=E();_[0][0]===j[0][0]&&_[0][1]===j[0][1]&&_[1][0]===j[1][0]&&_[1][1]===j[1][1]||(tg(N,k,C,{nodeOrigin:A,nodeExtent:_,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:L}),b({nodeExtent:_}))},panBy:_=>{const{transform:N,width:k,height:C,panZoom:A,translateExtent:z}=E();return q6({delta:_,panZoom:A,transform:N,translateExtent:z,width:k,height:C})},setCenter:async(_,N,k)=>{const{width:C,height:A,maxZoom:z,panZoom:j}=E();if(!j)return Promise.resolve(!1);const L=typeof k?.zoom<"u"?k.zoom:z;return await j.setViewport({x:C/2-_*L,y:A/2-N*L,zoom:L},{duration:k?.duration,ease:k?.ease,interpolate:k?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...f_}})},updateConnection:_=>{b({connection:_})},reset:()=>b({...b1()})}},Object.is);function g2({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:i,initialWidth:l,initialHeight:s,initialMinZoom:c,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:m,nodeExtent:g,zIndexMode:x,children:b}){const[E]=w.useState(()=>lP({nodes:e,edges:t,defaultNodes:r,defaultEdges:i,width:l,height:s,fitView:d,minZoom:c,maxZoom:f,fitViewOptions:h,nodeOrigin:m,nodeExtent:g,zIndexMode:x}));return p.jsx(NB,{value:E,children:p.jsx(GB,{children:b})})}function aP({children:e,nodes:t,edges:r,defaultNodes:i,defaultEdges:l,width:s,height:c,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:b}){return w.useContext(ld)?p.jsx(p.Fragment,{children:e}):p.jsx(g2,{initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:l,initialWidth:s,initialHeight:c,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:b,children:e})}const sP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function cP({nodes:e,edges:t,defaultNodes:r,defaultEdges:i,className:l,nodeTypes:s,edgeTypes:c,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:m,onMoveStart:g,onMoveEnd:x,onConnect:b,onConnectStart:E,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:N,onNodeMouseEnter:k,onNodeMouseMove:C,onNodeMouseLeave:A,onNodeContextMenu:z,onNodeDoubleClick:j,onNodeDragStart:L,onNodeDrag:P,onNodeDragStop:H,onNodesDelete:X,onEdgesDelete:q,onDelete:Y,onSelectionChange:F,onSelectionDragStart:O,onSelectionDrag:U,onSelectionDragStop:R,onSelectionContextMenu:V,onSelectionStart:$,onSelectionEnd:W,onBeforeDelete:M,connectionMode:B,connectionLineType:G=Wo.Bezier,connectionLineStyle:D,connectionLineComponent:oe,connectionLineContainerStyle:K,deleteKeyCode:J="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:ne=!1,selectionMode:se=zs.Full,panActivationKeyCode:he="Space",multiSelectionKeyCode:me=Bs()?"Meta":"Control",zoomActivationKeyCode:ge=Bs()?"Meta":"Control",snapToGrid:xe,snapGrid:_e,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:Pe,nodesDraggable:st,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:Kt,nodeOrigin:Vn=V_,edgesFocusable:jr,edgesReconnectable:Mr,elementsSelectable:Rt=!0,defaultViewport:mo=BB,minZoom:ce=.5,maxZoom:ye=2,translateExtent:ke=Ds,preventScrolling:Le=!0,nodeExtent:qe,defaultMarkerColor:Xt="#b1b1b7",zoomOnScroll:$n=!0,zoomOnPinch:Lt=!0,panOnScroll:vt=!1,panOnScrollSpeed:$t=.5,panOnScrollMode:Qe=Ri.Free,zoomOnDoubleClick:ar=!0,panOnDrag:dn=!0,onPaneClick:xd,onPaneMouseEnter:Yi,onPaneMouseMove:qi,onPaneMouseLeave:Fi,onPaneScroll:Or,onPaneContextMenu:Xi,paneClickDistance:ii=1,nodeClickDistance:vd=0,children:rc,onReconnect:da,onReconnectStart:li,onReconnectEnd:bd,onEdgeContextMenu:oc,onEdgeDoubleClick:ic,onEdgeMouseEnter:lc,onEdgeMouseMove:ha,onEdgeMouseLeave:ma,reconnectRadius:ac=10,onNodesChange:sc,onEdgesChange:sr,noDragClassName:jt="nodrag",noWheelClassName:Yt="nowheel",noPanClassName:Dr="nopan",fitView:Gi,fitViewOptions:cc,connectOnClick:wd,attributionPosition:uc,proOptions:ai,defaultEdgeOptions:pa,elevateNodesOnSelect:po=!0,elevateEdgesOnSelect:go=!1,disableKeyboardA11y:yo=!1,autoPanOnConnect:xo,autoPanOnNodeDrag:Et,autoPanSpeed:fc,connectionRadius:dc,isValidConnection:zr,onError:vo,style:Sd,id:ga,nodeDragThreshold:hc,connectionDragThreshold:Ed,viewport:Wi,onViewportChange:Zi,width:Yn,height:Qt,colorMode:mc="light",debug:Cd,onScroll:Ki,ariaLabelConfig:pc,zIndexMode:si="basic",...Nd},Jt){const ci=ga||"1",gc=VB(mc),ya=w.useCallback(Lr=>{Lr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ki?.(Lr)},[Ki]);return p.jsx("div",{"data-testid":"rf__wrapper",...Nd,onScroll:ya,style:{...Sd,...sP},ref:Jt,className:At(["react-flow",l,gc]),id:ga,role:"application",children:p.jsxs(aP,{nodes:e,edges:t,width:Yn,height:Qt,fitView:Gi,fitViewOptions:cc,minZoom:ce,maxZoom:ye,nodeOrigin:Vn,nodeExtent:qe,zIndexMode:si,children:[p.jsx(iP,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:k,onNodeMouseMove:C,onNodeMouseLeave:A,onNodeContextMenu:z,onNodeDoubleClick:j,nodeTypes:s,edgeTypes:c,connectionLineType:G,connectionLineStyle:D,connectionLineComponent:oe,connectionLineContainerStyle:K,selectionKeyCode:te,selectionOnDrag:ne,selectionMode:se,deleteKeyCode:J,multiSelectionKeyCode:me,panActivationKeyCode:he,zoomActivationKeyCode:ge,onlyRenderVisibleElements:$e,defaultViewport:mo,translateExtent:ke,minZoom:ce,maxZoom:ye,preventScrolling:Le,zoomOnScroll:$n,zoomOnPinch:Lt,zoomOnDoubleClick:ar,panOnScroll:vt,panOnScrollSpeed:$t,panOnScrollMode:Qe,panOnDrag:dn,onPaneClick:xd,onPaneMouseEnter:Yi,onPaneMouseMove:qi,onPaneMouseLeave:Fi,onPaneScroll:Or,onPaneContextMenu:Xi,paneClickDistance:ii,nodeClickDistance:vd,onSelectionContextMenu:V,onSelectionStart:$,onSelectionEnd:W,onReconnect:da,onReconnectStart:li,onReconnectEnd:bd,onEdgeContextMenu:oc,onEdgeDoubleClick:ic,onEdgeMouseEnter:lc,onEdgeMouseMove:ha,onEdgeMouseLeave:ma,reconnectRadius:ac,defaultMarkerColor:Xt,noDragClassName:jt,noWheelClassName:Yt,noPanClassName:Dr,rfId:ci,disableKeyboardA11y:yo,nodeExtent:qe,viewport:Wi,onViewportChange:Zi}),p.jsx(UB,{nodes:e,edges:t,defaultNodes:r,defaultEdges:i,onConnect:b,onConnectStart:E,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:N,nodesDraggable:st,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:Kt,edgesFocusable:jr,edgesReconnectable:Mr,elementsSelectable:Rt,elevateNodesOnSelect:po,elevateEdgesOnSelect:go,minZoom:ce,maxZoom:ye,nodeExtent:qe,onNodesChange:sc,onEdgesChange:sr,snapToGrid:xe,snapGrid:_e,connectionMode:B,translateExtent:ke,connectOnClick:wd,defaultEdgeOptions:pa,fitView:Gi,fitViewOptions:cc,onNodesDelete:X,onEdgesDelete:q,onDelete:Y,onNodeDragStart:L,onNodeDrag:P,onNodeDragStop:H,onSelectionDrag:U,onSelectionDragStart:O,onSelectionDragStop:R,onMove:m,onMoveStart:g,onMoveEnd:x,noPanClassName:Dr,nodeOrigin:Vn,rfId:ci,autoPanOnConnect:xo,autoPanOnNodeDrag:Et,autoPanSpeed:fc,onError:vo,connectionRadius:dc,isValidConnection:zr,selectNodesOnDrag:Pe,nodeDragThreshold:hc,connectionDragThreshold:Ed,onBeforeDelete:M,debug:Cd,ariaLabelConfig:pc,zIndexMode:si}),p.jsx(IB,{onSelectionChange:F}),rc,p.jsx(MB,{proOptions:ai,position:uc}),p.jsx(jB,{rfId:ci,disableKeyboardA11y:yo})]})})}var uP=F_(cP);function fP(e){const[t,r]=w.useState(e),i=w.useCallback(l=>r(s=>Y_(l,s)),[]);return[t,r,i]}function dP(e){const[t,r]=w.useState(e),i=w.useCallback(l=>r(s=>q_(l,s)),[]);return[t,r,i]}function hP({dimensions:e,lineWidth:t,variant:r,className:i}){return p.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:At(["react-flow__background-pattern",r,i])})}function mP({radius:e,className:t}){return p.jsx("circle",{cx:e,cy:e,r:e,className:At(["react-flow__background-pattern","dots",t])})}var lo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(lo||(lo={}));const pP={[lo.Dots]:1,[lo.Lines]:1,[lo.Cross]:6},gP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function y2({id:e,variant:t=lo.Dots,gap:r=20,size:i,lineWidth:l=1,offset:s=0,color:c,bgColor:f,style:h,className:d,patternClassName:m}){const g=w.useRef(null),{transform:x,patternId:b}=Fe(gP,ht),E=i||pP[t],S=t===lo.Dots,_=t===lo.Cross,N=Array.isArray(r)?r:[r,r],k=[N[0]*x[2]||1,N[1]*x[2]||1],C=E*x[2],A=Array.isArray(s)?s:[s,s],z=_?[C,C]:k,j=[A[0]*x[2]||1+z[0]/2,A[1]*x[2]||1+z[1]/2],L=`${b}${e||""}`;return p.jsxs("svg",{className:At(["react-flow__background",d]),style:{...h,...cd,"--xy-background-color-props":f,"--xy-background-pattern-color-props":c},ref:g,"data-testid":"rf__background",children:[p.jsx("pattern",{id:L,x:x[0]%k[0],y:x[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`,children:S?p.jsx(mP,{radius:C/2,className:m}):p.jsx(hP,{dimensions:z,lineWidth:l,variant:t,className:m})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}y2.displayName="Background";const yP=w.memo(y2);function xP(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:p.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function vP(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:p.jsx("path",{d:"M0 0h32v4.2H0z"})})}function bP(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:p.jsx("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 wP(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("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 SP(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("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"})})}function qu({children:e,className:t,...r}){return p.jsx("button",{type:"button",className:At(["react-flow__controls-button",t]),...r,children:e})}const EP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function x2({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:i=!0,fitViewOptions:l,onZoomIn:s,onZoomOut:c,onFitView:f,onInteractiveChange:h,className:d,children:m,position:g="bottom-left",orientation:x="vertical","aria-label":b}){const E=mt(),{isInteractive:S,minZoomReached:_,maxZoomReached:N,ariaLabelConfig:k}=Fe(EP,ht),{zoomIn:C,zoomOut:A,fitView:z}=sd(),j=()=>{C(),s?.()},L=()=>{A(),c?.()},P=()=>{z(l),f?.()},H=()=>{E.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),h?.(!S)},X=x==="horizontal"?"horizontal":"vertical";return p.jsxs(ad,{className:At(["react-flow__controls",X,d]),position:g,style:e,"data-testid":"rf__controls","aria-label":b??k["controls.ariaLabel"],children:[t&&p.jsxs(p.Fragment,{children:[p.jsx(qu,{onClick:j,className:"react-flow__controls-zoomin",title:k["controls.zoomIn.ariaLabel"],"aria-label":k["controls.zoomIn.ariaLabel"],disabled:N,children:p.jsx(xP,{})}),p.jsx(qu,{onClick:L,className:"react-flow__controls-zoomout",title:k["controls.zoomOut.ariaLabel"],"aria-label":k["controls.zoomOut.ariaLabel"],disabled:_,children:p.jsx(vP,{})})]}),r&&p.jsx(qu,{className:"react-flow__controls-fitview",onClick:P,title:k["controls.fitView.ariaLabel"],"aria-label":k["controls.fitView.ariaLabel"],children:p.jsx(bP,{})}),i&&p.jsx(qu,{className:"react-flow__controls-interactive",onClick:H,title:k["controls.interactive.ariaLabel"],"aria-label":k["controls.interactive.ariaLabel"],children:S?p.jsx(SP,{}):p.jsx(wP,{})}),m]})}x2.displayName="Controls";const CP=w.memo(x2);function NP({id:e,x:t,y:r,width:i,height:l,style:s,color:c,strokeColor:f,strokeWidth:h,className:d,borderRadius:m,shapeRendering:g,selected:x,onClick:b}){const{background:E,backgroundColor:S}=s||{},_=c||E||S;return p.jsx("rect",{className:At(["react-flow__minimap-node",{selected:x},d]),x:t,y:r,rx:m,ry:m,width:i,height:l,style:{fill:_,stroke:f,strokeWidth:h},shapeRendering:g,onClick:b?N=>b(N,e):void 0})}const _P=w.memo(NP),kP=e=>e.nodes.map(t=>t.id),cp=e=>e instanceof Function?e:()=>e;function TP({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:s=_P,onClick:c}){const f=Fe(kP,ht),h=cp(t),d=cp(e),m=cp(r),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:f.map(x=>p.jsx(RP,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:l,NodeComponent:s,onClick:c,shapeRendering:g},x))})}function AP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:i,nodeBorderRadius:l,nodeStrokeWidth:s,shapeRendering:c,NodeComponent:f,onClick:h}){const{node:d,x:m,y:g,width:x,height:b}=Fe(E=>{const S=E.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const _=S.internals.userNode,{x:N,y:k}=S.internals.positionAbsolute,{width:C,height:A}=ho(_);return{node:_,x:N,y:k,width:C,height:A}},ht);return!d||d.hidden||!x_(d)?null:p.jsx(f,{x:m,y:g,width:x,height:b,style:d.style,selected:!!d.selected,className:i(d),color:t(d),borderRadius:l,strokeColor:r(d),strokeWidth:s,shapeRendering:c,onClick:h,id:d.id})}const RP=w.memo(AP);var jP=w.memo(TP);const MP=200,OP=150,DP=e=>!e.hidden,zP=e=>{const t={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:t,boundingRect:e.nodeLookup.size>0?y_(Qs(e.nodeLookup,{filter:DP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},LP="react-flow__minimap-desc";function v2({style:e,className:t,nodeStrokeColor:r,nodeColor:i,nodeClassName:l="",nodeBorderRadius:s=5,nodeStrokeWidth:c,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:m,maskStrokeWidth:g,position:x="bottom-right",onClick:b,onNodeClick:E,pannable:S=!1,zoomable:_=!1,ariaLabel:N,inversePan:k,zoomStep:C=1,offsetScale:A=5}){const z=mt(),j=w.useRef(null),{boundingRect:L,viewBB:P,rfId:H,panZoom:X,translateExtent:q,flowWidth:Y,flowHeight:F,ariaLabelConfig:O}=Fe(zP,ht),U=e?.width??MP,R=e?.height??OP,V=L.width/U,$=L.height/R,W=Math.max(V,$),M=W*U,B=W*R,G=A*W,D=L.x-(M-L.width)/2-G,oe=L.y-(B-L.height)/2-G,K=M+G*2,J=B+G*2,te=`${LP}-${H}`,ne=w.useRef(0),se=w.useRef();ne.current=W,w.useEffect(()=>{if(j.current&&X)return se.current=eB({domNode:j.current,panZoom:X,getTransform:()=>z.getState().transform,getViewScale:()=>ne.current}),()=>{se.current?.destroy()}},[X]),w.useEffect(()=>{se.current?.update({translateExtent:q,width:Y,height:F,inversePan:k,pannable:S,zoomStep:C,zoomable:_})},[S,_,k,C,q,Y,F]);const he=b?xe=>{const[_e,$e]=se.current?.pointer(xe)||[0,0];b(xe,{x:_e,y:$e})}:void 0,me=E?w.useCallback((xe,_e)=>{const $e=z.getState().nodeLookup.get(_e).internals.userNode;E(xe,$e)},[]):void 0,ge=N??O["minimap.ariaLabel"];return p.jsx(ad,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*W:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:At(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:U,height:R,viewBox:`${D} ${oe} ${K} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:j,onClick:he,children:[ge&&p.jsx("title",{id:te,children:ge}),p.jsx(jP,{onClick:me,nodeColor:i,nodeStrokeColor:r,nodeBorderRadius:s,nodeClassName:l,nodeStrokeWidth:c,nodeComponent:f}),p.jsx("path",{className:"react-flow__minimap-mask",d:`M${D-G},${oe-G}h${K+G*2}v${J+G*2}h${-K-G*2}z
62
+ M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}v2.displayName="MiniMap";w.memo(v2);const IP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,BP={[ea.Line]:"right",[ea.Handle]:"bottom-right"};function HP({nodeId:e,position:t,variant:r=ea.Handle,className:i,style:l=void 0,children:s,color:c,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:x,autoScale:b=!0,shouldResize:E,onResizeStart:S,onResize:_,onResizeEnd:N}){const k=Z_(),C=typeof e=="string"?e:k,A=mt(),z=w.useRef(null),j=r===ea.Handle,L=Fe(w.useCallback(IP(j&&b),[j,b]),ht),P=w.useRef(null),H=t??BP[r];w.useEffect(()=>{if(!(!z.current||!C))return P.current||(P.current=mB({domNode:z.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:q,transform:Y,snapGrid:F,snapToGrid:O,nodeOrigin:U,domNode:R}=A.getState();return{nodeLookup:q,transform:Y,snapGrid:F,snapToGrid:O,nodeOrigin:U,paneDomNode:R}},onChange:(q,Y)=>{const{triggerNodeChanges:F,nodeLookup:O,parentLookup:U,nodeOrigin:R}=A.getState(),V=[],$={x:q.x,y:q.y},W=O.get(C);if(W&&W.expandParent&&W.parentId){const M=W.origin??R,B=q.width??W.measured.width??0,G=q.height??W.measured.height??0,D={id:W.id,parentId:W.parentId,rect:{width:B,height:G,...v_({x:q.x??W.position.x,y:q.y??W.position.y},{width:B,height:G},W.parentId,O,M)}},oe=vy([D],O,U,R);V.push(...oe),$.x=q.x?Math.max(M[0]*B,q.x):void 0,$.y=q.y?Math.max(M[1]*G,q.y):void 0}if($.x!==void 0&&$.y!==void 0){const M={id:C,type:"position",position:{...$}};V.push(M)}if(q.width!==void 0&&q.height!==void 0){const B={id:C,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:q.width,height:q.height}};V.push(B)}for(const M of Y){const B={...M,type:"position"};V.push(B)}F(V)},onEnd:({width:q,height:Y})=>{const F={id:C,type:"dimensions",resizing:!1,dimensions:{width:q,height:Y}};A.getState().triggerNodeChanges([F])}})),P.current.update({controlPosition:H,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:m},keepAspectRatio:g,resizeDirection:x,onResizeStart:S,onResize:_,onResizeEnd:N,shouldResize:E}),()=>{P.current?.destroy()}},[H,f,h,d,m,g,S,_,N,E]);const X=H.split("-");return p.jsx("div",{className:At(["react-flow__resize-control","nodrag",...X,r,i]),ref:z,style:{...l,scale:L,...c&&{[j?"backgroundColor":"borderColor"]:c}},children:s})}w.memo(HP);const w1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,S1=VS,b2=(e,t)=>r=>{var i;if(t?.variants==null)return S1(e,r?.class,r?.className);const{variants:l,defaultVariants:s}=t,c=Object.keys(l).map(d=>{const m=r?.[d],g=s?.[d];if(m===null)return null;const x=w1(m)||w1(g);return l[d][x]}),f=r&&Object.entries(r).reduce((d,m)=>{let[g,x]=m;return x===void 0||(d[g]=x),d},{}),h=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((d,m)=>{let{class:g,className:x,...b}=m;return Object.entries(b).every(E=>{let[S,_]=E;return Array.isArray(_)?_.includes({...s,...f}[S]):{...s,...f}[S]===_})?[...d,g,x]:d},[]);return S1(e,c,h,r?.class,r?.className)},PP=b2("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Kn({className:e,variant:t="default",asChild:r=!1,...i}){const l=r?Wj:"span";return p.jsx(l,{"data-slot":"badge","data-variant":t,className:ve(PP({variant:t}),e),...i})}function E1(e){return e.length===0?"-":e.join(", ")}function w2(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}function UP(e){const{data:t}=e,r=t,i=r.stepStatus,l=r.changeStatus,s=i??l,c=r.type==="HUMAN_IN_THE_LOOP",f=r.requiredMcps??[],h=r.requiredSkills??[],d=f.length===0?" - ":f.join(", "),m=h.length===0?" - ":h.join(", ");return p.jsxs("div",{className:ve("rounded-2xl border-2 bg-card shadow-md hover:shadow-xl transition-all duration-150 min-w-[220px] cursor-pointer w-max max-w-[380px] overflow-hidden","hover:scale-[1.02] hover:-translate-y-0.5 ring-2 ring-primary/15","px-4 py-3 space-y-3",c&&"border-violet-500/60 bg-violet-500/5 dark:bg-violet-500/10",i==="completed"&&"border-emerald-500/70 bg-emerald-500/10 dark:bg-emerald-500/15",i==="running"&&"border-amber-500/70 bg-amber-500/10 dark:bg-amber-500/15 animate-pulse",i==="pending"&&"border-border bg-muted/30",!i&&l==="added"&&"border-green-500 bg-green-500/10 dark:bg-green-500/15",!i&&l==="changed"&&"border-amber-500 bg-amber-500/10 dark:bg-amber-500/15",!i&&l==="removed"&&"border-red-500/80 bg-red-500/10 dark:bg-red-500/15 opacity-70 border-dashed",!s&&"border-primary/30"),children:[p.jsx(ei,{type:"target",position:Ce.Top}),p.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[p.jsx("h3",{className:"font-semibold text-sm text-foreground break-words leading-tight",children:w2(r.nodeId)}),p.jsx(Kn,{variant:c?"default":"secondary",className:ve("text-[10px] font-medium shrink-0",c&&"bg-violet-600 hover:bg-violet-600 text-white"),children:r.type.replace(/_/g," ")})]}),p.jsxs("div",{className:"rounded-lg border border-border/70 bg-muted/40 px-3 py-2 space-y-2",children:[p.jsxs("div",{className:"flex items-start gap-2",children:[p.jsx(U5,{className:"size-3.5 shrink-0 mt-0.5 text-muted-foreground","aria-hidden":!0}),p.jsxs("div",{className:"min-w-0 break-words",children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold",children:"Input"}),p.jsx("div",{className:"text-xs font-medium text-foreground break-words mt-0.5",children:E1(r.input??[])})]})]}),p.jsxs("div",{className:"flex items-start gap-2",children:[p.jsx($5,{className:"size-3.5 shrink-0 mt-0.5 text-muted-foreground","aria-hidden":!0}),p.jsxs("div",{className:"min-w-0 break-words",children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold",children:"Output"}),p.jsx("div",{className:"text-xs font-medium text-foreground break-words mt-0.5",children:E1(r.output??[])})]})]})]}),p.jsx("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 dark:bg-primary/10 px-3 py-2 min-h-[40px] flex items-center",children:p.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-medium text-foreground min-w-0 flex-1 flex-wrap",children:[p.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 break-words",children:[p.jsx(p3,{className:"size-3 text-primary shrink-0","aria-hidden":!0}),p.jsx("span",{className:"text-muted-foreground uppercase tracking-wider font-semibold shrink-0",children:"Skills"}),p.jsx("span",{className:"break-words",children:m})]}),p.jsx("span",{className:"text-border shrink-0","aria-hidden":!0,children:"·"}),p.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 break-words",children:[p.jsx(h3,{className:"size-3 text-primary shrink-0","aria-hidden":!0}),p.jsx("span",{className:"text-muted-foreground uppercase tracking-wider font-semibold shrink-0",children:"MCPs"}),p.jsx("span",{className:"break-words",children:d})]})]})}),i&&p.jsx("div",{className:"pt-0.5",children:p.jsx("span",{className:ve("inline-block text-xs font-semibold px-2.5 py-1 rounded-md",i==="completed"&&"bg-emerald-500/25 text-emerald-800 dark:text-emerald-200",i==="running"&&"bg-amber-500/25 text-amber-800 dark:text-amber-200",i==="pending"&&"bg-muted text-muted-foreground"),children:i})}),p.jsx(ei,{type:"source",position:Ce.Bottom})]})}const VP=w.memo(UP);function $P(e){const t=e.data,r=xr(t.kind);return p.jsxs("div",{className:ve("relative px-3 py-3 w-[180px] rounded-xl border-2 shadow-md text-sm cursor-pointer transition-all duration-150","hover:shadow-lg hover:scale-[1.03] hover:-translate-y-0.5",t.collected?"bg-emerald-500/10 border-emerald-500/70 ring-2 ring-emerald-500/25":"bg-card border-primary/45 ring-2 ring-primary/20"),style:{borderColor:t.collected?void 0:r},children:[p.jsx(ei,{type:"target",position:Ce.Top}),p.jsx(ei,{type:"source",position:Ce.Bottom}),p.jsx("div",{className:"absolute left-2 right-2 -top-2 h-4 rounded-full border bg-background",style:{borderColor:r}}),p.jsx("div",{className:"absolute left-2 right-2 -bottom-2 h-4 rounded-full border bg-background",style:{borderColor:r}}),p.jsxs("div",{className:"flex items-center gap-1.5 justify-center",children:[p.jsx(vf,{className:"size-3 text-muted-foreground","aria-hidden":!0}),p.jsxs("span",{className:"font-semibold truncate",title:t.kind,children:[t.label,t.collected?" ✓":""]})]})]})}const YP=w.memo($P),C1=320,N1=120,_1=120,qP=82;function FP(e){const{nodeIds:t,edges:r}=e,i={};t.forEach(m=>i[m]=[]);const l={},s={};r.forEach(m=>{m.from.startsWith("node:")&&t.has(m.from)&&(s[m.from]||(s[m.from]=[]),s[m.from].push(m.to)),m.to.startsWith("node:")&&t.has(m.to)&&(l[m.from]||(l[m.from]=[]),l[m.from].push(m.to))}),Object.keys(l).forEach(m=>{const g=l[m];Object.entries(s).filter(([,b])=>b.includes(m)).map(([b])=>b).forEach(b=>{g.forEach(E=>{b!==E&&i[E].push(b)})})});const c={};[...t].forEach(m=>c[m]=0);const f=t.size+1;let h=0,d=!0;for(;d&&h<f;){d=!1,h++;for(const m of t){const g=i[m]??[],x=g.map(E=>c[E]??0),b=g.length===0?0:Math.max(...x)+1;c[m]!==b&&(c[m]=b,d=!0)}}return c}function XP(e){const{vertices:t,rowByVertex:r}=e,i=new Map(t.map(m=>[m.id,m])),l={};t.forEach(m=>{const g=r[m.id]??0;l[g]||(l[g]=[]),l[g].push(m.id)});const s=Object.keys(l).map(Number).sort((m,g)=>m-g).map(m=>{const g=l[m];return g.sort((x,b)=>x.localeCompare(b,"en",{sensitivity:"base"})),g}),c=Math.max(...s.map(m=>m.length),1),h=(c*C1+(c-1)*_1)/2,d=new Map;return s.forEach((m,g)=>{const b=m.every(N=>i.get(N)?.type==="collection")?GP+WP:C1+_1,E=(m.length-1)*b,S=h-E/2,_=g*(N1+qP)+N1/2;m.forEach((N,k)=>{const C=S+k*b;d.set(N,{id:N,x:C,y:_,row:g,colInRow:k})})}),{positions:d,rows:s}}const GP=100,WP=119;function ZP(e){const t={};for(const r of e){const i=Gj(r.data);i&&(r.type==="step_started"&&(t[i]="running"),r.type==="step_completed"&&(t[i]="completed"))}return t}function S2(e,t,r){const i=new Set(e.nodes.map(k=>`node:${k.id}`)),l=[];for(const k of e.nodes){for(const C of k.input_collections??[])l.push({from:`collection:${C}`,to:`node:${k.id}`});for(const C of k.output_collections??[])l.push({from:`node:${k.id}`,to:`collection:${C}`})}const s=FP({nodeIds:i,edges:l}),c=Math.max(0,...Object.values(s)),f=[],h=[],d=[];for(let k=0;k<=c;k++){const C=e.nodes.filter(j=>(s[`node:${j.id}`]??0)===k);d[k]=C;const A=new Set,z=new Set;for(const j of C){for(const L of j.input_collections??[])A.add(L);for(const L of j.output_collections??[])z.add(L)}f[k]=A,h[k]=z}const m=[],g={},x=[];for(const k of e.nodes){const C=`node:${k.id}`,A=s[C]??0;m.push({id:C,type:"node"}),g[C]=2*A+1}for(let k=0;k<=c;k++){const C=d[k],A=f[k],z=h[k];if(k===0)for(const P of A){const H=`collection:${P}:row0`;m.push({id:H,type:"collection"}),g[H]=0;for(const X of C)(X.input_collections??[]).includes(P)&&x.push({from:H,to:`node:${X.id}`})}const j=2*k+2,L=new Set([...z]);if(k<c)for(const P of f[k+1])L.add(P);for(const P of L){const H=`collection:${P}:row${j}`;m.push({id:H,type:"collection"}),g[H]=j;for(const X of C)(X.output_collections??[]).includes(P)&&x.push({from:`node:${X.id}`,to:H});if(k<c)for(const X of d[k+1])(X.input_collections??[]).includes(P)&&x.push({from:H,to:`node:${X.id}`})}}const{positions:b}=XP({vertices:m,rowByVertex:g});function E(k){const C=k.match(/^collection:(.+):row\d+$/);return C?C[1]:k.replace(/^collection:/,"")}const S=m.filter(k=>k.type==="collection").map(k=>{const C=b.get(k.id),A=E(k.id),z={kind:A,label:A,collected:!!r?.has(A)};return{id:k.id,type:"collection",position:C?{x:C.x,y:C.y}:{x:0,y:0},data:z}}),_=e.nodes.map(k=>{const C=`node:${k.id}`,A=b.get(C),z={label:k.id,nodeId:k.id,type:k.type,input:k.input_collections??[],output:k.output_collections??[],requiredMcps:k.required_mcps??[],requiredSkills:k.required_skills??[]};return t&&t[k.id]&&(z.stepStatus=t[k.id]),{id:C,type:"workflow",position:A?{x:A.x,y:A.y}:{x:0,y:0},data:z}}),N=x.map(k=>({id:`${k.from}->${k.to}`,source:k.from,target:k.to}));return{nodes:[...S,..._],edges:N}}const KP=2e3;function ta({value:e,className:t,truncateLength:r}){const[i,l]=w.useState(!1),s=w.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{l(!0),setTimeout(()=>l(!1),KP)})},[e]),c=r&&e.length>r?`${e.slice(0,r)}…`:e;return p.jsxs("span",{className:ve("inline-flex items-center gap-1 min-w-0",t),title:e,children:[p.jsx("span",{className:"truncate font-mono text-inherit",children:c}),p.jsx("button",{type:"button",onClick:s,className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-1 focus:ring-ring","aria-label":i?"Copied":"Copy ID",title:i?"Copied":"Copy ID",children:i?p.jsx(ey,{className:"size-3.5 text-green-600 dark:text-green-400","aria-hidden":!0}):p.jsx(_N,{className:"size-3.5","aria-hidden":!0})})]})}function QP(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const JP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,e8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t8={};function k1(e,t){return(t8.jsx?e8:JP).test(e)}const n8=/[ \t\n\f\r]/g;function r8(e){return typeof e=="object"?e.type==="text"?T1(e.value):!1:T1(e)}function T1(e){return e.replace(n8,"")===""}class tc{constructor(t,r,i){this.normal=r,this.property=t,i&&(this.space=i)}}tc.prototype.normal={};tc.prototype.property={};tc.prototype.space=void 0;function E2(e,t){const r={},i={};for(const l of e)Object.assign(r,l.property),Object.assign(i,l.normal);return new tc(r,i,t)}function og(e){return e.toLowerCase()}class un{constructor(t,r){this.attribute=r,this.property=t}}un.prototype.attribute="";un.prototype.booleanish=!1;un.prototype.boolean=!1;un.prototype.commaOrSpaceSeparated=!1;un.prototype.commaSeparated=!1;un.prototype.defined=!1;un.prototype.mustUseProperty=!1;un.prototype.number=!1;un.prototype.overloadedBoolean=!1;un.prototype.property="";un.prototype.spaceSeparated=!1;un.prototype.space=void 0;let o8=0;const ze=$i(),Tt=$i(),ig=$i(),pe=$i(),it=$i(),Vl=$i(),bn=$i();function $i(){return 2**++o8}const lg=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Tt,commaOrSpaceSeparated:bn,commaSeparated:Vl,number:pe,overloadedBoolean:ig,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),up=Object.keys(lg);class wy extends un{constructor(t,r,i,l){let s=-1;if(super(t,r),A1(this,"space",l),typeof i=="number")for(;++s<up.length;){const c=up[s];A1(this,up[s],(i&lg[c])===lg[c])}}}wy.prototype.defined=!0;function A1(e,t,r){r&&(e[t]=r)}function ua(e){const t={},r={};for(const[i,l]of Object.entries(e.properties)){const s=new wy(i,e.transform(e.attributes||{},i),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,r[og(i)]=i,r[og(s.attribute)]=i}return new tc(t,r,e.space)}const C2=ua({properties:{ariaActiveDescendant:null,ariaAtomic:Tt,ariaAutoComplete:null,ariaBusy:Tt,ariaChecked:Tt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:Tt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:Tt,ariaFlowTo:it,ariaGrabbed:Tt,ariaHasPopup:null,ariaHidden:Tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:pe,ariaLive:null,ariaModal:Tt,ariaMultiLine:Tt,ariaMultiSelectable:Tt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Tt,ariaReadOnly:Tt,ariaRelevant:null,ariaRequired:Tt,ariaRoleDescription:it,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Tt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function N2(e,t){return t in e?e[t]:t}function _2(e,t){return N2(e,t.toLowerCase())}const i8=ua({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vl,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:it,autoFocus:ze,autoPlay:ze,blocking:it,capture:null,charSet:null,checked:ze,cite:null,className:it,cols:pe,colSpan:null,content:null,contentEditable:Tt,controls:ze,controlsList:it,coords:pe|Vl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:ig,draggable:Tt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:it,height:pe,hidden:ig,high:pe,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:it,itemRef:it,itemScope:ze,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:pe,pattern:null,ping:it,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:it,required:ze,reversed:ze,rows:pe,rowSpan:pe,sandbox:it,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Tt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Tt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Tt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ze,disableRemotePlayback:ze,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:_2}),l8=ua({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:it,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Vl,g2:Vl,glyphName:Vl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:N2}),k2=ua({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),T2=ua({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_2}),A2=ua({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),a8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},s8=/[A-Z]/g,R1=/-[a-z]/g,c8=/^data[-\w.:]+$/i;function u8(e,t){const r=og(t);let i=t,l=un;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&c8.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(R1,d8);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!R1.test(s)){let c=s.replace(s8,f8);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=wy}return new l(i,t)}function f8(e){return"-"+e.toLowerCase()}function d8(e){return e.charAt(1).toUpperCase()}const h8=E2([C2,i8,k2,T2,A2],"html"),Sy=E2([C2,l8,k2,T2,A2],"svg");function m8(e){return e.join(" ").trim()}var Dl={},fp,j1;function p8(){if(j1)return fp;j1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
63
+ `,d="/",m="*",g="",x="comment",b="declaration";function E(_,N){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];N=N||{};var k=1,C=1;function A(O){var U=O.match(t);U&&(k+=U.length);var R=O.lastIndexOf(h);C=~R?O.length-R:C+O.length}function z(){var O={line:k,column:C};return function(U){return U.position=new j(O),H(),U}}function j(O){this.start=O,this.end={line:k,column:C},this.source=N.source}j.prototype.content=_;function L(O){var U=new Error(N.source+":"+k+":"+C+": "+O);if(U.reason=O,U.filename=N.source,U.line=k,U.column=C,U.source=_,!N.silent)throw U}function P(O){var U=O.exec(_);if(U){var R=U[0];return A(R),_=_.slice(R.length),U}}function H(){P(r)}function X(O){var U;for(O=O||[];U=q();)U!==!1&&O.push(U);return O}function q(){var O=z();if(!(d!=_.charAt(0)||m!=_.charAt(1))){for(var U=2;g!=_.charAt(U)&&(m!=_.charAt(U)||d!=_.charAt(U+1));)++U;if(U+=2,g===_.charAt(U-1))return L("End of comment missing");var R=_.slice(2,U-2);return C+=2,A(R),_=_.slice(U),C+=2,O({type:x,comment:R})}}function Y(){var O=z(),U=P(i);if(U){if(q(),!P(l))return L("property missing ':'");var R=P(s),V=O({type:b,property:S(U[0].replace(e,g)),value:R?S(R[0].replace(e,g)):g});return P(c),V}}function F(){var O=[];X(O);for(var U;U=Y();)U!==!1&&(O.push(U),X(O));return O}return H(),F()}function S(_){return _?_.replace(f,g):g}return fp=E,fp}var M1;function g8(){if(M1)return Dl;M1=1;var e=Dl&&Dl.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.default=r;const t=e(p8());function r(i,l){let s=null;if(!i||typeof i!="string")return s;const c=(0,t.default)(i),f=typeof l=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:m}=h;f?l(d,m,h):m&&(s=s||{},s[d]=m)}),s}return Dl}var fs={},O1;function y8(){if(O1)return fs;O1=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,s=function(d){return!d||r.test(d)||e.test(d)},c=function(d,m){return m.toUpperCase()},f=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),s(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(l,f):d=d.replace(i,f),d.replace(t,c))};return fs.camelCase=h,fs}var ds,D1;function x8(){if(D1)return ds;D1=1;var e=ds&&ds.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(g8()),r=y8();function i(l,s){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,h){f&&h&&(c[(0,r.camelCase)(f,s)]=h)}),c}return i.default=i,ds=i,ds}var v8=x8();const b8=Us(v8),R2=j2("end"),Ey=j2("start");function j2(e){return t;function t(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function w8(e){const t=Ey(e),r=R2(e);if(t&&r)return{start:t,end:r}}function bs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?z1(e.position):"start"in e||"end"in e?z1(e):"line"in e||"column"in e?ag(e):""}function ag(e){return L1(e&&e.line)+":"+L1(e&&e.column)}function z1(e){return ag(e&&e.start)+"-"+ag(e&&e.end)}function L1(e){return e&&typeof e=="number"?e:1}class Ft extends Error{constructor(t,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let l="",s={},c=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof t=="string"?l=t:!s.cause&&t&&(c=!0,l=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const h=i.indexOf(":");h===-1?s.ruleId=i:(s.source=i.slice(0,h),s.ruleId=i.slice(h+1))}if(!s.place&&s.ancestors&&s.ancestors){const h=s.ancestors[s.ancestors.length-1];h&&(s.place=h.position)}const f=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=bs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=c&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ft.prototype.file="";Ft.prototype.name="";Ft.prototype.reason="";Ft.prototype.message="";Ft.prototype.stack="";Ft.prototype.column=void 0;Ft.prototype.line=void 0;Ft.prototype.ancestors=void 0;Ft.prototype.cause=void 0;Ft.prototype.fatal=void 0;Ft.prototype.place=void 0;Ft.prototype.ruleId=void 0;Ft.prototype.source=void 0;const Cy={}.hasOwnProperty,S8=new Map,E8=/[A-Z]/g,C8=new Set(["table","tbody","thead","tfoot","tr"]),N8=new Set(["td","th"]),M2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _8(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=D8(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=O8(r,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Sy:h8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=O2(l,e,void 0);return s&&typeof s!="string"?s:l.create(e,l.Fragment,{children:s||void 0},void 0)}function O2(e,t,r){if(t.type==="element")return k8(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return T8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return R8(e,t,r);if(t.type==="mdxjsEsm")return A8(e,t);if(t.type==="root")return j8(e,t,r);if(t.type==="text")return M8(e,t)}function k8(e,t,r){const i=e.schema;let l=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(l=Sy,e.schema=l),e.ancestors.push(t);const s=z2(e,t.tagName,!1),c=z8(e,t);let f=_y(e,t);return C8.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!r8(h):!0})),D2(e,c,s,t),Ny(c,f),e.ancestors.pop(),e.schema=i,e.create(t,s,c,r)}function T8(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Ps(e,t.position)}function A8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ps(e,t.position)}function R8(e,t,r){const i=e.schema;let l=i;t.name==="svg"&&i.space==="html"&&(l=Sy,e.schema=l),e.ancestors.push(t);const s=t.name===null?e.Fragment:z2(e,t.name,!0),c=L8(e,t),f=_y(e,t);return D2(e,c,s,t),Ny(c,f),e.ancestors.pop(),e.schema=i,e.create(t,s,c,r)}function j8(e,t,r){const i={};return Ny(i,_y(e,t)),e.create(t,e.Fragment,i,r)}function M8(e,t){return t.value}function D2(e,t,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=i)}function Ny(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function O8(e,t,r){return i;function i(l,s,c,f){const d=Array.isArray(c.children)?r:t;return f?d(s,c,f):d(s,c)}}function D8(e,t){return r;function r(i,l,s,c){const f=Array.isArray(s.children),h=Ey(i);return t(l,s,c,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function z8(e,t){const r={};let i,l;for(l in t.properties)if(l!=="children"&&Cy.call(t.properties,l)){const s=I8(e,l,t.properties[l]);if(s){const[c,f]=s;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&N8.has(t.tagName)?i=f:r[c]=f}}if(i){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function L8(e,t){const r={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const c=s.expression;c.type;const f=c.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else Ps(e,t.position);else{const l=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,s=e.evaluater.evaluateExpression(f.expression)}else Ps(e,t.position);else s=i.value===null?!0:i.value;r[l]=s}return r}function _y(e,t){const r=[];let i=-1;const l=e.passKeys?new Map:S8;for(;++i<t.children.length;){const s=t.children[i];let c;if(e.passKeys){const h=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(h){const d=l.get(h)||0;c=h+"-"+d,l.set(h,d+1)}}const f=O2(e,s,c);f!==void 0&&r.push(f)}return r}function I8(e,t,r){const i=u8(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?QP(r):m8(r)),i.property==="style"){let l=typeof r=="object"?r:B8(e,String(r));return e.stylePropertyNameCase==="css"&&(l=H8(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&i.space?a8[i.property]||i.property:i.attribute,r]}}function B8(e,t){try{return b8(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,l=new Ft("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=M2+"#cannot-parse-style-attribute",l}}function z2(e,t,r){let i;if(!r)i={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let s=-1,c;for(;++s<l.length;){const f=k1(l[s])?{type:"Identifier",name:l[s]}:{type:"Literal",value:l[s]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(s&&f.type==="Literal"),optional:!1}:f}i=c}else i=k1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const l=i.value;return Cy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ps(e)}function Ps(e,t){const r=new Ft("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=M2+"#cannot-handle-mdx-estrees-without-createevaluater",r}function H8(e){const t={};let r;for(r in e)Cy.call(e,r)&&(t[P8(r)]=e[r]);return t}function P8(e){let t=e.replace(E8,U8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function U8(e){return"-"+e.toLowerCase()}const dp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},V8={};function $8(e,t){const r=V8,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return L2(e,i,l)}function L2(e,t,r){if(Y8(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return I1(e.children,t,r)}return Array.isArray(e)?I1(e,t,r):""}function I1(e,t,r){const i=[];let l=-1;for(;++l<e.length;)i[l]=L2(e[l],t,r);return i.join("")}function Y8(e){return!!(e&&typeof e=="object")}const B1=document.createElement("i");function ky(e){const t="&"+e+";";B1.innerHTML=t;const r=B1.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Nr(e,t,r,i){const l=e.length;let s=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,r=r>0?r:0,i.length<1e4)c=Array.from(i),c.unshift(t,r),e.splice(...c);else for(r&&e.splice(t,r);s<i.length;)c=i.slice(s,s+1e4),c.unshift(t,0),e.splice(...c),s+=1e4,t+=1e4}function Bn(e,t){return e.length>0?(Nr(e,e.length,0,t),e):t}const H1={}.hasOwnProperty;function q8(e){const t={};let r=-1;for(;++r<e.length;)F8(t,e[r]);return t}function F8(e,t){let r;for(r in t){const l=(H1.call(e,r)?e[r]:void 0)||(e[r]={}),s=t[r];let c;if(s)for(c in s){H1.call(l,c)||(l[c]=[]);const f=s[c];X8(l[c],Array.isArray(f)?f:f?[f]:[])}}}function X8(e,t){let r=-1;const i=[];for(;++r<t.length;)(t[r].add==="after"?e:i).push(t[r]);Nr(e,0,0,i)}function I2(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function $l(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yr=oi(/[A-Za-z]/),Cn=oi(/[\dA-Za-z]/),G8=oi(/[#-'*+\--9=?A-Z^-~]/);function sg(e){return e!==null&&(e<32||e===127)}const cg=oi(/\d/),W8=oi(/[\dA-Fa-f]/),Z8=oi(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function cn(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const K8=oi(new RegExp("\\p{P}|\\p{S}","u")),Q8=oi(/\s/);function oi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function fa(e){const t=[];let r=-1,i=0,l=0;for(;++r<e.length;){const s=e.charCodeAt(r);let c="";if(s===37&&Cn(e.charCodeAt(r+1))&&Cn(e.charCodeAt(r+2)))l=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(c=String.fromCharCode(s));else if(s>55295&&s<57344){const f=e.charCodeAt(r+1);s<56320&&f>56319&&f<57344?(c=String.fromCharCode(s,f),l=1):c="�"}else c=String.fromCharCode(s);c&&(t.push(e.slice(i,r),encodeURIComponent(c)),i=r+l+1,c=""),l&&(r+=l,l=0)}return t.join("")+e.slice(i)}function at(e,t,r,i){const l=i?i-1:Number.POSITIVE_INFINITY;let s=0;return c;function c(h){return Ke(h)?(e.enter(r),f(h)):t(h)}function f(h){return Ke(h)&&s++<l?(e.consume(h),f):(e.exit(r),t(h))}}const J8={tokenize:eU};function eU(e){const t=e.attempt(this.parser.constructs.contentInitial,i,l);let r;return t;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),at(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),s(f)}function s(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ae(f)?(e.consume(f),e.exit("chunkText"),s):(e.consume(f),c)}}const tU={tokenize:nU},P1={tokenize:rU};function nU(e){const t=this,r=[];let i=0,l,s,c;return f;function f(C){if(i<r.length){const A=r[i];return t.containerState=A[1],e.attempt(A[0].continuation,h,d)(C)}return d(C)}function h(C){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&k();const A=t.events.length;let z=A,j;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){j=t.events[z][1].end;break}N(i);let L=A;for(;L<t.events.length;)t.events[L][1].end={...j},L++;return Nr(t.events,z+1,0,t.events.slice(A)),t.events.length=L,d(C)}return f(C)}function d(C){if(i===r.length){if(!l)return x(C);if(l.currentConstruct&&l.currentConstruct.concrete)return E(C);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(P1,m,g)(C)}function m(C){return l&&k(),N(i),x(C)}function g(C){return t.parser.lazy[t.now().line]=i!==r.length,c=t.now().offset,E(C)}function x(C){return t.containerState={},e.attempt(P1,b,E)(C)}function b(C){return i++,r.push([t.currentConstruct,t.containerState]),x(C)}function E(C){if(C===null){l&&k(),N(0),e.consume(C);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:s}),S(C)}function S(C){if(C===null){_(e.exit("chunkFlow"),!0),N(0),e.consume(C);return}return Ae(C)?(e.consume(C),_(e.exit("chunkFlow")),i=0,t.interrupt=void 0,f):(e.consume(C),S)}function _(C,A){const z=t.sliceStream(C);if(A&&z.push(null),C.previous=s,s&&(s.next=C),s=C,l.defineSkip(C.start),l.write(z),t.parser.lazy[C.start.line]){let j=l.events.length;for(;j--;)if(l.events[j][1].start.offset<c&&(!l.events[j][1].end||l.events[j][1].end.offset>c))return;const L=t.events.length;let P=L,H,X;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(H){X=t.events[P][1].end;break}H=!0}for(N(i),j=L;j<t.events.length;)t.events[j][1].end={...X},j++;Nr(t.events,P+1,0,t.events.slice(L)),t.events.length=j}}function N(C){let A=r.length;for(;A-- >C;){const z=r[A];t.containerState=z[1],z[0].exit.call(t,e)}r.length=C}function k(){l.write([null]),s=void 0,l=void 0,t.containerState._closeFlow=void 0}}function rU(e,t,r){return at(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function U1(e){if(e===null||cn(e)||Q8(e))return 1;if(K8(e))return 2}function Ty(e,t,r){const i=[];let l=-1;for(;++l<e.length;){const s=e[l].resolveAll;s&&!i.includes(s)&&(t=s(t,r),i.push(s))}return t}const ug={name:"attention",resolveAll:oU,tokenize:iU};function oU(e,t){let r=-1,i,l,s,c,f,h,d,m;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(i=r;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[i][1].end},x={...e[r][1].start};V1(g,-h),V1(x,h),c={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[i][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},s={type:h>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},l={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[i][1].end={...c.start},e[r][1].start={...f.end},d=[],e[i][1].end.offset-e[i][1].start.offset&&(d=Bn(d,[["enter",e[i][1],t],["exit",e[i][1],t]])),d=Bn(d,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",s,t]]),d=Bn(d,Ty(t.parser.constructs.insideSpan.null,e.slice(i+1,r),t)),d=Bn(d,[["exit",s,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,d=Bn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])):m=0,Nr(e,i-1,r-i+3,d),r=i+d.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function iU(e,t){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,l=U1(i);let s;return c;function c(h){return s=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===s)return e.consume(h),f;const d=e.exit("attentionSequence"),m=U1(h),g=!m||m===2&&l||r.includes(h),x=!l||l===2&&m||r.includes(i);return d._open=!!(s===42?g:g&&(l||!x)),d._close=!!(s===42?x:x&&(m||!g)),t(h)}}function V1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lU={name:"autolink",tokenize:aU};function aU(e,t,r){let i=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(b){return yr(b)?(e.consume(b),c):b===64?r(b):d(b)}function c(b){return b===43||b===45||b===46||Cn(b)?(i=1,f(b)):d(b)}function f(b){return b===58?(e.consume(b),i=0,h):(b===43||b===45||b===46||Cn(b))&&i++<32?(e.consume(b),f):(i=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||sg(b)?r(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),m):G8(b)?(e.consume(b),d):r(b)}function m(b){return Cn(b)?g(b):r(b)}function g(b){return b===46?(e.consume(b),i=0,m):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):x(b)}function x(b){if((b===45||Cn(b))&&i++<63){const E=b===45?x:g;return e.consume(b),E}return r(b)}}const fd={partial:!0,tokenize:sU};function sU(e,t,r){return i;function i(s){return Ke(s)?at(e,l,"linePrefix")(s):l(s)}function l(s){return s===null||Ae(s)?t(s):r(s)}}const B2={continuation:{tokenize:uU},exit:fU,name:"blockQuote",tokenize:cU};function cU(e,t,r){const i=this;return l;function l(c){if(c===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),s}return r(c)}function s(c){return Ke(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function uU(e,t,r){const i=this;return l;function l(c){return Ke(c)?at(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):s(c)}function s(c){return e.attempt(B2,t,r)(c)}}function fU(e){e.exit("blockQuote")}const H2={name:"characterEscape",tokenize:dU};function dU(e,t,r){return i;function i(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),l}function l(s){return Z8(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(s)}}const P2={name:"characterReference",tokenize:hU};function hU(e,t,r){const i=this;let l=0,s,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,c=Cn,m(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,c=W8,m):(e.enter("characterReferenceValue"),s=7,c=cg,m(g))}function m(g){if(g===59&&l){const x=e.exit("characterReferenceValue");return c===Cn&&!ky(i.sliceSerialize(x))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&l++<s?(e.consume(g),m):r(g)}}const $1={partial:!0,tokenize:pU},Y1={concrete:!0,name:"codeFenced",tokenize:mU};function mU(e,t,r){const i=this,l={partial:!0,tokenize:z};let s=0,c=0,f;return h;function h(j){return d(j)}function d(j){const L=i.events[i.events.length-1];return s=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(j)}function m(j){return j===f?(c++,e.consume(j),m):c<3?r(j):(e.exit("codeFencedFenceSequence"),Ke(j)?at(e,g,"whitespace")(j):g(j))}function g(j){return j===null||Ae(j)?(e.exit("codeFencedFence"),i.interrupt?t(j):e.check($1,S,A)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===null||Ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(j)):Ke(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,b,"whitespace")(j)):j===96&&j===f?r(j):(e.consume(j),x)}function b(j){return j===null||Ae(j)?g(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(j))}function E(j){return j===null||Ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(j)):j===96&&j===f?r(j):(e.consume(j),E)}function S(j){return e.attempt(l,A,_)(j)}function _(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),N}function N(j){return s>0&&Ke(j)?at(e,k,"linePrefix",s+1)(j):k(j)}function k(j){return j===null||Ae(j)?e.check($1,S,A)(j):(e.enter("codeFlowValue"),C(j))}function C(j){return j===null||Ae(j)?(e.exit("codeFlowValue"),k(j)):(e.consume(j),C)}function A(j){return e.exit("codeFenced"),t(j)}function z(j,L,P){let H=0;return X;function X(U){return j.enter("lineEnding"),j.consume(U),j.exit("lineEnding"),q}function q(U){return j.enter("codeFencedFence"),Ke(U)?at(j,Y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):Y(U)}function Y(U){return U===f?(j.enter("codeFencedFenceSequence"),F(U)):P(U)}function F(U){return U===f?(H++,j.consume(U),F):H>=c?(j.exit("codeFencedFenceSequence"),Ke(U)?at(j,O,"whitespace")(U):O(U)):P(U)}function O(U){return U===null||Ae(U)?(j.exit("codeFencedFence"),L(U)):P(U)}}}function pU(e,t,r){const i=this;return l;function l(c){return c===null?r(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s)}function s(c){return i.parser.lazy[i.now().line]?r(c):t(c)}}const hp={name:"codeIndented",tokenize:yU},gU={partial:!0,tokenize:xU};function yU(e,t,r){const i=this;return l;function l(d){return e.enter("codeIndented"),at(e,s,"linePrefix",5)(d)}function s(d){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?c(d):r(d)}function c(d){return d===null?h(d):Ae(d)?e.attempt(gU,c,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Ae(d)?(e.exit("codeFlowValue"),c(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),t(d)}}function xU(e,t,r){const i=this;return l;function l(c){return i.parser.lazy[i.now().line]?r(c):Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):at(e,s,"linePrefix",5)(c)}function s(c){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Ae(c)?l(c):r(c)}}const vU={name:"codeText",previous:wU,resolve:bU,tokenize:SU};function bU(e){let t=e.length-4,r=3,i,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=r;++i<t;)if(e[i][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(i=r-1,t++;++i<=t;)l===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(l=i):(i===t||e[i][1].type==="lineEnding")&&(e[l][1].type="codeTextData",i!==l+2&&(e[l][1].end=e[i-1][1].end,e.splice(l+2,i-l-2),t-=i-l-2,i=l+2),l=void 0);return e}function wU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function SU(e,t,r){let i=0,l,s;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),i++,f):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(s=e.enter("codeTextSequence"),l=0,m(g)):Ae(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||Ae(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),d)}function m(g){return g===96?(e.consume(g),l++,m):l===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(s.type="codeTextData",d(g))}}class EU{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,r,i){const l=r||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return i&&hs(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),hs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),hs(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);hs(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);hs(this.left,r.reverse())}}}function hs(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function U2(e){const t={};let r=-1,i,l,s,c,f,h,d;const m=new EU(e);for(;++r<m.length;){for(;r in t;)r=t[r];if(i=m.get(r),r&&i[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(h=i[1]._tokenizer.events,s=0,s<h.length&&h[s][1].type==="lineEndingBlank"&&(s+=2),s<h.length&&h[s][1].type==="content"))for(;++s<h.length&&h[s][1].type!=="content";)h[s][1].type==="chunkText"&&(h[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,CU(m,r)),r=t[r],d=!0);else if(i[1]._container){for(s=r,l=void 0;s--;)if(c=m.get(s),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(m.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=s);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(i[1].end={...m.get(l)[1].start},f=m.slice(l,r),f.unshift(i),m.splice(l,r-l+1,f))}}return Nr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function CU(e,t){const r=e.get(t)[1],i=e.get(t)[2];let l=t-1;const s=[];let c=r._tokenizer;c||(c=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],d={};let m,g,x=-1,b=r,E=0,S=0;const _=[S];for(;b;){for(;e.get(++l)[1]!==b;);s.push(l),b._tokenizer||(m=i.sliceStream(b),b.next||m.push(null),g&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(m),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=r;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(S=x+1,_.push(S),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):_.pop(),x=_.length;x--;){const N=f.slice(_[x],_[x+1]),k=s.pop();h.push([k,k+N.length-1]),e.splice(k,2,N)}for(h.reverse(),x=-1;++x<h.length;)d[E+h[x][0]]=E+h[x][1],E+=h[x][1]-h[x][0]-1;return d}const NU={resolve:kU,tokenize:TU},_U={partial:!0,tokenize:AU};function kU(e){return U2(e),e}function TU(e,t){let r;return i;function i(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?s(f):Ae(f)?e.check(_U,c,s)(f):(e.consume(f),l)}function s(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function AU(e,t,r){const i=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),at(e,s,"linePrefix")}function s(c){if(c===null||Ae(c))return r(c);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(i.parser.constructs.flow,r,t)(c)}}function V2(e,t,r,i,l,s,c,f,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return g;function g(N){return N===60?(e.enter(i),e.enter(l),e.enter(s),e.consume(N),e.exit(s),x):N===null||N===32||N===41||sg(N)?r(N):(e.enter(i),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(N))}function x(N){return N===62?(e.enter(s),e.consume(N),e.exit(s),e.exit(l),e.exit(i),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(N))}function b(N){return N===62?(e.exit("chunkString"),e.exit(f),x(N)):N===null||N===60||Ae(N)?r(N):(e.consume(N),N===92?E:b)}function E(N){return N===60||N===62||N===92?(e.consume(N),b):b(N)}function S(N){return!m&&(N===null||N===41||cn(N))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(i),t(N)):m<d&&N===40?(e.consume(N),m++,S):N===41?(e.consume(N),m--,S):N===null||N===32||N===40||sg(N)?r(N):(e.consume(N),N===92?_:S)}function _(N){return N===40||N===41||N===92?(e.consume(N),S):S(N)}}function $2(e,t,r,i,l,s){const c=this;let f=0,h;return d;function d(b){return e.enter(i),e.enter(l),e.consume(b),e.exit(l),e.enter(s),m}function m(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?r(b):b===93?(e.exit(s),e.enter(l),e.consume(b),e.exit(l),e.exit(i),t):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Ae(b)||f++>999?(e.exit("chunkString"),m(b)):(e.consume(b),h||(h=!Ke(b)),b===92?x:g)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,g):g(b)}}function Y2(e,t,r,i,l,s){let c;return f;function f(x){return x===34||x===39||x===40?(e.enter(i),e.enter(l),e.consume(x),e.exit(l),c=x===40?41:x,h):r(x)}function h(x){return x===c?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),t):(e.enter(s),d(x))}function d(x){return x===c?(e.exit(s),h(c)):x===null?r(x):Ae(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),at(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===c||x===null||Ae(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?g:m)}function g(x){return x===c||x===92?(e.consume(x),m):m(x)}}function ws(e,t){let r;return i;function i(l){return Ae(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,i):Ke(l)?at(e,i,r?"linePrefix":"lineSuffix")(l):t(l)}}const RU={name:"definition",tokenize:MU},jU={partial:!0,tokenize:OU};function MU(e,t,r){const i=this;let l;return s;function s(b){return e.enter("definition"),c(b)}function c(b){return $2.call(i,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return l=$l(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):r(b)}function h(b){return cn(b)?ws(e,d)(b):d(b)}function d(b){return V2(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(jU,g,g)(b)}function g(b){return Ke(b)?at(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Ae(b)?(e.exit("definition"),i.parser.defined.push(l),t(b)):r(b)}}function OU(e,t,r){return i;function i(f){return cn(f)?ws(e,l)(f):r(f)}function l(f){return Y2(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return Ke(f)?at(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Ae(f)?t(f):r(f)}}const DU={name:"hardBreakEscape",tokenize:zU};function zU(e,t,r){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),l}function l(s){return Ae(s)?(e.exit("hardBreakEscape"),t(s)):r(s)}}const LU={name:"headingAtx",resolve:IU,tokenize:BU};function IU(e,t){let r=e.length-2,i=3,l,s;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(l={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},s={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},Nr(e,i,r-i+1,[["enter",l,t],["enter",s,t],["exit",s,t],["exit",l,t]])),e}function BU(e,t,r){let i=0;return l;function l(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),c(m)}function c(m){return m===35&&i++<6?(e.consume(m),c):m===null||cn(m)?(e.exit("atxHeadingSequence"),f(m)):r(m)}function f(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Ae(m)?(e.exit("atxHeading"),t(m)):Ke(m)?at(e,f,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),f(m))}function d(m){return m===null||m===35||cn(m)?(e.exit("atxHeadingText"),f(m)):(e.consume(m),d)}}const HU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],q1=["pre","script","style","textarea"],PU={concrete:!0,name:"htmlFlow",resolveTo:$U,tokenize:YU},UU={partial:!0,tokenize:FU},VU={partial:!0,tokenize:qU};function $U(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function YU(e,t,r){const i=this;let l,s,c,f,h;return d;function d(D){return m(D)}function m(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),g}function g(D){return D===33?(e.consume(D),x):D===47?(e.consume(D),s=!0,S):D===63?(e.consume(D),l=3,i.interrupt?t:M):yr(D)?(e.consume(D),c=String.fromCharCode(D),_):r(D)}function x(D){return D===45?(e.consume(D),l=2,b):D===91?(e.consume(D),l=5,f=0,E):yr(D)?(e.consume(D),l=4,i.interrupt?t:M):r(D)}function b(D){return D===45?(e.consume(D),i.interrupt?t:M):r(D)}function E(D){const oe="CDATA[";return D===oe.charCodeAt(f++)?(e.consume(D),f===oe.length?i.interrupt?t:Y:E):r(D)}function S(D){return yr(D)?(e.consume(D),c=String.fromCharCode(D),_):r(D)}function _(D){if(D===null||D===47||D===62||cn(D)){const oe=D===47,K=c.toLowerCase();return!oe&&!s&&q1.includes(K)?(l=1,i.interrupt?t(D):Y(D)):HU.includes(c.toLowerCase())?(l=6,oe?(e.consume(D),N):i.interrupt?t(D):Y(D)):(l=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(D):s?k(D):C(D))}return D===45||Cn(D)?(e.consume(D),c+=String.fromCharCode(D),_):r(D)}function N(D){return D===62?(e.consume(D),i.interrupt?t:Y):r(D)}function k(D){return Ke(D)?(e.consume(D),k):X(D)}function C(D){return D===47?(e.consume(D),X):D===58||D===95||yr(D)?(e.consume(D),A):Ke(D)?(e.consume(D),C):X(D)}function A(D){return D===45||D===46||D===58||D===95||Cn(D)?(e.consume(D),A):z(D)}function z(D){return D===61?(e.consume(D),j):Ke(D)?(e.consume(D),z):C(D)}function j(D){return D===null||D===60||D===61||D===62||D===96?r(D):D===34||D===39?(e.consume(D),h=D,L):Ke(D)?(e.consume(D),j):P(D)}function L(D){return D===h?(e.consume(D),h=null,H):D===null||Ae(D)?r(D):(e.consume(D),L)}function P(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||cn(D)?z(D):(e.consume(D),P)}function H(D){return D===47||D===62||Ke(D)?C(D):r(D)}function X(D){return D===62?(e.consume(D),q):r(D)}function q(D){return D===null||Ae(D)?Y(D):Ke(D)?(e.consume(D),q):r(D)}function Y(D){return D===45&&l===2?(e.consume(D),R):D===60&&l===1?(e.consume(D),V):D===62&&l===4?(e.consume(D),B):D===63&&l===3?(e.consume(D),M):D===93&&l===5?(e.consume(D),W):Ae(D)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(UU,G,F)(D)):D===null||Ae(D)?(e.exit("htmlFlowData"),F(D)):(e.consume(D),Y)}function F(D){return e.check(VU,O,G)(D)}function O(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return D===null||Ae(D)?F(D):(e.enter("htmlFlowData"),Y(D))}function R(D){return D===45?(e.consume(D),M):Y(D)}function V(D){return D===47?(e.consume(D),c="",$):Y(D)}function $(D){if(D===62){const oe=c.toLowerCase();return q1.includes(oe)?(e.consume(D),B):Y(D)}return yr(D)&&c.length<8?(e.consume(D),c+=String.fromCharCode(D),$):Y(D)}function W(D){return D===93?(e.consume(D),M):Y(D)}function M(D){return D===62?(e.consume(D),B):D===45&&l===2?(e.consume(D),M):Y(D)}function B(D){return D===null||Ae(D)?(e.exit("htmlFlowData"),G(D)):(e.consume(D),B)}function G(D){return e.exit("htmlFlow"),t(D)}}function qU(e,t,r){const i=this;return l;function l(c){return Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):r(c)}function s(c){return i.parser.lazy[i.now().line]?r(c):t(c)}}function FU(e,t,r){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(fd,t,r)}}const XU={name:"htmlText",tokenize:GU};function GU(e,t,r){const i=this;let l,s,c;return f;function f(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),d):M===47?(e.consume(M),z):M===63?(e.consume(M),C):yr(M)?(e.consume(M),P):r(M)}function d(M){return M===45?(e.consume(M),m):M===91?(e.consume(M),s=0,E):yr(M)?(e.consume(M),k):r(M)}function m(M){return M===45?(e.consume(M),b):r(M)}function g(M){return M===null?r(M):M===45?(e.consume(M),x):Ae(M)?(c=g,V(M)):(e.consume(M),g)}function x(M){return M===45?(e.consume(M),b):g(M)}function b(M){return M===62?R(M):M===45?x(M):g(M)}function E(M){const B="CDATA[";return M===B.charCodeAt(s++)?(e.consume(M),s===B.length?S:E):r(M)}function S(M){return M===null?r(M):M===93?(e.consume(M),_):Ae(M)?(c=S,V(M)):(e.consume(M),S)}function _(M){return M===93?(e.consume(M),N):S(M)}function N(M){return M===62?R(M):M===93?(e.consume(M),N):S(M)}function k(M){return M===null||M===62?R(M):Ae(M)?(c=k,V(M)):(e.consume(M),k)}function C(M){return M===null?r(M):M===63?(e.consume(M),A):Ae(M)?(c=C,V(M)):(e.consume(M),C)}function A(M){return M===62?R(M):C(M)}function z(M){return yr(M)?(e.consume(M),j):r(M)}function j(M){return M===45||Cn(M)?(e.consume(M),j):L(M)}function L(M){return Ae(M)?(c=L,V(M)):Ke(M)?(e.consume(M),L):R(M)}function P(M){return M===45||Cn(M)?(e.consume(M),P):M===47||M===62||cn(M)?H(M):r(M)}function H(M){return M===47?(e.consume(M),R):M===58||M===95||yr(M)?(e.consume(M),X):Ae(M)?(c=H,V(M)):Ke(M)?(e.consume(M),H):R(M)}function X(M){return M===45||M===46||M===58||M===95||Cn(M)?(e.consume(M),X):q(M)}function q(M){return M===61?(e.consume(M),Y):Ae(M)?(c=q,V(M)):Ke(M)?(e.consume(M),q):H(M)}function Y(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),l=M,F):Ae(M)?(c=Y,V(M)):Ke(M)?(e.consume(M),Y):(e.consume(M),O)}function F(M){return M===l?(e.consume(M),l=void 0,U):M===null?r(M):Ae(M)?(c=F,V(M)):(e.consume(M),F)}function O(M){return M===null||M===34||M===39||M===60||M===61||M===96?r(M):M===47||M===62||cn(M)?H(M):(e.consume(M),O)}function U(M){return M===47||M===62||cn(M)?H(M):r(M)}function R(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):r(M)}function V(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),$}function $(M){return Ke(M)?at(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):W(M)}function W(M){return e.enter("htmlTextData"),c(M)}}const Ay={name:"labelEnd",resolveAll:QU,resolveTo:JU,tokenize:e9},WU={tokenize:t9},ZU={tokenize:n9},KU={tokenize:r9};function QU(e){let t=-1;const r=[];for(;++t<e.length;){const i=e[t][1];if(r.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const l=i.type==="labelImage"?4:2;i.type="data",t+=l}}return e.length!==r.length&&Nr(e,0,e.length,r),e}function JU(e,t){let r=e.length,i=0,l,s,c,f;for(;r--;)if(l=e[r][1],s){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[r][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[r][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(s=r,l.type!=="labelLink")){i=2;break}}else l.type==="labelEnd"&&(c=r);const h={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[c][1].end}},m={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",h,t],["enter",d,t]],f=Bn(f,e.slice(s+1,s+i+3)),f=Bn(f,[["enter",m,t]]),f=Bn(f,Ty(t.parser.constructs.insideSpan.null,e.slice(s+i+4,c-3),t)),f=Bn(f,[["exit",m,t],e[c-2],e[c-1],["exit",d,t]]),f=Bn(f,e.slice(c+1)),f=Bn(f,[["exit",h,t]]),Nr(e,s,e.length,f),e}function e9(e,t,r){const i=this;let l=i.events.length,s,c;for(;l--;)if((i.events[l][1].type==="labelImage"||i.events[l][1].type==="labelLink")&&!i.events[l][1]._balanced){s=i.events[l][1];break}return f;function f(x){return s?s._inactive?g(x):(c=i.parser.defined.includes($l(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):r(x)}function h(x){return x===40?e.attempt(WU,m,c?m:g)(x):x===91?e.attempt(ZU,m,c?d:g)(x):c?m(x):g(x)}function d(x){return e.attempt(KU,m,g)(x)}function m(x){return t(x)}function g(x){return s._balanced=!0,r(x)}}function t9(e,t,r){return i;function i(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return cn(g)?ws(e,s)(g):s(g)}function s(g){return g===41?m(g):V2(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return cn(g)?ws(e,h)(g):m(g)}function f(g){return r(g)}function h(g){return g===34||g===39||g===40?Y2(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function d(g){return cn(g)?ws(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):r(g)}}function n9(e,t,r){const i=this;return l;function l(f){return $2.call(i,e,s,c,"reference","referenceMarker","referenceString")(f)}function s(f){return i.parser.defined.includes($l(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(f):r(f)}function c(f){return r(f)}}function r9(e,t,r){return i;function i(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),l}function l(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):r(s)}}const o9={name:"labelStartImage",resolveAll:Ay.resolveAll,tokenize:i9};function i9(e,t,r){const i=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),s}function s(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):r(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(f):t(f)}}const l9={name:"labelStartLink",resolveAll:Ay.resolveAll,tokenize:a9};function a9(e,t,r){const i=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),s}function s(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(c):t(c)}}const mp={name:"lineEnding",tokenize:s9};function s9(e,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),at(e,t,"linePrefix")}}const af={name:"thematicBreak",tokenize:c9};function c9(e,t,r){let i=0,l;return s;function s(d){return e.enter("thematicBreak"),c(d)}function c(d){return l=d,f(d)}function f(d){return d===l?(e.enter("thematicBreakSequence"),h(d)):i>=3&&(d===null||Ae(d))?(e.exit("thematicBreak"),t(d)):r(d)}function h(d){return d===l?(e.consume(d),i++,h):(e.exit("thematicBreakSequence"),Ke(d)?at(e,f,"whitespace")(d):f(d))}}const an={continuation:{tokenize:h9},exit:p9,name:"list",tokenize:d9},u9={partial:!0,tokenize:g9},f9={partial:!0,tokenize:m9};function d9(e,t,r){const i=this,l=i.events[i.events.length-1];let s=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(b){const E=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:cg(b)){if(i.containerState.type||(i.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(af,r,d)(b):d(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return r(b)}function h(b){return cg(b)&&++c<10?(e.consume(b),h):(!i.interrupt||c<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):r(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(fd,i.interrupt?r:m,e.attempt(u9,x,g))}function m(b){return i.containerState.initialBlankLine=!0,s++,x(b)}function g(b){return Ke(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):r(b)}function x(b){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function h9(e,t,r){const i=this;return i.containerState._closeFlow=void 0,e.check(fd,l,s);function l(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,at(e,t,"listItemIndent",i.containerState.size+1)(f)}function s(f){return i.containerState.furtherBlankLines||!Ke(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,c(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(f9,t,c)(f))}function c(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,at(e,e.attempt(an,t,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function m9(e,t,r){const i=this;return at(e,l,"listItemIndent",i.containerState.size+1);function l(s){const c=i.events[i.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===i.containerState.size?t(s):r(s)}}function p9(e){e.exit(this.containerState.type)}function g9(e,t,r){const i=this;return at(e,l,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(s){const c=i.events[i.events.length-1];return!Ke(s)&&c&&c[1].type==="listItemPrefixWhitespace"?t(s):r(s)}}const F1={name:"setextUnderline",resolveTo:y9,tokenize:x9};function y9(e,t){let r=e.length,i,l,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&e.splice(r,1),!s&&e[r][1].type==="definition"&&(s=r);const c={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",s?(e.splice(l,0,["enter",c,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=c,e.push(["exit",c,t]),e}function x9(e,t,r){const i=this;let l;return s;function s(d){let m=i.events.length,g;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){g=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(e.enter("setextHeadingLine"),l=d,c(d)):r(d)}function c(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===l?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Ke(d)?at(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Ae(d)?(e.exit("setextHeadingLine"),t(d)):r(d)}}const v9={tokenize:b9};function b9(e){const t=this,r=e.attempt(fd,i,e.attempt(this.parser.constructs.flowInitial,l,at(e,e.attempt(this.parser.constructs.flow,l,e.attempt(NU,l)),"linePrefix")));return r;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function l(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const w9={resolveAll:F2()},S9=q2("string"),E9=q2("text");function q2(e){return{resolveAll:F2(e==="text"?C9:void 0),tokenize:t};function t(r){const i=this,l=this.parser.constructs[e],s=r.attempt(l,c,f);return c;function c(m){return d(m)?s(m):f(m)}function f(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),h}function h(m){return d(m)?(r.exit("data"),s(m)):(r.consume(m),h)}function d(m){if(m===null)return!0;const g=l[m];let x=-1;if(g)for(;++x<g.length;){const b=g[x];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function F2(e){return t;function t(r,i){let l=-1,s;for(;++l<=r.length;)s===void 0?r[l]&&r[l][1].type==="data"&&(s=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==s+2&&(r[s][1].end=r[l-1][1].end,r.splice(s+2,l-s-2),l=s+2),s=void 0);return e?e(r,i):r}}function C9(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],l=t.sliceStream(i);let s=l.length,c=-1,f=0,h;for(;s--;){const d=l[s];if(typeof d=="string"){for(c=d.length;d.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(d===-2)h=!0,f++;else if(d!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(f=0),f){const d={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?c:i.start._bufferIndex+c,_index:i.start._index+s,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):(e.splice(r,0,["enter",d,t],["exit",d,t]),r+=2)}r++}return e}const N9={42:an,43:an,45:an,48:an,49:an,50:an,51:an,52:an,53:an,54:an,55:an,56:an,57:an,62:B2},_9={91:RU},k9={[-2]:hp,[-1]:hp,32:hp},T9={35:LU,42:af,45:[F1,af],60:PU,61:F1,95:af,96:Y1,126:Y1},A9={38:P2,92:H2},R9={[-5]:mp,[-4]:mp,[-3]:mp,33:o9,38:P2,42:ug,60:[lU,XU],91:l9,92:[DU,H2],93:Ay,95:ug,96:vU},j9={null:[ug,w9]},M9={null:[42,95]},O9={null:[]},D9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:M9,contentInitial:_9,disable:O9,document:N9,flow:T9,flowInitial:k9,insideSpan:j9,string:A9,text:R9},Symbol.toStringTag,{value:"Module"}));function z9(e,t,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},s=[];let c=[],f=[];const h={attempt:L(z),check:L(j),consume:k,enter:C,exit:A,interrupt:L(j,{interrupt:!0})},d={code:null,containerState:{},defineSkip:S,events:[],now:E,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:g};let m=t.tokenize.call(d,h);return t.resolveAll&&s.push(t),d;function g(q){return c=Bn(c,q),_(),c[c.length-1]!==null?[]:(P(t,0),d.events=Ty(s,d.events,d),d.events)}function x(q,Y){return I9(b(q),Y)}function b(q){return L9(c,q)}function E(){const{_bufferIndex:q,_index:Y,line:F,column:O,offset:U}=i;return{_bufferIndex:q,_index:Y,line:F,column:O,offset:U}}function S(q){l[q.line]=q.column,X()}function _(){let q;for(;i._index<c.length;){const Y=c[i._index];if(typeof Y=="string")for(q=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===q&&i._bufferIndex<Y.length;)N(Y.charCodeAt(i._bufferIndex));else N(Y)}}function N(q){m=m(q)}function k(q){Ae(q)?(i.line++,i.column=1,i.offset+=q===-3?2:1,X()):q!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===c[i._index].length&&(i._bufferIndex=-1,i._index++)),d.previous=q}function C(q,Y){const F=Y||{};return F.type=q,F.start=E(),d.events.push(["enter",F,d]),f.push(F),F}function A(q){const Y=f.pop();return Y.end=E(),d.events.push(["exit",Y,d]),Y}function z(q,Y){P(q,Y.from)}function j(q,Y){Y.restore()}function L(q,Y){return F;function F(O,U,R){let V,$,W,M;return Array.isArray(O)?G(O):"tokenize"in O?G([O]):B(O);function B(J){return te;function te(ne){const se=ne!==null&&J[ne],he=ne!==null&&J.null,me=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(he)?he:he?[he]:[]];return G(me)(ne)}}function G(J){return V=J,$=0,J.length===0?R:D(J[$])}function D(J){return te;function te(ne){return M=H(),W=J,J.partial||(d.currentConstruct=J),J.name&&d.parser.constructs.disable.null.includes(J.name)?K():J.tokenize.call(Y?Object.assign(Object.create(d),Y):d,h,oe,K)(ne)}}function oe(J){return q(W,M),U}function K(J){return M.restore(),++$<V.length?D(V[$]):R}}}function P(q,Y){q.resolveAll&&!s.includes(q)&&s.push(q),q.resolve&&Nr(d.events,Y,d.events.length-Y,q.resolve(d.events.slice(Y),d)),q.resolveTo&&(d.events=q.resolveTo(d.events,d))}function H(){const q=E(),Y=d.previous,F=d.currentConstruct,O=d.events.length,U=Array.from(f);return{from:O,restore:R};function R(){i=q,d.previous=Y,d.currentConstruct=F,d.events.length=O,f=U,X()}}function X(){i.line in l&&i.column<2&&(i.column=l[i.line],i.offset+=l[i.line]-1)}}function L9(e,t){const r=t.start._index,i=t.start._bufferIndex,l=t.end._index,s=t.end._bufferIndex;let c;if(r===l)c=[e[r].slice(i,s)];else{if(c=e.slice(r,l),i>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(i):c.shift()}s>0&&c.push(e[l].slice(0,s))}return c}function I9(e,t){let r=-1;const i=[];let l;for(;++r<e.length;){const s=e[r];let c;if(typeof s=="string")c=s;else switch(s){case-5:{c="\r";break}case-4:{c=`
64
+ `;break}case-3:{c=`\r
65
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(s)}l=s===-2,i.push(c)}return i.join("")}function B9(e){const i={constructs:q8([D9,...(e||{}).extensions||[]]),content:l(J8),defined:[],document:l(tU),flow:l(v9),lazy:{},string:l(S9),text:l(E9)};return i;function l(s){return c;function c(f){return z9(i,s,f)}}}function H9(e){for(;!U2(e););return e}const X1=/[\0\t\n\r]/g;function P9(){let e=1,t="",r=!0,i;return l;function l(s,c,f){const h=[];let d,m,g,x,b;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(c||void 0).decode(s)),g=0,t="",r&&(s.charCodeAt(0)===65279&&g++,r=void 0);g<s.length;){if(X1.lastIndex=g,d=X1.exec(s),x=d&&d.index!==void 0?d.index:s.length,b=s.charCodeAt(x),!d){t=s.slice(g);break}if(b===10&&g===x&&i)h.push(-3),i=void 0;else switch(i&&(h.push(-5),i=void 0),g<x&&(h.push(s.slice(g,x)),e+=x-g),b){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:i=!0,e=1}g=x+1}return f&&(i&&h.push(-5),t&&h.push(t),h.push(null)),h}}const U9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function V9(e){return e.replace(U9,$9)}function $9(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),s=l===120||l===88;return I2(r.slice(s?2:1),s?16:10)}return ky(r)||e}const X2={}.hasOwnProperty;function Y9(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),q9(r)(H9(B9(r).document().write(P9()(e,t,!0))))}function q9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Vt),autolinkProtocol:H,autolinkEmail:H,atxHeading:s($e),blockQuote:s(he),characterEscape:H,characterReference:H,codeFenced:s(me),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:s(me,c),codeText:s(ge,c),codeTextData:H,data:H,codeFlowValue:H,definition:s(xe),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:s(_e),hardBreakEscape:s(Pe),hardBreakTrailing:s(Pe),htmlFlow:s(st,c),htmlFlowData:H,htmlText:s(st,c),htmlTextData:H,image:s(fn),label:c,link:s(Vt),listItem:s(Vn),listItemValue:x,listOrdered:s(Kt,g),listUnordered:s(Kt),paragraph:s(jr),reference:D,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:s($e),strong:s(Mr),thematicBreak:s(mo)},exit:{atxHeading:h(),atxHeadingSequence:z,autolink:h(),autolinkEmail:se,autolinkProtocol:ne,blockQuote:h(),characterEscapeValue:X,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:J,characterReference:te,codeFenced:h(_),codeFencedFence:S,codeFencedFenceInfo:b,codeFencedFenceMeta:E,codeFlowValue:X,codeIndented:h(N),codeText:h(U),codeTextData:X,data:X,definition:h(),definitionDestinationString:A,definitionLabelString:k,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(Y),hardBreakTrailing:h(Y),htmlFlow:h(F),htmlFlowData:X,htmlText:h(O),htmlTextData:X,image:h(V),label:W,labelText:$,lineEnding:q,link:h(R),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:oe,resourceDestinationString:M,resourceTitleString:B,resource:G,setextHeading:h(P),setextHeadingLineSequence:L,setextHeadingText:j,strong:h(),thematicBreak:h()}};G2(t,(e||{}).mdastExtensions||[]);const r={};return i;function i(ce){let ye={type:"root",children:[]};const ke={stack:[ye],tokenStack:[],config:t,enter:f,exit:d,buffer:c,resume:m,data:r},Le=[];let qe=-1;for(;++qe<ce.length;)if(ce[qe][1].type==="listOrdered"||ce[qe][1].type==="listUnordered")if(ce[qe][0]==="enter")Le.push(qe);else{const Xt=Le.pop();qe=l(ce,Xt,qe)}for(qe=-1;++qe<ce.length;){const Xt=t[ce[qe][0]];X2.call(Xt,ce[qe][1].type)&&Xt[ce[qe][1].type].call(Object.assign({sliceSerialize:ce[qe][2].sliceSerialize},ke),ce[qe][1])}if(ke.tokenStack.length>0){const Xt=ke.tokenStack[ke.tokenStack.length-1];(Xt[1]||G1).call(ke,void 0,Xt[0])}for(ye.position={start:Xo(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Xo(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<t.transforms.length;)ye=t.transforms[qe](ye)||ye;return ye}function l(ce,ye,ke){let Le=ye-1,qe=-1,Xt=!1,$n,Lt,vt,$t;for(;++Le<=ke;){const Qe=ce[Le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?qe++:qe--,$t=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&($n&&!$t&&!qe&&!vt&&(vt=Le),$t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$t=void 0}if(!qe&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||qe===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if($n){let ar=Le;for(Lt=void 0;ar--;){const dn=ce[ar];if(dn[1].type==="lineEnding"||dn[1].type==="lineEndingBlank"){if(dn[0]==="exit")continue;Lt&&(ce[Lt][1].type="lineEndingBlank",Xt=!0),dn[1].type="lineEnding",Lt=ar}else if(!(dn[1].type==="linePrefix"||dn[1].type==="blockQuotePrefix"||dn[1].type==="blockQuotePrefixWhitespace"||dn[1].type==="blockQuoteMarker"||dn[1].type==="listItemIndent"))break}vt&&(!Lt||vt<Lt)&&($n._spread=!0),$n.end=Object.assign({},Lt?ce[Lt][1].start:Qe[1].end),ce.splice(Lt||Le,0,["exit",$n,Qe[2]]),Le++,ke++}if(Qe[1].type==="listItemPrefix"){const ar={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};$n=ar,ce.splice(Le,0,["enter",ar,Qe[2]]),Le++,ke++,vt=void 0,$t=!0}}}return ce[ye][1]._spread=Xt,ke}function s(ce,ye){return ke;function ke(Le){f.call(this,ce(Le),Le),ye&&ye.call(this,Le)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(ce,ye,ke){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([ye,ke||void 0]),ce.position={start:Xo(ye.start),end:void 0}}function h(ce){return ye;function ye(ke){ce&&ce.call(this,ke),d.call(this,ke)}}function d(ce,ye){const ke=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==ce.type&&(ye?ye.call(this,ce,Le[0]):(Le[1]||G1).call(this,ce,Le[0]));else throw new Error("Cannot close `"+ce.type+"` ("+bs({start:ce.start,end:ce.end})+"): it’s not open");ke.position.end=Xo(ce.end)}function m(){return $8(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(ce){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ce}function E(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ce}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce.replace(/(\r?\n|\r)$/g,"")}function k(ce){const ye=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ye,ke.identifier=$l(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ce}function A(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ce}function z(ce){const ye=this.stack[this.stack.length-1];if(!ye.depth){const ke=this.sliceSerialize(ce).length;ye.depth=ke}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function L(ce){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function H(ce){const ke=this.stack[this.stack.length-1].children;let Le=ke[ke.length-1];(!Le||Le.type!=="text")&&(Le=Rt(),Le.position={start:Xo(ce.start),end:void 0},ke.push(Le)),this.stack.push(Le)}function X(ce){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ce),ye.position.end=Xo(ce.end)}function q(ce){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=ye.children[ye.children.length-1];ke.position.end=Xo(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(H.call(this,ce),X.call(this,ce))}function Y(){this.data.atHardBreak=!0}function F(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce}function O(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce}function U(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce}function R(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ye,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function V(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ye,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function $(ce){const ye=this.sliceSerialize(ce),ke=this.stack[this.stack.length-2];ke.label=V9(ye),ke.identifier=$l(ye).toLowerCase()}function W(){const ce=this.stack[this.stack.length-1],ye=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Le=ce.children;ke.children=Le}else ke.alt=ye}function M(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ce}function B(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ce}function G(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function oe(ce){const ye=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ye,ke.identifier=$l(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function K(ce){this.data.characterReferenceType=ce.type}function J(ce){const ye=this.sliceSerialize(ce),ke=this.data.characterReferenceType;let Le;ke?(Le=I2(ye,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=ky(ye);const qe=this.stack[this.stack.length-1];qe.value+=Le}function te(ce){const ye=this.stack.pop();ye.position.end=Xo(ce.end)}function ne(ce){X.call(this,ce);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ce)}function se(ce){X.call(this,ce);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ce)}function he(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function ge(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _e(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function st(){return{type:"html",value:""}}function fn(){return{type:"image",title:null,url:"",alt:null}}function Vt(){return{type:"link",title:null,url:"",children:[]}}function Kt(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Vn(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function jr(){return{type:"paragraph",children:[]}}function Mr(){return{type:"strong",children:[]}}function Rt(){return{type:"text",value:""}}function mo(){return{type:"thematicBreak"}}}function Xo(e){return{line:e.line,column:e.column,offset:e.offset}}function G2(e,t){let r=-1;for(;++r<t.length;){const i=t[r];Array.isArray(i)?G2(e,i):F9(e,i)}}function F9(e,t){let r;for(r in t)if(X2.call(t,r))switch(r){case"canContainEols":{const i=t[r];i&&e[r].push(...i);break}case"transforms":{const i=t[r];i&&e[r].push(...i);break}case"enter":case"exit":{const i=t[r];i&&Object.assign(e[r],i);break}}}function G1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bs({start:t.start,end:t.end})+") is still open")}function X9(e){const t=this;t.parser=r;function r(i){return Y9(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function G9(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function W9(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
66
+ `}]}function Z9(e,t){const r=t.value?t.value+`
67
+ `:"",i={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(i.className=["language-"+l[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function K9(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Q9(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function J9(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=fa(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let c,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),c=e.footnoteOrder.length):c=s+1,f+=1,e.footnoteCounts.set(i,f);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function eV(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function tV(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function W2(e,t){const r=t.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const l=e.all(t),s=l[0];s&&s.type==="text"?s.value="["+s.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=i:l.push({type:"text",value:i}),l}function nV(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return W2(e,t);const l={src:fa(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(l.title=i.title);const s={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,s),e.applyData(t,s)}function rV(e,t){const r={src:fa(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function oV(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,i),e.applyData(t,i)}function iV(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return W2(e,t);const l={href:fa(i.url||"")};i.title!==null&&i.title!==void 0&&(l.title=i.title);const s={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function lV(e,t){const r={href:fa(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function aV(e,t,r){const i=e.all(t),l=r?sV(r):Z2(t),s={},c=[];if(typeof t.checked=="boolean"){const m=i[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const m=i[f];(l||f!==0||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
68
+ `}),m.type==="element"&&m.tagName==="p"&&!l?c.push(...m.children):c.push(m)}const h=i[i.length-1];h&&(l||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
69
+ `});const d={type:"element",tagName:"li",properties:s,children:c};return e.patch(t,d),e.applyData(t,d)}function sV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let i=-1;for(;!t&&++i<r.length;)t=Z2(r[i])}return t}function Z2(e){const t=e.spread;return t??e.children.length>1}function cV(e,t){const r={},i=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++l<i.length;){const c=i[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function uV(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fV(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function dV(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hV(e,t){const r=e.all(t),i=r.shift(),l=[];if(i){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],c),l.push(c)}if(r.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Ey(t.children[1]),h=R2(t.children[t.children.length-1]);f&&h&&(c.position={start:f,end:h}),l.push(c)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,s),e.applyData(t,s)}function mV(e,t,r){const i=r?r.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",c=r&&r.type==="table"?r.align:void 0,f=c?c.length:t.children.length;let h=-1;const d=[];for(;++h<f;){const g=t.children[h],x={},b=c?c[h]:void 0;b&&(x.align=b);let E={type:"element",tagName:s,properties:x,children:[]};g&&(E.children=e.all(g),e.patch(g,E),E=e.applyData(g,E)),d.push(E)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function pV(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const W1=9,Z1=32;function gV(e){const t=String(e),r=/\r?\n|\r/g;let i=r.exec(t),l=0;const s=[];for(;i;)s.push(K1(t.slice(l,i.index),l>0,!0),i[0]),l=i.index+i[0].length,i=r.exec(t);return s.push(K1(t.slice(l),l>0,!1)),s.join("")}function K1(e,t,r){let i=0,l=e.length;if(t){let s=e.codePointAt(i);for(;s===W1||s===Z1;)i++,s=e.codePointAt(i)}if(r){let s=e.codePointAt(l-1);for(;s===W1||s===Z1;)l--,s=e.codePointAt(l-1)}return l>i?e.slice(i,l):""}function yV(e,t){const r={type:"text",value:gV(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function xV(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const vV={blockquote:G9,break:W9,code:Z9,delete:K9,emphasis:Q9,footnoteReference:J9,heading:eV,html:tV,imageReference:nV,image:rV,inlineCode:oV,linkReference:iV,link:lV,listItem:aV,list:cV,paragraph:uV,root:fV,strong:dV,table:hV,tableCell:pV,tableRow:mV,text:yV,thematicBreak:xV,toml:Fu,yaml:Fu,definition:Fu,footnoteDefinition:Fu};function Fu(){}const K2=-1,dd=0,Ss=1,Mf=2,Ry=3,jy=4,My=5,Oy=6,Q2=7,J2=8,Q1=typeof self=="object"?self:globalThis,bV=(e,t)=>{const r=(l,s)=>(e.set(s,l),l),i=l=>{if(e.has(l))return e.get(l);const[s,c]=t[l];switch(s){case dd:case K2:return r(c,l);case Ss:{const f=r([],l);for(const h of c)f.push(i(h));return f}case Mf:{const f=r({},l);for(const[h,d]of c)f[i(h)]=i(d);return f}case Ry:return r(new Date(c),l);case jy:{const{source:f,flags:h}=c;return r(new RegExp(f,h),l)}case My:{const f=r(new Map,l);for(const[h,d]of c)f.set(i(h),i(d));return f}case Oy:{const f=r(new Set,l);for(const h of c)f.add(i(h));return f}case Q2:{const{name:f,message:h}=c;return r(new Q1[f](h),l)}case J2:return r(BigInt(c),l);case"BigInt":return r(Object(BigInt(c)),l);case"ArrayBuffer":return r(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return r(new DataView(f),c)}}return r(new Q1[s](c),l)};return i},J1=e=>bV(new Map,e)(0),zl="",{toString:wV}={},{keys:SV}=Object,ms=e=>{const t=typeof e;if(t!=="object"||!e)return[dd,t];const r=wV.call(e).slice(8,-1);switch(r){case"Array":return[Ss,zl];case"Object":return[Mf,zl];case"Date":return[Ry,zl];case"RegExp":return[jy,zl];case"Map":return[My,zl];case"Set":return[Oy,zl];case"DataView":return[Ss,r]}return r.includes("Array")?[Ss,r]:r.includes("Error")?[Q2,r]:[Mf,r]},Xu=([e,t])=>e===dd&&(t==="function"||t==="symbol"),EV=(e,t,r,i)=>{const l=(c,f)=>{const h=i.push(c)-1;return r.set(f,h),h},s=c=>{if(r.has(c))return r.get(c);let[f,h]=ms(c);switch(f){case dd:{let m=c;switch(h){case"bigint":f=J2,m=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);m=null;break;case"undefined":return l([K2],c)}return l([f,m],c)}case Ss:{if(h){let x=c;return h==="DataView"?x=new Uint8Array(c.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(c)),l([h,[...x]],c)}const m=[],g=l([f,m],c);for(const x of c)m.push(s(x));return g}case Mf:{if(h)switch(h){case"BigInt":return l([h,c.toString()],c);case"Boolean":case"Number":case"String":return l([h,c.valueOf()],c)}if(t&&"toJSON"in c)return s(c.toJSON());const m=[],g=l([f,m],c);for(const x of SV(c))(e||!Xu(ms(c[x])))&&m.push([s(x),s(c[x])]);return g}case Ry:return l([f,c.toISOString()],c);case jy:{const{source:m,flags:g}=c;return l([f,{source:m,flags:g}],c)}case My:{const m=[],g=l([f,m],c);for(const[x,b]of c)(e||!(Xu(ms(x))||Xu(ms(b))))&&m.push([s(x),s(b)]);return g}case Oy:{const m=[],g=l([f,m],c);for(const x of c)(e||!Xu(ms(x)))&&m.push(s(x));return g}}const{message:d}=c;return l([f,{name:h,message:d}],c)};return s},eS=(e,{json:t,lossy:r}={})=>{const i=[];return EV(!(t||r),!!t,new Map,i)(e),i},Of=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?J1(eS(e,t)):structuredClone(e):(e,t)=>J1(eS(e,t));function CV(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function NV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function _V(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||CV,i=e.options.footnoteBackLabel||NV,l=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const m=e.all(d),g=String(d.identifier).toUpperCase(),x=fa(g.toLowerCase());let b=0;const E=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++b<=S;){E.length>0&&E.push({type:"text",value:" "});let k=typeof r=="string"?r:r(h,b);typeof k=="string"&&(k={type:"text",value:k}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(h,b),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const _=m[m.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const k=_.children[_.children.length-1];k&&k.type==="text"?k.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...E)}else m.push(...E);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(m,!0)};e.patch(d,N),f.push(N)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Of(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
70
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
71
+ `}]}}const ek=(function(e){if(e==null)return RV;if(typeof e=="function")return hd(e);if(typeof e=="object")return Array.isArray(e)?kV(e):TV(e);if(typeof e=="string")return AV(e);throw new Error("Expected function, string, or object as test")});function kV(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=ek(e[r]);return hd(i);function i(...l){let s=-1;for(;++s<t.length;)if(t[s].apply(this,l))return!0;return!1}}function TV(e){const t=e;return hd(r);function r(i){const l=i;let s;for(s in e)if(l[s]!==t[s])return!1;return!0}}function AV(e){return hd(t);function t(r){return r&&r.type===e}}function hd(e){return t;function t(r,i,l){return!!(jV(r)&&e.call(this,r,typeof i=="number"?i:void 0,l||void 0))}}function RV(){return!0}function jV(e){return e!==null&&typeof e=="object"&&"type"in e}const tk=[],MV=!0,tS=!1,OV="skip";function DV(e,t,r,i){let l;typeof t=="function"&&typeof r!="function"?(i=r,r=t):l=t;const s=ek(l),c=i?-1:1;f(e,void 0,[])();function f(h,d,m){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=tk,E,S,_;if((!t||s(h,d,m[m.length-1]||void 0))&&(b=zV(r(h,m)),b[0]===tS))return b;if("children"in h&&h.children){const N=h;if(N.children&&b[0]!==OV)for(S=(i?N.children.length:-1)+c,_=m.concat(N);S>-1&&S<N.children.length;){const k=N.children[S];if(E=f(k,S,_)(),E[0]===tS)return E;S=typeof E[1]=="number"?E[1]:S+c}}return b}}}function zV(e){return Array.isArray(e)?e:typeof e=="number"?[MV,e]:e==null?tk:[e]}function nk(e,t,r,i){let l,s,c;typeof t=="function"&&typeof r!="function"?(s=void 0,c=t,l=r):(s=t,c=r,l=i),DV(e,s,f,l);function f(h,d){const m=d[d.length-1],g=m?m.children.indexOf(h):void 0;return c(h,g,m)}}const fg={}.hasOwnProperty,LV={};function IV(e,t){const r=t||LV,i=new Map,l=new Map,s=new Map,c={...vV,...r.handlers},f={all:d,applyData:HV,definitionById:i,footnoteById:l,footnoteCounts:s,footnoteOrder:[],handlers:c,one:h,options:r,patch:BV,wrap:UV};return nk(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?i:l,x=String(m.identifier).toUpperCase();g.has(x)||g.set(x,m)}}),f;function h(m,g){const x=m.type,b=f.handlers[x];if(fg.call(f.handlers,x)&&b)return b(f,m,g);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in m){const{children:S,..._}=m,N=Of(_);return N.children=f.all(m),N}return Of(m)}return(f.options.unknownHandler||PV)(f,m,g)}function d(m){const g=[];if("children"in m){const x=m.children;let b=-1;for(;++b<x.length;){const E=f.one(x[b],m);if(E){if(b&&x[b-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=nS(E.value)),!Array.isArray(E)&&E.type==="element")){const S=E.children[0];S&&S.type==="text"&&(S.value=nS(S.value))}Array.isArray(E)?g.push(...E):g.push(E)}}}return g}}function BV(e,t){e.position&&(t.position=w8(e))}function HV(e,t){let r=t;if(e&&e.data){const i=e.data.hName,l=e.data.hChildren,s=e.data.hProperties;if(typeof i=="string")if(r.type==="element")r.tagName=i;else{const c="children"in r?r.children:[r];r={type:"element",tagName:i,properties:{},children:c}}r.type==="element"&&s&&Object.assign(r.properties,Of(s)),"children"in r&&r.children&&l!==null&&l!==void 0&&(r.children=l)}return r}function PV(e,t){const r=t.data||{},i="value"in t&&!(fg.call(r,"hProperties")||fg.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function UV(e,t){const r=[];let i=-1;for(t&&r.push({type:"text",value:`
72
+ `});++i<e.length;)i&&r.push({type:"text",value:`
73
+ `}),r.push(e[i]);return t&&e.length>0&&r.push({type:"text",value:`
74
+ `}),r}function nS(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function rS(e,t){const r=IV(e,t),i=r.one(e,void 0),l=_V(r),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return l&&s.children.push({type:"text",value:`
75
+ `},l),s}function VV(e,t){return e&&"run"in e?async function(r,i){const l=rS(r,{file:i,...t});await e.run(l,i)}:function(r,i){return rS(r,{file:i,...e||t})}}function oS(e){if(e)throw e}var pp,iS;function $V(){if(iS)return pp;iS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},s=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!g)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},c=function(d,m){r&&m.name==="__proto__"?r(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},f=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(i)return i(d,m).value}else return;return d[m]};return pp=function h(){var d,m,g,x,b,E,S=arguments[0],_=1,N=arguments.length,k=!1;for(typeof S=="boolean"&&(k=S,S=arguments[1]||{},_=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});_<N;++_)if(d=arguments[_],d!=null)for(m in d)g=f(S,m),x=f(d,m),S!==x&&(k&&x&&(s(x)||(b=l(x)))?(b?(b=!1,E=g&&l(g)?g:[]):E=g&&s(g)?g:{},c(S,{name:m,newValue:h(k,E,x)})):typeof x<"u"&&c(S,{name:m,newValue:x}));return S},pp}var YV=$V();const gp=Us(YV);function dg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function qV(){const e=[],t={run:r,use:i};return t;function r(...l){let s=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(h,...d){const m=e[++s];let g=-1;if(h){c(h);return}for(;++g<l.length;)(d[g]===null||d[g]===void 0)&&(d[g]=l[g]);l=d,m?FV(m,f)(...d):c(null,...d)}}function i(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function FV(e,t){let r;return i;function i(...c){const f=e.length>c.length;let h;f&&c.push(l);try{h=e.apply(this,c)}catch(d){const m=d;if(f&&r)throw m;return l(m)}f||(h&&h.then&&typeof h.then=="function"?h.then(s,l):h instanceof Error?l(h):s(h))}function l(c,...f){r||(r=!0,t(c,...f))}function s(c){l(null,c)}}const mr={basename:XV,dirname:GV,extname:WV,join:ZV,sep:"/"};function XV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nc(e);let r=0,i=-1,l=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(s){r=l+1;break}}else i<0&&(s=!0,i=l+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(s){r=l+1;break}}else c<0&&(s=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(i=l):(f=-1,i=c));return r===i?i=c:i<0&&(i=e.length),e.slice(r,i)}function GV(e){if(nc(e),e.length===0)return".";let t=-1,r=e.length,i;for(;--r;)if(e.codePointAt(r)===47){if(i){t=r;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function WV(e){nc(e);let t=e.length,r=-1,i=0,l=-1,s=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){i=t+1;break}continue}r<0&&(c=!0,r=t+1),f===46?l<0?l=t:s!==1&&(s=1):l>-1&&(s=-1)}return l<0||r<0||s===0||s===1&&l===r-1&&l===i+1?"":e.slice(l,r)}function ZV(...e){let t=-1,r;for(;++t<e.length;)nc(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":KV(r)}function KV(e){nc(e);const t=e.codePointAt(0)===47;let r=QV(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function QV(e,t){let r="",i=0,l=-1,s=0,c=-1,f,h;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||s===1))if(l!==c-1&&s===2){if(r.length<2||i!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",i=0):(r=r.slice(0,h),i=r.length-1-r.lastIndexOf("/")),l=c,s=0;continue}}else if(r.length>0){r="",i=0,l=c,s=0;continue}}t&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+e.slice(l+1,c):r=e.slice(l+1,c),i=c-l-1;l=c,s=0}else f===46&&s>-1?s++:s=-1}return r}function nc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const JV={cwd:e$};function e$(){return"/"}function hg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function t$(e){if(typeof e=="string")e=new URL(e);else if(!hg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return n$(e)}function n$(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const i=t.codePointAt(r+2);if(i===70||i===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const yp=["history","path","basename","stem","extname","dirname"];class rk{constructor(t){let r;t?hg(t)?r={path:t}:typeof t=="string"||r$(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":JV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<yp.length;){const s=yp[i];s in r&&r[s]!==void 0&&r[s]!==null&&(this[s]=s==="history"?[...r[s]]:r[s])}let l;for(l in r)yp.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?mr.basename(this.path):void 0}set basename(t){vp(t,"basename"),xp(t,"basename"),this.path=mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?mr.dirname(this.path):void 0}set dirname(t){lS(this.basename,"dirname"),this.path=mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?mr.extname(this.path):void 0}set extname(t){if(xp(t,"extname"),lS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){hg(t)&&(t=t$(t)),vp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?mr.basename(this.path,this.extname):void 0}set stem(t){vp(t,"stem"),xp(t,"stem"),this.path=mr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,i){const l=this.message(t,r,i);throw l.fatal=!0,l}info(t,r,i){const l=this.message(t,r,i);return l.fatal=void 0,l}message(t,r,i){const l=new Ft(t,r,i);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function xp(e,t){if(e&&e.includes(mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+mr.sep+"`")}function vp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function lS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function r$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const o$=(function(e){const i=this.constructor.prototype,l=i[e],s=function(){return l.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),i$={}.hasOwnProperty;class Dy extends o${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=qV()}copy(){const t=new Dy;let r=-1;for(;++r<this.attachers.length;){const i=this.attachers[r];t.use(...i)}return t.data(gp(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Sp("data",this.frozen),this.namespace[t]=r,this):i$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Sp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const l=r.call(t,...i);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Gu(t),i=this.parser||this.Parser;return bp("parse",i),i(String(r),r)}process(t,r){const i=this;return this.freeze(),bp("process",this.parser||this.Parser),wp("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(s,c){const f=Gu(t),h=i.parse(f);i.run(h,f,function(m,g,x){if(m||!g||!x)return d(m);const b=g,E=i.stringify(b,x);s$(E)?x.value=E:x.result=E,d(m,x)});function d(m,g){m||!g?c(m):s?s(g):r(void 0,g)}}}processSync(t){let r=!1,i;return this.freeze(),bp("processSync",this.parser||this.Parser),wp("processSync",this.compiler||this.Compiler),this.process(t,l),sS("processSync","process",r),i;function l(s,c){r=!0,oS(s),i=c}}run(t,r,i){aS(t),this.freeze();const l=this.transformers;return!i&&typeof r=="function"&&(i=r,r=void 0),i?s(void 0,i):new Promise(s);function s(c,f){const h=Gu(r);l.run(t,h,d);function d(m,g,x){const b=g||t;m?f(m):c?c(b):i(void 0,b,x)}}}runSync(t,r){let i=!1,l;return this.run(t,r,s),sS("runSync","run",i),l;function s(c,f){oS(c),l=f,i=!0}}stringify(t,r){this.freeze();const i=Gu(r),l=this.compiler||this.Compiler;return wp("stringify",l),aS(t),l(t,i)}use(t,...r){const i=this.attachers,l=this.namespace;if(Sp("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...g]=d;h(m,g)}else c(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function c(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(d.plugins),d.settings&&(l.settings=gp(!0,l.settings,d.settings))}function f(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const g=d[m];s(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,m){let g=-1,x=-1;for(;++g<i.length;)if(i[g][0]===d){x=g;break}if(x===-1)i.push([d,...m]);else if(m.length>0){let[b,...E]=m;const S=i[x][1];dg(S)&&dg(b)&&(b=gp(!0,S,b)),i[x]=[d,b,...E]}}}}const l$=new Dy().freeze();function bp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function wp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function aS(e){if(!dg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sS(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gu(e){return a$(e)?e:new rk(e)}function a$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function s$(e){return typeof e=="string"||c$(e)}function c$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",cS=[],uS={allowDangerousHtml:!0},f$=/^(https?|ircs?|mailto|xmpp)$/i,d$=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function h$(e){const t=m$(e),r=p$(e);return g$(t.runSync(t.parse(r),r),e)}function m$(e){const t=e.rehypePlugins||cS,r=e.remarkPlugins||cS,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uS}:uS;return l$().use(X9).use(r).use(VV,i).use(t)}function p$(e){const t=e.children||"",r=new rk;return typeof t=="string"&&(r.value=t),r}function g$(e,t){const r=t.allowedElements,i=t.allowElement,l=t.components,s=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||y$;for(const m of d$)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+u$+m.id,void 0);return nk(e,d),_8(e,{Fragment:p.Fragment,components:l,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function d(m,g,x){if(m.type==="raw"&&x&&typeof g=="number")return c?x.children.splice(g,1):x.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let b;for(b in dp)if(Object.hasOwn(dp,b)&&Object.hasOwn(m.properties,b)){const E=m.properties[b],S=dp[b];(S===null||S.includes(m.tagName))&&(m.properties[b]=h(String(E||""),b,m))}}if(m.type==="element"){let b=r?!r.includes(m.tagName):s?s.includes(m.tagName):!1;if(!b&&i&&typeof g=="number"&&(b=!i(m,g,x)),b&&x&&typeof g=="number")return f&&m.children?x.children.splice(g,1,...m.children):x.children.splice(g,1),g}}}function y$(e){const t=e.indexOf(":"),r=e.indexOf("?"),i=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||r!==-1&&t>r||i!==-1&&t>i||f$.test(e.slice(0,t))?e:""}const x$=new Set(["idea_summary","why_now_thesis","description","excerpt","reliability_reason","importance_reason","summary","content","body","notes"]);function v$(e){return x$.has(e)||e.endsWith("_reason")||e.endsWith("_summary")}function b$(e){if(!e||typeof e!="string")return!1;const t=e.trim(),r=t.includes("\\n")&&!t.includes(`
76
+ `)?t.replace(/\\n/g,`
77
+ `):t;if(!r)return!1;if(r.includes("```")||/^#{1,6}\s+/.test(r)||/^\s*>\s+/.test(r)||/^\s*[-*+]\s+/.test(r)||/^\s*\d+\.\s+/.test(r))return!0;const i=[/^#{1,6}\s+/m,/^\s*[-*+]\s+/m,/^\s*\d+\.\s+/m,/^\s*>\s+/m];return!!(r.includes(`
78
+ `)&&i.some(l=>l.test(r))||/\[[^\]]+\]\([^)]+\)/.test(r)||/\*\*[^*]+\*\*/.test(r)||/_([^_]+)_/.test(r))}function md(e,t){return typeof t=="string"&&(v$(e)||b$(t))}function w$(e,t){return t.length===0?e:e.replace(/\[(\d+)\]/g,(r,i)=>{const l=parseInt(i,10),s=t[l-1];if(!s)return`[${i}]`;const c=s.url??`#source-${s.id}`,f=s.label?` "${s.label.replace(/"/g,'\\"')}"`:"";return`[${i}](${c}${f})`})}function Ui({content:e,className:t,sourceRefs:r=[]}){if(!e||typeof e!="string")return null;const i=e.includes("\\n")&&!e.includes(`
79
+ `)?e.replace(/\\n/g,`
80
+ `):e,l=r.length>0?w$(i,r):i;return p.jsx("div",{className:ve("rich-text text-sm space-y-2",t),children:p.jsx(h$,{components:{p:({children:s})=>p.jsx("p",{className:"my-1.5",children:s}),ul:({children:s})=>p.jsx("ul",{className:"list-disc list-inside my-1.5 space-y-0.5",children:s}),ol:({children:s})=>p.jsx("ol",{className:"list-decimal list-inside my-1.5 space-y-0.5",children:s}),li:({children:s})=>p.jsx("li",{className:"my-0.5",children:s}),h1:({children:s})=>p.jsx("h1",{className:"font-semibold mt-4 mb-2 text-base first:mt-0",children:s}),h2:({children:s})=>p.jsx("h2",{className:"font-semibold mt-4 mb-2 text-base",children:s}),h3:({children:s})=>p.jsx("h3",{className:"font-semibold mt-3 mb-1.5 text-sm",children:s}),strong:({children:s})=>p.jsx("strong",{className:"font-semibold",children:s}),em:({children:s})=>p.jsx("em",{className:"italic",children:s}),code:({children:s})=>p.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs",children:s}),pre:({children:s})=>p.jsx("pre",{className:"bg-muted p-2 rounded overflow-x-auto text-xs my-2",children:s}),blockquote:({children:s})=>p.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 my-2 text-muted-foreground",children:s}),a:({href:s,children:c})=>p.jsx("a",{href:s,target:s?.startsWith("#")?void 0:"_blank",rel:s?.startsWith("#")?void 0:"noopener noreferrer",className:"text-primary hover:underline source-ref",children:c})},children:l})})}const S$={workflow:VP,collection:YP},E$=[],C$=[];function N$({workflow:e,workflowId:t,versionId:r,events:i,onStepClick:l,onCollectionClick:s,collectedKinds:c,nodeResults:f,readOnly:h=!0,nodesDraggable:d=!1,showControls:m=!0,showBackground:g=!1,className:x="",nodesOverride:b,edgesOverride:E,runsVersionForLink:S}){const[_,N]=w.useState(null),k=w.useRef(null),{fitView:C}=sd(),A=w.useMemo(()=>new Set(c??[]),[c]);w.useEffect(()=>{let K=!1;const J=setTimeout(()=>{if(K)return;const te=i?ZP(i):void 0;N(S2(e,te,A))},0);return()=>{K=!0,clearTimeout(J)}},[e,i,A]);const z=b??(_?_.nodes:E$),j=E??(_?_.edges:C$),[L,P,H]=fP(z),[X,q,Y]=dP(j);w.useEffect(()=>{P(z),q(j)},[z,j,P,q]),w.useEffect(()=>{if(!L.length)return;const K=setTimeout(()=>{C({padding:.35,duration:250,minZoom:.15,maxZoom:1.2})},80);return()=>clearTimeout(K)},[L.length,X.length,C]);const F=d||!h,[O,U]=w.useState(null),[R,V]=w.useState({}),[$,W]=w.useState({}),{theme:M}=PS();w.useEffect(()=>{if(!O||!t||!r)return;const J=O.data?.nodeId;!J||O.type!=="workflow"||J in R||(W(te=>({...te,[J]:!0})),lt.getWorkflowNodePrompt(t,r,J).then(te=>{V(ne=>({...ne,[J]:te})),W(ne=>({...ne,[J]:!1}))}).catch(()=>W(te=>({...te,[J]:!1}))))},[O,t,r,R]);function B(K,J){const te=J.data;if(J.type==="collection"){const se=te.kind;if(se&&s){s(se),U(null);return}}U(J);const ne=te.nodeId??void 0;ne&&l?.(ne)}function G(K){K||U(null)}function D(K){return!f||f.length===0?null:f.find(J=>J.node_id===K)??null}function oe(K){if(K.type==="collection"){const ne=K.data;return p.jsxs(p.Fragment,{children:[p.jsxs(bf,{children:[p.jsxs(As,{className:"text-base",children:["Collection: ",ne.kind]}),p.jsxs(wf,{className:"sr-only",children:["Collection details: ",ne.kind]}),p.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:p.jsx(ta,{value:ne.kind})})]}),p.jsx("div",{className:"space-y-4 pt-4",children:p.jsx(gt,{to:`/data/${encodeURIComponent(ne.kind)}`,className:`text-sm font-medium ${En}`,children:"View data →"})})]})}const J=K.data,te=D(J.nodeId);return p.jsxs(p.Fragment,{children:[p.jsxs(bf,{children:[p.jsx(As,{className:"text-base",children:w2(J.nodeId)}),p.jsxs(wf,{className:"sr-only",children:["Workflow node details: ",J.nodeId]}),p.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:p.jsx(ta,{value:J.nodeId})})]}),p.jsxs("div",{className:"space-y-4 pt-4",children:[f!==void 0&&p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Node result"}),te?p.jsxs("div",{className:"mt-1 rounded-md border border-border bg-muted/20 p-2 space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:"text-xs text-muted-foreground",children:"Status"}),p.jsx("span",{className:"text-xs font-medium",children:te.status})]}),p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:"text-xs text-muted-foreground",children:"Started"}),p.jsx("span",{className:"text-xs",children:ji(te.started_at)})]}),te.completed_at&&p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:"text-xs text-muted-foreground",children:"Completed"}),p.jsx("span",{className:"text-xs",children:ji(te.completed_at)})]}),te.output&&p.jsx("div",{className:"pt-2 border-t border-border",children:p.jsx(Ui,{content:te.output,className:"prose prose-sm dark:prose-invert max-w-none"})})]}):p.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"No node result yet."})]}),(()=>{const ne=(t&&r&&R[J.nodeId]?.prompt)??(t&&r&&R[J.nodeId]?.description)??J.description;return t&&r&&$[J.nodeId]?p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Prompt"}),p.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Loading…"})]}):ne?p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Prompt"}),p.jsx(Ui,{content:ne,className:"text-sm text-foreground mt-1 leading-relaxed prose prose-sm dark:prose-invert max-w-none [&_p]:mt-0 [&_p:first-child]:mt-0"}),p.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Prompts work best when long and specific: goal, constraints, and format."})]}):null})(),t&&r&&R[J.nodeId]?.minimum_rows!=null&&p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Minimum rows"}),p.jsxs("p",{className:"text-sm mt-0.5",children:["Produce at least ",R[J.nodeId].minimum_rows," items"]})]}),p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Input collections"}),(J.input??[]).length===0?p.jsx("p",{className:"font-mono text-sm",children:"-"}):p.jsx("div",{className:"flex flex-wrap gap-1.5",children:(J.input??[]).map(ne=>p.jsx("button",{type:"button",className:`text-xs font-mono px-2 py-1 rounded border hover:brightness-95 cursor-pointer transition-colors ${s?En:""}`,style:{borderColor:xr(ne),backgroundColor:`${xr(ne)}22`},onClick:()=>{s&&(s(ne),U(null))},children:ne},`in-${ne}`))})]}),p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Output collections"}),(J.output??[]).length===0?p.jsx("p",{className:"font-mono text-sm",children:"-"}):p.jsx("div",{className:"flex flex-wrap gap-1.5",children:(J.output??[]).map(ne=>p.jsx("button",{type:"button",className:`text-xs font-mono px-2 py-1 rounded border hover:brightness-95 cursor-pointer transition-colors ${s?En:""}`,style:{borderColor:xr(ne),backgroundColor:`${xr(ne)}22`},onClick:()=>{s&&(s(ne),U(null))},children:ne},`out-${ne}`))})]}),(()=>{const ne=(t&&r&&R[J.nodeId]?.required_mcps)??J.requiredMcps,se=(t&&r&&R[J.nodeId]?.required_skills)??J.requiredSkills,he=Array.isArray(ne)?ne:[],me=Array.isArray(se)?se:[];return he.length===0&&me.length===0?null:p.jsxs(p.Fragment,{children:[me.length>0&&p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Required skills"}),p.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:me.map(ge=>p.jsx(Kn,{variant:"outline",className:"font-mono text-xs",children:ge},ge))})]}),he.length>0&&p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Required MCPs"}),p.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:he.map(ge=>p.jsx(Kn,{variant:"secondary",className:"font-mono text-xs",children:ge},ge))})]})]})})(),J.stepStatus&&p.jsxs("div",{children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Status"}),p.jsx("p",{className:"mt-0.5",children:J.stepStatus})]}),S&&p.jsx("div",{className:"pt-4 border-t border-border",children:p.jsxs(gt,{to:`/runs?version=${encodeURIComponent(S)}`,className:`text-sm font-medium ${En}`,children:["View runs (",S,")"]})})]})]})}return p.jsxs(p.Fragment,{children:[p.jsxs(uP,{nodes:L,edges:X,onNodesChange:H,onInit:K=>{k.current=K,setTimeout(()=>{K.fitView({padding:.35,duration:200,minZoom:.15,maxZoom:1.2})},60)},onEdgesChange:Y,onNodeClick:B,nodeTypes:S$,nodesDraggable:F,nodesConnectable:!h,elementsSelectable:!0,defaultEdgeOptions:{type:"smoothstep",markerEnd:{type:Ls.ArrowClosed}},nodeOrigin:[.5,.5],fitView:!0,fitViewOptions:{padding:.5,duration:0,minZoom:.15},minZoom:.15,proOptions:{hideAttribution:!0},className:ve(x||"bg-muted/20",M==="dark"&&"dark"),children:[g&&p.jsx(yP,{variant:lo.Dots}),m&&p.jsx(CP,{showInteractive:!1})]}),p.jsx(ny,{open:!!O,onOpenChange:G,children:p.jsx(ry,{side:"right",className:"w-full max-w-md",children:O&&oe(O)})})]})}function ok(e){return p.jsx(g2,{children:p.jsx("div",{className:"relative w-full h-full min-h-[200px]",children:p.jsx(N$,{...e})})})}function fS(e){return`${e.id}|${e.type}|${(e.input_collections??[]).join(",")}|${(e.output_collections??[]).join(",")}|${e.prompt??""}|${e.description??""}`}function _$(e,t){const r=[],i=[],l=[],s=new Map(e.nodes.map(d=>[d.id,d])),c=new Map(t.nodes.map(d=>[d.id,d]));for(const d of c.keys())s.has(d)?fS(s.get(d))!==fS(c.get(d))&&l.push(d):r.push(d);for(const d of s.keys())c.has(d)||i.push(d);return{nodesAdded:r,nodesRemoved:i,nodesChanged:l,edgesAdded:[],edgesRemoved:[]}}const k$=2e3;function dS(){const{selectedWorkflowId:e,setSelectedWorkflowId:t,selectedWorkflow:r}=sa(),[i,l]=qs(),s=i.get("workflow_id"),c=i.get("version_id"),[f,h]=w.useState(null),[d,m]=w.useState([]),[g,x]=w.useState(c),[b,E]=w.useState(null),[S,_]=w.useState(null),[N,k]=w.useState(!1),[C,A]=w.useState({}),[z,j]=w.useState(null),[L,P]=w.useState(null);w.useEffect(()=>{s&&s!==e&&t(s)},[s,e,t]);const H=w.useCallback(async()=>{try{if(!e)return;const R=await lt.getWorkflow(e),V=await lt.getWorkflowVersions(e);h(R),m(V);const $=c??R.current_version_id,M=V.some(B=>B.version_id===$)?$:V[0]?.version_id??null;x(M),P(null)}catch(R){P(R instanceof Error?R.message:String(R))}},[e,c]);w.useEffect(()=>{H();const R=setInterval(H,k$);return()=>clearInterval(R)},[H]),w.useEffect(()=>{if(!e||!g){E(null);return}lt.getWorkflowVersion(e,g).then(E).catch(()=>E(null))},[e,g]),w.useEffect(()=>{if(!e){A({});return}lt.getCollectionSchema(e).then(R=>A(R.kinds??{})).catch(()=>A({}))},[e]),w.useEffect(()=>{if(!e||!g||d.length===0){_(null);return}const R=d.findIndex($=>$.version_id===g);if(R<=0){_(null),k(!1);return}const V=d[R-1].version_id;lt.getWorkflowVersion(e,V).then(_).catch(()=>_(null))},[e,g,d]);const X=w.useMemo(()=>!S||!b?null:_$(S,b),[S,b]),q=w.useMemo(()=>{if(!X||!b||!S||!N)return;const R=S.nodes.filter(B=>X.nodesRemoved.includes(B.id)),V={...b,nodes:[...b.nodes,...R]},{nodes:$,edges:W}=S2(V);return{nodes:$.map(B=>{if(B.type!=="workflow")return B;const G=B.data.nodeId;let D;return X.nodesAdded.includes(G)?D="added":X.nodesChanged.includes(G)?D="changed":X.nodesRemoved.includes(G)&&(D="removed"),{...B,data:{...B.data,changeStatus:D}}}),edges:W}},[X,b,S,N]),Y=f?.current_version_id??null;function F(R){x(R),l(V=>{const $=new URLSearchParams(V);return e&&$.set("workflow_id",e),$.set("version_id",R),$})}const O=w.useMemo(()=>d.map(R=>R.version_id),[d]);function U(R){return p.jsxs(ro,{value:R.version_id,children:[R.version_id,R.version_id===Y&&p.jsx("span",{className:"ml-1.5 text-muted-foreground font-normal",children:"(current)"})]},R.version_id)}return L?p.jsx("div",{className:"p-3",children:p.jsxs(_n,{className:"border-destructive",children:[p.jsx(tr,{children:p.jsx(nr,{children:"Error"})}),p.jsx(kn,{children:p.jsx("p",{className:"text-sm text-muted-foreground",children:L})})]})}):p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"p-3 border-b border-border flex flex-wrap items-center gap-2 text-sm",children:[p.jsx(ca,{items:[{label:"Workflow"}]}),r?.name&&p.jsx("span",{className:"text-xs text-muted-foreground",children:r.name}),O.length>0&&p.jsxs("div",{className:"ml-auto flex items-center gap-4",children:[g&&p.jsxs(gt,{to:`/runs?version=${encodeURIComponent(g)}`,className:`ml-auto text-xs font-medium ${En}`,children:["Go to runs of version ",g]}),p.jsxs(Ns,{value:g??Y??"",onValueChange:F,children:[p.jsx(ks,{className:"w-[140px] h-8 text-xs rounded-md border bg-background",children:p.jsx(_s,{placeholder:"Version"})}),p.jsx(Ts,{children:d.map(U)})]})]}),X&&p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-xs text-muted-foreground",children:"Show changes"}),p.jsx(TN,{checked:N,onCheckedChange:k}),p.jsxs("div",{className:"relative group",children:[p.jsx(c3,{className:"size-3.5 text-muted-foreground cursor-default"}),p.jsxs("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 hidden group-hover:block z-50 w-56 rounded-md border border-border bg-popover px-3 py-2 text-xs text-popover-foreground shadow-md",children:[p.jsx("p",{className:"mb-2 text-muted-foreground",children:"Highlights what changed between this version and the previous one."}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"size-2.5 rounded-sm shrink-0 bg-green-500/80 border border-green-500"}),"Added node"]}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"size-2.5 rounded-sm shrink-0 bg-amber-500/80 border border-amber-500"}),"Edited node"]}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"size-2.5 rounded-sm shrink-0 bg-red-500/30 border border-red-500/80 border-dashed"}),"Removed node"]})]})]})]})]})]}),p.jsxs("div",{className:"p-3 border-b border-border bg-muted/10",children:[p.jsx("div",{className:"text-sm font-semibold",children:f?.name??r?.name??"Workflow"}),f?.description&&p.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:f.description})]}),p.jsx("div",{className:"flex-1 min-h-0",children:b?p.jsx(ok,{workflow:b,workflowId:e??void 0,versionId:g??void 0,runsVersionForLink:g??void 0,nodesOverride:q?.nodes,edgesOverride:q?.edges,onCollectionClick:R=>j(R),readOnly:!0,showControls:!0,showBackground:!0,className:"bg-muted/30"}):p.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No workflow selected"})}),p.jsx(ny,{open:!!z,onOpenChange:R=>!R&&j(null),children:p.jsxs(ry,{side:"right",className:"w-full max-w-md",children:[p.jsxs(bf,{children:[p.jsxs(As,{className:"text-base",children:["Collection schema: ",z]}),p.jsx(wf,{className:"sr-only",children:"Collection schema details"})]}),p.jsx("div",{className:"pt-4 space-y-3 text-sm",children:z?(()=>{const R=C[z],V=R?.item_schema??{},$=V.properties??{},W=new Set(V.required??[]),M=new Set(["citations","derived_from","reasoning"]),B=Object.entries($).filter(([G])=>!M.has(G));return p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-1",children:"Name"}),p.jsx("div",{children:R?.name??"-"})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-1",children:"Description"}),p.jsx("div",{className:"text-muted-foreground",children:R?.description??"-"})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2",children:"Fields"}),B.length===0?p.jsx("div",{className:"rounded-md border border-border bg-muted/20 p-2 text-xs text-muted-foreground",children:"No explicit properties defined."}):p.jsx("div",{className:"rounded-md border border-border overflow-hidden",children:p.jsx("div",{className:"max-h-[50vh] overflow-y-auto",children:B.map(([G,D])=>p.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-2 border-b last:border-b-0 border-border px-3 py-2",children:[p.jsxs("div",{children:[p.jsx("div",{className:"font-medium text-sm",children:G}),p.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[D.type??"any",D.description?` • ${String(D.description)}`:""]})]}),W.has(G)?p.jsx("span",{className:"self-start rounded-full border border-emerald-500/40 bg-emerald-500/10 px-2 py-0.5 text-[10px] font-semibold text-emerald-700 dark:text-emerald-300",children:"required"}):p.jsx("span",{className:"self-start rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:"optional"})]},G))})}),$.citations||$.derived_from||$.reasoning?p.jsxs("div",{className:"mt-2 rounded-md border border-dashed border-border bg-muted/20 p-2 text-[11px] text-muted-foreground",children:["Shared traceability fields are hidden here to reduce noise: ",p.jsx("code",{children:"citations"}),", ",p.jsx("code",{children:"derived_from"}),", ",p.jsx("code",{children:"reasoning"}),"."]}):null]})]})})():null})]})})]})}function pd({className:e,...t}){return p.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0 overflow-x-auto",children:p.jsx("table",{"data-slot":"table",className:ve("w-full caption-bottom text-sm",e),...t})})}function gd({className:e,...t}){return p.jsx("thead",{"data-slot":"table-header",className:ve("[&_tr]:border-b",e),...t})}function yd({className:e,...t}){return p.jsx("tbody",{"data-slot":"table-body",className:ve("[&_tr:last-child]:border-0",e),...t})}function Sr({className:e,...t}){return p.jsx("tr",{"data-slot":"table-row",className:ve("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function St({className:e,...t}){return p.jsx("th",{"data-slot":"table-head",className:ve("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function pt({className:e,...t}){return p.jsx("td",{"data-slot":"table-cell",className:ve("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}const T$=3e3,Ep="",Cp="";function A$(){const[e,t]=qs(),{selectedWorkflowId:r,selectedWorkflow:i}=sa(),l=e.get("version")??Ep,s=e.get("status")??Cp,[c,f]=w.useState([]),[h,d]=w.useState(null),m=zf(),g=w.useMemo(()=>r?c.filter(A=>A.workflow_id===r):c,[c,r]),x=w.useMemo(()=>g.filter(A=>!(l&&A.workflow_version_id!==l||s&&A.status!==s)),[g,l,s]),b=w.useMemo(()=>Array.from(new Set(g.map(A=>A.workflow_version_id))).sort(),[g]),E=w.useMemo(()=>Array.from(new Set(c.map(A=>A.status))).sort(),[c]);function S(A){t(z=>{const j=new URLSearchParams(z);return A===Ep?j.delete("version"):j.set("version",A),j})}function _(A){t(z=>{const j=new URLSearchParams(z);return A===Cp?j.delete("status"):j.set("status",A),j})}const N=w.useCallback(async()=>{try{const A=await lt.getRuns();f(A),d(null)}catch(A){d(A instanceof Error?A.message:String(A))}},[]);if(w.useEffect(()=>{N();const A=setInterval(N,T$);return()=>clearInterval(A)},[N]),h)return p.jsx("div",{className:"p-3",children:p.jsxs(_n,{className:"border-destructive",children:[p.jsx(tr,{children:p.jsx(nr,{children:"Error"})}),p.jsx(kn,{children:p.jsx("p",{className:"text-sm text-muted-foreground",children:h})})]})});function k(){const A=["name","run_id","workflow_id","workflow_version_id","status","created_at"],z=["Name","ID","Workflow","Version","Status","Created"];uf(x.map(j=>({name:j.name??"",run_id:j.run_id,workflow_id:j.workflow_id,workflow_version_id:j.workflow_version_id,status:j.status,created_at:j.created_at})),A,z,"runs.csv")}const C=c.filter(A=>A.status==="running").length;return p.jsxs("div",{className:"p-3",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-1.5 py-0.5",children:[p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[p.jsx(ca,{items:[{label:"Runs"}]}),i?.name&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:["Workflow: ",p.jsx("span",{className:"font-medium text-foreground/80",children:i.name})]}),C>0&&p.jsxs("span",{className:"text-xs font-medium text-amber-600 dark:text-amber-400 flex items-center gap-1",children:[p.jsx("span",{className:"size-1.5 rounded-full bg-amber-500 animate-pulse","aria-hidden":!0}),C," running"]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(Ns,{value:l||"all",onValueChange:A=>S(A==="all"?Ep:A),children:[p.jsx(ks,{size:"sm",className:"w-[180px]",children:p.jsx(_s,{placeholder:"Workflow version"})}),p.jsxs(Ts,{children:[p.jsx(ro,{value:"all",children:"All versions"}),b.map(A=>p.jsx(ro,{value:A,children:A},A))]})]}),p.jsxs(Ns,{value:s||"all",onValueChange:A=>_(A==="all"?Cp:A),children:[p.jsx(ks,{size:"sm",className:"w-[140px]",children:p.jsx(_s,{placeholder:"Status"})}),p.jsxs(Ts,{children:[p.jsx(ro,{value:"all",children:"All statuses"}),E.map(A=>p.jsx(ro,{value:A,children:A},A))]})]})]})]}),p.jsx("div",{className:"flex items-center gap-2",children:x.length>0&&p.jsx("button",{type:"button",onClick:k,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Download CSV"})})]}),p.jsx(_n,{children:p.jsx(kn,{className:"p-0 text-sm",children:p.jsxs(pd,{children:[p.jsx(gd,{children:p.jsxs(Sr,{children:[p.jsx(St,{className:"w-8 min-w-8 text-center",children:"#"}),p.jsx(St,{className:"min-w-[120px]",children:"Name"}),p.jsx(St,{className:"min-w-[180px]",children:"ID"}),p.jsx(St,{className:"min-w-[80px]",children:"Version"}),p.jsx(St,{className:"min-w-[80px]",children:"Status"}),p.jsx(St,{className:"min-w-[140px] whitespace-nowrap",children:"Created"})]})}),p.jsxs(yd,{children:[x.length===0&&p.jsx(Sr,{children:p.jsx(pt,{colSpan:6,className:"text-center text-muted-foreground",children:c.length===0?p.jsx("p",{className:"mt-6",children:"No runs yet, Ask your agent to run the current workflow."}):"No runs match filter"})}),x.map((A,z)=>p.jsxs(Sr,{className:["cursor-pointer hover:bg-muted/50",A.status==="running"?"bg-amber-500/5 dark:bg-amber-500/10":""].join(" "),onClick:()=>m(`/runs/${encodeURIComponent(A.run_id)}`),children:[p.jsx(pt,{className:"text-xs text-muted-foreground text-center align-top w-8 min-w-8 py-1.5",children:z+1}),p.jsx(pt,{className:"align-top py-1.5",children:p.jsx("div",{className:"text-sm font-semibold whitespace-normal break-words line-clamp-2 overflow-hidden",children:A.name??"-"})}),p.jsx(pt,{className:"max-w-[200px] align-top py-1.5",children:p.jsx(ta,{value:A.run_id,truncateLength:24})}),p.jsx(pt,{className:"align-top py-1.5 text-sm",children:A.workflow_version_id}),p.jsx(pt,{className:"align-top py-1.5",children:p.jsx(Kn,{variant:A.status==="running"?"default":"secondary",children:A.status})}),p.jsx(pt,{className:"text-muted-foreground text-sm whitespace-nowrap align-top py-1.5",children:ji(A.created_at)})]},A.run_id))]})]})})})]})}function R$({className:e,orientation:t="horizontal",...r}){return p.jsx(y5,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ve("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...r})}const j$=b2("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function M$({className:e,variant:t="default",...r}){return p.jsx(x5,{"data-slot":"tabs-list","data-variant":t,className:ve(j$({variant:t}),e),...r})}function O$({className:e,...t}){return p.jsx(v5,{"data-slot":"tabs-trigger",className:ve("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function D$({className:e,...t}){return p.jsx(b5,{"data-slot":"tabs-content",className:ve("flex-1 outline-none",e),...t})}function Yl(e){return e==null?"-":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(Yl).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function z$({data:e}){const t=e.themes??[],r=e.signals??{},i=e.ideas_count,l=e.sources_count,s=e.learnings??[],c=e.output,f=e.stored_in,h=e.step??e.step_id??e.node_id,d=e.status,m=[];return i!=null&&m.push(`${i} ideas`),l!=null&&m.push(`${l} sources`),p.jsxs("div",{className:"space-y-1.5 text-xs",children:[h&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Step:"})," ",h,d&&d!=="step_completed"&&p.jsxs("span",{className:"ml-1.5 text-muted-foreground",children:["(",d,")"]})]}),t.length>0&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Themes:"})," ",t.join(", ")]}),Object.keys(r).length>0&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Signals:"}),p.jsx("ul",{className:"list-disc list-inside mt-0.5 ml-1",children:Object.entries(r).map(([g,x])=>p.jsxs("li",{children:[p.jsxs("span",{className:"font-medium",children:[g,":"]})," ",Yl(x)]},g))})]}),m.length>0&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Produced:"})," ",m.join(", ")]}),s.length>0&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Learnings:"}),p.jsx("ul",{className:"list-disc list-inside mt-0.5 ml-1",children:s.map((g,x)=>p.jsx("li",{children:Yl(g)},x))})]}),c!=null&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Output:"})," ",typeof c=="object"?p.jsx("pre",{className:"mt-0.5 p-1.5 bg-muted rounded text-[10px] overflow-x-auto max-h-24 overflow-y-auto",children:JSON.stringify(c,null,2)}):Yl(c)]}),f&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Stored in:"})," ",f]})]})}function L$({data:e}){const t=e.step??e.step_id??e.node_id,r=e.constraint,i=e.context;return p.jsxs("div",{className:"space-y-1 text-xs",children:[t&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Step:"})," ",t]}),r&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Constraint:"})," ",r]}),i!=null&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Context:"})," ",Yl(i)]})]})}function I$({data:e}){const t=e.workflow_version,r=e.input;return p.jsxs("div",{className:"space-y-1 text-xs",children:[t&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Version:"})," ",t]}),r&&Object.keys(r).length>0&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Input:"})," ",Object.entries(r).map(([i,l])=>`${i}: ${Yl(l)}`).join("; ")]})]})}function B$({data:e}){const t=e.ideas_count,r=e.status,i=e.message;return p.jsxs("div",{className:"space-y-1 text-xs",children:[r&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Status:"})," ",r]}),t!=null&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Ideas:"})," ",t]}),i&&p.jsxs("div",{children:[p.jsx("span",{className:"text-muted-foreground font-medium",children:"Message:"})," ",i]})]})}function H$({data:e}){const t=Object.keys(e);if(t.length===0)return p.jsx("span",{className:"text-muted-foreground italic",children:"-"});const r=[],i=e.step??e.step_id??e.node_id;i!=null&&r.push(`step: ${String(i)}`),e.status!=null&&r.push(String(e.status)),e.message!=null&&r.push(String(e.message).slice(0,60));const l=t.filter(s=>!["step","step_id","node_id","status","message"].includes(s));return l.length>0&&r.push(l.join(", ")),p.jsx("span",{className:"text-sm",children:r.join(" · ")||t.join(", ")})}function P$({type:e,data:t}){if(Object.keys(t).length===0)return p.jsx("span",{className:"text-muted-foreground italic",children:"-"});let i;switch(e){case"step_completed":i=p.jsx(z$,{data:t});break;case"step_started":i=p.jsx(L$,{data:t});break;case"run_started":i=p.jsx(I$,{data:t});break;case"run_completed":i=p.jsx(B$,{data:t});break;default:i=p.jsx(H$,{data:t})}return p.jsxs("div",{className:"space-y-1",children:[i,p.jsxs("details",{className:"text-xs",children:[p.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground py-0.5",children:"Raw data"}),p.jsx("pre",{className:"mt-0.5 p-1.5 bg-muted rounded text-[10px] overflow-x-auto max-h-40 overflow-y-auto",children:JSON.stringify(t,null,2)})]})]})}function mg(e){const t=e.created_by_node_id;return t&&t.trim()?t:null}function U$(e){const t=new Set(["id","created_at",...AN]),r=new Set;for(const i of e)for(const l of Object.keys(i))t.has(l)||r.add(l);return Array.from(r)}function pg(e){return e==null?"-":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(pg).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function V$(e,t){if(!t.trim())return!0;const r=t.trim().toLowerCase();for(const i of Object.values(e)){if(i==null)continue;if((typeof i=="string"?i:JSON.stringify(i)).toLowerCase().includes(r))return!0}return!1}function $$(e,t,r,i){const l=t.id??String(r);if(i)return`/runs/${encodeURIComponent(i)}/collections/${encodeURIComponent(e)}/items/${encodeURIComponent(l)}`;const s=t.run_id?`?run_id=${encodeURIComponent(String(t.run_id))}`:"";return`/data/${encodeURIComponent(e)}/items/${encodeURIComponent(l)}${s}`}function Y$({kind:e,items:t,workflow:r,runId:i,stepFilter:l,searchQuery:s}){const[c,f]=w.useState(null),h=w.useCallback(b=>{f(E=>E===b?null:b)},[]),d=t??[],m=d.filter(b=>!(l!=null&&l!==""&&mg(b)!==l||s!=null&&!V$(b,s)));if(d.length===0)return p.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",e," yet."]});const g=U$(m),x=!!r;return p.jsxs(pd,{children:[p.jsx(gd,{children:p.jsxs(Sr,{children:[p.jsx(St,{className:"w-16 text-right",children:"Actions"}),p.jsx(St,{className:"w-8 min-w-8 text-center",children:"#"}),p.jsx(St,{className:"min-w-[120px]",children:"Added"}),x&&p.jsx(St,{className:"min-w-[140px]",children:"Created by node"}),g.map(b=>p.jsx(St,{className:"capitalize min-w-[120px]",children:b.replace(/_/g," ")},b))]})}),p.jsx(yd,{children:m.map((b,E)=>{const S=x?mg(b):null,_=$$(e,b,E,i),N=b.id??`row-${E}`,k=c===N;return p.jsxs(Sr,{className:ve("cursor-pointer hover:bg-muted/50",k&&"bg-muted/30"),onClick:()=>h(N),children:[p.jsx(pt,{className:"text-right align-top py-1.5 w-16",onClick:C=>C.stopPropagation(),children:p.jsx("div",{className:"flex items-center justify-end",children:p.jsx("a",{href:_,onClick:C=>C.stopPropagation(),className:"p-1.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted inline-flex",title:"Go to collection item","aria-label":"Go to collection item",children:p.jsx(kN,{className:"size-3.5"})})})}),p.jsx(pt,{className:"text-xs text-muted-foreground text-center align-top py-1.5 w-8",children:E+1}),p.jsx(pt,{className:"text-xs text-muted-foreground whitespace-nowrap align-top py-1.5",children:ji(b.created_at)}),x&&p.jsx(pt,{className:"text-xs text-muted-foreground whitespace-nowrap align-top py-1.5",children:S?p.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-[11px]",children:S.replace(/_/g," ")}):"-"}),g.map(C=>{const A=b[C],z=md(C,A),j=!k;return p.jsx(pt,{className:"text-sm min-w-[120px] max-w-[500px] align-top py-1.5",children:p.jsx("div",{className:ve("whitespace-normal break-words",j&&"line-clamp-2 overflow-hidden"),children:C==="url"?p.jsx("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:`${En} break-all`,onClick:L=>L.stopPropagation(),children:pg(A)}):z?p.jsx(Ui,{content:A,className:ve("text-xs",j&&"line-clamp-2")}):pg(A)})},C)})]},N)})})]})}const q$=200,F$=600,X$=300;function G$(e,t,r,i){try{const l=localStorage.getItem(e);if(l){const s=Number(l);if(!Number.isNaN(s)&&s>=r&&s<=i)return s}}catch{}return t}function W$(e,t){try{localStorage.setItem(e,String(t))}catch{}}function Z$(e,t,r,i){if(e!=null&&typeof window<"u"){const l=Math.floor(window.innerWidth*e);return Math.min(i,Math.max(r,l))}return t}function K$({defaultWidth:e=X$,defaultFraction:t,minWidth:r=q$,maxWidth:i=F$,storageKey:l,left:s,right:c,className:f}){const h=Z$(t,e,r,i),d=l?G$(l,h,r,i):h,[m,g]=w.useState(d),[x,b]=w.useState(!1),E=w.useRef(null),S=w.useRef(m);S.current=m;const _=w.useCallback(N=>{N.preventDefault(),b(!0)},[]);return w.useEffect(()=>{if(!x)return;function N(C){if(!E.current)return;const A=E.current.getBoundingClientRect(),z=C.clientX-A.left,j=Math.min(i,Math.max(r,z));S.current=j,g(j)}function k(){l&&W$(l,S.current),b(!1)}return document.addEventListener("mousemove",N),document.addEventListener("mouseup",k),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",k),document.body.style.cursor="",document.body.style.userSelect=""}},[x,r,i,l]),p.jsxs("div",{ref:E,className:ve("flex h-full min-h-0",f),children:[p.jsx("div",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:`${m}px`},children:s}),p.jsx("div",{role:"separator","aria-orientation":"vertical","aria-valuenow":m,onMouseDown:_,className:ve("w-1 shrink-0 cursor-col-resize hover:bg-primary/30 transition-colors flex items-center justify-center group",x&&"bg-primary/50"),children:p.jsx("div",{className:ve("w-0.5 h-8 rounded-full bg-border group-hover:bg-primary/60 transition-colors",x&&"bg-primary")})}),p.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:c})]})}function hr({className:e,...t}){return p.jsx("div",{className:ve("animate-pulse rounded-md bg-muted",e),...t})}const gg=3e3;function Q$(e,t){if(!t)return"-";const r=Date.parse(e),i=Date.parse(t);if(Number.isNaN(r)||Number.isNaN(i))return"-";const l=(r-i)/1e3;if(l<60)return`+${l.toFixed(1)}s`;const s=Math.floor(l/60),c=Math.floor(l%60);return`+${s}m ${c}s`}function J$(e){switch(e){case"run_started":return"bg-primary/20 text-primary border-primary/40";case"step_started":return"bg-blue-500/20 text-blue-700 dark:text-blue-300 border-blue-500/40";case"step_completed":return"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40";case"run_completed":return"bg-violet-500/20 text-violet-700 dark:text-violet-300 border-violet-500/40";default:return"bg-muted text-muted-foreground border-border"}}function e7(e,t){if(e==="completed")return{label:"Settled",className:"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40"};if(!t)return{label:"No signal",className:"bg-muted text-muted-foreground border-border"};const r=Date.parse(t);if(Number.isNaN(r))return{label:"No signal",className:"bg-muted text-muted-foreground border-border"};const i=Date.now()-r;return i<=gg*2.5?{label:"Live",className:"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40"}:i<=gg*6?{label:"Delayed",className:"bg-amber-500/20 text-amber-700 dark:text-amber-300 border-amber-500/40"}:{label:"Stale",className:"bg-rose-500/20 text-rose-700 dark:text-rose-300 border-rose-500/40"}}function t7(){const{runId:e}=Cg(),[t]=qs(),r=t.get("tab"),[i,l]=w.useState(null),[s,c]=w.useState([]),[f,h]=w.useState([]),[d,m]=w.useState({}),[g,x]=w.useState(null),[b,E]=w.useState([]),[S,_]=w.useState(null),[N,k]=w.useState(!1),[C,A]=w.useState(null),[z,j]=w.useState(null),[L,P]=w.useState(!1),[H,X]=w.useState("all"),q=w.useRef(null),Y=C??(r&&f.includes(r)?r:f[0])??"",F=s.length>0?s[s.length-1]?.ts:void 0,O=e7(i?.status,F),U=w.useMemo(()=>H==="all"?s:H==="steps"?s.filter(K=>K.type==="step_started"||K.type==="step_completed"):s.filter(K=>K.type!=="step_started"&&K.type!=="step_completed"),[H,s]),R=w.useMemo(()=>{const K=g?.nodes??[];if(K.length===0)return{total:0,completed:0,running:0,pending:0,failed:0};const J=new Map;for(const me of b)J.set(me.node_id,me);let te=0,ne=0,se=0,he=0;for(const me of K){const xe=J.get(me.id)?.status;xe==="completed"?te+=1:xe==="started"?ne+=1:xe==="failed"||xe==="needs_human"?se+=1:he+=1}return{total:K.length,completed:te,running:ne,pending:he,failed:se}},[g,b]);function V(){const K=s.map(J=>({ts:J.ts,type:J.type,by:J.by??"",data:JSON.stringify(J.data)}));uf(K,["ts","type","by","data"],["Time","Type","By","Data"],"events.csv")}function $(){const K=Y,te=(K?d[K]:null)?.items??[];if(te.length===0)return;const ne=new Set(["id","created_at"]),se=Array.from(te.reduce((me,ge)=>(Object.keys(ge).filter(xe=>!ne.has(xe)).forEach(xe=>me.add(xe)),me),new Set)),he=se.map(me=>me.replace(/_/g," "));uf(te,se,he,`${K}.csv`)}function W(){document.querySelector('[data-collected-section="true"]')?.scrollIntoView({behavior:"smooth",block:"start"})}function M(){const K=q.current;K&&K.scrollTo({top:K.scrollHeight,behavior:"smooth"})}const B=w.useCallback(async()=>{if(e)try{const[K,J,te,ne]=await Promise.all([lt.getRun(e),lt.getRunEvents(e),lt.getCollectionKinds(e),lt.getNodeResults(e)]);l(K),c(J),h(te),E(ne),_(null);const se={};for(const he of te)se[he]=await lt.getCollections(e,he);if(m(se),K?.workflow_id&&K?.workflow_version_id)try{const he=await lt.getWorkflowVersion(K.workflow_id,K.workflow_version_id,{includePrompts:!1});x(he)}catch{x(null)}else x(null)}catch(K){_(K instanceof Error?K.message:String(K))}},[e]);if(w.useEffect(()=>{B();const K=setInterval(B,gg);return()=>clearInterval(K)},[B]),!e||S)return p.jsx("div",{className:"p-3",children:p.jsxs(_n,{className:"border-destructive",children:[p.jsx(tr,{children:p.jsx(nr,{children:"Error"})}),p.jsxs(kn,{children:[p.jsx("p",{className:"text-sm text-muted-foreground",children:S??"Missing run ID"}),p.jsx(gt,{to:"/runs",className:`text-sm mt-2 inline-block ${En}`,children:"Back to runs"})]})]})});if(i===null)return p.jsxs("div",{className:"h-full flex",children:[p.jsxs("aside",{className:"w-1/2 border-r border-border flex flex-col bg-muted/20 shrink-0",children:[p.jsx("div",{className:"p-2 border-b border-border",children:p.jsx(hr,{className:"h-4 w-24"})}),p.jsx("div",{className:"flex-1 p-4",children:p.jsx(hr,{className:"h-full w-full rounded-lg"})})]}),p.jsxs("main",{className:"flex-1 flex flex-col min-w-0 p-2 gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border",children:[p.jsx(hr,{className:"h-4 w-32"}),p.jsx(hr,{className:"h-5 w-16 rounded-full"}),p.jsx(hr,{className:"h-4 w-40 ml-auto"})]}),p.jsxs("div",{className:"space-y-2 pl-2 border-l-2 border-border",children:[p.jsx(hr,{className:"h-4 w-full max-w-[200px]"}),p.jsx(hr,{className:"h-4 w-full max-w-[280px]"})]}),p.jsxs("div",{className:"flex-1 flex flex-col border-l-2 border-border pl-2 gap-2",children:[p.jsx(hr,{className:"h-6 w-28"}),p.jsx(hr,{className:"h-8 w-full rounded"}),p.jsx(hr,{className:"flex-1 min-h-[120px] w-full rounded"})]})]})]});const D=g?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"px-2 py-2 border-b border-border flex items-center justify-between gap-1",children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Workflow"}),p.jsx("button",{type:"button",onClick:()=>k(K=>!K),className:"text-muted-foreground hover:text-foreground p-0.5 rounded","aria-label":"Show workflow tips",children:p.jsx("span",{className:"text-[10px] font-mono",children:"?"})})]}),N&&p.jsx("div",{className:"px-2 py-1.5 border-b border-border bg-muted/50",children:p.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Drag nodes to reposition · Click nodes for details"})}),p.jsx("div",{className:"flex-1 min-h-0",children:p.jsx(ok,{workflow:g,workflowId:i?.workflow_id,versionId:i?.workflow_version_id,events:s,nodeResults:b,collectedKinds:f.filter(K=>(d[K]?.items?.length??0)>0),onCollectionClick:K=>{A(K),W()},readOnly:!0,nodesDraggable:!0,showControls:!0,showBackground:!1,className:"bg-transparent"})})]}):null,oe=p.jsx("main",{className:"h-full flex flex-col overflow-hidden",children:p.jsxs("div",{className:"flex flex-col flex-1 min-h-0 p-2 gap-1.5",children:[p.jsxs("header",{className:"shrink-0 bg-background py-1.5 border-b border-border flex flex-wrap items-center gap-x-3 gap-y-1",children:[p.jsx(ca,{items:[{label:"Runs",to:"/runs"},{label:i?.name??e??"Run",to:void 0}]}),p.jsx(Kn,{variant:"outline",className:ve("text-xs shrink-0",i?.status==="completed"&&"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40",i?.status==="running"&&"bg-amber-500/20 text-amber-700 dark:text-amber-300 border-amber-500/40 animate-pulse",i?.status!=="completed"&&i?.status!=="running"&&"bg-muted text-muted-foreground"),children:i?.status}),p.jsxs(Kn,{variant:"outline",className:ve("text-[10px] shrink-0",O.className),children:["Signal: ",O.label]}),i?.workflow_version_id&&p.jsxs(gt,{to:`/workflow?workflow_id=${encodeURIComponent(i.workflow_id)}&version_id=${encodeURIComponent(i.workflow_version_id)}`,className:`text-xs shrink-0 ${En}`,children:["Workflow version: ",i.workflow_version_id]}),R.total>0&&p.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[p.jsxs(Kn,{variant:"outline",className:"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40",children:["✓ ",R.completed]}),p.jsxs(Kn,{variant:"outline",className:"bg-blue-500/20 text-blue-700 dark:text-blue-300 border-blue-500/40",children:["▶ ",R.running]}),p.jsxs(Kn,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:["○ ",R.pending]}),R.failed>0&&p.jsxs(Kn,{variant:"outline",className:"bg-rose-500/20 text-rose-700 dark:text-rose-300 border-rose-500/40",children:["! ",R.failed]})]}),p.jsxs("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:[p.jsx(ta,{value:e,truncateLength:20,className:"text-[11px] text-muted-foreground font-normal"}),p.jsx("button",{type:"button",onClick:W,className:"text-xs px-2 py-1 rounded-md border border-border bg-background hover:bg-muted",children:"Jump to data"}),p.jsxs("button",{type:"button",onClick:()=>P(!0),className:ve("flex items-center gap-1.5 text-xs px-2 py-1 rounded-md border border-border bg-muted/50 hover:bg-muted",L&&"ring-2 ring-ring/50"),"aria-label":"Open events",children:[p.jsx(f3,{className:"size-3.5"}),"Events (",s.length,")"]})]})]}),p.jsx("section",{className:"shrink-0 border-l-2 border-l-primary/40 pl-2 py-1 max-h-48 overflow-y-auto",children:p.jsxs("dl",{className:"text-sm space-y-0.5 pr-1",children:[p.jsxs("div",{className:"flex gap-2",children:[p.jsx("dt",{className:"text-muted-foreground shrink-0 w-16",children:"Created"}),p.jsx("dd",{children:ji(i?.created_at)})]}),i?.input&&Object.keys(i.input).length>0&&Object.entries(i.input).filter(([,K])=>K!=null&&K!=="").map(([K,J])=>p.jsxs("div",{className:"flex gap-2",children:[p.jsx("dt",{className:"text-muted-foreground shrink-0 w-16 capitalize",children:K.replace(/_/g," ")}),p.jsx("dd",{className:"min-w-0 break-words",children:typeof J=="string"&&J.length>200?p.jsx("span",{className:"block rounded bg-muted/50 p-2 text-xs whitespace-pre-wrap",children:J}):typeof J=="object"?p.jsx("span",{className:"block rounded bg-muted/50 p-2 text-xs whitespace-pre-wrap font-mono",children:JSON.stringify(J,null,2)}):p.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5",children:String(J)})})]},K)),(!i?.input||Object.keys(i.input).length===0)&&p.jsx("div",{className:"text-muted-foreground text-xs",children:"No input"})]})}),i?.final_answer!=null&&i.final_answer!==""&&p.jsxs("section",{className:"shrink-0 border-l-2 border-l-emerald-500/40 pl-2 py-1.5",children:[p.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Final answer"}),p.jsx("div",{className:"text-sm prose prose-sm dark:prose-invert max-w-none",children:p.jsx(Ui,{content:i.final_answer})})]}),p.jsx(ny,{open:L,onOpenChange:P,children:p.jsxs(ry,{side:"right",className:"w-full max-w-2xl",children:[p.jsx(bf,{children:p.jsxs(As,{children:["Events (",U.length,"/",s.length,")"]})}),p.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsxs("select",{value:H,onChange:K=>X(K.target.value),className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted","aria-label":"Event timeline mode",children:[p.jsx("option",{value:"all",children:"All events"}),p.jsx("option",{value:"steps",children:"Step events"}),p.jsx("option",{value:"system",children:"System events"})]}),p.jsx("button",{type:"button",onClick:M,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Jump latest"}),s.length>0&&p.jsx("button",{type:"button",onClick:V,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Download CSV"})]}),p.jsx(EN,{className:"flex-1 -mx-2",children:p.jsx("div",{className:"pr-2",ref:q,children:p.jsxs(pd,{children:[p.jsx(gd,{children:p.jsxs(Sr,{children:[p.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[70px]",children:"Delta"}),p.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[100px]",children:"Time"}),p.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[120px]",children:"Type"}),p.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[80px]",children:"By"}),p.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[280px]",children:"Data"})]})}),p.jsx(yd,{children:U.map((K,J)=>p.jsxs(Sr,{"data-event-index":J,className:ve("cursor-default",typeof K.data?.step=="string"&&"cursor-pointer hover:bg-muted/40"),onClick:()=>{const te=K.data?.step;typeof te=="string"&&(j(te),P(!1),W())},children:[p.jsx(pt,{className:"text-[11px] text-muted-foreground py-1 font-mono",children:Q$(K.ts,J>0?U[J-1].ts:null)}),p.jsx(pt,{className:"text-[11px] text-muted-foreground py-1",children:K.ts??"-"}),p.jsx(pt,{className:"py-1",children:p.jsx(Kn,{variant:"outline",className:ve("text-[10px]",J$(K.type)),children:K.type})}),p.jsx(pt,{className:"text-sm py-1",children:K.by??"-"}),p.jsx(pt,{className:"min-w-[280px] max-w-none whitespace-normal break-words align-top py-1.5 text-xs overflow-visible",children:p.jsx(P$,{type:K.type,data:K.data})})]},J))})]})})})]})]})}),f.length>0&&p.jsx("section",{"data-collected-section":"true",className:"flex-1 min-h-0 flex flex-col border-l-2 border-l-emerald-500/40 pl-2",children:p.jsxs(_n,{className:"flex-1 min-h-0 flex flex-col gap-0 py-1",children:[p.jsxs(tr,{className:"py-1 px-2 shrink-0 flex flex-row items-center justify-between gap-2 flex-wrap",children:[p.jsx(nr,{className:"text-sm",children:"Data collected"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("select",{value:z??"",onChange:K=>j(K.target.value===""?null:K.target.value),className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted min-w-[140px]","aria-label":"Filter by step",children:[p.jsx("option",{value:"",children:"All steps"}),g?.nodes.map(K=>p.jsx("option",{value:K.id,children:K.id.replace(/_/g," ")},K.id))]}),(d[Y]?.items?.length??0)>0&&p.jsx("button",{type:"button",onClick:$,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Download CSV"})]})]}),p.jsx(kn,{className:"flex-1 min-h-0 overflow-hidden px-2 pb-1 pt-0 flex flex-col",children:p.jsxs(R$,{value:Y,onValueChange:A,className:"flex flex-col flex-1 min-h-0",children:[p.jsx("div",{className:"shrink-0 min-w-0 overflow-x-auto overflow-y-hidden",children:p.jsx(M$,{className:"inline-flex w-max",children:f.map(K=>p.jsx(O$,{value:K,className:"shrink-0 border-l-4 pl-2",style:{borderLeftColor:xr(K)},children:K},K))})}),f.map(K=>p.jsx(D$,{value:K,className:"flex-1 min-h-0 mt-1 data-[state=inactive]:hidden flex flex-col overflow-hidden border-l-4 pl-2",style:{borderLeftColor:xr(K)},children:p.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto overflow-x-auto p-1",children:p.jsx(Y$,{kind:K,items:(d[K]??{items:[]}).items,workflow:g,runId:e??null,stepFilter:z,searchQuery:""})})},K))]})})]})})]})});return g?p.jsx(K$,{defaultFraction:.5,defaultWidth:400,minWidth:200,maxWidth:800,storageKey:"cognetivy-workflow-panel-width",left:p.jsx("aside",{className:"h-full flex flex-col border-r border-border bg-muted/20",children:D}),right:oe,className:"h-full"}):p.jsx("div",{className:"h-full flex",children:oe})}const n7=5e3,Np="cognetivy_collection_run_id";function yg(e){return e==null?"-":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(t=>yg(t)).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function r7(){const{kind:e}=Cg(),[t,r]=qs(),{selectedWorkflowId:i,selectedWorkflow:l}=sa(),[s,c]=w.useState(null),[f,h]=w.useState([]),[d,m]=w.useState([]),[g,x]=w.useState(null),[b,E]=w.useState(null),S=t.get("run_id")??"",_=w.useMemo(()=>{const F=new Map;for(const O of d)F.set(O.run_id,O.name??O.run_id);return F},[d]),N=w.useCallback(async()=>{if(e)try{if(!i)return;const[F,O,U]=await Promise.all([lt.getCollectionSchema(i),lt.getEntityData(e,{workflowId:i}),lt.getRuns()]);c(F),h(O),m(U),x(null)}catch(F){x(F instanceof Error?F.message:String(F))}},[e,i]);if(w.useEffect(()=>{N();const F=setInterval(N,n7);return()=>clearInterval(F)},[N]),w.useEffect(()=>{if(!(!e||t.get("run_id")))try{const F=localStorage.getItem(Np);if(F){const O=new URLSearchParams(t);O.set("run_id",F),r(O,{replace:!0})}}catch{}},[e,t,r]),!e||g)return p.jsx("div",{className:"p-3",children:p.jsxs(_n,{className:"border-destructive",children:[p.jsx(tr,{children:p.jsx(nr,{children:"Error"})}),p.jsxs(kn,{children:[p.jsx("p",{className:"text-sm text-muted-foreground",children:g??"Missing entity kind"}),p.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Use the Collection section in the sidebar to open a collection."})]})]})});const k=s?.kinds[e],C=k?.references??{},z=w.useMemo(()=>{const F=k?.item_schema;if(F&&typeof F=="object"){const O=F.properties;if(O&&typeof O=="object")return Object.keys(O)}return f.length>0?Array.from(new Set(f.flatMap(O=>Object.keys(O).filter(U=>!["id","created_at"].includes(U))))):[]},[f,k]).filter((F,O,U)=>U.indexOf(F)===O&&F!=="run_id"),j=w.useMemo(()=>S?f.filter(F=>String(F.run_id??"")===S):f,[f,S]),L=e.replace(/_/g," ").replace(/\b\w/g,F=>F.toUpperCase());function P(F){const O=F==="all"?"":F,U=new URLSearchParams(t);O?U.set("run_id",O):U.delete("run_id"),r(U,{replace:!0});try{O?localStorage.setItem(Np,O):localStorage.removeItem(Np)}catch{}}const H=e??"";function X(F,O){const U=F.id??String(O),R=F.run_id?`?run_id=${encodeURIComponent(String(F.run_id))}`:"";return`/data/${encodeURIComponent(H)}/items/${encodeURIComponent(U)}${R}`}function q(F){E(O=>O===F?null:F)}function Y(){const F=["created_at","run_name",...z],O=["Added","Run",...z.map(R=>R.replace(/_/g," "))],U=j.map(R=>({...R,run_name:R.run_id?_.get(String(R.run_id))??"":""}));uf(U,F,O,`${H}.csv`)}return p.jsxs("div",{className:"p-3 space-y-3",children:[p.jsx(ca,{items:[{label:"Data"},{label:e}]}),p.jsx("h1",{className:"text-2xl font-semibold tracking-tight border-l-4 pl-3",style:{borderLeftColor:xr(e)},children:L}),k&&p.jsxs("div",{className:"text-xs text-muted-foreground py-1.5 px-2 rounded-md bg-muted/40 border border-border/50",children:[p.jsx("span",{className:"font-medium text-foreground/80",children:"Workflow:"})," ",l?.name??"-",p.jsxs("span",{className:"ml-2",children:[p.jsx("span",{className:"font-medium text-foreground/80",children:"Schema:"})," ",k.description]})]}),p.jsxs(_n,{children:[p.jsxs(tr,{className:"py-2 px-3 flex flex-row items-center justify-between gap-2 flex-wrap",children:[p.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[p.jsxs(nr,{className:"text-sm",children:["Data (",j.length," items)"]}),d.length>0&&p.jsxs(Ns,{value:S||"all",onValueChange:P,children:[p.jsx(ks,{className:"w-[200px] h-8 text-xs",size:"sm",children:p.jsx(_s,{placeholder:"Filter by run"})}),p.jsxs(Ts,{children:[p.jsx(ro,{value:"all",children:"All runs"}),d.map(F=>p.jsx(ro,{value:F.run_id,children:F.name??F.run_id},F.run_id))]})]})]}),j.length>0&&p.jsx("button",{type:"button",onClick:Y,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Download CSV"})]}),p.jsx(kn,{className:"p-0",children:z.length===0&&j.length===0?p.jsx("p",{className:"p-4 text-sm text-muted-foreground text-center",children:f.length===0?"No data yet. Ask your agent to run the current workflow.":S?"No items for the selected run.":"No data yet."}):p.jsxs(pd,{children:[p.jsx(gd,{children:p.jsxs(Sr,{children:[p.jsx(St,{className:"w-16 text-right",children:"Actions"}),p.jsx(St,{className:"w-8 min-w-8 text-center",children:"#"}),p.jsx(St,{className:"min-w-[120px]",children:"Added"}),p.jsx(St,{className:"min-w-[120px]",children:"Run"}),z.map(F=>p.jsx(St,{className:"capitalize min-w-[120px]",children:F.replace(/_/g," ")},F))]})}),p.jsx(yd,{children:j.length===0?p.jsx(Sr,{children:p.jsx(pt,{colSpan:4+z.length,className:"p-4 text-sm text-muted-foreground text-center",children:f.length===0?"No data yet. Ask your agent to run the current workflow.":S?"No items for the selected run.":"No data yet."})}):j.map((F,O)=>{const U=X(F,O),R=F.id??`row-${O}`,V=b===R;return p.jsxs(Sr,{className:ve("cursor-pointer hover:bg-muted/50",V&&"bg-muted/30"),onClick:()=>q(R),children:[p.jsx(pt,{className:"text-right align-top py-1.5 w-16",onClick:$=>$.stopPropagation(),children:p.jsx("div",{className:"flex items-center justify-end",children:p.jsx("a",{href:U,onClick:$=>$.stopPropagation(),className:"p-1.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted inline-flex",title:"Go to collection item","aria-label":"Go to collection item",children:p.jsx(kN,{className:"size-3.5"})})})}),p.jsx(pt,{className:"text-xs text-muted-foreground text-center align-top w-8 min-w-8 py-1.5",children:O+1}),p.jsx(pt,{className:"text-xs text-muted-foreground whitespace-nowrap align-top min-w-[120px] py-1.5",children:ji(F.created_at)}),p.jsx(pt,{className:"text-sm min-w-[120px] align-top py-1.5",children:F.run_id?p.jsx(gt,{to:`/runs/${encodeURIComponent(String(F.run_id))}`,className:En,onClick:$=>$.stopPropagation(),title:_.get(String(F.run_id))??String(F.run_id),children:"Open run"}):"-"}),z.map($=>{const W=F[$],M=md($,W),B=C[$],G=!V;return p.jsx(pt,{className:"text-sm min-w-[120px] max-w-[500px] whitespace-normal break-words align-top py-1.5",children:p.jsx("div",{className:ve(G&&"line-clamp-2 overflow-hidden"),children:B&&W?Array.isArray(W)?p.jsx("span",{className:"space-x-1",children:W.map((D,oe)=>{const K=String(D),J=F.run_id?`?run_id=${encodeURIComponent(String(F.run_id))}`:"";return p.jsx(gt,{to:`/data/${encodeURIComponent(B.kind)}/items/${encodeURIComponent(K)}${J}`,className:En,onClick:te=>te.stopPropagation(),children:K},`${$}-${K}-${oe}`)})}):p.jsx(gt,{to:`/data/${encodeURIComponent(B.kind)}/items/${encodeURIComponent(String(W))}${F.run_id?`?run_id=${encodeURIComponent(String(F.run_id))}`:""}`,className:En,onClick:D=>D.stopPropagation(),children:String(W)}):$==="url"&&W?p.jsx("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:ve(En,"break-all"),onClick:D=>D.stopPropagation(),children:yg(W)}):M?p.jsx(Ui,{content:W,className:ve("text-xs",G&&"line-clamp-2")}):yg(W)})},$)})]},R)})})]})})]})]})}function o7(){const{selectedWorkflowId:e,selectedWorkflow:t}=sa(),[r,i]=w.useState(null),[l,s]=w.useState(null),c=w.useCallback(async()=>{try{if(!e){i(null);return}const d=await lt.getCollectionSchema(e);i(d),s(null)}catch(d){s(d instanceof Error?d.message:String(d))}},[e]);if(w.useEffect(()=>{c()},[c]),l)return p.jsx("div",{className:"p-3",children:p.jsxs(_n,{className:"border-destructive",children:[p.jsx(tr,{children:p.jsx(nr,{children:"Error"})}),p.jsx(kn,{children:p.jsx("p",{className:"text-sm text-muted-foreground",children:l})})]})});const f=r?Object.entries(r.kinds):[];function h(d){const[m,g]=d;return p.jsx(gt,{to:`/data/${encodeURIComponent(m)}`,className:"block focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-lg",children:p.jsxs(_n,{className:"h-full transition-colors hover:bg-muted/50",children:[p.jsx(tr,{className:"pb-2",children:p.jsxs("div",{className:"flex items-center gap-2 border-l-4 pl-2",style:{borderLeftColor:xr(m)},children:[p.jsx(vf,{className:"size-4 text-muted-foreground shrink-0","aria-hidden":!0}),p.jsx(nr,{className:"text-base",children:m})]})}),p.jsxs(kn,{className:"pt-0",children:[p.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description||`Collection kind: ${m}`}),p.jsx("span",{className:"text-xs text-primary font-medium mt-2 inline-block",children:"View by kind →"})]})]})},m)}return p.jsxs("div",{className:"p-3",children:[p.jsxs("div",{className:"mb-4",children:[p.jsx(ca,{items:[{label:"Collections"}]}),p.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Schema-backed stores per run for workflow: ",p.jsx("span",{className:"font-medium text-foreground/80",children:t?.name??"-"}),"."]})]}),f.length===0?p.jsx(_n,{children:p.jsx(kn,{className:"py-8 text-center text-muted-foreground text-sm",children:"No collection kinds defined. Configure collection schema in your workspace."})}):p.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:f.map(h)})]})}function i7(e){const t=e.citations;return Array.isArray(t)?t.filter(r=>r!=null&&typeof r=="object"):[]}function l7(e){const t=e.derived_from;return Array.isArray(t)?t.filter(r=>r!=null&&typeof r=="object"&&typeof r.kind=="string"&&typeof r.item_id=="string"):[]}function xg(e){return e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim()}function hS(e){return e.label??e.title??e.name??xg(e.item_id)}function a7(e){const t=e.reasoning;return typeof t=="string"&&t.trim()?t:null}function mS(e,t,r){return r?`/runs/${encodeURIComponent(r)}/collections/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`:`/data/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`}function s7({item:e,runId:t,headingLevel:r="h2",className:i}){const l=i7(e),s=l7(e),c=a7(e);return l.length===0&&s.length===0&&!c?null:p.jsxs("div",{className:i,children:[l.length>0&&p.jsxs("section",{className:"space-y-2",children:[p.jsx(r,{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Citations"}),p.jsx("ul",{className:"list-disc list-inside space-y-1.5 text-sm",children:l.map((f,h)=>p.jsxs("li",{children:[f.url?p.jsx("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-all",children:f.title??f.url}):f.item_ref?p.jsxs(p.Fragment,{children:[p.jsx(gt,{to:mS(f.item_ref.kind,f.item_ref.item_id,t??void 0),className:"text-primary hover:underline",children:hS(f.item_ref)}),p.jsx("span",{className:"block text-muted-foreground text-xs mt-0.5 pl-4",children:xg(f.item_ref.kind)})]}):p.jsx("span",{className:"text-muted-foreground",children:" - "}),f.excerpt&&p.jsx("span",{className:"block text-muted-foreground text-xs mt-0.5 pl-4 border-l border-border",children:f.excerpt})]},h))})]}),s.length>0&&p.jsxs("section",{className:"space-y-2",children:[p.jsx(r,{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Derived from"}),p.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:s.map((f,h)=>p.jsxs("li",{children:[p.jsx(gt,{to:mS(f.kind,f.item_id,t??void 0),className:"text-primary hover:underline",children:hS(f)}),p.jsx("span",{className:"block text-muted-foreground text-xs mt-0.5 pl-4",children:xg(f.kind)})]},h))})]}),c&&p.jsxs("section",{className:"space-y-2",children:[p.jsx(r,{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Reasoning"}),md("reasoning",c)?p.jsx(Ui,{content:c,className:"prose prose-sm dark:prose-invert max-w-none text-sm"}):p.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:c})]})]})}const c7="modulepreload",u7=function(e){return"/"+e},pS={},_p=function(t,r,i){let l=Promise.resolve();if(r&&r.length>0){let h=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=c?.nonce||c?.getAttribute("nonce");l=h(r.map(d=>{if(d=u7(d),d in pS)return;pS[d]=!0;const m=d.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${g}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":c7,m||(x.as="script"),x.crossOrigin="",x.href=d,f&&x.setAttribute("nonce",f),document.head.appendChild(x),m)return new Promise((b,E)=>{x.addEventListener("load",b),x.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&s(f.reason);return t().catch(s)})},f7=new Set(["id","created_at"]);function ik(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(ik).join(", "):typeof e=="object"?JSON.stringify(e,null,2):String(e)}function vg(e,t){const r=[`# ${t.replace(/_/g," ")}`,""],i=Object.entries(e).filter(([l])=>!f7.has(l));for(const[l,s]of i){if(s==null)continue;const c=l.replace(/_/g," ");r.push(`## ${c}`,"",ik(s),"")}return r.join(`
81
+ `).trim()}const d7=`
82
+ .pdf-md-body { font-family: system-ui, -apple-system, sans-serif; font-size: 12px; line-height: 1.5; color: #1a1a1a; background: #ffffff; padding: 24px; max-width: 100%; }
83
+ .pdf-md-body h1 { font-size: 1.5em; font-weight: 700; margin: 1em 0 0.5em; border-bottom: 1px solid #e5e5e5; padding-bottom: 0.25em; }
84
+ .pdf-md-body h2 { font-size: 1.25em; font-weight: 600; margin: 1em 0 0.5em; }
85
+ .pdf-md-body h3 { font-size: 1.1em; font-weight: 600; margin: 0.75em 0 0.35em; }
86
+ .pdf-md-body p { margin: 0.5em 0; }
87
+ .pdf-md-body ul, .pdf-md-body ol { margin: 0.5em 0; padding-left: 1.5em; }
88
+ .pdf-md-body li { margin: 0.25em 0; }
89
+ .pdf-md-body code { background: #f0f0f0; padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
90
+ .pdf-md-body pre { background: #f5f5f5; padding: 12px; border-radius: 6px; overflow-x: auto; margin: 0.75em 0; font-size: 11px; }
91
+ .pdf-md-body pre code { background: none; padding: 0; }
92
+ .pdf-md-body blockquote { border-left: 4px solid #ddd; margin: 0.5em 0; padding-left: 1em; color: #555; }
93
+ .pdf-md-body a { color: #0066cc; text-decoration: none; }
94
+ .pdf-md-body strong { font-weight: 600; }
95
+ .pdf-md-body em { font-style: italic; }
96
+ `,Wu=10,h7=2,m7=.95,gS="jpeg";async function p7(e,t,r){const[i,l,s]=await Promise.all([_p(()=>import("./marked.esm-Brtrz5BF.js"),[]),_p(()=>import("./html2canvas.esm-C5Fx4D8v.js"),[]),_p(()=>import("./jspdf.es.min-CE5b-FUc.js").then(S=>S.j),[])]),c=i.marked??i.parse,f=l.default,h=s.default,d=vg(e,t),m=c(d),g=document.createElement("div");g.setAttribute("style","position:absolute;left:-9999px;top:0;width:210mm;background:#ffffff;color:#1a1a1a;margin:0;padding:0;border:0;");const x=document.createElement("style");x.textContent=d7,g.appendChild(x);const b=document.createElement("div");b.className="pdf-md-body",b.innerHTML=m,g.appendChild(b),document.body.appendChild(g);const E=`${t}-item`.replace(/[^a-zA-Z0-9_-]/g,"_");try{const S=await f(g,{scale:h7,useCORS:!0,logging:!1}),_=new h({unit:"mm",format:"a4",orientation:"portrait"}),N=_.internal.pageSize.getWidth(),k=_.internal.pageSize.getHeight(),C=N-Wu*2,z=(k-Wu*2)/C,j=S.width,L=S.height,P=Math.floor(j*z),H=Math.ceil(L/P);for(let X=0;X<H;X++){X>0&&_.addPage();const q=X*P,Y=X===H-1&&L%P!==0?L%P:P,F=document.createElement("canvas");F.width=j,F.height=Y;const O=F.getContext("2d");O&&(O.fillStyle="#ffffff",O.fillRect(0,0,j,Y),O.drawImage(S,0,q,j,Y,0,0,j,Y));const U=F.toDataURL(`image/${gS}`,m7),R=Y/j*C;_.addImage(U,gS,Wu,Wu,C,R)}_.save(`${E}.pdf`)}finally{g.parentNode&&document.body.removeChild(g)}}const g7=new Set(["id","source_refs",...AN]),kp=new Set(["run_id","created_at","created_by_node_id","created_by_node_result_id","url"]),yS={id:"demo-item-001",run_id:"run_demo_ux_024",created_at:"2026-02-18T09:23:00.000Z",created_by_node_id:"synthesis_agent",created_by_node_result_id:"node_result_53",title:"Customer support quality is trending up after triage rewrite",summary:"The latest weekly support review indicates a measurable improvement in response quality and resolution confidence after introducing the new triage prompt.",content:`### Key finding
97
+ Average issue clarity improved from **3.1 → 4.2** in two weeks.
98
+
99
+ ### Why it matters
100
+ Clearer issue framing reduced back-and-forth and shortened average resolution time by 18%.
101
+
102
+ ### Suggested action
103
+ Roll out the triage template to the onboarding queue and monitor escalation volume for two more cycles.`,confidence_score:.83,citations:[{title:"Week 7 QA rubric",url:"https://example.com/qa-rubric/week-7",excerpt:"Issue clarity score rose in both billing and onboarding categories."},{item_ref:{kind:"support_ticket",item_id:"ticket-1882",label:"Escalation thread: onboarding billing confusion"},excerpt:"Representative conversation showed fewer clarification loops."}],derived_from:[{kind:"support_ticket",item_id:"ticket-1882",title:"Escalation thread: onboarding billing confusion"},{kind:"weekly_metrics",item_id:"metrics-2026-w07",title:"Support quality metrics · Week 7"}],reasoning:"The strongest signal is consistency across independent reviewers and cohorts, which lowers the chance that this is just sampling noise."};function y7(e){const t=e.source_refs;return Array.isArray(t)?t.filter(r=>r!=null&&typeof r=="object"&&typeof r.id=="string"):[]}function bg(e){return e==null?"-":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(bg).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function xS(){const e=Cg(),[t]=qs(),r=e.runId??t.get("run_id")??null,i=t.get("mock")==="1",l=e.kind??"",s=e.itemId??"",{selectedWorkflowId:c}=sa(),[f,h]=w.useState(null),[d,m]=w.useState(null),[g,x]=w.useState({}),b=w.useCallback(async()=>{if(!(!l||!s)){if(i){h({...yS,id:s,run_id:r??yS.run_id}),m(null);return}try{if(r){const H=await lt.getCollections(r,l),X=H.items.find(q=>q.id===s)??H.items[parseInt(s,10)];h(X??null),m(X?null:"Item not found")}else{const H=await lt.getEntityData(l),X=H.find(q=>q.id===s)??H[parseInt(s,10)];h(X??null),m(X?null:"Item not found")}}catch(H){m(H instanceof Error?H.message:String(H)),h(null)}}},[l,s,r,i]);if(w.useEffect(()=>{b()},[b]),w.useEffect(()=>{async function H(){if(l)try{if(r){const X=await lt.getRun(r),q=await lt.getCollectionSchema(X.workflow_id);x(q.kinds[l]?.references??{})}else if(c){const X=await lt.getCollectionSchema(c);x(X.kinds[l]?.references??{})}else x({})}catch{x({})}}H().catch(()=>x({}))},[l,r,c]),d||!l)return p.jsx("div",{className:"p-3",children:p.jsxs(_n,{className:"border-destructive",children:[p.jsx(tr,{children:p.jsx(nr,{children:"Error"})}),p.jsxs(kn,{children:[p.jsx("p",{className:"text-sm text-muted-foreground",children:d??"Missing kind or item"}),p.jsx(gt,{to:r?`/runs/${r}`:"/collections",className:"text-sm text-primary hover:underline mt-2 inline-block",children:"Back"})]})]})});if(!f)return p.jsx("div",{className:"p-3",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"})});const E=l.replace(/_/g," "),S=mg(f),_=y7(f),N=Object.entries(f).filter(([H])=>!g7.has(H)).filter(([,H])=>H!=null).sort(([H],[X])=>{const q=F=>{const O=F.toLowerCase();return O==="title"||O.endsWith("_title")?0:O.includes("content")||O.includes("summary")||O.includes("description")||O==="body"?1:kp.has(O)||O.endsWith("_id")||O.endsWith("_at")?3:2},Y=q(H)-q(X);return Y!==0?Y:H.localeCompare(X)}),k=N.find(([H])=>{const X=H.toLowerCase();return X==="title"||X.endsWith("_title")}),C=typeof k?.[1]=="string"?k[1]:null,A=N.filter(([H])=>{const X=H.toLowerCase();return k&&H===k[0]?!1:!(kp.has(X)||X.endsWith("_id")||X.endsWith("_at"))}),z=N.filter(([H])=>{const X=H.toLowerCase();return kp.has(X)||X.endsWith("_id")||X.endsWith("_at")}),j=r?[{label:"Runs",to:"/runs"},{label:r,to:`/runs/${r}`},{label:E,to:`/runs/${r}?tab=${l}`},{label:f.id?String(f.id):"Item"}]:[{label:"Collections",to:"/collections"},{label:E,to:`/data/${l}`},{label:f.id?String(f.id):"Item"}];async function L(){if(!f)return;const H=vg(f,l);await navigator.clipboard.writeText(H).catch(()=>{})}async function P(){if(!f)return;const H=Object.entries(f).filter(([Y,F])=>F!=null&&Y!=="id"),X=`
104
+ <article>
105
+ <h3>${l}</h3>
106
+ <table border="1" cellspacing="0" cellpadding="6">
107
+ <tbody>
108
+ ${H.map(([Y,F])=>`<tr><th align="left">${Y}</th><td>${String(typeof F=="object"?JSON.stringify(F,null,2):F)}</td></tr>`).join("")}
109
+ </tbody>
110
+ </table>
111
+ </article>
112
+ `,q=vg(f,l);try{await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([X],{type:"text/html"}),"text/plain":new Blob([q],{type:"text/plain"})})])}catch{await navigator.clipboard.writeText(q).catch(()=>{})}}return p.jsxs("div",{className:"p-3 max-w-6xl mx-auto",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2 mt-2",children:[p.jsx(ca,{items:j}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{type:"button",onClick:L,className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",title:"Copy as Markdown",children:[p.jsx(_N,{className:"size-3.5"}),"Copy Markdown"]}),p.jsxs("button",{type:"button",onClick:P,className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",title:"Copy as Rich Text",children:[p.jsx(e3,{className:"size-3.5"}),"Copy Rich Text"]}),p.jsxs("button",{type:"button",onClick:()=>f&&p7(f,l),className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",title:"Download as PDF",children:[p.jsx(i3,{className:"size-3.5"}),"Download PDF"]})]})]}),p.jsxs("article",{className:"mt-6 grid gap-8 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]",children:[p.jsxs("div",{className:"space-y-8",children:[p.jsxs("header",{children:[p.jsx("div",{className:"flex items-center gap-2 mb-2",children:p.jsx("span",{className:"inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:E})}),p.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:C??(f.id?String(f.id):"Untitled item")}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 text-sm text-muted-foreground",children:[f.created_at&&p.jsxs("span",{children:["Added ",ji(f.created_at)]}),r&&p.jsxs("span",{className:"inline-flex items-center gap-1",children:[p.jsx(ta,{value:r,truncateLength:16}),p.jsx(gt,{to:`/runs/${r}`,className:"text-primary hover:underline",children:"View run"})]}),S&&p.jsxs("span",{children:["Created by node:"," ",p.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:S.replace(/_/g," ")})]})]})]}),p.jsxs("div",{className:"space-y-8",children:[A.map(([H,X])=>{const q=H.replace(/_/g," "),Y=md(H,X),F=g[H];return p.jsxs("section",{children:[p.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:q}),H==="url"&&typeof X=="string"?p.jsx("a",{href:X,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-all",children:X}):H==="run_id"&&typeof X=="string"?p.jsxs("span",{className:"inline-flex items-center gap-2",children:[p.jsx(ta,{value:X}),p.jsx(gt,{to:`/runs/${encodeURIComponent(X)}`,className:"text-primary hover:underline text-sm",children:"View run"})]}):F?Array.isArray(X)?p.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:X.map((O,U)=>{const R=String(O);return p.jsx("li",{children:p.jsx(gt,{to:`/data/${encodeURIComponent(F.kind)}/items/${encodeURIComponent(R)}${r?`?run_id=${encodeURIComponent(r)}`:""}`,className:"text-primary hover:underline break-all",children:R})},`${H}-${R}-${U}`)})}):p.jsx(gt,{to:`/data/${encodeURIComponent(F.kind)}/items/${encodeURIComponent(String(X))}${r?`?run_id=${encodeURIComponent(r)}`:""}`,className:"text-primary hover:underline break-all",children:String(X)}):Y?p.jsx(Ui,{content:X,sourceRefs:_,className:"prose prose-sm dark:prose-invert max-w-none"}):p.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:bg(X)})]},H)}),z.length>0&&p.jsxs("section",{className:"space-y-4 border-t border-border pt-6",children:[p.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Technical details"}),p.jsx("div",{className:"space-y-4",children:z.map(([H,X])=>{const q=H.replace(/_/g," ");return p.jsxs("section",{children:[p.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:q}),p.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:bg(X)})]},H)})})]})]})]}),p.jsxs("aside",{className:"space-y-4 lg:sticky lg:top-4 self-start",children:[p.jsxs(_n,{children:[p.jsx(tr,{className:"pb-3",children:p.jsx(nr,{className:"text-sm",children:"Evidence & Traceability"})}),p.jsx(kn,{children:p.jsx(s7,{item:f,runId:r??f.run_id,headingLevel:"h3",className:"space-y-5"})})]}),_.length>0&&p.jsxs(_n,{children:[p.jsx(tr,{className:"pb-3",children:p.jsx(nr,{className:"text-sm",children:"Sources"})}),p.jsx(kn,{children:p.jsx("section",{children:p.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:_.map((H,X)=>p.jsx("li",{children:H.url?p.jsx("a",{href:H.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:H.label??H.id??`[${X+1}]`}):p.jsx("span",{children:H.label??H.id??`[${X+1}]`})},H.id))})})})]})]})]})]})}function x7(){return p.jsx(k3,{children:p.jsx(wR,{children:p.jsxs(Gn,{path:"/",element:p.jsx(D3,{}),children:[p.jsx(Gn,{index:!0,element:p.jsx(dS,{})}),p.jsx(Gn,{path:"workflow",element:p.jsx(dS,{})}),p.jsx(Gn,{path:"runs",element:p.jsx(A$,{})}),p.jsx(Gn,{path:"runs/:runId",element:p.jsx(t7,{})}),p.jsx(Gn,{path:"runs/:runId/collections/:kind/items/:itemId",element:p.jsx(xS,{})}),p.jsx(Gn,{path:"collections",element:p.jsx(o7,{})}),p.jsx(Gn,{path:"data/:kind",element:p.jsx(r7,{})}),p.jsx(Gn,{path:"data/:kind/items/:itemId",element:p.jsx(xS,{})}),p.jsx(Gn,{path:"*",element:p.jsx(xR,{to:"/",replace:!0})})]})})})}bA.createRoot(document.getElementById("root")).render(p.jsx(w.StrictMode,{children:p.jsx(oj,{children:p.jsx(FR,{children:p.jsx(x7,{})})})}));export{_p as _,v7 as c,Us as g};