function yA(e,t){for(var r=0;r<t.length;r++){const o=t[r];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(o,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>o[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).observe(document,{childList:!0,subtree:!0});function r(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(i){if(i.ep)return;i.ep=!0;const l=r(i);fetch(i.href,l)}})();function dg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bm={exports:{}},gl={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var eb;function xA(){if(eb)return gl;eb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,i,l){var u=null;if(l!==void 0&&(u=""+l),i.key!==void 0&&(u=""+i.key),"key"in i){l={};for(var f in i)f!=="key"&&(l[f]=i[f])}else l=i;return i=l.ref,{$$typeof:e,type:o,key:u,ref:i!==void 0?i:null,props:l}}return gl.Fragment=t,gl.jsx=r,gl.jsxs=r,gl}var tb;function bA(){return tb||(tb=1,Bm.exports=xA()),Bm.exports}var d=bA(),Hm={exports:{}},ke={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var nb;function wA(){if(nb)return ke;nb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function b(T){return T===null||typeof T!="object"?null:(T=v&&T[v]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function N(T,I,X){this.props=T,this.context=I,this.refs=S,this.updater=X||w}N.prototype.isReactComponent={},N.prototype.setState=function(T,I){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,I,"setState")},N.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function C(){}C.prototype=N.prototype;function j(T,I,X){this.props=T,this.context=I,this.refs=S,this.updater=X||w}var A=j.prototype=new C;A.constructor=j,E(A,N.prototype),A.isPureReactComponent=!0;var M=Array.isArray,O={H:null,A:null,T:null,S:null,V:null},U=Object.prototype.hasOwnProperty;function H(T,I,X,Z,re,fe){return X=fe.ref,{$$typeof:e,type:T,key:I,ref:X!==void 0?X:null,props:fe}}function V(T,I){return H(T.type,I,void 0,void 0,void 0,T.props)}function P(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function z(T){var I={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(X){return I[X]})}var F=/\/+/g;function K(T,I){return typeof T=="object"&&T!==null&&T.key!=null?z(""+T.key):I.toString(36)}function te(){}function k(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(te,te):(T.status="pending",T.then(function(I){T.status==="pending"&&(T.status="fulfilled",T.value=I)},function(I){T.status==="pending"&&(T.status="rejected",T.reason=I)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function Y(T,I,X,Z,re){var fe=typeof T;(fe==="undefined"||fe==="boolean")&&(T=null);var ue=!1;if(T===null)ue=!0;else switch(fe){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(T.$$typeof){case e:case t:ue=!0;break;case g:return ue=T._init,Y(ue(T._payload),I,X,Z,re)}}if(ue)return re=re(T),ue=Z===""?"."+K(T,0):Z,M(re)?(X="",ue!=null&&(X=ue.replace(F,"$&/")+"/"),Y(re,I,X,"",function(pe){return pe})):re!=null&&(P(re)&&(re=V(re,X+(re.key==null||T&&T.key===re.key?"":(""+re.key).replace(F,"$&/")+"/")+ue)),I.push(re)),1;ue=0;var se=Z===""?".":Z+":";if(M(T))for(var me=0;me<T.length;me++)Z=T[me],fe=se+K(Z,me),ue+=Y(Z,I,X,fe,re);else if(me=b(T),typeof me=="function")for(T=me.call(T),me=0;!(Z=T.next()).done;)Z=Z.value,fe=se+K(Z,me++),ue+=Y(Z,I,X,fe,re);else if(fe==="object"){if(typeof T.then=="function")return Y(k(T),I,X,Z,re);throw I=String(T),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return ue}function D(T,I,X){if(T==null)return T;var Z=[],re=0;return Y(T,Z,"","",function(fe){return I.call(X,fe,re++)}),Z}function q(T){if(T._status===-1){var I=T._result;I=I(),I.then(function(X){(T._status===0||T._status===-1)&&(T._status=1,T._result=X)},function(X){(T._status===0||T._status===-1)&&(T._status=2,T._result=X)}),T._status===-1&&(T._status=0,T._result=I)}if(T._status===1)return T._result.default;throw T._result}var B=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function L(){}return ke.Children={map:D,forEach:function(T,I,X){D(T,function(){I.apply(this,arguments)},X)},count:function(T){var I=0;return D(T,function(){I++}),I},toArray:function(T){return D(T,function(I){return I})||[]},only:function(T){if(!P(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},ke.Component=N,ke.Fragment=r,ke.Profiler=i,ke.PureComponent=j,ke.StrictMode=o,ke.Suspense=m,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ke.__COMPILER_RUNTIME={__proto__:null,c:function(T){return O.H.useMemoCache(T)}},ke.cache=function(T){return function(){return T.apply(null,arguments)}},ke.cloneElement=function(T,I,X){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var Z=E({},T.props),re=T.key,fe=void 0;if(I!=null)for(ue in I.ref!==void 0&&(fe=void 0),I.key!==void 0&&(re=""+I.key),I)!U.call(I,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&I.ref===void 0||(Z[ue]=I[ue]);var ue=arguments.length-2;if(ue===1)Z.children=X;else if(1<ue){for(var se=Array(ue),me=0;me<ue;me++)se[me]=arguments[me+2];Z.children=se}return H(T.type,re,void 0,void 0,fe,Z)},ke.createContext=function(T){return T={$$typeof:u,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:l,_context:T},T},ke.createElement=function(T,I,X){var Z,re={},fe=null;if(I!=null)for(Z in I.key!==void 0&&(fe=""+I.key),I)U.call(I,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(re[Z]=I[Z]);var ue=arguments.length-2;if(ue===1)re.children=X;else if(1<ue){for(var se=Array(ue),me=0;me<ue;me++)se[me]=arguments[me+2];re.children=se}if(T&&T.defaultProps)for(Z in ue=T.defaultProps,ue)re[Z]===void 0&&(re[Z]=ue[Z]);return H(T,fe,void 0,void 0,null,re)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(T){return{$$typeof:f,render:T}},ke.isValidElement=P,ke.lazy=function(T){return{$$typeof:g,_payload:{_status:-1,_result:T},_init:q}},ke.memo=function(T,I){return{$$typeof:h,type:T,compare:I===void 0?null:I}},ke.startTransition=function(T){var I=O.T,X={};O.T=X;try{var Z=T(),re=O.S;re!==null&&re(X,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(L,B)}catch(fe){B(fe)}finally{O.T=I}},ke.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ke.use=function(T){return O.H.use(T)},ke.useActionState=function(T,I,X){return O.H.useActionState(T,I,X)},ke.useCallback=function(T,I){return O.H.useCallback(T,I)},ke.useContext=function(T){return O.H.useContext(T)},ke.useDebugValue=function(){},ke.useDeferredValue=function(T,I){return O.H.useDeferredValue(T,I)},ke.useEffect=function(T,I,X){var Z=O.H;if(typeof X=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Z.useEffect(T,I)},ke.useId=function(){return O.H.useId()},ke.useImperativeHandle=function(T,I,X){return O.H.useImperativeHandle(T,I,X)},ke.useInsertionEffect=function(T,I){return O.H.useInsertionEffect(T,I)},ke.useLayoutEffect=function(T,I){return O.H.useLayoutEffect(T,I)},ke.useMemo=function(T,I){return O.H.useMemo(T,I)},ke.useOptimistic=function(T,I){return O.H.useOptimistic(T,I)},ke.useReducer=function(T,I,X){return O.H.useReducer(T,I,X)},ke.useRef=function(T){return O.H.useRef(T)},ke.useState=function(T){return O.H.useState(T)},ke.useSyncExternalStore=function(T,I,X){return O.H.useSyncExternalStore(T,I,X)},ke.useTransition=function(){return O.H.useTransition()},ke.version="19.1.0",ke}var rb;function tc(){return rb||(rb=1,Hm.exports=wA()),Hm.exports}var x=tc();const ae=dg(x),hS=yA({__proto__:null,default:ae},[x]);var $m={exports:{}},vl={},Im={exports:{}},Vm={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ab;function SA(){return ab||(ab=1,function(e){function t(D,q){var B=D.length;D.push(q);e:for(;0<B;){var L=B-1>>>1,T=D[L];if(0<i(T,q))D[L]=q,D[B]=T,B=L;else break e}}function r(D){return D.length===0?null:D[0]}function o(D){if(D.length===0)return null;var q=D[0],B=D.pop();if(B!==q){D[0]=B;e:for(var L=0,T=D.length,I=T>>>1;L<I;){var X=2*(L+1)-1,Z=D[X],re=X+1,fe=D[re];if(0>i(Z,B))re<T&&0>i(fe,Z)?(D[L]=fe,D[re]=B,L=re):(D[L]=Z,D[X]=B,L=X);else if(re<T&&0>i(fe,B))D[L]=fe,D[re]=B,L=re;else break e}}return q}function i(D,q){var B=D.sortIndex-q.sortIndex;return B!==0?B:D.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],g=1,v=null,b=3,w=!1,E=!1,S=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function M(D){for(var q=r(h);q!==null;){if(q.callback===null)o(h);else if(q.startTime<=D)o(h),q.sortIndex=q.expirationTime,t(m,q);else break;q=r(h)}}function O(D){if(S=!1,M(D),!E)if(r(m)!==null)E=!0,U||(U=!0,K());else{var q=r(h);q!==null&&Y(O,q.startTime-D)}}var U=!1,H=-1,V=5,P=-1;function z(){return N?!0:!(e.unstable_now()-P<V)}function F(){if(N=!1,U){var D=e.unstable_now();P=D;var q=!0;try{e:{E=!1,S&&(S=!1,j(H),H=-1),w=!0;var B=b;try{t:{for(M(D),v=r(m);v!==null&&!(v.expirationTime>D&&z());){var L=v.callback;if(typeof L=="function"){v.callback=null,b=v.priorityLevel;var T=L(v.expirationTime<=D);if(D=e.unstable_now(),typeof T=="function"){v.callback=T,M(D),q=!0;break t}v===r(m)&&o(m),M(D)}else o(m);v=r(m)}if(v!==null)q=!0;else{var I=r(h);I!==null&&Y(O,I.startTime-D),q=!1}}break e}finally{v=null,b=B,w=!1}q=void 0}}finally{q?K():U=!1}}}var K;if(typeof A=="function")K=function(){A(F)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,k=te.port2;te.port1.onmessage=F,K=function(){k.postMessage(null)}}else K=function(){C(F,0)};function Y(D,q){H=C(function(){D(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(D){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var B=b;b=q;try{return D()}finally{b=B}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(D,q){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var B=b;b=D;try{return q()}finally{b=B}},e.unstable_scheduleCallback=function(D,q,B){var L=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?L+B:L):B=L,D){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=B+T,D={id:g++,callback:q,priorityLevel:D,startTime:B,expirationTime:T,sortIndex:-1},B>L?(D.sortIndex=B,t(h,D),r(m)===null&&D===r(h)&&(S?(j(H),H=-1):S=!0,Y(O,B-L))):(D.sortIndex=T,t(m,D),E||w||(E=!0,U||(U=!0,K()))),D},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(D){var q=b;return function(){var B=b;b=q;try{return D.apply(this,arguments)}finally{b=B}}}}(Vm)),Vm}var ob;function EA(){return ob||(ob=1,Im.exports=SA()),Im.exports}var qm={exports:{}},Qt={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var sb;function NA(){if(sb)return Qt;sb=1;var e=tc();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={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},i=Symbol.for("react.portal");function l(m,h,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:m,containerInfo:h,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Qt.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(m,h,null,g)},Qt.flushSync=function(m){var h=u.T,g=o.p;try{if(u.T=null,o.p=2,m)return m()}finally{u.T=h,o.p=g,o.d.f()}},Qt.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(m,h))},Qt.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},Qt.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,v=f(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?o.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:w}):g==="script"&&o.d.X(m,{crossOrigin:v,integrity:b,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Qt.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);o.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(m)},Qt.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,v=f(g,h.crossOrigin);o.d.L(m,g,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Qt.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);o.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(m)},Qt.requestFormReset=function(m){o.d.r(m)},Qt.unstable_batchedUpdates=function(m,h){return m(h)},Qt.useFormState=function(m,h,g){return u.H.useFormState(m,h,g)},Qt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Qt.version="19.1.0",Qt}var ib;function mS(){if(ib)return qm.exports;ib=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(),qm.exports=NA(),qm.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var lb;function CA(){if(lb)return vl;lb=1;var e=EA(),t=tc(),r=mS();function o(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var a=n,s=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(s=a.return),n=a.return;while(n)}return a.tag===3?s:null}function u(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function f(n){if(l(n)!==n)throw Error(o(188))}function m(n){var a=n.alternate;if(!a){if(a=l(n),a===null)throw Error(o(188));return a!==n?null:n}for(var s=n,c=a;;){var p=s.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===s)return f(p),n;if(y===c)return f(p),a;y=y.sibling}throw Error(o(188))}if(s.return!==c.return)s=p,c=y;else{for(var _=!1,R=p.child;R;){if(R===s){_=!0,s=p,c=y;break}if(R===c){_=!0,c=p,s=y;break}R=R.sibling}if(!_){for(R=y.child;R;){if(R===s){_=!0,s=y,c=p;break}if(R===c){_=!0,c=y,s=p;break}R=R.sibling}if(!_)throw Error(o(189))}}if(s.alternate!==c)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?n:a}function h(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=h(n),a!==null)return a;n=n.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),A=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function K(n){return n===null||typeof n!="object"?null:(n=F&&n[F]||n["@@iterator"],typeof n=="function"?n:null)}var te=Symbol.for("react.client.reference");function k(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===te?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case E:return"Fragment";case N:return"Profiler";case S:return"StrictMode";case O:return"Suspense";case U:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case A:return(n.displayName||"Context")+".Provider";case j:return(n._context.displayName||"Context")+".Consumer";case M:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case H:return a=n.displayName||null,a!==null?a:k(n.type)||"Memo";case V:a=n._payload,n=n._init;try{return k(n(a))}catch{}}return null}var Y=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},L=[],T=-1;function I(n){return{current:n}}function X(n){0>T||(n.current=L[T],L[T]=null,T--)}function Z(n,a){T++,L[T]=n.current,n.current=a}var re=I(null),fe=I(null),ue=I(null),se=I(null);function me(n,a){switch(Z(ue,a),Z(fe,n),Z(re,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?A0(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=A0(a),n=T0(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}X(re),Z(re,n)}function pe(){X(re),X(fe),X(ue)}function ge(n){n.memoizedState!==null&&Z(se,n);var a=re.current,s=T0(a,n.type);a!==s&&(Z(fe,n),Z(re,s))}function Ee(n){fe.current===n&&(X(re),X(fe)),se.current===n&&(X(se),dl._currentValue=B)}var Se=Object.prototype.hasOwnProperty,Ye=e.unstable_scheduleCallback,We=e.unstable_cancelCallback,Je=e.unstable_shouldYield,mt=e.unstable_requestPaint,he=e.unstable_now,de=e.unstable_getCurrentPriorityLevel,Te=e.unstable_ImmediatePriority,Ke=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,Ct=e.unstable_LowPriority,zr=e.unstable_IdlePriority,Xn=e.log,pa=e.unstable_setDisableYieldValue,yn=null,bt=null;function tn(n){if(typeof Xn=="function"&&pa(n),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(yn,n)}catch{}}var jt=Math.clz32?Math.clz32:xn,lo=Math.log,Lt=Math.LN2;function xn(n){return n>>>=0,n===0?32:31-(lo(n)/Lt|0)|0}var Mn=256,Dn=4194304;function nn(n){var a=n&42;if(a!==0)return a;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:case 262144:case 524288:case 1048576:case 2097152:return n&4194048;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 sn(n,a,s){var c=n.pendingLanes;if(c===0)return 0;var p=0,y=n.suspendedLanes,_=n.pingedLanes;n=n.warmLanes;var R=c&134217727;return R!==0?(c=R&~y,c!==0?p=nn(c):(_&=R,_!==0?p=nn(_):s||(s=R&~n,s!==0&&(p=nn(s))))):(R=c&~y,R!==0?p=nn(R):_!==0?p=nn(_):s||(s=c&~n,s!==0&&(p=nn(s)))),p===0?0:a!==0&&a!==p&&(a&y)===0&&(y=p&-p,s=a&-a,y>=s||y===32&&(s&4194048)!==0)?a:p}function Wt(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function co(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 rs(){var n=Mn;return Mn<<=1,(Mn&4194048)===0&&(Mn=256),n}function ga(){var n=Dn;return Dn<<=1,(Dn&62914560)===0&&(Dn=4194304),n}function uo(n){for(var a=[],s=0;31>s;s++)a.push(n);return a}function va(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Lr(n,a,s,c,p,y){var _=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var R=n.entanglements,$=n.expirationTimes,J=n.hiddenUpdates;for(s=_&~s;0<s;){var ie=31-jt(s),ce=1<<ie;R[ie]=0,$[ie]=-1;var ee=J[ie];if(ee!==null)for(J[ie]=null,ie=0;ie<ee.length;ie++){var ne=ee[ie];ne!==null&&(ne.lane&=-536870913)}s&=~ce}c!==0&&xc(n,c,0),y!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=y&~(_&~a))}function xc(n,a,s){n.pendingLanes|=a,n.suspendedLanes&=~a;var c=31-jt(a);n.entangledLanes|=a,n.entanglements[c]=n.entanglements[c]|1073741824|s&4194090}function bc(n,a){var s=n.entangledLanes|=a;for(n=n.entanglements;s;){var c=31-jt(s),p=1<<c;p&a|n[c]&a&&(n[c]|=a),s&=~p}}function xi(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 bi(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function wc(){var n=q.p;return n!==0?n:(n=window.event,n===void 0?32:X0(n.type))}function Df(n,a){var s=q.p;try{return q.p=n,a()}finally{q.p=s}}var gr=Math.random().toString(36).slice(2),Pt="__reactFiber$"+gr,Kt="__reactProps$"+gr,ya="__reactContainer$"+gr,wi="__reactEvents$"+gr,Of="__reactListeners$"+gr,kf="__reactHandles$"+gr,Sc="__reactResources$"+gr,fo="__reactMarker$"+gr;function Si(n){delete n[Pt],delete n[Kt],delete n[wi],delete n[Of],delete n[kf]}function Pr(n){var a=n[Pt];if(a)return a;for(var s=n.parentNode;s;){if(a=s[ya]||s[Pt]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(n=O0(n);n!==null;){if(s=n[Pt])return s;n=O0(n)}return a}n=s,s=n.parentNode}return null}function xa(n){if(n=n[Pt]||n[ya]){var a=n.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return n}return null}function ho(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(o(33))}function ba(n){var a=n[Sc];return a||(a=n[Sc]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function _t(n){n[fo]=!0}var Ec=new Set,Nc={};function Ur(n,a){wa(n,a),wa(n+"Capture",a)}function wa(n,a){for(Nc[n]=a,n=0;n<a.length;n++)Ec.add(a[n])}var Cc=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]*$"),jc={},_c={};function zf(n){return Se.call(_c,n)?!0:Se.call(jc,n)?!1:Cc.test(n)?_c[n]=!0:(jc[n]=!0,!1)}function as(n,a,s){if(zf(a))if(s===null)n.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,""+s)}}function os(n,a,s){if(s===null)n.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,""+s)}}function Wn(n,a,s,c){if(c===null)n.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(a,s,""+c)}}var ss,Ac;function Sa(n){if(ss===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);ss=a&&a[1]||"",Ac=-1<s.stack.indexOf(`
    at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ss+n+Ac}var Ei=!1;function mo(n,a){if(!n||Ei)return"";Ei=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ne){var ee=ne}Reflect.construct(n,[],ce)}else{try{ce.call()}catch(ne){ee=ne}n.call(ce.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(ce=n())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),_=y[0],R=y[1];if(_&&R){var $=_.split(`
`),J=R.split(`
`);for(p=c=0;c<$.length&&!$[c].includes("DetermineComponentFrameRoot");)c++;for(;p<J.length&&!J[p].includes("DetermineComponentFrameRoot");)p++;if(c===$.length||p===J.length)for(c=$.length-1,p=J.length-1;1<=c&&0<=p&&$[c]!==J[p];)p--;for(;1<=c&&0<=p;c--,p--)if($[c]!==J[p]){if(c!==1||p!==1)do if(c--,p--,0>p||$[c]!==J[p]){var ie=`
`+$[c].replace(" at new "," at ");return n.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",n.displayName)),ie}while(1<=c&&0<=p);break}}}finally{Ei=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?Sa(s):""}function fj(n){switch(n.tag){case 26:case 27:case 5:return Sa(n.type);case 16:return Sa("Lazy");case 13:return Sa("Suspense");case 19:return Sa("SuspenseList");case 0:case 15:return mo(n.type,!1);case 11:return mo(n.type.render,!1);case 1:return mo(n.type,!0);case 31:return Sa("Activity");default:return""}}function Sv(n){try{var a="";do a+=fj(n),n=n.return;while(n);return a}catch(s){return`
Error generating stack: `+s.message+`
`+s.stack}}function On(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ev(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function hj(n){var a=Ev(n)?"checked":"value",s=Object.getOwnPropertyDescriptor(n.constructor.prototype,a),c=""+n[a];if(!n.hasOwnProperty(a)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var p=s.get,y=s.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return p.call(this)},set:function(_){c=""+_,y.call(this,_)}}),Object.defineProperty(n,a,{enumerable:s.enumerable}),{getValue:function(){return c},setValue:function(_){c=""+_},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function Tc(n){n._valueTracker||(n._valueTracker=hj(n))}function Nv(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var s=a.getValue(),c="";return n&&(c=Ev(n)?n.checked?"true":"false":n.value),n=c,n!==s?(a.setValue(n),!0):!1}function Rc(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 mj=/[\n"\\]/g;function kn(n){return n.replace(mj,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Lf(n,a,s,c,p,y,_,R){n.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.type=_:n.removeAttribute("type"),a!=null?_==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+On(a)):n.value!==""+On(a)&&(n.value=""+On(a)):_!=="submit"&&_!=="reset"||n.removeAttribute("value"),a!=null?Pf(n,_,On(a)):s!=null?Pf(n,_,On(s)):c!=null&&n.removeAttribute("value"),p==null&&y!=null&&(n.defaultChecked=!!y),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?n.name=""+On(R):n.removeAttribute("name")}function Cv(n,a,s,c,p,y,_,R){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),a!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||a!=null))return;s=s!=null?""+On(s):"",a=a!=null?""+On(a):s,R||a===n.value||(n.value=a),n.defaultValue=a}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=R?n.checked:!!c,n.defaultChecked=!!c,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(n.name=_)}function Pf(n,a,s){a==="number"&&Rc(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function is(n,a,s,c){if(n=n.options,a){a={};for(var p=0;p<s.length;p++)a["$"+s[p]]=!0;for(s=0;s<n.length;s++)p=a.hasOwnProperty("$"+n[s].value),n[s].selected!==p&&(n[s].selected=p),p&&c&&(n[s].defaultSelected=!0)}else{for(s=""+On(s),a=null,p=0;p<n.length;p++){if(n[p].value===s){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}a!==null||n[p].disabled||(a=n[p])}a!==null&&(a.selected=!0)}}function jv(n,a,s){if(a!=null&&(a=""+On(a),a!==n.value&&(n.value=a),s==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=s!=null?""+On(s):""}function _v(n,a,s,c){if(a==null){if(c!=null){if(s!=null)throw Error(o(92));if(Y(c)){if(1<c.length)throw Error(o(93));c=c[0]}s=c}s==null&&(s=""),a=s}s=On(a),n.defaultValue=s,c=n.textContent,c===s&&c!==""&&c!==null&&(n.value=c)}function ls(n,a){if(a){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=a;return}}n.textContent=a}var pj=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 Av(n,a,s){var c=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":c?n.setProperty(a,s):typeof s!="number"||s===0||pj.has(a)?a==="float"?n.cssFloat=s:n[a]=(""+s).trim():n[a]=s+"px"}function Tv(n,a,s){if(a!=null&&typeof a!="object")throw Error(o(62));if(n=n.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var p in a)c=a[p],a.hasOwnProperty(p)&&s[p]!==c&&Av(n,p,c)}else for(var y in a)a.hasOwnProperty(y)&&Av(n,y,a[y])}function Uf(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 gj=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"]]),vj=/^[\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 Mc(n){return vj.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}var Bf=null;function Hf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var cs=null,us=null;function Rv(n){var a=xa(n);if(a&&(n=a.stateNode)){var s=n[Kt]||null;e:switch(n=a.stateNode,a.type){case"input":if(Lf(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+kn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var c=s[a];if(c!==n&&c.form===n.form){var p=c[Kt]||null;if(!p)throw Error(o(90));Lf(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(a=0;a<s.length;a++)c=s[a],c.form===n.form&&Nv(c)}break e;case"textarea":jv(n,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&is(n,!!s.multiple,a,!1)}}}var $f=!1;function Mv(n,a,s){if($f)return n(a,s);$f=!0;try{var c=n(a);return c}finally{if($f=!1,(cs!==null||us!==null)&&(gu(),cs&&(a=cs,n=us,us=cs=null,Rv(a),n)))for(a=0;a<n.length;a++)Rv(n[a])}}function Ni(n,a){var s=n.stateNode;if(s===null)return null;var c=s[Kt]||null;if(c===null)return null;s=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(o(231,a,typeof s));return s}var Br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),If=!1;if(Br)try{var Ci={};Object.defineProperty(Ci,"passive",{get:function(){If=!0}}),window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{If=!1}var Ea=null,Vf=null,Dc=null;function Dv(){if(Dc)return Dc;var n,a=Vf,s=a.length,c,p="value"in Ea?Ea.value:Ea.textContent,y=p.length;for(n=0;n<s&&a[n]===p[n];n++);var _=s-n;for(c=1;c<=_&&a[s-c]===p[y-c];c++);return Dc=p.slice(n,1<c?1-c:void 0)}function Oc(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function kc(){return!0}function Ov(){return!1}function ln(n){function a(s,c,p,y,_){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=_,this.currentTarget=null;for(var R in n)n.hasOwnProperty(R)&&(s=n[R],this[R]=s?s(y):y[R]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?kc:Ov,this.isPropagationStopped=Ov,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=kc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=kc)},persist:function(){},isPersistent:kc}),a}var po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zc=ln(po),ji=g({},po,{view:0,detail:0}),yj=ln(ji),qf,Yf,_i,Lc=g({},ji,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ff,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!==_i&&(_i&&n.type==="mousemove"?(qf=n.screenX-_i.screenX,Yf=n.screenY-_i.screenY):Yf=qf=0,_i=n),qf)},movementY:function(n){return"movementY"in n?n.movementY:Yf}}),kv=ln(Lc),xj=g({},Lc,{dataTransfer:0}),bj=ln(xj),wj=g({},ji,{relatedTarget:0}),Gf=ln(wj),Sj=g({},po,{animationName:0,elapsedTime:0,pseudoElement:0}),Ej=ln(Sj),Nj=g({},po,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Cj=ln(Nj),jj=g({},po,{data:0}),zv=ln(jj),_j={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Aj={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"},Tj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rj(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=Tj[n])?!!a[n]:!1}function Ff(){return Rj}var Mj=g({},ji,{key:function(n){if(n.key){var a=_j[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=Oc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Aj[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ff,charCode:function(n){return n.type==="keypress"?Oc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Oc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Dj=ln(Mj),Oj=g({},Lc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lv=ln(Oj),kj=g({},ji,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ff}),zj=ln(kj),Lj=g({},po,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pj=ln(Lj),Uj=g({},Lc,{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}),Bj=ln(Uj),Hj=g({},po,{newState:0,oldState:0}),$j=ln(Hj),Ij=[9,13,27,32],Xf=Br&&"CompositionEvent"in window,Ai=null;Br&&"documentMode"in document&&(Ai=document.documentMode);var Vj=Br&&"TextEvent"in window&&!Ai,Pv=Br&&(!Xf||Ai&&8<Ai&&11>=Ai),Uv=" ",Bv=!1;function Hv(n,a){switch(n){case"keyup":return Ij.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $v(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ds=!1;function qj(n,a){switch(n){case"compositionend":return $v(a);case"keypress":return a.which!==32?null:(Bv=!0,Uv);case"textInput":return n=a.data,n===Uv&&Bv?null:n;default:return null}}function Yj(n,a){if(ds)return n==="compositionend"||!Xf&&Hv(n,a)?(n=Dv(),Dc=Vf=Ea=null,ds=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Pv&&a.locale!=="ko"?null:a.data;default:return null}}var Gj={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 Iv(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!Gj[n.type]:a==="textarea"}function Vv(n,a,s,c){cs?us?us.push(c):us=[c]:cs=c,a=Su(a,"onChange"),0<a.length&&(s=new zc("onChange","change",null,s,c),n.push({event:s,listeners:a}))}var Ti=null,Ri=null;function Fj(n){E0(n,0)}function Pc(n){var a=ho(n);if(Nv(a))return n}function qv(n,a){if(n==="change")return a}var Yv=!1;if(Br){var Wf;if(Br){var Kf="oninput"in document;if(!Kf){var Gv=document.createElement("div");Gv.setAttribute("oninput","return;"),Kf=typeof Gv.oninput=="function"}Wf=Kf}else Wf=!1;Yv=Wf&&(!document.documentMode||9<document.documentMode)}function Fv(){Ti&&(Ti.detachEvent("onpropertychange",Xv),Ri=Ti=null)}function Xv(n){if(n.propertyName==="value"&&Pc(Ri)){var a=[];Vv(a,Ri,n,Hf(n)),Mv(Fj,a)}}function Xj(n,a,s){n==="focusin"?(Fv(),Ti=a,Ri=s,Ti.attachEvent("onpropertychange",Xv)):n==="focusout"&&Fv()}function Wj(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Pc(Ri)}function Kj(n,a){if(n==="click")return Pc(a)}function Zj(n,a){if(n==="input"||n==="change")return Pc(a)}function Qj(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var bn=typeof Object.is=="function"?Object.is:Qj;function Mi(n,a){if(bn(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var s=Object.keys(n),c=Object.keys(a);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Se.call(a,p)||!bn(n[p],a[p]))return!1}return!0}function Wv(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Kv(n,a){var s=Wv(n);n=0;for(var c;s;){if(s.nodeType===3){if(c=n+s.textContent.length,n<=a&&c>=a)return{node:s,offset:a-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Wv(s)}}function Zv(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?Zv(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function Qv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Rc(n.document);a instanceof n.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)n=a.contentWindow;else break;a=Rc(n.document)}return a}function Zf(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var Jj=Br&&"documentMode"in document&&11>=document.documentMode,fs=null,Qf=null,Di=null,Jf=!1;function Jv(n,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Jf||fs==null||fs!==Rc(c)||(c=fs,"selectionStart"in c&&Zf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Di&&Mi(Di,c)||(Di=c,c=Su(Qf,"onSelect"),0<c.length&&(a=new zc("onSelect","select",null,a,s),n.push({event:a,listeners:c}),a.target=fs)))}function go(n,a){var s={};return s[n.toLowerCase()]=a.toLowerCase(),s["Webkit"+n]="webkit"+a,s["Moz"+n]="moz"+a,s}var hs={animationend:go("Animation","AnimationEnd"),animationiteration:go("Animation","AnimationIteration"),animationstart:go("Animation","AnimationStart"),transitionrun:go("Transition","TransitionRun"),transitionstart:go("Transition","TransitionStart"),transitioncancel:go("Transition","TransitionCancel"),transitionend:go("Transition","TransitionEnd")},eh={},ey={};Br&&(ey=document.createElement("div").style,"AnimationEvent"in window||(delete hs.animationend.animation,delete hs.animationiteration.animation,delete hs.animationstart.animation),"TransitionEvent"in window||delete hs.transitionend.transition);function vo(n){if(eh[n])return eh[n];if(!hs[n])return n;var a=hs[n],s;for(s in a)if(a.hasOwnProperty(s)&&s in ey)return eh[n]=a[s];return n}var ty=vo("animationend"),ny=vo("animationiteration"),ry=vo("animationstart"),e_=vo("transitionrun"),t_=vo("transitionstart"),n_=vo("transitioncancel"),ay=vo("transitionend"),oy=new Map,th="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(" ");th.push("scrollEnd");function Kn(n,a){oy.set(n,a),Ur(a,[n])}var sy=new WeakMap;function zn(n,a){if(typeof n=="object"&&n!==null){var s=sy.get(n);return s!==void 0?s:(a={value:n,source:a,stack:Sv(a)},sy.set(n,a),a)}return{value:n,source:a,stack:Sv(a)}}var Ln=[],ms=0,nh=0;function Uc(){for(var n=ms,a=nh=ms=0;a<n;){var s=Ln[a];Ln[a++]=null;var c=Ln[a];Ln[a++]=null;var p=Ln[a];Ln[a++]=null;var y=Ln[a];if(Ln[a++]=null,c!==null&&p!==null){var _=c.pending;_===null?p.next=p:(p.next=_.next,_.next=p),c.pending=p}y!==0&&iy(s,p,y)}}function Bc(n,a,s,c){Ln[ms++]=n,Ln[ms++]=a,Ln[ms++]=s,Ln[ms++]=c,nh|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function rh(n,a,s,c){return Bc(n,a,s,c),Hc(n)}function ps(n,a){return Bc(n,null,null,a),Hc(n)}function iy(n,a,s){n.lanes|=s;var c=n.alternate;c!==null&&(c.lanes|=s);for(var p=!1,y=n.return;y!==null;)y.childLanes|=s,c=y.alternate,c!==null&&(c.childLanes|=s),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(p=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,p&&a!==null&&(p=31-jt(s),n=y.hiddenUpdates,c=n[p],c===null?n[p]=[a]:c.push(a),a.lane=s|536870912),y):null}function Hc(n){if(50<rl)throw rl=0,cm=null,Error(o(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var gs={};function r_(n,a,s,c){this.tag=n,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(n,a,s,c){return new r_(n,a,s,c)}function ah(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Hr(n,a){var s=n.alternate;return s===null?(s=wn(n.tag,a,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=a,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,a=n.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function ly(n,a){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,a=s.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function $c(n,a,s,c,p,y){var _=0;if(c=n,typeof n=="function")ah(n)&&(_=1);else if(typeof n=="string")_=oA(n,s,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=wn(31,s,a,p),n.elementType=P,n.lanes=y,n;case E:return yo(s.children,p,y,a);case S:_=8,p|=24;break;case N:return n=wn(12,s,a,p|2),n.elementType=N,n.lanes=y,n;case O:return n=wn(13,s,a,p),n.elementType=O,n.lanes=y,n;case U:return n=wn(19,s,a,p),n.elementType=U,n.lanes=y,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case C:case A:_=10;break e;case j:_=9;break e;case M:_=11;break e;case H:_=14;break e;case V:_=16,c=null;break e}_=29,s=Error(o(130,n===null?"null":typeof n,"")),c=null}return a=wn(_,s,a,p),a.elementType=n,a.type=c,a.lanes=y,a}function yo(n,a,s,c){return n=wn(7,n,c,a),n.lanes=s,n}function oh(n,a,s){return n=wn(6,n,null,a),n.lanes=s,n}function sh(n,a,s){return a=wn(4,n.children!==null?n.children:[],n.key,a),a.lanes=s,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var vs=[],ys=0,Ic=null,Vc=0,Pn=[],Un=0,xo=null,$r=1,Ir="";function bo(n,a){vs[ys++]=Vc,vs[ys++]=Ic,Ic=n,Vc=a}function cy(n,a,s){Pn[Un++]=$r,Pn[Un++]=Ir,Pn[Un++]=xo,xo=n;var c=$r;n=Ir;var p=32-jt(c)-1;c&=~(1<<p),s+=1;var y=32-jt(a)+p;if(30<y){var _=p-p%5;y=(c&(1<<_)-1).toString(32),c>>=_,p-=_,$r=1<<32-jt(a)+p|s<<p|c,Ir=y+n}else $r=1<<y|s<<p|c,Ir=n}function ih(n){n.return!==null&&(bo(n,1),cy(n,1,0))}function lh(n){for(;n===Ic;)Ic=vs[--ys],vs[ys]=null,Vc=vs[--ys],vs[ys]=null;for(;n===xo;)xo=Pn[--Un],Pn[Un]=null,Ir=Pn[--Un],Pn[Un]=null,$r=Pn[--Un],Pn[Un]=null}var rn=null,gt=null,et=!1,wo=null,vr=!1,ch=Error(o(519));function So(n){var a=Error(o(418,""));throw zi(zn(a,n)),ch}function uy(n){var a=n.stateNode,s=n.type,c=n.memoizedProps;switch(a[Pt]=n,a[Kt]=c,s){case"dialog":Ve("cancel",a),Ve("close",a);break;case"iframe":case"object":case"embed":Ve("load",a);break;case"video":case"audio":for(s=0;s<ol.length;s++)Ve(ol[s],a);break;case"source":Ve("error",a);break;case"img":case"image":case"link":Ve("error",a),Ve("load",a);break;case"details":Ve("toggle",a);break;case"input":Ve("invalid",a),Cv(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0),Tc(a);break;case"select":Ve("invalid",a);break;case"textarea":Ve("invalid",a),_v(a,c.value,c.defaultValue,c.children),Tc(a)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||c.suppressHydrationWarning===!0||_0(a.textContent,s)?(c.popover!=null&&(Ve("beforetoggle",a),Ve("toggle",a)),c.onScroll!=null&&Ve("scroll",a),c.onScrollEnd!=null&&Ve("scrollend",a),c.onClick!=null&&(a.onclick=Eu),a=!0):a=!1,a||So(n)}function dy(n){for(rn=n.return;rn;)switch(rn.tag){case 5:case 13:vr=!1;return;case 27:case 3:vr=!0;return;default:rn=rn.return}}function Oi(n){if(n!==rn)return!1;if(!et)return dy(n),et=!0,!1;var a=n.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||Cm(n.type,n.memoizedProps)),s=!s),s&&gt&&So(n),dy(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));e:{for(n=n.nextSibling,a=0;n;){if(n.nodeType===8)if(s=n.data,s==="/$"){if(a===0){gt=Qn(n.nextSibling);break e}a--}else s!=="$"&&s!=="$!"&&s!=="$?"||a++;n=n.nextSibling}gt=null}}else a===27?(a=gt,Ba(n.type)?(n=Tm,Tm=null,gt=n):gt=a):gt=rn?Qn(n.stateNode.nextSibling):null;return!0}function ki(){gt=rn=null,et=!1}function fy(){var n=wo;return n!==null&&(dn===null?dn=n:dn.push.apply(dn,n),wo=null),n}function zi(n){wo===null?wo=[n]:wo.push(n)}var uh=I(null),Eo=null,Vr=null;function Na(n,a,s){Z(uh,a._currentValue),a._currentValue=s}function qr(n){n._currentValue=uh.current,X(uh)}function dh(n,a,s){for(;n!==null;){var c=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),n===s)break;n=n.return}}function fh(n,a,s,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var y=p.dependencies;if(y!==null){var _=p.child;y=y.firstContext;e:for(;y!==null;){var R=y;y=p;for(var $=0;$<a.length;$++)if(R.context===a[$]){y.lanes|=s,R=y.alternate,R!==null&&(R.lanes|=s),dh(y.return,s,n),c||(_=null);break e}y=R.next}}else if(p.tag===18){if(_=p.return,_===null)throw Error(o(341));_.lanes|=s,y=_.alternate,y!==null&&(y.lanes|=s),dh(_,s,n),_=null}else _=p.child;if(_!==null)_.return=p;else for(_=p;_!==null;){if(_===n){_=null;break}if(p=_.sibling,p!==null){p.return=_.return,_=p;break}_=_.return}p=_}}function Li(n,a,s,c){n=null;for(var p=a,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var _=p.alternate;if(_===null)throw Error(o(387));if(_=_.memoizedProps,_!==null){var R=p.type;bn(p.pendingProps.value,_.value)||(n!==null?n.push(R):n=[R])}}else if(p===se.current){if(_=p.alternate,_===null)throw Error(o(387));_.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(dl):n=[dl])}p=p.return}n!==null&&fh(a,n,s,c),a.flags|=262144}function qc(n){for(n=n.firstContext;n!==null;){if(!bn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function No(n){Eo=n,Vr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Zt(n){return hy(Eo,n)}function Yc(n,a){return Eo===null&&No(n),hy(n,a)}function hy(n,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},Vr===null){if(n===null)throw Error(o(308));Vr=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Vr=Vr.next=a;return s}var a_=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(s,c){n.push(c)}};this.abort=function(){a.aborted=!0,n.forEach(function(s){return s()})}},o_=e.unstable_scheduleCallback,s_=e.unstable_NormalPriority,Dt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hh(){return{controller:new a_,data:new Map,refCount:0}}function Pi(n){n.refCount--,n.refCount===0&&o_(s_,function(){n.controller.abort()})}var Ui=null,mh=0,xs=0,bs=null;function i_(n,a){if(Ui===null){var s=Ui=[];mh=0,xs=gm(),bs={status:"pending",value:void 0,then:function(c){s.push(c)}}}return mh++,a.then(my,my),a}function my(){if(--mh===0&&Ui!==null){bs!==null&&(bs.status="fulfilled");var n=Ui;Ui=null,xs=0,bs=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function l_(n,a){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return n.then(function(){c.status="fulfilled",c.value=a;for(var p=0;p<s.length;p++)(0,s[p])(a)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var py=D.S;D.S=function(n,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&i_(n,a),py!==null&&py(n,a)};var Co=I(null);function ph(){var n=Co.current;return n!==null?n:lt.pooledCache}function Gc(n,a){a===null?Z(Co,Co.current):Z(Co,a.pool)}function gy(){var n=ph();return n===null?null:{parent:Dt._currentValue,pool:n}}var Bi=Error(o(460)),vy=Error(o(474)),Fc=Error(o(542)),gh={then:function(){}};function yy(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Xc(){}function xy(n,a,s){switch(s=n[s],s===void 0?n.push(a):s!==a&&(a.then(Xc,Xc),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,wy(n),n;default:if(typeof a.status=="string")a.then(Xc,Xc);else{if(n=lt,n!==null&&100<n.shellSuspendCounter)throw Error(o(482));n=a,n.status="pending",n.then(function(c){if(a.status==="pending"){var p=a;p.status="fulfilled",p.value=c}},function(c){if(a.status==="pending"){var p=a;p.status="rejected",p.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,wy(n),n}throw Hi=a,Bi}}var Hi=null;function by(){if(Hi===null)throw Error(o(459));var n=Hi;return Hi=null,n}function wy(n){if(n===Bi||n===Fc)throw Error(o(483))}var Ca=!1;function vh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yh(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ja(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function _a(n,a,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(tt&2)!==0){var p=c.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),c.pending=a,a=Hc(n),iy(n,null,s),a}return Bc(n,c,a,s),Hc(n)}function $i(n,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,bc(n,s)}}function xh(n,a){var s=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?p=y=_:y=y.next=_,s=s.next}while(s!==null);y===null?p=y=a:y=y.next=a}else p=y=a;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=a:n.next=a,s.lastBaseUpdate=a}var bh=!1;function Ii(){if(bh){var n=bs;if(n!==null)throw n}}function Vi(n,a,s,c){bh=!1;var p=n.updateQueue;Ca=!1;var y=p.firstBaseUpdate,_=p.lastBaseUpdate,R=p.shared.pending;if(R!==null){p.shared.pending=null;var $=R,J=$.next;$.next=null,_===null?y=J:_.next=J,_=$;var ie=n.alternate;ie!==null&&(ie=ie.updateQueue,R=ie.lastBaseUpdate,R!==_&&(R===null?ie.firstBaseUpdate=J:R.next=J,ie.lastBaseUpdate=$))}if(y!==null){var ce=p.baseState;_=0,ie=J=$=null,R=y;do{var ee=R.lane&-536870913,ne=ee!==R.lane;if(ne?(Fe&ee)===ee:(c&ee)===ee){ee!==0&&ee===xs&&(bh=!0),ie!==null&&(ie=ie.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Re=n,je=R;ee=a;var st=s;switch(je.tag){case 1:if(Re=je.payload,typeof Re=="function"){ce=Re.call(st,ce,ee);break e}ce=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=je.payload,ee=typeof Re=="function"?Re.call(st,ce,ee):Re,ee==null)break e;ce=g({},ce,ee);break e;case 2:Ca=!0}}ee=R.callback,ee!==null&&(n.flags|=64,ne&&(n.flags|=8192),ne=p.callbacks,ne===null?p.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ie===null?(J=ie=ne,$=ce):ie=ie.next=ne,_|=ee;if(R=R.next,R===null){if(R=p.shared.pending,R===null)break;ne=R,R=ne.next,ne.next=null,p.lastBaseUpdate=ne,p.shared.pending=null}}while(!0);ie===null&&($=ce),p.baseState=$,p.firstBaseUpdate=J,p.lastBaseUpdate=ie,y===null&&(p.shared.lanes=0),za|=_,n.lanes=_,n.memoizedState=ce}}function Sy(n,a){if(typeof n!="function")throw Error(o(191,n));n.call(a)}function Ey(n,a){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)Sy(s[n],a)}var ws=I(null),Wc=I(0);function Ny(n,a){n=Zr,Z(Wc,n),Z(ws,a),Zr=n|a.baseLanes}function wh(){Z(Wc,Zr),Z(ws,ws.current)}function Sh(){Zr=Wc.current,X(ws),X(Wc)}var Aa=0,Pe=null,at=null,At=null,Kc=!1,Ss=!1,jo=!1,Zc=0,qi=0,Es=null,c_=0;function wt(){throw Error(o(321))}function Eh(n,a){if(a===null)return!1;for(var s=0;s<a.length&&s<n.length;s++)if(!bn(n[s],a[s]))return!1;return!0}function Nh(n,a,s,c,p,y){return Aa=y,Pe=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,D.H=n===null||n.memoizedState===null?ix:lx,jo=!1,y=s(c,p),jo=!1,Ss&&(y=jy(a,s,c,p)),Cy(n),y}function Cy(n){D.H=ru;var a=at!==null&&at.next!==null;if(Aa=0,At=at=Pe=null,Kc=!1,qi=0,Es=null,a)throw Error(o(300));n===null||Ut||(n=n.dependencies,n!==null&&qc(n)&&(Ut=!0))}function jy(n,a,s,c){Pe=n;var p=0;do{if(Ss&&(Es=null),qi=0,Ss=!1,25<=p)throw Error(o(301));if(p+=1,At=at=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}D.H=g_,y=a(s,c)}while(Ss);return y}function u_(){var n=D.H,a=n.useState()[0];return a=typeof a.then=="function"?Yi(a):a,n=n.useState()[0],(at!==null?at.memoizedState:null)!==n&&(Pe.flags|=1024),a}function Ch(){var n=Zc!==0;return Zc=0,n}function jh(n,a,s){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~s}function _h(n){if(Kc){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Kc=!1}Aa=0,At=at=Pe=null,Ss=!1,qi=Zc=0,Es=null}function cn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?Pe.memoizedState=At=n:At=At.next=n,At}function Tt(){if(at===null){var n=Pe.alternate;n=n!==null?n.memoizedState:null}else n=at.next;var a=At===null?Pe.memoizedState:At.next;if(a!==null)At=a,at=n;else{if(n===null)throw Pe.alternate===null?Error(o(467)):Error(o(310));at=n,n={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},At===null?Pe.memoizedState=At=n:At=At.next=n}return At}function Ah(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yi(n){var a=qi;return qi+=1,Es===null&&(Es=[]),n=xy(Es,n,a),a=Pe,(At===null?a.memoizedState:At.next)===null&&(a=a.alternate,D.H=a===null||a.memoizedState===null?ix:lx),n}function Qc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Yi(n);if(n.$$typeof===A)return Zt(n)}throw Error(o(438,String(n)))}function Th(n){var a=null,s=Pe.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var c=Pe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(p){return p.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=Ah(),Pe.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(n),c=0;c<n;c++)s[c]=z;return a.index++,s}function Yr(n,a){return typeof a=="function"?a(n):a}function Jc(n){var a=Tt();return Rh(a,at,n)}function Rh(n,a,s){var c=n.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=s;var p=n.baseQueue,y=c.pending;if(y!==null){if(p!==null){var _=p.next;p.next=y.next,y.next=_}a.baseQueue=p=y,c.pending=null}if(y=n.baseState,p===null)n.memoizedState=y;else{a=p.next;var R=_=null,$=null,J=a,ie=!1;do{var ce=J.lane&-536870913;if(ce!==J.lane?(Fe&ce)===ce:(Aa&ce)===ce){var ee=J.revertLane;if(ee===0)$!==null&&($=$.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ce===xs&&(ie=!0);else if((Aa&ee)===ee){J=J.next,ee===xs&&(ie=!0);continue}else ce={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},$===null?(R=$=ce,_=y):$=$.next=ce,Pe.lanes|=ee,za|=ee;ce=J.action,jo&&s(y,ce),y=J.hasEagerState?J.eagerState:s(y,ce)}else ee={lane:ce,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},$===null?(R=$=ee,_=y):$=$.next=ee,Pe.lanes|=ce,za|=ce;J=J.next}while(J!==null&&J!==a);if($===null?_=y:$.next=R,!bn(y,n.memoizedState)&&(Ut=!0,ie&&(s=bs,s!==null)))throw s;n.memoizedState=y,n.baseState=_,n.baseQueue=$,c.lastRenderedState=y}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function Mh(n){var a=Tt(),s=a.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=n;var c=s.dispatch,p=s.pending,y=a.memoizedState;if(p!==null){s.pending=null;var _=p=p.next;do y=n(y,_.action),_=_.next;while(_!==p);bn(y,a.memoizedState)||(Ut=!0),a.memoizedState=y,a.baseQueue===null&&(a.baseState=y),s.lastRenderedState=y}return[y,c]}function _y(n,a,s){var c=Pe,p=Tt(),y=et;if(y){if(s===void 0)throw Error(o(407));s=s()}else s=a();var _=!bn((at||p).memoizedState,s);_&&(p.memoizedState=s,Ut=!0),p=p.queue;var R=Ry.bind(null,c,p,n);if(Gi(2048,8,R,[n]),p.getSnapshot!==a||_||At!==null&&At.memoizedState.tag&1){if(c.flags|=2048,Ns(9,eu(),Ty.bind(null,c,p,s,a),null),lt===null)throw Error(o(349));y||(Aa&124)!==0||Ay(c,a,s)}return s}function Ay(n,a,s){n.flags|=16384,n={getSnapshot:a,value:s},a=Pe.updateQueue,a===null?(a=Ah(),Pe.updateQueue=a,a.stores=[n]):(s=a.stores,s===null?a.stores=[n]:s.push(n))}function Ty(n,a,s,c){a.value=s,a.getSnapshot=c,My(a)&&Dy(n)}function Ry(n,a,s){return s(function(){My(a)&&Dy(n)})}function My(n){var a=n.getSnapshot;n=n.value;try{var s=a();return!bn(n,s)}catch{return!0}}function Dy(n){var a=ps(n,2);a!==null&&jn(a,n,2)}function Dh(n){var a=cn();if(typeof n=="function"){var s=n;if(n=s(),jo){tn(!0);try{s()}finally{tn(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:n},a}function Oy(n,a,s,c){return n.baseState=s,Rh(n,at,typeof c=="function"?c:Yr)}function d_(n,a,s,c,p){if(nu(n))throw Error(o(485));if(n=a.action,n!==null){var y={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){y.listeners.push(_)}};D.T!==null?s(!0):y.isTransition=!1,c(y),s=a.pending,s===null?(y.next=a.pending=y,ky(a,y)):(y.next=s.next,a.pending=s.next=y)}}function ky(n,a){var s=a.action,c=a.payload,p=n.state;if(a.isTransition){var y=D.T,_={};D.T=_;try{var R=s(p,c),$=D.S;$!==null&&$(_,R),zy(n,a,R)}catch(J){Oh(n,a,J)}finally{D.T=y}}else try{y=s(p,c),zy(n,a,y)}catch(J){Oh(n,a,J)}}function zy(n,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Ly(n,a,c)},function(c){return Oh(n,a,c)}):Ly(n,a,s)}function Ly(n,a,s){a.status="fulfilled",a.value=s,Py(a),n.state=s,a=n.pending,a!==null&&(s=a.next,s===a?n.pending=null:(s=s.next,a.next=s,ky(n,s)))}function Oh(n,a,s){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=s,Py(a),a=a.next;while(a!==c)}n.action=null}function Py(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function Uy(n,a){return a}function By(n,a){if(et){var s=lt.formState;if(s!==null){e:{var c=Pe;if(et){if(gt){t:{for(var p=gt,y=vr;p.nodeType!==8;){if(!y){p=null;break t}if(p=Qn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){gt=Qn(p.nextSibling),c=p.data==="F!";break e}}So(c)}c=!1}c&&(a=s[0])}}return s=cn(),s.memoizedState=s.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uy,lastRenderedState:a},s.queue=c,s=ax.bind(null,Pe,c),c.dispatch=s,c=Dh(!1),y=Uh.bind(null,Pe,!1,c.queue),c=cn(),p={state:a,dispatch:null,action:n,pending:null},c.queue=p,s=d_.bind(null,Pe,p,y,s),p.dispatch=s,c.memoizedState=n,[a,s,!1]}function Hy(n){var a=Tt();return $y(a,at,n)}function $y(n,a,s){if(a=Rh(n,a,Uy)[0],n=Jc(Yr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=Yi(a)}catch(_){throw _===Bi?Fc:_}else c=a;a=Tt();var p=a.queue,y=p.dispatch;return s!==a.memoizedState&&(Pe.flags|=2048,Ns(9,eu(),f_.bind(null,p,s),null)),[c,y,n]}function f_(n,a){n.action=a}function Iy(n){var a=Tt(),s=at;if(s!==null)return $y(a,s,n);Tt(),a=a.memoizedState,s=Tt();var c=s.queue.dispatch;return s.memoizedState=n,[a,c,!1]}function Ns(n,a,s,c){return n={tag:n,create:s,deps:c,inst:a,next:null},a=Pe.updateQueue,a===null&&(a=Ah(),Pe.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=n.next=n:(c=s.next,s.next=n,n.next=c,a.lastEffect=n),n}function eu(){return{destroy:void 0,resource:void 0}}function Vy(){return Tt().memoizedState}function tu(n,a,s,c){var p=cn();c=c===void 0?null:c,Pe.flags|=n,p.memoizedState=Ns(1|a,eu(),s,c)}function Gi(n,a,s,c){var p=Tt();c=c===void 0?null:c;var y=p.memoizedState.inst;at!==null&&c!==null&&Eh(c,at.memoizedState.deps)?p.memoizedState=Ns(a,y,s,c):(Pe.flags|=n,p.memoizedState=Ns(1|a,y,s,c))}function qy(n,a){tu(8390656,8,n,a)}function Yy(n,a){Gi(2048,8,n,a)}function Gy(n,a){return Gi(4,2,n,a)}function Fy(n,a){return Gi(4,4,n,a)}function Xy(n,a){if(typeof a=="function"){n=n();var s=a(n);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function Wy(n,a,s){s=s!=null?s.concat([n]):null,Gi(4,4,Xy.bind(null,a,n),s)}function kh(){}function Ky(n,a){var s=Tt();a=a===void 0?null:a;var c=s.memoizedState;return a!==null&&Eh(a,c[1])?c[0]:(s.memoizedState=[n,a],n)}function Zy(n,a){var s=Tt();a=a===void 0?null:a;var c=s.memoizedState;if(a!==null&&Eh(a,c[1]))return c[0];if(c=n(),jo){tn(!0);try{n()}finally{tn(!1)}}return s.memoizedState=[c,a],c}function zh(n,a,s){return s===void 0||(Aa&1073741824)!==0?n.memoizedState=a:(n.memoizedState=s,n=e0(),Pe.lanes|=n,za|=n,s)}function Qy(n,a,s,c){return bn(s,a)?s:ws.current!==null?(n=zh(n,s,c),bn(n,a)||(Ut=!0),n):(Aa&42)===0?(Ut=!0,n.memoizedState=s):(n=e0(),Pe.lanes|=n,za|=n,a)}function Jy(n,a,s,c,p){var y=q.p;q.p=y!==0&&8>y?y:8;var _=D.T,R={};D.T=R,Uh(n,!1,a,s);try{var $=p(),J=D.S;if(J!==null&&J(R,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ie=l_($,c);Fi(n,a,ie,Cn(n))}else Fi(n,a,c,Cn(n))}catch(ce){Fi(n,a,{then:function(){},status:"rejected",reason:ce},Cn())}finally{q.p=y,D.T=_}}function h_(){}function Lh(n,a,s,c){if(n.tag!==5)throw Error(o(476));var p=ex(n).queue;Jy(n,p,a,B,s===null?h_:function(){return tx(n),s(c)})}function ex(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:B},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:s},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function tx(n){var a=ex(n).next.queue;Fi(n,a,{},Cn())}function Ph(){return Zt(dl)}function nx(){return Tt().memoizedState}function rx(){return Tt().memoizedState}function m_(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var s=Cn();n=ja(s);var c=_a(a,n,s);c!==null&&(jn(c,a,s),$i(c,a,s)),a={cache:hh()},n.payload=a;return}a=a.return}}function p_(n,a,s){var c=Cn();s={lane:c,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null},nu(n)?ox(a,s):(s=rh(n,a,s,c),s!==null&&(jn(s,n,c),sx(s,a,c)))}function ax(n,a,s){var c=Cn();Fi(n,a,s,c)}function Fi(n,a,s,c){var p={lane:c,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};if(nu(n))ox(a,p);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=a.lastRenderedReducer,y!==null))try{var _=a.lastRenderedState,R=y(_,s);if(p.hasEagerState=!0,p.eagerState=R,bn(R,_))return Bc(n,a,p,0),lt===null&&Uc(),!1}catch{}finally{}if(s=rh(n,a,p,c),s!==null)return jn(s,n,c),sx(s,a,c),!0}return!1}function Uh(n,a,s,c){if(c={lane:2,revertLane:gm(),action:c,hasEagerState:!1,eagerState:null,next:null},nu(n)){if(a)throw Error(o(479))}else a=rh(n,s,c,2),a!==null&&jn(a,n,2)}function nu(n){var a=n.alternate;return n===Pe||a!==null&&a===Pe}function ox(n,a){Ss=Kc=!0;var s=n.pending;s===null?a.next=a:(a.next=s.next,s.next=a),n.pending=a}function sx(n,a,s){if((s&4194048)!==0){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,bc(n,s)}}var ru={readContext:Zt,use:Qc,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt},ix={readContext:Zt,use:Qc,useCallback:function(n,a){return cn().memoizedState=[n,a===void 0?null:a],n},useContext:Zt,useEffect:qy,useImperativeHandle:function(n,a,s){s=s!=null?s.concat([n]):null,tu(4194308,4,Xy.bind(null,a,n),s)},useLayoutEffect:function(n,a){return tu(4194308,4,n,a)},useInsertionEffect:function(n,a){tu(4,2,n,a)},useMemo:function(n,a){var s=cn();a=a===void 0?null:a;var c=n();if(jo){tn(!0);try{n()}finally{tn(!1)}}return s.memoizedState=[c,a],c},useReducer:function(n,a,s){var c=cn();if(s!==void 0){var p=s(a);if(jo){tn(!0);try{s(a)}finally{tn(!1)}}}else p=a;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=p_.bind(null,Pe,n),[c.memoizedState,n]},useRef:function(n){var a=cn();return n={current:n},a.memoizedState=n},useState:function(n){n=Dh(n);var a=n.queue,s=ax.bind(null,Pe,a);return a.dispatch=s,[n.memoizedState,s]},useDebugValue:kh,useDeferredValue:function(n,a){var s=cn();return zh(s,n,a)},useTransition:function(){var n=Dh(!1);return n=Jy.bind(null,Pe,n.queue,!0,!1),cn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,s){var c=Pe,p=cn();if(et){if(s===void 0)throw Error(o(407));s=s()}else{if(s=a(),lt===null)throw Error(o(349));(Fe&124)!==0||Ay(c,a,s)}p.memoizedState=s;var y={value:s,getSnapshot:a};return p.queue=y,qy(Ry.bind(null,c,y,n),[n]),c.flags|=2048,Ns(9,eu(),Ty.bind(null,c,y,s,a),null),s},useId:function(){var n=cn(),a=lt.identifierPrefix;if(et){var s=Ir,c=$r;s=(c&~(1<<32-jt(c)-1)).toString(32)+s,a="«"+a+"R"+s,s=Zc++,0<s&&(a+="H"+s.toString(32)),a+="»"}else s=c_++,a="«"+a+"r"+s.toString(32)+"»";return n.memoizedState=a},useHostTransitionStatus:Ph,useFormState:By,useActionState:By,useOptimistic:function(n){var a=cn();a.memoizedState=a.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=Uh.bind(null,Pe,!0,s),s.dispatch=a,[n,a]},useMemoCache:Th,useCacheRefresh:function(){return cn().memoizedState=m_.bind(null,Pe)}},lx={readContext:Zt,use:Qc,useCallback:Ky,useContext:Zt,useEffect:Yy,useImperativeHandle:Wy,useInsertionEffect:Gy,useLayoutEffect:Fy,useMemo:Zy,useReducer:Jc,useRef:Vy,useState:function(){return Jc(Yr)},useDebugValue:kh,useDeferredValue:function(n,a){var s=Tt();return Qy(s,at.memoizedState,n,a)},useTransition:function(){var n=Jc(Yr)[0],a=Tt().memoizedState;return[typeof n=="boolean"?n:Yi(n),a]},useSyncExternalStore:_y,useId:nx,useHostTransitionStatus:Ph,useFormState:Hy,useActionState:Hy,useOptimistic:function(n,a){var s=Tt();return Oy(s,at,n,a)},useMemoCache:Th,useCacheRefresh:rx},g_={readContext:Zt,use:Qc,useCallback:Ky,useContext:Zt,useEffect:Yy,useImperativeHandle:Wy,useInsertionEffect:Gy,useLayoutEffect:Fy,useMemo:Zy,useReducer:Mh,useRef:Vy,useState:function(){return Mh(Yr)},useDebugValue:kh,useDeferredValue:function(n,a){var s=Tt();return at===null?zh(s,n,a):Qy(s,at.memoizedState,n,a)},useTransition:function(){var n=Mh(Yr)[0],a=Tt().memoizedState;return[typeof n=="boolean"?n:Yi(n),a]},useSyncExternalStore:_y,useId:nx,useHostTransitionStatus:Ph,useFormState:Iy,useActionState:Iy,useOptimistic:function(n,a){var s=Tt();return at!==null?Oy(s,at,n,a):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:Th,useCacheRefresh:rx},Cs=null,Xi=0;function au(n){var a=Xi;return Xi+=1,Cs===null&&(Cs=[]),xy(Cs,n,a)}function Wi(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function ou(n,a){throw a.$$typeof===v?Error(o(525)):(n=Object.prototype.toString.call(a),Error(o(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function cx(n){var a=n._init;return a(n._payload)}function ux(n){function a(W,G){if(n){var Q=W.deletions;Q===null?(W.deletions=[G],W.flags|=16):Q.push(G)}}function s(W,G){if(!n)return null;for(;G!==null;)a(W,G),G=G.sibling;return null}function c(W){for(var G=new Map;W!==null;)W.key!==null?G.set(W.key,W):G.set(W.index,W),W=W.sibling;return G}function p(W,G){return W=Hr(W,G),W.index=0,W.sibling=null,W}function y(W,G,Q){return W.index=Q,n?(Q=W.alternate,Q!==null?(Q=Q.index,Q<G?(W.flags|=67108866,G):Q):(W.flags|=67108866,G)):(W.flags|=1048576,G)}function _(W){return n&&W.alternate===null&&(W.flags|=67108866),W}function R(W,G,Q,le){return G===null||G.tag!==6?(G=oh(Q,W.mode,le),G.return=W,G):(G=p(G,Q),G.return=W,G)}function $(W,G,Q,le){var ye=Q.type;return ye===E?ie(W,G,Q.props.children,le,Q.key):G!==null&&(G.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===V&&cx(ye)===G.type)?(G=p(G,Q.props),Wi(G,Q),G.return=W,G):(G=$c(Q.type,Q.key,Q.props,null,W.mode,le),Wi(G,Q),G.return=W,G)}function J(W,G,Q,le){return G===null||G.tag!==4||G.stateNode.containerInfo!==Q.containerInfo||G.stateNode.implementation!==Q.implementation?(G=sh(Q,W.mode,le),G.return=W,G):(G=p(G,Q.children||[]),G.return=W,G)}function ie(W,G,Q,le,ye){return G===null||G.tag!==7?(G=yo(Q,W.mode,le,ye),G.return=W,G):(G=p(G,Q),G.return=W,G)}function ce(W,G,Q){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=oh(""+G,W.mode,Q),G.return=W,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return Q=$c(G.type,G.key,G.props,null,W.mode,Q),Wi(Q,G),Q.return=W,Q;case w:return G=sh(G,W.mode,Q),G.return=W,G;case V:var le=G._init;return G=le(G._payload),ce(W,G,Q)}if(Y(G)||K(G))return G=yo(G,W.mode,Q,null),G.return=W,G;if(typeof G.then=="function")return ce(W,au(G),Q);if(G.$$typeof===A)return ce(W,Yc(W,G),Q);ou(W,G)}return null}function ee(W,G,Q,le){var ye=G!==null?G.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return ye!==null?null:R(W,G,""+Q,le);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return Q.key===ye?$(W,G,Q,le):null;case w:return Q.key===ye?J(W,G,Q,le):null;case V:return ye=Q._init,Q=ye(Q._payload),ee(W,G,Q,le)}if(Y(Q)||K(Q))return ye!==null?null:ie(W,G,Q,le,null);if(typeof Q.then=="function")return ee(W,G,au(Q),le);if(Q.$$typeof===A)return ee(W,G,Yc(W,Q),le);ou(W,Q)}return null}function ne(W,G,Q,le,ye){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return W=W.get(Q)||null,R(G,W,""+le,ye);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return W=W.get(le.key===null?Q:le.key)||null,$(G,W,le,ye);case w:return W=W.get(le.key===null?Q:le.key)||null,J(G,W,le,ye);case V:var He=le._init;return le=He(le._payload),ne(W,G,Q,le,ye)}if(Y(le)||K(le))return W=W.get(Q)||null,ie(G,W,le,ye,null);if(typeof le.then=="function")return ne(W,G,Q,au(le),ye);if(le.$$typeof===A)return ne(W,G,Q,Yc(G,le),ye);ou(G,le)}return null}function Re(W,G,Q,le){for(var ye=null,He=null,Ne=G,_e=G=0,Ht=null;Ne!==null&&_e<Q.length;_e++){Ne.index>_e?(Ht=Ne,Ne=null):Ht=Ne.sibling;var Ze=ee(W,Ne,Q[_e],le);if(Ze===null){Ne===null&&(Ne=Ht);break}n&&Ne&&Ze.alternate===null&&a(W,Ne),G=y(Ze,G,_e),He===null?ye=Ze:He.sibling=Ze,He=Ze,Ne=Ht}if(_e===Q.length)return s(W,Ne),et&&bo(W,_e),ye;if(Ne===null){for(;_e<Q.length;_e++)Ne=ce(W,Q[_e],le),Ne!==null&&(G=y(Ne,G,_e),He===null?ye=Ne:He.sibling=Ne,He=Ne);return et&&bo(W,_e),ye}for(Ne=c(Ne);_e<Q.length;_e++)Ht=ne(Ne,W,_e,Q[_e],le),Ht!==null&&(n&&Ht.alternate!==null&&Ne.delete(Ht.key===null?_e:Ht.key),G=y(Ht,G,_e),He===null?ye=Ht:He.sibling=Ht,He=Ht);return n&&Ne.forEach(function(qa){return a(W,qa)}),et&&bo(W,_e),ye}function je(W,G,Q,le){if(Q==null)throw Error(o(151));for(var ye=null,He=null,Ne=G,_e=G=0,Ht=null,Ze=Q.next();Ne!==null&&!Ze.done;_e++,Ze=Q.next()){Ne.index>_e?(Ht=Ne,Ne=null):Ht=Ne.sibling;var qa=ee(W,Ne,Ze.value,le);if(qa===null){Ne===null&&(Ne=Ht);break}n&&Ne&&qa.alternate===null&&a(W,Ne),G=y(qa,G,_e),He===null?ye=qa:He.sibling=qa,He=qa,Ne=Ht}if(Ze.done)return s(W,Ne),et&&bo(W,_e),ye;if(Ne===null){for(;!Ze.done;_e++,Ze=Q.next())Ze=ce(W,Ze.value,le),Ze!==null&&(G=y(Ze,G,_e),He===null?ye=Ze:He.sibling=Ze,He=Ze);return et&&bo(W,_e),ye}for(Ne=c(Ne);!Ze.done;_e++,Ze=Q.next())Ze=ne(Ne,W,_e,Ze.value,le),Ze!==null&&(n&&Ze.alternate!==null&&Ne.delete(Ze.key===null?_e:Ze.key),G=y(Ze,G,_e),He===null?ye=Ze:He.sibling=Ze,He=Ze);return n&&Ne.forEach(function(vA){return a(W,vA)}),et&&bo(W,_e),ye}function st(W,G,Q,le){if(typeof Q=="object"&&Q!==null&&Q.type===E&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:e:{for(var ye=Q.key;G!==null;){if(G.key===ye){if(ye=Q.type,ye===E){if(G.tag===7){s(W,G.sibling),le=p(G,Q.props.children),le.return=W,W=le;break e}}else if(G.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===V&&cx(ye)===G.type){s(W,G.sibling),le=p(G,Q.props),Wi(le,Q),le.return=W,W=le;break e}s(W,G);break}else a(W,G);G=G.sibling}Q.type===E?(le=yo(Q.props.children,W.mode,le,Q.key),le.return=W,W=le):(le=$c(Q.type,Q.key,Q.props,null,W.mode,le),Wi(le,Q),le.return=W,W=le)}return _(W);case w:e:{for(ye=Q.key;G!==null;){if(G.key===ye)if(G.tag===4&&G.stateNode.containerInfo===Q.containerInfo&&G.stateNode.implementation===Q.implementation){s(W,G.sibling),le=p(G,Q.children||[]),le.return=W,W=le;break e}else{s(W,G);break}else a(W,G);G=G.sibling}le=sh(Q,W.mode,le),le.return=W,W=le}return _(W);case V:return ye=Q._init,Q=ye(Q._payload),st(W,G,Q,le)}if(Y(Q))return Re(W,G,Q,le);if(K(Q)){if(ye=K(Q),typeof ye!="function")throw Error(o(150));return Q=ye.call(Q),je(W,G,Q,le)}if(typeof Q.then=="function")return st(W,G,au(Q),le);if(Q.$$typeof===A)return st(W,G,Yc(W,Q),le);ou(W,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,G!==null&&G.tag===6?(s(W,G.sibling),le=p(G,Q),le.return=W,W=le):(s(W,G),le=oh(Q,W.mode,le),le.return=W,W=le),_(W)):s(W,G)}return function(W,G,Q,le){try{Xi=0;var ye=st(W,G,Q,le);return Cs=null,ye}catch(Ne){if(Ne===Bi||Ne===Fc)throw Ne;var He=wn(29,Ne,null,W.mode);return He.lanes=le,He.return=W,He}finally{}}}var js=ux(!0),dx=ux(!1),Bn=I(null),yr=null;function Ta(n){var a=n.alternate;Z(Ot,Ot.current&1),Z(Bn,n),yr===null&&(a===null||ws.current!==null||a.memoizedState!==null)&&(yr=n)}function fx(n){if(n.tag===22){if(Z(Ot,Ot.current),Z(Bn,n),yr===null){var a=n.alternate;a!==null&&a.memoizedState!==null&&(yr=n)}}else Ra()}function Ra(){Z(Ot,Ot.current),Z(Bn,Bn.current)}function Gr(n){X(Bn),yr===n&&(yr=null),X(Ot)}var Ot=I(0);function su(n){for(var a=n;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||Am(s)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function Bh(n,a,s,c){a=n.memoizedState,s=s(c,a),s=s==null?a:g({},a,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Hh={enqueueSetState:function(n,a,s){n=n._reactInternals;var c=Cn(),p=ja(c);p.payload=a,s!=null&&(p.callback=s),a=_a(n,p,c),a!==null&&(jn(a,n,c),$i(a,n,c))},enqueueReplaceState:function(n,a,s){n=n._reactInternals;var c=Cn(),p=ja(c);p.tag=1,p.payload=a,s!=null&&(p.callback=s),a=_a(n,p,c),a!==null&&(jn(a,n,c),$i(a,n,c))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var s=Cn(),c=ja(s);c.tag=2,a!=null&&(c.callback=a),a=_a(n,c,s),a!==null&&(jn(a,n,s),$i(a,n,s))}};function hx(n,a,s,c,p,y,_){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,y,_):a.prototype&&a.prototype.isPureReactComponent?!Mi(s,c)||!Mi(p,y):!0}function mx(n,a,s,c){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,c),a.state!==n&&Hh.enqueueReplaceState(a,a.state,null)}function _o(n,a){var s=a;if("ref"in a){s={};for(var c in a)c!=="ref"&&(s[c]=a[c])}if(n=n.defaultProps){s===a&&(s=g({},s));for(var p in n)s[p]===void 0&&(s[p]=n[p])}return s}var iu=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=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(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function px(n){iu(n)}function gx(n){console.error(n)}function vx(n){iu(n)}function lu(n,a){try{var s=n.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function yx(n,a,s){try{var c=n.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function $h(n,a,s){return s=ja(s),s.tag=3,s.payload={element:null},s.callback=function(){lu(n,a)},s}function xx(n){return n=ja(n),n.tag=3,n}function bx(n,a,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;n.payload=function(){return p(y)},n.callback=function(){yx(a,s,c)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(n.callback=function(){yx(a,s,c),typeof p!="function"&&(La===null?La=new Set([this]):La.add(this));var R=c.stack;this.componentDidCatch(c.value,{componentStack:R!==null?R:""})})}function v_(n,a,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=s.alternate,a!==null&&Li(a,s,p,!0),s=Bn.current,s!==null){switch(s.tag){case 13:return yr===null?dm():s.alternate===null&&vt===0&&(vt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===gh?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([c]):a.add(c),hm(n,c,p)),!1;case 22:return s.flags|=65536,c===gh?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([c]):s.add(c)),hm(n,c,p)),!1}throw Error(o(435,s.tag))}return hm(n,c,p),dm(),!1}if(et)return a=Bn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=p,c!==ch&&(n=Error(o(422),{cause:c}),zi(zn(n,s)))):(c!==ch&&(a=Error(o(423),{cause:c}),zi(zn(a,s))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=zn(c,s),p=$h(n.stateNode,c,p),xh(n,p),vt!==4&&(vt=2)),!1;var y=Error(o(520),{cause:c});if(y=zn(y,s),nl===null?nl=[y]:nl.push(y),vt!==4&&(vt=2),a===null)return!0;c=zn(c,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,n=p&-p,s.lanes|=n,n=$h(s.stateNode,c,n),xh(s,n),!1;case 1:if(a=s.type,y=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(La===null||!La.has(y))))return s.flags|=65536,p&=-p,s.lanes|=p,p=xx(p),bx(p,n,s,c),xh(s,p),!1}s=s.return}while(s!==null);return!1}var wx=Error(o(461)),Ut=!1;function Yt(n,a,s,c){a.child=n===null?dx(a,null,s,c):js(a,n.child,s,c)}function Sx(n,a,s,c,p){s=s.render;var y=a.ref;if("ref"in c){var _={};for(var R in c)R!=="ref"&&(_[R]=c[R])}else _=c;return No(a),c=Nh(n,a,s,_,y,p),R=Ch(),n!==null&&!Ut?(jh(n,a,p),Fr(n,a,p)):(et&&R&&ih(a),a.flags|=1,Yt(n,a,c,p),a.child)}function Ex(n,a,s,c,p){if(n===null){var y=s.type;return typeof y=="function"&&!ah(y)&&y.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=y,Nx(n,a,y,c,p)):(n=$c(s.type,null,c,a,a.mode,p),n.ref=a.ref,n.return=a,a.child=n)}if(y=n.child,!Wh(n,p)){var _=y.memoizedProps;if(s=s.compare,s=s!==null?s:Mi,s(_,c)&&n.ref===a.ref)return Fr(n,a,p)}return a.flags|=1,n=Hr(y,c),n.ref=a.ref,n.return=a,a.child=n}function Nx(n,a,s,c,p){if(n!==null){var y=n.memoizedProps;if(Mi(y,c)&&n.ref===a.ref)if(Ut=!1,a.pendingProps=c=y,Wh(n,p))(n.flags&131072)!==0&&(Ut=!0);else return a.lanes=n.lanes,Fr(n,a,p)}return Ih(n,a,s,c,p)}function Cx(n,a,s){var c=a.pendingProps,p=c.children,y=n!==null?n.memoizedState:null;if(c.mode==="hidden"){if((a.flags&128)!==0){if(c=y!==null?y.baseLanes|s:s,n!==null){for(p=a.child=n.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;a.childLanes=y&~c}else a.childLanes=0,a.child=null;return jx(n,a,c,s)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gc(a,y!==null?y.cachePool:null),y!==null?Ny(a,y):wh(),fx(a);else return a.lanes=a.childLanes=536870912,jx(n,a,y!==null?y.baseLanes|s:s,s)}else y!==null?(Gc(a,y.cachePool),Ny(a,y),Ra(),a.memoizedState=null):(n!==null&&Gc(a,null),wh(),Ra());return Yt(n,a,p,s),a.child}function jx(n,a,s,c){var p=ph();return p=p===null?null:{parent:Dt._currentValue,pool:p},a.memoizedState={baseLanes:s,cachePool:p},n!==null&&Gc(a,null),wh(),fx(a),n!==null&&Li(n,a,c,!0),null}function cu(n,a){var s=a.ref;if(s===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(n===null||n.ref!==s)&&(a.flags|=4194816)}}function Ih(n,a,s,c,p){return No(a),s=Nh(n,a,s,c,void 0,p),c=Ch(),n!==null&&!Ut?(jh(n,a,p),Fr(n,a,p)):(et&&c&&ih(a),a.flags|=1,Yt(n,a,s,p),a.child)}function _x(n,a,s,c,p,y){return No(a),a.updateQueue=null,s=jy(a,c,s,p),Cy(n),c=Ch(),n!==null&&!Ut?(jh(n,a,y),Fr(n,a,y)):(et&&c&&ih(a),a.flags|=1,Yt(n,a,s,y),a.child)}function Ax(n,a,s,c,p){if(No(a),a.stateNode===null){var y=gs,_=s.contextType;typeof _=="object"&&_!==null&&(y=Zt(_)),y=new s(c,y),a.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Hh,a.stateNode=y,y._reactInternals=a,y=a.stateNode,y.props=c,y.state=a.memoizedState,y.refs={},vh(a),_=s.contextType,y.context=typeof _=="object"&&_!==null?Zt(_):gs,y.state=a.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Bh(a,s,_,c),y.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(_=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),_!==y.state&&Hh.enqueueReplaceState(y,y.state,null),Vi(a,c,y,p),Ii(),y.state=a.memoizedState),typeof y.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(n===null){y=a.stateNode;var R=a.memoizedProps,$=_o(s,R);y.props=$;var J=y.context,ie=s.contextType;_=gs,typeof ie=="object"&&ie!==null&&(_=Zt(ie));var ce=s.getDerivedStateFromProps;ie=typeof ce=="function"||typeof y.getSnapshotBeforeUpdate=="function",R=a.pendingProps!==R,ie||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R||J!==_)&&mx(a,y,c,_),Ca=!1;var ee=a.memoizedState;y.state=ee,Vi(a,c,y,p),Ii(),J=a.memoizedState,R||ee!==J||Ca?(typeof ce=="function"&&(Bh(a,s,ce,c),J=a.memoizedState),($=Ca||hx(a,s,$,c,ee,J,_))?(ie||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(a.flags|=4194308)):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=J),y.props=c,y.state=J,y.context=_,c=$):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{y=a.stateNode,yh(n,a),_=a.memoizedProps,ie=_o(s,_),y.props=ie,ce=a.pendingProps,ee=y.context,J=s.contextType,$=gs,typeof J=="object"&&J!==null&&($=Zt(J)),R=s.getDerivedStateFromProps,(J=typeof R=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(_!==ce||ee!==$)&&mx(a,y,c,$),Ca=!1,ee=a.memoizedState,y.state=ee,Vi(a,c,y,p),Ii();var ne=a.memoizedState;_!==ce||ee!==ne||Ca||n!==null&&n.dependencies!==null&&qc(n.dependencies)?(typeof R=="function"&&(Bh(a,s,R,c),ne=a.memoizedState),(ie=Ca||hx(a,s,ie,c,ee,ne,$)||n!==null&&n.dependencies!==null&&qc(n.dependencies))?(J||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,ne,$),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,ne,$)),typeof y.componentDidUpdate=="function"&&(a.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof y.componentDidUpdate!="function"||_===n.memoizedProps&&ee===n.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||_===n.memoizedProps&&ee===n.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=ne),y.props=c,y.state=ne,y.context=$,c=ie):(typeof y.componentDidUpdate!="function"||_===n.memoizedProps&&ee===n.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||_===n.memoizedProps&&ee===n.memoizedState||(a.flags|=1024),c=!1)}return y=c,cu(n,a),c=(a.flags&128)!==0,y||c?(y=a.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:y.render(),a.flags|=1,n!==null&&c?(a.child=js(a,n.child,null,p),a.child=js(a,null,s,p)):Yt(n,a,s,p),a.memoizedState=y.state,n=a.child):n=Fr(n,a,p),n}function Tx(n,a,s,c){return ki(),a.flags|=256,Yt(n,a,s,c),a.child}var Vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qh(n){return{baseLanes:n,cachePool:gy()}}function Yh(n,a,s){return n=n!==null?n.childLanes&~s:0,a&&(n|=Hn),n}function Rx(n,a,s){var c=a.pendingProps,p=!1,y=(a.flags&128)!==0,_;if((_=y)||(_=n!==null&&n.memoizedState===null?!1:(Ot.current&2)!==0),_&&(p=!0,a.flags&=-129),_=(a.flags&32)!==0,a.flags&=-33,n===null){if(et){if(p?Ta(a):Ra(),et){var R=gt,$;if($=R){e:{for($=R,R=vr;$.nodeType!==8;){if(!R){R=null;break e}if($=Qn($.nextSibling),$===null){R=null;break e}}R=$}R!==null?(a.memoizedState={dehydrated:R,treeContext:xo!==null?{id:$r,overflow:Ir}:null,retryLane:536870912,hydrationErrors:null},$=wn(18,null,null,0),$.stateNode=R,$.return=a,a.child=$,rn=a,gt=null,$=!0):$=!1}$||So(a)}if(R=a.memoizedState,R!==null&&(R=R.dehydrated,R!==null))return Am(R)?a.lanes=32:a.lanes=536870912,null;Gr(a)}return R=c.children,c=c.fallback,p?(Ra(),p=a.mode,R=uu({mode:"hidden",children:R},p),c=yo(c,p,s,null),R.return=a,c.return=a,R.sibling=c,a.child=R,p=a.child,p.memoizedState=qh(s),p.childLanes=Yh(n,_,s),a.memoizedState=Vh,c):(Ta(a),Gh(a,R))}if($=n.memoizedState,$!==null&&(R=$.dehydrated,R!==null)){if(y)a.flags&256?(Ta(a),a.flags&=-257,a=Fh(n,a,s)):a.memoizedState!==null?(Ra(),a.child=n.child,a.flags|=128,a=null):(Ra(),p=c.fallback,R=a.mode,c=uu({mode:"visible",children:c.children},R),p=yo(p,R,s,null),p.flags|=2,c.return=a,p.return=a,c.sibling=p,a.child=c,js(a,n.child,null,s),c=a.child,c.memoizedState=qh(s),c.childLanes=Yh(n,_,s),a.memoizedState=Vh,a=p);else if(Ta(a),Am(R)){if(_=R.nextSibling&&R.nextSibling.dataset,_)var J=_.dgst;_=J,c=Error(o(419)),c.stack="",c.digest=_,zi({value:c,source:null,stack:null}),a=Fh(n,a,s)}else if(Ut||Li(n,a,s,!1),_=(s&n.childLanes)!==0,Ut||_){if(_=lt,_!==null&&(c=s&-s,c=(c&42)!==0?1:xi(c),c=(c&(_.suspendedLanes|s))!==0?0:c,c!==0&&c!==$.retryLane))throw $.retryLane=c,ps(n,c),jn(_,n,c),wx;R.data==="$?"||dm(),a=Fh(n,a,s)}else R.data==="$?"?(a.flags|=192,a.child=n.child,a=null):(n=$.treeContext,gt=Qn(R.nextSibling),rn=a,et=!0,wo=null,vr=!1,n!==null&&(Pn[Un++]=$r,Pn[Un++]=Ir,Pn[Un++]=xo,$r=n.id,Ir=n.overflow,xo=a),a=Gh(a,c.children),a.flags|=4096);return a}return p?(Ra(),p=c.fallback,R=a.mode,$=n.child,J=$.sibling,c=Hr($,{mode:"hidden",children:c.children}),c.subtreeFlags=$.subtreeFlags&65011712,J!==null?p=Hr(J,p):(p=yo(p,R,s,null),p.flags|=2),p.return=a,c.return=a,c.sibling=p,a.child=c,c=p,p=a.child,R=n.child.memoizedState,R===null?R=qh(s):($=R.cachePool,$!==null?(J=Dt._currentValue,$=$.parent!==J?{parent:J,pool:J}:$):$=gy(),R={baseLanes:R.baseLanes|s,cachePool:$}),p.memoizedState=R,p.childLanes=Yh(n,_,s),a.memoizedState=Vh,c):(Ta(a),s=n.child,n=s.sibling,s=Hr(s,{mode:"visible",children:c.children}),s.return=a,s.sibling=null,n!==null&&(_=a.deletions,_===null?(a.deletions=[n],a.flags|=16):_.push(n)),a.child=s,a.memoizedState=null,s)}function Gh(n,a){return a=uu({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function uu(n,a){return n=wn(22,n,null,a),n.lanes=0,n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},n}function Fh(n,a,s){return js(a,n.child,null,s),n=Gh(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function Mx(n,a,s){n.lanes|=a;var c=n.alternate;c!==null&&(c.lanes|=a),dh(n.return,a,s)}function Xh(n,a,s,c,p){var y=n.memoizedState;y===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p}:(y.isBackwards=a,y.rendering=null,y.renderingStartTime=0,y.last=c,y.tail=s,y.tailMode=p)}function Dx(n,a,s){var c=a.pendingProps,p=c.revealOrder,y=c.tail;if(Yt(n,a,c.children,s),c=Ot.current,(c&2)!==0)c=c&1|2,a.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Mx(n,s,a);else if(n.tag===19)Mx(n,s,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}c&=1}switch(Z(Ot,c),p){case"forwards":for(s=a.child,p=null;s!==null;)n=s.alternate,n!==null&&su(n)===null&&(p=s),s=s.sibling;s=p,s===null?(p=a.child,a.child=null):(p=s.sibling,s.sibling=null),Xh(a,!1,p,s,y);break;case"backwards":for(s=null,p=a.child,a.child=null;p!==null;){if(n=p.alternate,n!==null&&su(n)===null){a.child=p;break}n=p.sibling,p.sibling=s,s=p,p=n}Xh(a,!0,s,null,y);break;case"together":Xh(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Fr(n,a,s){if(n!==null&&(a.dependencies=n.dependencies),za|=a.lanes,(s&a.childLanes)===0)if(n!==null){if(Li(n,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(o(153));if(a.child!==null){for(n=a.child,s=Hr(n,n.pendingProps),a.child=s,s.return=a;n.sibling!==null;)n=n.sibling,s=s.sibling=Hr(n,n.pendingProps),s.return=a;s.sibling=null}return a.child}function Wh(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&qc(n)))}function y_(n,a,s){switch(a.tag){case 3:me(a,a.stateNode.containerInfo),Na(a,Dt,n.memoizedState.cache),ki();break;case 27:case 5:ge(a);break;case 4:me(a,a.stateNode.containerInfo);break;case 10:Na(a,a.type,a.memoizedProps.value);break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?(Ta(a),a.flags|=128,null):(s&a.child.childLanes)!==0?Rx(n,a,s):(Ta(a),n=Fr(n,a,s),n!==null?n.sibling:null);Ta(a);break;case 19:var p=(n.flags&128)!==0;if(c=(s&a.childLanes)!==0,c||(Li(n,a,s,!1),c=(s&a.childLanes)!==0),p){if(c)return Dx(n,a,s);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Z(Ot,Ot.current),c)break;return null;case 22:case 23:return a.lanes=0,Cx(n,a,s);case 24:Na(a,Dt,n.memoizedState.cache)}return Fr(n,a,s)}function Ox(n,a,s){if(n!==null)if(n.memoizedProps!==a.pendingProps)Ut=!0;else{if(!Wh(n,s)&&(a.flags&128)===0)return Ut=!1,y_(n,a,s);Ut=(n.flags&131072)!==0}else Ut=!1,et&&(a.flags&1048576)!==0&&cy(a,Vc,a.index);switch(a.lanes=0,a.tag){case 16:e:{n=a.pendingProps;var c=a.elementType,p=c._init;if(c=p(c._payload),a.type=c,typeof c=="function")ah(c)?(n=_o(c,n),a.tag=1,a=Ax(null,a,c,n,s)):(a.tag=0,a=Ih(null,a,c,n,s));else{if(c!=null){if(p=c.$$typeof,p===M){a.tag=11,a=Sx(null,a,c,n,s);break e}else if(p===H){a.tag=14,a=Ex(null,a,c,n,s);break e}}throw a=k(c)||c,Error(o(306,a,""))}}return a;case 0:return Ih(n,a,a.type,a.pendingProps,s);case 1:return c=a.type,p=_o(c,a.pendingProps),Ax(n,a,c,p,s);case 3:e:{if(me(a,a.stateNode.containerInfo),n===null)throw Error(o(387));c=a.pendingProps;var y=a.memoizedState;p=y.element,yh(n,a),Vi(a,c,null,s);var _=a.memoizedState;if(c=_.cache,Na(a,Dt,c),c!==y.cache&&fh(a,[Dt],s,!0),Ii(),c=_.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:_.cache},a.updateQueue.baseState=y,a.memoizedState=y,a.flags&256){a=Tx(n,a,c,s);break e}else if(c!==p){p=zn(Error(o(424)),a),zi(p),a=Tx(n,a,c,s);break e}else{switch(n=a.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(gt=Qn(n.firstChild),rn=a,et=!0,wo=null,vr=!0,s=dx(a,null,c,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ki(),c===p){a=Fr(n,a,s);break e}Yt(n,a,c,s)}a=a.child}return a;case 26:return cu(n,a),n===null?(s=P0(a.type,null,a.pendingProps,null))?a.memoizedState=s:et||(s=a.type,n=a.pendingProps,c=Nu(ue.current).createElement(s),c[Pt]=a,c[Kt]=n,Ft(c,s,n),_t(c),a.stateNode=c):a.memoizedState=P0(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return ge(a),n===null&&et&&(c=a.stateNode=k0(a.type,a.pendingProps,ue.current),rn=a,vr=!0,p=gt,Ba(a.type)?(Tm=p,gt=Qn(c.firstChild)):gt=p),Yt(n,a,a.pendingProps.children,s),cu(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&et&&((p=c=gt)&&(c=G_(c,a.type,a.pendingProps,vr),c!==null?(a.stateNode=c,rn=a,gt=Qn(c.firstChild),vr=!1,p=!0):p=!1),p||So(a)),ge(a),p=a.type,y=a.pendingProps,_=n!==null?n.memoizedProps:null,c=y.children,Cm(p,y)?c=null:_!==null&&Cm(p,_)&&(a.flags|=32),a.memoizedState!==null&&(p=Nh(n,a,u_,null,null,s),dl._currentValue=p),cu(n,a),Yt(n,a,c,s),a.child;case 6:return n===null&&et&&((n=s=gt)&&(s=F_(s,a.pendingProps,vr),s!==null?(a.stateNode=s,rn=a,gt=null,n=!0):n=!1),n||So(a)),null;case 13:return Rx(n,a,s);case 4:return me(a,a.stateNode.containerInfo),c=a.pendingProps,n===null?a.child=js(a,null,c,s):Yt(n,a,c,s),a.child;case 11:return Sx(n,a,a.type,a.pendingProps,s);case 7:return Yt(n,a,a.pendingProps,s),a.child;case 8:return Yt(n,a,a.pendingProps.children,s),a.child;case 12:return Yt(n,a,a.pendingProps.children,s),a.child;case 10:return c=a.pendingProps,Na(a,a.type,c.value),Yt(n,a,c.children,s),a.child;case 9:return p=a.type._context,c=a.pendingProps.children,No(a),p=Zt(p),c=c(p),a.flags|=1,Yt(n,a,c,s),a.child;case 14:return Ex(n,a,a.type,a.pendingProps,s);case 15:return Nx(n,a,a.type,a.pendingProps,s);case 19:return Dx(n,a,s);case 31:return c=a.pendingProps,s=a.mode,c={mode:c.mode,children:c.children},n===null?(s=uu(c,s),s.ref=a.ref,a.child=s,s.return=a,a=s):(s=Hr(n.child,c),s.ref=a.ref,a.child=s,s.return=a,a=s),a;case 22:return Cx(n,a,s);case 24:return No(a),c=Zt(Dt),n===null?(p=ph(),p===null&&(p=lt,y=hh(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=s),p=y),a.memoizedState={parent:c,cache:p},vh(a),Na(a,Dt,p)):((n.lanes&s)!==0&&(yh(n,a),Vi(a,null,null,s),Ii()),p=n.memoizedState,y=a.memoizedState,p.parent!==c?(p={parent:c,cache:c},a.memoizedState=p,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=p),Na(a,Dt,c)):(c=y.cache,Na(a,Dt,c),c!==p.cache&&fh(a,[Dt],s,!0))),Yt(n,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(o(156,a.tag))}function Xr(n){n.flags|=4}function kx(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!I0(a)){if(a=Bn.current,a!==null&&((Fe&4194048)===Fe?yr!==null:(Fe&62914560)!==Fe&&(Fe&536870912)===0||a!==yr))throw Hi=gh,vy;n.flags|=8192}}function du(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?ga():536870912,n.lanes|=a,Rs|=a)}function Ki(n,a){if(!et)switch(n.tailMode){case"hidden":a=n.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function pt(n){var a=n.alternate!==null&&n.alternate.child===n.child,s=0,c=0;if(a)for(var p=n.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=s,a}function x_(n,a,s){var c=a.pendingProps;switch(lh(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(a),null;case 1:return pt(a),null;case 3:return s=a.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),qr(Dt),pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(Oi(a)?Xr(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,fy())),pt(a),null;case 26:return s=a.memoizedState,n===null?(Xr(a),s!==null?(pt(a),kx(a,s)):(pt(a),a.flags&=-16777217)):s?s!==n.memoizedState?(Xr(a),pt(a),kx(a,s)):(pt(a),a.flags&=-16777217):(n.memoizedProps!==c&&Xr(a),pt(a),a.flags&=-16777217),null;case 27:Ee(a),s=ue.current;var p=a.type;if(n!==null&&a.stateNode!=null)n.memoizedProps!==c&&Xr(a);else{if(!c){if(a.stateNode===null)throw Error(o(166));return pt(a),null}n=re.current,Oi(a)?uy(a):(n=k0(p,c,s),a.stateNode=n,Xr(a))}return pt(a),null;case 5:if(Ee(a),s=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==c&&Xr(a);else{if(!c){if(a.stateNode===null)throw Error(o(166));return pt(a),null}if(n=re.current,Oi(a))uy(a);else{switch(p=Nu(ue.current),n){case 1:n=p.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:n=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":n=p.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":n=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":n=p.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof c.is=="string"?p.createElement("select",{is:c.is}):p.createElement("select"),c.multiple?n.multiple=!0:c.size&&(n.size=c.size);break;default:n=typeof c.is=="string"?p.createElement(s,{is:c.is}):p.createElement(s)}}n[Pt]=a,n[Kt]=c;e:for(p=a.child;p!==null;){if(p.tag===5||p.tag===6)n.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===a)break e;for(;p.sibling===null;){if(p.return===null||p.return===a)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}a.stateNode=n;e:switch(Ft(n,s,c),s){case"button":case"input":case"select":case"textarea":n=!!c.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Xr(a)}}return pt(a),a.flags&=-16777217,null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==c&&Xr(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(o(166));if(n=ue.current,Oi(a)){if(n=a.stateNode,s=a.memoizedProps,c=null,p=rn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[Pt]=a,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||_0(n.nodeValue,s)),n||So(a)}else n=Nu(n).createTextNode(c),n[Pt]=a,a.stateNode=n}return pt(a),null;case 13:if(c=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Oi(a),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(o(318));if(p=a.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[Pt]=a}else ki(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;pt(a),p=!1}else p=fy(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return a.flags&256?(Gr(a),a):(Gr(a),null)}if(Gr(a),(a.flags&128)!==0)return a.lanes=s,a;if(s=c!==null,n=n!==null&&n.memoizedState!==null,s){c=a.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool);var y=null;c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)}return s!==n&&s&&(a.child.flags|=8192),du(a,a.updateQueue),pt(a),null;case 4:return pe(),n===null&&bm(a.stateNode.containerInfo),pt(a),null;case 10:return qr(a.type),pt(a),null;case 19:if(X(Ot),p=a.memoizedState,p===null)return pt(a),null;if(c=(a.flags&128)!==0,y=p.rendering,y===null)if(c)Ki(p,!1);else{if(vt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(y=su(n),y!==null){for(a.flags|=128,Ki(p,!1),n=y.updateQueue,a.updateQueue=n,du(a,n),a.subtreeFlags=0,n=s,s=a.child;s!==null;)ly(s,n),s=s.sibling;return Z(Ot,Ot.current&1|2),a.child}n=n.sibling}p.tail!==null&&he()>mu&&(a.flags|=128,c=!0,Ki(p,!1),a.lanes=4194304)}else{if(!c)if(n=su(y),n!==null){if(a.flags|=128,c=!0,n=n.updateQueue,a.updateQueue=n,du(a,n),Ki(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!et)return pt(a),null}else 2*he()-p.renderingStartTime>mu&&s!==536870912&&(a.flags|=128,c=!0,Ki(p,!1),a.lanes=4194304);p.isBackwards?(y.sibling=a.child,a.child=y):(n=p.last,n!==null?n.sibling=y:a.child=y,p.last=y)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=he(),a.sibling=null,n=Ot.current,Z(Ot,c?n&1|2:n&1),a):(pt(a),null);case 22:case 23:return Gr(a),Sh(),c=a.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(pt(a),a.subtreeFlags&6&&(a.flags|=8192)):pt(a),s=a.updateQueue,s!==null&&du(a,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),n!==null&&X(Co),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),qr(Dt),pt(a),null;case 25:return null;case 30:return null}throw Error(o(156,a.tag))}function b_(n,a){switch(lh(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return qr(Dt),pe(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return Ee(a),null;case 13:if(Gr(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(o(340));ki()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return X(Ot),null;case 4:return pe(),null;case 10:return qr(a.type),null;case 22:case 23:return Gr(a),Sh(),n!==null&&X(Co),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return qr(Dt),null;case 25:return null;default:return null}}function zx(n,a){switch(lh(a),a.tag){case 3:qr(Dt),pe();break;case 26:case 27:case 5:Ee(a);break;case 4:pe();break;case 13:Gr(a);break;case 19:X(Ot);break;case 10:qr(a.type);break;case 22:case 23:Gr(a),Sh(),n!==null&&X(Co);break;case 24:qr(Dt)}}function Zi(n,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&n)===n){c=void 0;var y=s.create,_=s.inst;c=y(),_.destroy=c}s=s.next}while(s!==p)}}catch(R){it(a,a.return,R)}}function Ma(n,a,s){try{var c=a.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&n)===n){var _=c.inst,R=_.destroy;if(R!==void 0){_.destroy=void 0,p=a;var $=s,J=R;try{J()}catch(ie){it(p,$,ie)}}}c=c.next}while(c!==y)}}catch(ie){it(a,a.return,ie)}}function Lx(n){var a=n.updateQueue;if(a!==null){var s=n.stateNode;try{Ey(a,s)}catch(c){it(n,n.return,c)}}}function Px(n,a,s){s.props=_o(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){it(n,a,c)}}function Qi(n,a){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(p){it(n,a,p)}}function xr(n,a){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){it(n,a,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){it(n,a,p)}else s.current=null}function Ux(n){var a=n.type,s=n.memoizedProps,c=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){it(n,n.return,p)}}function Kh(n,a,s){try{var c=n.stateNode;$_(c,n.type,s,a),c[Kt]=a}catch(p){it(n,n.return,p)}}function Bx(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ba(n.type)||n.tag===4}function Zh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Bx(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&&Ba(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,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(n),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Eu));else if(c!==4&&(c===27&&Ba(n.type)&&(s=n.stateNode,a=null),n=n.child,n!==null))for(Qh(n,a,s),n=n.sibling;n!==null;)Qh(n,a,s),n=n.sibling}function fu(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?s.insertBefore(n,a):s.appendChild(n);else if(c!==4&&(c===27&&Ba(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(fu(n,a,s),n=n.sibling;n!==null;)fu(n,a,s),n=n.sibling}function Hx(n){var a=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,p=a.attributes;p.length;)a.removeAttributeNode(p[0]);Ft(a,c,s),a[Pt]=n,a[Kt]=s}catch(y){it(n,n.return,y)}}var Wr=!1,St=!1,Jh=!1,$x=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function w_(n,a){if(n=n.containerInfo,Em=Ru,n=Qv(n),Zf(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var _=0,R=-1,$=-1,J=0,ie=0,ce=n,ee=null;t:for(;;){for(var ne;ce!==s||p!==0&&ce.nodeType!==3||(R=_+p),ce!==y||c!==0&&ce.nodeType!==3||($=_+c),ce.nodeType===3&&(_+=ce.nodeValue.length),(ne=ce.firstChild)!==null;)ee=ce,ce=ne;for(;;){if(ce===n)break t;if(ee===s&&++J===p&&(R=_),ee===y&&++ie===c&&($=_),(ne=ce.nextSibling)!==null)break;ce=ee,ee=ce.parentNode}ce=ne}s=R===-1||$===-1?null:{start:R,end:$}}else s=null}s=s||{start:0,end:0}}else s=null;for(Nm={focusedElem:n,selectionRange:s},Ru=!1,Bt=a;Bt!==null;)if(a=Bt,n=a.child,(a.subtreeFlags&1024)!==0&&n!==null)n.return=a,Bt=n;else for(;Bt!==null;){switch(a=Bt,y=a.alternate,n=a.flags,a.tag){case 0:break;case 11:case 15:break;case 1:if((n&1024)!==0&&y!==null){n=void 0,s=a,p=y.memoizedProps,y=y.memoizedState,c=s.stateNode;try{var Re=_o(s.type,p,s.elementType===s.type);n=c.getSnapshotBeforeUpdate(Re,y),c.__reactInternalSnapshotBeforeUpdate=n}catch(je){it(s,s.return,je)}}break;case 3:if((n&1024)!==0){if(n=a.stateNode.containerInfo,s=n.nodeType,s===9)_m(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":_m(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(o(163))}if(n=a.sibling,n!==null){n.return=a.return,Bt=n;break}Bt=a.return}}function Ix(n,a,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Da(n,s),c&4&&Zi(5,s);break;case 1:if(Da(n,s),c&4)if(n=s.stateNode,a===null)try{n.componentDidMount()}catch(_){it(s,s.return,_)}else{var p=_o(s.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(p,a,n.__reactInternalSnapshotBeforeUpdate)}catch(_){it(s,s.return,_)}}c&64&&Lx(s),c&512&&Qi(s,s.return);break;case 3:if(Da(n,s),c&64&&(n=s.updateQueue,n!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Ey(n,a)}catch(_){it(s,s.return,_)}}break;case 27:a===null&&c&4&&Hx(s);case 26:case 5:Da(n,s),a===null&&c&4&&Ux(s),c&512&&Qi(s,s.return);break;case 12:Da(n,s);break;case 13:Da(n,s),c&4&&Yx(n,s),c&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=R_.bind(null,s),X_(n,s))));break;case 22:if(c=s.memoizedState!==null||Wr,!c){a=a!==null&&a.memoizedState!==null||St,p=Wr;var y=St;Wr=c,(St=a)&&!y?Oa(n,s,(s.subtreeFlags&8772)!==0):Da(n,s),Wr=p,St=y}break;case 30:break;default:Da(n,s)}}function Vx(n){var a=n.alternate;a!==null&&(n.alternate=null,Vx(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&Si(a)),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,un=!1;function Kr(n,a,s){for(s=s.child;s!==null;)qx(n,a,s),s=s.sibling}function qx(n,a,s){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(yn,s)}catch{}switch(s.tag){case 26:St||xr(s,a),Kr(n,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:St||xr(s,a);var c=ft,p=un;Ba(s.type)&&(ft=s.stateNode,un=!1),Kr(n,a,s),il(s.stateNode),ft=c,un=p;break;case 5:St||xr(s,a);case 6:if(c=ft,p=un,ft=null,Kr(n,a,s),ft=c,un=p,ft!==null)if(un)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(s.stateNode)}catch(y){it(s,a,y)}else try{ft.removeChild(s.stateNode)}catch(y){it(s,a,y)}break;case 18:ft!==null&&(un?(n=ft,D0(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),pl(n)):D0(ft,s.stateNode));break;case 4:c=ft,p=un,ft=s.stateNode.containerInfo,un=!0,Kr(n,a,s),ft=c,un=p;break;case 0:case 11:case 14:case 15:St||Ma(2,s,a),St||Ma(4,s,a),Kr(n,a,s);break;case 1:St||(xr(s,a),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Px(s,a,c)),Kr(n,a,s);break;case 21:Kr(n,a,s);break;case 22:St=(c=St)||s.memoizedState!==null,Kr(n,a,s),St=c;break;default:Kr(n,a,s)}}function Yx(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{pl(n)}catch(s){it(a,a.return,s)}}function S_(n){switch(n.tag){case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new $x),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new $x),a;default:throw Error(o(435,n.tag))}}function em(n,a){var s=S_(n);a.forEach(function(c){var p=M_.bind(null,n,c);s.has(c)||(s.add(c),c.then(p,p))})}function Sn(n,a){var s=a.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],y=n,_=a,R=_;e:for(;R!==null;){switch(R.tag){case 27:if(Ba(R.type)){ft=R.stateNode,un=!1;break e}break;case 5:ft=R.stateNode,un=!1;break e;case 3:case 4:ft=R.stateNode.containerInfo,un=!0;break e}R=R.return}if(ft===null)throw Error(o(160));qx(y,_,p),ft=null,un=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)Gx(a,n),a=a.sibling}var Zn=null;function Gx(n,a){var s=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Sn(a,n),En(n),c&4&&(Ma(3,n,n.return),Zi(3,n),Ma(5,n,n.return));break;case 1:Sn(a,n),En(n),c&512&&(St||s===null||xr(s,s.return)),c&64&&Wr&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=Zn;if(Sn(a,n),En(n),c&512&&(St||s===null||xr(s,s.return)),c&4){var y=s!==null?s.memoizedState:null;if(c=n.memoizedState,s===null)if(c===null)if(n.stateNode===null){e:{c=n.type,s=n.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[fo]||y[Pt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Ft(y,c,s),y[Pt]=n,_t(y),c=y;break e;case"link":var _=H0("link","href",p).get(c+(s.href||""));if(_){for(var R=0;R<_.length;R++)if(y=_[R],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(R,1);break t}}y=p.createElement(c),Ft(y,c,s),p.head.appendChild(y);break;case"meta":if(_=H0("meta","content",p).get(c+(s.content||""))){for(R=0;R<_.length;R++)if(y=_[R],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(R,1);break t}}y=p.createElement(c),Ft(y,c,s),p.head.appendChild(y);break;default:throw Error(o(468,c))}y[Pt]=n,_t(y),c=y}n.stateNode=c}else $0(p,n.type,n.stateNode);else n.stateNode=B0(p,c,n.memoizedProps);else y!==c?(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,c===null?$0(p,n.type,n.stateNode):B0(p,c,n.memoizedProps)):c===null&&n.stateNode!==null&&Kh(n,n.memoizedProps,s.memoizedProps)}break;case 27:Sn(a,n),En(n),c&512&&(St||s===null||xr(s,s.return)),s!==null&&c&4&&Kh(n,n.memoizedProps,s.memoizedProps);break;case 5:if(Sn(a,n),En(n),c&512&&(St||s===null||xr(s,s.return)),n.flags&32){p=n.stateNode;try{ls(p,"")}catch(ne){it(n,n.return,ne)}}c&4&&n.stateNode!=null&&(p=n.memoizedProps,Kh(n,p,s!==null?s.memoizedProps:p)),c&1024&&(Jh=!0);break;case 6:if(Sn(a,n),En(n),c&4){if(n.stateNode===null)throw Error(o(162));c=n.memoizedProps,s=n.stateNode;try{s.nodeValue=c}catch(ne){it(n,n.return,ne)}}break;case 3:if(_u=null,p=Zn,Zn=Cu(a.containerInfo),Sn(a,n),Zn=p,En(n),c&4&&s!==null&&s.memoizedState.isDehydrated)try{pl(a.containerInfo)}catch(ne){it(n,n.return,ne)}Jh&&(Jh=!1,Fx(n));break;case 4:c=Zn,Zn=Cu(n.stateNode.containerInfo),Sn(a,n),En(n),Zn=c;break;case 12:Sn(a,n),En(n);break;case 13:Sn(a,n),En(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(sm=he()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,em(n,c)));break;case 22:p=n.memoizedState!==null;var $=s!==null&&s.memoizedState!==null,J=Wr,ie=St;if(Wr=J||p,St=ie||$,Sn(a,n),St=ie,Wr=J,En(n),c&8192)e:for(a=n.stateNode,a._visibility=p?a._visibility&-2:a._visibility|1,p&&(s===null||$||Wr||St||Ao(n)),s=null,a=n;;){if(a.tag===5||a.tag===26){if(s===null){$=s=a;try{if(y=$.stateNode,p)_=y.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{R=$.stateNode;var ce=$.memoizedProps.style,ee=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;R.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ne){it($,$.return,ne)}}}else if(a.tag===6){if(s===null){$=a;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(ne){it($,$.return,ne)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===n)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break e;for(;a.sibling===null;){if(a.return===null||a.return===n)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=n.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,em(n,s))));break;case 19:Sn(a,n),En(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,em(n,c)));break;case 30:break;case 21:break;default:Sn(a,n),En(n)}}function En(n){var a=n.flags;if(a&2){try{for(var s,c=n.return;c!==null;){if(Bx(c)){s=c;break}c=c.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var p=s.stateNode,y=Zh(n);fu(n,y,p);break;case 5:var _=s.stateNode;s.flags&32&&(ls(_,""),s.flags&=-33);var R=Zh(n);fu(n,R,_);break;case 3:case 4:var $=s.stateNode.containerInfo,J=Zh(n);Qh(n,J,$);break;default:throw Error(o(161))}}catch(ie){it(n,n.return,ie)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function Fx(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;Fx(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),n=n.sibling}}function Da(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Ix(n,a.alternate,a),a=a.sibling}function Ao(n){for(n=n.child;n!==null;){var a=n;switch(a.tag){case 0:case 11:case 14:case 15:Ma(4,a,a.return),Ao(a);break;case 1:xr(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&Px(a,a.return,s),Ao(a);break;case 27:il(a.stateNode);case 26:case 5:xr(a,a.return),Ao(a);break;case 22:a.memoizedState===null&&Ao(a);break;case 30:Ao(a);break;default:Ao(a)}n=n.sibling}}function Oa(n,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,p=n,y=a,_=y.flags;switch(y.tag){case 0:case 11:case 15:Oa(p,y,s),Zi(4,y);break;case 1:if(Oa(p,y,s),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(J){it(c,c.return,J)}if(c=y,p=c.updateQueue,p!==null){var R=c.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)Sy($[p],R)}catch(J){it(c,c.return,J)}}s&&_&64&&Lx(y),Qi(y,y.return);break;case 27:Hx(y);case 26:case 5:Oa(p,y,s),s&&c===null&&_&4&&Ux(y),Qi(y,y.return);break;case 12:Oa(p,y,s);break;case 13:Oa(p,y,s),s&&_&4&&Yx(p,y);break;case 22:y.memoizedState===null&&Oa(p,y,s),Qi(y,y.return);break;case 30:break;default:Oa(p,y,s)}a=a.sibling}}function tm(n,a){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&Pi(s))}function nm(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Pi(n))}function br(n,a,s,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Xx(n,a,s,c),a=a.sibling}function Xx(n,a,s,c){var p=a.flags;switch(a.tag){case 0:case 11:case 15:br(n,a,s,c),p&2048&&Zi(9,a);break;case 1:br(n,a,s,c);break;case 3:br(n,a,s,c),p&2048&&(n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Pi(n)));break;case 12:if(p&2048){br(n,a,s,c),n=a.stateNode;try{var y=a.memoizedProps,_=y.id,R=y.onPostCommit;typeof R=="function"&&R(_,a.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch($){it(a,a.return,$)}}else br(n,a,s,c);break;case 13:br(n,a,s,c);break;case 23:break;case 22:y=a.stateNode,_=a.alternate,a.memoizedState!==null?y._visibility&2?br(n,a,s,c):Ji(n,a):y._visibility&2?br(n,a,s,c):(y._visibility|=2,_s(n,a,s,c,(a.subtreeFlags&10256)!==0)),p&2048&&tm(_,a);break;case 24:br(n,a,s,c),p&2048&&nm(a.alternate,a);break;default:br(n,a,s,c)}}function _s(n,a,s,c,p){for(p=p&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var y=n,_=a,R=s,$=c,J=_.flags;switch(_.tag){case 0:case 11:case 15:_s(y,_,R,$,p),Zi(8,_);break;case 23:break;case 22:var ie=_.stateNode;_.memoizedState!==null?ie._visibility&2?_s(y,_,R,$,p):Ji(y,_):(ie._visibility|=2,_s(y,_,R,$,p)),p&&J&2048&&tm(_.alternate,_);break;case 24:_s(y,_,R,$,p),p&&J&2048&&nm(_.alternate,_);break;default:_s(y,_,R,$,p)}a=a.sibling}}function Ji(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=n,c=a,p=c.flags;switch(c.tag){case 22:Ji(s,c),p&2048&&tm(c.alternate,c);break;case 24:Ji(s,c),p&2048&&nm(c.alternate,c);break;default:Ji(s,c)}a=a.sibling}}var el=8192;function As(n){if(n.subtreeFlags&el)for(n=n.child;n!==null;)Wx(n),n=n.sibling}function Wx(n){switch(n.tag){case 26:As(n),n.flags&el&&n.memoizedState!==null&&iA(Zn,n.memoizedState,n.memoizedProps);break;case 5:As(n);break;case 3:case 4:var a=Zn;Zn=Cu(n.stateNode.containerInfo),As(n),Zn=a;break;case 22:n.memoizedState===null&&(a=n.alternate,a!==null&&a.memoizedState!==null?(a=el,el=16777216,As(n),el=a):As(n));break;default:As(n)}}function Kx(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function tl(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Bt=c,Qx(c,n)}Kx(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Zx(n),n=n.sibling}function Zx(n){switch(n.tag){case 0:case 11:case 15:tl(n),n.flags&2048&&Ma(9,n,n.return);break;case 3:tl(n);break;case 12:tl(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,hu(n)):tl(n);break;default:tl(n)}}function hu(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Bt=c,Qx(c,n)}Kx(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:Ma(8,a,a.return),hu(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,hu(a));break;default:hu(a)}n=n.sibling}}function Qx(n,a){for(;Bt!==null;){var s=Bt;switch(s.tag){case 0:case 11:case 15:Ma(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Pi(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Bt=c;else e:for(s=n;Bt!==null;){c=Bt;var p=c.sibling,y=c.return;if(Vx(c),c===s){Bt=null;break e}if(p!==null){p.return=y,Bt=p;break e}Bt=y}}}var E_={getCacheForType:function(n){var a=Zt(Dt),s=a.data.get(n);return s===void 0&&(s=n(),a.data.set(n,s)),s}},N_=typeof WeakMap=="function"?WeakMap:Map,tt=0,lt=null,Ie=null,Fe=0,nt=0,Nn=null,ka=!1,Ts=!1,rm=!1,Zr=0,vt=0,za=0,To=0,am=0,Hn=0,Rs=0,nl=null,dn=null,om=!1,sm=0,mu=1/0,pu=null,La=null,Gt=0,Pa=null,Ms=null,Ds=0,im=0,lm=null,Jx=null,rl=0,cm=null;function Cn(){if((tt&2)!==0&&Fe!==0)return Fe&-Fe;if(D.T!==null){var n=xs;return n!==0?n:gm()}return wc()}function e0(){Hn===0&&(Hn=(Fe&536870912)===0||et?rs():536870912);var n=Bn.current;return n!==null&&(n.flags|=32),Hn}function jn(n,a,s){(n===lt&&(nt===2||nt===9)||n.cancelPendingCommit!==null)&&(Os(n,0),Ua(n,Fe,Hn,!1)),va(n,s),((tt&2)===0||n!==lt)&&(n===lt&&((tt&2)===0&&(To|=s),vt===4&&Ua(n,Fe,Hn,!1)),wr(n))}function t0(n,a,s){if((tt&6)!==0)throw Error(o(327));var c=!s&&(a&124)===0&&(a&n.expiredLanes)===0||Wt(n,a),p=c?__(n,a):fm(n,a,!0),y=c;do{if(p===0){Ts&&!c&&Ua(n,a,0,!1);break}else{if(s=n.current.alternate,y&&!C_(s)){p=fm(n,a,!1),y=!1;continue}if(p===2){if(y=a,n.errorRecoveryDisabledLanes&y)var _=0;else _=n.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){a=_;e:{var R=n;p=nl;var $=R.current.memoizedState.isDehydrated;if($&&(Os(R,_).flags|=256),_=fm(R,_,!1),_!==2){if(rm&&!$){R.errorRecoveryDisabledLanes|=y,To|=y,p=4;break e}y=dn,dn=p,y!==null&&(dn===null?dn=y:dn.push.apply(dn,y))}p=_}if(y=!1,p!==2)continue}}if(p===1){Os(n,0),Ua(n,a,0,!0);break}e:{switch(c=n,y=p,y){case 0:case 1:throw Error(o(345));case 4:if((a&4194048)!==a)break;case 6:Ua(c,a,Hn,!ka);break e;case 2:dn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((a&62914560)===a&&(p=sm+300-he(),10<p)){if(Ua(c,a,Hn,!ka),sn(c,0,!0)!==0)break e;c.timeoutHandle=R0(n0.bind(null,c,s,dn,pu,om,a,Hn,To,Rs,ka,y,2,-0,0),p);break e}n0(c,s,dn,pu,om,a,Hn,To,Rs,ka,y,0,-0,0)}}break}while(!0);wr(n)}function n0(n,a,s,c,p,y,_,R,$,J,ie,ce,ee,ne){if(n.timeoutHandle=-1,ce=a.subtreeFlags,(ce&8192||(ce&16785408)===16785408)&&(ul={stylesheets:null,count:0,unsuspend:sA},Wx(a),ce=lA(),ce!==null)){n.cancelPendingCommit=ce(c0.bind(null,n,a,y,s,c,p,_,R,$,ie,1,ee,ne)),Ua(n,y,_,!J);return}c0(n,a,y,s,c,p,_,R,$)}function C_(n){for(var a=n;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var p=s[c],y=p.getSnapshot;p=p.value;try{if(!bn(y(),p))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ua(n,a,s,c){a&=~am,a&=~To,n.suspendedLanes|=a,n.pingedLanes&=~a,c&&(n.warmLanes|=a),c=n.expirationTimes;for(var p=a;0<p;){var y=31-jt(p),_=1<<y;c[y]=-1,p&=~_}s!==0&&xc(n,s,a)}function gu(){return(tt&6)===0?(al(0),!1):!0}function um(){if(Ie!==null){if(nt===0)var n=Ie.return;else n=Ie,Vr=Eo=null,_h(n),Cs=null,Xi=0,n=Ie;for(;n!==null;)zx(n.alternate,n),n=n.return;Ie=null}}function Os(n,a){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,V_(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),um(),lt=n,Ie=s=Hr(n.current,null),Fe=a,nt=0,Nn=null,ka=!1,Ts=Wt(n,a),rm=!1,Rs=Hn=am=To=za=vt=0,dn=nl=null,om=!1,(a&8)!==0&&(a|=a&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=a;0<c;){var p=31-jt(c),y=1<<p;a|=n[p],c&=~y}return Zr=a,Uc(),s}function r0(n,a){Pe=null,D.H=ru,a===Bi||a===Fc?(a=by(),nt=3):a===vy?(a=by(),nt=4):nt=a===wx?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Nn=a,Ie===null&&(vt=1,lu(n,zn(a,n.current)))}function a0(){var n=D.H;return D.H=ru,n===null?ru:n}function o0(){var n=D.A;return D.A=E_,n}function dm(){vt=4,ka||(Fe&4194048)!==Fe&&Bn.current!==null||(Ts=!0),(za&134217727)===0&&(To&134217727)===0||lt===null||Ua(lt,Fe,Hn,!1)}function fm(n,a,s){var c=tt;tt|=2;var p=a0(),y=o0();(lt!==n||Fe!==a)&&(pu=null,Os(n,a)),a=!1;var _=vt;e:do try{if(nt!==0&&Ie!==null){var R=Ie,$=Nn;switch(nt){case 8:um(),_=6;break e;case 3:case 2:case 9:case 6:Bn.current===null&&(a=!0);var J=nt;if(nt=0,Nn=null,ks(n,R,$,J),s&&Ts){_=0;break e}break;default:J=nt,nt=0,Nn=null,ks(n,R,$,J)}}j_(),_=vt;break}catch(ie){r0(n,ie)}while(!0);return a&&n.shellSuspendCounter++,Vr=Eo=null,tt=c,D.H=p,D.A=y,Ie===null&&(lt=null,Fe=0,Uc()),_}function j_(){for(;Ie!==null;)s0(Ie)}function __(n,a){var s=tt;tt|=2;var c=a0(),p=o0();lt!==n||Fe!==a?(pu=null,mu=he()+500,Os(n,a)):Ts=Wt(n,a);e:do try{if(nt!==0&&Ie!==null){a=Ie;var y=Nn;t:switch(nt){case 1:nt=0,Nn=null,ks(n,a,y,1);break;case 2:case 9:if(yy(y)){nt=0,Nn=null,i0(a);break}a=function(){nt!==2&&nt!==9||lt!==n||(nt=7),wr(n)},y.then(a,a);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:yy(y)?(nt=0,Nn=null,i0(a)):(nt=0,Nn=null,ks(n,a,y,7));break;case 5:var _=null;switch(Ie.tag){case 26:_=Ie.memoizedState;case 5:case 27:var R=Ie;if(!_||I0(_)){nt=0,Nn=null;var $=R.sibling;if($!==null)Ie=$;else{var J=R.return;J!==null?(Ie=J,vu(J)):Ie=null}break t}}nt=0,Nn=null,ks(n,a,y,5);break;case 6:nt=0,Nn=null,ks(n,a,y,6);break;case 8:um(),vt=6;break e;default:throw Error(o(462))}}A_();break}catch(ie){r0(n,ie)}while(!0);return Vr=Eo=null,D.H=c,D.A=p,tt=s,Ie!==null?0:(lt=null,Fe=0,Uc(),vt)}function A_(){for(;Ie!==null&&!Je();)s0(Ie)}function s0(n){var a=Ox(n.alternate,n,Zr);n.memoizedProps=n.pendingProps,a===null?vu(n):Ie=a}function i0(n){var a=n,s=a.alternate;switch(a.tag){case 15:case 0:a=_x(s,a,a.pendingProps,a.type,void 0,Fe);break;case 11:a=_x(s,a,a.pendingProps,a.type.render,a.ref,Fe);break;case 5:_h(a);default:zx(s,a),a=Ie=ly(a,Zr),a=Ox(s,a,Zr)}n.memoizedProps=n.pendingProps,a===null?vu(n):Ie=a}function ks(n,a,s,c){Vr=Eo=null,_h(a),Cs=null,Xi=0;var p=a.return;try{if(v_(n,p,a,s,Fe)){vt=1,lu(n,zn(s,n.current)),Ie=null;return}}catch(y){if(p!==null)throw Ie=p,y;vt=1,lu(n,zn(s,n.current)),Ie=null;return}a.flags&32768?(et||c===1?n=!0:Ts||(Fe&536870912)!==0?n=!1:(ka=n=!0,(c===2||c===9||c===3||c===6)&&(c=Bn.current,c!==null&&c.tag===13&&(c.flags|=16384))),l0(a,n)):vu(a)}function vu(n){var a=n;do{if((a.flags&32768)!==0){l0(a,ka);return}n=a.return;var s=x_(a.alternate,a,Zr);if(s!==null){Ie=s;return}if(a=a.sibling,a!==null){Ie=a;return}Ie=a=n}while(a!==null);vt===0&&(vt=5)}function l0(n,a){do{var s=b_(n.alternate,n);if(s!==null){s.flags&=32767,Ie=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(n=n.sibling,n!==null)){Ie=n;return}Ie=n=s}while(n!==null);vt=6,Ie=null}function c0(n,a,s,c,p,y,_,R,$){n.cancelPendingCommit=null;do yu();while(Gt!==0);if((tt&6)!==0)throw Error(o(327));if(a!==null){if(a===n.current)throw Error(o(177));if(y=a.lanes|a.childLanes,y|=nh,Lr(n,s,y,_,R,$),n===lt&&(Ie=lt=null,Fe=0),Ms=a,Pa=n,Ds=s,im=y,lm=p,Jx=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,D_(Le,function(){return m0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=D.T,D.T=null,p=q.p,q.p=2,_=tt,tt|=4;try{w_(n,a,s)}finally{tt=_,q.p=p,D.T=c}}Gt=1,u0(),d0(),f0()}}function u0(){if(Gt===1){Gt=0;var n=Pa,a=Ms,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=D.T,D.T=null;var c=q.p;q.p=2;var p=tt;tt|=4;try{Gx(a,n);var y=Nm,_=Qv(n.containerInfo),R=y.focusedElem,$=y.selectionRange;if(_!==R&&R&&R.ownerDocument&&Zv(R.ownerDocument.documentElement,R)){if($!==null&&Zf(R)){var J=$.start,ie=$.end;if(ie===void 0&&(ie=J),"selectionStart"in R)R.selectionStart=J,R.selectionEnd=Math.min(ie,R.value.length);else{var ce=R.ownerDocument||document,ee=ce&&ce.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),Re=R.textContent.length,je=Math.min($.start,Re),st=$.end===void 0?je:Math.min($.end,Re);!ne.extend&&je>st&&(_=st,st=je,je=_);var W=Kv(R,je),G=Kv(R,st);if(W&&G&&(ne.rangeCount!==1||ne.anchorNode!==W.node||ne.anchorOffset!==W.offset||ne.focusNode!==G.node||ne.focusOffset!==G.offset)){var Q=ce.createRange();Q.setStart(W.node,W.offset),ne.removeAllRanges(),je>st?(ne.addRange(Q),ne.extend(G.node,G.offset)):(Q.setEnd(G.node,G.offset),ne.addRange(Q))}}}}for(ce=[],ne=R;ne=ne.parentNode;)ne.nodeType===1&&ce.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ce.length;R++){var le=ce[R];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Ru=!!Em,Nm=Em=null}finally{tt=p,q.p=c,D.T=s}}n.current=a,Gt=2}}function d0(){if(Gt===2){Gt=0;var n=Pa,a=Ms,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=D.T,D.T=null;var c=q.p;q.p=2;var p=tt;tt|=4;try{Ix(n,a.alternate,a)}finally{tt=p,q.p=c,D.T=s}}Gt=3}}function f0(){if(Gt===4||Gt===3){Gt=0,mt();var n=Pa,a=Ms,s=Ds,c=Jx;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Gt=5:(Gt=0,Ms=Pa=null,h0(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(La=null),bi(s),a=a.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(yn,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=D.T,p=q.p,q.p=2,D.T=null;try{for(var y=n.onRecoverableError,_=0;_<c.length;_++){var R=c[_];y(R.value,{componentStack:R.stack})}}finally{D.T=a,q.p=p}}(Ds&3)!==0&&yu(),wr(n),p=n.pendingLanes,(s&4194090)!==0&&(p&42)!==0?n===cm?rl++:(rl=0,cm=n):rl=0,al(0)}}function h0(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,Pi(a)))}function yu(n){return u0(),d0(),f0(),m0()}function m0(){if(Gt!==5)return!1;var n=Pa,a=im;im=0;var s=bi(Ds),c=D.T,p=q.p;try{q.p=32>s?32:s,D.T=null,s=lm,lm=null;var y=Pa,_=Ds;if(Gt=0,Ms=Pa=null,Ds=0,(tt&6)!==0)throw Error(o(331));var R=tt;if(tt|=4,Zx(y.current),Xx(y,y.current,_,s),tt=R,al(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(yn,y)}catch{}return!0}finally{q.p=p,D.T=c,h0(n,a)}}function p0(n,a,s){a=zn(s,a),a=$h(n.stateNode,a,2),n=_a(n,a,2),n!==null&&(va(n,2),wr(n))}function it(n,a,s){if(n.tag===3)p0(n,n,s);else for(;a!==null;){if(a.tag===3){p0(a,n,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(La===null||!La.has(c))){n=zn(s,n),s=xx(2),c=_a(a,s,2),c!==null&&(bx(s,c,a,n),va(c,2),wr(c));break}}a=a.return}}function hm(n,a,s){var c=n.pingCache;if(c===null){c=n.pingCache=new N_;var p=new Set;c.set(a,p)}else p=c.get(a),p===void 0&&(p=new Set,c.set(a,p));p.has(s)||(rm=!0,p.add(s),n=T_.bind(null,n,a,s),a.then(n,n))}function T_(n,a,s){var c=n.pingCache;c!==null&&c.delete(a),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,lt===n&&(Fe&s)===s&&(vt===4||vt===3&&(Fe&62914560)===Fe&&300>he()-sm?(tt&2)===0&&Os(n,0):am|=s,Rs===Fe&&(Rs=0)),wr(n)}function g0(n,a){a===0&&(a=ga()),n=ps(n,a),n!==null&&(va(n,a),wr(n))}function R_(n){var a=n.memoizedState,s=0;a!==null&&(s=a.retryLane),g0(n,s)}function M_(n,a){var s=0;switch(n.tag){case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(o(314))}c!==null&&c.delete(a),g0(n,s)}function D_(n,a){return Ye(n,a)}var xu=null,zs=null,mm=!1,bu=!1,pm=!1,Ro=0;function wr(n){n!==zs&&n.next===null&&(zs===null?xu=zs=n:zs=zs.next=n),bu=!0,mm||(mm=!0,k_())}function al(n,a){if(!pm&&bu){pm=!0;do for(var s=!1,c=xu;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var _=c.suspendedLanes,R=c.pingedLanes;y=(1<<31-jt(42|n)+1)-1,y&=p&~(_&~R),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,b0(c,y))}else y=Fe,y=sn(c,c===lt?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||Wt(c,y)||(s=!0,b0(c,y));c=c.next}while(s);pm=!1}}function O_(){v0()}function v0(){bu=mm=!1;var n=0;Ro!==0&&(I_()&&(n=Ro),Ro=0);for(var a=he(),s=null,c=xu;c!==null;){var p=c.next,y=y0(c,a);y===0?(c.next=null,s===null?xu=p:s.next=p,p===null&&(zs=s)):(s=c,(n!==0||(y&3)!==0)&&(bu=!0)),c=p}al(n)}function y0(n,a){for(var s=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var _=31-jt(y),R=1<<_,$=p[_];$===-1?((R&s)===0||(R&c)!==0)&&(p[_]=co(R,a)):$<=a&&(n.expiredLanes|=R),y&=~R}if(a=lt,s=Fe,s=sn(n,n===a?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,s===0||n===a&&(nt===2||nt===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&We(c),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||Wt(n,s)){if(a=s&-s,a===n.callbackPriority)return a;switch(c!==null&&We(c),bi(s)){case 2:case 8:s=Ke;break;case 32:s=Le;break;case 268435456:s=zr;break;default:s=Le}return c=x0.bind(null,n),s=Ye(s,c),n.callbackPriority=a,n.callbackNode=s,a}return c!==null&&c!==null&&We(c),n.callbackPriority=2,n.callbackNode=null,2}function x0(n,a){if(Gt!==0&&Gt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(yu()&&n.callbackNode!==s)return null;var c=Fe;return c=sn(n,n===lt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(t0(n,c,a),y0(n,he()),n.callbackNode!=null&&n.callbackNode===s?x0.bind(null,n):null)}function b0(n,a){if(yu())return null;t0(n,a,!0)}function k_(){q_(function(){(tt&6)!==0?Ye(Te,O_):v0()})}function gm(){return Ro===0&&(Ro=rs()),Ro}function w0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Mc(""+n)}function S0(n,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,n.id&&s.setAttribute("form",n.id),a.parentNode.insertBefore(s,a),n=new FormData(n),s.parentNode.removeChild(s),n}function z_(n,a,s,c,p){if(a==="submit"&&s&&s.stateNode===p){var y=w0((p[Kt]||null).action),_=c.submitter;_&&(a=(a=_[Kt]||null)?w0(a.formAction):_.getAttribute("formAction"),a!==null&&(y=a,_=null));var R=new zc("action","action",null,c,p);n.push({event:R,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ro!==0){var $=_?S0(p,_):new FormData(p);Lh(s,{pending:!0,data:$,method:p.method,action:y},null,$)}}else typeof y=="function"&&(R.preventDefault(),$=_?S0(p,_):new FormData(p),Lh(s,{pending:!0,data:$,method:p.method,action:y},y,$))},currentTarget:p}]})}}for(var vm=0;vm<th.length;vm++){var ym=th[vm],L_=ym.toLowerCase(),P_=ym[0].toUpperCase()+ym.slice(1);Kn(L_,"on"+P_)}Kn(ty,"onAnimationEnd"),Kn(ny,"onAnimationIteration"),Kn(ry,"onAnimationStart"),Kn("dblclick","onDoubleClick"),Kn("focusin","onFocus"),Kn("focusout","onBlur"),Kn(e_,"onTransitionRun"),Kn(t_,"onTransitionStart"),Kn(n_,"onTransitionCancel"),Kn(ay,"onTransitionEnd"),wa("onMouseEnter",["mouseout","mouseover"]),wa("onMouseLeave",["mouseout","mouseover"]),wa("onPointerEnter",["pointerout","pointerover"]),wa("onPointerLeave",["pointerout","pointerover"]),Ur("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ur("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ur("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ur("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ur("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ur("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ol="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(" "),U_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function E0(n,a){a=(a&4)!==0;for(var s=0;s<n.length;s++){var c=n[s],p=c.event;c=c.listeners;e:{var y=void 0;if(a)for(var _=c.length-1;0<=_;_--){var R=c[_],$=R.instance,J=R.currentTarget;if(R=R.listener,$!==y&&p.isPropagationStopped())break e;y=R,p.currentTarget=J;try{y(p)}catch(ie){iu(ie)}p.currentTarget=null,y=$}else for(_=0;_<c.length;_++){if(R=c[_],$=R.instance,J=R.currentTarget,R=R.listener,$!==y&&p.isPropagationStopped())break e;y=R,p.currentTarget=J;try{y(p)}catch(ie){iu(ie)}p.currentTarget=null,y=$}}}}function Ve(n,a){var s=a[wi];s===void 0&&(s=a[wi]=new Set);var c=n+"__bubble";s.has(c)||(N0(a,n,2,!1),s.add(c))}function xm(n,a,s){var c=0;a&&(c|=4),N0(s,n,c,a)}var wu="_reactListening"+Math.random().toString(36).slice(2);function bm(n){if(!n[wu]){n[wu]=!0,Ec.forEach(function(s){s!=="selectionchange"&&(U_.has(s)||xm(s,!1,n),xm(s,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[wu]||(a[wu]=!0,xm("selectionchange",!1,a))}}function N0(n,a,s,c){switch(X0(a)){case 2:var p=dA;break;case 8:p=fA;break;default:p=km}s=p.bind(null,a,s,n),p=void 0,!If||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(p=!0),c?p!==void 0?n.addEventListener(a,s,{capture:!0,passive:p}):n.addEventListener(a,s,!0):p!==void 0?n.addEventListener(a,s,{passive:p}):n.addEventListener(a,s,!1)}function wm(n,a,s,c,p){var y=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var _=c.tag;if(_===3||_===4){var R=c.stateNode.containerInfo;if(R===p)break;if(_===4)for(_=c.return;_!==null;){var $=_.tag;if(($===3||$===4)&&_.stateNode.containerInfo===p)return;_=_.return}for(;R!==null;){if(_=Pr(R),_===null)return;if($=_.tag,$===5||$===6||$===26||$===27){c=y=_;continue e}R=R.parentNode}}c=c.return}Mv(function(){var J=y,ie=Hf(s),ce=[];e:{var ee=oy.get(n);if(ee!==void 0){var ne=zc,Re=n;switch(n){case"keypress":if(Oc(s)===0)break e;case"keydown":case"keyup":ne=Dj;break;case"focusin":Re="focus",ne=Gf;break;case"focusout":Re="blur",ne=Gf;break;case"beforeblur":case"afterblur":ne=Gf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=kv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=bj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=zj;break;case ty:case ny:case ry:ne=Ej;break;case ay:ne=Pj;break;case"scroll":case"scrollend":ne=yj;break;case"wheel":ne=Bj;break;case"copy":case"cut":case"paste":ne=Cj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Lv;break;case"toggle":case"beforetoggle":ne=$j}var je=(a&4)!==0,st=!je&&(n==="scroll"||n==="scrollend"),W=je?ee!==null?ee+"Capture":null:ee;je=[];for(var G=J,Q;G!==null;){var le=G;if(Q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Q===null||W===null||(le=Ni(G,W),le!=null&&je.push(sl(G,le,Q))),st)break;G=G.return}0<je.length&&(ee=new ne(ee,Re,null,s,ie),ce.push({event:ee,listeners:je}))}}if((a&7)===0){e:{if(ee=n==="mouseover"||n==="pointerover",ne=n==="mouseout"||n==="pointerout",ee&&s!==Bf&&(Re=s.relatedTarget||s.fromElement)&&(Pr(Re)||Re[ya]))break e;if((ne||ee)&&(ee=ie.window===ie?ie:(ee=ie.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(Re=s.relatedTarget||s.toElement,ne=J,Re=Re?Pr(Re):null,Re!==null&&(st=l(Re),je=Re.tag,Re!==st||je!==5&&je!==27&&je!==6)&&(Re=null)):(ne=null,Re=J),ne!==Re)){if(je=kv,le="onMouseLeave",W="onMouseEnter",G="mouse",(n==="pointerout"||n==="pointerover")&&(je=Lv,le="onPointerLeave",W="onPointerEnter",G="pointer"),st=ne==null?ee:ho(ne),Q=Re==null?ee:ho(Re),ee=new je(le,G+"leave",ne,s,ie),ee.target=st,ee.relatedTarget=Q,le=null,Pr(ie)===J&&(je=new je(W,G+"enter",Re,s,ie),je.target=Q,je.relatedTarget=st,le=je),st=le,ne&&Re)t:{for(je=ne,W=Re,G=0,Q=je;Q;Q=Ls(Q))G++;for(Q=0,le=W;le;le=Ls(le))Q++;for(;0<G-Q;)je=Ls(je),G--;for(;0<Q-G;)W=Ls(W),Q--;for(;G--;){if(je===W||W!==null&&je===W.alternate)break t;je=Ls(je),W=Ls(W)}je=null}else je=null;ne!==null&&C0(ce,ee,ne,je,!1),Re!==null&&st!==null&&C0(ce,st,Re,je,!0)}}e:{if(ee=J?ho(J):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var ye=qv;else if(Iv(ee))if(Yv)ye=Zj;else{ye=Wj;var He=Xj}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?J&&Uf(J.elementType)&&(ye=qv):ye=Kj;if(ye&&(ye=ye(n,J))){Vv(ce,ye,s,ie);break e}He&&He(n,ee,J),n==="focusout"&&J&&ee.type==="number"&&J.memoizedProps.value!=null&&Pf(ee,"number",ee.value)}switch(He=J?ho(J):window,n){case"focusin":(Iv(He)||He.contentEditable==="true")&&(fs=He,Qf=J,Di=null);break;case"focusout":Di=Qf=fs=null;break;case"mousedown":Jf=!0;break;case"contextmenu":case"mouseup":case"dragend":Jf=!1,Jv(ce,s,ie);break;case"selectionchange":if(Jj)break;case"keydown":case"keyup":Jv(ce,s,ie)}var Ne;if(Xf)e:{switch(n){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else ds?Hv(n,s)&&(_e="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(_e="onCompositionStart");_e&&(Pv&&s.locale!=="ko"&&(ds||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&ds&&(Ne=Dv()):(Ea=ie,Vf="value"in Ea?Ea.value:Ea.textContent,ds=!0)),He=Su(J,_e),0<He.length&&(_e=new zv(_e,n,null,s,ie),ce.push({event:_e,listeners:He}),Ne?_e.data=Ne:(Ne=$v(s),Ne!==null&&(_e.data=Ne)))),(Ne=Vj?qj(n,s):Yj(n,s))&&(_e=Su(J,"onBeforeInput"),0<_e.length&&(He=new zv("onBeforeInput","beforeinput",null,s,ie),ce.push({event:He,listeners:_e}),He.data=Ne)),z_(ce,n,J,s,ie)}E0(ce,a)})}function sl(n,a,s){return{instance:n,listener:a,currentTarget:s}}function Su(n,a){for(var s=a+"Capture",c=[];n!==null;){var p=n,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ni(n,s),p!=null&&c.unshift(sl(n,p,y)),p=Ni(n,a),p!=null&&c.push(sl(n,p,y))),n.tag===3)return c;n=n.return}return[]}function Ls(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function C0(n,a,s,c,p){for(var y=a._reactName,_=[];s!==null&&s!==c;){var R=s,$=R.alternate,J=R.stateNode;if(R=R.tag,$!==null&&$===c)break;R!==5&&R!==26&&R!==27||J===null||($=J,p?(J=Ni(s,y),J!=null&&_.unshift(sl(s,J,$))):p||(J=Ni(s,y),J!=null&&_.push(sl(s,J,$)))),s=s.return}_.length!==0&&n.push({event:a,listeners:_})}var B_=/\r\n?/g,H_=/\u0000|\uFFFD/g;function j0(n){return(typeof n=="string"?n:""+n).replace(B_,`
`).replace(H_,"")}function _0(n,a){return a=j0(a),j0(n)===a}function Eu(){}function ot(n,a,s,c,p,y){switch(s){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||ls(n,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&ls(n,""+c);break;case"className":os(n,"class",c);break;case"tabIndex":os(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":os(n,s,c);break;case"style":Tv(n,c,y);break;case"data":if(a!=="object"){os(n,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||s!=="href")){n.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Mc(""+c),n.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(s,"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 y=="function"&&(s==="formAction"?(a!=="input"&&ot(n,a,"name",p.name,p,null),ot(n,a,"formEncType",p.formEncType,p,null),ot(n,a,"formMethod",p.formMethod,p,null),ot(n,a,"formTarget",p.formTarget,p,null)):(ot(n,a,"encType",p.encType,p,null),ot(n,a,"method",p.method,p,null),ot(n,a,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Mc(""+c),n.setAttribute(s,c);break;case"onClick":c!=null&&(n.onclick=Eu);break;case"onScroll":c!=null&&Ve("scroll",n);break;case"onScrollEnd":c!=null&&Ve("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(o(60));n.innerHTML=s}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}s=Mc(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""+c):n.removeAttribute(s);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":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":c===!0?n.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,c):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(s,c):n.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(s):n.setAttribute(s,c);break;case"popover":Ve("beforetoggle",n),Ve("toggle",n),as(n,"popover",c);break;case"xlinkActuate":Wn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Wn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Wn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Wn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Wn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Wn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":as(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=gj.get(s)||s,as(n,s,c))}}function Sm(n,a,s,c,p,y){switch(s){case"style":Tv(n,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(o(60));n.innerHTML=s}}break;case"children":typeof c=="string"?ls(n,c):(typeof c=="number"||typeof c=="bigint")&&ls(n,""+c);break;case"onScroll":c!=null&&Ve("scroll",n);break;case"onScrollEnd":c!=null&&Ve("scrollend",n);break;case"onClick":c!=null&&(n.onclick=Eu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Nc.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),a=s.slice(2,p?s.length-7:void 0),y=n[Kt]||null,y=y!=null?y[s]:null,typeof y=="function"&&n.removeEventListener(a,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(a,c,p);break e}s in n?n[s]=c:c===!0?n.setAttribute(s,""):as(n,s,c)}}}function Ft(n,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",n),Ve("load",n);var c=!1,p=!1,y;for(y in s)if(s.hasOwnProperty(y)){var _=s[y];if(_!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:ot(n,a,y,_,s,null)}}p&&ot(n,a,"srcSet",s.srcSet,s,null),c&&ot(n,a,"src",s.src,s,null);return;case"input":Ve("invalid",n);var R=y=_=p=null,$=null,J=null;for(c in s)if(s.hasOwnProperty(c)){var ie=s[c];if(ie!=null)switch(c){case"name":p=ie;break;case"type":_=ie;break;case"checked":$=ie;break;case"defaultChecked":J=ie;break;case"value":y=ie;break;case"defaultValue":R=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(o(137,a));break;default:ot(n,a,c,ie,s,null)}}Cv(n,y,R,$,J,_,p,!1),Tc(n);return;case"select":Ve("invalid",n),c=_=y=null;for(p in s)if(s.hasOwnProperty(p)&&(R=s[p],R!=null))switch(p){case"value":y=R;break;case"defaultValue":_=R;break;case"multiple":c=R;default:ot(n,a,p,R,s,null)}a=y,s=_,n.multiple=!!c,a!=null?is(n,!!c,a,!1):s!=null&&is(n,!!c,s,!0);return;case"textarea":Ve("invalid",n),y=p=c=null;for(_ in s)if(s.hasOwnProperty(_)&&(R=s[_],R!=null))switch(_){case"value":c=R;break;case"defaultValue":p=R;break;case"children":y=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(o(91));break;default:ot(n,a,_,R,s,null)}_v(n,c,p,y),Tc(n);return;case"option":for($ in s)if(s.hasOwnProperty($)&&(c=s[$],c!=null))switch($){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:ot(n,a,$,c,s,null)}return;case"dialog":Ve("beforetoggle",n),Ve("toggle",n),Ve("cancel",n),Ve("close",n);break;case"iframe":case"object":Ve("load",n);break;case"video":case"audio":for(c=0;c<ol.length;c++)Ve(ol[c],n);break;case"image":Ve("error",n),Ve("load",n);break;case"details":Ve("toggle",n);break;case"embed":case"source":case"link":Ve("error",n),Ve("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(J in s)if(s.hasOwnProperty(J)&&(c=s[J],c!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,a));default:ot(n,a,J,c,s,null)}return;default:if(Uf(a)){for(ie in s)s.hasOwnProperty(ie)&&(c=s[ie],c!==void 0&&Sm(n,a,ie,c,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(c=s[R],c!=null&&ot(n,a,R,c,s,null))}function $_(n,a,s,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,_=null,R=null,$=null,J=null,ie=null;for(ne in s){var ce=s[ne];if(s.hasOwnProperty(ne)&&ce!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":$=ce;default:c.hasOwnProperty(ne)||ot(n,a,ne,null,c,ce)}}for(var ee in c){var ne=c[ee];if(ce=s[ee],c.hasOwnProperty(ee)&&(ne!=null||ce!=null))switch(ee){case"type":y=ne;break;case"name":p=ne;break;case"checked":J=ne;break;case"defaultChecked":ie=ne;break;case"value":_=ne;break;case"defaultValue":R=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,a));break;default:ne!==ce&&ot(n,a,ee,ne,c,ce)}}Lf(n,_,R,$,J,ie,y,p);return;case"select":ne=_=R=ee=null;for(y in s)if($=s[y],s.hasOwnProperty(y)&&$!=null)switch(y){case"value":break;case"multiple":ne=$;default:c.hasOwnProperty(y)||ot(n,a,y,null,c,$)}for(p in c)if(y=c[p],$=s[p],c.hasOwnProperty(p)&&(y!=null||$!=null))switch(p){case"value":ee=y;break;case"defaultValue":R=y;break;case"multiple":_=y;default:y!==$&&ot(n,a,p,y,c,$)}a=R,s=_,c=ne,ee!=null?is(n,!!s,ee,!1):!!c!=!!s&&(a!=null?is(n,!!s,a,!0):is(n,!!s,s?[]:"",!1));return;case"textarea":ne=ee=null;for(R in s)if(p=s[R],s.hasOwnProperty(R)&&p!=null&&!c.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:ot(n,a,R,null,c,p)}for(_ in c)if(p=c[_],y=s[_],c.hasOwnProperty(_)&&(p!=null||y!=null))switch(_){case"value":ee=p;break;case"defaultValue":ne=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:p!==y&&ot(n,a,_,p,c,y)}jv(n,ee,ne);return;case"option":for(var Re in s)if(ee=s[Re],s.hasOwnProperty(Re)&&ee!=null&&!c.hasOwnProperty(Re))switch(Re){case"selected":n.selected=!1;break;default:ot(n,a,Re,null,c,ee)}for($ in c)if(ee=c[$],ne=s[$],c.hasOwnProperty($)&&ee!==ne&&(ee!=null||ne!=null))switch($){case"selected":n.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:ot(n,a,$,ee,c,ne)}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 je in s)ee=s[je],s.hasOwnProperty(je)&&ee!=null&&!c.hasOwnProperty(je)&&ot(n,a,je,null,c,ee);for(J in c)if(ee=c[J],ne=s[J],c.hasOwnProperty(J)&&ee!==ne&&(ee!=null||ne!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,a));break;default:ot(n,a,J,ee,c,ne)}return;default:if(Uf(a)){for(var st in s)ee=s[st],s.hasOwnProperty(st)&&ee!==void 0&&!c.hasOwnProperty(st)&&Sm(n,a,st,void 0,c,ee);for(ie in c)ee=c[ie],ne=s[ie],!c.hasOwnProperty(ie)||ee===ne||ee===void 0&&ne===void 0||Sm(n,a,ie,ee,c,ne);return}}for(var W in s)ee=s[W],s.hasOwnProperty(W)&&ee!=null&&!c.hasOwnProperty(W)&&ot(n,a,W,null,c,ee);for(ce in c)ee=c[ce],ne=s[ce],!c.hasOwnProperty(ce)||ee===ne||ee==null&&ne==null||ot(n,a,ce,ee,c,ne)}var Em=null,Nm=null;function Nu(n){return n.nodeType===9?n:n.ownerDocument}function A0(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 T0(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function Cm(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var jm=null;function I_(){var n=window.event;return n&&n.type==="popstate"?n===jm?!1:(jm=n,!0):(jm=null,!1)}var R0=typeof setTimeout=="function"?setTimeout:void 0,V_=typeof clearTimeout=="function"?clearTimeout:void 0,M0=typeof Promise=="function"?Promise:void 0,q_=typeof queueMicrotask=="function"?queueMicrotask:typeof M0<"u"?function(n){return M0.resolve(null).then(n).catch(Y_)}:R0;function Y_(n){setTimeout(function(){throw n})}function Ba(n){return n==="head"}function D0(n,a){var s=a,c=0,p=0;do{var y=s.nextSibling;if(n.removeChild(s),y&&y.nodeType===8)if(s=y.data,s==="/$"){if(0<c&&8>c){s=c;var _=n.ownerDocument;if(s&1&&il(_.documentElement),s&2&&il(_.body),s&4)for(s=_.head,il(s),_=s.firstChild;_;){var R=_.nextSibling,$=_.nodeName;_[fo]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&_.rel.toLowerCase()==="stylesheet"||s.removeChild(_),_=R}}if(p===0){n.removeChild(y),pl(a);return}p--}else s==="$"||s==="$?"||s==="$!"?p++:c=s.charCodeAt(0)-48;else c=0;s=y}while(s);pl(a)}function _m(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":_m(s),Si(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function G_(n,a,s,c){for(;n.nodeType===1;){var p=s;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[fo])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=Qn(n.nextSibling),n===null)break}return null}function F_(n,a,s){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=Qn(n.nextSibling),n===null))return null;return n}function Am(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState==="complete"}function X_(n,a){var s=n.ownerDocument;if(n.data!=="$?"||s.readyState==="complete")a();else{var c=function(){a(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Qn(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="F!"||a==="F")break;if(a==="/$")return null}}return n}var Tm=null;function O0(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"){if(a===0)return n;a--}else s==="/$"&&a++}n=n.previousSibling}return null}function k0(n,a,s){switch(a=Nu(s),n){case"html":if(n=a.documentElement,!n)throw Error(o(452));return n;case"head":if(n=a.head,!n)throw Error(o(453));return n;case"body":if(n=a.body,!n)throw Error(o(454));return n;default:throw Error(o(451))}}function il(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);Si(n)}var $n=new Map,z0=new Set;function Cu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Qr=q.d;q.d={f:W_,r:K_,D:Z_,C:Q_,L:J_,m:eA,X:nA,S:tA,M:rA};function W_(){var n=Qr.f(),a=gu();return n||a}function K_(n){var a=xa(n);a!==null&&a.tag===5&&a.type==="form"?tx(a):Qr.r(n)}var Ps=typeof document>"u"?null:document;function L0(n,a,s){var c=Ps;if(c&&typeof a=="string"&&a){var p=kn(a);p='link[rel="'+n+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),z0.has(p)||(z0.add(p),n={rel:n,crossOrigin:s,href:a},c.querySelector(p)===null&&(a=c.createElement("link"),Ft(a,"link",n),_t(a),c.head.appendChild(a)))}}function Z_(n){Qr.D(n),L0("dns-prefetch",n,null)}function Q_(n,a){Qr.C(n,a),L0("preconnect",n,a)}function J_(n,a,s){Qr.L(n,a,s);var c=Ps;if(c&&n&&a){var p='link[rel="preload"][as="'+kn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+kn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+kn(s.imageSizes)+'"]')):p+='[href="'+kn(n)+'"]';var y=p;switch(a){case"style":y=Us(n);break;case"script":y=Bs(n)}$n.has(y)||(n=g({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:n,as:a},s),$n.set(y,n),c.querySelector(p)!==null||a==="style"&&c.querySelector(ll(y))||a==="script"&&c.querySelector(cl(y))||(a=c.createElement("link"),Ft(a,"link",n),_t(a),c.head.appendChild(a)))}}function eA(n,a){Qr.m(n,a);var s=Ps;if(s&&n){var c=a&&typeof a.as=="string"?a.as:"script",p='link[rel="modulepreload"][as="'+kn(c)+'"][href="'+kn(n)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Bs(n)}if(!$n.has(y)&&(n=g({rel:"modulepreload",href:n},a),$n.set(y,n),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(cl(y)))return}c=s.createElement("link"),Ft(c,"link",n),_t(c),s.head.appendChild(c)}}}function tA(n,a,s){Qr.S(n,a,s);var c=Ps;if(c&&n){var p=ba(c).hoistableStyles,y=Us(n);a=a||"default";var _=p.get(y);if(!_){var R={loading:0,preload:null};if(_=c.querySelector(ll(y)))R.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":a},s),(s=$n.get(y))&&Rm(n,s);var $=_=c.createElement("link");_t($),Ft($,"link",n),$._p=new Promise(function(J,ie){$.onload=J,$.onerror=ie}),$.addEventListener("load",function(){R.loading|=1}),$.addEventListener("error",function(){R.loading|=2}),R.loading|=4,ju(_,a,c)}_={type:"stylesheet",instance:_,count:1,state:R},p.set(y,_)}}}function nA(n,a){Qr.X(n,a);var s=Ps;if(s&&n){var c=ba(s).hoistableScripts,p=Bs(n),y=c.get(p);y||(y=s.querySelector(cl(p)),y||(n=g({src:n,async:!0},a),(a=$n.get(p))&&Mm(n,a),y=s.createElement("script"),_t(y),Ft(y,"link",n),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function rA(n,a){Qr.M(n,a);var s=Ps;if(s&&n){var c=ba(s).hoistableScripts,p=Bs(n),y=c.get(p);y||(y=s.querySelector(cl(p)),y||(n=g({src:n,async:!0,type:"module"},a),(a=$n.get(p))&&Mm(n,a),y=s.createElement("script"),_t(y),Ft(y,"link",n),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function P0(n,a,s,c){var p=(p=ue.current)?Cu(p):null;if(!p)throw Error(o(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Us(s.href),s=ba(p).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=Us(s.href);var y=ba(p).hoistableStyles,_=y.get(n);if(_||(p=p.ownerDocument||p,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,_),(y=p.querySelector(ll(n)))&&!y._p&&(_.instance=y,_.state.loading=5),$n.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},$n.set(n,s),y||aA(p,n,s,_.state))),a&&c===null)throw Error(o(528,""));return _}if(a&&c!==null)throw Error(o(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Bs(s),s=ba(p).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,n))}}function Us(n){return'href="'+kn(n)+'"'}function ll(n){return'link[rel="stylesheet"]['+n+"]"}function U0(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function aA(n,a,s,c){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=n.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),Ft(a,"link",s),_t(a),n.head.appendChild(a))}function Bs(n){return'[src="'+kn(n)+'"]'}function cl(n){return"script[async]"+n}function B0(n,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=n.querySelector('style[data-href~="'+kn(s.href)+'"]');if(c)return a.instance=c,_t(c),c;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),_t(c),Ft(c,"style",p),ju(c,s.precedence,n),a.instance=c;case"stylesheet":p=Us(s.href);var y=n.querySelector(ll(p));if(y)return a.state.loading|=4,a.instance=y,_t(y),y;c=U0(s),(p=$n.get(p))&&Rm(c,p),y=(n.ownerDocument||n).createElement("link"),_t(y);var _=y;return _._p=new Promise(function(R,$){_.onload=R,_.onerror=$}),Ft(y,"link",c),a.state.loading|=4,ju(y,s.precedence,n),a.instance=y;case"script":return y=Bs(s.src),(p=n.querySelector(cl(y)))?(a.instance=p,_t(p),p):(c=s,(p=$n.get(y))&&(c=g({},s),Mm(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),_t(p),Ft(p,"link",c),n.head.appendChild(p),a.instance=p);case"void":return null;default:throw Error(o(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,ju(c,s.precedence,n));return a.instance}function ju(n,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,_=0;_<c.length;_++){var R=c[_];if(R.dataset.precedence===a)y=R;else if(y!==p)break}y?y.parentNode.insertBefore(n,y.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(n,a.firstChild))}function Rm(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function Mm(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var _u=null;function H0(n,a,s){if(_u===null){var c=new Map,p=_u=new Map;p.set(s,c)}else p=_u,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(n))return c;for(c.set(n,null),s=s.getElementsByTagName(n),p=0;p<s.length;p++){var y=s[p];if(!(y[fo]||y[Pt]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var _=y.getAttribute(a)||"";_=n+_;var R=c.get(_);R?R.push(y):c.set(_,[y])}}return c}function $0(n,a,s){n=n.ownerDocument||n,n.head.insertBefore(s,a==="title"?n.querySelector("head > title"):null)}function oA(n,a,s){if(s===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return n=a.disabled,typeof a.precedence=="string"&&n==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function I0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}var ul=null;function sA(){}function iA(n,a,s){if(ul===null)throw Error(o(475));var c=ul;if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=Us(s.href),y=n.querySelector(ll(p));if(y){n=y._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(c.count++,c=Au.bind(c),n.then(c,c)),a.state.loading|=4,a.instance=y,_t(y);return}y=n.ownerDocument||n,s=U0(s),(p=$n.get(p))&&Rm(s,p),y=y.createElement("link"),_t(y);var _=y;_._p=new Promise(function(R,$){_.onload=R,_.onerror=$}),Ft(y,"link",s),a.instance=y}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(c.count++,a=Au.bind(c),n.addEventListener("load",a),n.addEventListener("error",a))}}function lA(){if(ul===null)throw Error(o(475));var n=ul;return n.stylesheets&&n.count===0&&Dm(n,n.stylesheets),0<n.count?function(a){var s=setTimeout(function(){if(n.stylesheets&&Dm(n,n.stylesheets),n.unsuspend){var c=n.unsuspend;n.unsuspend=null,c()}},6e4);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(s)}}:null}function Au(){if(this.count--,this.count===0){if(this.stylesheets)Dm(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Tu=null;function Dm(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Tu=new Map,a.forEach(cA,n),Tu=null,Au.call(n))}function cA(n,a){if(!(a.state.loading&4)){var s=Tu.get(n);if(s)var c=s.get(null);else{s=new Map,Tu.set(n,s);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var _=p[y];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),c=_)}c&&s.set(null,c)}p=a.instance,_=p.getAttribute("data-precedence"),y=s.get(_)||c,y===c&&s.set(null,p),s.set(_,p),this.count++,c=Au.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),a.state.loading|=4}}var dl={$$typeof:A,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function uA(n,a,s,c,p,y,_,R){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=uo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uo(0),this.hiddenUpdates=uo(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function V0(n,a,s,c,p,y,_,R,$,J,ie,ce){return n=new uA(n,a,s,_,R,$,J,ce),a=1,y===!0&&(a|=24),y=wn(3,null,null,a),n.current=y,y.stateNode=n,a=hh(),a.refCount++,n.pooledCache=a,a.refCount++,y.memoizedState={element:c,isDehydrated:s,cache:a},vh(y),n}function q0(n){return n?(n=gs,n):gs}function Y0(n,a,s,c,p,y){p=q0(p),c.context===null?c.context=p:c.pendingContext=p,c=ja(a),c.payload={element:s},y=y===void 0?null:y,y!==null&&(c.callback=y),s=_a(n,c,a),s!==null&&(jn(s,n,a),$i(s,n,a))}function G0(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<a?s:a}}function Om(n,a){G0(n,a),(n=n.alternate)&&G0(n,a)}function F0(n){if(n.tag===13){var a=ps(n,67108864);a!==null&&jn(a,n,67108864),Om(n,67108864)}}var Ru=!0;function dA(n,a,s,c){var p=D.T;D.T=null;var y=q.p;try{q.p=2,km(n,a,s,c)}finally{q.p=y,D.T=p}}function fA(n,a,s,c){var p=D.T;D.T=null;var y=q.p;try{q.p=8,km(n,a,s,c)}finally{q.p=y,D.T=p}}function km(n,a,s,c){if(Ru){var p=zm(c);if(p===null)wm(n,a,c,Mu,s),W0(n,c);else if(mA(p,n,a,s,c))c.stopPropagation();else if(W0(n,c),a&4&&-1<hA.indexOf(n)){for(;p!==null;){var y=xa(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var _=nn(y.pendingLanes);if(_!==0){var R=y;for(R.pendingLanes|=2,R.entangledLanes|=2;_;){var $=1<<31-jt(_);R.entanglements[1]|=$,_&=~$}wr(y),(tt&6)===0&&(mu=he()+500,al(0))}}break;case 13:R=ps(y,2),R!==null&&jn(R,y,2),gu(),Om(y,2)}if(y=zm(c),y===null&&wm(n,a,c,Mu,s),y===p)break;p=y}p!==null&&c.stopPropagation()}else wm(n,a,c,null,s)}}function zm(n){return n=Hf(n),Lm(n)}var Mu=null;function Lm(n){if(Mu=null,n=Pr(n),n!==null){var a=l(n);if(a===null)n=null;else{var s=a.tag;if(s===13){if(n=u(a),n!==null)return n;n=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return Mu=n,null}function X0(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(de()){case Te:return 2;case Ke:return 8;case Le:case Ct:return 32;case zr:return 268435456;default:return 32}default:return 32}}var Pm=!1,Ha=null,$a=null,Ia=null,fl=new Map,hl=new Map,Va=[],hA="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 W0(n,a){switch(n){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":Ia=null;break;case"pointerover":case"pointerout":fl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(a.pointerId)}}function ml(n,a,s,c,p,y){return n===null||n.nativeEvent!==y?(n={blockedOn:a,domEventName:s,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},a!==null&&(a=xa(a),a!==null&&F0(a)),n):(n.eventSystemFlags|=c,a=n.targetContainers,p!==null&&a.indexOf(p)===-1&&a.push(p),n)}function mA(n,a,s,c,p){switch(a){case"focusin":return Ha=ml(Ha,n,a,s,c,p),!0;case"dragenter":return $a=ml($a,n,a,s,c,p),!0;case"mouseover":return Ia=ml(Ia,n,a,s,c,p),!0;case"pointerover":var y=p.pointerId;return fl.set(y,ml(fl.get(y)||null,n,a,s,c,p)),!0;case"gotpointercapture":return y=p.pointerId,hl.set(y,ml(hl.get(y)||null,n,a,s,c,p)),!0}return!1}function K0(n){var a=Pr(n.target);if(a!==null){var s=l(a);if(s!==null){if(a=s.tag,a===13){if(a=u(s),a!==null){n.blockedOn=a,Df(n.priority,function(){if(s.tag===13){var c=Cn();c=xi(c);var p=ps(s,c);p!==null&&jn(p,s,c),Om(s,c)}});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Du(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var s=zm(n.nativeEvent);if(s===null){s=n.nativeEvent;var c=new s.constructor(s.type,s);Bf=c,s.target.dispatchEvent(c),Bf=null}else return a=xa(s),a!==null&&F0(a),n.blockedOn=s,!1;a.shift()}return!0}function Z0(n,a,s){Du(n)&&s.delete(a)}function pA(){Pm=!1,Ha!==null&&Du(Ha)&&(Ha=null),$a!==null&&Du($a)&&($a=null),Ia!==null&&Du(Ia)&&(Ia=null),fl.forEach(Z0),hl.forEach(Z0)}function Ou(n,a){n.blockedOn===a&&(n.blockedOn=null,Pm||(Pm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pA)))}var ku=null;function Q0(n){ku!==n&&(ku=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ku===n&&(ku=null);for(var a=0;a<n.length;a+=3){var s=n[a],c=n[a+1],p=n[a+2];if(typeof c!="function"){if(Lm(c||s)===null)continue;break}var y=xa(s);y!==null&&(n.splice(a,3),a-=3,Lh(y,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function pl(n){function a($){return Ou($,n)}Ha!==null&&Ou(Ha,n),$a!==null&&Ou($a,n),Ia!==null&&Ou(Ia,n),fl.forEach(a),hl.forEach(a);for(var s=0;s<Va.length;s++){var c=Va[s];c.blockedOn===n&&(c.blockedOn=null)}for(;0<Va.length&&(s=Va[0],s.blockedOn===null);)K0(s),s.blockedOn===null&&Va.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],y=s[c+1],_=p[Kt]||null;if(typeof y=="function")_||Q0(s);else if(_){var R=null;if(y&&y.hasAttribute("formAction")){if(p=y,_=y[Kt]||null)R=_.formAction;else if(Lm(p)!==null)continue}else R=_.action;typeof R=="function"?s[c+1]=R:(s.splice(c,3),c-=3),Q0(s)}}}function Um(n){this._internalRoot=n}zu.prototype.render=Um.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(o(409));var s=a.current,c=Cn();Y0(s,c,n,a,null,null)},zu.prototype.unmount=Um.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;Y0(n.current,2,null,n,null,null),gu(),a[ya]=null}};function zu(n){this._internalRoot=n}zu.prototype.unstable_scheduleHydration=function(n){if(n){var a=wc();n={blockedOn:null,target:n,priority:a};for(var s=0;s<Va.length&&a!==0&&a<Va[s].priority;s++);Va.splice(s,0,n),s===0&&K0(n)}};var J0=t.version;if(J0!=="19.1.0")throw Error(o(527,J0,"19.1.0"));q.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(o(188)):(n=Object.keys(n).join(","),Error(o(268,n)));return n=m(a),n=n!==null?h(n):null,n=n===null?null:n.stateNode,n};var gA={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lu.isDisabled&&Lu.supportsFiber)try{yn=Lu.inject(gA),bt=Lu}catch{}}return vl.createRoot=function(n,a){if(!i(n))throw Error(o(299));var s=!1,c="",p=px,y=gx,_=vx,R=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(_=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(R=a.unstable_transitionCallbacks)),a=V0(n,1,!1,null,null,s,c,p,y,_,R,null),n[ya]=a.current,bm(n),new Um(a)},vl.hydrateRoot=function(n,a,s){if(!i(n))throw Error(o(299));var c=!1,p="",y=px,_=gx,R=vx,$=null,J=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(R=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&($=s.unstable_transitionCallbacks),s.formState!==void 0&&(J=s.formState)),a=V0(n,1,!0,a,s??null,c,p,y,_,R,$,J),a.context=q0(null),s=a.current,c=Cn(),c=xi(c),p=ja(c),p.callback=null,_a(s,p,c),s=c,a.current.lanes=s,va(a,s),wr(a),n[ya]=a.current,bm(n),new zu(a)},vl.version="19.1.0",vl}var cb;function jA(){if(cb)return $m.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(),$m.exports=CA(),$m.exports}var _A=jA(),yl={},ub;function AA(){if(ub)return yl;ub=1,Object.defineProperty(yl,"__esModule",{value:!0}),yl.parse=u,yl.serialize=h;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,l=(()=>{const b=function(){};return b.prototype=Object.create(null),b})();function u(b,w){const E=new l,S=b.length;if(S<2)return E;const N=(w==null?void 0:w.decode)||g;let C=0;do{const j=b.indexOf("=",C);if(j===-1)break;const A=b.indexOf(";",C),M=A===-1?S:A;if(j>M){C=b.lastIndexOf(";",j-1)+1;continue}const O=f(b,C,j),U=m(b,j,O),H=b.slice(O,U);if(E[H]===void 0){let V=f(b,j+1,M),P=m(b,M,V);const z=N(b.slice(V,P));E[H]=z}C=M+1}while(C<S);return E}function f(b,w,E){do{const S=b.charCodeAt(w);if(S!==32&&S!==9)return w}while(++w<E);return E}function m(b,w,E){for(;w>E;){const S=b.charCodeAt(--w);if(S!==32&&S!==9)return w+1}return E}function h(b,w,E){const S=(E==null?void 0:E.encode)||encodeURIComponent;if(!e.test(b))throw new TypeError(`argument name is invalid: ${b}`);const N=S(w);if(!t.test(N))throw new TypeError(`argument val is invalid: ${w}`);let C=b+"="+N;if(!E)return C;if(E.maxAge!==void 0){if(!Number.isInteger(E.maxAge))throw new TypeError(`option maxAge is invalid: ${E.maxAge}`);C+="; Max-Age="+E.maxAge}if(E.domain){if(!r.test(E.domain))throw new TypeError(`option domain is invalid: ${E.domain}`);C+="; Domain="+E.domain}if(E.path){if(!o.test(E.path))throw new TypeError(`option path is invalid: ${E.path}`);C+="; Path="+E.path}if(E.expires){if(!v(E.expires)||!Number.isFinite(E.expires.valueOf()))throw new TypeError(`option expires is invalid: ${E.expires}`);C+="; Expires="+E.expires.toUTCString()}if(E.httpOnly&&(C+="; HttpOnly"),E.secure&&(C+="; Secure"),E.partitioned&&(C+="; Partitioned"),E.priority)switch(typeof E.priority=="string"?E.priority.toLowerCase():void 0){case"low":C+="; Priority=Low";break;case"medium":C+="; Priority=Medium";break;case"high":C+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${E.priority}`)}if(E.sameSite)switch(typeof E.sameSite=="string"?E.sameSite.toLowerCase():E.sameSite){case!0:case"strict":C+="; SameSite=Strict";break;case"lax":C+="; SameSite=Lax";break;case"none":C+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${E.sameSite}`)}return C}function g(b){if(b.indexOf("%")===-1)return b;try{return decodeURIComponent(b)}catch{return b}}function v(b){return i.call(b)==="[object Date]"}return yl}AA();var db="popstate";function TA(e={}){function t(o,i){let{pathname:l,search:u,hash:f}=o.location;return Np("",{pathname:l,search:u,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){return typeof i=="string"?i:Ul(i)}return MA(t,r,null,e)}function ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function lr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RA(){return Math.random().toString(36).substring(2,10)}function fb(e,t){return{usr:e.state,key:e.key,idx:t}}function Np(e,t,r=null,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?li(t):t,state:r,key:t&&t.key||o||RA()}}function Ul({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 li(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function MA(e,t,r,o={}){let{window:i=document.defaultView,v5Compat:l=!1}=o,u=i.history,f="POP",m=null,h=g();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function g(){return(u.state||{idx:null}).idx}function v(){f="POP";let N=g(),C=N==null?null:N-h;h=N,m&&m({action:f,location:S.location,delta:C})}function b(N,C){f="PUSH";let j=Np(S.location,N,C);h=g()+1;let A=fb(j,h),M=S.createHref(j);try{u.pushState(A,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(M)}l&&m&&m({action:f,location:S.location,delta:1})}function w(N,C){f="REPLACE";let j=Np(S.location,N,C);h=g();let A=fb(j,h),M=S.createHref(j);u.replaceState(A,"",M),l&&m&&m({action:f,location:S.location,delta:0})}function E(N){return DA(N)}let S={get action(){return f},get location(){return e(i,u)},listen(N){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(db,v),m=N,()=>{i.removeEventListener(db,v),m=null}},createHref(N){return t(i,N)},createURL:E,encodeLocation(N){let C=E(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:w,go(N){return u.go(N)}};return S}function DA(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),ht(r,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:Ul(e);return o=o.replace(/ $/,"%20"),!t&&o.startsWith("//")&&(o=r+o),new URL(o,r)}function pS(e,t,r="/"){return OA(e,t,r,!1)}function OA(e,t,r,o){let i=typeof t=="string"?li(t):t,l=sa(i.pathname||"/",r);if(l==null)return null;let u=gS(e);kA(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=YA(l);f=VA(u[m],h,o)}return f}function gS(e,t=[],r=[],o=""){let i=(l,u,f)=>{let m={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};m.relativePath.startsWith("/")&&(ht(m.relativePath.startsWith(o),`Absolute route path "${m.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(o.length));let h=ra([o,m.relativePath]),g=r.concat(m);l.children&&l.children.length>0&&(ht(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),gS(l.children,t,g,h)),!(l.path==null&&!l.index)&&t.push({path:h,score:$A(h,l.index),routesMeta:g})};return e.forEach((l,u)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))i(l,u);else for(let m of vS(l.path))i(l,u,m)}),t}function vS(e){let t=e.split("/");if(t.length===0)return[];let[r,...o]=t,i=r.endsWith("?"),l=r.replace(/\?$/,"");if(o.length===0)return i?[l,""]:[l];let u=vS(o.join("/")),f=[];return f.push(...u.map(m=>m===""?l:[l,m].join("/"))),i&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function kA(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:IA(t.routesMeta.map(o=>o.childrenIndex),r.routesMeta.map(o=>o.childrenIndex)))}var zA=/^:[\w-]+$/,LA=3,PA=2,UA=1,BA=10,HA=-2,hb=e=>e==="*";function $A(e,t){let r=e.split("/"),o=r.length;return r.some(hb)&&(o+=HA),t&&(o+=PA),r.filter(i=>!hb(i)).reduce((i,l)=>i+(zA.test(l)?LA:l===""?UA:BA),o)}function IA(e,t){return e.length===t.length&&e.slice(0,-1).every((o,i)=>o===t[i])?e[e.length-1]-t[t.length-1]:0}function VA(e,t,r=!1){let{routesMeta:o}=e,i={},l="/",u=[];for(let f=0;f<o.length;++f){let m=o[f],h=f===o.length-1,g=l==="/"?t:t.slice(l.length)||"/",v=vd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},g),b=m.route;if(!v&&h&&r&&!o[o.length-1].route.index&&(v=vd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!v)return null;Object.assign(i,v.params),u.push({params:i,pathname:ra([l,v.pathname]),pathnameBase:WA(ra([l,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(l=ra([l,v.pathnameBase]))}return u}function vd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,o]=qA(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let l=i[0],u=l.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:o.reduce((h,{paramName:g,isOptional:v},b)=>{if(g==="*"){let E=f[b]||"";u=l.slice(0,l.length-E.length).replace(/(.)\/+$/,"$1")}const w=f[b];return v&&!w?h[g]=void 0:h[g]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:u,pattern:e}}function qA(e,t=!1,r=!0){lr(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 o=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m)=>(o.push({paramName:f,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(o.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),o]}function YA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return lr(!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 sa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,o=e.charAt(r);return o&&o!=="/"?null:e.slice(r)||"/"}function GA(e,t="/"){let{pathname:r,search:o="",hash:i=""}=typeof e=="string"?li(e):e;return{pathname:r?r.startsWith("/")?r:FA(r,t):t,search:KA(o),hash:ZA(i)}}function FA(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Ym(e,t,r,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}].  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 XA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function fg(e){let t=XA(e);return t.map((r,o)=>o===t.length-1?r.pathname:r.pathnameBase)}function hg(e,t,r,o=!1){let i;typeof e=="string"?i=li(e):(i={...e},ht(!i.pathname||!i.pathname.includes("?"),Ym("?","pathname","search",i)),ht(!i.pathname||!i.pathname.includes("#"),Ym("#","pathname","hash",i)),ht(!i.search||!i.search.includes("#"),Ym("#","search","hash",i)));let l=e===""||i.pathname==="",u=l?"/":i.pathname,f;if(u==null)f=r;else{let v=t.length-1;if(!o&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),v-=1;i.pathname=b.join("/")}f=v>=0?t[v]:"/"}let m=GA(i,f),h=u&&u!=="/"&&u.endsWith("/"),g=(l||u===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var ra=e=>e.join("/").replace(/\/\/+/g,"/"),WA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function QA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var yS=["POST","PUT","PATCH","DELETE"];new Set(yS);var JA=["GET",...yS];new Set(JA);var ci=x.createContext(null);ci.displayName="DataRouter";var Yd=x.createContext(null);Yd.displayName="DataRouterState";var xS=x.createContext({isTransitioning:!1});xS.displayName="ViewTransition";var eT=x.createContext(new Map);eT.displayName="Fetchers";var tT=x.createContext(null);tT.displayName="Await";var dr=x.createContext(null);dr.displayName="Navigation";var nc=x.createContext(null);nc.displayName="Location";var Yn=x.createContext({outlet:null,matches:[],isDataRoute:!1});Yn.displayName="Route";var mg=x.createContext(null);mg.displayName="RouteError";function nT(e,{relative:t}={}){ht(ui(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=x.useContext(dr),{hash:i,pathname:l,search:u}=ac(e,{relative:t}),f=l;return r!=="/"&&(f=l==="/"?r:ra([r,l])),o.createHref({pathname:f,search:u,hash:i})}function ui(){return x.useContext(nc)!=null}function ma(){return ht(ui(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(nc).location}var bS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wS(e){x.useContext(dr).static||x.useLayoutEffect(e)}function an(){let{isDataRoute:e}=x.useContext(Yn);return e?vT():rT()}function rT(){ht(ui(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(ci),{basename:t,navigator:r}=x.useContext(dr),{matches:o}=x.useContext(Yn),{pathname:i}=ma(),l=JSON.stringify(fg(o)),u=x.useRef(!1);return wS(()=>{u.current=!0}),x.useCallback((m,h={})=>{if(lr(u.current,bS),!u.current)return;if(typeof m=="number"){r.go(m);return}let g=hg(m,JSON.parse(l),i,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ra([t,g.pathname])),(h.replace?r.replace:r.push)(g,h.state,h)},[t,r,l,i,e])}var aT=x.createContext(null);function oT(e){let t=x.useContext(Yn).outlet;return t&&x.createElement(aT.Provider,{value:e},t)}function rc(){let{matches:e}=x.useContext(Yn),t=e[e.length-1];return t?t.params:{}}function ac(e,{relative:t}={}){let{matches:r}=x.useContext(Yn),{pathname:o}=ma(),i=JSON.stringify(fg(r));return x.useMemo(()=>hg(e,JSON.parse(i),o,t==="path"),[e,i,o,t])}function sT(e,t){return SS(e,t)}function SS(e,t,r,o){var j;ht(ui(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i,static:l}=x.useContext(dr),{matches:u}=x.useContext(Yn),f=u[u.length-1],m=f?f.params:{},h=f?f.pathname:"/",g=f?f.pathnameBase:"/",v=f&&f.route;{let A=v&&v.path||"";ES(h,!v||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${A}">) 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.

Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let b=ma(),w;if(t){let A=typeof t=="string"?li(t):t;ht(g==="/"||((j=A.pathname)==null?void 0:j.startsWith(g)),`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 "${g}" but pathname "${A.pathname}" was given in the \`location\` prop.`),w=A}else w=b;let E=w.pathname||"/",S=E;if(g!=="/"){let A=g.replace(/^\//,"").split("/");S="/"+E.replace(/^\//,"").split("/").slice(A.length).join("/")}let N=!l&&r&&r.matches&&r.matches.length>0?r.matches:pS(e,{pathname:S});lr(v||N!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),lr(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.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 C=dT(N&&N.map(A=>Object.assign({},A,{params:Object.assign({},m,A.params),pathname:ra([g,i.encodeLocation?i.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?g:ra([g,i.encodeLocation?i.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),u,r,o);return t&&C?x.createElement(nc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},C):C}function iT(){let e=gT(),t=QA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:l},"ErrorBoundary")," or"," ",x.createElement("code",{style:l},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),r?x.createElement("pre",{style:i},r):null,u)}var lT=x.createElement(iT,null),cT=class extends x.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){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?x.createElement(Yn.Provider,{value:this.props.routeContext},x.createElement(mg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function uT({routeContext:e,match:t,children:r}){let o=x.useContext(ci);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Yn.Provider,{value:e},r)}function dT(e,t=[],r=null,o=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 i=e,l=r==null?void 0:r.errors;if(l!=null){let m=i.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);ht(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,m+1))}let u=!1,f=-1;if(r)for(let m=0;m<i.length;m++){let h=i[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=m),h.route.id){let{loaderData:g,errors:v}=r,b=h.route.loader&&!g.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||b){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}return i.reduceRight((m,h,g)=>{let v,b=!1,w=null,E=null;r&&(v=l&&h.route.id?l[h.route.id]:void 0,w=h.route.errorElement||lT,u&&(f<0&&g===0?(ES("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,E=null):f===g&&(b=!0,E=h.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,g+1)),N=()=>{let C;return v?C=w:b?C=E:h.route.Component?C=x.createElement(h.route.Component,null):h.route.element?C=h.route.element:C=m,x.createElement(uT,{match:h,routeContext:{outlet:m,matches:S,isDataRoute:r!=null},children:C})};return r&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?x.createElement(cT,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}function pg(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function fT(e){let t=x.useContext(ci);return ht(t,pg(e)),t}function hT(e){let t=x.useContext(Yd);return ht(t,pg(e)),t}function mT(e){let t=x.useContext(Yn);return ht(t,pg(e)),t}function gg(e){let t=mT(e),r=t.matches[t.matches.length-1];return ht(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function pT(){return gg("useRouteId")}function gT(){var o;let e=x.useContext(mg),t=hT("useRouteError"),r=gg("useRouteError");return e!==void 0?e:(o=t.errors)==null?void 0:o[r]}function vT(){let{router:e}=fT("useNavigate"),t=gg("useNavigate"),r=x.useRef(!1);return wS(()=>{r.current=!0}),x.useCallback(async(i,l={})=>{lr(r.current,bS),r.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var mb={};function ES(e,t,r){!t&&!mb[e]&&(mb[e]=!0,lr(!1,r))}x.memo(yT);function yT({routes:e,future:t,state:r}){return SS(e,void 0,r,t)}function NS({to:e,replace:t,state:r,relative:o}){ht(ui(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=x.useContext(dr);lr(!i,"<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:l}=x.useContext(Yn),{pathname:u}=ma(),f=an(),m=hg(e,fg(l),u,o==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:r,relative:o})},[f,h,o,t,r]),null}function xT(e){return oT(e.context)}function $t(e){ht(!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 bT({basename:e="/",children:t=null,location:r,navigationType:o="POP",navigator:i,static:l=!1}){ht(!ui(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=x.useMemo(()=>({basename:u,navigator:i,static:l,future:{}}),[u,i,l]);typeof r=="string"&&(r=li(r));let{pathname:m="/",search:h="",hash:g="",state:v=null,key:b="default"}=r,w=x.useMemo(()=>{let E=sa(m,u);return E==null?null:{location:{pathname:E,search:h,hash:g,state:v,key:b},navigationType:o}},[u,m,h,g,v,b,o]);return lr(w!=null,`<Router basename="${u}"> is not able to match the URL "${m}${h}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(dr.Provider,{value:f},x.createElement(nc.Provider,{children:t,value:w}))}function wT({children:e,location:t}){return sT(Cp(e),t)}function Cp(e,t=[]){let r=[];return x.Children.forEach(e,(o,i)=>{if(!x.isValidElement(o))return;let l=[...t,i];if(o.type===x.Fragment){r.push.apply(r,Cp(o.props.children,l));return}ht(o.type===$t,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!o.props.index||!o.props.children,"An index route cannot have child routes.");let u={id:o.props.id||l.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(u.children=Cp(o.props.children,l)),r.push(u)}),r}var rd="get",ad="application/x-www-form-urlencoded";function Gd(e){return e!=null&&typeof e.tagName=="string"}function ST(e){return Gd(e)&&e.tagName.toLowerCase()==="button"}function ET(e){return Gd(e)&&e.tagName.toLowerCase()==="form"}function NT(e){return Gd(e)&&e.tagName.toLowerCase()==="input"}function CT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jT(e,t){return e.button===0&&(!t||t==="_self")&&!CT(e)}var Pu=null;function _T(){if(Pu===null)try{new FormData(document.createElement("form"),0),Pu=!1}catch{Pu=!0}return Pu}var AT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gm(e){return e!=null&&!AT.has(e)?(lr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ad}"`),null):e}function TT(e,t){let r,o,i,l,u;if(ET(e)){let f=e.getAttribute("action");o=f?sa(f,t):null,r=e.getAttribute("method")||rd,i=Gm(e.getAttribute("enctype"))||ad,l=new FormData(e)}else if(ST(e)||NT(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 m=e.getAttribute("formaction")||f.getAttribute("action");if(o=m?sa(m,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||rd,i=Gm(e.getAttribute("formenctype"))||Gm(f.getAttribute("enctype"))||ad,l=new FormData(f,e),!_T()){let{name:h,type:g,value:v}=e;if(g==="image"){let b=h?`${h}.`:"";l.append(`${b}x`,"0"),l.append(`${b}y`,"0")}else h&&l.append(h,v)}}else{if(Gd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=rd,o=null,i=ad,u=e}return l&&i==="text/plain"&&(u=l,l=void 0),{action:o,method:r.toLowerCase(),encType:i,formData:l,body:u}}function vg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function RT(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 MT(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 DT(e,t,r){let o=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let u=await RT(l,r);return u.links?u.links():[]}return[]}));return LT(o.flat(1).filter(MT).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function pb(e,t,r,o,i,l){let u=(m,h)=>r[h]?m.route.id!==r[h].route.id:!0,f=(m,h)=>{var g;return r[h].pathname!==m.pathname||((g=r[h].route.path)==null?void 0:g.endsWith("*"))&&r[h].params["*"]!==m.params["*"]};return l==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):l==="data"?t.filter((m,h)=>{var v;let g=o.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((v=r[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function OT(e,t,{includeHydrateFallback:r}={}){return kT(e.map(o=>{let i=t.routes[o.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function kT(e){return[...new Set(e)]}function zT(e){let t={},r=Object.keys(e).sort();for(let o of r)t[o]=e[o];return t}function LT(e,t){let r=new Set;return new Set(t),e.reduce((o,i)=>{let l=JSON.stringify(zT(i));return r.has(l)||(r.add(l),o.push({key:l,link:i})),o},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var PT=new Set([100,101,204,205]);function UT(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":t&&sa(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function CS(){let e=x.useContext(ci);return vg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function BT(){let e=x.useContext(Yd);return vg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var yg=x.createContext(void 0);yg.displayName="FrameworkContext";function jS(){let e=x.useContext(yg);return vg(e,"You must render this element inside a <HydratedRouter> element"),e}function HT(e,t){let r=x.useContext(yg),[o,i]=x.useState(!1),[l,u]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:v}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let S=C=>{C.forEach(j=>{u(j.isIntersecting)})},N=new IntersectionObserver(S,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[e]),x.useEffect(()=>{if(o){let S=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(S)}}},[o]);let w=()=>{i(!0)},E=()=>{i(!1),u(!1)};return r?e!=="intent"?[l,b,{}]:[l,b,{onFocus:xl(f,w),onBlur:xl(m,E),onMouseEnter:xl(h,w),onMouseLeave:xl(g,E),onTouchStart:xl(v,w)}]:[!1,b,{}]}function xl(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function $T({page:e,...t}){let{router:r}=CS(),o=x.useMemo(()=>pS(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?x.createElement(VT,{page:e,matches:o,...t}):null}function IT(e){let{manifest:t,routeModules:r}=jS(),[o,i]=x.useState([]);return x.useEffect(()=>{let l=!1;return DT(e,t,r).then(u=>{l||i(u)}),()=>{l=!0}},[e,t,r]),o}function VT({page:e,matches:t,...r}){let o=ma(),{manifest:i,routeModules:l}=jS(),{basename:u}=CS(),{loaderData:f,matches:m}=BT(),h=x.useMemo(()=>pb(e,t,m,i,o,"data"),[e,t,m,i,o]),g=x.useMemo(()=>pb(e,t,m,i,o,"assets"),[e,t,m,i,o]),v=x.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let E=new Set,S=!1;if(t.forEach(C=>{var A;let j=i.routes[C.route.id];!j||!j.hasLoader||(!h.some(M=>M.route.id===C.route.id)&&C.route.id in f&&((A=l[C.route.id])!=null&&A.shouldRevalidate)||j.hasClientLoader?S=!0:E.add(C.route.id))}),E.size===0)return[];let N=UT(e,u);return S&&E.size>0&&N.searchParams.set("_routes",t.filter(C=>E.has(C.route.id)).map(C=>C.route.id).join(",")),[N.pathname+N.search]},[u,f,o,i,h,t,e,l]),b=x.useMemo(()=>OT(g,i),[g,i]),w=IT(g);return x.createElement(x.Fragment,null,v.map(E=>x.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),b.map(E=>x.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),w.map(({key:E,link:S})=>x.createElement("link",{key:E,...S})))}function qT(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var _S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_S&&(window.__reactRouterVersion="7.6.0")}catch{}function YT({basename:e,children:t,window:r}){let o=x.useRef();o.current==null&&(o.current=TA({window:r,v5Compat:!0}));let i=o.current,[l,u]=x.useState({action:i.action,location:i.location}),f=x.useCallback(m=>{x.startTransition(()=>u(m))},[u]);return x.useLayoutEffect(()=>i.listen(f),[i,f]),x.createElement(bT,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i})}var AS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Za=x.forwardRef(function({onClick:t,discover:r="render",prefetch:o="none",relative:i,reloadDocument:l,replace:u,state:f,target:m,to:h,preventScrollReset:g,viewTransition:v,...b},w){let{basename:E}=x.useContext(dr),S=typeof h=="string"&&AS.test(h),N,C=!1;if(typeof h=="string"&&S&&(N=h,_S))try{let P=new URL(window.location.href),z=h.startsWith("//")?new URL(P.protocol+h):new URL(h),F=sa(z.pathname,E);z.origin===P.origin&&F!=null?h=F+z.search+z.hash:C=!0}catch{lr(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let j=nT(h,{relative:i}),[A,M,O]=HT(o,b),U=WT(h,{replace:u,state:f,target:m,preventScrollReset:g,relative:i,viewTransition:v});function H(P){t&&t(P),P.defaultPrevented||U(P)}let V=x.createElement("a",{...b,...O,href:N||j,onClick:C||l?t:H,ref:qT(w,M),target:m,"data-discover":!S&&r==="render"?"true":void 0});return A&&!S?x.createElement(x.Fragment,null,V,x.createElement($T,{page:j})):V});Za.displayName="Link";var GT=x.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:o="",end:i=!1,style:l,to:u,viewTransition:f,children:m,...h},g){let v=ac(u,{relative:h.relative}),b=ma(),w=x.useContext(Yd),{navigator:E,basename:S}=x.useContext(dr),N=w!=null&&eR(v)&&f===!0,C=E.encodeLocation?E.encodeLocation(v).pathname:v.pathname,j=b.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(j=j.toLowerCase(),A=A?A.toLowerCase():null,C=C.toLowerCase()),A&&S&&(A=sa(A,S)||A);const M=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let O=j===C||!i&&j.startsWith(C)&&j.charAt(M)==="/",U=A!=null&&(A===C||!i&&A.startsWith(C)&&A.charAt(C.length)==="/"),H={isActive:O,isPending:U,isTransitioning:N},V=O?t:void 0,P;typeof o=="function"?P=o(H):P=[o,O?"active":null,U?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let z=typeof l=="function"?l(H):l;return x.createElement(Za,{...h,"aria-current":V,className:P,ref:g,style:z,to:u,viewTransition:f},typeof m=="function"?m(H):m)});GT.displayName="NavLink";var FT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:o,replace:i,state:l,method:u=rd,action:f,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:v,...b},w)=>{let E=QT(),S=JT(f,{relative:h}),N=u.toLowerCase()==="get"?"get":"post",C=typeof f=="string"&&AS.test(f),j=A=>{if(m&&m(A),A.defaultPrevented)return;A.preventDefault();let M=A.nativeEvent.submitter,O=(M==null?void 0:M.getAttribute("formmethod"))||u;E(M||A.currentTarget,{fetcherKey:t,method:O,navigate:r,replace:i,state:l,relative:h,preventScrollReset:g,viewTransition:v})};return x.createElement("form",{ref:w,method:N,action:S,onSubmit:o?m:j,...b,"data-discover":!C&&e==="render"?"true":void 0})});FT.displayName="Form";function XT(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function TS(e){let t=x.useContext(ci);return ht(t,XT(e)),t}function WT(e,{target:t,replace:r,state:o,preventScrollReset:i,relative:l,viewTransition:u}={}){let f=an(),m=ma(),h=ac(e,{relative:l});return x.useCallback(g=>{if(jT(g,t)){g.preventDefault();let v=r!==void 0?r:Ul(m)===Ul(h);f(e,{replace:v,state:o,preventScrollReset:i,relative:l,viewTransition:u})}},[m,f,h,r,o,t,e,i,l,u])}var KT=0,ZT=()=>`__${String(++KT)}__`;function QT(){let{router:e}=TS("useSubmit"),{basename:t}=x.useContext(dr),r=pT();return x.useCallback(async(o,i={})=>{let{action:l,method:u,encType:f,formData:m,body:h}=TT(o,t);if(i.navigate===!1){let g=i.fetcherKey||ZT();await e.fetch(g,r,i.action||l,{preventScrollReset:i.preventScrollReset,formData:m,body:h,formMethod:i.method||u,formEncType:i.encType||f,flushSync:i.flushSync})}else await e.navigate(i.action||l,{preventScrollReset:i.preventScrollReset,formData:m,body:h,formMethod:i.method||u,formEncType:i.encType||f,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,r])}function JT(e,{relative:t}={}){let{basename:r}=x.useContext(dr),o=x.useContext(Yn);ht(o,"useFormAction must be used inside a RouteContext");let[i]=o.matches.slice(-1),l={...ac(e||".",{relative:t})},u=ma();if(e==null){l.search=u.search;let f=new URLSearchParams(l.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(v=>v).forEach(v=>f.append("index",v));let g=f.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:ra([r,l.pathname])),Ul(l)}function eR(e,t={}){let r=x.useContext(xS);ht(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=TS("useViewTransitionState"),i=ac(e,{relative:t.relative});if(!r.isTransitioning)return!1;let l=sa(r.currentLocation.pathname,o)||r.currentLocation.pathname,u=sa(r.nextLocation.pathname,o)||r.nextLocation.pathname;return vd(i.pathname,u)!=null||vd(i.pathname,l)!=null}[...PT];function tR(){return d.jsx(NS,{to:"/dashboard"})}function ve(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function nR(e,t){const r=x.createContext(t),o=l=>{const{children:u,...f}=l,m=x.useMemo(()=>f,Object.values(f));return d.jsx(r.Provider,{value:m,children:u})};o.displayName=e+"Provider";function i(l){const u=x.useContext(r);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[o,i]}function fr(e,t=[]){let r=[];function o(l,u){const f=x.createContext(u),m=r.length;r=[...r,u];const h=v=>{var C;const{scope:b,children:w,...E}=v,S=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,N=x.useMemo(()=>E,Object.values(E));return d.jsx(S.Provider,{value:N,children:w})};h.displayName=l+"Provider";function g(v,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[m])||f,E=x.useContext(w);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[h,g]}const i=()=>{const l=r.map(u=>x.createContext(u));return function(f){const m=(f==null?void 0:f[e])||l;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return i.scopeName=e,[o,rR(i,...t)]}function rR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const u=o.reduce((f,{useScope:m,scopeName:h})=>{const v=m(l)[`__scope${h}`];return{...f,...v}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function gb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xg(...e){return t=>{let r=!1;const o=e.map(i=>{const l=gb(i,t);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let i=0;i<o.length;i++){const l=o[i];typeof l=="function"?l():gb(e[i],null)}}}}function qe(...e){return x.useCallback(xg(...e),e)}function $o(e){const t=aR(e),r=x.forwardRef((o,i)=>{const{children:l,...u}=o,f=x.Children.toArray(l),m=f.find(sR);if(m){const h=m.props.children,g=f.map(v=>v===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:v);return d.jsx(t,{...u,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,g):null})}return d.jsx(t,{...u,ref:i,children:l})});return r.displayName=`${e}.Slot`,r}var RS=$o("Slot");function aR(e){const t=x.forwardRef((r,o)=>{const{children:i,...l}=r,u=x.isValidElement(i)?lR(i):void 0,f=qe(u,o);if(x.isValidElement(i)){const m=iR(l,i.props);return i.type!==x.Fragment&&(m.ref=f),x.cloneElement(i,m)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oR=Symbol("radix.slottable");function sR(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oR}function iR(e,t){const r={...t};for(const o in t){const i=e[o],l=t[o];/^on[A-Z]/.test(o)?i&&l?r[o]=(...f)=>{const m=l(...f);return i(...f),m}:i&&(r[o]=i):o==="style"?r[o]={...i,...l}:o==="className"&&(r[o]=[i,l].filter(Boolean).join(" "))}return{...e,...r}}function lR(e){var o,i;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function bg(e){const t=e+"CollectionProvider",[r,o]=fr(t),[i,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=S=>{const{scope:N,children:C}=S,j=ae.useRef(null),A=ae.useRef(new Map).current;return d.jsx(i,{scope:N,itemMap:A,collectionRef:j,children:C})};u.displayName=t;const f=e+"CollectionSlot",m=$o(f),h=ae.forwardRef((S,N)=>{const{scope:C,children:j}=S,A=l(f,C),M=qe(N,A.collectionRef);return d.jsx(m,{ref:M,children:j})});h.displayName=f;const g=e+"CollectionItemSlot",v="data-radix-collection-item",b=$o(g),w=ae.forwardRef((S,N)=>{const{scope:C,children:j,...A}=S,M=ae.useRef(null),O=qe(N,M),U=l(g,C);return ae.useEffect(()=>(U.itemMap.set(M,{ref:M,...A}),()=>void U.itemMap.delete(M))),d.jsx(b,{[v]:"",ref:O,children:j})});w.displayName=g;function E(S){const N=l(e+"CollectionConsumer",S);return ae.useCallback(()=>{const j=N.collectionRef.current;if(!j)return[];const A=Array.from(j.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((U,H)=>A.indexOf(U.ref.current)-A.indexOf(H.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:u,Slot:h,ItemSlot:w},E,o]}var Mt=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},cR=hS[" useId ".trim().toString()]||(()=>{}),uR=0;function Er(e){const[t,r]=x.useState(cR());return Mt(()=>{r(o=>o??String(uR++))},[e]),e||(t?`radix-${t}`:"")}var oc=mS();const dR=dg(oc);var fR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=fR.reduce((e,t)=>{const r=$o(`Primitive.${t}`),o=x.forwardRef((i,l)=>{const{asChild:u,...f}=i,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:l})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function MS(e,t){e&&oc.flushSync(()=>e.dispatchEvent(t))}function It(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}var hR=hS[" useInsertionEffect ".trim().toString()]||Mt;function Io({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[i,l,u]=mR({defaultProp:t,onChange:r}),f=e!==void 0,m=f?e:i;{const g=x.useRef(e!==void 0);x.useEffect(()=>{const v=g.current;v!==f&&console.warn(`${o} is changing from ${v?"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.`),g.current=f},[f,o])}const h=x.useCallback(g=>{var v;if(f){const b=pR(g)?g(e):g;b!==e&&((v=u.current)==null||v.call(u,b))}else l(g)},[f,e,l,u]);return[m,h]}function mR({defaultProp:e,onChange:t}){const[r,o]=x.useState(e),i=x.useRef(r),l=x.useRef(t);return hR(()=>{l.current=t},[t]),x.useEffect(()=>{var u;i.current!==r&&((u=l.current)==null||u.call(l,r),i.current=r)},[r,i]),[r,o,l]}function pR(e){return typeof e=="function"}var gR=x.createContext(void 0);function sc(e){const t=x.useContext(gR);return e||t||"ltr"}var Fm="rovingFocusGroup.onEntryFocus",vR={bubbles:!1,cancelable:!0},ic="RovingFocusGroup",[jp,DS,yR]=bg(ic),[xR,Fd]=fr(ic,[yR]),[bR,wR]=xR(ic),OS=x.forwardRef((e,t)=>d.jsx(jp.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(jp.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(SR,{...e,ref:t})})}));OS.displayName=ic;var SR=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:i=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...v}=e,b=x.useRef(null),w=qe(t,b),E=sc(l),[S,N]=Io({prop:u,defaultProp:f??null,onChange:m,caller:ic}),[C,j]=x.useState(!1),A=It(h),M=DS(r),O=x.useRef(!1),[U,H]=x.useState(0);return x.useEffect(()=>{const V=b.current;if(V)return V.addEventListener(Fm,A),()=>V.removeEventListener(Fm,A)},[A]),d.jsx(bR,{scope:r,orientation:o,dir:E,loop:i,currentTabStopId:S,onItemFocus:x.useCallback(V=>N(V),[N]),onItemShiftTab:x.useCallback(()=>j(!0),[]),onFocusableItemAdd:x.useCallback(()=>H(V=>V+1),[]),onFocusableItemRemove:x.useCallback(()=>H(V=>V-1),[]),children:d.jsx(Ae.div,{tabIndex:C||U===0?-1:0,"data-orientation":o,...v,ref:w,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{O.current=!0}),onFocus:ve(e.onFocus,V=>{const P=!O.current;if(V.target===V.currentTarget&&P&&!C){const z=new CustomEvent(Fm,vR);if(V.currentTarget.dispatchEvent(z),!z.defaultPrevented){const F=M().filter(D=>D.focusable),K=F.find(D=>D.active),te=F.find(D=>D.id===S),Y=[K,te,...F].filter(Boolean).map(D=>D.ref.current);LS(Y,g)}}O.current=!1}),onBlur:ve(e.onBlur,()=>j(!1))})})}),kS="RovingFocusGroupItem",zS=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:i=!1,tabStopId:l,children:u,...f}=e,m=Er(),h=l||m,g=wR(kS,r),v=g.currentTabStopId===h,b=DS(r),{onFocusableItemAdd:w,onFocusableItemRemove:E,currentTabStopId:S}=g;return x.useEffect(()=>{if(o)return w(),()=>E()},[o,w,E]),d.jsx(jp.ItemSlot,{scope:r,id:h,focusable:o,active:i,children:d.jsx(Ae.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:t,onMouseDown:ve(e.onMouseDown,N=>{o?g.onItemFocus(h):N.preventDefault()}),onFocus:ve(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:ve(e.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){g.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const C=CR(N,g.orientation,g.dir);if(C!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let A=b().filter(M=>M.focusable).map(M=>M.ref.current);if(C==="last")A.reverse();else if(C==="prev"||C==="next"){C==="prev"&&A.reverse();const M=A.indexOf(N.currentTarget);A=g.loop?jR(A,M+1):A.slice(M+1)}setTimeout(()=>LS(A))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:S!=null}):u})})});zS.displayName=kS;var ER={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function NR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function CR(e,t,r){const o=NR(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ER[o]}function LS(e,t=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function jR(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var PS=OS,US=zS;function _R(e,t){return x.useReducer((r,o)=>t[r][o]??r,e)}var vn=e=>{const{present:t,children:r}=e,o=AR(t),i=typeof r=="function"?r({present:o.isPresent}):x.Children.only(r),l=qe(o.ref,TR(i));return typeof r=="function"||o.isPresent?x.cloneElement(i,{ref:l}):null};vn.displayName="Presence";function AR(e){const[t,r]=x.useState(),o=x.useRef(null),i=x.useRef(e),l=x.useRef("none"),u=e?"mounted":"unmounted",[f,m]=_R(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Uu(o.current);l.current=f==="mounted"?h:"none"},[f]),Mt(()=>{const h=o.current,g=i.current;if(g!==e){const b=l.current,w=Uu(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(g&&b!==w?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,m]),Mt(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,v=w=>{const S=Uu(o.current).includes(w.animationName);if(w.target===t&&S&&(m("ANIMATION_END"),!i.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},b=w=>{w.target===t&&(l.current=Uu(o.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{o.current=h?getComputedStyle(h):null,r(h)},[])}}function Uu(e){return(e==null?void 0:e.animationName)||"none"}function TR(e){var o,i;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Xd="Tabs",[RR,WI]=fr(Xd,[Fd]),BS=Fd(),[MR,wg]=RR(Xd),HS=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:l,orientation:u="horizontal",dir:f,activationMode:m="automatic",...h}=e,g=sc(f),[v,b]=Io({prop:o,onChange:i,defaultProp:l??"",caller:Xd});return d.jsx(MR,{scope:r,baseId:Er(),value:v,onValueChange:b,orientation:u,dir:g,activationMode:m,children:d.jsx(Ae.div,{dir:g,"data-orientation":u,...h,ref:t})})});HS.displayName=Xd;var $S="TabsList",IS=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,l=wg($S,r),u=BS(r);return d.jsx(PS,{asChild:!0,...u,orientation:l.orientation,dir:l.dir,loop:o,children:d.jsx(Ae.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:t})})});IS.displayName=$S;var VS="TabsTrigger",qS=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...l}=e,u=wg(VS,r),f=BS(r),m=FS(u.baseId,o),h=XS(u.baseId,o),g=o===u.value;return d.jsx(US,{asChild:!0,...f,focusable:!i,active:g,children:d.jsx(Ae.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":h,"data-state":g?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:m,...l,ref:t,onMouseDown:ve(e.onMouseDown,v=>{!i&&v.button===0&&v.ctrlKey===!1?u.onValueChange(o):v.preventDefault()}),onKeyDown:ve(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&u.onValueChange(o)}),onFocus:ve(e.onFocus,()=>{const v=u.activationMode!=="manual";!g&&!i&&v&&u.onValueChange(o)})})})});qS.displayName=VS;var YS="TabsContent",GS=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,forceMount:i,children:l,...u}=e,f=wg(YS,r),m=FS(f.baseId,o),h=XS(f.baseId,o),g=o===f.value,v=x.useRef(g);return x.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(vn,{present:i||g,children:({present:b})=>d.jsx(Ae.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":m,hidden:!b,id:h,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:v.current?"0s":void 0},children:b&&l})})});GS.displayName=YS;function FS(e,t){return`${e}-trigger-${t}`}function XS(e,t){return`${e}-content-${t}`}var DR=HS,OR=IS,kR=qS,zR=GS;function WS(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=WS(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function KS(){for(var e,t,r=0,o="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=WS(e))&&(o&&(o+=" "),o+=t);return o}const Sg="-",LR=e=>{const t=UR(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:u=>{const f=u.split(Sg);return f[0]===""&&f.length!==1&&f.shift(),ZS(f,t)||PR(u)},getConflictingClassGroupIds:(u,f)=>{const m=r[u]||[];return f&&o[u]?[...m,...o[u]]:m}}},ZS=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),i=o?ZS(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;const l=e.join(Sg);return(u=t.validators.find(({validator:f})=>f(l)))==null?void 0:u.classGroupId},vb=/^\[(.+)\]$/,PR=e=>{if(vb.test(e)){const t=vb.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},UR=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const i in r)_p(r[i],o,i,t);return o},_p=(e,t,r,o)=>{e.forEach(i=>{if(typeof i=="string"){const l=i===""?t:yb(t,i);l.classGroupId=r;return}if(typeof i=="function"){if(BR(i)){_p(i(o),t,r,o);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([l,u])=>{_p(u,yb(t,l),r,o)})})},yb=(e,t)=>{let r=e;return t.split(Sg).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},BR=e=>e.isThemeGetter,HR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const i=(l,u)=>{r.set(l,u),t++,t>e&&(t=0,o=r,r=new Map)};return{get(l){let u=r.get(l);if(u!==void 0)return u;if((u=o.get(l))!==void 0)return i(l,u),u},set(l,u){r.has(l)?r.set(l,u):i(l,u)}}},Ap="!",Tp=":",$R=Tp.length,IR=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=i=>{const l=[];let u=0,f=0,m=0,h;for(let E=0;E<i.length;E++){let S=i[E];if(u===0&&f===0){if(S===Tp){l.push(i.slice(m,E)),m=E+$R;continue}if(S==="/"){h=E;continue}}S==="["?u++:S==="]"?u--:S==="("?f++:S===")"&&f--}const g=l.length===0?i:i.substring(m),v=VR(g),b=v!==g,w=h&&h>m?h-m:void 0;return{modifiers:l,hasImportantModifier:b,baseClassName:v,maybePostfixModifierPosition:w}};if(t){const i=t+Tp,l=o;o=u=>u.startsWith(i)?l(u.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:u,maybePostfixModifierPosition:void 0}}if(r){const i=o;o=l=>r({className:l,parseClassName:i})}return o},VR=e=>e.endsWith(Ap)?e.substring(0,e.length-1):e.startsWith(Ap)?e.substring(1):e,qR=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const i=[];let l=[];return o.forEach(u=>{u[0]==="["||t[u]?(i.push(...l.sort(),u),l=[]):l.push(u)}),i.push(...l.sort()),i}},YR=e=>({cache:HR(e.cacheSize),parseClassName:IR(e),sortModifiers:qR(e),...LR(e)}),GR=/\s+/,FR=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:l}=t,u=[],f=e.trim().split(GR);let m="";for(let h=f.length-1;h>=0;h-=1){const g=f[h],{isExternal:v,modifiers:b,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:S}=r(g);if(v){m=g+(m.length>0?" "+m:m);continue}let N=!!S,C=o(N?E.substring(0,S):E);if(!C){if(!N){m=g+(m.length>0?" "+m:m);continue}if(C=o(E),!C){m=g+(m.length>0?" "+m:m);continue}N=!1}const j=l(b).join(":"),A=w?j+Ap:j,M=A+C;if(u.includes(M))continue;u.push(M);const O=i(C,N);for(let U=0;U<O.length;++U){const H=O[U];u.push(A+H)}m=g+(m.length>0?" "+m:m)}return m};function XR(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=QS(t))&&(o&&(o+=" "),o+=r);return o}const QS=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=QS(e[o]))&&(r&&(r+=" "),r+=t);return r};function WR(e,...t){let r,o,i,l=u;function u(m){const h=t.reduce((g,v)=>v(g),e());return r=YR(h),o=r.cache.get,i=r.cache.set,l=f,f(m)}function f(m){const h=o(m);if(h)return h;const g=FR(m,r);return i(m,g),g}return function(){return l(XR.apply(null,arguments))}}const kt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},JS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,e1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KR=/^\d+\/\d+$/,ZR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QR=/\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$/,JR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,eM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hs=e=>KR.test(e),Ue=e=>!!e&&!Number.isNaN(Number(e)),Ya=e=>!!e&&Number.isInteger(Number(e)),Xm=e=>e.endsWith("%")&&Ue(e.slice(0,-1)),Jr=e=>ZR.test(e),nM=()=>!0,rM=e=>QR.test(e)&&!JR.test(e),t1=()=>!1,aM=e=>eM.test(e),oM=e=>tM.test(e),sM=e=>!xe(e)&&!be(e),iM=e=>di(e,a1,t1),xe=e=>JS.test(e),Mo=e=>di(e,o1,rM),Wm=e=>di(e,fM,Ue),xb=e=>di(e,n1,t1),lM=e=>di(e,r1,oM),Bu=e=>di(e,s1,aM),be=e=>e1.test(e),bl=e=>fi(e,o1),cM=e=>fi(e,hM),bb=e=>fi(e,n1),uM=e=>fi(e,a1),dM=e=>fi(e,r1),Hu=e=>fi(e,s1,!0),di=(e,t,r)=>{const o=JS.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},fi=(e,t,r=!1)=>{const o=e1.exec(e);return o?o[1]?t(o[1]):r:!1},n1=e=>e==="position"||e==="percentage",r1=e=>e==="image"||e==="url",a1=e=>e==="length"||e==="size"||e==="bg-size",o1=e=>e==="length",fM=e=>e==="number",hM=e=>e==="family-name",s1=e=>e==="shadow",mM=()=>{const e=kt("color"),t=kt("font"),r=kt("text"),o=kt("font-weight"),i=kt("tracking"),l=kt("leading"),u=kt("breakpoint"),f=kt("container"),m=kt("spacing"),h=kt("radius"),g=kt("shadow"),v=kt("inset-shadow"),b=kt("text-shadow"),w=kt("drop-shadow"),E=kt("blur"),S=kt("perspective"),N=kt("aspect"),C=kt("ease"),j=kt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...M(),be,xe],U=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],V=()=>[be,xe,m],P=()=>[Hs,"full","auto",...V()],z=()=>[Ya,"none","subgrid",be,xe],F=()=>["auto",{span:["full",Ya,be,xe]},Ya,be,xe],K=()=>[Ya,"auto",be,xe],te=()=>["auto","min","max","fr",be,xe],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...V()],q=()=>[Hs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],B=()=>[e,be,xe],L=()=>[...M(),bb,xb,{position:[be,xe]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",uM,iM,{size:[be,xe]}],X=()=>[Xm,bl,Mo],Z=()=>["","none","full",h,be,xe],re=()=>["",Ue,bl,Mo],fe=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Ue,Xm,bb,xb],me=()=>["","none",E,be,xe],pe=()=>["none",Ue,be,xe],ge=()=>["none",Ue,be,xe],Ee=()=>[Ue,be,xe],Se=()=>[Hs,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jr],breakpoint:[Jr],color:[nM],container:[Jr],"drop-shadow":[Jr],ease:["in","out","in-out"],font:[sM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jr],shadow:[Jr],spacing:["px",Ue],text:[Jr],"text-shadow":[Jr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hs,xe,be,N]}],container:["container"],columns:[{columns:[Ue,xe,be,f]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:O()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ya,"auto",be,xe]}],basis:[{basis:[Hs,"full","auto",f,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ue,Hs,"auto","initial","none",xe]}],grow:[{grow:["",Ue,be,xe]}],shrink:[{shrink:["",Ue,be,xe]}],order:[{order:[Ya,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[f,"screen",...q()]}],"min-w":[{"min-w":[f,"screen","none",...q()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...q()]}],h:[{h:["screen",...q()]}],"min-h":[{"min-h":["screen","none",...q()]}],"max-h":[{"max-h":["screen",...q()]}],"font-size":[{text:["base",r,bl,Mo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,be,Wm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xm,xe]}],"font-family":[{font:[cM,xe,t]}],"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:[i,be,xe]}],"line-clamp":[{"line-clamp":[Ue,"none",be,Wm]}],leading:[{leading:[l,...V()]}],"list-image":[{"list-image":["none",be,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ue,"from-font","auto",be,Mo]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ue,"auto",be,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,xe]}],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",be,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ya,be,xe],radial:["",be,xe],conic:[Ya,be,xe]},dM,lM]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ue,be,xe]}],"outline-w":[{outline:["",Ue,bl,Mo]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,Hu,Bu]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",v,Hu,Bu]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ue,Mo]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",b,Hu,Bu]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ue,be,xe]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[Ue]}],"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":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"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":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"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":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"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":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"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":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"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":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"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":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"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":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[Ue]}],"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":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:me()}],brightness:[{brightness:[Ue,be,xe]}],contrast:[{contrast:[Ue,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",w,Hu,Bu]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ue,be,xe]}],"hue-rotate":[{"hue-rotate":[Ue,be,xe]}],invert:[{invert:["",Ue,be,xe]}],saturate:[{saturate:[Ue,be,xe]}],sepia:[{sepia:["",Ue,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[Ue,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Ue,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ue,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ue,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Ue,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Ue,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Ue,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ue,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ue,"initial",be,xe]}],ease:[{ease:["linear","initial",C,be,xe]}],delay:[{delay:[Ue,be,xe]}],animate:[{animate:["none",j,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,xe]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",be,xe]}],"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":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,xe]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ue,bl,Mo,Wm]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},pM=WR(mM);function Me(...e){return pM(KS(e))}function Wd({className:e,...t}){return d.jsx(DR,{"data-slot":"tabs",className:Me("flex flex-col gap-2",e),...t})}function Kd({className:e,...t}){return d.jsx(OR,{"data-slot":"tabs-list",className:Me("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Vo({className:e,...t}){return d.jsx(kR,{"data-slot":"tabs-trigger",className:Me("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground 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-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function qo({className:e,...t}){return d.jsx(zR,{"data-slot":"tabs-content",className:Me("flex-1 outline-none",e),...t})}function Et({className:e,...t}){return d.jsx("div",{"data-slot":"card",className:Me("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function fn({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:Me("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function hn({className:e,...t}){return d.jsx("div",{"data-slot":"card-title",className:Me("leading-none font-semibold",e),...t})}function Yo({className:e,...t}){return d.jsx("div",{"data-slot":"card-description",className:Me("text-muted-foreground text-sm",e),...t})}function Nt({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:Me("px-6",e),...t})}function hi({className:e,...t}){return d.jsx("div",{"data-slot":"card-footer",className:Me("flex items-center px-6 [.border-t]:pt-6",e),...t})}function eo({className:e,...t}){return d.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:d.jsx("table",{"data-slot":"table",className:Me("w-full caption-bottom text-sm",e),...t})})}function to({className:e,...t}){return d.jsx("thead",{"data-slot":"table-header",className:Me("[&_tr]:border-b",e),...t})}function no({className:e,...t}){return d.jsx("tbody",{"data-slot":"table-body",className:Me("[&_tr:last-child]:border-0",e),...t})}function yt({className:e,...t}){return d.jsx("tr",{"data-slot":"table-row",className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Be({className:e,...t}){return d.jsx("th",{"data-slot":"table-head",className:Me("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 De({className:e,...t}){return d.jsx("td",{"data-slot":"table-cell",className:Me("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Rp(e,[t,r]){return Math.min(r,Math.max(t,e))}function gM(e,t=globalThis==null?void 0:globalThis.document){const r=It(e);x.useEffect(()=>{const o=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var vM="DismissableLayer",Mp="dismissableLayer.update",yM="dismissableLayer.pointerDownOutside",xM="dismissableLayer.focusOutside",wb,i1=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:u,onDismiss:f,...m}=e,h=x.useContext(i1),[g,v]=x.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=x.useState({}),E=qe(t,H=>v(H)),S=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(N),j=g?S.indexOf(g):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,M=j>=C,O=SM(H=>{const V=H.target,P=[...h.branches].some(z=>z.contains(V));!M||P||(i==null||i(H),u==null||u(H),H.defaultPrevented||f==null||f())},b),U=EM(H=>{const V=H.target;[...h.branches].some(z=>z.contains(V))||(l==null||l(H),u==null||u(H),H.defaultPrevented||f==null||f())},b);return gM(H=>{j===h.layers.size-1&&(o==null||o(H),!H.defaultPrevented&&f&&(H.preventDefault(),f()))},b),x.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(wb=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),Sb(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=wb)}},[g,b,r,h]),x.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),Sb())},[g,h]),x.useEffect(()=>{const H=()=>w({});return document.addEventListener(Mp,H),()=>document.removeEventListener(Mp,H)},[]),d.jsx(Ae.div,{...m,ref:E,style:{pointerEvents:A?M?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,U.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,U.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,O.onPointerDownCapture)})});Zd.displayName=vM;var bM="DismissableLayerBranch",wM=x.forwardRef((e,t)=>{const r=x.useContext(i1),o=x.useRef(null),i=qe(t,o);return x.useEffect(()=>{const l=o.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),d.jsx(Ae.div,{...e,ref:i})});wM.displayName=bM;function SM(e,t=globalThis==null?void 0:globalThis.document){const r=It(e),o=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const l=f=>{if(f.target&&!o.current){let m=function(){l1(yM,r,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=m,t.addEventListener("click",i.current,{once:!0})):m()}else t.removeEventListener("click",i.current);o.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",l),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function EM(e,t=globalThis==null?void 0:globalThis.document){const r=It(e),o=x.useRef(!1);return x.useEffect(()=>{const i=l=>{l.target&&!o.current&&l1(xM,r,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Sb(){const e=new CustomEvent(Mp);document.dispatchEvent(e)}function l1(e,t,r,{discrete:o}){const i=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),o?MS(i,l):i.dispatchEvent(l)}var Km=0;function Eg(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Eb()),document.body.insertAdjacentElement("beforeend",e[1]??Eb()),Km++,()=>{Km===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Km--}},[])}function Eb(){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 Zm="focusScope.autoFocusOnMount",Qm="focusScope.autoFocusOnUnmount",Nb={bubbles:!1,cancelable:!0},NM="FocusScope",Qd=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...u}=e,[f,m]=x.useState(null),h=It(i),g=It(l),v=x.useRef(null),b=qe(t,S=>m(S)),w=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(o){let S=function(A){if(w.paused||!f)return;const M=A.target;f.contains(M)?v.current=M:Xa(v.current,{select:!0})},N=function(A){if(w.paused||!f)return;const M=A.relatedTarget;M!==null&&(f.contains(M)||Xa(v.current,{select:!0}))},C=function(A){if(document.activeElement===document.body)for(const O of A)O.removedNodes.length>0&&Xa(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",N);const j=new MutationObserver(C);return f&&j.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",N),j.disconnect()}}},[o,f,w.paused]),x.useEffect(()=>{if(f){jb.add(w);const S=document.activeElement;if(!f.contains(S)){const C=new CustomEvent(Zm,Nb);f.addEventListener(Zm,h),f.dispatchEvent(C),C.defaultPrevented||(CM(RM(c1(f)),{select:!0}),document.activeElement===S&&Xa(f))}return()=>{f.removeEventListener(Zm,h),setTimeout(()=>{const C=new CustomEvent(Qm,Nb);f.addEventListener(Qm,g),f.dispatchEvent(C),C.defaultPrevented||Xa(S??document.body,{select:!0}),f.removeEventListener(Qm,g),jb.remove(w)},0)}}},[f,h,g,w]);const E=x.useCallback(S=>{if(!r&&!o||w.paused)return;const N=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(N&&C){const j=S.currentTarget,[A,M]=jM(j);A&&M?!S.shiftKey&&C===M?(S.preventDefault(),r&&Xa(A,{select:!0})):S.shiftKey&&C===A&&(S.preventDefault(),r&&Xa(M,{select:!0})):C===j&&S.preventDefault()}},[r,o,w.paused]);return d.jsx(Ae.div,{tabIndex:-1,...u,ref:b,onKeyDown:E})});Qd.displayName=NM;function CM(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(Xa(o,{select:t}),document.activeElement!==r)return}function jM(e){const t=c1(e),r=Cb(t,e),o=Cb(t.reverse(),e);return[r,o]}function c1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Cb(e,t){for(const r of e)if(!_M(r,{upTo:t}))return r}function _M(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 AM(e){return e instanceof HTMLInputElement&&"select"in e}function Xa(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&AM(e)&&t&&e.select()}}var jb=TM();function TM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=_b(e,t),e.unshift(t)},remove(t){var r;e=_b(e,t),(r=e[0])==null||r.resume()}}}function _b(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function RM(e){return e.filter(t=>t.tagName!=="A")}const MM=["top","right","bottom","left"],ro=Math.min,_n=Math.max,yd=Math.round,$u=Math.floor,Nr=e=>({x:e,y:e}),DM={left:"right",right:"left",bottom:"top",top:"bottom"},OM={start:"end",end:"start"};function Dp(e,t,r){return _n(e,ro(t,r))}function ia(e,t){return typeof e=="function"?e(t):e}function la(e){return e.split("-")[0]}function mi(e){return e.split("-")[1]}function Ng(e){return e==="x"?"y":"x"}function Cg(e){return e==="y"?"height":"width"}function aa(e){return["top","bottom"].includes(la(e))?"y":"x"}function jg(e){return Ng(aa(e))}function kM(e,t,r){r===void 0&&(r=!1);const o=mi(e),i=jg(e),l=Cg(i);let u=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=xd(u)),[u,xd(u)]}function zM(e){const t=xd(e);return[Op(e),t,Op(t)]}function Op(e){return e.replace(/start|end/g,t=>OM[t])}function LM(e,t,r){const o=["left","right"],i=["right","left"],l=["top","bottom"],u=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:o:t?o:i;case"left":case"right":return t?l:u;default:return[]}}function PM(e,t,r,o){const i=mi(e);let l=LM(la(e),r==="start",o);return i&&(l=l.map(u=>u+"-"+i),t&&(l=l.concat(l.map(Op)))),l}function xd(e){return e.replace(/left|right|bottom|top/g,t=>DM[t])}function UM(e){return{top:0,right:0,bottom:0,left:0,...e}}function u1(e){return typeof e!="number"?UM(e):{top:e,right:e,bottom:e,left:e}}function bd(e){const{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Ab(e,t,r){let{reference:o,floating:i}=e;const l=aa(t),u=jg(t),f=Cg(u),m=la(t),h=l==="y",g=o.x+o.width/2-i.width/2,v=o.y+o.height/2-i.height/2,b=o[f]/2-i[f]/2;let w;switch(m){case"top":w={x:g,y:o.y-i.height};break;case"bottom":w={x:g,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:v};break;case"left":w={x:o.x-i.width,y:v};break;default:w={x:o.x,y:o.y}}switch(mi(t)){case"start":w[u]-=b*(r&&h?-1:1);break;case"end":w[u]+=b*(r&&h?-1:1);break}return w}const BM=async(e,t,r)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:u}=r,f=l.filter(Boolean),m=await(u.isRTL==null?void 0:u.isRTL(t));let h=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y:v}=Ab(h,o,m),b=o,w={},E=0;for(let S=0;S<f.length;S++){const{name:N,fn:C}=f[S],{x:j,y:A,data:M,reset:O}=await C({x:g,y:v,initialPlacement:o,placement:b,strategy:i,middlewareData:w,rects:h,platform:u,elements:{reference:e,floating:t}});g=j??g,v=A??v,w={...w,[N]:{...w[N],...M}},O&&E<=50&&(E++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(h=O.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:g,y:v}=Ab(h,b,m)),S=-1)}return{x:g,y:v,placement:b,strategy:i,middlewareData:w}};async function Bl(e,t){var r;t===void 0&&(t={});const{x:o,y:i,platform:l,rects:u,elements:f,strategy:m}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:b=!1,padding:w=0}=ia(t,e),E=u1(w),N=f[b?v==="floating"?"reference":"floating":v],C=bd(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(N)))==null||r?N:N.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:h,rootBoundary:g,strategy:m})),j=v==="floating"?{x:o,y:i,width:u.floating.width,height:u.floating.height}:u.reference,A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),M=await(l.isElement==null?void 0:l.isElement(A))?await(l.getScale==null?void 0:l.getScale(A))||{x:1,y:1}:{x:1,y:1},O=bd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:j,offsetParent:A,strategy:m}):j);return{top:(C.top-O.top+E.top)/M.y,bottom:(O.bottom-C.bottom+E.bottom)/M.y,left:(C.left-O.left+E.left)/M.x,right:(O.right-C.right+E.right)/M.x}}const HM=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:i,rects:l,platform:u,elements:f,middlewareData:m}=t,{element:h,padding:g=0}=ia(e,t)||{};if(h==null)return{};const v=u1(g),b={x:r,y:o},w=jg(i),E=Cg(w),S=await u.getDimensions(h),N=w==="y",C=N?"top":"left",j=N?"bottom":"right",A=N?"clientHeight":"clientWidth",M=l.reference[E]+l.reference[w]-b[w]-l.floating[E],O=b[w]-l.reference[w],U=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h));let H=U?U[A]:0;(!H||!await(u.isElement==null?void 0:u.isElement(U)))&&(H=f.floating[A]||l.floating[E]);const V=M/2-O/2,P=H/2-S[E]/2-1,z=ro(v[C],P),F=ro(v[j],P),K=z,te=H-S[E]-F,k=H/2-S[E]/2+V,Y=Dp(K,k,te),D=!m.arrow&&mi(i)!=null&&k!==Y&&l.reference[E]/2-(k<K?z:F)-S[E]/2<0,q=D?k<K?k-K:k-te:0;return{[w]:b[w]+q,data:{[w]:Y,centerOffset:k-Y-q,...D&&{alignmentOffset:q}},reset:D}}}),$M=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:i,middlewareData:l,rects:u,initialPlacement:f,platform:m,elements:h}=t,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,...N}=ia(e,t);if((r=l.arrow)!=null&&r.alignmentOffset)return{};const C=la(i),j=aa(f),A=la(f)===f,M=await(m.isRTL==null?void 0:m.isRTL(h.floating)),O=b||(A||!S?[xd(f)]:zM(f)),U=E!=="none";!b&&U&&O.push(...PM(f,S,E,M));const H=[f,...O],V=await Bl(t,N),P=[];let z=((o=l.flip)==null?void 0:o.overflows)||[];if(g&&P.push(V[C]),v){const Y=kM(i,u,M);P.push(V[Y[0]],V[Y[1]])}if(z=[...z,{placement:i,overflows:P}],!P.every(Y=>Y<=0)){var F,K;const Y=(((F=l.flip)==null?void 0:F.index)||0)+1,D=H[Y];if(D){var te;const B=v==="alignment"?j!==aa(D):!1,L=((te=z[0])==null?void 0:te.overflows[0])>0;if(!B||L)return{data:{index:Y,overflows:z},reset:{placement:D}}}let q=(K=z.filter(B=>B.overflows[0]<=0).sort((B,L)=>B.overflows[1]-L.overflows[1])[0])==null?void 0:K.placement;if(!q)switch(w){case"bestFit":{var k;const B=(k=z.filter(L=>{if(U){const T=aa(L.placement);return T===j||T==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(T=>T>0).reduce((T,I)=>T+I,0)]).sort((L,T)=>L[1]-T[1])[0])==null?void 0:k[0];B&&(q=B);break}case"initialPlacement":q=f;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function Tb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rb(e){return MM.some(t=>e[t]>=0)}const IM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:o="referenceHidden",...i}=ia(e,t);switch(o){case"referenceHidden":{const l=await Bl(t,{...i,elementContext:"reference"}),u=Tb(l,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Rb(u)}}}case"escaped":{const l=await Bl(t,{...i,altBoundary:!0}),u=Tb(l,r.floating);return{data:{escapedOffsets:u,escaped:Rb(u)}}}default:return{}}}}};async function VM(e,t){const{placement:r,platform:o,elements:i}=e,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),u=la(r),f=mi(r),m=aa(r)==="y",h=["left","top"].includes(u)?-1:1,g=l&&m?-1:1,v=ia(t,e);let{mainAxis:b,crossAxis:w,alignmentAxis:E}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof E=="number"&&(w=f==="end"?E*-1:E),m?{x:w*g,y:b*h}:{x:b*h,y:w*g}}const qM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:i,y:l,placement:u,middlewareData:f}=t,m=await VM(t,e);return u===((r=f.offset)==null?void 0:r.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:i+m.x,y:l+m.y,data:{...m,placement:u}}}}},YM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:i}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:f={fn:N=>{let{x:C,y:j}=N;return{x:C,y:j}}},...m}=ia(e,t),h={x:r,y:o},g=await Bl(t,m),v=aa(la(i)),b=Ng(v);let w=h[b],E=h[v];if(l){const N=b==="y"?"top":"left",C=b==="y"?"bottom":"right",j=w+g[N],A=w-g[C];w=Dp(j,w,A)}if(u){const N=v==="y"?"top":"left",C=v==="y"?"bottom":"right",j=E+g[N],A=E-g[C];E=Dp(j,E,A)}const S=f.fn({...t,[b]:w,[v]:E});return{...S,data:{x:S.x-r,y:S.y-o,enabled:{[b]:l,[v]:u}}}}}},GM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:i,rects:l,middlewareData:u}=t,{offset:f=0,mainAxis:m=!0,crossAxis:h=!0}=ia(e,t),g={x:r,y:o},v=aa(i),b=Ng(v);let w=g[b],E=g[v];const S=ia(f,t),N=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(m){const A=b==="y"?"height":"width",M=l.reference[b]-l.floating[A]+N.mainAxis,O=l.reference[b]+l.reference[A]-N.mainAxis;w<M?w=M:w>O&&(w=O)}if(h){var C,j;const A=b==="y"?"width":"height",M=["top","left"].includes(la(i)),O=l.reference[v]-l.floating[A]+(M&&((C=u.offset)==null?void 0:C[v])||0)+(M?0:N.crossAxis),U=l.reference[v]+l.reference[A]+(M?0:((j=u.offset)==null?void 0:j[v])||0)-(M?N.crossAxis:0);E<O?E=O:E>U&&(E=U)}return{[b]:w,[v]:E}}}},FM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:i,rects:l,platform:u,elements:f}=t,{apply:m=()=>{},...h}=ia(e,t),g=await Bl(t,h),v=la(i),b=mi(i),w=aa(i)==="y",{width:E,height:S}=l.floating;let N,C;v==="top"||v==="bottom"?(N=v,C=b===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(C=v,N=b==="end"?"top":"bottom");const j=S-g.top-g.bottom,A=E-g.left-g.right,M=ro(S-g[N],j),O=ro(E-g[C],A),U=!t.middlewareData.shift;let H=M,V=O;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(V=A),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(H=j),U&&!b){const z=_n(g.left,0),F=_n(g.right,0),K=_n(g.top,0),te=_n(g.bottom,0);w?V=E-2*(z!==0||F!==0?z+F:_n(g.left,g.right)):H=S-2*(K!==0||te!==0?K+te:_n(g.top,g.bottom))}await m({...t,availableWidth:V,availableHeight:H});const P=await u.getDimensions(f.floating);return E!==P.width||S!==P.height?{reset:{rects:!0}}:{}}}};function Jd(){return typeof window<"u"}function pi(e){return d1(e)?(e.nodeName||"").toLowerCase():"#document"}function An(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dr(e){var t;return(t=(d1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function d1(e){return Jd()?e instanceof Node||e instanceof An(e).Node:!1}function cr(e){return Jd()?e instanceof Element||e instanceof An(e).Element:!1}function jr(e){return Jd()?e instanceof HTMLElement||e instanceof An(e).HTMLElement:!1}function Mb(e){return!Jd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof An(e).ShadowRoot}function lc(e){const{overflow:t,overflowX:r,overflowY:o,display:i}=ur(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!["inline","contents"].includes(i)}function XM(e){return["table","td","th"].includes(pi(e))}function ef(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function _g(e){const t=Ag(),r=cr(e)?ur(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(r.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(r.contain||"").includes(o))}function WM(e){let t=ao(e);for(;jr(t)&&!ni(t);){if(_g(t))return t;if(ef(t))return null;t=ao(t)}return null}function Ag(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ni(e){return["html","body","#document"].includes(pi(e))}function ur(e){return An(e).getComputedStyle(e)}function tf(e){return cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ao(e){if(pi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mb(e)&&e.host||Dr(e);return Mb(t)?t.host:t}function f1(e){const t=ao(e);return ni(t)?e.ownerDocument?e.ownerDocument.body:e.body:jr(t)&&lc(t)?t:f1(t)}function Hl(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=f1(e),l=i===((o=e.ownerDocument)==null?void 0:o.body),u=An(i);if(l){const f=kp(u);return t.concat(u,u.visualViewport||[],lc(i)?i:[],f&&r?Hl(f):[])}return t.concat(i,Hl(i,[],r))}function kp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function h1(e){const t=ur(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=jr(e),l=i?e.offsetWidth:r,u=i?e.offsetHeight:o,f=yd(r)!==l||yd(o)!==u;return f&&(r=l,o=u),{width:r,height:o,$:f}}function Tg(e){return cr(e)?e:e.contextElement}function Zs(e){const t=Tg(e);if(!jr(t))return Nr(1);const r=t.getBoundingClientRect(),{width:o,height:i,$:l}=h1(t);let u=(l?yd(r.width):r.width)/o,f=(l?yd(r.height):r.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const KM=Nr(0);function m1(e){const t=An(e);return!Ag()||!t.visualViewport?KM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZM(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==An(e)?!1:t}function Go(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),l=Tg(e);let u=Nr(1);t&&(o?cr(o)&&(u=Zs(o)):u=Zs(e));const f=ZM(l,r,o)?m1(l):Nr(0);let m=(i.left+f.x)/u.x,h=(i.top+f.y)/u.y,g=i.width/u.x,v=i.height/u.y;if(l){const b=An(l),w=o&&cr(o)?An(o):o;let E=b,S=kp(E);for(;S&&o&&w!==E;){const N=Zs(S),C=S.getBoundingClientRect(),j=ur(S),A=C.left+(S.clientLeft+parseFloat(j.paddingLeft))*N.x,M=C.top+(S.clientTop+parseFloat(j.paddingTop))*N.y;m*=N.x,h*=N.y,g*=N.x,v*=N.y,m+=A,h+=M,E=An(S),S=kp(E)}}return bd({width:g,height:v,x:m,y:h})}function Rg(e,t){const r=tf(e).scrollLeft;return t?t.left+r:Go(Dr(e)).left+r}function p1(e,t,r){r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(r?0:Rg(e,o)),l=o.top+t.scrollTop;return{x:i,y:l}}function QM(e){let{elements:t,rect:r,offsetParent:o,strategy:i}=e;const l=i==="fixed",u=Dr(o),f=t?ef(t.floating):!1;if(o===u||f&&l)return r;let m={scrollLeft:0,scrollTop:0},h=Nr(1);const g=Nr(0),v=jr(o);if((v||!v&&!l)&&((pi(o)!=="body"||lc(u))&&(m=tf(o)),jr(o))){const w=Go(o);h=Zs(o),g.x=w.x+o.clientLeft,g.y=w.y+o.clientTop}const b=u&&!v&&!l?p1(u,m,!0):Nr(0);return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-m.scrollLeft*h.x+g.x+b.x,y:r.y*h.y-m.scrollTop*h.y+g.y+b.y}}function JM(e){return Array.from(e.getClientRects())}function eD(e){const t=Dr(e),r=tf(e),o=e.ownerDocument.body,i=_n(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=_n(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let u=-r.scrollLeft+Rg(e);const f=-r.scrollTop;return ur(o).direction==="rtl"&&(u+=_n(t.clientWidth,o.clientWidth)-i),{width:i,height:l,x:u,y:f}}function tD(e,t){const r=An(e),o=Dr(e),i=r.visualViewport;let l=o.clientWidth,u=o.clientHeight,f=0,m=0;if(i){l=i.width,u=i.height;const h=Ag();(!h||h&&t==="fixed")&&(f=i.offsetLeft,m=i.offsetTop)}return{width:l,height:u,x:f,y:m}}function nD(e,t){const r=Go(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,l=jr(e)?Zs(e):Nr(1),u=e.clientWidth*l.x,f=e.clientHeight*l.y,m=i*l.x,h=o*l.y;return{width:u,height:f,x:m,y:h}}function Db(e,t,r){let o;if(t==="viewport")o=tD(e,r);else if(t==="document")o=eD(Dr(e));else if(cr(t))o=nD(t,r);else{const i=m1(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return bd(o)}function g1(e,t){const r=ao(e);return r===t||!cr(r)||ni(r)?!1:ur(r).position==="fixed"||g1(r,t)}function rD(e,t){const r=t.get(e);if(r)return r;let o=Hl(e,[],!1).filter(f=>cr(f)&&pi(f)!=="body"),i=null;const l=ur(e).position==="fixed";let u=l?ao(e):e;for(;cr(u)&&!ni(u);){const f=ur(u),m=_g(u);!m&&f.position==="fixed"&&(i=null),(l?!m&&!i:!m&&f.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||lc(u)&&!m&&g1(e,u))?o=o.filter(g=>g!==u):i=f,u=ao(u)}return t.set(e,o),o}function aD(e){let{element:t,boundary:r,rootBoundary:o,strategy:i}=e;const u=[...r==="clippingAncestors"?ef(t)?[]:rD(t,this._c):[].concat(r),o],f=u[0],m=u.reduce((h,g)=>{const v=Db(t,g,i);return h.top=_n(v.top,h.top),h.right=ro(v.right,h.right),h.bottom=ro(v.bottom,h.bottom),h.left=_n(v.left,h.left),h},Db(t,f,i));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function oD(e){const{width:t,height:r}=h1(e);return{width:t,height:r}}function sD(e,t,r){const o=jr(t),i=Dr(t),l=r==="fixed",u=Go(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const m=Nr(0);function h(){m.x=Rg(i)}if(o||!o&&!l)if((pi(t)!=="body"||lc(i))&&(f=tf(t)),o){const w=Go(t,!0,l,t);m.x=w.x+t.clientLeft,m.y=w.y+t.clientTop}else i&&h();l&&!o&&i&&h();const g=i&&!o&&!l?p1(i,f):Nr(0),v=u.left+f.scrollLeft-m.x-g.x,b=u.top+f.scrollTop-m.y-g.y;return{x:v,y:b,width:u.width,height:u.height}}function Jm(e){return ur(e).position==="static"}function Ob(e,t){if(!jr(e)||ur(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Dr(e)===r&&(r=r.ownerDocument.body),r}function v1(e,t){const r=An(e);if(ef(e))return r;if(!jr(e)){let i=ao(e);for(;i&&!ni(i);){if(cr(i)&&!Jm(i))return i;i=ao(i)}return r}let o=Ob(e,t);for(;o&&XM(o)&&Jm(o);)o=Ob(o,t);return o&&ni(o)&&Jm(o)&&!_g(o)?r:o||WM(e)||r}const iD=async function(e){const t=this.getOffsetParent||v1,r=this.getDimensions,o=await r(e.floating);return{reference:sD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function lD(e){return ur(e).direction==="rtl"}const cD={convertOffsetParentRelativeRectToViewportRelativeRect:QM,getDocumentElement:Dr,getClippingRect:aD,getOffsetParent:v1,getElementRects:iD,getClientRects:JM,getDimensions:oD,getScale:Zs,isElement:cr,isRTL:lD};function y1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uD(e,t){let r=null,o;const i=Dr(e);function l(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function u(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),l();const h=e.getBoundingClientRect(),{left:g,top:v,width:b,height:w}=h;if(f||t(),!b||!w)return;const E=$u(v),S=$u(i.clientWidth-(g+b)),N=$u(i.clientHeight-(v+w)),C=$u(g),A={rootMargin:-E+"px "+-S+"px "+-N+"px "+-C+"px",threshold:_n(0,ro(1,m))||1};let M=!0;function O(U){const H=U[0].intersectionRatio;if(H!==m){if(!M)return u();H?u(!1,H):o=setTimeout(()=>{u(!1,1e-7)},1e3)}H===1&&!y1(h,e.getBoundingClientRect())&&u(),M=!1}try{r=new IntersectionObserver(O,{...A,root:i.ownerDocument})}catch{r=new IntersectionObserver(O,A)}r.observe(e)}return u(!0),l}function dD(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,h=Tg(e),g=i||l?[...h?Hl(h):[],...Hl(t)]:[];g.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),l&&C.addEventListener("resize",r)});const v=h&&f?uD(h,r):null;let b=-1,w=null;u&&(w=new ResizeObserver(C=>{let[j]=C;j&&j.target===h&&w&&(w.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(t)})),r()}),h&&!m&&w.observe(h),w.observe(t));let E,S=m?Go(e):null;m&&N();function N(){const C=Go(e);S&&!y1(S,C)&&r(),S=C,E=requestAnimationFrame(N)}return r(),()=>{var C;g.forEach(j=>{i&&j.removeEventListener("scroll",r),l&&j.removeEventListener("resize",r)}),v==null||v(),(C=w)==null||C.disconnect(),w=null,m&&cancelAnimationFrame(E)}}const fD=qM,hD=YM,mD=$M,pD=FM,gD=IM,kb=HM,vD=GM,yD=(e,t,r)=>{const o=new Map,i={platform:cD,...r},l={...i.platform,_c:o};return BM(e,t,{...i,platform:l})};var od=typeof document<"u"?x.useLayoutEffect:x.useEffect;function wd(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,o,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!wd(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){const l=i[o];if(!(l==="_owner"&&e.$$typeof)&&!wd(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function x1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zb(e,t){const r=x1(e);return Math.round(t*r)/r}function ep(e){const t=x.useRef(e);return od(()=>{t.current=e}),t}function xD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:f=!0,whileElementsMounted:m,open:h}=e,[g,v]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,w]=x.useState(o);wd(b,o)||w(o);const[E,S]=x.useState(null),[N,C]=x.useState(null),j=x.useCallback(B=>{B!==U.current&&(U.current=B,S(B))},[]),A=x.useCallback(B=>{B!==H.current&&(H.current=B,C(B))},[]),M=l||E,O=u||N,U=x.useRef(null),H=x.useRef(null),V=x.useRef(g),P=m!=null,z=ep(m),F=ep(i),K=ep(h),te=x.useCallback(()=>{if(!U.current||!H.current)return;const B={placement:t,strategy:r,middleware:b};F.current&&(B.platform=F.current),yD(U.current,H.current,B).then(L=>{const T={...L,isPositioned:K.current!==!1};k.current&&!wd(V.current,T)&&(V.current=T,oc.flushSync(()=>{v(T)}))})},[b,t,r,F,K]);od(()=>{h===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,v(B=>({...B,isPositioned:!1})))},[h]);const k=x.useRef(!1);od(()=>(k.current=!0,()=>{k.current=!1}),[]),od(()=>{if(M&&(U.current=M),O&&(H.current=O),M&&O){if(z.current)return z.current(M,O,te);te()}},[M,O,te,z,P]);const Y=x.useMemo(()=>({reference:U,floating:H,setReference:j,setFloating:A}),[j,A]),D=x.useMemo(()=>({reference:M,floating:O}),[M,O]),q=x.useMemo(()=>{const B={position:r,left:0,top:0};if(!D.floating)return B;const L=zb(D.floating,g.x),T=zb(D.floating,g.y);return f?{...B,transform:"translate("+L+"px, "+T+"px)",...x1(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:L,top:T}},[r,f,D.floating,g.x,g.y]);return x.useMemo(()=>({...g,update:te,refs:Y,elements:D,floatingStyles:q}),[g,te,Y,D,q])}const bD=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:i}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?kb({element:o.current,padding:i}).fn(r):{}:o?kb({element:o,padding:i}).fn(r):{}}}},wD=(e,t)=>({...fD(e),options:[e,t]}),SD=(e,t)=>({...hD(e),options:[e,t]}),ED=(e,t)=>({...vD(e),options:[e,t]}),ND=(e,t)=>({...mD(e),options:[e,t]}),CD=(e,t)=>({...pD(e),options:[e,t]}),jD=(e,t)=>({...gD(e),options:[e,t]}),_D=(e,t)=>({...bD(e),options:[e,t]});var AD="Arrow",b1=x.forwardRef((e,t)=>{const{children:r,width:o=10,height:i=5,...l}=e;return d.jsx(Ae.svg,{...l,ref:t,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});b1.displayName=AD;var TD=b1;function w1(e){const[t,r]=x.useState(void 0);return Mt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let u,f;if("borderBoxSize"in l){const m=l.borderBoxSize,h=Array.isArray(m)?m[0]:m;u=h.inlineSize,f=h.blockSize}else u=e.offsetWidth,f=e.offsetHeight;r({width:u,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var Mg="Popper",[S1,nf]=fr(Mg),[RD,E1]=S1(Mg),N1=e=>{const{__scopePopper:t,children:r}=e,[o,i]=x.useState(null);return d.jsx(RD,{scope:t,anchor:o,onAnchorChange:i,children:r})};N1.displayName=Mg;var C1="PopperAnchor",j1=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...i}=e,l=E1(C1,r),u=x.useRef(null),f=qe(t,u);return x.useEffect(()=>{l.onAnchorChange((o==null?void 0:o.current)||u.current)}),o?null:d.jsx(Ae.div,{...i,ref:f})});j1.displayName=C1;var Dg="PopperContent",[MD,DD]=S1(Dg),_1=x.forwardRef((e,t)=>{var se,me,pe,ge,Ee,Se;const{__scopePopper:r,side:o="bottom",sideOffset:i=0,align:l="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:w="optimized",onPlaced:E,...S}=e,N=E1(Dg,r),[C,j]=x.useState(null),A=qe(t,Ye=>j(Ye)),[M,O]=x.useState(null),U=w1(M),H=(U==null?void 0:U.width)??0,V=(U==null?void 0:U.height)??0,P=o+(l!=="center"?"-"+l:""),z=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},F=Array.isArray(h)?h:[h],K=F.length>0,te={padding:z,boundary:F.filter(kD),altBoundary:K},{refs:k,floatingStyles:Y,placement:D,isPositioned:q,middlewareData:B}=xD({strategy:"fixed",placement:P,whileElementsMounted:(...Ye)=>dD(...Ye,{animationFrame:w==="always"}),elements:{reference:N.anchor},middleware:[wD({mainAxis:i+V,alignmentAxis:u}),m&&SD({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?ED():void 0,...te}),m&&ND({...te}),CD({...te,apply:({elements:Ye,rects:We,availableWidth:Je,availableHeight:mt})=>{const{width:he,height:de}=We.reference,Te=Ye.floating.style;Te.setProperty("--radix-popper-available-width",`${Je}px`),Te.setProperty("--radix-popper-available-height",`${mt}px`),Te.setProperty("--radix-popper-anchor-width",`${he}px`),Te.setProperty("--radix-popper-anchor-height",`${de}px`)}}),M&&_D({element:M,padding:f}),zD({arrowWidth:H,arrowHeight:V}),b&&jD({strategy:"referenceHidden",...te})]}),[L,T]=R1(D),I=It(E);Mt(()=>{q&&(I==null||I())},[q,I]);const X=(se=B.arrow)==null?void 0:se.x,Z=(me=B.arrow)==null?void 0:me.y,re=((pe=B.arrow)==null?void 0:pe.centerOffset)!==0,[fe,ue]=x.useState();return Mt(()=>{C&&ue(window.getComputedStyle(C).zIndex)},[C]),d.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:q?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(ge=B.transformOrigin)==null?void 0:ge.x,(Ee=B.transformOrigin)==null?void 0:Ee.y].join(" "),...((Se=B.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(MD,{scope:r,placedSide:L,onArrowChange:O,arrowX:X,arrowY:Z,shouldHideArrow:re,children:d.jsx(Ae.div,{"data-side":L,"data-align":T,...S,ref:A,style:{...S.style,animation:q?void 0:"none"}})})})});_1.displayName=Dg;var A1="PopperArrow",OD={top:"bottom",right:"left",bottom:"top",left:"right"},T1=x.forwardRef(function(t,r){const{__scopePopper:o,...i}=t,l=DD(A1,o),u=OD[l.placedSide];return d.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:d.jsx(TD,{...i,ref:r,style:{...i.style,display:"block"}})})});T1.displayName=A1;function kD(e){return e!==null}var zD=e=>({name:"transformOrigin",options:e,fn(t){var N,C,j;const{placement:r,rects:o,middlewareData:i}=t,u=((N=i.arrow)==null?void 0:N.centerOffset)!==0,f=u?0:e.arrowWidth,m=u?0:e.arrowHeight,[h,g]=R1(r),v={start:"0%",center:"50%",end:"100%"}[g],b=(((C=i.arrow)==null?void 0:C.x)??0)+f/2,w=(((j=i.arrow)==null?void 0:j.y)??0)+m/2;let E="",S="";return h==="bottom"?(E=u?v:`${b}px`,S=`${-m}px`):h==="top"?(E=u?v:`${b}px`,S=`${o.floating.height+m}px`):h==="right"?(E=`${-m}px`,S=u?v:`${w}px`):h==="left"&&(E=`${o.floating.width+m}px`,S=u?v:`${w}px`),{data:{x:E,y:S}}}});function R1(e){const[t,r="center"]=e.split("-");return[t,r]}var M1=N1,D1=j1,O1=_1,k1=T1,LD="Portal",rf=x.forwardRef((e,t)=>{var f;const{container:r,...o}=e,[i,l]=x.useState(!1);Mt(()=>l(!0),[]);const u=r||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?dR.createPortal(d.jsx(Ae.div,{...o,ref:t}),u):null});rf.displayName=LD;function z1(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var L1=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"}),PD="VisuallyHidden",UD=x.forwardRef((e,t)=>d.jsx(Ae.span,{...e,ref:t,style:{...L1,...e.style}}));UD.displayName=PD;var BD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$s=new WeakMap,Iu=new WeakMap,Vu={},tp=0,P1=function(e){return e&&(e.host||P1(e.parentNode))},HD=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=P1(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},$D=function(e,t,r,o){var i=HD(t,Array.isArray(e)?e:[e]);Vu[r]||(Vu[r]=new WeakMap);var l=Vu[r],u=[],f=new Set,m=new Set(i),h=function(v){!v||f.has(v)||(f.add(v),h(v.parentNode))};i.forEach(h);var g=function(v){!v||m.has(v)||Array.prototype.forEach.call(v.children,function(b){if(f.has(b))g(b);else try{var w=b.getAttribute(o),E=w!==null&&w!=="false",S=($s.get(b)||0)+1,N=(l.get(b)||0)+1;$s.set(b,S),l.set(b,N),u.push(b),S===1&&E&&Iu.set(b,!0),N===1&&b.setAttribute(r,"true"),E||b.setAttribute(o,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return g(t),f.clear(),tp++,function(){u.forEach(function(v){var b=$s.get(v)-1,w=l.get(v)-1;$s.set(v,b),l.set(v,w),b||(Iu.has(v)||v.removeAttribute(o),Iu.delete(v)),w||v.removeAttribute(r)}),tp--,tp||($s=new WeakMap,$s=new WeakMap,Iu=new WeakMap,Vu={})}},Og=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=BD(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),$D(o,i,r,"aria-hidden")):function(){return null}},Rt=function(){return Rt=Object.assign||function(t){for(var r,o=1,i=arguments.length;o<i;o++){r=arguments[o];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(t[l]=r[l])}return t},Rt.apply(this,arguments)};function U1(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]]);return r}function Ll(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ko(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),i,l=[],u;try{for(;(t===void 0||t-- >0)&&!(i=o.next()).done;)l.push(i.value)}catch(f){u={error:f}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(u)throw u.error}}return l}function Pl(e,t,r){if(r||arguments.length===2)for(var o=0,i=t.length,l;o<i;o++)(l||!(o in t))&&(l||(l=Array.prototype.slice.call(t,0,o)),l[o]=t[o]);return e.concat(l||Array.prototype.slice.call(t))}var sd="right-scroll-bar-position",id="width-before-scroll-bar",ID="with-scroll-bars-hidden",VD="--removed-body-scroll-bar-size";function np(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qD(e,t){var r=x.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var i=r.value;i!==o&&(r.value=o,r.callback(o,i))}}}})[0];return r.callback=t,r.facade}var YD=typeof window<"u"?x.useLayoutEffect:x.useEffect,Lb=new WeakMap;function GD(e,t){var r=qD(null,function(o){return e.forEach(function(i){return np(i,o)})});return YD(function(){var o=Lb.get(r);if(o){var i=new Set(o),l=new Set(e),u=r.current;i.forEach(function(f){l.has(f)||np(f,null)}),l.forEach(function(f){i.has(f)||np(f,u)})}Lb.set(r,e)},[e]),r}function FD(e){return e}function XD(e,t){t===void 0&&(t=FD);var r=[],o=!1,i={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(l){var u=t(l,o);return r.push(u),function(){r=r.filter(function(f){return f!==u})}},assignSyncMedium:function(l){for(o=!0;r.length;){var u=r;r=[],u.forEach(l)}r={push:function(f){return l(f)},filter:function(){return r}}},assignMedium:function(l){o=!0;var u=[];if(r.length){var f=r;r=[],f.forEach(l),u=r}var m=function(){var g=u;u=[],g.forEach(l)},h=function(){return Promise.resolve().then(m)};h(),r={push:function(g){u.push(g),h()},filter:function(g){return u=u.filter(g),r}}}};return i}function WD(e){e===void 0&&(e={});var t=XD(null);return t.options=Rt({async:!0,ssr:!1},e),t}var B1=function(e){var t=e.sideCar,r=U1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return x.createElement(o,Rt({},r))};B1.isSideCarExport=!0;function KD(e,t){return e.useMedium(t),B1}var H1=WD(),rp=function(){},af=x.forwardRef(function(e,t){var r=x.useRef(null),o=x.useState({onScrollCapture:rp,onWheelCapture:rp,onTouchMoveCapture:rp}),i=o[0],l=o[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,g=e.enabled,v=e.shards,b=e.sideCar,w=e.noIsolation,E=e.inert,S=e.allowPinchZoom,N=e.as,C=N===void 0?"div":N,j=e.gapMode,A=U1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,O=GD([r,t]),U=Rt(Rt({},A),i);return x.createElement(x.Fragment,null,g&&x.createElement(M,{sideCar:H1,removeScrollBar:h,shards:v,noIsolation:w,inert:E,setCallbacks:l,allowPinchZoom:!!S,lockRef:r,gapMode:j}),u?x.cloneElement(x.Children.only(f),Rt(Rt({},U),{ref:O})):x.createElement(C,Rt({},U,{className:m,ref:O}),f))});af.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};af.classNames={fullWidth:id,zeroRight:sd};var ZD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function QD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ZD();return t&&e.setAttribute("nonce",t),e}function JD(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tO=function(){var e=0,t=null;return{add:function(r){e==0&&(t=QD())&&(JD(t,r),eO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nO=function(){var e=tO();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},$1=function(){var e=nO(),t=function(r){var o=r.styles,i=r.dynamic;return e(o,i),null};return t},rO={left:0,top:0,right:0,gap:0},ap=function(e){return parseInt(e||"",10)||0},aO=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ap(r),ap(o),ap(i)]},oO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rO;var t=aO(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},sO=$1(),Qs="data-scroll-locked",iO=function(e,t,r,o){var i=e.left,l=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),`
  .`.concat(ID,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(f,"px ").concat(o,`;
  }
  body[`).concat(Qs,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(l,`px;
    padding-right: `).concat(u,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(f,"px ").concat(o,`;
    `),r==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(sd,` {
    right: `).concat(f,"px ").concat(o,`;
  }
  
  .`).concat(id,` {
    margin-right: `).concat(f,"px ").concat(o,`;
  }
  
  .`).concat(sd," .").concat(sd,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(id," .").concat(id,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(Qs,`] {
    `).concat(VD,": ").concat(f,`px;
  }
`)},Pb=function(){var e=parseInt(document.body.getAttribute(Qs)||"0",10);return isFinite(e)?e:0},lO=function(){x.useEffect(function(){return document.body.setAttribute(Qs,(Pb()+1).toString()),function(){var e=Pb()-1;e<=0?document.body.removeAttribute(Qs):document.body.setAttribute(Qs,e.toString())}},[])},cO=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,i=o===void 0?"margin":o;lO();var l=x.useMemo(function(){return oO(i)},[i]);return x.createElement(sO,{styles:iO(l,!t,i,r?"":"!important")})},zp=!1;if(typeof window<"u")try{var qu=Object.defineProperty({},"passive",{get:function(){return zp=!0,!0}});window.addEventListener("test",qu,qu),window.removeEventListener("test",qu,qu)}catch{zp=!1}var Is=zp?{passive:!1}:!1,uO=function(e){return e.tagName==="TEXTAREA"},I1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!uO(e)&&r[t]==="visible")},dO=function(e){return I1(e,"overflowY")},fO=function(e){return I1(e,"overflowX")},Ub=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var i=V1(e,o);if(i){var l=q1(e,o),u=l[1],f=l[2];if(u>f)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},hO=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},mO=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},V1=function(e,t){return e==="v"?dO(t):fO(t)},q1=function(e,t){return e==="v"?hO(t):mO(t)},pO=function(e,t){return e==="h"&&t==="rtl"?-1:1},gO=function(e,t,r,o,i){var l=pO(e,window.getComputedStyle(t).direction),u=l*o,f=r.target,m=t.contains(f),h=!1,g=u>0,v=0,b=0;do{var w=q1(e,f),E=w[0],S=w[1],N=w[2],C=S-N-l*E;(E||C)&&V1(e,f)&&(v+=C,b+=E),f instanceof ShadowRoot?f=f.host:f=f.parentNode}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(g&&Math.abs(v)<1||!g&&Math.abs(b)<1)&&(h=!0),h},Yu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bb=function(e){return[e.deltaX,e.deltaY]},Hb=function(e){return e&&"current"in e?e.current:e},vO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yO=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},xO=0,Vs=[];function bO(e){var t=x.useRef([]),r=x.useRef([0,0]),o=x.useRef(),i=x.useState(xO++)[0],l=x.useState($1)[0],u=x.useRef(e);x.useEffect(function(){u.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=Pl([e.lockRef.current],(e.shards||[]).map(Hb),!0).filter(Boolean);return S.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var C=Yu(S),j=r.current,A="deltaX"in S?S.deltaX:j[0]-C[0],M="deltaY"in S?S.deltaY:j[1]-C[1],O,U=S.target,H=Math.abs(A)>Math.abs(M)?"h":"v";if("touches"in S&&H==="h"&&U.type==="range")return!1;var V=Ub(H,U);if(!V)return!0;if(V?O=H:(O=H==="v"?"h":"v",V=Ub(H,U)),!V)return!1;if(!o.current&&"changedTouches"in S&&(A||M)&&(o.current=O),!O)return!0;var P=o.current||O;return gO(P,N,S,P==="h"?A:M)},[]),m=x.useCallback(function(S){var N=S;if(!(!Vs.length||Vs[Vs.length-1]!==l)){var C="deltaY"in N?Bb(N):Yu(N),j=t.current.filter(function(O){return O.name===N.type&&(O.target===N.target||N.target===O.shadowParent)&&vO(O.delta,C)})[0];if(j&&j.should){N.cancelable&&N.preventDefault();return}if(!j){var A=(u.current.shards||[]).map(Hb).filter(Boolean).filter(function(O){return O.contains(N.target)}),M=A.length>0?f(N,A[0]):!u.current.noIsolation;M&&N.cancelable&&N.preventDefault()}}},[]),h=x.useCallback(function(S,N,C,j){var A={name:S,delta:N,target:C,should:j,shadowParent:wO(C)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(M){return M!==A})},1)},[]),g=x.useCallback(function(S){r.current=Yu(S),o.current=void 0},[]),v=x.useCallback(function(S){h(S.type,Bb(S),S.target,f(S,e.lockRef.current))},[]),b=x.useCallback(function(S){h(S.type,Yu(S),S.target,f(S,e.lockRef.current))},[]);x.useEffect(function(){return Vs.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",m,Is),document.addEventListener("touchmove",m,Is),document.addEventListener("touchstart",g,Is),function(){Vs=Vs.filter(function(S){return S!==l}),document.removeEventListener("wheel",m,Is),document.removeEventListener("touchmove",m,Is),document.removeEventListener("touchstart",g,Is)}},[]);var w=e.removeScrollBar,E=e.inert;return x.createElement(x.Fragment,null,E?x.createElement(l,{styles:yO(i)}):null,w?x.createElement(cO,{gapMode:e.gapMode}):null)}function wO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SO=KD(H1,bO);var of=x.forwardRef(function(e,t){return x.createElement(af,Rt({},e,{ref:t,sideCar:SO}))});of.classNames=af.classNames;var EO=[" ","Enter","ArrowUp","ArrowDown"],NO=[" ","Enter"],Fo="Select",[sf,lf,CO]=bg(Fo),[gi,KI]=fr(Fo,[CO,nf]),cf=nf(),[jO,so]=gi(Fo),[_O,AO]=gi(Fo),Y1=e=>{const{__scopeSelect:t,children:r,open:o,defaultOpen:i,onOpenChange:l,value:u,defaultValue:f,onValueChange:m,dir:h,name:g,autoComplete:v,disabled:b,required:w,form:E}=e,S=cf(t),[N,C]=x.useState(null),[j,A]=x.useState(null),[M,O]=x.useState(!1),U=sc(h),[H,V]=Io({prop:o,defaultProp:i??!1,onChange:l,caller:Fo}),[P,z]=Io({prop:u,defaultProp:f,onChange:m,caller:Fo}),F=x.useRef(null),K=N?E||!!N.closest("form"):!0,[te,k]=x.useState(new Set),Y=Array.from(te).map(D=>D.props.value).join(";");return d.jsx(M1,{...S,children:d.jsxs(jO,{required:w,scope:t,trigger:N,onTriggerChange:C,valueNode:j,onValueNodeChange:A,valueNodeHasChildren:M,onValueNodeHasChildrenChange:O,contentId:Er(),value:P,onValueChange:z,open:H,onOpenChange:V,dir:U,triggerPointerDownPosRef:F,disabled:b,children:[d.jsx(sf.Provider,{scope:t,children:d.jsx(_O,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(D=>{k(q=>new Set(q).add(D))},[]),onNativeOptionRemove:x.useCallback(D=>{k(q=>{const B=new Set(q);return B.delete(D),B})},[]),children:r})}),K?d.jsxs(hE,{"aria-hidden":!0,required:w,tabIndex:-1,name:g,autoComplete:v,value:P,onChange:D=>z(D.target.value),disabled:b,form:E,children:[P===void 0?d.jsx("option",{value:""}):null,Array.from(te)]},Y):null]})})};Y1.displayName=Fo;var G1="SelectTrigger",F1=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:o=!1,...i}=e,l=cf(r),u=so(G1,r),f=u.disabled||o,m=qe(t,u.onTriggerChange),h=lf(r),g=x.useRef("touch"),[v,b,w]=pE(S=>{const N=h().filter(A=>!A.disabled),C=N.find(A=>A.value===u.value),j=gE(N,S,C);j!==void 0&&u.onValueChange(j.value)}),E=S=>{f||(u.onOpenChange(!0),w()),S&&(u.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return d.jsx(D1,{asChild:!0,...l,children:d.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":mE(u.value)?"":void 0,...i,ref:m,onClick:ve(i.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&E(S)}),onPointerDown:ve(i.onPointerDown,S=>{g.current=S.pointerType;const N=S.target;N.hasPointerCapture(S.pointerId)&&N.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(E(S),S.preventDefault())}),onKeyDown:ve(i.onKeyDown,S=>{const N=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&b(S.key),!(N&&S.key===" ")&&EO.includes(S.key)&&(E(),S.preventDefault())})})})});F1.displayName=G1;var X1="SelectValue",W1=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:i,children:l,placeholder:u="",...f}=e,m=so(X1,r),{onValueNodeHasChildrenChange:h}=m,g=l!==void 0,v=qe(t,m.onValueNodeChange);return Mt(()=>{h(g)},[h,g]),d.jsx(Ae.span,{...f,ref:v,style:{pointerEvents:"none"},children:mE(m.value)?d.jsx(d.Fragment,{children:u}):l})});W1.displayName=X1;var TO="SelectIcon",K1=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...i}=e;return d.jsx(Ae.span,{"aria-hidden":!0,...i,ref:t,children:o||"▼"})});K1.displayName=TO;var RO="SelectPortal",Z1=e=>d.jsx(rf,{asChild:!0,...e});Z1.displayName=RO;var Xo="SelectContent",Q1=x.forwardRef((e,t)=>{const r=so(Xo,e.__scopeSelect),[o,i]=x.useState();if(Mt(()=>{i(new DocumentFragment)},[]),!r.open){const l=o;return l?oc.createPortal(d.jsx(J1,{scope:e.__scopeSelect,children:d.jsx(sf.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),l):null}return d.jsx(eE,{...e,ref:t})});Q1.displayName=Xo;var Jn=10,[J1,io]=gi(Xo),MO="SelectContentImpl",DO=$o("SelectContent.RemoveScroll"),eE=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:f,sideOffset:m,align:h,alignOffset:g,arrowPadding:v,collisionBoundary:b,collisionPadding:w,sticky:E,hideWhenDetached:S,avoidCollisions:N,...C}=e,j=so(Xo,r),[A,M]=x.useState(null),[O,U]=x.useState(null),H=qe(t,se=>M(se)),[V,P]=x.useState(null),[z,F]=x.useState(null),K=lf(r),[te,k]=x.useState(!1),Y=x.useRef(!1);x.useEffect(()=>{if(A)return Og(A)},[A]),Eg();const D=x.useCallback(se=>{const[me,...pe]=K().map(Se=>Se.ref.current),[ge]=pe.slice(-1),Ee=document.activeElement;for(const Se of se)if(Se===Ee||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===me&&O&&(O.scrollTop=0),Se===ge&&O&&(O.scrollTop=O.scrollHeight),Se==null||Se.focus(),document.activeElement!==Ee))return},[K,O]),q=x.useCallback(()=>D([V,A]),[D,V,A]);x.useEffect(()=>{te&&q()},[te,q]);const{onOpenChange:B,triggerPointerDownPosRef:L}=j;x.useEffect(()=>{if(A){let se={x:0,y:0};const me=ge=>{var Ee,Se;se={x:Math.abs(Math.round(ge.pageX)-(((Ee=L.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(ge.pageY)-(((Se=L.current)==null?void 0:Se.y)??0))}},pe=ge=>{se.x<=10&&se.y<=10?ge.preventDefault():A.contains(ge.target)||B(!1),document.removeEventListener("pointermove",me),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",pe,{capture:!0})}}},[A,B,L]),x.useEffect(()=>{const se=()=>B(!1);return window.addEventListener("blur",se),window.addEventListener("resize",se),()=>{window.removeEventListener("blur",se),window.removeEventListener("resize",se)}},[B]);const[T,I]=pE(se=>{const me=K().filter(Ee=>!Ee.disabled),pe=me.find(Ee=>Ee.ref.current===document.activeElement),ge=gE(me,se,pe);ge&&setTimeout(()=>ge.ref.current.focus())}),X=x.useCallback((se,me,pe)=>{const ge=!Y.current&&!pe;(j.value!==void 0&&j.value===me||ge)&&(P(se),ge&&(Y.current=!0))},[j.value]),Z=x.useCallback(()=>A==null?void 0:A.focus(),[A]),re=x.useCallback((se,me,pe)=>{const ge=!Y.current&&!pe;(j.value!==void 0&&j.value===me||ge)&&F(se)},[j.value]),fe=o==="popper"?Lp:tE,ue=fe===Lp?{side:f,sideOffset:m,align:h,alignOffset:g,arrowPadding:v,collisionBoundary:b,collisionPadding:w,sticky:E,hideWhenDetached:S,avoidCollisions:N}:{};return d.jsx(J1,{scope:r,content:A,viewport:O,onViewportChange:U,itemRefCallback:X,selectedItem:V,onItemLeave:Z,itemTextRefCallback:re,focusSelectedItem:q,selectedItemText:z,position:o,isPositioned:te,searchRef:T,children:d.jsx(of,{as:DO,allowPinchZoom:!0,children:d.jsx(Qd,{asChild:!0,trapped:j.open,onMountAutoFocus:se=>{se.preventDefault()},onUnmountAutoFocus:ve(i,se=>{var me;(me=j.trigger)==null||me.focus({preventScroll:!0}),se.preventDefault()}),children:d.jsx(Zd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:se=>se.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:d.jsx(fe,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:se=>se.preventDefault(),...C,...ue,onPlaced:()=>k(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:ve(C.onKeyDown,se=>{const me=se.ctrlKey||se.altKey||se.metaKey;if(se.key==="Tab"&&se.preventDefault(),!me&&se.key.length===1&&I(se.key),["ArrowUp","ArrowDown","Home","End"].includes(se.key)){let ge=K().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(se.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(se.key)){const Ee=se.target,Se=ge.indexOf(Ee);ge=ge.slice(Se+1)}setTimeout(()=>D(ge)),se.preventDefault()}})})})})})})});eE.displayName=MO;var OO="SelectItemAlignedPosition",tE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:o,...i}=e,l=so(Xo,r),u=io(Xo,r),[f,m]=x.useState(null),[h,g]=x.useState(null),v=qe(t,H=>g(H)),b=lf(r),w=x.useRef(!1),E=x.useRef(!0),{viewport:S,selectedItem:N,selectedItemText:C,focusSelectedItem:j}=u,A=x.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&h&&S&&N&&C){const H=l.trigger.getBoundingClientRect(),V=h.getBoundingClientRect(),P=l.valueNode.getBoundingClientRect(),z=C.getBoundingClientRect();if(l.dir!=="rtl"){const Ee=z.left-V.left,Se=P.left-Ee,Ye=H.left-Se,We=H.width+Ye,Je=Math.max(We,V.width),mt=window.innerWidth-Jn,he=Rp(Se,[Jn,Math.max(Jn,mt-Je)]);f.style.minWidth=We+"px",f.style.left=he+"px"}else{const Ee=V.right-z.right,Se=window.innerWidth-P.right-Ee,Ye=window.innerWidth-H.right-Se,We=H.width+Ye,Je=Math.max(We,V.width),mt=window.innerWidth-Jn,he=Rp(Se,[Jn,Math.max(Jn,mt-Je)]);f.style.minWidth=We+"px",f.style.right=he+"px"}const F=b(),K=window.innerHeight-Jn*2,te=S.scrollHeight,k=window.getComputedStyle(h),Y=parseInt(k.borderTopWidth,10),D=parseInt(k.paddingTop,10),q=parseInt(k.borderBottomWidth,10),B=parseInt(k.paddingBottom,10),L=Y+D+te+B+q,T=Math.min(N.offsetHeight*5,L),I=window.getComputedStyle(S),X=parseInt(I.paddingTop,10),Z=parseInt(I.paddingBottom,10),re=H.top+H.height/2-Jn,fe=K-re,ue=N.offsetHeight/2,se=N.offsetTop+ue,me=Y+D+se,pe=L-me;if(me<=re){const Ee=F.length>0&&N===F[F.length-1].ref.current;f.style.bottom="0px";const Se=h.clientHeight-S.offsetTop-S.offsetHeight,Ye=Math.max(fe,ue+(Ee?Z:0)+Se+q),We=me+Ye;f.style.height=We+"px"}else{const Ee=F.length>0&&N===F[0].ref.current;f.style.top="0px";const Ye=Math.max(re,Y+S.offsetTop+(Ee?X:0)+ue)+pe;f.style.height=Ye+"px",S.scrollTop=me-re+S.offsetTop}f.style.margin=`${Jn}px 0`,f.style.minHeight=T+"px",f.style.maxHeight=K+"px",o==null||o(),requestAnimationFrame(()=>w.current=!0)}},[b,l.trigger,l.valueNode,f,h,S,N,C,l.dir,o]);Mt(()=>A(),[A]);const[M,O]=x.useState();Mt(()=>{h&&O(window.getComputedStyle(h).zIndex)},[h]);const U=x.useCallback(H=>{H&&E.current===!0&&(A(),j==null||j(),E.current=!1)},[A,j]);return d.jsx(zO,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:w,onScrollButtonChange:U,children:d.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:d.jsx(Ae.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});tE.displayName=OO;var kO="SelectPopperPosition",Lp=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=Jn,...l}=e,u=cf(r);return d.jsx(O1,{...u,...l,ref:t,align:o,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Lp.displayName=kO;var[zO,kg]=gi(Xo,{}),Pp="SelectViewport",nE=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:o,...i}=e,l=io(Pp,r),u=kg(Pp,r),f=qe(t,l.onViewportChange),m=x.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(sf.Slot,{scope:r,children:d.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ve(i.onScroll,h=>{const g=h.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b!=null&&b.current&&v){const w=Math.abs(m.current-g.scrollTop);if(w>0){const E=window.innerHeight-Jn*2,S=parseFloat(v.style.minHeight),N=parseFloat(v.style.height),C=Math.max(S,N);if(C<E){const j=C+w,A=Math.min(E,j),M=j-A;v.style.height=A+"px",v.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,v.style.justifyContent="flex-end")}}}m.current=g.scrollTop})})})]})});nE.displayName=Pp;var rE="SelectGroup",[LO,PO]=gi(rE),UO=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,i=Er();return d.jsx(LO,{scope:r,id:i,children:d.jsx(Ae.div,{role:"group","aria-labelledby":i,...o,ref:t})})});UO.displayName=rE;var aE="SelectLabel",BO=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,i=PO(aE,r);return d.jsx(Ae.div,{id:i.id,...o,ref:t})});BO.displayName=aE;var Sd="SelectItem",[HO,oE]=gi(Sd),sE=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:o,disabled:i=!1,textValue:l,...u}=e,f=so(Sd,r),m=io(Sd,r),h=f.value===o,[g,v]=x.useState(l??""),[b,w]=x.useState(!1),E=qe(t,j=>{var A;return(A=m.itemRefCallback)==null?void 0:A.call(m,j,o,i)}),S=Er(),N=x.useRef("touch"),C=()=>{i||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(HO,{scope:r,value:o,disabled:i,textId:S,isSelected:h,onItemTextChange:x.useCallback(j=>{v(A=>A||((j==null?void 0:j.textContent)??"").trim())},[]),children:d.jsx(sf.ItemSlot,{scope:r,value:o,disabled:i,textValue:g,children:d.jsx(Ae.div,{role:"option","aria-labelledby":S,"data-highlighted":b?"":void 0,"aria-selected":h&&b,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:E,onFocus:ve(u.onFocus,()=>w(!0)),onBlur:ve(u.onBlur,()=>w(!1)),onClick:ve(u.onClick,()=>{N.current!=="mouse"&&C()}),onPointerUp:ve(u.onPointerUp,()=>{N.current==="mouse"&&C()}),onPointerDown:ve(u.onPointerDown,j=>{N.current=j.pointerType}),onPointerMove:ve(u.onPointerMove,j=>{var A;N.current=j.pointerType,i?(A=m.onItemLeave)==null||A.call(m):N.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(u.onPointerLeave,j=>{var A;j.currentTarget===document.activeElement&&((A=m.onItemLeave)==null||A.call(m))}),onKeyDown:ve(u.onKeyDown,j=>{var M;((M=m.searchRef)==null?void 0:M.current)!==""&&j.key===" "||(NO.includes(j.key)&&C(),j.key===" "&&j.preventDefault())})})})})});sE.displayName=Sd;var Tl="SelectItemText",iE=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:i,...l}=e,u=so(Tl,r),f=io(Tl,r),m=oE(Tl,r),h=AO(Tl,r),[g,v]=x.useState(null),b=qe(t,C=>v(C),m.onItemTextChange,C=>{var j;return(j=f.itemTextRefCallback)==null?void 0:j.call(f,C,m.value,m.disabled)}),w=g==null?void 0:g.textContent,E=x.useMemo(()=>d.jsx("option",{value:m.value,disabled:m.disabled,children:w},m.value),[m.disabled,m.value,w]),{onNativeOptionAdd:S,onNativeOptionRemove:N}=h;return Mt(()=>(S(E),()=>N(E)),[S,N,E]),d.jsxs(d.Fragment,{children:[d.jsx(Ae.span,{id:m.textId,...l,ref:b}),m.isSelected&&u.valueNode&&!u.valueNodeHasChildren?oc.createPortal(l.children,u.valueNode):null]})});iE.displayName=Tl;var lE="SelectItemIndicator",cE=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return oE(lE,r).isSelected?d.jsx(Ae.span,{"aria-hidden":!0,...o,ref:t}):null});cE.displayName=lE;var Up="SelectScrollUpButton",uE=x.forwardRef((e,t)=>{const r=io(Up,e.__scopeSelect),o=kg(Up,e.__scopeSelect),[i,l]=x.useState(!1),u=qe(t,o.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const h=m.scrollTop>0;l(h)};const m=r.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),i?d.jsx(fE,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=r;f&&m&&(f.scrollTop=f.scrollTop-m.offsetHeight)}}):null});uE.displayName=Up;var Bp="SelectScrollDownButton",dE=x.forwardRef((e,t)=>{const r=io(Bp,e.__scopeSelect),o=kg(Bp,e.__scopeSelect),[i,l]=x.useState(!1),u=qe(t,o.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const h=m.scrollHeight-m.clientHeight,g=Math.ceil(m.scrollTop)<h;l(g)};const m=r.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),i?d.jsx(fE,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=r;f&&m&&(f.scrollTop=f.scrollTop+m.offsetHeight)}}):null});dE.displayName=Bp;var fE=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:o,...i}=e,l=io("SelectScrollButton",r),u=x.useRef(null),f=lf(r),m=x.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return x.useEffect(()=>()=>m(),[m]),Mt(()=>{var g;const h=f().find(v=>v.ref.current===document.activeElement);(g=h==null?void 0:h.ref.current)==null||g.scrollIntoView({block:"nearest"})},[f]),d.jsx(Ae.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ve(i.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(o,50))}),onPointerMove:ve(i.onPointerMove,()=>{var h;(h=l.onItemLeave)==null||h.call(l),u.current===null&&(u.current=window.setInterval(o,50))}),onPointerLeave:ve(i.onPointerLeave,()=>{m()})})}),$O="SelectSeparator",IO=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return d.jsx(Ae.div,{"aria-hidden":!0,...o,ref:t})});IO.displayName=$O;var Hp="SelectArrow",VO=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,i=cf(r),l=so(Hp,r),u=io(Hp,r);return l.open&&u.position==="popper"?d.jsx(k1,{...i,...o,ref:t}):null});VO.displayName=Hp;var qO="SelectBubbleInput",hE=x.forwardRef(({__scopeSelect:e,value:t,...r},o)=>{const i=x.useRef(null),l=qe(o,i),u=z1(t);return x.useEffect(()=>{const f=i.current;if(!f)return;const m=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(m,"value").set;if(u!==t&&g){const v=new Event("change",{bubbles:!0});g.call(f,t),f.dispatchEvent(v)}},[u,t]),d.jsx(Ae.select,{...r,style:{...L1,...r.style},ref:l,defaultValue:t})});hE.displayName=qO;function mE(e){return e===""||e===void 0}function pE(e){const t=It(e),r=x.useRef(""),o=x.useRef(0),i=x.useCallback(u=>{const f=r.current+u;t(f),function m(h){r.current=h,window.clearTimeout(o.current),h!==""&&(o.current=window.setTimeout(()=>m(""),1e3))}(f)},[t]),l=x.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,i,l]}function gE(e,t,r){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=YO(e,Math.max(l,0));i.length===1&&(u=u.filter(h=>h!==r));const m=u.find(h=>h.textValue.toLowerCase().startsWith(i.toLowerCase()));return m!==r?m:void 0}function YO(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var GO=Y1,FO=F1,XO=W1,WO=K1,KO=Z1,ZO=Q1,QO=nE,JO=sE,ek=iE,tk=cE,nk=uE,rk=dE;/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ak=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ok=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,o)=>o?o.toUpperCase():r.toLowerCase()),$b=e=>{const t=ok(e);return t.charAt(0).toUpperCase()+t.slice(1)},vE=(...e)=>e.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim(),sk=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var ik={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"};/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lk=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:i="",children:l,iconNode:u,...f},m)=>x.createElement("svg",{ref:m,...ik,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:vE("lucide",i),...!l&&!sk(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,g])=>x.createElement(h,g)),...Array.isArray(l)?l:[l]]));/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ze=(e,t)=>{const r=x.forwardRef(({className:o,...i},l)=>x.createElement(lk,{ref:l,iconNode:t,className:vE(`lucide-${ak($b(e))}`,`lucide-${e}`,o),...i}));return r.displayName=$b(e),r};/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ck=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],uk=ze("activity",ck);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],cc=ze("arrow-left",dk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yE=ze("check",fk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xE=ze("chevron-down",hk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mk=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],pk=ze("chevron-up",mk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ed=ze("circle-alert",gk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vk=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Nd=ze("circle-check-big",vk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],xk=ze("circle-plus",yk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],bE=ze("circle-x",bk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],nr=ze("clock",wk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sk=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Ek=ze("code",Sk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nk=[["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"}]],Ck=ze("database",Nk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jk=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_k=ze("file-text",jk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ak=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Tk=ze("funnel",Ak);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rk=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],wE=ze("git-branch",Rk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mk=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Dk=ze("history",Mk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ok=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],op=ze("info",Ok);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kk=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],zk=ze("key",kk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lk=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Pk=ze("layout-dashboard",Lk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uk=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],zg=ze("log-out",Uk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bk=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Hk=ze("mail",Bk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $k=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Ik=ze("menu",$k);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vk=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],qk=ze("message-square",Vk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yk=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],SE=ze("network",Yk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gk=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],Ib=ze("octagon-alert",Gk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fk=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Xk=ze("play",Fk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$l=ze("plus",Wk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kk=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Lg=ze("save",Kk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],es=ze("search",Zk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qk=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Il=ze("server",Qk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jk=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],e4=ze("shield-check",Jk);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const t4=[["path",{d:"M5 8V5c0-1 1-2 2-2h10c1 0 2 1 2 2v3",key:"1pi83i"}],["path",{d:"M19 16v3c0 1-1 2-2 2H7c-1 0-2-1-2-2v-3",key:"ido5k7"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],n4=ze("square-split-vertical",t4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const r4=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],EE=ze("terminal",r4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const a4=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Wo=ze("trash-2",a4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const o4=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Vb=ze("triangle-alert",o4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const s4=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Cd=ze("user",s4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const i4=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],uc=ze("users",i4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const l4=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],c4=ze("webhook",l4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const u4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],NE=ze("x",u4);/**
 * @license lucide-react v0.509.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const d4=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],CE=ze("zap",d4);function rr({...e}){return d.jsx(GO,{"data-slot":"select",...e})}function ar({...e}){return d.jsx(XO,{"data-slot":"select-value",...e})}function or({className:e,size:t="default",children:r,...o}){return d.jsxs(FO,{"data-slot":"select-trigger","data-size":t,className:Me("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),...o,children:[r,d.jsx(WO,{asChild:!0,children:d.jsx(xE,{className:"size-4 opacity-50"})})]})}function sr({className:e,children:t,position:r="popper",...o}){return d.jsx(KO,{children:d.jsxs(ZO,{"data-slot":"select-content",className:Me("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-x-hidden overflow-y-auto 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,...o,children:[d.jsx(f4,{}),d.jsx(QO,{className:Me("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(h4,{})]})})}function ct({className:e,children:t,...r}){return d.jsxs(JO,{"data-slot":"select-item",className:Me("focus:bg-accent focus:text-accent-foreground [&_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:[d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(tk,{children:d.jsx(yE,{className:"size-4"})})}),d.jsx(ek,{children:t})]})}function f4({className:e,...t}){return d.jsx(nk,{"data-slot":"select-scroll-up-button",className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(pk,{className:"size-4"})})}function h4({className:e,...t}){return d.jsx(rk,{"data-slot":"select-scroll-down-button",className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(xE,{className:"size-4"})})}function Ge({className:e,type:t,...r}){return d.jsx("input",{type:t,"data-slot":"input",className:Me("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","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",e),...r})}function jE(e,t){return function(){return e.apply(t,arguments)}}const{toString:m4}=Object.prototype,{getPrototypeOf:Pg}=Object,{iterator:uf,toStringTag:_E}=Symbol,df=(e=>t=>{const r=m4.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),hr=e=>(e=e.toLowerCase(),t=>df(t)===e),ff=e=>t=>typeof t===e,{isArray:vi}=Array,Vl=ff("undefined");function p4(e){return e!==null&&!Vl(e)&&e.constructor!==null&&!Vl(e.constructor)&&pn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const AE=hr("ArrayBuffer");function g4(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&AE(e.buffer),t}const v4=ff("string"),pn=ff("function"),TE=ff("number"),hf=e=>e!==null&&typeof e=="object",y4=e=>e===!0||e===!1,ld=e=>{if(df(e)!=="object")return!1;const t=Pg(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(_E in e)&&!(uf in e)},x4=hr("Date"),b4=hr("File"),w4=hr("Blob"),S4=hr("FileList"),E4=e=>hf(e)&&pn(e.pipe),N4=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||pn(e.append)&&((t=df(e))==="formdata"||t==="object"&&pn(e.toString)&&e.toString()==="[object FormData]"))},C4=hr("URLSearchParams"),[j4,_4,A4,T4]=["ReadableStream","Request","Response","Headers"].map(hr),R4=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function dc(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let o,i;if(typeof e!="object"&&(e=[e]),vi(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{const l=r?Object.getOwnPropertyNames(e):Object.keys(e),u=l.length;let f;for(o=0;o<u;o++)f=l[o],t.call(null,e[f],f,e)}}function RE(e,t){t=t.toLowerCase();const r=Object.keys(e);let o=r.length,i;for(;o-- >0;)if(i=r[o],t===i.toLowerCase())return i;return null}const zo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ME=e=>!Vl(e)&&e!==zo;function $p(){const{caseless:e}=ME(this)&&this||{},t={},r=(o,i)=>{const l=e&&RE(t,i)||i;ld(t[l])&&ld(o)?t[l]=$p(t[l],o):ld(o)?t[l]=$p({},o):vi(o)?t[l]=o.slice():t[l]=o};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&dc(arguments[o],r);return t}const M4=(e,t,r,{allOwnKeys:o}={})=>(dc(t,(i,l)=>{r&&pn(i)?e[l]=jE(i,r):e[l]=i},{allOwnKeys:o}),e),D4=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),O4=(e,t,r,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},k4=(e,t,r,o)=>{let i,l,u;const f={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),l=i.length;l-- >0;)u=i[l],(!o||o(u,e,t))&&!f[u]&&(t[u]=e[u],f[u]=!0);e=r!==!1&&Pg(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},z4=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const o=e.indexOf(t,r);return o!==-1&&o===r},L4=e=>{if(!e)return null;if(vi(e))return e;let t=e.length;if(!TE(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},P4=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Pg(Uint8Array)),U4=(e,t)=>{const o=(e&&e[uf]).call(e);let i;for(;(i=o.next())&&!i.done;){const l=i.value;t.call(e,l[0],l[1])}},B4=(e,t)=>{let r;const o=[];for(;(r=e.exec(t))!==null;)o.push(r);return o},H4=hr("HTMLFormElement"),$4=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,i){return o.toUpperCase()+i}),qb=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),I4=hr("RegExp"),DE=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),o={};dc(r,(i,l)=>{let u;(u=t(i,l,e))!==!1&&(o[l]=u||i)}),Object.defineProperties(e,o)},V4=e=>{DE(e,(t,r)=>{if(pn(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const o=e[r];if(pn(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},q4=(e,t)=>{const r={},o=i=>{i.forEach(l=>{r[l]=!0})};return vi(e)?o(e):o(String(e).split(t)),r},Y4=()=>{},G4=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function F4(e){return!!(e&&pn(e.append)&&e[_E]==="FormData"&&e[uf])}const X4=e=>{const t=new Array(10),r=(o,i)=>{if(hf(o)){if(t.indexOf(o)>=0)return;if(!("toJSON"in o)){t[i]=o;const l=vi(o)?[]:{};return dc(o,(u,f)=>{const m=r(u,i+1);!Vl(m)&&(l[f]=m)}),t[i]=void 0,l}}return o};return r(e,0)},W4=hr("AsyncFunction"),K4=e=>e&&(hf(e)||pn(e))&&pn(e.then)&&pn(e.catch),OE=((e,t)=>e?setImmediate:t?((r,o)=>(zo.addEventListener("message",({source:i,data:l})=>{i===zo&&l===r&&o.length&&o.shift()()},!1),i=>{o.push(i),zo.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",pn(zo.postMessage)),Z4=typeof queueMicrotask<"u"?queueMicrotask.bind(zo):typeof process<"u"&&process.nextTick||OE,Q4=e=>e!=null&&pn(e[uf]),oe={isArray:vi,isArrayBuffer:AE,isBuffer:p4,isFormData:N4,isArrayBufferView:g4,isString:v4,isNumber:TE,isBoolean:y4,isObject:hf,isPlainObject:ld,isReadableStream:j4,isRequest:_4,isResponse:A4,isHeaders:T4,isUndefined:Vl,isDate:x4,isFile:b4,isBlob:w4,isRegExp:I4,isFunction:pn,isStream:E4,isURLSearchParams:C4,isTypedArray:P4,isFileList:S4,forEach:dc,merge:$p,extend:M4,trim:R4,stripBOM:D4,inherits:O4,toFlatObject:k4,kindOf:df,kindOfTest:hr,endsWith:z4,toArray:L4,forEachEntry:U4,matchAll:B4,isHTMLForm:H4,hasOwnProperty:qb,hasOwnProp:qb,reduceDescriptors:DE,freezeMethods:V4,toObjectSet:q4,toCamelCase:$4,noop:Y4,toFiniteNumber:G4,findKey:RE,global:zo,isContextDefined:ME,isSpecCompliantForm:F4,toJSONObject:X4,isAsyncFn:W4,isThenable:K4,setImmediate:OE,asap:Z4,isIterable:Q4};function Oe(e,t,r,o,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),i&&(this.response=i,this.status=i.status?i.status:null)}oe.inherits(Oe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const kE=Oe.prototype,zE={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{zE[e]={value:e}});Object.defineProperties(Oe,zE);Object.defineProperty(kE,"isAxiosError",{value:!0});Oe.from=(e,t,r,o,i,l)=>{const u=Object.create(kE);return oe.toFlatObject(e,u,function(m){return m!==Error.prototype},f=>f!=="isAxiosError"),Oe.call(u,e.message,t,r,o,i),u.cause=e,u.name=e.name,l&&Object.assign(u,l),u};const J4=null;function Ip(e){return oe.isPlainObject(e)||oe.isArray(e)}function LE(e){return oe.endsWith(e,"[]")?e.slice(0,-2):e}function Yb(e,t,r){return e?e.concat(t).map(function(i,l){return i=LE(i),!r&&l?"["+i+"]":i}).join(r?".":""):t}function e3(e){return oe.isArray(e)&&!e.some(Ip)}const t3=oe.toFlatObject(oe,{},null,function(t){return/^is[A-Z]/.test(t)});function mf(e,t,r){if(!oe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=oe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,N){return!oe.isUndefined(N[S])});const o=r.metaTokens,i=r.visitor||g,l=r.dots,u=r.indexes,m=(r.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(t);if(!oe.isFunction(i))throw new TypeError("visitor must be a function");function h(E){if(E===null)return"";if(oe.isDate(E))return E.toISOString();if(!m&&oe.isBlob(E))throw new Oe("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(E)||oe.isTypedArray(E)?m&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function g(E,S,N){let C=E;if(E&&!N&&typeof E=="object"){if(oe.endsWith(S,"{}"))S=o?S:S.slice(0,-2),E=JSON.stringify(E);else if(oe.isArray(E)&&e3(E)||(oe.isFileList(E)||oe.endsWith(S,"[]"))&&(C=oe.toArray(E)))return S=LE(S),C.forEach(function(A,M){!(oe.isUndefined(A)||A===null)&&t.append(u===!0?Yb([S],M,l):u===null?S:S+"[]",h(A))}),!1}return Ip(E)?!0:(t.append(Yb(N,S,l),h(E)),!1)}const v=[],b=Object.assign(t3,{defaultVisitor:g,convertValue:h,isVisitable:Ip});function w(E,S){if(!oe.isUndefined(E)){if(v.indexOf(E)!==-1)throw Error("Circular reference detected in "+S.join("."));v.push(E),oe.forEach(E,function(C,j){(!(oe.isUndefined(C)||C===null)&&i.call(t,C,oe.isString(j)?j.trim():j,S,b))===!0&&w(C,S?S.concat(j):[j])}),v.pop()}}if(!oe.isObject(e))throw new TypeError("data must be an object");return w(e),t}function Gb(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function Ug(e,t){this._pairs=[],e&&mf(e,this,t)}const PE=Ug.prototype;PE.append=function(t,r){this._pairs.push([t,r])};PE.toString=function(t){const r=t?function(o){return t.call(this,o,Gb)}:Gb;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function n3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UE(e,t,r){if(!t)return e;const o=r&&r.encode||n3;oe.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let l;if(i?l=i(t,r):l=oe.isURLSearchParams(t)?t.toString():new Ug(t,r).toString(o),l){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class Fb{constructor(){this.handlers=[]}use(t,r,o){return this.handlers.push({fulfilled:t,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){oe.forEach(this.handlers,function(o){o!==null&&t(o)})}}const BE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},r3=typeof URLSearchParams<"u"?URLSearchParams:Ug,a3=typeof FormData<"u"?FormData:null,o3=typeof Blob<"u"?Blob:null,s3={isBrowser:!0,classes:{URLSearchParams:r3,FormData:a3,Blob:o3},protocols:["http","https","file","blob","url","data"]},Bg=typeof window<"u"&&typeof document<"u",Vp=typeof navigator=="object"&&navigator||void 0,i3=Bg&&(!Vp||["ReactNative","NativeScript","NS"].indexOf(Vp.product)<0),l3=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",c3=Bg&&window.location.href||"http://localhost",u3=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bg,hasStandardBrowserEnv:i3,hasStandardBrowserWebWorkerEnv:l3,navigator:Vp,origin:c3},Symbol.toStringTag,{value:"Module"})),Jt={...u3,...s3};function d3(e,t){return mf(e,new Jt.classes.URLSearchParams,Object.assign({visitor:function(r,o,i,l){return Jt.isNode&&oe.isBuffer(r)?(this.append(o,r.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},t))}function f3(e){return oe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function h3(e){const t={},r=Object.keys(e);let o;const i=r.length;let l;for(o=0;o<i;o++)l=r[o],t[l]=e[l];return t}function HE(e){function t(r,o,i,l){let u=r[l++];if(u==="__proto__")return!0;const f=Number.isFinite(+u),m=l>=r.length;return u=!u&&oe.isArray(i)?i.length:u,m?(oe.hasOwnProp(i,u)?i[u]=[i[u],o]:i[u]=o,!f):((!i[u]||!oe.isObject(i[u]))&&(i[u]=[]),t(r,o,i[u],l)&&oe.isArray(i[u])&&(i[u]=h3(i[u])),!f)}if(oe.isFormData(e)&&oe.isFunction(e.entries)){const r={};return oe.forEachEntry(e,(o,i)=>{t(f3(o),i,r,0)}),r}return null}function m3(e,t,r){if(oe.isString(e))try{return(t||JSON.parse)(e),oe.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(e)}const fc={transitional:BE,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const o=r.getContentType()||"",i=o.indexOf("application/json")>-1,l=oe.isObject(t);if(l&&oe.isHTMLForm(t)&&(t=new FormData(t)),oe.isFormData(t))return i?JSON.stringify(HE(t)):t;if(oe.isArrayBuffer(t)||oe.isBuffer(t)||oe.isStream(t)||oe.isFile(t)||oe.isBlob(t)||oe.isReadableStream(t))return t;if(oe.isArrayBufferView(t))return t.buffer;if(oe.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let f;if(l){if(o.indexOf("application/x-www-form-urlencoded")>-1)return d3(t,this.formSerializer).toString();if((f=oe.isFileList(t))||o.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return mf(f?{"files[]":t}:t,m&&new m,this.formSerializer)}}return l||i?(r.setContentType("application/json",!1),m3(t)):t}],transformResponse:[function(t){const r=this.transitional||fc.transitional,o=r&&r.forcedJSONParsing,i=this.responseType==="json";if(oe.isResponse(t)||oe.isReadableStream(t))return t;if(t&&oe.isString(t)&&(o&&!this.responseType||i)){const u=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(f){if(u)throw f.name==="SyntaxError"?Oe.from(f,Oe.ERR_BAD_RESPONSE,this,null,this.response):f}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Jt.classes.FormData,Blob:Jt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],e=>{fc.headers[e]={}});const p3=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),g3=e=>{const t={};let r,o,i;return e&&e.split(`
`).forEach(function(u){i=u.indexOf(":"),r=u.substring(0,i).trim().toLowerCase(),o=u.substring(i+1).trim(),!(!r||t[r]&&p3[r])&&(r==="set-cookie"?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)}),t},Xb=Symbol("internals");function wl(e){return e&&String(e).trim().toLowerCase()}function cd(e){return e===!1||e==null?e:oe.isArray(e)?e.map(cd):String(e)}function v3(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}const y3=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sp(e,t,r,o,i){if(oe.isFunction(o))return o.call(this,t,r);if(i&&(t=r),!!oe.isString(t)){if(oe.isString(o))return t.indexOf(o)!==-1;if(oe.isRegExp(o))return o.test(t)}}function x3(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,o)=>r.toUpperCase()+o)}function b3(e,t){const r=oe.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+r,{value:function(i,l,u){return this[o].call(this,t,i,l,u)},configurable:!0})})}let gn=class{constructor(t){t&&this.set(t)}set(t,r,o){const i=this;function l(f,m,h){const g=wl(m);if(!g)throw new Error("header name must be a non-empty string");const v=oe.findKey(i,g);(!v||i[v]===void 0||h===!0||h===void 0&&i[v]!==!1)&&(i[v||m]=cd(f))}const u=(f,m)=>oe.forEach(f,(h,g)=>l(h,g,m));if(oe.isPlainObject(t)||t instanceof this.constructor)u(t,r);else if(oe.isString(t)&&(t=t.trim())&&!y3(t))u(g3(t),r);else if(oe.isObject(t)&&oe.isIterable(t)){let f={},m,h;for(const g of t){if(!oe.isArray(g))throw TypeError("Object iterator must return a key-value pair");f[h=g[0]]=(m=f[h])?oe.isArray(m)?[...m,g[1]]:[m,g[1]]:g[1]}u(f,r)}else t!=null&&l(r,t,o);return this}get(t,r){if(t=wl(t),t){const o=oe.findKey(this,t);if(o){const i=this[o];if(!r)return i;if(r===!0)return v3(i);if(oe.isFunction(r))return r.call(this,i,o);if(oe.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=wl(t),t){const o=oe.findKey(this,t);return!!(o&&this[o]!==void 0&&(!r||sp(this,this[o],o,r)))}return!1}delete(t,r){const o=this;let i=!1;function l(u){if(u=wl(u),u){const f=oe.findKey(o,u);f&&(!r||sp(o,o[f],f,r))&&(delete o[f],i=!0)}}return oe.isArray(t)?t.forEach(l):l(t),i}clear(t){const r=Object.keys(this);let o=r.length,i=!1;for(;o--;){const l=r[o];(!t||sp(this,this[l],l,t,!0))&&(delete this[l],i=!0)}return i}normalize(t){const r=this,o={};return oe.forEach(this,(i,l)=>{const u=oe.findKey(o,l);if(u){r[u]=cd(i),delete r[l];return}const f=t?x3(l):String(l).trim();f!==l&&delete r[l],r[f]=cd(i),o[f]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return oe.forEach(this,(o,i)=>{o!=null&&o!==!1&&(r[i]=t&&oe.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const o=new this(t);return r.forEach(i=>o.set(i)),o}static accessor(t){const o=(this[Xb]=this[Xb]={accessors:{}}).accessors,i=this.prototype;function l(u){const f=wl(u);o[f]||(b3(i,u),o[f]=!0)}return oe.isArray(t)?t.forEach(l):l(t),this}};gn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);oe.reduceDescriptors(gn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[r]=o}}});oe.freezeMethods(gn);function ip(e,t){const r=this||fc,o=t||r,i=gn.from(o.headers);let l=o.data;return oe.forEach(e,function(f){l=f.call(r,l,i.normalize(),t?t.status:void 0)}),i.normalize(),l}function $E(e){return!!(e&&e.__CANCEL__)}function yi(e,t,r){Oe.call(this,e??"canceled",Oe.ERR_CANCELED,t,r),this.name="CanceledError"}oe.inherits(yi,Oe,{__CANCEL__:!0});function IE(e,t,r){const o=r.config.validateStatus;!r.status||!o||o(r.status)?e(r):t(new Oe("Request failed with status code "+r.status,[Oe.ERR_BAD_REQUEST,Oe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function w3(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function S3(e,t){e=e||10;const r=new Array(e),o=new Array(e);let i=0,l=0,u;return t=t!==void 0?t:1e3,function(m){const h=Date.now(),g=o[l];u||(u=h),r[i]=m,o[i]=h;let v=l,b=0;for(;v!==i;)b+=r[v++],v=v%e;if(i=(i+1)%e,i===l&&(l=(l+1)%e),h-u<t)return;const w=g&&h-g;return w?Math.round(b*1e3/w):void 0}}function E3(e,t){let r=0,o=1e3/t,i,l;const u=(h,g=Date.now())=>{r=g,i=null,l&&(clearTimeout(l),l=null),e.apply(null,h)};return[(...h)=>{const g=Date.now(),v=g-r;v>=o?u(h,g):(i=h,l||(l=setTimeout(()=>{l=null,u(i)},o-v)))},()=>i&&u(i)]}const jd=(e,t,r=3)=>{let o=0;const i=S3(50,250);return E3(l=>{const u=l.loaded,f=l.lengthComputable?l.total:void 0,m=u-o,h=i(m),g=u<=f;o=u;const v={loaded:u,total:f,progress:f?u/f:void 0,bytes:m,rate:h||void 0,estimated:h&&f&&g?(f-u)/h:void 0,event:l,lengthComputable:f!=null,[t?"download":"upload"]:!0};e(v)},r)},Wb=(e,t)=>{const r=e!=null;return[o=>t[0]({lengthComputable:r,total:e,loaded:o}),t[1]]},Kb=e=>(...t)=>oe.asap(()=>e(...t)),N3=Jt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Jt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Jt.origin),Jt.navigator&&/(msie|trident)/i.test(Jt.navigator.userAgent)):()=>!0,C3=Jt.hasStandardBrowserEnv?{write(e,t,r,o,i,l){const u=[e+"="+encodeURIComponent(t)];oe.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),oe.isString(o)&&u.push("path="+o),oe.isString(i)&&u.push("domain="+i),l===!0&&u.push("secure"),document.cookie=u.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function j3(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function _3(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function VE(e,t,r){let o=!j3(t);return e&&(o||r==!1)?_3(e,t):t}const Zb=e=>e instanceof gn?{...e}:e;function Ko(e,t){t=t||{};const r={};function o(h,g,v,b){return oe.isPlainObject(h)&&oe.isPlainObject(g)?oe.merge.call({caseless:b},h,g):oe.isPlainObject(g)?oe.merge({},g):oe.isArray(g)?g.slice():g}function i(h,g,v,b){if(oe.isUndefined(g)){if(!oe.isUndefined(h))return o(void 0,h,v,b)}else return o(h,g,v,b)}function l(h,g){if(!oe.isUndefined(g))return o(void 0,g)}function u(h,g){if(oe.isUndefined(g)){if(!oe.isUndefined(h))return o(void 0,h)}else return o(void 0,g)}function f(h,g,v){if(v in t)return o(h,g);if(v in e)return o(void 0,h)}const m={url:l,method:l,data:l,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:f,headers:(h,g,v)=>i(Zb(h),Zb(g),v,!0)};return oe.forEach(Object.keys(Object.assign({},e,t)),function(g){const v=m[g]||i,b=v(e[g],t[g],g);oe.isUndefined(b)&&v!==f||(r[g]=b)}),r}const qE=e=>{const t=Ko({},e);let{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:l,headers:u,auth:f}=t;t.headers=u=gn.from(u),t.url=UE(VE(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),f&&u.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):"")));let m;if(oe.isFormData(r)){if(Jt.hasStandardBrowserEnv||Jt.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((m=u.getContentType())!==!1){const[h,...g]=m?m.split(";").map(v=>v.trim()).filter(Boolean):[];u.setContentType([h||"multipart/form-data",...g].join("; "))}}if(Jt.hasStandardBrowserEnv&&(o&&oe.isFunction(o)&&(o=o(t)),o||o!==!1&&N3(t.url))){const h=i&&l&&C3.read(l);h&&u.set(i,h)}return t},A3=typeof XMLHttpRequest<"u",T3=A3&&function(e){return new Promise(function(r,o){const i=qE(e);let l=i.data;const u=gn.from(i.headers).normalize();let{responseType:f,onUploadProgress:m,onDownloadProgress:h}=i,g,v,b,w,E;function S(){w&&w(),E&&E(),i.cancelToken&&i.cancelToken.unsubscribe(g),i.signal&&i.signal.removeEventListener("abort",g)}let N=new XMLHttpRequest;N.open(i.method.toUpperCase(),i.url,!0),N.timeout=i.timeout;function C(){if(!N)return;const A=gn.from("getAllResponseHeaders"in N&&N.getAllResponseHeaders()),O={data:!f||f==="text"||f==="json"?N.responseText:N.response,status:N.status,statusText:N.statusText,headers:A,config:e,request:N};IE(function(H){r(H),S()},function(H){o(H),S()},O),N=null}"onloadend"in N?N.onloadend=C:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.indexOf("file:")===0)||setTimeout(C)},N.onabort=function(){N&&(o(new Oe("Request aborted",Oe.ECONNABORTED,e,N)),N=null)},N.onerror=function(){o(new Oe("Network Error",Oe.ERR_NETWORK,e,N)),N=null},N.ontimeout=function(){let M=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const O=i.transitional||BE;i.timeoutErrorMessage&&(M=i.timeoutErrorMessage),o(new Oe(M,O.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,e,N)),N=null},l===void 0&&u.setContentType(null),"setRequestHeader"in N&&oe.forEach(u.toJSON(),function(M,O){N.setRequestHeader(O,M)}),oe.isUndefined(i.withCredentials)||(N.withCredentials=!!i.withCredentials),f&&f!=="json"&&(N.responseType=i.responseType),h&&([b,E]=jd(h,!0),N.addEventListener("progress",b)),m&&N.upload&&([v,w]=jd(m),N.upload.addEventListener("progress",v),N.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(g=A=>{N&&(o(!A||A.type?new yi(null,e,N):A),N.abort(),N=null)},i.cancelToken&&i.cancelToken.subscribe(g),i.signal&&(i.signal.aborted?g():i.signal.addEventListener("abort",g)));const j=w3(i.url);if(j&&Jt.protocols.indexOf(j)===-1){o(new Oe("Unsupported protocol "+j+":",Oe.ERR_BAD_REQUEST,e));return}N.send(l||null)})},R3=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let o=new AbortController,i;const l=function(h){if(!i){i=!0,f();const g=h instanceof Error?h:this.reason;o.abort(g instanceof Oe?g:new yi(g instanceof Error?g.message:g))}};let u=t&&setTimeout(()=>{u=null,l(new Oe(`timeout ${t} of ms exceeded`,Oe.ETIMEDOUT))},t);const f=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(l):h.removeEventListener("abort",l)}),e=null)};e.forEach(h=>h.addEventListener("abort",l));const{signal:m}=o;return m.unsubscribe=()=>oe.asap(f),m}},M3=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let o=0,i;for(;o<r;)i=o+t,yield e.slice(o,i),o=i},D3=async function*(e,t){for await(const r of O3(e))yield*M3(r,t)},O3=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:o}=await t.read();if(r)break;yield o}}finally{await t.cancel()}},Qb=(e,t,r,o)=>{const i=D3(e,t);let l=0,u,f=m=>{u||(u=!0,o&&o(m))};return new ReadableStream({async pull(m){try{const{done:h,value:g}=await i.next();if(h){f(),m.close();return}let v=g.byteLength;if(r){let b=l+=v;r(b)}m.enqueue(new Uint8Array(g))}catch(h){throw f(h),h}},cancel(m){return f(m),i.return()}},{highWaterMark:2})},pf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",YE=pf&&typeof ReadableStream=="function",k3=pf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),GE=(e,...t)=>{try{return!!e(...t)}catch{return!1}},z3=YE&&GE(()=>{let e=!1;const t=new Request(Jt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Jb=64*1024,qp=YE&&GE(()=>oe.isReadableStream(new Response("").body)),_d={stream:qp&&(e=>e.body)};pf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_d[t]&&(_d[t]=oe.isFunction(e[t])?r=>r[t]():(r,o)=>{throw new Oe(`Response type '${t}' is not supported`,Oe.ERR_NOT_SUPPORT,o)})})})(new Response);const L3=async e=>{if(e==null)return 0;if(oe.isBlob(e))return e.size;if(oe.isSpecCompliantForm(e))return(await new Request(Jt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(oe.isArrayBufferView(e)||oe.isArrayBuffer(e))return e.byteLength;if(oe.isURLSearchParams(e)&&(e=e+""),oe.isString(e))return(await k3(e)).byteLength},P3=async(e,t)=>{const r=oe.toFiniteNumber(e.getContentLength());return r??L3(t)},U3=pf&&(async e=>{let{url:t,method:r,data:o,signal:i,cancelToken:l,timeout:u,onDownloadProgress:f,onUploadProgress:m,responseType:h,headers:g,withCredentials:v="same-origin",fetchOptions:b}=qE(e);h=h?(h+"").toLowerCase():"text";let w=R3([i,l&&l.toAbortSignal()],u),E;const S=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let N;try{if(m&&z3&&r!=="get"&&r!=="head"&&(N=await P3(g,o))!==0){let O=new Request(t,{method:"POST",body:o,duplex:"half"}),U;if(oe.isFormData(o)&&(U=O.headers.get("content-type"))&&g.setContentType(U),O.body){const[H,V]=Wb(N,jd(Kb(m)));o=Qb(O.body,Jb,H,V)}}oe.isString(v)||(v=v?"include":"omit");const C="credentials"in Request.prototype;E=new Request(t,{...b,signal:w,method:r.toUpperCase(),headers:g.normalize().toJSON(),body:o,duplex:"half",credentials:C?v:void 0});let j=await fetch(E);const A=qp&&(h==="stream"||h==="response");if(qp&&(f||A&&S)){const O={};["status","statusText","headers"].forEach(P=>{O[P]=j[P]});const U=oe.toFiniteNumber(j.headers.get("content-length")),[H,V]=f&&Wb(U,jd(Kb(f),!0))||[];j=new Response(Qb(j.body,Jb,H,()=>{V&&V(),S&&S()}),O)}h=h||"text";let M=await _d[oe.findKey(_d,h)||"text"](j,e);return!A&&S&&S(),await new Promise((O,U)=>{IE(O,U,{data:M,headers:gn.from(j.headers),status:j.status,statusText:j.statusText,config:e,request:E})})}catch(C){throw S&&S(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new Oe("Network Error",Oe.ERR_NETWORK,e,E),{cause:C.cause||C}):Oe.from(C,C&&C.code,e,E)}}),Yp={http:J4,xhr:T3,fetch:U3};oe.forEach(Yp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ew=e=>`- ${e}`,B3=e=>oe.isFunction(e)||e===null||e===!1,FE={getAdapter:e=>{e=oe.isArray(e)?e:[e];const{length:t}=e;let r,o;const i={};for(let l=0;l<t;l++){r=e[l];let u;if(o=r,!B3(r)&&(o=Yp[(u=String(r)).toLowerCase()],o===void 0))throw new Oe(`Unknown adapter '${u}'`);if(o)break;i[u||"#"+l]=o}if(!o){const l=Object.entries(i).map(([f,m])=>`adapter ${f} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=t?l.length>1?`since :
`+l.map(ew).join(`
`):" "+ew(l[0]):"as no adapter specified";throw new Oe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return o},adapters:Yp};function lp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yi(null,e)}function tw(e){return lp(e),e.headers=gn.from(e.headers),e.data=ip.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),FE.getAdapter(e.adapter||fc.adapter)(e).then(function(o){return lp(e),o.data=ip.call(e,e.transformResponse,o),o.headers=gn.from(o.headers),o},function(o){return $E(o)||(lp(e),o&&o.response&&(o.response.data=ip.call(e,e.transformResponse,o.response),o.response.headers=gn.from(o.response.headers))),Promise.reject(o)})}const XE="1.9.0",gf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gf[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const nw={};gf.transitional=function(t,r,o){function i(l,u){return"[Axios v"+XE+"] Transitional option '"+l+"'"+u+(o?". "+o:"")}return(l,u,f)=>{if(t===!1)throw new Oe(i(u," has been removed"+(r?" in "+r:"")),Oe.ERR_DEPRECATED);return r&&!nw[u]&&(nw[u]=!0,console.warn(i(u," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(l,u,f):!0}};gf.spelling=function(t){return(r,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function H3(e,t,r){if(typeof e!="object")throw new Oe("options must be an object",Oe.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const l=o[i],u=t[l];if(u){const f=e[l],m=f===void 0||u(f,l,e);if(m!==!0)throw new Oe("option "+l+" must be "+m,Oe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Oe("Unknown option "+l,Oe.ERR_BAD_OPTION)}}const ud={assertOptions:H3,validators:gf},Sr=ud.validators;let Uo=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Fb,response:new Fb}}async request(t,r){try{return await this._request(t,r)}catch(o){if(o instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const l=i.stack?i.stack.replace(/^.+\n/,""):"";try{o.stack?l&&!String(o.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(o.stack+=`
`+l):o.stack=l}catch{}}throw o}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ko(this.defaults,r);const{transitional:o,paramsSerializer:i,headers:l}=r;o!==void 0&&ud.assertOptions(o,{silentJSONParsing:Sr.transitional(Sr.boolean),forcedJSONParsing:Sr.transitional(Sr.boolean),clarifyTimeoutError:Sr.transitional(Sr.boolean)},!1),i!=null&&(oe.isFunction(i)?r.paramsSerializer={serialize:i}:ud.assertOptions(i,{encode:Sr.function,serialize:Sr.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ud.assertOptions(r,{baseUrl:Sr.spelling("baseURL"),withXsrfToken:Sr.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let u=l&&oe.merge(l.common,l[r.method]);l&&oe.forEach(["delete","get","head","post","put","patch","common"],E=>{delete l[E]}),r.headers=gn.concat(u,l);const f=[];let m=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(r)===!1||(m=m&&S.synchronous,f.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let g,v=0,b;if(!m){const E=[tw.bind(this),void 0];for(E.unshift.apply(E,f),E.push.apply(E,h),b=E.length,g=Promise.resolve(r);v<b;)g=g.then(E[v++],E[v++]);return g}b=f.length;let w=r;for(v=0;v<b;){const E=f[v++],S=f[v++];try{w=E(w)}catch(N){S.call(this,N);break}}try{g=tw.call(this,w)}catch(E){return Promise.reject(E)}for(v=0,b=h.length;v<b;)g=g.then(h[v++],h[v++]);return g}getUri(t){t=Ko(this.defaults,t);const r=VE(t.baseURL,t.url,t.allowAbsoluteUrls);return UE(r,t.params,t.paramsSerializer)}};oe.forEach(["delete","get","head","options"],function(t){Uo.prototype[t]=function(r,o){return this.request(Ko(o||{},{method:t,url:r,data:(o||{}).data}))}});oe.forEach(["post","put","patch"],function(t){function r(o){return function(l,u,f){return this.request(Ko(f||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:l,data:u}))}}Uo.prototype[t]=r(),Uo.prototype[t+"Form"]=r(!0)});let $3=class WE{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(l){r=l});const o=this;this.promise.then(i=>{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](i);o._listeners=null}),this.promise.then=i=>{let l;const u=new Promise(f=>{o.subscribe(f),l=f}).then(i);return u.cancel=function(){o.unsubscribe(l)},u},t(function(l,u,f){o.reason||(o.reason=new yi(l,u,f),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=o=>{t.abort(o)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new WE(function(i){t=i}),cancel:t}}};function I3(e){return function(r){return e.apply(null,r)}}function V3(e){return oe.isObject(e)&&e.isAxiosError===!0}const Gp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Gp).forEach(([e,t])=>{Gp[t]=e});function KE(e){const t=new Uo(e),r=jE(Uo.prototype.request,t);return oe.extend(r,Uo.prototype,t,{allOwnKeys:!0}),oe.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return KE(Ko(e,i))},r}const Qe=KE(fc);Qe.Axios=Uo;Qe.CanceledError=yi;Qe.CancelToken=$3;Qe.isCancel=$E;Qe.VERSION=XE;Qe.toFormData=mf;Qe.AxiosError=Oe;Qe.Cancel=Qe.CanceledError;Qe.all=function(t){return Promise.all(t)};Qe.spread=I3;Qe.isAxiosError=V3;Qe.mergeConfig=Ko;Qe.AxiosHeaders=gn;Qe.formToJSON=e=>HE(oe.isHTMLForm(e)?new FormData(e):e);Qe.getAdapter=FE.getAdapter;Qe.HttpStatusCode=Gp;Qe.default=Qe;const{Axios:JI,AxiosError:e9,CanceledError:t9,isCancel:n9,CancelToken:r9,VERSION:a9,all:o9,Cancel:s9,isAxiosError:i9,spread:l9,toFormData:c9,AxiosHeaders:q3,HttpStatusCode:u9,formToJSON:d9,getAdapter:f9,mergeConfig:h9}=Qe;function Y3(e){return e.toLowerCase()}var G3=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],F3=/[^A-Z0-9]+/gi;function Hg(e,t){t===void 0&&(t={});for(var r=t.splitRegexp,o=r===void 0?G3:r,i=t.stripRegexp,l=i===void 0?F3:i,u=t.transform,f=u===void 0?Y3:u,m=t.delimiter,h=m===void 0?" ":m,g=rw(rw(e,o,"$1\0$2"),l,"\0"),v=0,b=g.length;g.charAt(v)==="\0";)v++;for(;g.charAt(b-1)==="\0";)b--;return g.slice(v,b).split("\0").map(f).join(h)}function rw(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce(function(o,i){return o.replace(i,r)},e)}function ZE(e,t){var r=e.charAt(0),o=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+o:""+r.toUpperCase()+o}function X3(e,t){return t===void 0&&(t={}),Hg(e,Rt({delimiter:"",transform:ZE},t))}function W3(e,t){return t===0?e.toLowerCase():ZE(e,t)}function K3(e,t){return t===void 0&&(t={}),X3(e,Rt({transform:W3},t))}function Z3(e,t){return t===void 0&&(t={}),Hg(e,Rt({delimiter:"."},t))}function Q3(e,t){return t===void 0&&(t={}),Z3(e,Rt({delimiter:"_"},t))}function J3(e){return e.charAt(0).toUpperCase()+e.substr(1)}function ez(e){return J3(e.toLowerCase())}function tz(e,t){return t===void 0&&(t={}),Hg(e,Rt({delimiter:" ",transform:ez},t))}function nz(e,t){return t===void 0&&(t={}),tz(e,Rt({delimiter:"-"},t))}var rz=function(e,t){return function(r,o){return e(r,Rt(Rt({},t),o))}},az=function(e,t){var r=typeof t=="function"?t:function(o){return t.includes(o)};return function(o,i){return r(o,i)?o:e(o,i)}},dd=function(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams},Ws=function(e){return typeof FormData<"u"&&e instanceof FormData},QE=function(e){if(e==null)return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},oz=function(e){return Array.isArray(e)||QE(e)||Ws(e)||dd(e)},aw=function(e){return e==null?!1:e instanceof q3},JE={snake:Q3,camel:K3,header:nz},eN=function(e,t,r){var o,i,l,u,f,m;if(!oz(e))return e;if((Ws(e)||dd(e))&&(!e.entries||r&&!e.delete)){var h=Ws(e)?"FormData":"URLSearchParams",g=Ws(e)?"https://github.com/jimmywarting/FormData":"https://github.com/jerrybendy/url-search-params-polyfill";return typeof navigator<"u"&&navigator.product==="ReactNative"?console.warn("Be careful that ".concat(h," cannot be transformed on React Native. If you intentionally implemented, ignore this kind of warning: https://facebook.github.io/react-native/docs/debugging.html")):(e.entries||console.warn("You must use polyfill of ".concat(h,".prototype.entries() on Internet Explorer or Safari: ").concat(g)),r&&!e.delete&&console.warn("You must use polyfill of ".concat(h,".prototype.delete() on Internet Explorer or Safari: ").concat(g))),e}var v=Object.getPrototypeOf(e),b=r?e:v?new v.constructor:Object.create(null),w;if(Ws(e)||dd(e)){if(w=e.entries(),r){w=Pl([],ko(w),!1);try{for(var E=Ll(w),S=E.next();!S.done;S=E.next()){var N=ko(S.value,1),C=N[0];e.delete(C)}}catch(P){o={error:P}}finally{try{S&&!S.done&&(i=E.return)&&i.call(E)}finally{if(o)throw o.error}}}}else if(w=Object.entries(e),r&&!Array.isArray(e))try{for(var j=Ll(w),A=j.next();!A.done;A=j.next()){var M=ko(A.value,1),C=M[0];delete e[C]}}catch(P){l={error:P}}finally{try{A&&!A.done&&(u=j.return)&&u.call(j)}finally{if(l)throw l.error}}try{for(var O=Ll(w),U=O.next();!U.done;U=O.next()){var H=ko(U.value,2),C=H[0],V=H[1];Ws(b)||dd(b)?b.append(t(C),V):C!=="__proto__"&&(b[Array.isArray(e)?Number(C):t("".concat(C))]=eN(V,t,r))}}catch(P){f={error:P}}finally{try{U&&!U.done&&(m=O.return)&&m.call(O)}finally{if(f)throw f.error}}return b},sz=function(e,t,r){return t=rz(t,Rt({stripRegexp:/[^A-Z0-9[\]]+/gi},r==null?void 0:r.caseOptions)),r!=null&&r.preservedKeys&&(t=az(t,r.preservedKeys)),eN(e,t,(r==null?void 0:r.overwrite)||!1)},iz=function(e){return function(t,r){return sz(t,e,r)}},lz=function(e,t){return iz(JE[e])},$g=function(e){var t,r,o=Object.keys(JE),i={};try{for(var l=Ll(o),u=l.next();!u.done;u=l.next()){var f=u.value;i[f]=lz(f,e)}}catch(m){t={error:m}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return i},cz=function(e){var t=$g(void 0).snake;return function(r){return r.params&&(r.params=t(r.params,e)),r}},uz=function(e){var t=$g(void 0),r=t.snake,o=t.header;return function(i,l){return tN(l,o,e,["common","delete","get","head","post","put","patch"]),r(i,e)}},dz=function(e){var t=$g(void 0).camel;return function(r,o){return tN(o,t,e),t(r,e)}},tN=function(e,t,r,o){var i,l,u,f;if(!(!QE(e)&&!aw(e)))try{for(var m=Ll(Object.entries(e)),h=m.next();!h.done;h=m.next()){var g=ko(h.value,2),v=g[0],b=g[1];t(b,Rt({overwrite:!0},r)),!(o||[]).includes(v)&&(aw(e)?(e.delete(v),e.set(Object.keys(t((u={},u[v]=null,u),r))[0],b,!0)):(delete e[v],e[Object.keys(t((f={},f[v]=null,f),r))[0]]=b))}}catch(w){i={error:w}}finally{try{h&&!h.done&&(l=m.return)&&l.call(m)}finally{if(i)throw i.error}}},Gn=function(e,t){var r,o,i;return e.defaults.transformRequest=Pl([((r=void 0)===null||r===void 0?void 0:r.requestTransformer)||uz(t)],ko(Array.isArray(e.defaults.transformRequest)?e.defaults.transformRequest:e.defaults.transformRequest!==void 0?[e.defaults.transformRequest]:[]),!1),e.defaults.transformResponse=Pl(Pl([],ko(Array.isArray(e.defaults.transformResponse)?e.defaults.transformResponse:e.defaults.transformResponse!==void 0?[e.defaults.transformResponse]:[]),!1),[((o=void 0)===null||o===void 0?void 0:o.responseTransformer)||dz(t)],!1),e.interceptors.request.use(((i=void 0)===null||i===void 0?void 0:i.requestInterceptor)||cz(t)),e};class Rl extends Error{}Rl.prototype.name="InvalidTokenError";function fz(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let o=r.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function hz(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return fz(t)}catch{return atob(t)}}function mz(e,t){if(typeof e!="string")throw new Rl("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,o=e.split(".")[r];if(typeof o!="string")throw new Rl(`Invalid token specified: missing part #${r+1}`);let i;try{i=hz(o)}catch(l){throw new Rl(`Invalid token specified: invalid base64 for part #${r+1} (${l.message})`)}try{return JSON.parse(i)}catch(l){throw new Rl(`Invalid token specified: invalid json for part #${r+1} (${l.message})`)}}const pz="http://localhost:8000/api",gz=e=>{localStorage.setItem("auth_token",e)},Tn=()=>typeof window<"u"?localStorage.getItem("auth_token"):null,vz=()=>{localStorage.removeItem("auth_token")},yz=async(e,t,r)=>{const i=await fetch(`${pz}/auth/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,email:t,password:r,role:"operator"})});if(!i.ok){const l=await i.json();throw new Error(l.message||"Registration failed")}return await i.json()},xz=async(e,t)=>{const r=new FormData,o="http://localhost:8000/api",i=Gn(Qe.create());r.append("username",e),r.append("password",t);const l=await fetch(`${o}/auth/jwt/login`,{method:"POST",body:r});if(!l.ok){const m=await l.json();throw new Error(m.message||"Login failed")}const u=await l.json(),{data:f}=await i.get(`${o}/users/me`,{headers:{Authorization:`Bearer ${u.access_token}`}});return localStorage.setItem("user",JSON.stringify(f)),console.log(u),gz(u.access_token),u};function bz(){const[e,t]=x.useState([]),[r,o]=x.useState(""),i="http://localhost:8000/api",l=Tn(),u=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:g}=await u.get(`${i}/users`,{headers:{Authorization:`Bearer ${l}`}});t(g)})()},[]),x.useEffect(()=>{e.length>0&&localStorage.setItem("users",JSON.stringify(e))},[e]);const f=async(h,g)=>{await u.patch(`${i}/users/${h}`,{role:g},{headers:{Authorization:`Bearer ${l}`}}),t(e.map(v=>v.id===h?{...v,role:g}:v))},m=e.filter(h=>h.name.toLowerCase().includes(r.toLowerCase())||h.email.toLowerCase().includes(r.toLowerCase()));return d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsxs("div",{className:"relative w-64",children:[d.jsx(es,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),d.jsx(Ge,{placeholder:"Search users...",className:"pl-8",value:r,onChange:h=>o(h.target.value)})]})}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(eo,{children:[d.jsx(to,{children:d.jsxs(yt,{children:[d.jsx(Be,{children:"Name"}),d.jsx(Be,{children:"Email"}),d.jsx(Be,{children:"Role"})]})}),d.jsx(no,{children:m.length>0?m.map(h=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:h.name}),d.jsx(De,{children:h.email}),h.isSuperuser?d.jsx(De,{className:"text-orange-600",children:"Superuser"}):d.jsx(De,{children:d.jsxs(rr,{value:h.role,onValueChange:g=>f(h.id,g),children:[d.jsx(or,{className:"w-[130px]",children:d.jsx(ar,{placeholder:"Select role"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"operator",className:"text-fuchsia-600",children:"Operator"}),d.jsx(ct,{value:"admin",className:"text-blue-600",children:"Admin"})]})]})})]},h.id)):d.jsx(yt,{children:d.jsx(De,{colSpan:4,className:"text-center py-4",children:"No users found"})})})]})})]})}const ow=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sw=KS,Ig=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return sw(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:l}=t,u=Object.keys(i).map(h=>{const g=r==null?void 0:r[h],v=l==null?void 0:l[h];if(g===null)return null;const b=ow(g)||ow(v);return i[h][b]}),f=r&&Object.entries(r).reduce((h,g)=>{let[v,b]=g;return b===void 0||(h[v]=b),h},{}),m=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((h,g)=>{let{class:v,className:b,...w}=g;return Object.entries(w).every(E=>{let[S,N]=E;return Array.isArray(N)?N.includes({...l,...f}[S]):{...l,...f}[S]===N})?[...h,v,b]:h},[]);return sw(e,u,m,r==null?void 0:r.class,r==null?void 0:r.className)},wz=Ig("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-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",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function we({className:e,variant:t,size:r,asChild:o=!1,...i}){const l=o?RS:"button";return d.jsx(l,{"data-slot":"button",className:Me(wz({variant:t,size:r,className:e})),...i})}var vf="Dialog",[nN,m9]=fr(vf),[Sz,mr]=nN(vf),rN=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,g]=Io({prop:o,defaultProp:i??!1,onChange:l,caller:vf});return d.jsx(Sz,{scope:t,triggerRef:f,contentRef:m,contentId:Er(),titleId:Er(),descriptionId:Er(),open:h,onOpenChange:g,onOpenToggle:x.useCallback(()=>g(v=>!v),[g]),modal:u,children:r})};rN.displayName=vf;var aN="DialogTrigger",oN=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(aN,r),l=qe(t,i.triggerRef);return d.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Yg(i.open),...o,ref:l,onClick:ve(e.onClick,i.onOpenToggle)})});oN.displayName=aN;var Vg="DialogPortal",[Ez,sN]=nN(Vg,{forceMount:void 0}),iN=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:i}=e,l=mr(Vg,t);return d.jsx(Ez,{scope:t,forceMount:r,children:x.Children.map(o,u=>d.jsx(vn,{present:r||l.open,children:d.jsx(rf,{asChild:!0,container:i,children:u})}))})};iN.displayName=Vg;var Ad="DialogOverlay",lN=x.forwardRef((e,t)=>{const r=sN(Ad,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,l=mr(Ad,e.__scopeDialog);return l.modal?d.jsx(vn,{present:o||l.open,children:d.jsx(Cz,{...i,ref:t})}):null});lN.displayName=Ad;var Nz=$o("DialogOverlay.RemoveScroll"),Cz=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(Ad,r);return d.jsx(of,{as:Nz,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(Ae.div,{"data-state":Yg(i.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Zo="DialogContent",cN=x.forwardRef((e,t)=>{const r=sN(Zo,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,l=mr(Zo,e.__scopeDialog);return d.jsx(vn,{present:o||l.open,children:l.modal?d.jsx(jz,{...i,ref:t}):d.jsx(_z,{...i,ref:t})})});cN.displayName=Zo;var jz=x.forwardRef((e,t)=>{const r=mr(Zo,e.__scopeDialog),o=x.useRef(null),i=qe(t,r.contentRef,o);return x.useEffect(()=>{const l=o.current;if(l)return Og(l)},[]),d.jsx(uN,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&l.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,l=>l.preventDefault())})}),_z=x.forwardRef((e,t)=>{const r=mr(Zo,e.__scopeDialog),o=x.useRef(!1),i=x.useRef(!1);return d.jsx(uN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,l),l.defaultPrevented||(o.current||(f=r.triggerRef.current)==null||f.focus(),l.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:l=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,l),l.defaultPrevented||(o.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),uN=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:l,...u}=e,f=mr(Zo,r),m=x.useRef(null),h=qe(t,m);return Eg(),d.jsxs(d.Fragment,{children:[d.jsx(Qd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:l,children:d.jsx(Zd,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Yg(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Az,{titleId:f.titleId}),d.jsx(Rz,{contentRef:m,descriptionId:f.descriptionId})]})]})}),qg="DialogTitle",dN=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(qg,r);return d.jsx(Ae.h2,{id:i.titleId,...o,ref:t})});dN.displayName=qg;var fN="DialogDescription",hN=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(fN,r);return d.jsx(Ae.p,{id:i.descriptionId,...o,ref:t})});hN.displayName=fN;var mN="DialogClose",pN=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,i=mr(mN,r);return d.jsx(Ae.button,{type:"button",...o,ref:t,onClick:ve(e.onClick,()=>i.onOpenChange(!1))})});pN.displayName=mN;function Yg(e){return e?"open":"closed"}var gN="DialogTitleWarning",[p9,vN]=nR(gN,{contentName:Zo,titleName:qg,docsSlug:"dialog"}),Az=({titleId:e})=>{const t=vN(gN),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Tz="DialogDescriptionWarning",Rz=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${vN(Tz).contentName}}.`;return x.useEffect(()=>{var l;const i=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},yN=rN,xN=oN,bN=iN,wN=lN,SN=cN,Mz=dN,Dz=hN,Gg=pN;function _r({...e}){return d.jsx(yN,{"data-slot":"dialog",...e})}function ca({...e}){return d.jsx(xN,{"data-slot":"dialog-trigger",...e})}function Oz({...e}){return d.jsx(bN,{"data-slot":"dialog-portal",...e})}function Ml({...e}){return d.jsx(Gg,{"data-slot":"dialog-close",...e})}function kz({className:e,...t}){return d.jsx(wN,{"data-slot":"dialog-overlay",className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Ar({className:e,children:t,...r}){return d.jsxs(Oz,{"data-slot":"dialog-portal",children:[d.jsx(kz,{}),d.jsxs(SN,{"data-slot":"dialog-content",className:Me("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,d.jsxs(Gg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[d.jsx(NE,{}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Tr({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:Me("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ua({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-footer",className:Me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Rr({className:e,...t}){return d.jsx(Mz,{"data-slot":"dialog-title",className:Me("text-lg leading-none font-semibold",e),...t})}function oo({className:e,...t}){return d.jsx(Dz,{"data-slot":"dialog-description",className:Me("text-muted-foreground text-sm",e),...t})}var zz="Label",EN=x.forwardRef((e,t)=>d.jsx(Ae.label,{...e,ref:t,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));EN.displayName=zz;var Lz=EN;function Xe({className:e,...t}){return d.jsx(Lz,{"data-slot":"label",className:Me("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var yf="Checkbox",[Pz,g9]=fr(yf),[Uz,Fg]=Pz(yf);function Bz(e){const{__scopeCheckbox:t,checked:r,children:o,defaultChecked:i,disabled:l,form:u,name:f,onCheckedChange:m,required:h,value:g="on",internal_do_not_use_render:v}=e,[b,w]=Io({prop:r,defaultProp:i??!1,onChange:m,caller:yf}),[E,S]=x.useState(null),[N,C]=x.useState(null),j=x.useRef(!1),A=E?!!u||!!E.closest("form"):!0,M={checked:b,disabled:l,setChecked:w,control:E,setControl:S,name:f,form:u,value:g,hasConsumerStoppedPropagationRef:j,required:h,defaultChecked:Qa(i)?!1:i,isFormControl:A,bubbleInput:N,setBubbleInput:C};return d.jsx(Uz,{scope:t,...M,children:Hz(v)?v(M):o})}var NN="CheckboxTrigger",CN=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...o},i)=>{const{control:l,value:u,disabled:f,checked:m,required:h,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:b,isFormControl:w,bubbleInput:E}=Fg(NN,e),S=qe(i,g),N=x.useRef(m);return x.useEffect(()=>{const C=l==null?void 0:l.form;if(C){const j=()=>v(N.current);return C.addEventListener("reset",j),()=>C.removeEventListener("reset",j)}},[l,v]),d.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":Qa(m)?"mixed":m,"aria-required":h,"data-state":MN(m),"data-disabled":f?"":void 0,disabled:f,value:u,...o,ref:S,onKeyDown:ve(t,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:ve(r,C=>{v(j=>Qa(j)?!0:!j),E&&w&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})})});CN.displayName=NN;var jN=x.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:o,checked:i,defaultChecked:l,required:u,disabled:f,value:m,onCheckedChange:h,form:g,...v}=e;return d.jsx(Bz,{__scopeCheckbox:r,checked:i,defaultChecked:l,disabled:f,required:u,onCheckedChange:h,name:o,form:g,value:m,internal_do_not_use_render:({isFormControl:b})=>d.jsxs(d.Fragment,{children:[d.jsx(CN,{...v,ref:t,__scopeCheckbox:r}),b&&d.jsx(RN,{__scopeCheckbox:r})]})})});jN.displayName=yf;var _N="CheckboxIndicator",AN=x.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:o,...i}=e,l=Fg(_N,r);return d.jsx(vn,{present:o||Qa(l.checked)||l.checked===!0,children:d.jsx(Ae.span,{"data-state":MN(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});AN.displayName=_N;var TN="CheckboxBubbleInput",RN=x.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:o,hasConsumerStoppedPropagationRef:i,checked:l,defaultChecked:u,required:f,disabled:m,name:h,value:g,form:v,bubbleInput:b,setBubbleInput:w}=Fg(TN,e),E=qe(r,w),S=z1(l),N=w1(o);x.useEffect(()=>{const j=b;if(!j)return;const A=window.HTMLInputElement.prototype,O=Object.getOwnPropertyDescriptor(A,"checked").set,U=!i.current;if(S!==l&&O){const H=new Event("click",{bubbles:U});j.indeterminate=Qa(l),O.call(j,Qa(l)?!1:l),j.dispatchEvent(H)}},[b,S,l,i]);const C=x.useRef(Qa(l)?!1:l);return d.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??C.current,required:f,disabled:m,name:h,value:g,form:v,...t,tabIndex:-1,ref:E,style:{...t.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});RN.displayName=TN;function Hz(e){return typeof e=="function"}function Qa(e){return e==="indeterminate"}function MN(e){return Qa(e)?"indeterminate":e?"checked":"unchecked"}function $z({className:e,...t}){return d.jsx(jN,{"data-slot":"checkbox",className:Me("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:d.jsx(AN,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:d.jsx(yE,{className:"size-3.5"})})})}function Iz(){const[e,t]=x.useState([]),[r,o]=x.useState([]),[i,l]=x.useState(""),[u,f]=x.useState({groupId:"",description:""}),[m,h]=x.useState(null),[g,v]=x.useState([]),b="http://localhost:8000/api",w=Tn(),E=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:H}=await E.get(`${b}/groups`,{headers:{Authorization:`Bearer ${w}`}});t(H)})();const U=localStorage.getItem("users");U&&o(JSON.parse(U))},[]),x.useEffect(()=>{e.length>0&&localStorage.setItem("groups",JSON.stringify(e))},[e]);const S=async()=>{const{data:O}=await E.post(`${b}/groups`,u,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`}});console.log(O),t([...e,O]),f({groupId:"",description:""})},N=async O=>{await E.delete(`${b}/groups/${O}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`}}),t(e.filter(U=>U.groupId!==O))},C=O=>{h(O),v([...O.members])},j=async()=>{if(m){const{data:O}=await E.post(`${b}/groups/${m.groupId}/users`,{users:g},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`}}),U=O.members;t(e.map(H=>H.groupId===m.groupId?{...H,members:U}:H)),h(null)}},A=O=>{g.includes(O)?v(g.filter(U=>U!==O)):v([...g,O])};console.log(e);const M=e.filter(O=>O.groupId.toLowerCase().includes(i.toLowerCase())||O.description.toLowerCase().includes(i.toLowerCase()));return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"relative w-64",children:[d.jsx(es,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),d.jsx(Ge,{placeholder:"Search groups...",className:"pl-8",value:i,onChange:O=>l(O.target.value)})]}),d.jsxs(_r,{children:[d.jsx(ca,{asChild:!0,children:d.jsxs(we,{children:[d.jsx(xk,{className:"mr-2 h-4 w-4"}),"Create Group"]})}),d.jsxs(Ar,{children:[d.jsx(Tr,{children:d.jsx(Rr,{children:"Create New Group"})}),d.jsxs("div",{className:"grid gap-4 py-4",children:[d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"name",className:"text-right",children:"Group ID"}),d.jsx(Ge,{id:"name",value:u.groupId,onChange:O=>f({...u,groupId:O.target.value}),className:"col-span-3"})]}),d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"description",className:"text-right",children:"Description"}),d.jsx(Ge,{id:"description",value:u.description,onChange:O=>f({...u,description:O.target.value}),className:"col-span-3"})]})]}),d.jsxs(ua,{children:[d.jsx(Ml,{asChild:!0,children:d.jsx(we,{type:"button",variant:"outline",children:"Cancel"})}),d.jsx(Ml,{asChild:!0,children:d.jsx(we,{type:"button",onClick:S,children:"Create"})})]})]})]})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(eo,{children:[d.jsx(to,{children:d.jsxs(yt,{children:[d.jsx(Be,{children:"Group ID"}),d.jsx(Be,{children:"Description"}),d.jsx(Be,{children:"Members"}),d.jsx(Be,{className:"w-[150px]",children:"Actions"})]})}),d.jsx(no,{children:M.length>0?M.map(O=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:O.groupId}),d.jsx(De,{children:O.description}),d.jsx(De,{children:O.members.length}),d.jsx(De,{children:d.jsxs("div",{className:"flex space-x-2",children:[d.jsxs(_r,{children:[d.jsx(ca,{asChild:!0,children:d.jsxs(we,{variant:"outline",size:"sm",onClick:()=>C(O),children:[d.jsx(uc,{className:"h-4 w-4 mr-1"}),"Members"]})}),d.jsxs(Ar,{className:"max-w-md",children:[d.jsx(Tr,{children:d.jsx(Rr,{children:"Manage Group Members"})}),d.jsx("div",{className:"py-4",children:d.jsxs(Et,{children:[d.jsxs(fn,{children:[d.jsx(hn,{children:"Users"}),d.jsx(Yo,{children:"Select users to add to this group"})]}),d.jsx(Nt,{children:d.jsx("div",{className:"max-h-[300px] overflow-y-auto space-y-2",children:r.map(U=>d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx($z,{id:`user-${U.id}`,checked:g.includes(U.id),onCheckedChange:()=>A(U.id)}),d.jsxs(Xe,{htmlFor:`user-${U.id}`,children:[U.name," (",U.email,")"]})]},U.id))})})]})}),d.jsxs(ua,{children:[d.jsx(Ml,{asChild:!0,children:d.jsx(we,{type:"button",variant:"outline",children:"Cancel"})}),d.jsx(Ml,{asChild:!0,children:d.jsx(we,{type:"button",onClick:j,children:"Save"})})]})]})]}),d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>N(O.groupId),children:d.jsx(Wo,{className:"h-4 w-4 text-red-500"})})]})})]},O.groupId)):d.jsx(yt,{children:d.jsx(De,{colSpan:4,className:"text-center py-4",children:"No groups found"})})})]})})]})}var Fp=["Enter"," "],Vz=["ArrowDown","PageUp","Home"],DN=["ArrowUp","PageDown","End"],qz=[...Vz,...DN],Yz={ltr:[...Fp,"ArrowRight"],rtl:[...Fp,"ArrowLeft"]},Gz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hc="Menu",[ql,Fz,Xz]=bg(hc),[ts,ON]=fr(hc,[Xz,nf,Fd]),xf=nf(),kN=Fd(),[Wz,ns]=ts(hc),[Kz,mc]=ts(hc),zN=e=>{const{__scopeMenu:t,open:r=!1,children:o,dir:i,onOpenChange:l,modal:u=!0}=e,f=xf(t),[m,h]=x.useState(null),g=x.useRef(!1),v=It(l),b=sc(i);return x.useEffect(()=>{const w=()=>{g.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>g.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),d.jsx(M1,{...f,children:d.jsx(Wz,{scope:t,open:r,onOpenChange:v,content:m,onContentChange:h,children:d.jsx(Kz,{scope:t,onClose:x.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:g,dir:b,modal:u,children:o})})})};zN.displayName=hc;var Zz="MenuAnchor",Xg=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,i=xf(r);return d.jsx(D1,{...i,...o,ref:t})});Xg.displayName=Zz;var Wg="MenuPortal",[Qz,LN]=ts(Wg,{forceMount:void 0}),PN=e=>{const{__scopeMenu:t,forceMount:r,children:o,container:i}=e,l=ns(Wg,t);return d.jsx(Qz,{scope:t,forceMount:r,children:d.jsx(vn,{present:r||l.open,children:d.jsx(rf,{asChild:!0,container:i,children:o})})})};PN.displayName=Wg;var qn="MenuContent",[Jz,Kg]=ts(qn),UN=x.forwardRef((e,t)=>{const r=LN(qn,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,l=ns(qn,e.__scopeMenu),u=mc(qn,e.__scopeMenu);return d.jsx(ql.Provider,{scope:e.__scopeMenu,children:d.jsx(vn,{present:o||l.open,children:d.jsx(ql.Slot,{scope:e.__scopeMenu,children:u.modal?d.jsx(eL,{...i,ref:t}):d.jsx(tL,{...i,ref:t})})})})}),eL=x.forwardRef((e,t)=>{const r=ns(qn,e.__scopeMenu),o=x.useRef(null),i=qe(t,o);return x.useEffect(()=>{const l=o.current;if(l)return Og(l)},[]),d.jsx(Zg,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ve(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),tL=x.forwardRef((e,t)=>{const r=ns(qn,e.__scopeMenu);return d.jsx(Zg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),nL=$o("MenuContent.ScrollLock"),Zg=x.forwardRef((e,t)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:m,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:b,onDismiss:w,disableOutsideScroll:E,...S}=e,N=ns(qn,r),C=mc(qn,r),j=xf(r),A=kN(r),M=Fz(r),[O,U]=x.useState(null),H=x.useRef(null),V=qe(t,H,N.onContentChange),P=x.useRef(0),z=x.useRef(""),F=x.useRef(0),K=x.useRef(null),te=x.useRef("right"),k=x.useRef(0),Y=E?of:x.Fragment,D=E?{as:nL,allowPinchZoom:!0}:void 0,q=L=>{var se,me;const T=z.current+L,I=M().filter(pe=>!pe.disabled),X=document.activeElement,Z=(se=I.find(pe=>pe.ref.current===X))==null?void 0:se.textValue,re=I.map(pe=>pe.textValue),fe=mL(re,T,Z),ue=(me=I.find(pe=>pe.textValue===fe))==null?void 0:me.ref.current;(function pe(ge){z.current=ge,window.clearTimeout(P.current),ge!==""&&(P.current=window.setTimeout(()=>pe(""),1e3))})(T),ue&&setTimeout(()=>ue.focus())};x.useEffect(()=>()=>window.clearTimeout(P.current),[]),Eg();const B=x.useCallback(L=>{var I,X;return te.current===((I=K.current)==null?void 0:I.side)&&gL(L,(X=K.current)==null?void 0:X.area)},[]);return d.jsx(Jz,{scope:r,searchRef:z,onItemEnter:x.useCallback(L=>{B(L)&&L.preventDefault()},[B]),onItemLeave:x.useCallback(L=>{var T;B(L)||((T=H.current)==null||T.focus(),U(null))},[B]),onTriggerLeave:x.useCallback(L=>{B(L)&&L.preventDefault()},[B]),pointerGraceTimerRef:F,onPointerGraceIntentChange:x.useCallback(L=>{K.current=L},[]),children:d.jsx(Y,{...D,children:d.jsx(Qd,{asChild:!0,trapped:i,onMountAutoFocus:ve(l,L=>{var T;L.preventDefault(),(T=H.current)==null||T.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:d.jsx(Zd,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:b,onDismiss:w,children:d.jsx(PS,{asChild:!0,...A,dir:C.dir,orientation:"vertical",loop:o,currentTabStopId:O,onCurrentTabStopIdChange:U,onEntryFocus:ve(m,L=>{C.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(O1,{role:"menu","aria-orientation":"vertical","data-state":eC(N.open),"data-radix-menu-content":"",dir:C.dir,...j,...S,ref:V,style:{outline:"none",...S.style},onKeyDown:ve(S.onKeyDown,L=>{const I=L.target.closest("[data-radix-menu-content]")===L.currentTarget,X=L.ctrlKey||L.altKey||L.metaKey,Z=L.key.length===1;I&&(L.key==="Tab"&&L.preventDefault(),!X&&Z&&q(L.key));const re=H.current;if(L.target!==re||!qz.includes(L.key))return;L.preventDefault();const ue=M().filter(se=>!se.disabled).map(se=>se.ref.current);DN.includes(L.key)&&ue.reverse(),fL(ue)}),onBlur:ve(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(P.current),z.current="")}),onPointerMove:ve(e.onPointerMove,Yl(L=>{const T=L.target,I=k.current!==L.clientX;if(L.currentTarget.contains(T)&&I){const X=L.clientX>k.current?"right":"left";te.current=X,k.current=L.clientX}}))})})})})})})});UN.displayName=qn;var rL="MenuGroup",Qg=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(Ae.div,{role:"group",...o,ref:t})});Qg.displayName=rL;var aL="MenuLabel",BN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(Ae.div,{...o,ref:t})});BN.displayName=aL;var Td="MenuItem",iw="menu.itemSelect",bf=x.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:o,...i}=e,l=x.useRef(null),u=mc(Td,e.__scopeMenu),f=Kg(Td,e.__scopeMenu),m=qe(t,l),h=x.useRef(!1),g=()=>{const v=l.current;if(!r&&v){const b=new CustomEvent(iw,{bubbles:!0,cancelable:!0});v.addEventListener(iw,w=>o==null?void 0:o(w),{once:!0}),MS(v,b),b.defaultPrevented?h.current=!1:u.onClose()}};return d.jsx(HN,{...i,ref:m,disabled:r,onClick:ve(e.onClick,g),onPointerDown:v=>{var b;(b=e.onPointerDown)==null||b.call(e,v),h.current=!0},onPointerUp:ve(e.onPointerUp,v=>{var b;h.current||(b=v.currentTarget)==null||b.click()}),onKeyDown:ve(e.onKeyDown,v=>{const b=f.searchRef.current!=="";r||b&&v.key===" "||Fp.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});bf.displayName=Td;var HN=x.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:o=!1,textValue:i,...l}=e,u=Kg(Td,r),f=kN(r),m=x.useRef(null),h=qe(t,m),[g,v]=x.useState(!1),[b,w]=x.useState("");return x.useEffect(()=>{const E=m.current;E&&w((E.textContent??"").trim())},[l.children]),d.jsx(ql.ItemSlot,{scope:r,disabled:o,textValue:i??b,children:d.jsx(US,{asChild:!0,...f,focusable:!o,children:d.jsx(Ae.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...l,ref:h,onPointerMove:ve(e.onPointerMove,Yl(E=>{o?u.onItemLeave(E):(u.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(e.onPointerLeave,Yl(E=>u.onItemLeave(E))),onFocus:ve(e.onFocus,()=>v(!0)),onBlur:ve(e.onBlur,()=>v(!1))})})})}),oL="MenuCheckboxItem",$N=x.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return d.jsx(GN,{scope:e.__scopeMenu,checked:r,children:d.jsx(bf,{role:"menuitemcheckbox","aria-checked":Rd(r)?"mixed":r,...i,ref:t,"data-state":ev(r),onSelect:ve(i.onSelect,()=>o==null?void 0:o(Rd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});$N.displayName=oL;var IN="MenuRadioGroup",[sL,iL]=ts(IN,{value:void 0,onValueChange:()=>{}}),VN=x.forwardRef((e,t)=>{const{value:r,onValueChange:o,...i}=e,l=It(o);return d.jsx(sL,{scope:e.__scopeMenu,value:r,onValueChange:l,children:d.jsx(Qg,{...i,ref:t})})});VN.displayName=IN;var qN="MenuRadioItem",YN=x.forwardRef((e,t)=>{const{value:r,...o}=e,i=iL(qN,e.__scopeMenu),l=r===i.value;return d.jsx(GN,{scope:e.__scopeMenu,checked:l,children:d.jsx(bf,{role:"menuitemradio","aria-checked":l,...o,ref:t,"data-state":ev(l),onSelect:ve(o.onSelect,()=>{var u;return(u=i.onValueChange)==null?void 0:u.call(i,r)},{checkForDefaultPrevented:!1})})})});YN.displayName=qN;var Jg="MenuItemIndicator",[GN,lL]=ts(Jg,{checked:!1}),FN=x.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:o,...i}=e,l=lL(Jg,r);return d.jsx(vn,{present:o||Rd(l.checked)||l.checked===!0,children:d.jsx(Ae.span,{...i,ref:t,"data-state":ev(l.checked)})})});FN.displayName=Jg;var cL="MenuSeparator",XN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return d.jsx(Ae.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});XN.displayName=cL;var uL="MenuArrow",WN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,i=xf(r);return d.jsx(k1,{...i,...o,ref:t})});WN.displayName=uL;var dL="MenuSub",[v9,KN]=ts(dL),Dl="MenuSubTrigger",ZN=x.forwardRef((e,t)=>{const r=ns(Dl,e.__scopeMenu),o=mc(Dl,e.__scopeMenu),i=KN(Dl,e.__scopeMenu),l=Kg(Dl,e.__scopeMenu),u=x.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:m}=l,h={__scopeMenu:e.__scopeMenu},g=x.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return x.useEffect(()=>g,[g]),x.useEffect(()=>{const v=f.current;return()=>{window.clearTimeout(v),m(null)}},[f,m]),d.jsx(Xg,{asChild:!0,...h,children:d.jsx(HN,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":eC(r.open),...e,ref:xg(t,i.onTriggerChange),onClick:v=>{var b;(b=e.onClick)==null||b.call(e,v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ve(e.onPointerMove,Yl(v=>{l.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:ve(e.onPointerLeave,Yl(v=>{var w,E;g();const b=(w=r.content)==null?void 0:w.getBoundingClientRect();if(b){const S=(E=r.content)==null?void 0:E.dataset.side,N=S==="right",C=N?-5:5,j=b[N?"left":"right"],A=b[N?"right":"left"];l.onPointerGraceIntentChange({area:[{x:v.clientX+C,y:v.clientY},{x:j,y:b.top},{x:A,y:b.top},{x:A,y:b.bottom},{x:j,y:b.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(v),v.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:ve(e.onKeyDown,v=>{var w;const b=l.searchRef.current!=="";e.disabled||b&&v.key===" "||Yz[o.dir].includes(v.key)&&(r.onOpenChange(!0),(w=r.content)==null||w.focus(),v.preventDefault())})})})});ZN.displayName=Dl;var QN="MenuSubContent",JN=x.forwardRef((e,t)=>{const r=LN(qn,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,l=ns(qn,e.__scopeMenu),u=mc(qn,e.__scopeMenu),f=KN(QN,e.__scopeMenu),m=x.useRef(null),h=qe(t,m);return d.jsx(ql.Provider,{scope:e.__scopeMenu,children:d.jsx(vn,{present:o||l.open,children:d.jsx(ql.Slot,{scope:e.__scopeMenu,children:d.jsx(Zg,{id:f.contentId,"aria-labelledby":f.triggerId,...i,ref:h,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var v;u.isUsingKeyboardRef.current&&((v=m.current)==null||v.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:ve(e.onFocusOutside,g=>{g.target!==f.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:ve(e.onEscapeKeyDown,g=>{u.onClose(),g.preventDefault()}),onKeyDown:ve(e.onKeyDown,g=>{var w;const v=g.currentTarget.contains(g.target),b=Gz[u.dir].includes(g.key);v&&b&&(l.onOpenChange(!1),(w=f.trigger)==null||w.focus(),g.preventDefault())})})})})})});JN.displayName=QN;function eC(e){return e?"open":"closed"}function Rd(e){return e==="indeterminate"}function ev(e){return Rd(e)?"indeterminate":e?"checked":"unchecked"}function fL(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function hL(e,t){return e.map((r,o)=>e[(t+o)%e.length])}function mL(e,t,r){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=hL(e,Math.max(l,0));i.length===1&&(u=u.filter(h=>h!==r));const m=u.find(h=>h.toLowerCase().startsWith(i.toLowerCase()));return m!==r?m:void 0}function pL(e,t){const{x:r,y:o}=e;let i=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],m=t[u],h=f.x,g=f.y,v=m.x,b=m.y;g>o!=b>o&&r<(v-h)*(o-g)/(b-g)+h&&(i=!i)}return i}function gL(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return pL(r,t)}function Yl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var vL=zN,yL=Xg,xL=PN,bL=UN,wL=Qg,SL=BN,EL=bf,NL=$N,CL=VN,jL=YN,_L=FN,AL=XN,TL=WN,RL=ZN,ML=JN,wf="DropdownMenu",[DL,y9]=fr(wf,[ON]),on=ON(),[OL,tC]=DL(wf),nC=e=>{const{__scopeDropdownMenu:t,children:r,dir:o,open:i,defaultOpen:l,onOpenChange:u,modal:f=!0}=e,m=on(t),h=x.useRef(null),[g,v]=Io({prop:i,defaultProp:l??!1,onChange:u,caller:wf});return d.jsx(OL,{scope:t,triggerId:Er(),triggerRef:h,contentId:Er(),open:g,onOpenChange:v,onOpenToggle:x.useCallback(()=>v(b=>!b),[v]),modal:f,children:d.jsx(vL,{...m,open:g,onOpenChange:v,dir:o,modal:f,children:r})})};nC.displayName=wf;var rC="DropdownMenuTrigger",aC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,l=tC(rC,r),u=on(r);return d.jsx(yL,{asChild:!0,...u,children:d.jsx(Ae.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:xg(t,l.triggerRef),onPointerDown:ve(e.onPointerDown,f=>{!o&&f.button===0&&f.ctrlKey===!1&&(l.onOpenToggle(),l.open||f.preventDefault())}),onKeyDown:ve(e.onKeyDown,f=>{o||(["Enter"," "].includes(f.key)&&l.onOpenToggle(),f.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});aC.displayName=rC;var kL="DropdownMenuPortal",oC=e=>{const{__scopeDropdownMenu:t,...r}=e,o=on(t);return d.jsx(xL,{...o,...r})};oC.displayName=kL;var sC="DropdownMenuContent",iC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=tC(sC,r),l=on(r),u=x.useRef(!1);return d.jsx(bL,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...o,ref:t,onCloseAutoFocus:ve(e.onCloseAutoFocus,f=>{var m;u.current||(m=i.triggerRef.current)==null||m.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:ve(e.onInteractOutside,f=>{const m=f.detail.originalEvent,h=m.button===0&&m.ctrlKey===!0,g=m.button===2||h;(!i.modal||g)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});iC.displayName=sC;var zL="DropdownMenuGroup",LL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(wL,{...i,...o,ref:t})});LL.displayName=zL;var PL="DropdownMenuLabel",lC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(SL,{...i,...o,ref:t})});lC.displayName=PL;var UL="DropdownMenuItem",cC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(EL,{...i,...o,ref:t})});cC.displayName=UL;var BL="DropdownMenuCheckboxItem",HL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(NL,{...i,...o,ref:t})});HL.displayName=BL;var $L="DropdownMenuRadioGroup",IL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(CL,{...i,...o,ref:t})});IL.displayName=$L;var VL="DropdownMenuRadioItem",qL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(jL,{...i,...o,ref:t})});qL.displayName=VL;var YL="DropdownMenuItemIndicator",GL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(_L,{...i,...o,ref:t})});GL.displayName=YL;var FL="DropdownMenuSeparator",uC=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(AL,{...i,...o,ref:t})});uC.displayName=FL;var XL="DropdownMenuArrow",WL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(TL,{...i,...o,ref:t})});WL.displayName=XL;var KL="DropdownMenuSubTrigger",ZL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(RL,{...i,...o,ref:t})});ZL.displayName=KL;var QL="DropdownMenuSubContent",JL=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,i=on(r);return d.jsx(ML,{...i,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});JL.displayName=QL;var e5=nC,t5=aC,n5=oC,r5=iC,a5=lC,o5=cC,s5=uC;function dC({...e}){return d.jsx(e5,{"data-slot":"dropdown-menu",...e})}function i5({...e}){return d.jsx(t5,{"data-slot":"dropdown-menu-trigger",...e})}function l5({className:e,sideOffset:t=4,...r}){return d.jsx(n5,{children:d.jsx(r5,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Me("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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})})}function lw({className:e,inset:t,variant:r="default",...o}){return d.jsx(o5,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:Me("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}function c5({className:e,inset:t,...r}){return d.jsx(a5,{"data-slot":"dropdown-menu-label","data-inset":t,className:Me("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function cw({className:e,...t}){return d.jsx(s5,{"data-slot":"dropdown-menu-separator",className:Me("bg-border -mx-1 my-1 h-px",e),...t})}function u5({...e}){return d.jsx(yN,{"data-slot":"sheet",...e})}function d5({...e}){return d.jsx(xN,{"data-slot":"sheet-trigger",...e})}function f5({...e}){return d.jsx(bN,{"data-slot":"sheet-portal",...e})}function h5({className:e,...t}){return d.jsx(wN,{"data-slot":"sheet-overlay",className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function m5({className:e,children:t,side:r="right",...o}){return d.jsxs(f5,{children:[d.jsx(h5,{}),d.jsxs(SN,{"data-slot":"sheet-content",className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[t,d.jsxs(Gg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[d.jsx(NE,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function en({children:e}){const t=an(),r=ma().pathname,o=[{name:"Dashboard",href:"/dashboard",icon:Pk},{name:"Devices",href:"/devices",icon:Il},{name:"Groups",href:"/groups",icon:uc},{name:"Executions",href:"/executions",icon:uk},{name:"Profile",href:"/profile",icon:Cd}],i=localStorage.getItem("user");i&&JSON.parse(i).isSuperuser&&o.push({name:"Superuser",href:"/admin",icon:e4});const l=()=>{vz(),t("/login")};return d.jsxs("div",{className:"flex min-h-screen flex-col",children:[d.jsxs("header",{className:"sticky top-0 z-50 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsx(Za,{to:"/dashboard",className:"flex items-center gap-2 font-semibold",children:d.jsx("span",{className:"hidden md:inline-block",children:"Formica"})})}),d.jsxs(u5,{children:[d.jsx(d5,{asChild:!0,children:d.jsxs(we,{variant:"outline",size:"icon",className:"md:hidden",children:[d.jsx(Ik,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),d.jsx(m5,{side:"left",children:d.jsx("div",{className:"grid gap-2 py-6",children:o.map(u=>d.jsxs(Za,{to:u.href,className:`flex items-center gap-2 rounded-lg px-3 py-2 text-sm transition-all hover:text-primary ${r===u.href?"bg-muted font-medium":"text-muted-foreground"}`,children:[d.jsx(u.icon,{className:"h-4 w-4"}),u.name]},u.name))})})]}),d.jsx("nav",{className:"hidden md:flex md:flex-1 md:items-center md:gap-4 md:px-4",children:o.map(u=>d.jsxs(Za,{to:u.href,className:`flex items-center gap-2 rounded-lg px-3 py-2 text-sm transition-all hover:text-primary ${r===u.href||u.href!=="/"&&(r!=null&&r.startsWith(u.href))?"bg-muted font-medium":"text-muted-foreground"}`,children:[d.jsx(u.icon,{className:"h-4 w-4"}),u.name]},u.name))}),d.jsx("div",{className:"ml-auto flex items-center gap-2",children:d.jsxs(dC,{children:[d.jsx(i5,{asChild:!0,children:d.jsxs(we,{variant:"ghost",size:"icon",className:"rounded-full",children:[d.jsx("img",{src:"/placeholder.svg?height=32&width=32",alt:"Avatar",className:"rounded-full",height:"32",width:"32"}),d.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),d.jsxs(l5,{align:"end",children:[d.jsx(c5,{children:"My Account"}),d.jsx(cw,{}),d.jsx(lw,{asChild:!0,children:d.jsxs(Za,{to:"/profile",children:[d.jsx(Cd,{className:"mr-2 h-4 w-4"}),"Profile"]})}),d.jsx(cw,{}),d.jsxs(lw,{onClick:l,children:[d.jsx(zg,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})})]}),d.jsx("main",{className:"flex-1",children:e})]})}function p5(){const[e,t]=x.useState("users");return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6",children:[d.jsx("h1",{className:"text-3xl font-bold mb-6",children:"Superuser Dashboard"}),d.jsxs(Wd,{defaultValue:"users",value:e,onValueChange:t,className:"w-full",children:[d.jsxs(Kd,{className:"grid w-full max-w-md grid-cols-2",children:[d.jsx(Vo,{value:"users",children:"Users"}),d.jsx(Vo,{value:"groups",children:"Groups"})]}),d.jsx(qo,{value:"users",className:"mt-6",children:d.jsxs(Et,{children:[d.jsxs(fn,{children:[d.jsx(hn,{children:"User Management"}),d.jsx(Yo,{children:"Manage user accounts and roles"})]}),d.jsx(Nt,{children:d.jsx(bz,{})})]})}),d.jsx(qo,{value:"groups",className:"mt-6",children:d.jsxs(Et,{children:[d.jsxs(fn,{children:[d.jsx(hn,{children:"Group Management"}),d.jsx(Yo,{children:"Create and manage groups and assign users"})]}),d.jsx(Nt,{children:d.jsx(Iz,{})})]})})]})]})})}function g5(){return d.jsx(p5,{})}function Xt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,o;r<e.length;r++)(o=Xt(e[r]))!==""&&(t+=(t&&" ")+o);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var cp={exports:{}},up={},dp={exports:{}},fp={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var uw;function v5(){if(uw)return fp;uw=1;var e=tc();function t(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var r=typeof Object.is=="function"?Object.is:t,o=e.useState,i=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(v,b){var w=b(),E=o({inst:{value:w,getSnapshot:b}}),S=E[0].inst,N=E[1];return l(function(){S.value=w,S.getSnapshot=b,m(S)&&N({inst:S})},[v,w,b]),i(function(){return m(S)&&N({inst:S}),v(function(){m(S)&&N({inst:S})})},[v]),u(w),w}function m(v){var b=v.getSnapshot;v=v.value;try{var w=b();return!r(v,w)}catch{return!0}}function h(v,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return fp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,fp}var dw;function fC(){return dw||(dw=1,dp.exports=v5()),dp.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var fw;function y5(){if(fw)return up;fw=1;var e=tc(),t=fC();function r(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var o=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,m=e.useDebugValue;return up.useSyncExternalStoreWithSelector=function(h,g,v,b,w){var E=l(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=f(function(){function C(U){if(!j){if(j=!0,A=U,U=b(U),w!==void 0&&S.hasValue){var H=S.value;if(w(H,U))return M=H}return M=U}if(H=M,o(A,U))return H;var V=b(U);return w!==void 0&&w(H,V)?(A=U,H):(A=U,M=V)}var j=!1,A,M,O=v===void 0?null:v;return[function(){return C(g())},O===null?void 0:function(){return C(O())}]},[g,v,b,w]);var N=i(h,E[0],E[1]);return u(function(){S.hasValue=!0,S.value=N},[N]),m(N),N},up}var hw;function x5(){return hw||(hw=1,cp.exports=y5()),cp.exports}var b5=x5();const w5=dg(b5),S5={},mw=e=>{let t;const r=new Set,o=(g,v)=>{const b=typeof g=="function"?g(t):g;if(!Object.is(b,t)){const w=t;t=v??(typeof b!="object"||b===null)?b:Object.assign({},t,b),r.forEach(E=>E(t,w))}},i=()=>t,m={setState:o,getState:i,getInitialState:()=>h,subscribe:g=>(r.add(g),()=>r.delete(g)),destroy:()=>{(S5?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},h=t=e(o,i,m);return m},E5=e=>e?mw(e):mw,{useDebugValue:N5}=ae,{useSyncExternalStoreWithSelector:C5}=w5,j5=e=>e;function hC(e,t=j5,r){const o=C5(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return N5(o),o}const pw=(e,t)=>{const r=E5(e),o=(i,l=t)=>hC(r,i,l);return Object.assign(o,r),o},_5=(e,t)=>e?pw(e,t):pw;function Vt(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[o,i]of e)if(!Object.is(i,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const o of r)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var A5={value:()=>{}};function Sf(){for(var e=0,t=arguments.length,r={},o;e<t;++e){if(!(o=arguments[e]+"")||o in r||/[\s.]/.test(o))throw new Error("illegal type: "+o);r[o]=[]}return new fd(r)}function fd(e){this._=e}function T5(e,t){return e.trim().split(/^|\s+/).map(function(r){var o="",i=r.indexOf(".");if(i>=0&&(o=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:o}})}fd.prototype=Sf.prototype={constructor:fd,on:function(e,t){var r=this._,o=T5(e+"",r),i,l=-1,u=o.length;if(arguments.length<2){for(;++l<u;)if((i=(e=o[l]).type)&&(i=R5(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(i=(e=o[l]).type)r[i]=gw(r[i],e.name,t);else if(t==null)for(i in r)r[i]=gw(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new fd(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),o=0,i,l;o<i;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],o=0,i=l.length;o<i;++o)l[o].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,l=o.length;i<l;++i)o[i].value.apply(t,r)}};function R5(e,t){for(var r=0,o=e.length,i;r<o;++r)if((i=e[r]).name===t)return i.value}function gw(e,t,r){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=A5,e=e.slice(0,o).concat(e.slice(o+1));break}return r!=null&&e.push({name:t,value:r}),e}var Xp="http://www.w3.org/1999/xhtml";const vw={svg:"http://www.w3.org/2000/svg",xhtml:Xp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ef(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),vw.hasOwnProperty(t)?{space:vw[t],local:e}:e}function M5(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Xp&&t.documentElement.namespaceURI===Xp?t.createElement(e):t.createElementNS(r,e)}}function D5(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mC(e){var t=Ef(e);return(t.local?D5:M5)(t)}function O5(){}function tv(e){return e==null?O5:function(){return this.querySelector(e)}}function k5(e){typeof e!="function"&&(e=tv(e));for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i)for(var l=t[i],u=l.length,f=o[i]=new Array(u),m,h,g=0;g<u;++g)(m=l[g])&&(h=e.call(m,m.__data__,g,l))&&("__data__"in m&&(h.__data__=m.__data__),f[g]=h);return new Rn(o,this._parents)}function z5(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function L5(){return[]}function pC(e){return e==null?L5:function(){return this.querySelectorAll(e)}}function P5(e){return function(){return z5(e.apply(this,arguments))}}function U5(e){typeof e=="function"?e=P5(e):e=pC(e);for(var t=this._groups,r=t.length,o=[],i=[],l=0;l<r;++l)for(var u=t[l],f=u.length,m,h=0;h<f;++h)(m=u[h])&&(o.push(e.call(m,m.__data__,h,u)),i.push(m));return new Rn(o,i)}function gC(e){return function(){return this.matches(e)}}function vC(e){return function(t){return t.matches(e)}}var B5=Array.prototype.find;function H5(e){return function(){return B5.call(this.children,e)}}function $5(){return this.firstElementChild}function I5(e){return this.select(e==null?$5:H5(typeof e=="function"?e:vC(e)))}var V5=Array.prototype.filter;function q5(){return Array.from(this.children)}function Y5(e){return function(){return V5.call(this.children,e)}}function G5(e){return this.selectAll(e==null?q5:Y5(typeof e=="function"?e:vC(e)))}function F5(e){typeof e!="function"&&(e=gC(e));for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i)for(var l=t[i],u=l.length,f=o[i]=[],m,h=0;h<u;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new Rn(o,this._parents)}function yC(e){return new Array(e.length)}function X5(){return new Rn(this._enter||this._groups.map(yC),this._parents)}function Md(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Md.prototype={constructor:Md,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 W5(e){return function(){return e}}function K5(e,t,r,o,i,l){for(var u=0,f,m=t.length,h=l.length;u<h;++u)(f=t[u])?(f.__data__=l[u],o[u]=f):r[u]=new Md(e,l[u]);for(;u<m;++u)(f=t[u])&&(i[u]=f)}function Z5(e,t,r,o,i,l,u){var f,m,h=new Map,g=t.length,v=l.length,b=new Array(g),w;for(f=0;f<g;++f)(m=t[f])&&(b[f]=w=u.call(m,m.__data__,f,t)+"",h.has(w)?i[f]=m:h.set(w,m));for(f=0;f<v;++f)w=u.call(e,l[f],f,l)+"",(m=h.get(w))?(o[f]=m,m.__data__=l[f],h.delete(w)):r[f]=new Md(e,l[f]);for(f=0;f<g;++f)(m=t[f])&&h.get(b[f])===m&&(i[f]=m)}function Q5(e){return e.__data__}function J5(e,t){if(!arguments.length)return Array.from(this,Q5);var r=t?Z5:K5,o=this._parents,i=this._groups;typeof e!="function"&&(e=W5(e));for(var l=i.length,u=new Array(l),f=new Array(l),m=new Array(l),h=0;h<l;++h){var g=o[h],v=i[h],b=v.length,w=e6(e.call(g,g&&g.__data__,h,o)),E=w.length,S=f[h]=new Array(E),N=u[h]=new Array(E),C=m[h]=new Array(b);r(g,v,S,N,C,w,t);for(var j=0,A=0,M,O;j<E;++j)if(M=S[j]){for(j>=A&&(A=j+1);!(O=N[A])&&++A<E;);M._next=O||null}}return u=new Rn(u,o),u._enter=f,u._exit=m,u}function e6(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function t6(){return new Rn(this._exit||this._groups.map(yC),this._parents)}function n6(e,t,r){var o=this.enter(),i=this,l=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?l.remove():r(l),o&&i?o.merge(i).order():i}function r6(e){for(var t=e.selection?e.selection():e,r=this._groups,o=t._groups,i=r.length,l=o.length,u=Math.min(i,l),f=new Array(i),m=0;m<u;++m)for(var h=r[m],g=o[m],v=h.length,b=f[m]=new Array(v),w,E=0;E<v;++E)(w=h[E]||g[E])&&(b[E]=w);for(;m<i;++m)f[m]=r[m];return new Rn(f,this._parents)}function a6(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var o=e[t],i=o.length-1,l=o[i],u;--i>=0;)(u=o[i])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function o6(e){e||(e=s6);function t(v,b){return v&&b?e(v.__data__,b.__data__):!v-!b}for(var r=this._groups,o=r.length,i=new Array(o),l=0;l<o;++l){for(var u=r[l],f=u.length,m=i[l]=new Array(f),h,g=0;g<f;++g)(h=u[g])&&(m[g]=h);m.sort(t)}return new Rn(i,this._parents).order()}function s6(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function i6(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function l6(){return Array.from(this)}function c6(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o=e[t],i=0,l=o.length;i<l;++i){var u=o[i];if(u)return u}return null}function u6(){let e=0;for(const t of this)++e;return e}function d6(){return!this.node()}function f6(e){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var i=t[r],l=0,u=i.length,f;l<u;++l)(f=i[l])&&e.call(f,f.__data__,l,i);return this}function h6(e){return function(){this.removeAttribute(e)}}function m6(e){return function(){this.removeAttributeNS(e.space,e.local)}}function p6(e,t){return function(){this.setAttribute(e,t)}}function g6(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function v6(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function y6(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 x6(e,t){var r=Ef(e);if(arguments.length<2){var o=this.node();return r.local?o.getAttributeNS(r.space,r.local):o.getAttribute(r)}return this.each((t==null?r.local?m6:h6:typeof t=="function"?r.local?y6:v6:r.local?g6:p6)(r,t))}function xC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function b6(e){return function(){this.style.removeProperty(e)}}function w6(e,t,r){return function(){this.style.setProperty(e,t,r)}}function S6(e,t,r){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,r)}}function E6(e,t,r){return arguments.length>1?this.each((t==null?b6:typeof t=="function"?S6:w6)(e,t,r??"")):ri(this.node(),e)}function ri(e,t){return e.style.getPropertyValue(t)||xC(e).getComputedStyle(e,null).getPropertyValue(t)}function N6(e){return function(){delete this[e]}}function C6(e,t){return function(){this[e]=t}}function j6(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function _6(e,t){return arguments.length>1?this.each((t==null?N6:typeof t=="function"?j6:C6)(e,t)):this.node()[e]}function bC(e){return e.trim().split(/^|\s+/)}function nv(e){return e.classList||new wC(e)}function wC(e){this._node=e,this._names=bC(e.getAttribute("class")||"")}wC.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 SC(e,t){for(var r=nv(e),o=-1,i=t.length;++o<i;)r.add(t[o])}function EC(e,t){for(var r=nv(e),o=-1,i=t.length;++o<i;)r.remove(t[o])}function A6(e){return function(){SC(this,e)}}function T6(e){return function(){EC(this,e)}}function R6(e,t){return function(){(t.apply(this,arguments)?SC:EC)(this,e)}}function M6(e,t){var r=bC(e+"");if(arguments.length<2){for(var o=nv(this.node()),i=-1,l=r.length;++i<l;)if(!o.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?R6:t?A6:T6)(r,t))}function D6(){this.textContent=""}function O6(e){return function(){this.textContent=e}}function k6(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function z6(e){return arguments.length?this.each(e==null?D6:(typeof e=="function"?k6:O6)(e)):this.node().textContent}function L6(){this.innerHTML=""}function P6(e){return function(){this.innerHTML=e}}function U6(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function B6(e){return arguments.length?this.each(e==null?L6:(typeof e=="function"?U6:P6)(e)):this.node().innerHTML}function H6(){this.nextSibling&&this.parentNode.appendChild(this)}function $6(){return this.each(H6)}function I6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function V6(){return this.each(I6)}function q6(e){var t=typeof e=="function"?e:mC(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Y6(){return null}function G6(e,t){var r=typeof e=="function"?e:mC(e),o=t==null?Y6:typeof t=="function"?t:tv(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),o.apply(this,arguments)||null)})}function F6(){var e=this.parentNode;e&&e.removeChild(this)}function X6(){return this.each(F6)}function W6(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function K6(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Z6(e){return this.select(e?K6:W6)}function Q6(e){return arguments.length?this.property("__data__",e):this.node().__data__}function J6(e){return function(t){e.call(this,t,this.__data__)}}function eP(e){return e.trim().split(/^|\s+/).map(function(t){var r="",o=t.indexOf(".");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{type:t,name:r}})}function tP(e){return function(){var t=this.__on;if(t){for(var r=0,o=-1,i=t.length,l;r<i;++r)l=t[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++o]=l;++o?t.length=o:delete this.__on}}}function nP(e,t,r){return function(){var o=this.__on,i,l=J6(t);if(o){for(var u=0,f=o.length;u<f;++u)if((i=o[u]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=l,i.options=r),i.value=t;return}}this.addEventListener(e.type,l,r),i={type:e.type,name:e.name,value:t,listener:l,options:r},o?o.push(i):this.__on=[i]}}function rP(e,t,r){var o=eP(e+""),i,l=o.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var m=0,h=f.length,g;m<h;++m)for(i=0,g=f[m];i<l;++i)if((u=o[i]).type===g.type&&u.name===g.name)return g.value}return}for(f=t?nP:tP,i=0;i<l;++i)this.each(f(o[i],t,r));return this}function NC(e,t,r){var o=xC(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,r):(i=o.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function aP(e,t){return function(){return NC(this,e,t)}}function oP(e,t){return function(){return NC(this,e,t.apply(this,arguments))}}function sP(e,t){return this.each((typeof t=="function"?oP:aP)(e,t))}function*iP(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o=e[t],i=0,l=o.length,u;i<l;++i)(u=o[i])&&(yield u)}var CC=[null];function Rn(e,t){this._groups=e,this._parents=t}function pc(){return new Rn([[document.documentElement]],CC)}function lP(){return this}Rn.prototype=pc.prototype={constructor:Rn,select:k5,selectAll:U5,selectChild:I5,selectChildren:G5,filter:F5,data:J5,enter:X5,exit:t6,join:n6,merge:r6,selection:lP,order:a6,sort:o6,call:i6,nodes:l6,node:c6,size:u6,empty:d6,each:f6,attr:x6,style:E6,property:_6,classed:M6,text:z6,html:B6,raise:$6,lower:V6,append:q6,insert:G6,remove:X6,clone:Z6,datum:Q6,on:rP,dispatch:sP,[Symbol.iterator]:iP};function In(e){return typeof e=="string"?new Rn([[document.querySelector(e)]],[document.documentElement]):new Rn([[e]],CC)}function cP(e){let t;for(;t=e.sourceEvent;)e=t;return e}function er(e,t){if(e=cP(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var o=r.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const uP={passive:!1},Gl={capture:!0,passive:!1};function hp(e){e.stopImmediatePropagation()}function Js(e){e.preventDefault(),e.stopImmediatePropagation()}function jC(e){var t=e.document.documentElement,r=In(e).on("dragstart.drag",Js,Gl);"onselectstart"in t?r.on("selectstart.drag",Js,Gl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function _C(e,t){var r=e.document.documentElement,o=In(e).on("dragstart.drag",null);t&&(o.on("click.drag",Js,Gl),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in r?o.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Gu=e=>()=>e;function Wp(e,{sourceEvent:t,subject:r,target:o,identifier:i,active:l,x:u,y:f,dx:m,dy:h,dispatch:g}){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:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}Wp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function dP(e){return!e.ctrlKey&&!e.button}function fP(){return this.parentNode}function hP(e,t){return t??{x:e.x,y:e.y}}function mP(){return navigator.maxTouchPoints||"ontouchstart"in this}function pP(){var e=dP,t=fP,r=hP,o=mP,i={},l=Sf("start","drag","end"),u=0,f,m,h,g,v=0;function b(M){M.on("mousedown.drag",w).filter(o).on("touchstart.drag",N).on("touchmove.drag",C,uP).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(M,O){if(!(g||!e.call(this,M,O))){var U=A(this,t.call(this,M,O),M,O,"mouse");U&&(In(M.view).on("mousemove.drag",E,Gl).on("mouseup.drag",S,Gl),jC(M.view),hp(M),h=!1,f=M.clientX,m=M.clientY,U("start",M))}}function E(M){if(Js(M),!h){var O=M.clientX-f,U=M.clientY-m;h=O*O+U*U>v}i.mouse("drag",M)}function S(M){In(M.view).on("mousemove.drag mouseup.drag",null),_C(M.view,h),Js(M),i.mouse("end",M)}function N(M,O){if(e.call(this,M,O)){var U=M.changedTouches,H=t.call(this,M,O),V=U.length,P,z;for(P=0;P<V;++P)(z=A(this,H,M,O,U[P].identifier,U[P]))&&(hp(M),z("start",M,U[P]))}}function C(M){var O=M.changedTouches,U=O.length,H,V;for(H=0;H<U;++H)(V=i[O[H].identifier])&&(Js(M),V("drag",M,O[H]))}function j(M){var O=M.changedTouches,U=O.length,H,V;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),H=0;H<U;++H)(V=i[O[H].identifier])&&(hp(M),V("end",M,O[H]))}function A(M,O,U,H,V,P){var z=l.copy(),F=er(P||U,O),K,te,k;if((k=r.call(M,new Wp("beforestart",{sourceEvent:U,target:b,identifier:V,active:u,x:F[0],y:F[1],dx:0,dy:0,dispatch:z}),H))!=null)return K=k.x-F[0]||0,te=k.y-F[1]||0,function Y(D,q,B){var L=F,T;switch(D){case"start":i[V]=Y,T=u++;break;case"end":delete i[V],--u;case"drag":F=er(B||q,O),T=u;break}z.call(D,M,new Wp(D,{sourceEvent:q,subject:k,target:b,identifier:V,active:T,x:F[0]+K,y:F[1]+te,dx:F[0]-L[0],dy:F[1]-L[1],dispatch:z}),H)}}return b.filter=function(M){return arguments.length?(e=typeof M=="function"?M:Gu(!!M),b):e},b.container=function(M){return arguments.length?(t=typeof M=="function"?M:Gu(M),b):t},b.subject=function(M){return arguments.length?(r=typeof M=="function"?M:Gu(M),b):r},b.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:Gu(!!M),b):o},b.on=function(){var M=l.on.apply(l,arguments);return M===l?b:M},b.clickDistance=function(M){return arguments.length?(v=(M=+M)*M,b):Math.sqrt(v)},b}function rv(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function AC(e,t){var r=Object.create(e.prototype);for(var o in t)r[o]=t[o];return r}function gc(){}var Fl=.7,Dd=1/Fl,ei="\\s*([+-]?\\d+)\\s*",Xl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Cr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gP=/^#([0-9a-f]{3,8})$/,vP=new RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),yP=new RegExp(`^rgb\\(${Cr},${Cr},${Cr}\\)$`),xP=new RegExp(`^rgba\\(${ei},${ei},${ei},${Xl}\\)$`),bP=new RegExp(`^rgba\\(${Cr},${Cr},${Cr},${Xl}\\)$`),wP=new RegExp(`^hsl\\(${Xl},${Cr},${Cr}\\)$`),SP=new RegExp(`^hsla\\(${Xl},${Cr},${Cr},${Xl}\\)$`),yw={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};rv(gc,Wl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xw,formatHex:xw,formatHex8:EP,formatHsl:NP,formatRgb:bw,toString:bw});function xw(){return this.rgb().formatHex()}function EP(){return this.rgb().formatHex8()}function NP(){return TC(this).formatHsl()}function bw(){return this.rgb().formatRgb()}function Wl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=gP.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?ww(t):r===3?new mn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Fu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Fu(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=vP.exec(e))?new mn(t[1],t[2],t[3],1):(t=yP.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xP.exec(e))?Fu(t[1],t[2],t[3],t[4]):(t=bP.exec(e))?Fu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wP.exec(e))?Nw(t[1],t[2]/100,t[3]/100,1):(t=SP.exec(e))?Nw(t[1],t[2]/100,t[3]/100,t[4]):yw.hasOwnProperty(e)?ww(yw[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function ww(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function Fu(e,t,r,o){return o<=0&&(e=t=r=NaN),new mn(e,t,r,o)}function CP(e){return e instanceof gc||(e=Wl(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function Kp(e,t,r,o){return arguments.length===1?CP(e):new mn(e,t,r,o??1)}function mn(e,t,r,o){this.r=+e,this.g=+t,this.b=+r,this.opacity=+o}rv(mn,Kp,AC(gc,{brighter(e){return e=e==null?Dd:Math.pow(Dd,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fl:Math.pow(Fl,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(Bo(this.r),Bo(this.g),Bo(this.b),Od(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:Sw,formatHex:Sw,formatHex8:jP,formatRgb:Ew,toString:Ew}));function Sw(){return`#${Lo(this.r)}${Lo(this.g)}${Lo(this.b)}`}function jP(){return`#${Lo(this.r)}${Lo(this.g)}${Lo(this.b)}${Lo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ew(){const e=Od(this.opacity);return`${e===1?"rgb(":"rgba("}${Bo(this.r)}, ${Bo(this.g)}, ${Bo(this.b)}${e===1?")":`, ${e})`}`}function Od(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Lo(e){return e=Bo(e),(e<16?"0":"")+e.toString(16)}function Nw(e,t,r,o){return o<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,r,o)}function TC(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof gc||(e=Wl(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,o=e.b/255,i=Math.min(t,r,o),l=Math.max(t,r,o),u=NaN,f=l-i,m=(l+i)/2;return f?(t===l?u=(r-o)/f+(r<o)*6:r===l?u=(o-t)/f+2:u=(t-r)/f+4,f/=m<.5?l+i:2-l-i,u*=60):f=m>0&&m<1?0:u,new tr(u,f,m,e.opacity)}function _P(e,t,r,o){return arguments.length===1?TC(e):new tr(e,t,r,o??1)}function tr(e,t,r,o){this.h=+e,this.s=+t,this.l=+r,this.opacity=+o}rv(tr,_P,AC(gc,{brighter(e){return e=e==null?Dd:Math.pow(Dd,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fl:Math.pow(Fl,e),new tr(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,o=r+(r<.5?r:1-r)*t,i=2*r-o;return new mn(mp(e>=240?e-240:e+120,i,o),mp(e,i,o),mp(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new tr(Cw(this.h),Xu(this.s),Xu(this.l),Od(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=Od(this.opacity);return`${e===1?"hsl(":"hsla("}${Cw(this.h)}, ${Xu(this.s)*100}%, ${Xu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Cw(e){return e=(e||0)%360,e<0?e+360:e}function Xu(e){return Math.max(0,Math.min(1,e||0))}function mp(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 RC=e=>()=>e;function AP(e,t){return function(r){return e+r*t}}function TP(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(o){return Math.pow(e+o*t,r)}}function RP(e){return(e=+e)==1?MC:function(t,r){return r-t?TP(t,r,e):RC(isNaN(t)?r:t)}}function MC(e,t){var r=t-e;return r?AP(e,r):RC(isNaN(e)?t:e)}const jw=function e(t){var r=RP(t);function o(i,l){var u=r((i=Kp(i)).r,(l=Kp(l)).r),f=r(i.g,l.g),m=r(i.b,l.b),h=MC(i.opacity,l.opacity);return function(g){return i.r=u(g),i.g=f(g),i.b=m(g),i.opacity=h(g),i+""}}return o.gamma=e,o}(1);function Wa(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Zp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pp=new RegExp(Zp.source,"g");function MP(e){return function(){return e}}function DP(e){return function(t){return e(t)+""}}function OP(e,t){var r=Zp.lastIndex=pp.lastIndex=0,o,i,l,u=-1,f=[],m=[];for(e=e+"",t=t+"";(o=Zp.exec(e))&&(i=pp.exec(t));)(l=i.index)>r&&(l=t.slice(r,l),f[u]?f[u]+=l:f[++u]=l),(o=o[0])===(i=i[0])?f[u]?f[u]+=i:f[++u]=i:(f[++u]=null,m.push({i:u,x:Wa(o,i)})),r=pp.lastIndex;return r<t.length&&(l=t.slice(r),f[u]?f[u]+=l:f[++u]=l),f.length<2?m[0]?DP(m[0].x):MP(t):(t=m.length,function(h){for(var g=0,v;g<t;++g)f[(v=m[g]).i]=v.x(h);return f.join("")})}var _w=180/Math.PI,Qp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function DC(e,t,r,o,i,l){var u,f,m;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(m=e*r+t*o)&&(r-=e*m,o-=t*m),(f=Math.sqrt(r*r+o*o))&&(r/=f,o/=f,m/=f),e*o<t*r&&(e=-e,t=-t,m=-m,u=-u),{translateX:i,translateY:l,rotate:Math.atan2(t,e)*_w,skewX:Math.atan(m)*_w,scaleX:u,scaleY:f}}var Wu;function kP(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qp:DC(t.a,t.b,t.c,t.d,t.e,t.f)}function zP(e){return e==null||(Wu||(Wu=document.createElementNS("http://www.w3.org/2000/svg","g")),Wu.setAttribute("transform",e),!(e=Wu.transform.baseVal.consolidate()))?Qp:(e=e.matrix,DC(e.a,e.b,e.c,e.d,e.e,e.f))}function OC(e,t,r,o){function i(h){return h.length?h.pop()+" ":""}function l(h,g,v,b,w,E){if(h!==v||g!==b){var S=w.push("translate(",null,t,null,r);E.push({i:S-4,x:Wa(h,v)},{i:S-2,x:Wa(g,b)})}else(v||b)&&w.push("translate("+v+t+b+r)}function u(h,g,v,b){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),b.push({i:v.push(i(v)+"rotate(",null,o)-2,x:Wa(h,g)})):g&&v.push(i(v)+"rotate("+g+o)}function f(h,g,v,b){h!==g?b.push({i:v.push(i(v)+"skewX(",null,o)-2,x:Wa(h,g)}):g&&v.push(i(v)+"skewX("+g+o)}function m(h,g,v,b,w,E){if(h!==v||g!==b){var S=w.push(i(w)+"scale(",null,",",null,")");E.push({i:S-4,x:Wa(h,v)},{i:S-2,x:Wa(g,b)})}else(v!==1||b!==1)&&w.push(i(w)+"scale("+v+","+b+")")}return function(h,g){var v=[],b=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,v,b),u(h.rotate,g.rotate,v,b),f(h.skewX,g.skewX,v,b),m(h.scaleX,h.scaleY,g.scaleX,g.scaleY,v,b),h=g=null,function(w){for(var E=-1,S=b.length,N;++E<S;)v[(N=b[E]).i]=N.x(w);return v.join("")}}}var LP=OC(kP,"px, ","px)","deg)"),PP=OC(zP,", ",")",")"),UP=1e-12;function Aw(e){return((e=Math.exp(e))+1/e)/2}function BP(e){return((e=Math.exp(e))-1/e)/2}function HP(e){return((e=Math.exp(2*e))-1)/(e+1)}const $P=function e(t,r,o){function i(l,u){var f=l[0],m=l[1],h=l[2],g=u[0],v=u[1],b=u[2],w=g-f,E=v-m,S=w*w+E*E,N,C;if(S<UP)C=Math.log(b/h)/t,N=function(H){return[f+H*w,m+H*E,h*Math.exp(t*H*C)]};else{var j=Math.sqrt(S),A=(b*b-h*h+o*S)/(2*h*r*j),M=(b*b-h*h-o*S)/(2*b*r*j),O=Math.log(Math.sqrt(A*A+1)-A),U=Math.log(Math.sqrt(M*M+1)-M);C=(U-O)/t,N=function(H){var V=H*C,P=Aw(O),z=h/(r*j)*(P*HP(t*V+O)-BP(O));return[f+z*w,m+z*E,h*P/Aw(t*V+O)]}}return N.duration=C*1e3*t/Math.SQRT2,N}return i.rho=function(l){var u=Math.max(.001,+l),f=u*u,m=f*f;return e(u,f,m)},i}(Math.SQRT2,2,4);var ai=0,Ol=0,Sl=0,kC=1e3,kd,kl,zd=0,Qo=0,Nf=0,Kl=typeof performance=="object"&&performance.now?performance:Date,zC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function av(){return Qo||(zC(IP),Qo=Kl.now()+Nf)}function IP(){Qo=0}function Ld(){this._call=this._time=this._next=null}Ld.prototype=LC.prototype={constructor:Ld,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?av():+r)+(t==null?0:+t),!this._next&&kl!==this&&(kl?kl._next=this:kd=this,kl=this),this._call=e,this._time=r,Jp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jp())}};function LC(e,t,r){var o=new Ld;return o.restart(e,t,r),o}function VP(){av(),++ai;for(var e=kd,t;e;)(t=Qo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ai}function Tw(){Qo=(zd=Kl.now())+Nf,ai=Ol=0;try{VP()}finally{ai=0,YP(),Qo=0}}function qP(){var e=Kl.now(),t=e-zd;t>kC&&(Nf-=t,zd=e)}function YP(){for(var e,t=kd,r,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:kd=r);kl=e,Jp(o)}function Jp(e){if(!ai){Ol&&(Ol=clearTimeout(Ol));var t=e-Qo;t>24?(e<1/0&&(Ol=setTimeout(Tw,e-Kl.now()-Nf)),Sl&&(Sl=clearInterval(Sl))):(Sl||(zd=Kl.now(),Sl=setInterval(qP,kC)),ai=1,zC(Tw))}}function Rw(e,t,r){var o=new Ld;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,r),o}var GP=Sf("start","end","cancel","interrupt"),FP=[],PC=0,Mw=1,eg=2,hd=3,Dw=4,tg=5,md=6;function Cf(e,t,r,o,i,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;XP(e,r,{name:t,index:o,group:i,on:GP,tween:FP,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:PC})}function ov(e,t){var r=pr(e,t);if(r.state>PC)throw new Error("too late; already scheduled");return r}function Or(e,t){var r=pr(e,t);if(r.state>hd)throw new Error("too late; already running");return r}function pr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function XP(e,t,r){var o=e.__transition,i;o[t]=r,r.timer=LC(l,0,r.time);function l(h){r.state=Mw,r.timer.restart(u,r.delay,r.time),r.delay<=h&&u(h-r.delay)}function u(h){var g,v,b,w;if(r.state!==Mw)return m();for(g in o)if(w=o[g],w.name===r.name){if(w.state===hd)return Rw(u);w.state===Dw?(w.state=md,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete o[g]):+g<t&&(w.state=md,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete o[g])}if(Rw(function(){r.state===hd&&(r.state=Dw,r.timer.restart(f,r.delay,r.time),f(h))}),r.state=eg,r.on.call("start",e,e.__data__,r.index,r.group),r.state===eg){for(r.state=hd,i=new Array(b=r.tween.length),g=0,v=-1;g<b;++g)(w=r.tween[g].value.call(e,e.__data__,r.index,r.group))&&(i[++v]=w);i.length=v+1}}function f(h){for(var g=h<r.duration?r.ease.call(null,h/r.duration):(r.timer.restart(m),r.state=tg,1),v=-1,b=i.length;++v<b;)i[v].call(e,g);r.state===tg&&(r.on.call("end",e,e.__data__,r.index,r.group),m())}function m(){r.state=md,r.timer.stop(),delete o[t];for(var h in o)return;delete e.__transition}}function pd(e,t){var r=e.__transition,o,i,l=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((o=r[u]).name!==t){l=!1;continue}i=o.state>eg&&o.state<tg,o.state=md,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete r[u]}l&&delete e.__transition}}function WP(e){return this.each(function(){pd(this,e)})}function KP(e,t){var r,o;return function(){var i=Or(this,e),l=i.tween;if(l!==r){o=r=l;for(var u=0,f=o.length;u<f;++u)if(o[u].name===t){o=o.slice(),o.splice(u,1);break}}i.tween=o}}function ZP(e,t,r){var o,i;if(typeof r!="function")throw new Error;return function(){var l=Or(this,e),u=l.tween;if(u!==o){i=(o=u).slice();for(var f={name:t,value:r},m=0,h=i.length;m<h;++m)if(i[m].name===t){i[m]=f;break}m===h&&i.push(f)}l.tween=i}}function QP(e,t){var r=this._id;if(e+="",arguments.length<2){for(var o=pr(this.node(),r).tween,i=0,l=o.length,u;i<l;++i)if((u=o[i]).name===e)return u.value;return null}return this.each((t==null?KP:ZP)(r,e,t))}function sv(e,t,r){var o=e._id;return e.each(function(){var i=Or(this,o);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return pr(i,o).value[t]}}function UC(e,t){var r;return(typeof t=="number"?Wa:t instanceof Wl?jw:(r=Wl(t))?(t=r,jw):OP)(e,t)}function JP(e){return function(){this.removeAttribute(e)}}function e8(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t8(e,t,r){var o,i=r+"",l;return function(){var u=this.getAttribute(e);return u===i?null:u===o?l:l=t(o=u,r)}}function n8(e,t,r){var o,i=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===i?null:u===o?l:l=t(o=u,r)}}function r8(e,t,r){var o,i,l;return function(){var u,f=r(this),m;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),m=f+"",u===m?null:u===o&&m===i?l:(i=m,l=t(o=u,f)))}}function a8(e,t,r){var o,i,l;return function(){var u,f=r(this),m;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),m=f+"",u===m?null:u===o&&m===i?l:(i=m,l=t(o=u,f)))}}function o8(e,t){var r=Ef(e),o=r==="transform"?PP:UC;return this.attrTween(e,typeof t=="function"?(r.local?a8:r8)(r,o,sv(this,"attr."+e,t)):t==null?(r.local?e8:JP)(r):(r.local?n8:t8)(r,o,t))}function s8(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function i8(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function l8(e,t){var r,o;function i(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&i8(e,l)),r}return i._value=t,i}function c8(e,t){var r,o;function i(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&s8(e,l)),r}return i._value=t,i}function u8(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 o=Ef(e);return this.tween(r,(o.local?l8:c8)(o,t))}function d8(e,t){return function(){ov(this,e).delay=+t.apply(this,arguments)}}function f8(e,t){return t=+t,function(){ov(this,e).delay=t}}function h8(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?d8:f8)(t,e)):pr(this.node(),t).delay}function m8(e,t){return function(){Or(this,e).duration=+t.apply(this,arguments)}}function p8(e,t){return t=+t,function(){Or(this,e).duration=t}}function g8(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?m8:p8)(t,e)):pr(this.node(),t).duration}function v8(e,t){if(typeof t!="function")throw new Error;return function(){Or(this,e).ease=t}}function y8(e){var t=this._id;return arguments.length?this.each(v8(t,e)):pr(this.node(),t).ease}function x8(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Or(this,e).ease=r}}function b8(e){if(typeof e!="function")throw new Error;return this.each(x8(this._id,e))}function w8(e){typeof e!="function"&&(e=gC(e));for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i)for(var l=t[i],u=l.length,f=o[i]=[],m,h=0;h<u;++h)(m=l[h])&&e.call(m,m.__data__,h,l)&&f.push(m);return new da(o,this._parents,this._name,this._id)}function S8(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,o=t.length,i=r.length,l=Math.min(o,i),u=new Array(o),f=0;f<l;++f)for(var m=t[f],h=r[f],g=m.length,v=u[f]=new Array(g),b,w=0;w<g;++w)(b=m[w]||h[w])&&(v[w]=b);for(;f<o;++f)u[f]=t[f];return new da(u,this._parents,this._name,this._id)}function E8(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 N8(e,t,r){var o,i,l=E8(t)?ov:Or;return function(){var u=l(this,e),f=u.on;f!==o&&(i=(o=f).copy()).on(t,r),u.on=i}}function C8(e,t){var r=this._id;return arguments.length<2?pr(this.node(),r).on.on(e):this.each(N8(r,e,t))}function j8(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function _8(){return this.on("end.remove",j8(this._id))}function A8(e){var t=this._name,r=this._id;typeof e!="function"&&(e=tv(e));for(var o=this._groups,i=o.length,l=new Array(i),u=0;u<i;++u)for(var f=o[u],m=f.length,h=l[u]=new Array(m),g,v,b=0;b<m;++b)(g=f[b])&&(v=e.call(g,g.__data__,b,f))&&("__data__"in g&&(v.__data__=g.__data__),h[b]=v,Cf(h[b],t,r,b,h,pr(g,r)));return new da(l,this._parents,t,r)}function T8(e){var t=this._name,r=this._id;typeof e!="function"&&(e=pC(e));for(var o=this._groups,i=o.length,l=[],u=[],f=0;f<i;++f)for(var m=o[f],h=m.length,g,v=0;v<h;++v)if(g=m[v]){for(var b=e.call(g,g.__data__,v,m),w,E=pr(g,r),S=0,N=b.length;S<N;++S)(w=b[S])&&Cf(w,t,r,S,b,E);l.push(b),u.push(g)}return new da(l,u,t,r)}var R8=pc.prototype.constructor;function M8(){return new R8(this._groups,this._parents)}function D8(e,t){var r,o,i;return function(){var l=ri(this,e),u=(this.style.removeProperty(e),ri(this,e));return l===u?null:l===r&&u===o?i:i=t(r=l,o=u)}}function BC(e){return function(){this.style.removeProperty(e)}}function O8(e,t,r){var o,i=r+"",l;return function(){var u=ri(this,e);return u===i?null:u===o?l:l=t(o=u,r)}}function k8(e,t,r){var o,i,l;return function(){var u=ri(this,e),f=r(this),m=f+"";return f==null&&(m=f=(this.style.removeProperty(e),ri(this,e))),u===m?null:u===o&&m===i?l:(i=m,l=t(o=u,f))}}function z8(e,t){var r,o,i,l="style."+t,u="end."+l,f;return function(){var m=Or(this,e),h=m.on,g=m.value[l]==null?f||(f=BC(t)):void 0;(h!==r||i!==g)&&(o=(r=h).copy()).on(u,i=g),m.on=o}}function L8(e,t,r){var o=(e+="")=="transform"?LP:UC;return t==null?this.styleTween(e,D8(e,o)).on("end.style."+e,BC(e)):typeof t=="function"?this.styleTween(e,k8(e,o,sv(this,"style."+e,t))).each(z8(this._id,e)):this.styleTween(e,O8(e,o,t),r).on("end.style."+e,null)}function P8(e,t,r){return function(o){this.style.setProperty(e,t.call(this,o),r)}}function U8(e,t,r){var o,i;function l(){var u=t.apply(this,arguments);return u!==i&&(o=(i=u)&&P8(e,u,r)),o}return l._value=t,l}function B8(e,t,r){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,U8(e,t,r??""))}function H8(e){return function(){this.textContent=e}}function $8(e){return function(){var t=e(this);this.textContent=t??""}}function I8(e){return this.tween("text",typeof e=="function"?$8(sv(this,"text",e)):H8(e==null?"":e+""))}function V8(e){return function(t){this.textContent=e.call(this,t)}}function q8(e){var t,r;function o(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&V8(i)),t}return o._value=e,o}function Y8(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,q8(e))}function G8(){for(var e=this._name,t=this._id,r=HC(),o=this._groups,i=o.length,l=0;l<i;++l)for(var u=o[l],f=u.length,m,h=0;h<f;++h)if(m=u[h]){var g=pr(m,t);Cf(m,e,r,h,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new da(o,this._parents,e,r)}function F8(){var e,t,r=this,o=r._id,i=r.size();return new Promise(function(l,u){var f={value:u},m={value:function(){--i===0&&l()}};r.each(function(){var h=Or(this,o),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(m)),h.on=t}),i===0&&l()})}var X8=0;function da(e,t,r,o){this._groups=e,this._parents=t,this._name=r,this._id=o}function HC(){return++X8}var ea=pc.prototype;da.prototype={constructor:da,select:A8,selectAll:T8,selectChild:ea.selectChild,selectChildren:ea.selectChildren,filter:w8,merge:S8,selection:M8,transition:G8,call:ea.call,nodes:ea.nodes,node:ea.node,size:ea.size,empty:ea.empty,each:ea.each,on:C8,attr:o8,attrTween:u8,style:L8,styleTween:B8,text:I8,textTween:Y8,remove:_8,tween:QP,delay:h8,duration:g8,ease:y8,easeVarying:b8,end:F8,[Symbol.iterator]:ea[Symbol.iterator]};function W8(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var K8={time:null,delay:0,duration:250,ease:W8};function Z8(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 Q8(e){var t,r;e instanceof da?(t=e._id,e=e._name):(t=HC(),(r=K8).time=av(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,l=0;l<i;++l)for(var u=o[l],f=u.length,m,h=0;h<f;++h)(m=u[h])&&Cf(m,e,t,h,u,r||Z8(m,t));return new da(o,this._parents,e,t)}pc.prototype.interrupt=WP;pc.prototype.transition=Q8;const Ku=e=>()=>e;function J8(e,{sourceEvent:t,target:r,transform:o,dispatch:i}){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:o,enumerable:!0,configurable:!0},_:{value:i}})}function na(e,t,r){this.k=e,this.x=t,this.y=r}na.prototype={constructor:na,scale:function(e){return e===1?this:new na(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new na(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 oa=new na(1,0,0);na.prototype;function gp(e){e.stopImmediatePropagation()}function El(e){e.preventDefault(),e.stopImmediatePropagation()}function eU(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tU(){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||oa}function nU(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rU(){return navigator.maxTouchPoints||"ontouchstart"in this}function aU(e,t,r){var o=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],l=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function $C(){var e=eU,t=tU,r=aU,o=nU,i=rU,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,m=$P,h=Sf("start","zoom","end"),g,v,b,w=500,E=150,S=0,N=10;function C(k){k.property("__zoom",Ow).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",K).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(k,Y,D,q){var B=k.selection?k.selection():k;B.property("__zoom",Ow),k!==B?O(k,Y,D,q):B.interrupt().each(function(){U(this,arguments).event(q).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},C.scaleBy=function(k,Y,D,q){C.scaleTo(k,function(){var B=this.__zoom.k,L=typeof Y=="function"?Y.apply(this,arguments):Y;return B*L},D,q)},C.scaleTo=function(k,Y,D,q){C.transform(k,function(){var B=t.apply(this,arguments),L=this.__zoom,T=D==null?M(B):typeof D=="function"?D.apply(this,arguments):D,I=L.invert(T),X=typeof Y=="function"?Y.apply(this,arguments):Y;return r(A(j(L,X),T,I),B,u)},D,q)},C.translateBy=function(k,Y,D,q){C.transform(k,function(){return r(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),u)},null,q)},C.translateTo=function(k,Y,D,q,B){C.transform(k,function(){var L=t.apply(this,arguments),T=this.__zoom,I=q==null?M(L):typeof q=="function"?q.apply(this,arguments):q;return r(oa.translate(I[0],I[1]).scale(T.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof D=="function"?-D.apply(this,arguments):-D),L,u)},q,B)};function j(k,Y){return Y=Math.max(l[0],Math.min(l[1],Y)),Y===k.k?k:new na(Y,k.x,k.y)}function A(k,Y,D){var q=Y[0]-D[0]*k.k,B=Y[1]-D[1]*k.k;return q===k.x&&B===k.y?k:new na(k.k,q,B)}function M(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function O(k,Y,D,q){k.on("start.zoom",function(){U(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){U(this,arguments).event(q).end()}).tween("zoom",function(){var B=this,L=arguments,T=U(B,L).event(q),I=t.apply(B,L),X=D==null?M(I):typeof D=="function"?D.apply(B,L):D,Z=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),re=B.__zoom,fe=typeof Y=="function"?Y.apply(B,L):Y,ue=m(re.invert(X).concat(Z/re.k),fe.invert(X).concat(Z/fe.k));return function(se){if(se===1)se=fe;else{var me=ue(se),pe=Z/me[2];se=new na(pe,X[0]-me[0]*pe,X[1]-me[1]*pe)}T.zoom(null,se)}})}function U(k,Y,D){return!D&&k.__zooming||new H(k,Y)}function H(k,Y){this.that=k,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=t.apply(k,Y),this.taps=0}H.prototype={event:function(k){return k&&(this.sourceEvent=k),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(k,Y){return this.mouse&&k!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&k!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&k!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(k){var Y=In(this.that).datum();h.call(k,this.that,new J8(k,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:h}),Y)}};function V(k,...Y){if(!e.apply(this,arguments))return;var D=U(this,Y).event(k),q=this.__zoom,B=Math.max(l[0],Math.min(l[1],q.k*Math.pow(2,o.apply(this,arguments)))),L=er(k);if(D.wheel)(D.mouse[0][0]!==L[0]||D.mouse[0][1]!==L[1])&&(D.mouse[1]=q.invert(D.mouse[0]=L)),clearTimeout(D.wheel);else{if(q.k===B)return;D.mouse=[L,q.invert(L)],pd(this),D.start()}El(k),D.wheel=setTimeout(T,E),D.zoom("mouse",r(A(j(q,B),D.mouse[0],D.mouse[1]),D.extent,u));function T(){D.wheel=null,D.end()}}function P(k,...Y){if(b||!e.apply(this,arguments))return;var D=k.currentTarget,q=U(this,Y,!0).event(k),B=In(k.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",Z,!0),L=er(k,D),T=k.clientX,I=k.clientY;jC(k.view),gp(k),q.mouse=[L,this.__zoom.invert(L)],pd(this),q.start();function X(re){if(El(re),!q.moved){var fe=re.clientX-T,ue=re.clientY-I;q.moved=fe*fe+ue*ue>S}q.event(re).zoom("mouse",r(A(q.that.__zoom,q.mouse[0]=er(re,D),q.mouse[1]),q.extent,u))}function Z(re){B.on("mousemove.zoom mouseup.zoom",null),_C(re.view,q.moved),El(re),q.event(re).end()}}function z(k,...Y){if(e.apply(this,arguments)){var D=this.__zoom,q=er(k.changedTouches?k.changedTouches[0]:k,this),B=D.invert(q),L=D.k*(k.shiftKey?.5:2),T=r(A(j(D,L),q,B),t.apply(this,Y),u);El(k),f>0?In(this).transition().duration(f).call(O,T,q,k):In(this).call(C.transform,T,q,k)}}function F(k,...Y){if(e.apply(this,arguments)){var D=k.touches,q=D.length,B=U(this,Y,k.changedTouches.length===q).event(k),L,T,I,X;for(gp(k),T=0;T<q;++T)I=D[T],X=er(I,this),X=[X,this.__zoom.invert(X),I.identifier],B.touch0?!B.touch1&&B.touch0[2]!==X[2]&&(B.touch1=X,B.taps=0):(B.touch0=X,L=!0,B.taps=1+!!g);g&&(g=clearTimeout(g)),L&&(B.taps<2&&(v=X[0],g=setTimeout(function(){g=null},w)),pd(this),B.start())}}function K(k,...Y){if(this.__zooming){var D=U(this,Y).event(k),q=k.changedTouches,B=q.length,L,T,I,X;for(El(k),L=0;L<B;++L)T=q[L],I=er(T,this),D.touch0&&D.touch0[2]===T.identifier?D.touch0[0]=I:D.touch1&&D.touch1[2]===T.identifier&&(D.touch1[0]=I);if(T=D.that.__zoom,D.touch1){var Z=D.touch0[0],re=D.touch0[1],fe=D.touch1[0],ue=D.touch1[1],se=(se=fe[0]-Z[0])*se+(se=fe[1]-Z[1])*se,me=(me=ue[0]-re[0])*me+(me=ue[1]-re[1])*me;T=j(T,Math.sqrt(se/me)),I=[(Z[0]+fe[0])/2,(Z[1]+fe[1])/2],X=[(re[0]+ue[0])/2,(re[1]+ue[1])/2]}else if(D.touch0)I=D.touch0[0],X=D.touch0[1];else return;D.zoom("touch",r(A(T,I,X),D.extent,u))}}function te(k,...Y){if(this.__zooming){var D=U(this,Y).event(k),q=k.changedTouches,B=q.length,L,T;for(gp(k),b&&clearTimeout(b),b=setTimeout(function(){b=null},w),L=0;L<B;++L)T=q[L],D.touch0&&D.touch0[2]===T.identifier?delete D.touch0:D.touch1&&D.touch1[2]===T.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(T=er(T,this),Math.hypot(v[0]-T[0],v[1]-T[1])<N)){var I=In(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return C.wheelDelta=function(k){return arguments.length?(o=typeof k=="function"?k:Ku(+k),C):o},C.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Ku(!!k),C):e},C.touchable=function(k){return arguments.length?(i=typeof k=="function"?k:Ku(!!k),C):i},C.extent=function(k){return arguments.length?(t=typeof k=="function"?k:Ku([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),C):t},C.scaleExtent=function(k){return arguments.length?(l[0]=+k[0],l[1]=+k[1],C):[l[0],l[1]]},C.translateExtent=function(k){return arguments.length?(u[0][0]=+k[0][0],u[1][0]=+k[1][0],u[0][1]=+k[0][1],u[1][1]=+k[1][1],C):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},C.constrain=function(k){return arguments.length?(r=k,C):r},C.duration=function(k){return arguments.length?(f=+k,C):f},C.interpolate=function(k){return arguments.length?(m=k,C):m},C.on=function(){var k=h.on.apply(h,arguments);return k===h?C:k},C.clickDistance=function(k){return arguments.length?(S=(k=+k)*k,C):Math.sqrt(S)},C.tapDistance=function(k){return arguments.length?(N=+k,C):N},C}const jf=x.createContext(null),oU=jf.Provider,fa={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,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},IC=fa.error001();function dt(e,t){const r=x.useContext(jf);if(r===null)throw new Error(IC);return hC(r,e,t)}const zt=()=>{const e=x.useContext(jf);if(e===null)throw new Error(IC);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},sU=e=>e.userSelectionActive?"none":"all";function iv({position:e,children:t,className:r,style:o,...i}){const l=dt(sU),u=`${e}`.split("-");return ae.createElement("div",{className:Xt(["react-flow__panel",r,...u]),style:{...o,pointerEvents:l},...i},t)}function iU({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:ae.createElement(iv,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ae.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const lU=({x:e,y:t,label:r,labelStyle:o={},labelShowBg:i=!0,labelBgStyle:l={},labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:m,className:h,...g})=>{const v=x.useRef(null),[b,w]=x.useState({x:0,y:0,width:0,height:0}),E=Xt(["react-flow__edge-textwrapper",h]);return x.useEffect(()=>{if(v.current){const S=v.current.getBBox();w({x:S.x,y:S.y,width:S.width,height:S.height})}},[r]),typeof r>"u"||!r?null:ae.createElement("g",{transform:`translate(${e-b.width/2} ${t-b.height/2})`,className:E,visibility:b.width?"visible":"hidden",...g},i&&ae.createElement("rect",{width:b.width+2*u[0],x:-u[0],y:-u[1],height:b.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:f,ry:f}),ae.createElement("text",{className:"react-flow__edge-text",y:b.height/2,dy:"0.3em",ref:v,style:o},r),m)};var cU=x.memo(lU);const lv=e=>({width:e.offsetWidth,height:e.offsetHeight}),oi=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),cv=(e={x:0,y:0},t)=>({x:oi(e.x,t[0][0],t[1][0]),y:oi(e.y,t[0][1],t[1][1])}),kw=(e,t,r)=>e<t?oi(Math.abs(e-t),1,50)/50:e>r?-oi(Math.abs(e-r),1,50)/50:0,VC=(e,t)=>{const r=kw(e.x,35,t.width-35)*20,o=kw(e.y,35,t.height-35)*20;return[r,o]},qC=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},YC=(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)}),Zl=({x:e,y:t,width:r,height:o})=>({x:e,y:t,x2:e+r,y2:t+o}),GC=({x:e,y:t,x2:r,y2:o})=>({x:e,y:t,width:r-e,height:o-t}),zw=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),uU=(e,t)=>GC(YC(Zl(e),Zl(t))),ng=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*o)},dU=e=>Vn(e.width)&&Vn(e.height)&&Vn(e.x)&&Vn(e.y),Vn=e=>!isNaN(e)&&isFinite(e),xt=Symbol.for("internals"),FC=["Enter"," ","Escape"],fU=(e,t)=>{},hU=e=>"nativeEvent"in e;function rg(e){var i,l;const t=hU(e)?e.nativeEvent:e,r=((l=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:l[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(r==null?void 0:r.nodeName)||(r==null?void 0:r.hasAttribute("contenteditable"))||!!(r!=null&&r.closest(".nokey"))}const XC=e=>"clientX"in e,Ja=(e,t)=>{var l,u;const r=XC(e),o=r?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,i=r?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:o-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Pd=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},vc=({id:e,path:t,labelX:r,labelY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w=20})=>ae.createElement(ae.Fragment,null,ae.createElement("path",{id:e,style:g,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:v,markerStart:b}),w&&ae.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}),i&&Vn(r)&&Vn(o)?ae.createElement(cU,{x:r,y:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h}):null);vc.displayName="BaseEdge";function Nl(e,t,r){return r===void 0?r:o=>{const i=t().edges.find(l=>l.id===e);i&&r(o,{...i})}}function WC({sourceX:e,sourceY:t,targetX:r,targetY:o}){const i=Math.abs(r-e)/2,l=r<e?r+i:r-i,u=Math.abs(o-t)/2,f=o<t?o+u:o-u;return[l,f,i,u]}function KC({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:l,targetControlX:u,targetControlY:f}){const m=e*.125+i*.375+u*.375+r*.125,h=t*.125+l*.375+f*.375+o*.125,g=Math.abs(m-e),v=Math.abs(h-t);return[m,h,g,v]}var Jo;(function(e){e.Strict="strict",e.Loose="loose"})(Jo||(Jo={}));var Po;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Po||(Po={}));var Ql;(function(e){e.Partial="partial",e.Full="full"})(Ql||(Ql={}));var ta;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ta||(ta={}));var Ud;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ud||(Ud={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));function Lw({pos:e,x1:t,y1:r,x2:o,y2:i}){return e===Ce.Left||e===Ce.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function ZC({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:o,targetY:i,targetPosition:l=Ce.Top}){const[u,f]=Lw({pos:r,x1:e,y1:t,x2:o,y2:i}),[m,h]=Lw({pos:l,x1:o,y1:i,x2:e,y2:t}),[g,v,b,w]=KC({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:u,sourceControlY:f,targetControlX:m,targetControlY:h});return[`M${e},${t} C${u},${f} ${m},${h} ${o},${i}`,g,v,b,w]}const uv=x.memo(({sourceX:e,sourceY:t,targetX:r,targetY:o,sourcePosition:i=Ce.Bottom,targetPosition:l=Ce.Top,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:E,interactionWidth:S})=>{const[N,C,j]=ZC({sourceX:e,sourceY:t,sourcePosition:i,targetX:r,targetY:o,targetPosition:l});return ae.createElement(vc,{path:N,labelX:C,labelY:j,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:E,interactionWidth:S})});uv.displayName="SimpleBezierEdge";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}},mU=({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 pU({source:e,sourcePosition:t=Ce.Bottom,target:r,targetPosition:o=Ce.Top,center:i,offset:l}){const u=Pw[t],f=Pw[o],m={x:e.x+u.x*l,y:e.y+u.y*l},h={x:r.x+f.x*l,y:r.y+f.y*l},g=mU({source:m,sourcePosition:t,target:h}),v=g.x!==0?"x":"y",b=g[v];let w=[],E,S;const N={x:0,y:0},C={x:0,y:0},[j,A,M,O]=WC({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(u[v]*f[v]===-1){E=i.x??j,S=i.y??A;const H=[{x:E,y:m.y},{x:E,y:h.y}],V=[{x:m.x,y:S},{x:h.x,y:S}];u[v]===b?w=v==="x"?H:V:w=v==="x"?V:H}else{const H=[{x:m.x,y:h.y}],V=[{x:h.x,y:m.y}];if(v==="x"?w=u.x===b?V:H:w=u.y===b?H:V,t===o){const te=Math.abs(e[v]-r[v]);if(te<=l){const k=Math.min(l-1,l-te);u[v]===b?N[v]=(m[v]>e[v]?-1:1)*k:C[v]=(h[v]>r[v]?-1:1)*k}}if(t!==o){const te=v==="x"?"y":"x",k=u[v]===f[te],Y=m[te]>h[te],D=m[te]<h[te];(u[v]===1&&(!k&&Y||k&&D)||u[v]!==1&&(!k&&D||k&&Y))&&(w=v==="x"?H:V)}const P={x:m.x+N.x,y:m.y+N.y},z={x:h.x+C.x,y:h.y+C.y},F=Math.max(Math.abs(P.x-w[0].x),Math.abs(z.x-w[0].x)),K=Math.max(Math.abs(P.y-w[0].y),Math.abs(z.y-w[0].y));F>=K?(E=(P.x+z.x)/2,S=w[0].y):(E=w[0].x,S=(P.y+z.y)/2)}return[[e,{x:m.x+N.x,y:m.y+N.y},...w,{x:h.x+C.x,y:h.y+C.y},r],E,S,M,O]}function gU(e,t,r,o){const i=Math.min(Uw(e,t)/2,Uw(t,r)/2,o),{x:l,y:u}=t;if(e.x===l&&l===r.x||e.y===u&&u===r.y)return`L${l} ${u}`;if(e.y===u){const h=e.x<r.x?-1:1,g=e.y<r.y?1:-1;return`L ${l+i*h},${u}Q ${l},${u} ${l},${u+i*g}`}const f=e.x<r.x?1:-1,m=e.y<r.y?-1:1;return`L ${l},${u+i*m}Q ${l},${u} ${l+i*f},${u}`}function ag({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:o,targetY:i,targetPosition:l=Ce.Top,borderRadius:u=5,centerX:f,centerY:m,offset:h=20}){const[g,v,b,w,E]=pU({source:{x:e,y:t},sourcePosition:r,target:{x:o,y:i},targetPosition:l,center:{x:f,y:m},offset:h});return[g.reduce((N,C,j)=>{let A="";return j>0&&j<g.length-1?A=gU(g[j-1],C,g[j+1],u):A=`${j===0?"M":"L"}${C.x} ${C.y}`,N+=A,N},""),v,b,w,E]}const _f=x.memo(({sourceX:e,sourceY:t,targetX:r,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,sourcePosition:v=Ce.Bottom,targetPosition:b=Ce.Top,markerEnd:w,markerStart:E,pathOptions:S,interactionWidth:N})=>{const[C,j,A]=ag({sourceX:e,sourceY:t,sourcePosition:v,targetX:r,targetY:o,targetPosition:b,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset});return ae.createElement(vc,{path:C,labelX:j,labelY:A,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:E,interactionWidth:N})});_f.displayName="SmoothStepEdge";const dv=x.memo(e=>{var t;return ae.createElement(_f,{...e,pathOptions:x.useMemo(()=>{var r;return{borderRadius:0,offset:(r=e.pathOptions)==null?void 0:r.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});dv.displayName="StepEdge";function vU({sourceX:e,sourceY:t,targetX:r,targetY:o}){const[i,l,u,f]=WC({sourceX:e,sourceY:t,targetX:r,targetY:o});return[`M ${e},${t}L ${r},${o}`,i,l,u,f]}const fv=x.memo(({sourceX:e,sourceY:t,targetX:r,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[E,S,N]=vU({sourceX:e,sourceY:t,targetX:r,targetY:o});return ae.createElement(vc,{path:E,labelX:S,labelY:N,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w})});fv.displayName="StraightEdge";function Zu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Bw({pos:e,x1:t,y1:r,x2:o,y2:i,c:l}){switch(e){case Ce.Left:return[t-Zu(t-o,l),r];case Ce.Right:return[t+Zu(o-t,l),r];case Ce.Top:return[t,r-Zu(r-i,l)];case Ce.Bottom:return[t,r+Zu(i-r,l)]}}function QC({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:o,targetY:i,targetPosition:l=Ce.Top,curvature:u=.25}){const[f,m]=Bw({pos:r,x1:e,y1:t,x2:o,y2:i,c:u}),[h,g]=Bw({pos:l,x1:o,y1:i,x2:e,y2:t,c:u}),[v,b,w,E]=KC({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:f,sourceControlY:m,targetControlX:h,targetControlY:g});return[`M${e},${t} C${f},${m} ${h},${g} ${o},${i}`,v,b,w,E]}const Bd=x.memo(({sourceX:e,sourceY:t,targetX:r,targetY:o,sourcePosition:i=Ce.Bottom,targetPosition:l=Ce.Top,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:E,pathOptions:S,interactionWidth:N})=>{const[C,j,A]=QC({sourceX:e,sourceY:t,sourcePosition:i,targetX:r,targetY:o,targetPosition:l,curvature:S==null?void 0:S.curvature});return ae.createElement(vc,{path:C,labelX:j,labelY:A,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:E,interactionWidth:N})});Bd.displayName="BezierEdge";const hv=x.createContext(null),yU=hv.Provider;hv.Consumer;const xU=()=>x.useContext(hv),bU=e=>"id"in e&&"source"in e&&"target"in e,wU=({source:e,sourceHandle:t,target:r,targetHandle:o})=>`reactflow__edge-${e}${t||""}-${r}${o||""}`,og=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`,SU=(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)),JC=(e,t)=>{if(!e.source||!e.target)return t;let r;return bU(e)?r={...e}:r={...e,id:wU(e)},SU(r,t)?t:t.concat(r)},sg=({x:e,y:t},[r,o,i],l,[u,f])=>{const m={x:(e-r)/i,y:(t-o)/i};return l?{x:u*Math.round(m.x/u),y:f*Math.round(m.y/f)}:m},e2=({x:e,y:t},[r,o,i])=>({x:e*i+r,y:t*i+o}),Ho=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const r=(e.width??0)*t[0],o=(e.height??0)*t[1],i={x:e.position.x-r,y:e.position.y-o};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-o}:i}},Af=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((o,i)=>{const{x:l,y:u}=Ho(i,t).positionAbsolute;return YC(o,Zl({x:l,y:u,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return GC(r)},t2=(e,t,[r,o,i]=[0,0,1],l=!1,u=!1,f=[0,0])=>{const m={x:(t.x-r)/i,y:(t.y-o)/i,width:t.width/i,height:t.height/i},h=[];return e.forEach(g=>{const{width:v,height:b,selectable:w=!0,hidden:E=!1}=g;if(u&&!w||E)return!1;const{positionAbsolute:S}=Ho(g,f),N={x:S.x,y:S.y,width:v||0,height:b||0},C=ng(m,N),j=typeof v>"u"||typeof b>"u"||v===null||b===null,A=l&&C>0,M=(v||0)*(b||0);(j||A||C>=M||g.dragging)&&h.push(g)}),h},n2=(e,t)=>{const r=e.map(o=>o.id);return t.filter(o=>r.includes(o.source)||r.includes(o.target))},r2=(e,t,r,o,i,l=.1)=>{const u=t/(e.width*(1+l)),f=r/(e.height*(1+l)),m=Math.min(u,f),h=oi(m,o,i),g=e.x+e.width/2,v=e.y+e.height/2,b=t/2-g*h,w=r/2-v*h;return{x:b,y:w,zoom:h}},Do=(e,t=0)=>e.transition().duration(t);function Hw(e,t,r,o){return(t[r]||[]).reduce((i,l)=>{var u,f;return`${e.id}-${l.id}-${r}`!==o&&i.push({id:l.id||null,type:r,nodeId:e.id,x:(((u=e.positionAbsolute)==null?void 0:u.x)??0)+l.x+l.width/2,y:(((f=e.positionAbsolute)==null?void 0:f.y)??0)+l.y+l.height/2}),i},[])}function EU(e,t,r,o,i,l){const{x:u,y:f}=Ja(e),h=t.elementsFromPoint(u,f).find(E=>E.classList.contains("react-flow__handle"));if(h){const E=h.getAttribute("data-nodeid");if(E){const S=mv(void 0,h),N=h.getAttribute("data-handleid"),C=l({nodeId:E,id:N,type:S});if(C){const j=i.find(A=>A.nodeId===E&&A.type===S&&A.id===N);return{handle:{id:N,type:S,nodeId:E,x:(j==null?void 0:j.x)||r.x,y:(j==null?void 0:j.y)||r.y},validHandleResult:C}}}}let g=[],v=1/0;if(i.forEach(E=>{const S=Math.sqrt((E.x-r.x)**2+(E.y-r.y)**2);if(S<=o){const N=l(E);S<=v&&(S<v?g=[{handle:E,validHandleResult:N}]:S===v&&g.push({handle:E,validHandleResult:N}),v=S)}}),!g.length)return{handle:null,validHandleResult:a2()};if(g.length===1)return g[0];const b=g.some(({validHandleResult:E})=>E.isValid),w=g.some(({handle:E})=>E.type==="target");return g.find(({handle:E,validHandleResult:S})=>w?E.type==="target":b?S.isValid:!0)||g[0]}const NU={source:null,target:null,sourceHandle:null,targetHandle:null},a2=()=>({handleDomNode:null,isValid:!1,connection:NU,endHandle:null});function o2(e,t,r,o,i,l,u){const f=i==="target",m=u.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),h={...a2(),handleDomNode:m};if(m){const g=mv(void 0,m),v=m.getAttribute("data-nodeid"),b=m.getAttribute("data-handleid"),w=m.classList.contains("connectable"),E=m.classList.contains("connectableend"),S={source:f?v:r,sourceHandle:f?b:o,target:f?r:v,targetHandle:f?o:b};h.connection=S,w&&E&&(t===Jo.Strict?f&&g==="source"||!f&&g==="target":v!==r||b!==o)&&(h.endHandle={nodeId:v,handleId:b,type:g},h.isValid=l(S))}return h}function CU({nodes:e,nodeId:t,handleId:r,handleType:o}){return e.reduce((i,l)=>{if(l[xt]){const{handleBounds:u}=l[xt];let f=[],m=[];u&&(f=Hw(l,u,"source",`${t}-${r}-${o}`),m=Hw(l,u,"target",`${t}-${r}-${o}`)),i.push(...f,...m)}return i},[])}function mv(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function vp(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function jU(e,t){let r=null;return t?r="valid":e&&!t&&(r="invalid"),r}function s2({event:e,handleId:t,nodeId:r,onConnect:o,isTarget:i,getState:l,setState:u,isValidConnection:f,edgeUpdaterType:m,onReconnectEnd:h}){const g=qC(e.target),{connectionMode:v,domNode:b,autoPanOnConnect:w,connectionRadius:E,onConnectStart:S,panBy:N,getNodes:C,cancelConnection:j}=l();let A=0,M;const{x:O,y:U}=Ja(e),H=g==null?void 0:g.elementFromPoint(O,U),V=mv(m,H),P=b==null?void 0:b.getBoundingClientRect();if(!P||!V)return;let z,F=Ja(e,P),K=!1,te=null,k=!1,Y=null;const D=CU({nodes:C(),nodeId:r,handleId:t,handleType:V}),q=()=>{if(!w)return;const[T,I]=VC(F,P);N({x:T,y:I}),A=requestAnimationFrame(q)};u({connectionPosition:F,connectionStatus:null,connectionNodeId:r,connectionHandleId:t,connectionHandleType:V,connectionStartHandle:{nodeId:r,handleId:t,type:V},connectionEndHandle:null}),S==null||S(e,{nodeId:r,handleId:t,handleType:V});function B(T){const{transform:I}=l();F=Ja(T,P);const{handle:X,validHandleResult:Z}=EU(T,g,sg(F,I,!1,[1,1]),E,D,re=>o2(re,v,r,t,i?"target":"source",f,g));if(M=X,K||(q(),K=!0),Y=Z.handleDomNode,te=Z.connection,k=Z.isValid,u({connectionPosition:M&&k?e2({x:M.x,y:M.y},I):F,connectionStatus:jU(!!M,k),connectionEndHandle:Z.endHandle}),!M&&!k&&!Y)return vp(z);te.source!==te.target&&Y&&(vp(z),z=Y,Y.classList.add("connecting","react-flow__handle-connecting"),Y.classList.toggle("valid",k),Y.classList.toggle("react-flow__handle-valid",k))}function L(T){var I,X;(M||Y)&&te&&k&&(o==null||o(te)),(X=(I=l()).onConnectEnd)==null||X.call(I,T),m&&(h==null||h(T)),vp(z),j(),cancelAnimationFrame(A),K=!1,k=!1,te=null,Y=null,g.removeEventListener("mousemove",B),g.removeEventListener("mouseup",L),g.removeEventListener("touchmove",B),g.removeEventListener("touchend",L)}g.addEventListener("mousemove",B),g.addEventListener("mouseup",L),g.addEventListener("touchmove",B),g.addEventListener("touchend",L)}const $w=()=>!0,_U=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),AU=(e,t,r)=>o=>{const{connectionStartHandle:i,connectionEndHandle:l,connectionClickStartHandle:u}=o;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===r||(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===t&&(l==null?void 0:l.type)===r,clickConnecting:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.handleId)===t&&(u==null?void 0:u.type)===r}},i2=x.forwardRef(({type:e="source",position:t=Ce.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:i=!0,isConnectableEnd:l=!0,id:u,onConnect:f,children:m,className:h,onMouseDown:g,onTouchStart:v,...b},w)=>{var P,z;const E=u||null,S=e==="target",N=zt(),C=xU(),{connectOnClick:j,noPanClassName:A}=dt(_U,Vt),{connecting:M,clickConnecting:O}=dt(AU(C,E,e),Vt);C||(z=(P=N.getState()).onError)==null||z.call(P,"010",fa.error010());const U=F=>{const{defaultEdgeOptions:K,onConnect:te,hasDefaultEdges:k}=N.getState(),Y={...K,...F};if(k){const{edges:D,setEdges:q}=N.getState();q(JC(Y,D))}te==null||te(Y),f==null||f(Y)},H=F=>{if(!C)return;const K=XC(F);i&&(K&&F.button===0||!K)&&s2({event:F,handleId:E,nodeId:C,onConnect:U,isTarget:S,getState:N.getState,setState:N.setState,isValidConnection:r||N.getState().isValidConnection||$w}),K?g==null||g(F):v==null||v(F)},V=F=>{const{onClickConnectStart:K,onClickConnectEnd:te,connectionClickStartHandle:k,connectionMode:Y,isValidConnection:D}=N.getState();if(!C||!k&&!i)return;if(!k){K==null||K(F,{nodeId:C,handleId:E,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:C,type:e,handleId:E}});return}const q=qC(F.target),B=r||D||$w,{connection:L,isValid:T}=o2({nodeId:C,id:E,type:e},Y,k.nodeId,k.handleId||null,k.type,B,q);T&&U(L),te==null||te(F),N.setState({connectionClickStartHandle:null})};return ae.createElement("div",{"data-handleid":E,"data-nodeid":C,"data-handlepos":t,"data-id":`${C}-${E}-${e}`,className:Xt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",A,h,{source:!S,target:S,connectable:o,connectablestart:i,connectableend:l,connecting:O,connectionindicator:o&&(i&&!M||l&&M)}]),onMouseDown:H,onTouchStart:H,onClick:j?V:void 0,ref:w,...b},m)});i2.displayName="Handle";var si=x.memo(i2);const l2=({data:e,isConnectable:t,targetPosition:r=Ce.Top,sourcePosition:o=Ce.Bottom})=>ae.createElement(ae.Fragment,null,ae.createElement(si,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,ae.createElement(si,{type:"source",position:o,isConnectable:t}));l2.displayName="DefaultNode";var ig=x.memo(l2);const c2=({data:e,isConnectable:t,sourcePosition:r=Ce.Bottom})=>ae.createElement(ae.Fragment,null,e==null?void 0:e.label,ae.createElement(si,{type:"source",position:r,isConnectable:t}));c2.displayName="InputNode";var u2=x.memo(c2);const d2=({data:e,isConnectable:t,targetPosition:r=Ce.Top})=>ae.createElement(ae.Fragment,null,ae.createElement(si,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label);d2.displayName="OutputNode";var f2=x.memo(d2);const pv=()=>null;pv.displayName="GroupNode";const TU=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Qu=e=>e.id;function RU(e,t){return Vt(e.selectedNodes.map(Qu),t.selectedNodes.map(Qu))&&Vt(e.selectedEdges.map(Qu),t.selectedEdges.map(Qu))}const h2=x.memo(({onSelectionChange:e})=>{const t=zt(),{selectedNodes:r,selectedEdges:o}=dt(TU,RU);return x.useEffect(()=>{const i={nodes:r,edges:o};e==null||e(i),t.getState().onSelectionChange.forEach(l=>l(i))},[r,o,e]),null});h2.displayName="SelectionListener";const MU=e=>!!e.onSelectionChange;function DU({onSelectionChange:e}){const t=dt(MU);return e||t?ae.createElement(h2,{onSelectionChange:e}):null}const OU=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function qs(e,t){x.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function $e(e,t,r){x.useEffect(()=>{typeof t<"u"&&r({[e]:t})},[t])}const kU=({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,onConnect:i,onConnectStart:l,onConnectEnd:u,onClickConnectStart:f,onClickConnectEnd:m,nodesDraggable:h,nodesConnectable:g,nodesFocusable:v,edgesFocusable:b,edgesUpdatable:w,elevateNodesOnSelect:E,minZoom:S,maxZoom:N,nodeExtent:C,onNodesChange:j,onEdgesChange:A,elementsSelectable:M,connectionMode:O,snapGrid:U,snapToGrid:H,translateExtent:V,connectOnClick:P,defaultEdgeOptions:z,fitView:F,fitViewOptions:K,onNodesDelete:te,onEdgesDelete:k,onNodeDrag:Y,onNodeDragStart:D,onNodeDragStop:q,onSelectionDrag:B,onSelectionDragStart:L,onSelectionDragStop:T,noPanClassName:I,nodeOrigin:X,rfId:Z,autoPanOnConnect:re,autoPanOnNodeDrag:fe,onError:ue,connectionRadius:se,isValidConnection:me,nodeDragThreshold:pe})=>{const{setNodes:ge,setEdges:Ee,setDefaultNodesAndEdges:Se,setMinZoom:Ye,setMaxZoom:We,setTranslateExtent:Je,setNodeExtent:mt,reset:he}=dt(OU,Vt),de=zt();return x.useEffect(()=>{const Te=o==null?void 0:o.map(Ke=>({...Ke,...z}));return Se(r,Te),()=>{he()}},[]),$e("defaultEdgeOptions",z,de.setState),$e("connectionMode",O,de.setState),$e("onConnect",i,de.setState),$e("onConnectStart",l,de.setState),$e("onConnectEnd",u,de.setState),$e("onClickConnectStart",f,de.setState),$e("onClickConnectEnd",m,de.setState),$e("nodesDraggable",h,de.setState),$e("nodesConnectable",g,de.setState),$e("nodesFocusable",v,de.setState),$e("edgesFocusable",b,de.setState),$e("edgesUpdatable",w,de.setState),$e("elementsSelectable",M,de.setState),$e("elevateNodesOnSelect",E,de.setState),$e("snapToGrid",H,de.setState),$e("snapGrid",U,de.setState),$e("onNodesChange",j,de.setState),$e("onEdgesChange",A,de.setState),$e("connectOnClick",P,de.setState),$e("fitViewOnInit",F,de.setState),$e("fitViewOnInitOptions",K,de.setState),$e("onNodesDelete",te,de.setState),$e("onEdgesDelete",k,de.setState),$e("onNodeDrag",Y,de.setState),$e("onNodeDragStart",D,de.setState),$e("onNodeDragStop",q,de.setState),$e("onSelectionDrag",B,de.setState),$e("onSelectionDragStart",L,de.setState),$e("onSelectionDragStop",T,de.setState),$e("noPanClassName",I,de.setState),$e("nodeOrigin",X,de.setState),$e("rfId",Z,de.setState),$e("autoPanOnConnect",re,de.setState),$e("autoPanOnNodeDrag",fe,de.setState),$e("onError",ue,de.setState),$e("connectionRadius",se,de.setState),$e("isValidConnection",me,de.setState),$e("nodeDragThreshold",pe,de.setState),qs(e,ge),qs(t,Ee),qs(S,Ye),qs(N,We),qs(V,Je),qs(C,mt),null},Iw={display:"none"},zU={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},m2="react-flow__node-desc",p2="react-flow__edge-desc",LU="react-flow__aria-live",PU=e=>e.ariaLiveMessage;function UU({rfId:e}){const t=dt(PU);return ae.createElement("div",{id:`${LU}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zU},t)}function BU({rfId:e,disableKeyboardA11y:t}){return ae.createElement(ae.Fragment,null,ae.createElement("div",{id:`${m2}-${e}`,style:Iw},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ae.createElement("div",{id:`${p2}-${e}`,style:Iw},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&ae.createElement(UU,{rfId:e}))}var Jl=(e=null,t={actInsideInputWithModifier:!0})=>{const[r,o]=x.useState(!1),i=x.useRef(!1),l=x.useRef(new Set([])),[u,f]=x.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(v=>typeof v=="string").map(v=>v.split("+")),g=h.reduce((v,b)=>v.concat(...b),[]);return[h,g]}return[[],[]]},[e]);return x.useEffect(()=>{const m=typeof document<"u"?document:null,h=(t==null?void 0:t.target)||m;if(e!==null){const g=w=>{if(i.current=w.ctrlKey||w.metaKey||w.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&rg(w))return!1;const S=qw(w.code,f);l.current.add(w[S]),Vw(u,l.current,!1)&&(w.preventDefault(),o(!0))},v=w=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&rg(w))return!1;const S=qw(w.code,f);Vw(u,l.current,!0)?(o(!1),l.current.clear()):l.current.delete(w[S]),w.key==="Meta"&&l.current.clear(),i.current=!1},b=()=>{l.current.clear(),o(!1)};return h==null||h.addEventListener("keydown",g),h==null||h.addEventListener("keyup",v),window.addEventListener("blur",b),()=>{h==null||h.removeEventListener("keydown",g),h==null||h.removeEventListener("keyup",v),window.removeEventListener("blur",b)}}},[e,o]),r};function Vw(e,t,r){return e.filter(o=>r||o.length===t.size).some(o=>o.every(i=>t.has(i)))}function qw(e,t){return t.includes(e)?"code":"key"}function g2(e,t,r,o){var f,m;const i=e.parentNode||e.parentId;if(!i)return r;const l=t.get(i),u=Ho(l,o);return g2(l,t,{x:(r.x??0)+u.x,y:(r.y??0)+u.y,z:(((f=l[xt])==null?void 0:f.z)??0)>(r.z??0)?((m=l[xt])==null?void 0:m.z)??0:r.z??0},o)}function v2(e,t,r){e.forEach(o=>{var l;const i=o.parentNode||o.parentId;if(i&&!e.has(i))throw new Error(`Parent node ${i} not found`);if(i||r!=null&&r[o.id]){const{x:u,y:f,z:m}=g2(o,e,{...o.position,z:((l=o[xt])==null?void 0:l.z)??0},t);o.positionAbsolute={x:u,y:f},o[xt].z=m,r!=null&&r[o.id]&&(o[xt].isParent=!0)}})}function yp(e,t,r,o){const i=new Map,l={},u=o?1e3:0;return e.forEach(f=>{var w;const m=(Vn(f.zIndex)?f.zIndex:0)+(f.selected?u:0),h=t.get(f.id),g={...f,positionAbsolute:{x:f.position.x,y:f.position.y}},v=f.parentNode||f.parentId;v&&(l[v]=!0);const b=(h==null?void 0:h.type)&&(h==null?void 0:h.type)!==f.type;Object.defineProperty(g,xt,{enumerable:!1,value:{handleBounds:b||(w=h==null?void 0:h[xt])==null?void 0:w.handleBounds,z:m}}),i.set(f.id,g)}),v2(i,r,l),i}function y2(e,t={}){const{getNodes:r,width:o,height:i,minZoom:l,maxZoom:u,d3Zoom:f,d3Selection:m,fitViewOnInitDone:h,fitViewOnInit:g,nodeOrigin:v}=e(),b=t.initial&&!h&&g;if(f&&m&&(b||!t.initial)){const E=r().filter(N=>{var j;const C=t.includeHiddenNodes?N.width&&N.height:!N.hidden;return(j=t.nodes)!=null&&j.length?C&&t.nodes.some(A=>A.id===N.id):C}),S=E.every(N=>N.width&&N.height);if(E.length>0&&S){const N=Af(E,v),{x:C,y:j,zoom:A}=r2(N,o,i,t.minZoom??l,t.maxZoom??u,t.padding??.1),M=oa.translate(C,j).scale(A);return typeof t.duration=="number"&&t.duration>0?f.transform(Do(m,t.duration),M):f.transform(m,M),!0}}return!1}function HU(e,t){return e.forEach(r=>{const o=t.get(r.id);o&&t.set(o.id,{...o,[xt]:o[xt],selected:r.selected})}),new Map(t)}function $U(e,t){return t.map(r=>{const o=e.find(i=>i.id===r.id);return o&&(r.selected=o.selected),r})}function Ju({changedNodes:e,changedEdges:t,get:r,set:o}){const{nodeInternals:i,edges:l,onNodesChange:u,onEdgesChange:f,hasDefaultNodes:m,hasDefaultEdges:h}=r();e!=null&&e.length&&(m&&o({nodeInternals:HU(e,i)}),u==null||u(e)),t!=null&&t.length&&(h&&o({edges:$U(t,l)}),f==null||f(t))}const Ys=()=>{},IU={zoomIn:Ys,zoomOut:Ys,zoomTo:Ys,getZoom:()=>1,setViewport:Ys,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ys,fitBounds:Ys,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},VU=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),qU=()=>{const e=zt(),{d3Zoom:t,d3Selection:r}=dt(VU,Vt);return x.useMemo(()=>r&&t?{zoomIn:i=>t.scaleBy(Do(r,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Do(r,i==null?void 0:i.duration),1/1.2),zoomTo:(i,l)=>t.scaleTo(Do(r,l==null?void 0:l.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,l)=>{const[u,f,m]=e.getState().transform,h=oa.translate(i.x??u,i.y??f).scale(i.zoom??m);t.transform(Do(r,l==null?void 0:l.duration),h)},getViewport:()=>{const[i,l,u]=e.getState().transform;return{x:i,y:l,zoom:u}},fitView:i=>y2(e.getState,i),setCenter:(i,l,u)=>{const{width:f,height:m,maxZoom:h}=e.getState(),g=typeof(u==null?void 0:u.zoom)<"u"?u.zoom:h,v=f/2-i*g,b=m/2-l*g,w=oa.translate(v,b).scale(g);t.transform(Do(r,u==null?void 0:u.duration),w)},fitBounds:(i,l)=>{const{width:u,height:f,minZoom:m,maxZoom:h}=e.getState(),{x:g,y:v,zoom:b}=r2(i,u,f,m,h,(l==null?void 0:l.padding)??.1),w=oa.translate(g,v).scale(b);t.transform(Do(r,l==null?void 0:l.duration),w)},project:i=>{const{transform:l,snapToGrid:u,snapGrid:f}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),sg(i,l,u,f)},screenToFlowPosition:i=>{const{transform:l,snapToGrid:u,snapGrid:f,domNode:m}=e.getState();if(!m)return i;const{x:h,y:g}=m.getBoundingClientRect(),v={x:i.x-h,y:i.y-g};return sg(v,l,u,f)},flowToScreenPosition:i=>{const{transform:l,domNode:u}=e.getState();if(!u)return i;const{x:f,y:m}=u.getBoundingClientRect(),h=e2(i,l);return{x:h.x+f,y:h.y+m}},viewportInitialized:!0}:IU,[t,r])};function gv(){const e=qU(),t=zt(),r=x.useCallback(()=>t.getState().getNodes().map(S=>({...S})),[]),o=x.useCallback(S=>t.getState().nodeInternals.get(S),[]),i=x.useCallback(()=>{const{edges:S=[]}=t.getState();return S.map(N=>({...N}))},[]),l=x.useCallback(S=>{const{edges:N=[]}=t.getState();return N.find(C=>C.id===S)},[]),u=x.useCallback(S=>{const{getNodes:N,setNodes:C,hasDefaultNodes:j,onNodesChange:A}=t.getState(),M=N(),O=typeof S=="function"?S(M):S;if(j)C(O);else if(A){const U=O.length===0?M.map(H=>({type:"remove",id:H.id})):O.map(H=>({item:H,type:"reset"}));A(U)}},[]),f=x.useCallback(S=>{const{edges:N=[],setEdges:C,hasDefaultEdges:j,onEdgesChange:A}=t.getState(),M=typeof S=="function"?S(N):S;if(j)C(M);else if(A){const O=M.length===0?N.map(U=>({type:"remove",id:U.id})):M.map(U=>({item:U,type:"reset"}));A(O)}},[]),m=x.useCallback(S=>{const N=Array.isArray(S)?S:[S],{getNodes:C,setNodes:j,hasDefaultNodes:A,onNodesChange:M}=t.getState();if(A){const U=[...C(),...N];j(U)}else if(M){const O=N.map(U=>({item:U,type:"add"}));M(O)}},[]),h=x.useCallback(S=>{const N=Array.isArray(S)?S:[S],{edges:C=[],setEdges:j,hasDefaultEdges:A,onEdgesChange:M}=t.getState();if(A)j([...C,...N]);else if(M){const O=N.map(U=>({item:U,type:"add"}));M(O)}},[]),g=x.useCallback(()=>{const{getNodes:S,edges:N=[],transform:C}=t.getState(),[j,A,M]=C;return{nodes:S().map(O=>({...O})),edges:N.map(O=>({...O})),viewport:{x:j,y:A,zoom:M}}},[]),v=x.useCallback(({nodes:S,edges:N})=>{const{nodeInternals:C,getNodes:j,edges:A,hasDefaultNodes:M,hasDefaultEdges:O,onNodesDelete:U,onEdgesDelete:H,onNodesChange:V,onEdgesChange:P}=t.getState(),z=(S||[]).map(Y=>Y.id),F=(N||[]).map(Y=>Y.id),K=j().reduce((Y,D)=>{const q=D.parentNode||D.parentId,B=!z.includes(D.id)&&q&&Y.find(T=>T.id===q);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(z.includes(D.id)||B)&&Y.push(D),Y},[]),te=A.filter(Y=>typeof Y.deletable=="boolean"?Y.deletable:!0),k=te.filter(Y=>F.includes(Y.id));if(K||k){const Y=n2(K,te),D=[...k,...Y],q=D.reduce((B,L)=>(B.includes(L.id)||B.push(L.id),B),[]);if((O||M)&&(O&&t.setState({edges:A.filter(B=>!q.includes(B.id))}),M&&(K.forEach(B=>{C.delete(B.id)}),t.setState({nodeInternals:new Map(C)}))),q.length>0&&(H==null||H(D),P&&P(q.map(B=>({id:B,type:"remove"})))),K.length>0&&(U==null||U(K),V)){const B=K.map(L=>({id:L.id,type:"remove"}));V(B)}}},[]),b=x.useCallback(S=>{const N=dU(S),C=N?null:t.getState().nodeInternals.get(S.id);return!N&&!C?[null,null,N]:[N?S:zw(C),C,N]},[]),w=x.useCallback((S,N=!0,C)=>{const[j,A,M]=b(S);return j?(C||t.getState().getNodes()).filter(O=>{if(!M&&(O.id===A.id||!O.positionAbsolute))return!1;const U=zw(O),H=ng(U,j);return N&&H>0||H>=j.width*j.height}):[]},[]),E=x.useCallback((S,N,C=!0)=>{const[j]=b(S);if(!j)return!1;const A=ng(j,N);return C&&A>0||A>=j.width*j.height},[]);return x.useMemo(()=>({...e,getNodes:r,getNode:o,getEdges:i,getEdge:l,setNodes:u,setEdges:f,addNodes:m,addEdges:h,toObject:g,deleteElements:v,getIntersectingNodes:w,isNodeIntersecting:E}),[e,r,o,i,l,u,f,m,h,g,v,w,E])}const YU={actInsideInputWithModifier:!1};var GU=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const r=zt(),{deleteElements:o}=gv(),i=Jl(e,YU),l=Jl(t);x.useEffect(()=>{if(i){const{edges:u,getNodes:f}=r.getState(),m=f().filter(g=>g.selected),h=u.filter(g=>g.selected);o({nodes:m,edges:h}),r.setState({nodesSelectionActive:!1})}},[i]),x.useEffect(()=>{r.setState({multiSelectionActive:l})},[l])};function FU(e){const t=zt();x.useEffect(()=>{let r;const o=()=>{var l,u;if(!e.current)return;const i=lv(e.current);(i.height===0||i.width===0)&&((u=(l=t.getState()).onError)==null||u.call(l,"004",fa.error004())),t.setState({width:i.width||500,height:i.height||500})};return o(),window.addEventListener("resize",o),e.current&&(r=new ResizeObserver(()=>o()),r.observe(e.current)),()=>{window.removeEventListener("resize",o),r&&e.current&&r.unobserve(e.current)}},[])}const vv={position:"absolute",width:"100%",height:"100%",top:0,left:0},XU=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,ed=e=>({x:e.x,y:e.y,zoom:e.k}),Gs=(e,t)=>e.target.closest(`.${t}`),Yw=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Gw=e=>{const t=e.ctrlKey&&Pd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},WU=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),KU=({onMove:e,onMoveStart:t,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:i=!0,zoomOnPinch:l=!0,panOnScroll:u=!1,panOnScrollSpeed:f=.5,panOnScrollMode:m=Po.Free,zoomOnDoubleClick:h=!0,elementsSelectable:g,panOnDrag:v=!0,defaultViewport:b,translateExtent:w,minZoom:E,maxZoom:S,zoomActivationKeyCode:N,preventScrolling:C=!0,children:j,noWheelClassName:A,noPanClassName:M})=>{const O=x.useRef(),U=zt(),H=x.useRef(!1),V=x.useRef(!1),P=x.useRef(null),z=x.useRef({x:0,y:0,zoom:0}),{d3Zoom:F,d3Selection:K,d3ZoomHandler:te,userSelectionActive:k}=dt(WU,Vt),Y=Jl(N),D=x.useRef(0),q=x.useRef(!1),B=x.useRef();return FU(P),x.useEffect(()=>{if(P.current){const L=P.current.getBoundingClientRect(),T=$C().scaleExtent([E,S]).translateExtent(w),I=In(P.current).call(T),X=oa.translate(b.x,b.y).scale(oi(b.zoom,E,S)),Z=[[0,0],[L.width,L.height]],re=T.constrain()(X,Z,w);T.transform(I,re),T.wheelDelta(Gw),U.setState({d3Zoom:T,d3Selection:I,d3ZoomHandler:I.on("wheel.zoom"),transform:[re.x,re.y,re.k],domNode:P.current.closest(".react-flow")})}},[]),x.useEffect(()=>{K&&F&&(u&&!Y&&!k?K.on("wheel.zoom",L=>{if(Gs(L,A))return!1;L.preventDefault(),L.stopImmediatePropagation();const T=K.property("__zoom").k||1;if(L.ctrlKey&&l){const me=er(L),pe=Gw(L),ge=T*Math.pow(2,pe);F.scaleTo(K,ge,me,L);return}const I=L.deltaMode===1?20:1;let X=m===Po.Vertical?0:L.deltaX*I,Z=m===Po.Horizontal?0:L.deltaY*I;!Pd()&&L.shiftKey&&m!==Po.Vertical&&(X=L.deltaY*I,Z=0),F.translateBy(K,-(X/T)*f,-(Z/T)*f,{internal:!0});const re=ed(K.property("__zoom")),{onViewportChangeStart:fe,onViewportChange:ue,onViewportChangeEnd:se}=U.getState();clearTimeout(B.current),q.current||(q.current=!0,t==null||t(L,re),fe==null||fe(re)),q.current&&(e==null||e(L,re),ue==null||ue(re),B.current=setTimeout(()=>{r==null||r(L,re),se==null||se(re),q.current=!1},150))},{passive:!1}):typeof te<"u"&&K.on("wheel.zoom",function(L,T){if(!C&&L.type==="wheel"&&!L.ctrlKey||Gs(L,A))return null;L.preventDefault(),te.call(this,L,T)},{passive:!1}))},[k,u,m,K,F,te,Y,l,C,A,t,e,r]),x.useEffect(()=>{F&&F.on("start",L=>{var X,Z;if(!L.sourceEvent||L.sourceEvent.internal)return null;D.current=(X=L.sourceEvent)==null?void 0:X.button;const{onViewportChangeStart:T}=U.getState(),I=ed(L.transform);H.current=!0,z.current=I,((Z=L.sourceEvent)==null?void 0:Z.type)==="mousedown"&&U.setState({paneDragging:!0}),T==null||T(I),t==null||t(L.sourceEvent,I)})},[F,t]),x.useEffect(()=>{F&&(k&&!H.current?F.on("zoom",null):k||F.on("zoom",L=>{var I;const{onViewportChange:T}=U.getState();if(U.setState({transform:[L.transform.x,L.transform.y,L.transform.k]}),V.current=!!(o&&Yw(v,D.current??0)),(e||T)&&!((I=L.sourceEvent)!=null&&I.internal)){const X=ed(L.transform);T==null||T(X),e==null||e(L.sourceEvent,X)}}))},[k,F,e,v,o]),x.useEffect(()=>{F&&F.on("end",L=>{if(!L.sourceEvent||L.sourceEvent.internal)return null;const{onViewportChangeEnd:T}=U.getState();if(H.current=!1,U.setState({paneDragging:!1}),o&&Yw(v,D.current??0)&&!V.current&&o(L.sourceEvent),V.current=!1,(r||T)&&XU(z.current,L.transform)){const I=ed(L.transform);z.current=I,clearTimeout(O.current),O.current=setTimeout(()=>{T==null||T(I),r==null||r(L.sourceEvent,I)},u?150:0)}})},[F,u,v,r,o]),x.useEffect(()=>{F&&F.filter(L=>{const T=Y||i,I=l&&L.ctrlKey;if((v===!0||Array.isArray(v)&&v.includes(1))&&L.button===1&&L.type==="mousedown"&&(Gs(L,"react-flow__node")||Gs(L,"react-flow__edge")))return!0;if(!v&&!T&&!u&&!h&&!l||k||!h&&L.type==="dblclick"||Gs(L,A)&&L.type==="wheel"||Gs(L,M)&&(L.type!=="wheel"||u&&L.type==="wheel"&&!Y)||!l&&L.ctrlKey&&L.type==="wheel"||!T&&!u&&!I&&L.type==="wheel"||!v&&(L.type==="mousedown"||L.type==="touchstart")||Array.isArray(v)&&!v.includes(L.button)&&L.type==="mousedown")return!1;const X=Array.isArray(v)&&v.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||L.type==="wheel")&&X})},[k,F,i,l,u,h,v,g,Y]),ae.createElement("div",{className:"react-flow__renderer",ref:P,style:vv},j)},ZU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function QU(){const{userSelectionActive:e,userSelectionRect:t}=dt(ZU,Vt);return e&&t?ae.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Fw(e,t){const r=t.parentNode||t.parentId,o=e.find(i=>i.id===r);if(o){const i=t.position.x+t.width-o.width,l=t.position.y+t.height-o.height;if(i>0||l>0||t.position.x<0||t.position.y<0){if(o.style={...o.style},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,i>0&&(o.style.width+=i),l>0&&(o.style.height+=l),t.position.x<0){const u=Math.abs(t.position.x);o.position.x=o.position.x-u,o.style.width+=u,t.position.x=0}if(t.position.y<0){const u=Math.abs(t.position.y);o.position.y=o.position.y-u,o.style.height+=u,t.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function x2(e,t){if(e.some(o=>o.type==="reset"))return e.filter(o=>o.type==="reset").map(o=>o.item);const r=e.filter(o=>o.type==="add").map(o=>o.item);return t.reduce((o,i)=>{const l=e.filter(f=>f.id===i.id);if(l.length===0)return o.push(i),o;const u={...i};for(const f of l)if(f)switch(f.type){case"select":{u.selected=f.selected;break}case"position":{typeof f.position<"u"&&(u.position=f.position),typeof f.positionAbsolute<"u"&&(u.positionAbsolute=f.positionAbsolute),typeof f.dragging<"u"&&(u.dragging=f.dragging),u.expandParent&&Fw(o,u);break}case"dimensions":{typeof f.dimensions<"u"&&(u.width=f.dimensions.width,u.height=f.dimensions.height),typeof f.updateStyle<"u"&&(u.style={...u.style||{},...f.dimensions}),typeof f.resizing=="boolean"&&(u.resizing=f.resizing),u.expandParent&&Fw(o,u);break}case"remove":return o}return o.push(u),o},r)}function b2(e,t){return x2(e,t)}function JU(e,t){return x2(e,t)}const Ka=(e,t)=>({id:e,type:"select",selected:t});function Ks(e,t){return e.reduce((r,o)=>{const i=t.includes(o.id);return!o.selected&&i?(o.selected=!0,r.push(Ka(o.id,!0))):o.selected&&!i&&(o.selected=!1,r.push(Ka(o.id,!1))),r},[])}const xp=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},eB=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),w2=x.memo(({isSelecting:e,selectionMode:t=Ql.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:i,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:f,onPaneMouseEnter:m,onPaneMouseMove:h,onPaneMouseLeave:g,children:v})=>{const b=x.useRef(null),w=zt(),E=x.useRef(0),S=x.useRef(0),N=x.useRef(),{userSelectionActive:C,elementsSelectable:j,dragging:A}=dt(eB,Vt),M=()=>{w.setState({userSelectionActive:!1,userSelectionRect:null}),E.current=0,S.current=0},O=te=>{l==null||l(te),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},U=te=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){te.preventDefault();return}u==null||u(te)},H=f?te=>f(te):void 0,V=te=>{const{resetSelectedElements:k,domNode:Y}=w.getState();if(N.current=Y==null?void 0:Y.getBoundingClientRect(),!j||!e||te.button!==0||te.target!==b.current||!N.current)return;const{x:D,y:q}=Ja(te,N.current);k(),w.setState({userSelectionRect:{width:0,height:0,startX:D,startY:q,x:D,y:q}}),o==null||o(te)},P=te=>{const{userSelectionRect:k,nodeInternals:Y,edges:D,transform:q,onNodesChange:B,onEdgesChange:L,nodeOrigin:T,getNodes:I}=w.getState();if(!e||!N.current||!k)return;w.setState({userSelectionActive:!0,nodesSelectionActive:!1});const X=Ja(te,N.current),Z=k.startX??0,re=k.startY??0,fe={...k,x:X.x<Z?X.x:Z,y:X.y<re?X.y:re,width:Math.abs(X.x-Z),height:Math.abs(X.y-re)},ue=I(),se=t2(Y,fe,q,t===Ql.Partial,!0,T),me=n2(se,D).map(ge=>ge.id),pe=se.map(ge=>ge.id);if(E.current!==pe.length){E.current=pe.length;const ge=Ks(ue,pe);ge.length&&(B==null||B(ge))}if(S.current!==me.length){S.current=me.length;const ge=Ks(D,me);ge.length&&(L==null||L(ge))}w.setState({userSelectionRect:fe})},z=te=>{if(te.button!==0)return;const{userSelectionRect:k}=w.getState();!C&&k&&te.target===b.current&&(O==null||O(te)),w.setState({nodesSelectionActive:E.current>0}),M(),i==null||i(te)},F=te=>{C&&(w.setState({nodesSelectionActive:E.current>0}),i==null||i(te)),M()},K=j&&(e||C);return ae.createElement("div",{className:Xt(["react-flow__pane",{dragging:A,selection:e}]),onClick:K?void 0:xp(O,b),onContextMenu:xp(U,b),onWheel:xp(H,b),onMouseEnter:K?void 0:m,onMouseDown:K?V:void 0,onMouseMove:K?P:h,onMouseUp:K?z:void 0,onMouseLeave:K?F:g,ref:b,style:vv},v,ae.createElement(QU,null))});w2.displayName="Pane";function S2(e,t){const r=e.parentNode||e.parentId;if(!r)return!1;const o=t.get(r);return o?o.selected?!0:S2(o,t):!1}function Xw(e,t,r){let o=e;do{if(o!=null&&o.matches(t))return!0;if(o===r.current)return!1;o=o.parentElement}while(o);return!1}function tB(e,t,r,o){return Array.from(e.values()).filter(i=>(i.selected||i.id===o)&&(!i.parentNode||i.parentId||!S2(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var l,u;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:r.x-(((l=i.positionAbsolute)==null?void 0:l.x)??0),y:r.y-(((u=i.positionAbsolute)==null?void 0:u.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode||i.parentId,parentId:i.parentNode||i.parentId,width:i.width,height:i.height,expandParent:i.expandParent}})}function nB(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function E2(e,t,r,o,i=[0,0],l){const u=nB(e,e.extent||o);let f=u;const m=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(m&&e.width&&e.height){const v=r.get(m),{x:b,y:w}=Ho(v,i).positionAbsolute;f=v&&Vn(b)&&Vn(w)&&Vn(v.width)&&Vn(v.height)?[[b+e.width*i[0],w+e.height*i[1]],[b+v.width-e.width+e.width*i[0],w+v.height-e.height+e.height*i[1]]]:f}else l==null||l("005",fa.error005()),f=u;else if(e.extent&&m&&e.extent!=="parent"){const v=r.get(m),{x:b,y:w}=Ho(v,i).positionAbsolute;f=[[e.extent[0][0]+b,e.extent[0][1]+w],[e.extent[1][0]+b,e.extent[1][1]+w]]}let h={x:0,y:0};if(m){const v=r.get(m);h=Ho(v,i).positionAbsolute}const g=f&&f!=="parent"?cv(t,f):t;return{position:{x:g.x-h.x,y:g.y-h.y},positionAbsolute:g}}function bp({nodeId:e,dragItems:t,nodeInternals:r}){const o=t.map(i=>({...r.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?o.find(i=>i.id===e):o[0],o]}const Ww=(e,t,r,o)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const l=Array.from(i),u=t.getBoundingClientRect(),f={x:u.width*o[0],y:u.height*o[1]};return l.map(m=>{const h=m.getBoundingClientRect();return{id:m.getAttribute("data-handleid"),position:m.getAttribute("data-handlepos"),x:(h.left-u.left-f.x)/r,y:(h.top-u.top-f.y)/r,...lv(m)}})};function Cl(e,t,r){return r===void 0?r:o=>{const i=t().nodeInternals.get(e);i&&r(o,{...i})}}function lg({id:e,store:t,unselect:r=!1,nodeRef:o}){const{addSelectedNodes:i,unselectNodesAndEdges:l,multiSelectionActive:u,nodeInternals:f,onError:m}=t.getState(),h=f.get(e);if(!h){m==null||m("012",fa.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(r||h.selected&&u)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var g;return(g=o==null?void 0:o.current)==null?void 0:g.blur()})):i([e])}function rB(){const e=zt();return x.useCallback(({sourceEvent:r})=>{const{transform:o,snapGrid:i,snapToGrid:l}=e.getState(),u=r.touches?r.touches[0].clientX:r.clientX,f=r.touches?r.touches[0].clientY:r.clientY,m={x:(u-o[0])/o[2],y:(f-o[1])/o[2]};return{xSnapped:l?i[0]*Math.round(m.x/i[0]):m.x,ySnapped:l?i[1]*Math.round(m.y/i[1]):m.y,...m}},[])}function wp(e){return(t,r,o)=>e==null?void 0:e(t,o)}function N2({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:o,nodeId:i,isSelectable:l,selectNodesOnDrag:u}){const f=zt(),[m,h]=x.useState(!1),g=x.useRef([]),v=x.useRef({x:null,y:null}),b=x.useRef(0),w=x.useRef(null),E=x.useRef({x:0,y:0}),S=x.useRef(null),N=x.useRef(!1),C=x.useRef(!1),j=x.useRef(!1),A=rB();return x.useEffect(()=>{if(e!=null&&e.current){const M=In(e.current),O=({x:V,y:P})=>{const{nodeInternals:z,onNodeDrag:F,onSelectionDrag:K,updateNodePositions:te,nodeExtent:k,snapGrid:Y,snapToGrid:D,nodeOrigin:q,onError:B}=f.getState();v.current={x:V,y:P};let L=!1,T={x:0,y:0,x2:0,y2:0};if(g.current.length>1&&k){const X=Af(g.current,q);T=Zl(X)}if(g.current=g.current.map(X=>{const Z={x:V-X.distance.x,y:P-X.distance.y};D&&(Z.x=Y[0]*Math.round(Z.x/Y[0]),Z.y=Y[1]*Math.round(Z.y/Y[1]));const re=[[k[0][0],k[0][1]],[k[1][0],k[1][1]]];g.current.length>1&&k&&!X.extent&&(re[0][0]=X.positionAbsolute.x-T.x+k[0][0],re[1][0]=X.positionAbsolute.x+(X.width??0)-T.x2+k[1][0],re[0][1]=X.positionAbsolute.y-T.y+k[0][1],re[1][1]=X.positionAbsolute.y+(X.height??0)-T.y2+k[1][1]);const fe=E2(X,Z,z,re,q,B);return L=L||X.position.x!==fe.position.x||X.position.y!==fe.position.y,X.position=fe.position,X.positionAbsolute=fe.positionAbsolute,X}),!L)return;te(g.current,!0,!0),h(!0);const I=i?F:wp(K);if(I&&S.current){const[X,Z]=bp({nodeId:i,dragItems:g.current,nodeInternals:z});I(S.current,X,Z)}},U=()=>{if(!w.current)return;const[V,P]=VC(E.current,w.current);if(V!==0||P!==0){const{transform:z,panBy:F}=f.getState();v.current.x=(v.current.x??0)-V/z[2],v.current.y=(v.current.y??0)-P/z[2],F({x:V,y:P})&&O(v.current)}b.current=requestAnimationFrame(U)},H=V=>{var q;const{nodeInternals:P,multiSelectionActive:z,nodesDraggable:F,unselectNodesAndEdges:K,onNodeDragStart:te,onSelectionDragStart:k}=f.getState();C.current=!0;const Y=i?te:wp(k);(!u||!l)&&!z&&i&&((q=P.get(i))!=null&&q.selected||K()),i&&l&&u&&lg({id:i,store:f,nodeRef:e});const D=A(V);if(v.current=D,g.current=tB(P,F,D,i),Y&&g.current){const[B,L]=bp({nodeId:i,dragItems:g.current,nodeInternals:P});Y(V.sourceEvent,B,L)}};if(t)M.on(".drag",null);else{const V=pP().on("start",P=>{const{domNode:z,nodeDragThreshold:F}=f.getState();F===0&&H(P),j.current=!1;const K=A(P);v.current=K,w.current=(z==null?void 0:z.getBoundingClientRect())||null,E.current=Ja(P.sourceEvent,w.current)}).on("drag",P=>{var te,k;const z=A(P),{autoPanOnNodeDrag:F,nodeDragThreshold:K}=f.getState();if(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1&&(j.current=!0),!j.current){if(!N.current&&C.current&&F&&(N.current=!0,U()),!C.current){const Y=z.xSnapped-(((te=v==null?void 0:v.current)==null?void 0:te.x)??0),D=z.ySnapped-(((k=v==null?void 0:v.current)==null?void 0:k.y)??0);Math.sqrt(Y*Y+D*D)>K&&H(P)}(v.current.x!==z.xSnapped||v.current.y!==z.ySnapped)&&g.current&&C.current&&(S.current=P.sourceEvent,E.current=Ja(P.sourceEvent,w.current),O(z))}}).on("end",P=>{if(!(!C.current||j.current)&&(h(!1),N.current=!1,C.current=!1,cancelAnimationFrame(b.current),g.current)){const{updateNodePositions:z,nodeInternals:F,onNodeDragStop:K,onSelectionDragStop:te}=f.getState(),k=i?K:wp(te);if(z(g.current,!1,!1),k){const[Y,D]=bp({nodeId:i,dragItems:g.current,nodeInternals:F});k(P.sourceEvent,Y,D)}}}).filter(P=>{const z=P.target;return!P.button&&(!r||!Xw(z,`.${r}`,e))&&(!o||Xw(z,o,e))});return M.call(V),()=>{M.on(".drag",null)}}}},[e,t,r,o,l,f,i,u,A]),m}function C2(){const e=zt();return x.useCallback(r=>{const{nodeInternals:o,nodeExtent:i,updateNodePositions:l,getNodes:u,snapToGrid:f,snapGrid:m,onError:h,nodesDraggable:g}=e.getState(),v=u().filter(j=>j.selected&&(j.draggable||g&&typeof j.draggable>"u")),b=f?m[0]:5,w=f?m[1]:5,E=r.isShiftPressed?4:1,S=r.x*b*E,N=r.y*w*E,C=v.map(j=>{if(j.positionAbsolute){const A={x:j.positionAbsolute.x+S,y:j.positionAbsolute.y+N};f&&(A.x=m[0]*Math.round(A.x/m[0]),A.y=m[1]*Math.round(A.y/m[1]));const{positionAbsolute:M,position:O}=E2(j,A,o,i,void 0,h);j.position=O,j.positionAbsolute=M}return j});l(C,!0,!1)},[])}const ti={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var jl=e=>{const t=({id:r,type:o,data:i,xPos:l,yPos:u,xPosOrigin:f,yPosOrigin:m,selected:h,onClick:g,onMouseEnter:v,onMouseMove:b,onMouseLeave:w,onContextMenu:E,onDoubleClick:S,style:N,className:C,isDraggable:j,isSelectable:A,isConnectable:M,isFocusable:O,selectNodesOnDrag:U,sourcePosition:H,targetPosition:V,hidden:P,resizeObserver:z,dragHandle:F,zIndex:K,isParent:te,noDragClassName:k,noPanClassName:Y,initialized:D,disableKeyboardA11y:q,ariaLabel:B,rfId:L,hasHandleBounds:T})=>{const I=zt(),X=x.useRef(null),Z=x.useRef(null),re=x.useRef(H),fe=x.useRef(V),ue=x.useRef(o),se=A||j||g||v||b||w,me=C2(),pe=Cl(r,I.getState,v),ge=Cl(r,I.getState,b),Ee=Cl(r,I.getState,w),Se=Cl(r,I.getState,E),Ye=Cl(r,I.getState,S),We=he=>{const{nodeDragThreshold:de}=I.getState();if(A&&(!U||!j||de>0)&&lg({id:r,store:I,nodeRef:X}),g){const Te=I.getState().nodeInternals.get(r);Te&&g(he,{...Te})}},Je=he=>{if(!rg(he)&&!q)if(FC.includes(he.key)&&A){const de=he.key==="Escape";lg({id:r,store:I,unselect:de,nodeRef:X})}else j&&h&&Object.prototype.hasOwnProperty.call(ti,he.key)&&(I.setState({ariaLiveMessage:`Moved selected node ${he.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~l}, y: ${~~u}`}),me({x:ti[he.key].x,y:ti[he.key].y,isShiftPressed:he.shiftKey}))};x.useEffect(()=>()=>{Z.current&&(z==null||z.unobserve(Z.current),Z.current=null)},[]),x.useEffect(()=>{if(X.current&&!P){const he=X.current;(!D||!T||Z.current!==he)&&(Z.current&&(z==null||z.unobserve(Z.current)),z==null||z.observe(he),Z.current=he)}},[P,D,T]),x.useEffect(()=>{const he=ue.current!==o,de=re.current!==H,Te=fe.current!==V;X.current&&(he||de||Te)&&(he&&(ue.current=o),de&&(re.current=H),Te&&(fe.current=V),I.getState().updateNodeDimensions([{id:r,nodeElement:X.current,forceUpdate:!0}]))},[r,o,H,V]);const mt=N2({nodeRef:X,disabled:P||!j,noDragClassName:k,handleSelector:F,nodeId:r,isSelectable:A,selectNodesOnDrag:U});return P?null:ae.createElement("div",{className:Xt(["react-flow__node",`react-flow__node-${o}`,{[Y]:j},C,{selected:h,selectable:A,parent:te,dragging:mt}]),ref:X,style:{zIndex:K,transform:`translate(${f}px,${m}px)`,pointerEvents:se?"all":"none",visibility:D?"visible":"hidden",...N},"data-id":r,"data-testid":`rf__node-${r}`,onMouseEnter:pe,onMouseMove:ge,onMouseLeave:Ee,onContextMenu:Se,onClick:We,onDoubleClick:Ye,onKeyDown:O?Je:void 0,tabIndex:O?0:void 0,role:O?"button":void 0,"aria-describedby":q?void 0:`${m2}-${L}`,"aria-label":B},ae.createElement(yU,{value:r},ae.createElement(e,{id:r,data:i,type:o,xPos:l,yPos:u,selected:h,isConnectable:M,sourcePosition:H,targetPosition:V,dragging:mt,dragHandle:F,zIndex:K})))};return t.displayName="NodeWrapper",x.memo(t)};const aB=e=>{const t=e.getNodes().filter(r=>r.selected);return{...Af(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function oB({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const o=zt(),{width:i,height:l,x:u,y:f,transformString:m,userSelectionActive:h}=dt(aB,Vt),g=C2(),v=x.useRef(null);if(x.useEffect(()=>{var E;r||(E=v.current)==null||E.focus({preventScroll:!0})},[r]),N2({nodeRef:v}),h||!i||!l)return null;const b=e?E=>{const S=o.getState().getNodes().filter(N=>N.selected);e(E,S)}:void 0,w=E=>{Object.prototype.hasOwnProperty.call(ti,E.key)&&g({x:ti[E.key].x,y:ti[E.key].y,isShiftPressed:E.shiftKey})};return ae.createElement("div",{className:Xt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:m}},ae.createElement("div",{ref:v,className:"react-flow__nodesselection-rect",onContextMenu:b,tabIndex:r?void 0:-1,onKeyDown:r?void 0:w,style:{width:i,height:l,top:f,left:u}}))}var sB=x.memo(oB);const iB=e=>e.nodesSelectionActive,j2=({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:l,onPaneScroll:u,deleteKeyCode:f,onMove:m,onMoveStart:h,onMoveEnd:g,selectionKeyCode:v,selectionOnDrag:b,selectionMode:w,onSelectionStart:E,onSelectionEnd:S,multiSelectionKeyCode:N,panActivationKeyCode:C,zoomActivationKeyCode:j,elementsSelectable:A,zoomOnScroll:M,zoomOnPinch:O,panOnScroll:U,panOnScrollSpeed:H,panOnScrollMode:V,zoomOnDoubleClick:P,panOnDrag:z,defaultViewport:F,translateExtent:K,minZoom:te,maxZoom:k,preventScrolling:Y,onSelectionContextMenu:D,noWheelClassName:q,noPanClassName:B,disableKeyboardA11y:L})=>{const T=dt(iB),I=Jl(v),X=Jl(C),Z=X||z,re=X||U,fe=I||b&&Z!==!0;return GU({deleteKeyCode:f,multiSelectionKeyCode:N}),ae.createElement(KU,{onMove:m,onMoveStart:h,onMoveEnd:g,onPaneContextMenu:l,elementsSelectable:A,zoomOnScroll:M,zoomOnPinch:O,panOnScroll:re,panOnScrollSpeed:H,panOnScrollMode:V,zoomOnDoubleClick:P,panOnDrag:!I&&Z,defaultViewport:F,translateExtent:K,minZoom:te,maxZoom:k,zoomActivationKeyCode:j,preventScrolling:Y,noWheelClassName:q,noPanClassName:B},ae.createElement(w2,{onSelectionStart:E,onSelectionEnd:S,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:Z,isSelecting:!!fe,selectionMode:w},e,T&&ae.createElement(sB,{onSelectionContextMenu:D,noPanClassName:B,disableKeyboardA11y:L})))};j2.displayName="FlowRenderer";var lB=x.memo(j2);function cB(e){return dt(x.useCallback(r=>e?t2(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):r.getNodes(),[e]))}function uB(e){const t={input:jl(e.input||u2),default:jl(e.default||ig),output:jl(e.output||f2),group:jl(e.group||pv)},r={},o=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,l)=>(i[l]=jl(e[l]||ig),i),r);return{...t,...o}}const dB=({x:e,y:t,width:r,height:o,origin:i})=>!r||!o?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-r*i[0],y:t-o*i[1]},fB=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),_2=e=>{const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:o,elementsSelectable:i,updateNodeDimensions:l,onError:u}=dt(fB,Vt),f=cB(e.onlyRenderVisibleElements),m=x.useRef(),h=x.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const g=new ResizeObserver(v=>{const b=v.map(w=>({id:w.target.getAttribute("data-id"),nodeElement:w.target,forceUpdate:!0}));l(b)});return m.current=g,g},[]);return x.useEffect(()=>()=>{var g;(g=m==null?void 0:m.current)==null||g.disconnect()},[]),ae.createElement("div",{className:"react-flow__nodes",style:vv},f.map(g=>{var O,U,H;let v=g.type||"default";e.nodeTypes[v]||(u==null||u("003",fa.error003(v)),v="default");const b=e.nodeTypes[v]||e.nodeTypes.default,w=!!(g.draggable||t&&typeof g.draggable>"u"),E=!!(g.selectable||i&&typeof g.selectable>"u"),S=!!(g.connectable||r&&typeof g.connectable>"u"),N=!!(g.focusable||o&&typeof g.focusable>"u"),C=e.nodeExtent?cv(g.positionAbsolute,e.nodeExtent):g.positionAbsolute,j=(C==null?void 0:C.x)??0,A=(C==null?void 0:C.y)??0,M=dB({x:j,y:A,width:g.width??0,height:g.height??0,origin:e.nodeOrigin});return ae.createElement(b,{key:g.id,id:g.id,className:g.className,style:g.style,type:v,data:g.data,sourcePosition:g.sourcePosition||Ce.Bottom,targetPosition:g.targetPosition||Ce.Top,hidden:g.hidden,xPos:j,yPos:A,xPosOrigin:M.x,yPosOrigin:M.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!g.selected,isDraggable:w,isSelectable:E,isConnectable:S,isFocusable:N,resizeObserver:h,dragHandle:g.dragHandle,zIndex:((O=g[xt])==null?void 0:O.z)??0,isParent:!!((U=g[xt])!=null&&U.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!g.width&&!!g.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:g.ariaLabel,hasHandleBounds:!!((H=g[xt])!=null&&H.handleBounds)})}))};_2.displayName="NodeRenderer";var hB=x.memo(_2);const mB=(e,t,r)=>r===Ce.Left?e-t:r===Ce.Right?e+t:e,pB=(e,t,r)=>r===Ce.Top?e-t:r===Ce.Bottom?e+t:e,Kw="react-flow__edgeupdater",Zw=({position:e,centerX:t,centerY:r,radius:o=10,onMouseDown:i,onMouseEnter:l,onMouseOut:u,type:f})=>ae.createElement("circle",{onMouseDown:i,onMouseEnter:l,onMouseOut:u,className:Xt([Kw,`${Kw}-${f}`]),cx:mB(t,o,e),cy:pB(r,o,e),r:o,stroke:"transparent",fill:"transparent"}),gB=()=>!0;var Fs=e=>{const t=({id:r,className:o,type:i,data:l,onClick:u,onEdgeDoubleClick:f,selected:m,animated:h,label:g,labelStyle:v,labelShowBg:b,labelBgStyle:w,labelBgPadding:E,labelBgBorderRadius:S,style:N,source:C,target:j,sourceX:A,sourceY:M,targetX:O,targetY:U,sourcePosition:H,targetPosition:V,elementsSelectable:P,hidden:z,sourceHandleId:F,targetHandleId:K,onContextMenu:te,onMouseEnter:k,onMouseMove:Y,onMouseLeave:D,reconnectRadius:q,onReconnect:B,onReconnectStart:L,onReconnectEnd:T,markerEnd:I,markerStart:X,rfId:Z,ariaLabel:re,isFocusable:fe,isReconnectable:ue,pathOptions:se,interactionWidth:me,disableKeyboardA11y:pe})=>{const ge=x.useRef(null),[Ee,Se]=x.useState(!1),[Ye,We]=x.useState(!1),Je=zt(),mt=x.useMemo(()=>`url('#${og(X,Z)}')`,[X,Z]),he=x.useMemo(()=>`url('#${og(I,Z)}')`,[I,Z]);if(z)return null;const de=Lt=>{var Wt;const{edges:xn,addSelectedEdges:Mn,unselectNodesAndEdges:Dn,multiSelectionActive:nn}=Je.getState(),sn=xn.find(co=>co.id===r);sn&&(P&&(Je.setState({nodesSelectionActive:!1}),sn.selected&&nn?(Dn({nodes:[],edges:[sn]}),(Wt=ge.current)==null||Wt.blur()):Mn([r])),u&&u(Lt,sn))},Te=Nl(r,Je.getState,f),Ke=Nl(r,Je.getState,te),Le=Nl(r,Je.getState,k),Ct=Nl(r,Je.getState,Y),zr=Nl(r,Je.getState,D),Xn=(Lt,xn)=>{if(Lt.button!==0)return;const{edges:Mn,isValidConnection:Dn}=Je.getState(),nn=xn?j:C,sn=(xn?K:F)||null,Wt=xn?"target":"source",co=Dn||gB,rs=xn,ga=Mn.find(Lr=>Lr.id===r);We(!0),L==null||L(Lt,ga,Wt);const uo=Lr=>{We(!1),T==null||T(Lr,ga,Wt)};s2({event:Lt,handleId:sn,nodeId:nn,onConnect:Lr=>B==null?void 0:B(ga,Lr),isTarget:rs,getState:Je.getState,setState:Je.setState,isValidConnection:co,edgeUpdaterType:Wt,onReconnectEnd:uo})},pa=Lt=>Xn(Lt,!0),yn=Lt=>Xn(Lt,!1),bt=()=>Se(!0),tn=()=>Se(!1),jt=!P&&!u,lo=Lt=>{var xn;if(!pe&&FC.includes(Lt.key)&&P){const{unselectNodesAndEdges:Mn,addSelectedEdges:Dn,edges:nn}=Je.getState();Lt.key==="Escape"?((xn=ge.current)==null||xn.blur(),Mn({edges:[nn.find(Wt=>Wt.id===r)]})):Dn([r])}};return ae.createElement("g",{className:Xt(["react-flow__edge",`react-flow__edge-${i}`,o,{selected:m,animated:h,inactive:jt,updating:Ee}]),onClick:de,onDoubleClick:Te,onContextMenu:Ke,onMouseEnter:Le,onMouseMove:Ct,onMouseLeave:zr,onKeyDown:fe?lo:void 0,tabIndex:fe?0:void 0,role:fe?"button":"img","data-testid":`rf__edge-${r}`,"aria-label":re===null?void 0:re||`Edge from ${C} to ${j}`,"aria-describedby":fe?`${p2}-${Z}`:void 0,ref:ge},!Ye&&ae.createElement(e,{id:r,source:C,target:j,selected:m,animated:h,label:g,labelStyle:v,labelShowBg:b,labelBgStyle:w,labelBgPadding:E,labelBgBorderRadius:S,data:l,style:N,sourceX:A,sourceY:M,targetX:O,targetY:U,sourcePosition:H,targetPosition:V,sourceHandleId:F,targetHandleId:K,markerStart:mt,markerEnd:he,pathOptions:se,interactionWidth:me}),ue&&ae.createElement(ae.Fragment,null,(ue==="source"||ue===!0)&&ae.createElement(Zw,{position:H,centerX:A,centerY:M,radius:q,onMouseDown:pa,onMouseEnter:bt,onMouseOut:tn,type:"source"}),(ue==="target"||ue===!0)&&ae.createElement(Zw,{position:V,centerX:O,centerY:U,radius:q,onMouseDown:yn,onMouseEnter:bt,onMouseOut:tn,type:"target"})))};return t.displayName="EdgeWrapper",x.memo(t)};function vB(e){const t={default:Fs(e.default||Bd),straight:Fs(e.bezier||fv),step:Fs(e.step||dv),smoothstep:Fs(e.step||_f),simplebezier:Fs(e.simplebezier||uv)},r={},o=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,l)=>(i[l]=Fs(e[l]||Bd),i),r);return{...t,...o}}function Qw(e,t,r=null){const o=((r==null?void 0:r.x)||0)+t.x,i=((r==null?void 0:r.y)||0)+t.y,l=(r==null?void 0:r.width)||t.width,u=(r==null?void 0:r.height)||t.height;switch(e){case Ce.Top:return{x:o+l/2,y:i};case Ce.Right:return{x:o+l,y:i+u/2};case Ce.Bottom:return{x:o+l/2,y:i+u};case Ce.Left:return{x:o,y:i+u/2}}}function Jw(e,t){return e?e.length===1||!t?e[0]:t&&e.find(r=>r.id===t)||null:null}const yB=(e,t,r,o,i,l)=>{const u=Qw(r,e,t),f=Qw(l,o,i);return{sourceX:u.x,sourceY:u.y,targetX:f.x,targetY:f.y}};function xB({sourcePos:e,targetPos:t,sourceWidth:r,sourceHeight:o,targetWidth:i,targetHeight:l,width:u,height:f,transform:m}){const h={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+r,t.x+i),y2:Math.max(e.y+o,t.y+l)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const g=Zl({x:(0-m[0])/m[2],y:(0-m[1])/m[2],width:u/m[2],height:f/m[2]}),v=Math.max(0,Math.min(g.x2,h.x2)-Math.max(g.x,h.x)),b=Math.max(0,Math.min(g.y2,h.y2)-Math.max(g.y,h.y));return Math.ceil(v*b)>0}function eS(e){var o,i,l,u,f;const t=((o=e==null?void 0:e[xt])==null?void 0:o.handleBounds)||null,r=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)<"u";return[{x:((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.x)||0,y:((f=e==null?void 0:e.positionAbsolute)==null?void 0:f.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!r]}const bB=[{level:0,isMaxLevel:!0,edges:[]}];function wB(e,t,r=!1){let o=-1;const i=e.reduce((u,f)=>{var g,v;const m=Vn(f.zIndex);let h=m?f.zIndex:0;if(r){const b=t.get(f.target),w=t.get(f.source),E=f.selected||(b==null?void 0:b.selected)||(w==null?void 0:w.selected),S=Math.max(((g=w==null?void 0:w[xt])==null?void 0:g.z)||0,((v=b==null?void 0:b[xt])==null?void 0:v.z)||0,1e3);h=(m?f.zIndex:0)+(E?S:0)}return u[h]?u[h].push(f):u[h]=[f],o=h>o?h:o,u},{}),l=Object.entries(i).map(([u,f])=>{const m=+u;return{edges:f,level:m,isMaxLevel:m===o}});return l.length===0?bB:l}function SB(e,t,r){const o=dt(x.useCallback(i=>e?i.edges.filter(l=>{const u=t.get(l.source),f=t.get(l.target);return(u==null?void 0:u.width)&&(u==null?void 0:u.height)&&(f==null?void 0:f.width)&&(f==null?void 0:f.height)&&xB({sourcePos:u.positionAbsolute||{x:0,y:0},targetPos:f.positionAbsolute||{x:0,y:0},sourceWidth:u.width,sourceHeight:u.height,targetWidth:f.width,targetHeight:f.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return wB(o,t,r)}const EB=({color:e="none",strokeWidth:t=1})=>ae.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),NB=({color:e="none",strokeWidth:t=1})=>ae.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),tS={[Ud.Arrow]:EB,[Ud.ArrowClosed]:NB};function CB(e){const t=zt();return x.useMemo(()=>{var i,l;return Object.prototype.hasOwnProperty.call(tS,e)?tS[e]:((l=(i=t.getState()).onError)==null||l.call(i,"009",fa.error009(e)),null)},[e])}const jB=({id:e,type:t,color:r,width:o=12.5,height:i=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const m=CB(t);return m?ae.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0"},ae.createElement(m,{color:r,strokeWidth:u})):null},_B=({defaultColor:e,rfId:t})=>r=>{const o=[];return r.edges.reduce((i,l)=>([l.markerStart,l.markerEnd].forEach(u=>{if(u&&typeof u=="object"){const f=og(u,t);o.includes(f)||(i.push({id:f,color:u.color||e,...u}),o.push(f))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))},A2=({defaultColor:e,rfId:t})=>{const r=dt(x.useCallback(_B({defaultColor:e,rfId:t}),[e,t]),(o,i)=>!(o.length!==i.length||o.some((l,u)=>l.id!==i[u].id)));return ae.createElement("defs",null,r.map(o=>ae.createElement(jB,{id:o.id,key:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient})))};A2.displayName="MarkerDefinitions";var AB=x.memo(A2);const TB=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),T2=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:r,rfId:o,edgeTypes:i,noPanClassName:l,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:m,onEdgeMouseLeave:h,onEdgeClick:g,onEdgeDoubleClick:v,onReconnect:b,onReconnectStart:w,onReconnectEnd:E,reconnectRadius:S,children:N,disableKeyboardA11y:C})=>{const{edgesFocusable:j,edgesUpdatable:A,elementsSelectable:M,width:O,height:U,connectionMode:H,nodeInternals:V,onError:P}=dt(TB,Vt),z=SB(t,V,r);return O?ae.createElement(ae.Fragment,null,z.map(({level:F,edges:K,isMaxLevel:te})=>ae.createElement("svg",{key:F,style:{zIndex:F},width:O,height:U,className:"react-flow__edges react-flow__container"},te&&ae.createElement(AB,{defaultColor:e,rfId:o}),ae.createElement("g",null,K.map(k=>{const[Y,D,q]=eS(V.get(k.source)),[B,L,T]=eS(V.get(k.target));if(!q||!T)return null;let I=k.type||"default";i[I]||(P==null||P("011",fa.error011(I)),I="default");const X=i[I]||i.default,Z=H===Jo.Strict?L.target:(L.target??[]).concat(L.source??[]),re=Jw(D.source,k.sourceHandle),fe=Jw(Z,k.targetHandle),ue=(re==null?void 0:re.position)||Ce.Bottom,se=(fe==null?void 0:fe.position)||Ce.Top,me=!!(k.focusable||j&&typeof k.focusable>"u"),pe=k.reconnectable||k.updatable,ge=typeof b<"u"&&(pe||A&&typeof pe>"u");if(!re||!fe)return P==null||P("008",fa.error008(re,k)),null;const{sourceX:Ee,sourceY:Se,targetX:Ye,targetY:We}=yB(Y,re,ue,B,fe,se);return ae.createElement(X,{key:k.id,id:k.id,className:Xt([k.className,l]),type:I,data:k.data,selected:!!k.selected,animated:!!k.animated,hidden:!!k.hidden,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,style:k.style,source:k.source,target:k.target,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerEnd:k.markerEnd,markerStart:k.markerStart,sourceX:Ee,sourceY:Se,targetX:Ye,targetY:We,sourcePosition:ue,targetPosition:se,elementsSelectable:M,onContextMenu:u,onMouseEnter:f,onMouseMove:m,onMouseLeave:h,onClick:g,onEdgeDoubleClick:v,onReconnect:b,onReconnectStart:w,onReconnectEnd:E,reconnectRadius:S,rfId:o,ariaLabel:k.ariaLabel,isFocusable:me,isReconnectable:ge,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth,disableKeyboardA11y:C})})))),N):null};T2.displayName="EdgeRenderer";var RB=x.memo(T2);const MB=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function DB({children:e}){const t=dt(MB);return ae.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function OB(e){const t=gv(),r=x.useRef(!1);x.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const kB={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},R2=({nodeId:e,handleType:t,style:r,type:o=ta.Bezier,CustomComponent:i,connectionStatus:l})=>{var U,H,V;const{fromNode:u,handleId:f,toX:m,toY:h,connectionMode:g}=dt(x.useCallback(P=>({fromNode:P.nodeInternals.get(e),handleId:P.connectionHandleId,toX:(P.connectionPosition.x-P.transform[0])/P.transform[2],toY:(P.connectionPosition.y-P.transform[1])/P.transform[2],connectionMode:P.connectionMode}),[e]),Vt),v=(U=u==null?void 0:u[xt])==null?void 0:U.handleBounds;let b=v==null?void 0:v[t];if(g===Jo.Loose&&(b=b||(v==null?void 0:v[t==="source"?"target":"source"])),!u||!b)return null;const w=f?b.find(P=>P.id===f):b[0],E=w?w.x+w.width/2:(u.width??0)/2,S=w?w.y+w.height/2:u.height??0,N=(((H=u.positionAbsolute)==null?void 0:H.x)??0)+E,C=(((V=u.positionAbsolute)==null?void 0:V.y)??0)+S,j=w==null?void 0:w.position,A=j?kB[j]:null;if(!j||!A)return null;if(i)return ae.createElement(i,{connectionLineType:o,connectionLineStyle:r,fromNode:u,fromHandle:w,fromX:N,fromY:C,toX:m,toY:h,fromPosition:j,toPosition:A,connectionStatus:l});let M="";const O={sourceX:N,sourceY:C,sourcePosition:j,targetX:m,targetY:h,targetPosition:A};return o===ta.Bezier?[M]=QC(O):o===ta.Step?[M]=ag({...O,borderRadius:0}):o===ta.SmoothStep?[M]=ag(O):o===ta.SimpleBezier?[M]=ZC(O):M=`M${N},${C} ${m},${h}`,ae.createElement("path",{d:M,fill:"none",className:"react-flow__connection-path",style:r})};R2.displayName="ConnectionLine";const zB=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function LB({containerStyle:e,style:t,type:r,component:o}){const{nodeId:i,handleType:l,nodesConnectable:u,width:f,height:m,connectionStatus:h}=dt(zB,Vt);return!(i&&l&&f&&u)?null:ae.createElement("svg",{style:e,width:f,height:m,className:"react-flow__edges react-flow__connectionline react-flow__container"},ae.createElement("g",{className:Xt(["react-flow__connection",h])},ae.createElement(R2,{nodeId:i,handleType:l,style:t,type:r,CustomComponent:o,connectionStatus:h})))}function nS(e,t){return x.useRef(null),zt(),x.useMemo(()=>t(e),[e])}const M2=({nodeTypes:e,edgeTypes:t,onMove:r,onMoveStart:o,onMoveEnd:i,onInit:l,onNodeClick:u,onEdgeClick:f,onNodeDoubleClick:m,onEdgeDoubleClick:h,onNodeMouseEnter:g,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:w,onSelectionContextMenu:E,onSelectionStart:S,onSelectionEnd:N,connectionLineType:C,connectionLineStyle:j,connectionLineComponent:A,connectionLineContainerStyle:M,selectionKeyCode:O,selectionOnDrag:U,selectionMode:H,multiSelectionKeyCode:V,panActivationKeyCode:P,zoomActivationKeyCode:z,deleteKeyCode:F,onlyRenderVisibleElements:K,elementsSelectable:te,selectNodesOnDrag:k,defaultViewport:Y,translateExtent:D,minZoom:q,maxZoom:B,preventScrolling:L,defaultMarkerColor:T,zoomOnScroll:I,zoomOnPinch:X,panOnScroll:Z,panOnScrollSpeed:re,panOnScrollMode:fe,zoomOnDoubleClick:ue,panOnDrag:se,onPaneClick:me,onPaneMouseEnter:pe,onPaneMouseMove:ge,onPaneMouseLeave:Ee,onPaneScroll:Se,onPaneContextMenu:Ye,onEdgeContextMenu:We,onEdgeMouseEnter:Je,onEdgeMouseMove:mt,onEdgeMouseLeave:he,onReconnect:de,onReconnectStart:Te,onReconnectEnd:Ke,reconnectRadius:Le,noDragClassName:Ct,noWheelClassName:zr,noPanClassName:Xn,elevateEdgesOnSelect:pa,disableKeyboardA11y:yn,nodeOrigin:bt,nodeExtent:tn,rfId:jt})=>{const lo=nS(e,uB),Lt=nS(t,vB);return OB(l),ae.createElement(lB,{onPaneClick:me,onPaneMouseEnter:pe,onPaneMouseMove:ge,onPaneMouseLeave:Ee,onPaneContextMenu:Ye,onPaneScroll:Se,deleteKeyCode:F,selectionKeyCode:O,selectionOnDrag:U,selectionMode:H,onSelectionStart:S,onSelectionEnd:N,multiSelectionKeyCode:V,panActivationKeyCode:P,zoomActivationKeyCode:z,elementsSelectable:te,onMove:r,onMoveStart:o,onMoveEnd:i,zoomOnScroll:I,zoomOnPinch:X,zoomOnDoubleClick:ue,panOnScroll:Z,panOnScrollSpeed:re,panOnScrollMode:fe,panOnDrag:se,defaultViewport:Y,translateExtent:D,minZoom:q,maxZoom:B,onSelectionContextMenu:E,preventScrolling:L,noDragClassName:Ct,noWheelClassName:zr,noPanClassName:Xn,disableKeyboardA11y:yn},ae.createElement(DB,null,ae.createElement(RB,{edgeTypes:Lt,onEdgeClick:f,onEdgeDoubleClick:h,onlyRenderVisibleElements:K,onEdgeContextMenu:We,onEdgeMouseEnter:Je,onEdgeMouseMove:mt,onEdgeMouseLeave:he,onReconnect:de,onReconnectStart:Te,onReconnectEnd:Ke,reconnectRadius:Le,defaultMarkerColor:T,noPanClassName:Xn,elevateEdgesOnSelect:!!pa,disableKeyboardA11y:yn,rfId:jt},ae.createElement(LB,{style:j,type:C,component:A,containerStyle:M})),ae.createElement("div",{className:"react-flow__edgelabel-renderer"}),ae.createElement(hB,{nodeTypes:lo,onNodeClick:u,onNodeDoubleClick:m,onNodeMouseEnter:g,onNodeMouseMove:v,onNodeMouseLeave:b,onNodeContextMenu:w,selectNodesOnDrag:k,onlyRenderVisibleElements:K,noPanClassName:Xn,noDragClassName:Ct,disableKeyboardA11y:yn,nodeOrigin:bt,nodeExtent:tn,rfId:jt})))};M2.displayName="GraphView";var PB=x.memo(M2);const cg=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ga={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:cg,nodeExtent:cg,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Jo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:fU,isValidConnection:void 0},UB=()=>_5((e,t)=>({...Ga,setNodes:r=>{const{nodeInternals:o,nodeOrigin:i,elevateNodesOnSelect:l}=t();e({nodeInternals:yp(r,o,i,l)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:r=>{const{defaultEdgeOptions:o={}}=t();e({edges:r.map(i=>({...o,...i}))})},setDefaultNodesAndEdges:(r,o)=>{const i=typeof r<"u",l=typeof o<"u",u=i?yp(r,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:u,edges:l?o:[],hasDefaultNodes:i,hasDefaultEdges:l})},updateNodeDimensions:r=>{const{onNodesChange:o,nodeInternals:i,fitViewOnInit:l,fitViewOnInitDone:u,fitViewOnInitOptions:f,domNode:m,nodeOrigin:h}=t(),g=m==null?void 0:m.querySelector(".react-flow__viewport");if(!g)return;const v=window.getComputedStyle(g),{m22:b}=new window.DOMMatrixReadOnly(v.transform),w=r.reduce((S,N)=>{const C=i.get(N.id);if(C!=null&&C.hidden)i.set(C.id,{...C,[xt]:{...C[xt],handleBounds:void 0}});else if(C){const j=lv(N.nodeElement);!!(j.width&&j.height&&(C.width!==j.width||C.height!==j.height||N.forceUpdate))&&(i.set(C.id,{...C,[xt]:{...C[xt],handleBounds:{source:Ww(".source",N.nodeElement,b,h),target:Ww(".target",N.nodeElement,b,h)}},...j}),S.push({id:C.id,type:"dimensions",dimensions:j}))}return S},[]);v2(i,h);const E=u||l&&!u&&y2(t,{initial:!0,...f});e({nodeInternals:new Map(i),fitViewOnInitDone:E}),(w==null?void 0:w.length)>0&&(o==null||o(w))},updateNodePositions:(r,o=!0,i=!1)=>{const{triggerNodeChanges:l}=t(),u=r.map(f=>{const m={id:f.id,type:"position",dragging:i};return o&&(m.positionAbsolute=f.positionAbsolute,m.position=f.position),m});l(u)},triggerNodeChanges:r=>{const{onNodesChange:o,nodeInternals:i,hasDefaultNodes:l,nodeOrigin:u,getNodes:f,elevateNodesOnSelect:m}=t();if(r!=null&&r.length){if(l){const h=b2(r,f()),g=yp(h,i,u,m);e({nodeInternals:g})}o==null||o(r)}},addSelectedNodes:r=>{const{multiSelectionActive:o,edges:i,getNodes:l}=t();let u,f=null;o?u=r.map(m=>Ka(m,!0)):(u=Ks(l(),r),f=Ks(i,[])),Ju({changedNodes:u,changedEdges:f,get:t,set:e})},addSelectedEdges:r=>{const{multiSelectionActive:o,edges:i,getNodes:l}=t();let u,f=null;o?u=r.map(m=>Ka(m,!0)):(u=Ks(i,r),f=Ks(l(),[])),Ju({changedNodes:f,changedEdges:u,get:t,set:e})},unselectNodesAndEdges:({nodes:r,edges:o}={})=>{const{edges:i,getNodes:l}=t(),u=r||l(),f=o||i,m=u.map(g=>(g.selected=!1,Ka(g.id,!1))),h=f.map(g=>Ka(g.id,!1));Ju({changedNodes:m,changedEdges:h,get:t,set:e})},setMinZoom:r=>{const{d3Zoom:o,maxZoom:i}=t();o==null||o.scaleExtent([r,i]),e({minZoom:r})},setMaxZoom:r=>{const{d3Zoom:o,minZoom:i}=t();o==null||o.scaleExtent([i,r]),e({maxZoom:r})},setTranslateExtent:r=>{var o;(o=t().d3Zoom)==null||o.translateExtent(r),e({translateExtent:r})},resetSelectedElements:()=>{const{edges:r,getNodes:o}=t(),l=o().filter(f=>f.selected).map(f=>Ka(f.id,!1)),u=r.filter(f=>f.selected).map(f=>Ka(f.id,!1));Ju({changedNodes:l,changedEdges:u,get:t,set:e})},setNodeExtent:r=>{const{nodeInternals:o}=t();o.forEach(i=>{i.positionAbsolute=cv(i.position,r)}),e({nodeExtent:r,nodeInternals:new Map(o)})},panBy:r=>{const{transform:o,width:i,height:l,d3Zoom:u,d3Selection:f,translateExtent:m}=t();if(!u||!f||!r.x&&!r.y)return!1;const h=oa.translate(o[0]+r.x,o[1]+r.y).scale(o[2]),g=[[0,0],[i,l]],v=u==null?void 0:u.constrain()(h,g,m);return u.transform(f,v),o[0]!==v.x||o[1]!==v.y||o[2]!==v.k},cancelConnection:()=>e({connectionNodeId:Ga.connectionNodeId,connectionHandleId:Ga.connectionHandleId,connectionHandleType:Ga.connectionHandleType,connectionStatus:Ga.connectionStatus,connectionStartHandle:Ga.connectionStartHandle,connectionEndHandle:Ga.connectionEndHandle}),reset:()=>e({...Ga})}),Object.is),D2=({children:e})=>{const t=x.useRef(null);return t.current||(t.current=UB()),ae.createElement(oU,{value:t.current},e)};D2.displayName="ReactFlowProvider";const O2=({children:e})=>x.useContext(jf)?ae.createElement(ae.Fragment,null,e):ae.createElement(D2,null,e);O2.displayName="ReactFlowWrapper";const BB={input:u2,default:ig,output:f2,group:pv},HB={default:Bd,straight:fv,step:dv,smoothstep:_f,simplebezier:uv},$B=[0,0],IB=[15,15],VB={x:0,y:0,zoom:1},qB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},k2=x.forwardRef(({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,className:i,nodeTypes:l=BB,edgeTypes:u=HB,onNodeClick:f,onEdgeClick:m,onInit:h,onMove:g,onMoveStart:v,onMoveEnd:b,onConnect:w,onConnectStart:E,onConnectEnd:S,onClickConnectStart:N,onClickConnectEnd:C,onNodeMouseEnter:j,onNodeMouseMove:A,onNodeMouseLeave:M,onNodeContextMenu:O,onNodeDoubleClick:U,onNodeDragStart:H,onNodeDrag:V,onNodeDragStop:P,onNodesDelete:z,onEdgesDelete:F,onSelectionChange:K,onSelectionDragStart:te,onSelectionDrag:k,onSelectionDragStop:Y,onSelectionContextMenu:D,onSelectionStart:q,onSelectionEnd:B,connectionMode:L=Jo.Strict,connectionLineType:T=ta.Bezier,connectionLineStyle:I,connectionLineComponent:X,connectionLineContainerStyle:Z,deleteKeyCode:re="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:ue=!1,selectionMode:se=Ql.Full,panActivationKeyCode:me="Space",multiSelectionKeyCode:pe=Pd()?"Meta":"Control",zoomActivationKeyCode:ge=Pd()?"Meta":"Control",snapToGrid:Ee=!1,snapGrid:Se=IB,onlyRenderVisibleElements:Ye=!1,selectNodesOnDrag:We=!0,nodesDraggable:Je,nodesConnectable:mt,nodesFocusable:he,nodeOrigin:de=$B,edgesFocusable:Te,edgesUpdatable:Ke,elementsSelectable:Le,defaultViewport:Ct=VB,minZoom:zr=.5,maxZoom:Xn=2,translateExtent:pa=cg,preventScrolling:yn=!0,nodeExtent:bt,defaultMarkerColor:tn="#b1b1b7",zoomOnScroll:jt=!0,zoomOnPinch:lo=!0,panOnScroll:Lt=!1,panOnScrollSpeed:xn=.5,panOnScrollMode:Mn=Po.Free,zoomOnDoubleClick:Dn=!0,panOnDrag:nn=!0,onPaneClick:sn,onPaneMouseEnter:Wt,onPaneMouseMove:co,onPaneMouseLeave:rs,onPaneScroll:ga,onPaneContextMenu:uo,children:va,onEdgeContextMenu:Lr,onEdgeDoubleClick:xc,onEdgeMouseEnter:bc,onEdgeMouseMove:xi,onEdgeMouseLeave:bi,onEdgeUpdate:wc,onEdgeUpdateStart:Df,onEdgeUpdateEnd:gr,onReconnect:Pt,onReconnectStart:Kt,onReconnectEnd:ya,reconnectRadius:wi=10,edgeUpdaterRadius:Of=10,onNodesChange:kf,onEdgesChange:Sc,noDragClassName:fo="nodrag",noWheelClassName:Si="nowheel",noPanClassName:Pr="nopan",fitView:xa=!1,fitViewOptions:ho,connectOnClick:ba=!0,attributionPosition:_t,proOptions:Ec,defaultEdgeOptions:Nc,elevateNodesOnSelect:Ur=!0,elevateEdgesOnSelect:wa=!1,disableKeyboardA11y:Cc=!1,autoPanOnConnect:jc=!0,autoPanOnNodeDrag:_c=!0,connectionRadius:zf=20,isValidConnection:as,onError:os,style:Wn,id:ss,nodeDragThreshold:Ac,...Sa},Ei)=>{const mo=ss||"1";return ae.createElement("div",{...Sa,style:{...Wn,...qB},ref:Ei,className:Xt(["react-flow",i]),"data-testid":"rf__wrapper",id:ss},ae.createElement(O2,null,ae.createElement(PB,{onInit:h,onMove:g,onMoveStart:v,onMoveEnd:b,onNodeClick:f,onEdgeClick:m,onNodeMouseEnter:j,onNodeMouseMove:A,onNodeMouseLeave:M,onNodeContextMenu:O,onNodeDoubleClick:U,nodeTypes:l,edgeTypes:u,connectionLineType:T,connectionLineStyle:I,connectionLineComponent:X,connectionLineContainerStyle:Z,selectionKeyCode:fe,selectionOnDrag:ue,selectionMode:se,deleteKeyCode:re,multiSelectionKeyCode:pe,panActivationKeyCode:me,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Ye,selectNodesOnDrag:We,defaultViewport:Ct,translateExtent:pa,minZoom:zr,maxZoom:Xn,preventScrolling:yn,zoomOnScroll:jt,zoomOnPinch:lo,zoomOnDoubleClick:Dn,panOnScroll:Lt,panOnScrollSpeed:xn,panOnScrollMode:Mn,panOnDrag:nn,onPaneClick:sn,onPaneMouseEnter:Wt,onPaneMouseMove:co,onPaneMouseLeave:rs,onPaneScroll:ga,onPaneContextMenu:uo,onSelectionContextMenu:D,onSelectionStart:q,onSelectionEnd:B,onEdgeContextMenu:Lr,onEdgeDoubleClick:xc,onEdgeMouseEnter:bc,onEdgeMouseMove:xi,onEdgeMouseLeave:bi,onReconnect:Pt??wc,onReconnectStart:Kt??Df,onReconnectEnd:ya??gr,reconnectRadius:wi??Of,defaultMarkerColor:tn,noDragClassName:fo,noWheelClassName:Si,noPanClassName:Pr,elevateEdgesOnSelect:wa,rfId:mo,disableKeyboardA11y:Cc,nodeOrigin:de,nodeExtent:bt}),ae.createElement(kU,{nodes:e,edges:t,defaultNodes:r,defaultEdges:o,onConnect:w,onConnectStart:E,onConnectEnd:S,onClickConnectStart:N,onClickConnectEnd:C,nodesDraggable:Je,nodesConnectable:mt,nodesFocusable:he,edgesFocusable:Te,edgesUpdatable:Ke,elementsSelectable:Le,elevateNodesOnSelect:Ur,minZoom:zr,maxZoom:Xn,nodeExtent:bt,onNodesChange:kf,onEdgesChange:Sc,snapToGrid:Ee,snapGrid:Se,connectionMode:L,translateExtent:pa,connectOnClick:ba,defaultEdgeOptions:Nc,fitView:xa,fitViewOptions:ho,onNodesDelete:z,onEdgesDelete:F,onNodeDragStart:H,onNodeDrag:V,onNodeDragStop:P,onSelectionDrag:k,onSelectionDragStart:te,onSelectionDragStop:Y,noPanClassName:Pr,nodeOrigin:de,rfId:mo,autoPanOnConnect:jc,autoPanOnNodeDrag:_c,onError:os,connectionRadius:zf,isValidConnection:as,nodeDragThreshold:Ac}),ae.createElement(DU,{onSelectionChange:K}),va,ae.createElement(iU,{proOptions:Ec,position:_t}),ae.createElement(BU,{rfId:mo,disableKeyboardA11y:Cc})))});k2.displayName="ReactFlow";function z2(e){return t=>{const[r,o]=x.useState(t),i=x.useCallback(l=>o(u=>e(l,u)),[]);return[r,o,i]}}const YB=z2(b2),GB=z2(JU),L2=({id:e,x:t,y:r,width:o,height:i,style:l,color:u,strokeColor:f,strokeWidth:m,className:h,borderRadius:g,shapeRendering:v,onClick:b,selected:w})=>{const{background:E,backgroundColor:S}=l||{},N=u||E||S;return ae.createElement("rect",{className:Xt(["react-flow__minimap-node",{selected:w},h]),x:t,y:r,rx:g,ry:g,width:o,height:i,fill:N,stroke:f,strokeWidth:m,shapeRendering:v,onClick:b?C=>b(C,e):void 0})};L2.displayName="MiniMapNode";var FB=x.memo(L2);const XB=e=>e.nodeOrigin,WB=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Sp=e=>e instanceof Function?e:()=>e;function KB({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:r="",nodeBorderRadius:o=5,nodeStrokeWidth:i=2,nodeComponent:l=FB,onClick:u}){const f=dt(WB,Vt),m=dt(XB),h=Sp(t),g=Sp(e),v=Sp(r),b=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ae.createElement(ae.Fragment,null,f.map(w=>{const{x:E,y:S}=Ho(w,m).positionAbsolute;return ae.createElement(l,{key:w.id,x:E,y:S,width:w.width,height:w.height,style:w.style,selected:w.selected,className:v(w),color:h(w),borderRadius:o,strokeColor:g(w),strokeWidth:i,shapeRendering:b,onClick:u,id:w.id})}))}var ZB=x.memo(KB);const QB=200,JB=150,eH=e=>{const t=e.getNodes(),r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:t.length>0?uU(Af(t,e.nodeOrigin),r):r,rfId:e.rfId}},tH="react-flow__minimap-desc";function P2({style:e,className:t,nodeStrokeColor:r="transparent",nodeColor:o="#e2e2e2",nodeClassName:i="",nodeBorderRadius:l=5,nodeStrokeWidth:u=2,nodeComponent:f,maskColor:m="rgb(240, 240, 240, 0.6)",maskStrokeColor:h="none",maskStrokeWidth:g=1,position:v="bottom-right",onClick:b,onNodeClick:w,pannable:E=!1,zoomable:S=!1,ariaLabel:N="React Flow mini map",inversePan:C=!1,zoomStep:j=10,offsetScale:A=5}){const M=zt(),O=x.useRef(null),{boundingRect:U,viewBB:H,rfId:V}=dt(eH,Vt),P=(e==null?void 0:e.width)??QB,z=(e==null?void 0:e.height)??JB,F=U.width/P,K=U.height/z,te=Math.max(F,K),k=te*P,Y=te*z,D=A*te,q=U.x-(k-U.width)/2-D,B=U.y-(Y-U.height)/2-D,L=k+D*2,T=Y+D*2,I=`${tH}-${V}`,X=x.useRef(0);X.current=te,x.useEffect(()=>{if(O.current){const fe=In(O.current),ue=pe=>{const{transform:ge,d3Selection:Ee,d3Zoom:Se}=M.getState();if(pe.sourceEvent.type!=="wheel"||!Ee||!Se)return;const Ye=-pe.sourceEvent.deltaY*(pe.sourceEvent.deltaMode===1?.05:pe.sourceEvent.deltaMode?1:.002)*j,We=ge[2]*Math.pow(2,Ye);Se.scaleTo(Ee,We)},se=pe=>{const{transform:ge,d3Selection:Ee,d3Zoom:Se,translateExtent:Ye,width:We,height:Je}=M.getState();if(pe.sourceEvent.type!=="mousemove"||!Ee||!Se)return;const mt=X.current*Math.max(1,ge[2])*(C?-1:1),he={x:ge[0]-pe.sourceEvent.movementX*mt,y:ge[1]-pe.sourceEvent.movementY*mt},de=[[0,0],[We,Je]],Te=oa.translate(he.x,he.y).scale(ge[2]),Ke=Se.constrain()(Te,de,Ye);Se.transform(Ee,Ke)},me=$C().on("zoom",E?se:null).on("zoom.wheel",S?ue:null);return fe.call(me),()=>{fe.on("zoom",null)}}},[E,S,C,j]);const Z=b?fe=>{const ue=er(fe);b(fe,{x:ue[0],y:ue[1]})}:void 0,re=w?(fe,ue)=>{const se=M.getState().nodeInternals.get(ue);w(fe,se)}:void 0;return ae.createElement(iv,{position:v,style:e,className:Xt(["react-flow__minimap",t]),"data-testid":"rf__minimap"},ae.createElement("svg",{width:P,height:z,viewBox:`${q} ${B} ${L} ${T}`,role:"img","aria-labelledby":I,ref:O,onClick:Z},N&&ae.createElement("title",{id:I},N),ae.createElement(ZB,{onClick:re,nodeColor:o,nodeStrokeColor:r,nodeBorderRadius:l,nodeClassName:i,nodeStrokeWidth:u,nodeComponent:f}),ae.createElement("path",{className:"react-flow__minimap-mask",d:`M${q-D},${B-D}h${L+D*2}v${T+D*2}h${-L-D*2}z
        M${H.x},${H.y}h${H.width}v${H.height}h${-H.width}z`,fill:m,fillRule:"evenodd",stroke:h,strokeWidth:g,pointerEvents:"none"})))}P2.displayName="MiniMap";var nH=x.memo(P2);function rH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ae.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function aH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ae.createElement("path",{d:"M0 0h32v4.2H0z"}))}function oH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ae.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function sH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function iH(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const zl=({children:e,className:t,...r})=>ae.createElement("button",{type:"button",className:Xt(["react-flow__controls-button",t]),...r},e);zl.displayName="ControlButton";const lH=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),U2=({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:o=!0,fitViewOptions:i,onZoomIn:l,onZoomOut:u,onFitView:f,onInteractiveChange:m,className:h,children:g,position:v="bottom-left"})=>{const b=zt(),[w,E]=x.useState(!1),{isInteractive:S,minZoomReached:N,maxZoomReached:C}=dt(lH,Vt),{zoomIn:j,zoomOut:A,fitView:M}=gv();if(x.useEffect(()=>{E(!0)},[]),!w)return null;const O=()=>{j(),l==null||l()},U=()=>{A(),u==null||u()},H=()=>{M(i),f==null||f()},V=()=>{b.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),m==null||m(!S)};return ae.createElement(iv,{className:Xt(["react-flow__controls",h]),position:v,style:e,"data-testid":"rf__controls"},t&&ae.createElement(ae.Fragment,null,ae.createElement(zl,{onClick:O,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:C},ae.createElement(rH,null)),ae.createElement(zl,{onClick:U,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:N},ae.createElement(aH,null))),r&&ae.createElement(zl,{className:"react-flow__controls-fitview",onClick:H,title:"fit view","aria-label":"fit view"},ae.createElement(oH,null)),o&&ae.createElement(zl,{className:"react-flow__controls-interactive",onClick:V,title:"toggle interactivity","aria-label":"toggle interactivity"},S?ae.createElement(iH,null):ae.createElement(sH,null)),g)};U2.displayName="Controls";var cH=x.memo(U2),ir;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ir||(ir={}));function uH({color:e,dimensions:t,lineWidth:r}){return ae.createElement("path",{stroke:e,strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function dH({color:e,radius:t}){return ae.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const fH={[ir.Dots]:"#91919a",[ir.Lines]:"#eee",[ir.Cross]:"#e2e2e2"},hH={[ir.Dots]:1,[ir.Lines]:1,[ir.Cross]:6},mH=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function B2({id:e,variant:t=ir.Dots,gap:r=20,size:o,lineWidth:i=1,offset:l=2,color:u,style:f,className:m}){const h=x.useRef(null),{transform:g,patternId:v}=dt(mH,Vt),b=u||fH[t],w=o||hH[t],E=t===ir.Dots,S=t===ir.Cross,N=Array.isArray(r)?r:[r,r],C=[N[0]*g[2]||1,N[1]*g[2]||1],j=w*g[2],A=S?[j,j]:C,M=E?[j/l,j/l]:[A[0]/l,A[1]/l];return ae.createElement("svg",{className:Xt(["react-flow__background",m]),style:{...f,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:h,"data-testid":"rf__background"},ae.createElement("pattern",{id:v+e,x:g[0]%C[0],y:g[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`},E?ae.createElement(dH,{color:b,radius:j/l}):ae.createElement(uH,{dimensions:A,color:b,lineWidth:i})),ae.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${v+e})`}))}B2.displayName="Background";var pH=x.memo(B2);function Mr({className:e,...t}){return d.jsx("textarea",{"data-slot":"textarea",className:Me("border-input placeholder: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 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const gH=Ig("inline-flex items-center justify-center rounded-md border 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:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent 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:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function ut({className:e,variant:t,asChild:r=!1,...o}){const i=r?RS:"span";return d.jsx(i,{"data-slot":"badge",className:Me(gH({variant:t}),e),...o})}function vH(){const e=an(),[t,r]=x.useState([]),[o,i]=x.useState([]),[l,u]=x.useState(""),[f,m]=x.useState(!1),[h,g]=x.useState({flowId:"New Workflow",description:"Workflow description",groupId:"no-group"}),v="http://localhost:8000/api",b=Tn(),w=Gn(Qe.create());x.useEffect(()=>{Tn()===null&&e("/login"),(async()=>{try{await w.get(`${v}/users/me`,{headers:{Authorization:`Bearer ${b}`}});const{data:A}=await w.get(`${v}/flows`,{headers:{Authorization:`Bearer ${b}`}});r(A);const{data:M}=await w.get(`${v}/groups`,{headers:{Authorization:`Bearer ${b}`}});i(M)}catch(A){console.log(A),e("/login")}})()},[]);const E=async()=>{const j={flowId:h.flowId,description:h.description,groupId:h.groupId},{data:A}=await w.post(`${v}/flows`,j,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`}}),M=[...t,A];r(M),g({flowId:"New Workflow",description:"Workflow description",groupId:"no-group"}),m(!1),e(`/workflow/${j.flowId}`)},S=async j=>{const A=t.filter(M=>M.flowId!==j);await w.delete(`${v}/flows/${j}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`}}),r(A)},N=j=>{if(!j)return"No Group";const A=o.find(M=>M.groupId===j);return A?A.groupId:"Unknown Group"},C=t.filter(j=>j.flowId.toLowerCase().includes(l.toLowerCase())||j.description.toLowerCase().includes(l.toLowerCase())||N(j.groupId).toLowerCase().includes(l.toLowerCase()));return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h1",{className:"text-2xl font-bold",children:"My Workflows"}),d.jsxs(_r,{open:f,onOpenChange:m,children:[d.jsx(ca,{asChild:!0,children:d.jsxs(we,{className:"flex items-center gap-2",children:[d.jsx($l,{className:"h-4 w-4"}),"Create Workflow"]})}),d.jsxs(Ar,{children:[d.jsxs(Tr,{children:[d.jsx(Rr,{children:"Create New Workflow"}),d.jsx(oo,{children:"Configure your new workflow before creating it."})]}),d.jsxs("div",{className:"grid gap-4 py-4",children:[d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"name",className:"text-right",children:"Name"}),d.jsx(Ge,{id:"name",value:h.flowId,onChange:j=>g({...h,flowId:j.target.value}),className:"col-span-3"})]}),d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"description",className:"text-right",children:"Description"}),d.jsx(Mr,{id:"description",value:h.description,onChange:j=>g({...h,description:j.target.value}),className:"col-span-3"})]}),d.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[d.jsx(Xe,{htmlFor:"group",className:"text-right",children:"Group"}),d.jsxs(rr,{value:h.groupId,onValueChange:j=>g({...h,groupId:j}),children:[d.jsx(or,{className:"col-span-3",children:d.jsx(ar,{placeholder:"Select a group"})}),d.jsx(sr,{children:o.map(j=>d.jsx(ct,{value:j.groupId,children:j.groupId},j.groupId))})]})]})]}),d.jsxs(ua,{children:[d.jsx(we,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),d.jsx(we,{onClick:E,children:"Create Workflow"})]})]})]})]}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(Ge,{placeholder:"Search workflows...",className:"pl-10",value:l,onChange:j=>u(j.target.value)})]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:C.map(j=>d.jsxs(Et,{className:"overflow-hidden",children:[d.jsx("div",{className:"h-32 bg-muted flex items-center justify-center cursor-pointer",onClick:()=>e(`/workflow/${j.flowId}`),children:d.jsx("div",{className:"text-center",children:d.jsx("p",{className:"text-xs text-muted-foreground",children:"Click to edit"})})}),d.jsx(Nt,{className:"p-4",children:d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"font-medium truncate",children:j.flowId}),d.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]}),d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>S(j.flowId),children:d.jsx(Wo,{className:"h-4 w-4 text-red-500"})})]})}),d.jsx(hi,{className:"p-4 pt-0 flex justify-between text-xs text-muted-foreground",children:d.jsxs("div",{className:"flex items-center",children:[d.jsx(uc,{className:"mr-1 h-3 w-3"}),d.jsx(ut,{variant:"outline",className:"ml-1 text-xs",children:N(j.groupId)})]})})]},j.flowId))}),C.length===0&&d.jsxs("div",{className:"text-center py-12",children:[d.jsx("p",{className:"text-muted-foreground",children:"No workflows found"}),l&&d.jsx(we,{variant:"link",onClick:()=>u(""),className:"mt-2",children:"Clear search"})]})]})})}function yH(){return d.jsx(vH,{})}function xH(){const e=an(),[t,r]=x.useState([]),[o,i]=x.useState([]),[l,u]=x.useState(""),[f,m]=x.useState(!1),[h,g]=x.useState(!1),[v,b]=x.useState([]),w="http://localhost:8000/api",E=Tn(),S=Gn(Qe.create()),[N,C]=x.useState({deviceId:"",ip:"",deviceType:"router",groupId:""}),[j,A]=x.useState({deviceId:"",connectionType:"ssh",description:"",username:"",password:"",port:22,priority:1,extra:{}});x.useEffect(()=>{const z=async()=>{const{data:te}=await S.get(`${w}/devices`,{headers:{Authorization:`Bearer ${E}`}});r(te)},F=async()=>{const{data:te}=await S.get(`${w}/credentials`,{headers:{Authorization:`Bearer ${E}`}});i(te)};z(),F(),(()=>{try{(async()=>{const{data:k}=await S.get(`${w}/groups`,{headers:{Authorization:`Bearer ${E}`}});b(k.map(Y=>Y.groupId))})()}catch(te){console.error("Error loading data:",te)}})()},[]),console.log(t);const M=t.filter(z=>z.deviceId.toLowerCase().includes(l.toLowerCase())||z.ip.toLowerCase().includes(l.toLowerCase())||z.deviceType.toLowerCase().includes(l.toLowerCase())||z.groupId.toLowerCase().includes(l.toLowerCase()));console.log("filter:"),console.log(M);const O=o.filter(z=>z.deviceId.toLowerCase().includes(l.toLowerCase())||z.connectionType.toLowerCase().includes(l.toLowerCase())||z.description.toLowerCase().includes(l.toLowerCase())||z.username.toLowerCase().includes(l.toLowerCase())),U=async()=>{if(!N.deviceId||!N.ip)return;const z={deviceId:N.deviceId,ip:N.ip,deviceType:N.deviceType||"linux",groupId:N.groupId||"default"};console.log(z);const{data:F}=await S.post(`${w}/devices`,z,{headers:{Authorization:`Bearer ${E}`}}),K=[...t,F];r(K),localStorage.setItem("devices",JSON.stringify(K)),C({deviceId:"",ip:"",deviceType:"router"}),m(!1)},H=async()=>{if(!j.deviceId||!j.username||!j.password)return;const z={deviceId:j.deviceId,connectionType:j.connectionType||"ssh",description:j.description||"",username:j.username,password:j.password,port:j.port||22,priority:j.priority||1,extra:j.extra||{}},{data:F}=await S.post(`${w}/credentials`,z,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${E}`}}),K=[...o,F];i(K),localStorage.setItem("credentials",JSON.stringify(K)),A({deviceId:"",connectionType:"ssh",description:"",username:"",password:"",port:22,priority:1,extra:{}}),g(!1)},V=async(z,F)=>{console.log("device_id"+F),await S.delete(`${w}/devices/${z}/${F}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${E}`}});const K=t.filter(k=>k.deviceId!==F);r(K),localStorage.setItem("devices",JSON.stringify(K));const te=o.filter(k=>!t.find(Y=>Y.deviceId===F&&Y.deviceId===k.deviceId));i(te),localStorage.setItem("credentials",JSON.stringify(te))},P=async z=>{console.log("Deleting"),await S.delete(`${w}/credentials/${z}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${E}`}});const F=o.filter(K=>K.id!==z);i(F),localStorage.setItem("credentials",JSON.stringify(F))};return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold",children:"Devices & Credentials"}),d.jsx("p",{className:"text-muted-foreground",children:"Manage your network devices and access credentials"})]}),d.jsx("div",{className:"flex gap-2",children:d.jsxs(we,{variant:"outline",onClick:()=>e("/devices/sets"),className:"flex items-center gap-2",children:[d.jsx(Il,{className:"h-4 w-4"}),"Device Sets"]})})]}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(Ge,{placeholder:"Search devices and credentials...",className:"pl-10",value:l,onChange:z=>u(z.target.value)})]}),d.jsxs(Wd,{defaultValue:"devices",children:[d.jsxs(Kd,{className:"grid w-full grid-cols-2",children:[d.jsxs(Vo,{value:"devices",className:"flex items-center gap-2",children:[d.jsx(Il,{className:"h-4 w-4"}),"Devices"]}),d.jsxs(Vo,{value:"credentials",className:"flex items-center gap-2",children:[d.jsx(zk,{className:"h-4 w-4"}),"Credentials"]})]}),d.jsxs(qo,{value:"devices",className:"space-y-4 pt-4",children:[d.jsx("div",{className:"flex justify-end",children:d.jsxs(_r,{open:f,onOpenChange:m,children:[d.jsx(ca,{asChild:!0,children:d.jsxs(we,{className:"flex items-center gap-2",children:[d.jsx($l,{className:"h-4 w-4"}),"Add Device"]})}),d.jsxs(Ar,{children:[d.jsxs(Tr,{children:[d.jsx(Rr,{children:"Add New Device"}),d.jsx(oo,{children:"Enter the details for the new device."})]}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"device-id",children:"Device ID"}),d.jsx(Ge,{id:"device-id",value:N.deviceId,onChange:z=>C({...N,deviceId:z.target.value}),placeholder:"e.g., router-01"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"ip",children:"IP"}),d.jsx(Ge,{id:"ip",value:N.ip,onChange:z=>C({...N,ip:z.target.value}),placeholder:"e.g., 192.168.1.1"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"device-type",children:"Device Type"}),d.jsxs(rr,{value:N.deviceType,onValueChange:z=>C({...N,deviceType:z}),children:[d.jsx(or,{id:"device-type",children:d.jsx(ar,{placeholder:"Select device type"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"linux",children:"Linux"}),d.jsx(ct,{value:"huawei",children:"Huawei"}),d.jsx(ct,{value:"juniper",children:"Juniper"}),d.jsx(ct,{value:"gcom",children:"GCOM"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"group",children:"Group"}),d.jsxs(rr,{value:N.groupId,onValueChange:z=>C({...N,groupId:z}),children:[d.jsx(or,{id:"group",children:d.jsx(ar,{placeholder:"Select group"})}),d.jsx(sr,{children:v.map(z=>d.jsx(ct,{value:z,children:z},z))})]})]})]}),d.jsxs(ua,{children:[d.jsx(we,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),d.jsx(we,{onClick:U,children:"Add Device"})]})]})]})}),d.jsx(Et,{children:d.jsx(Nt,{className:"p-0",children:d.jsxs(eo,{children:[d.jsx(to,{children:d.jsxs(yt,{children:[d.jsx(Be,{children:"Device ID"}),d.jsx(Be,{children:"IP"}),d.jsx(Be,{children:"Type"}),d.jsx(Be,{children:"Group"}),d.jsx(Be,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(no,{children:M.length===0?d.jsx(yt,{children:d.jsx(De,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No devices found"})}):M.map(z=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:z.deviceId}),d.jsx(De,{children:z.ip}),d.jsx(De,{className:"capitalize",children:z.deviceType}),d.jsx(De,{children:z.groupId}),d.jsx(De,{children:d.jsx(dC,{children:d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>V(z.groupId,z.deviceId),children:d.jsx(Wo,{className:"h-4 w-4 text-red-500"})})})})]},z.deviceId))})]})})})]}),d.jsxs(qo,{value:"credentials",className:"space-y-4 pt-4",children:[d.jsx("div",{className:"flex justify-end",children:d.jsxs(_r,{open:h,onOpenChange:g,children:[d.jsx(ca,{asChild:!0,children:d.jsxs(we,{className:"flex items-center gap-2",children:[d.jsx($l,{className:"h-4 w-4"}),"Add Credential"]})}),d.jsxs(Ar,{children:[d.jsxs(Tr,{children:[d.jsx(Rr,{children:"Add New Credential"}),d.jsx(oo,{children:"Enter the access credentials for a device."})]}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"credential-device-id",children:"Device ID"}),d.jsxs(rr,{value:j.deviceId,onValueChange:z=>A({...j,deviceId:z}),children:[d.jsx(or,{id:"credential-device-id",children:d.jsx(ar,{placeholder:"Select device"})}),d.jsx(sr,{children:t.map(z=>d.jsxs(ct,{value:z.deviceId,children:[z.deviceId," (",z.ip,")"]},z.deviceId))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"connection-type",children:"Connection Type"}),d.jsxs(rr,{value:j.connectionType,onValueChange:z=>A({...j,connectionType:z}),children:[d.jsx(or,{id:"connection-type",children:d.jsx(ar,{placeholder:"Select connection type"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"ssh",children:"SSH"}),d.jsx(ct,{value:"telnet",children:"Telnet"}),d.jsx(ct,{value:"http",children:"HTTP"}),d.jsx(ct,{value:"https",children:"HTTPS"}),d.jsx(ct,{value:"snmp",children:"SNMP"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"description",children:"Description"}),d.jsx(Ge,{id:"description",value:j.description,onChange:z=>A({...j,description:z.target.value}),placeholder:"e.g., Admin SSH access"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"Username",children:"Username"}),d.jsx(Ge,{id:"username",value:j.username,onChange:z=>A({...j,username:z.target.value}),placeholder:"e.g., admin"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"password",children:"Password"}),d.jsx(Ge,{id:"password",type:"password",value:j.password,onChange:z=>A({...j,password:z.target.value}),placeholder:"Enter password"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"port",children:"Port"}),d.jsx(Ge,{id:"port",type:"number",value:j.port,onChange:z=>A({...j,port:Number.parseInt(z.target.value)})})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"priority",children:"Priority"}),d.jsx(Ge,{id:"priority",type:"number",value:j.priority,onChange:z=>A({...j,priority:Number.parseInt(z.target.value)})})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"extra",children:"Extra (JSON)"}),d.jsx(Mr,{id:"extra",value:JSON.stringify(j.extra,null,2),onChange:z=>{try{const F=JSON.parse(z.target.value);A({...j,extra:F})}catch(F){console.log("error parsing extra field of credential"),console.log(F)}},placeholder:'{"key": "value"}',className:"font-mono"})]})]}),d.jsxs(ua,{children:[d.jsx(we,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),d.jsx(we,{onClick:H,children:"Add Credential"})]})]})]})}),d.jsx(Et,{children:d.jsx(Nt,{className:"p-0",children:d.jsxs(eo,{children:[d.jsx(to,{children:d.jsxs(yt,{children:[d.jsx(Be,{children:"Device ID"}),d.jsx(Be,{children:"Type"}),d.jsx(Be,{children:"Username"}),d.jsx(Be,{children:"Description"}),d.jsx(Be,{children:"Priority"}),d.jsx(Be,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(no,{children:O.length===0?d.jsx(yt,{children:d.jsx(De,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No credentials found"})}):O.map(z=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:z.deviceId}),d.jsx(De,{children:z.connectionType}),d.jsx(De,{children:z.username}),d.jsx(De,{children:z.description}),d.jsx(De,{children:z.priority}),d.jsx(De,{children:d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>P(z.id),children:d.jsx(Wo,{className:"h-4 w-4 text-red-500"})})})]},z.id))})]})})})]})]})]})})}function bH(){return d.jsx(xH,{})}function wH(){const e=an(),[t,r]=x.useState([]),[o,i]=x.useState([]),[l,u]=x.useState([]),[f,m]=x.useState(""),[h,g]=x.useState(!1),[v,b]=x.useState(""),w="http://localhost:8000/api",E=Tn(),S=Gn(Qe.create()),[N,C]=x.useState({deviceSetId:"",description:"",devices:[],groupId:""});x.useEffect(()=>{(async()=>{const F=async()=>{const{data:k}=await S.get(`${w}/device-sets`,{headers:{Authorization:`Bearer ${E}`}});r(k)},K=async()=>{const{data:k}=await S.get(`${w}/groups`,{headers:{Authorization:`Bearer ${E}`}});u(k)},te=async()=>{const{data:k}=await S.get(`${w}/devices`,{headers:{Authorization:`Bearer ${E}`}});i(k)};K(),F(),te()})()},[]);const j=t.filter(z=>z.deviceSetId.toLowerCase().includes(f.toLowerCase())||z.description.toLowerCase().includes(f.toLowerCase())),A=o.filter(z=>v?z.groupId===v:!0),M=z=>{if(console.log("Get group name:"+z),!z)return"No Group";const F=l.find(K=>K.groupId===z);return F?F.groupId:"Unknown Group"},O=z=>{b(z),C({...N,groupId:z,devices:[]})},U=async()=>{if(!N.deviceSetId)return;console.log(N);const{data:z}=await S.post(`${w}/device-sets`,N,{headers:{Authorization:`Bearer ${E}`}}),F=[...t,z];r(F),localStorage.setItem("device_sets",JSON.stringify(F)),C({deviceSetId:"",description:"",devices:[],groupId:""}),b(""),g(!1)},H=z=>{const F=t.filter(K=>K.deviceSetId!==z);r(F),localStorage.setItem("device_sets",JSON.stringify(F))},V=z=>{const F=N.devices||[],K=F.includes(z)?F.filter(te=>te!==z):[...F,z];C({...N,devices:K})},P=z=>{z||(C({description:"",devices:[],groupId:""}),b("")),g(z)};return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold",children:"Device Sets"}),d.jsx("p",{className:"text-muted-foreground",children:"Manage groups of devices for workflow execution"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(we,{variant:"outline",onClick:()=>e("/devices"),className:"flex items-center gap-2",children:[d.jsx(Il,{className:"h-4 w-4"}),"Devices"]}),d.jsxs(_r,{open:h,onOpenChange:P,children:[d.jsx(ca,{asChild:!0,children:d.jsxs(we,{className:"flex items-center gap-2",children:[d.jsx($l,{className:"h-4 w-4"}),"Create Device Set"]})}),d.jsxs(Ar,{className:"max-w-md",children:[d.jsxs(Tr,{children:[d.jsx(Rr,{children:"Create Device Set"}),d.jsx(oo,{children:"Group devices together for workflow execution."})]}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"set-name",children:"Device Set ID"}),d.jsx(Ge,{id:"set-name",value:N.deviceSetId,onChange:z=>C({...N,deviceSetId:z.target.value}),placeholder:"e.g., Production Servers"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"set-description",children:"Description"}),d.jsx(Mr,{id:"set-description",value:N.description,onChange:z=>C({...N,description:z.target.value}),placeholder:"Describe this device set",rows:2})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"group",children:"Group"}),d.jsxs(rr,{value:v,onValueChange:O,children:[d.jsx(or,{id:"group",children:d.jsx(ar,{placeholder:"Select a group"})}),d.jsx(sr,{children:l.length===0?d.jsx(ct,{value:"no-groups",disabled:!0,children:"No groups available"}):l.map(z=>d.jsx(ct,{value:z.groupId,children:z.groupId},z.groupId))})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Select a group to see available devices from that group"})]}),v&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{children:"Select Devices"}),d.jsx("div",{className:"border rounded-md p-2 max-h-60 overflow-y-auto",children:A.length===0?d.jsx("p",{className:"text-sm text-muted-foreground p-2",children:"No devices available in this group"}):d.jsx("div",{className:"space-y-2",children:A.map(z=>d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("input",{type:"checkbox",id:`device-${z.deviceId}`,checked:(N.devices||[]).includes(z.deviceId),onChange:()=>V(z.deviceId),className:"rounded border-gray-300"}),d.jsxs("label",{htmlFor:`device-${z.deviceId}`,className:"text-sm flex-1",children:[z.deviceId," (",z.host,")"]}),d.jsx(ut,{variant:"outline",className:"text-xs",children:z.deviceType})]},z.deviceId))})})]})]}),d.jsxs(ua,{children:[d.jsx(we,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),d.jsx(we,{onClick:U,disabled:!N.deviceSetId||!v||(N.devices||[]).length===0,children:"Create"})]})]})]})]})]}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(Ge,{placeholder:"Search device sets...",className:"pl-10",value:f,onChange:z=>m(z.target.value)})]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:j.map(z=>d.jsxs(Et,{className:"overflow-hidden",children:[d.jsx(fn,{className:"pb-2",children:d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx(hn,{className:"text-lg",children:z.deviceSetId}),d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>H(z.deviceSetId),children:d.jsx(Wo,{className:"h-4 w-4 text-red-500"})})]})}),d.jsxs(Nt,{className:"pb-2",children:[d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:z.description}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[d.jsx(uc,{className:"h-4 w-4 text-muted-foreground"}),d.jsx(ut,{variant:"outline",className:"text-xs",children:M(z.groupId)})]}),d.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[d.jsx(Il,{className:"h-4 w-4 text-muted-foreground"}),d.jsxs("span",{children:[z.devices.length," ",z.devices.length==1?"device":"devices"]})]})]})]}),d.jsx(hi,{className:"pt-2",children:d.jsx(we,{variant:"outline",size:"sm",className:"w-full",onClick:()=>e(`/devices/sets/${z.deviceSetId}`),children:"View Details"})})]},z.deviceSetId))}),j.length===0&&d.jsxs("div",{className:"text-center py-12",children:[d.jsx("p",{className:"text-muted-foreground",children:"No device sets found"}),f&&d.jsx(we,{variant:"link",onClick:()=>m(""),className:"mt-2",children:"Clear search"})]})]})})}function SH(){return d.jsx(wH,{})}function EH({deviceSetId:e}){const t=an(),[r,o]=x.useState(null),[i,l]=x.useState([]),[u,f]=x.useState(""),[m,h]=x.useState(""),[g,v]=x.useState(!1),[b,w]=x.useState(!1),[E,S]=x.useState([]),N="http://localhost:8000/api",C=Tn(),j=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:z}=await j.get(`${N}/device-sets/${e}`,{headers:{Authorization:`Bearer ${C}`}});o(z),S(z.devices);const F=await j.get(`${N}/devices`,{params:{groupId:z.groupId},headers:{Authorization:`Bearer ${C}`}});l(F.data)})()},[e,t]);const A=()=>{if(r)try{const P=localStorage.getItem("device_sets");if(!P)return;const F=JSON.parse(P).map(K=>K.deviceSetId===e?{...K,name:u,description:m}:K);localStorage.setItem("device_sets",JSON.stringify(F)),o({...r,description:m}),v(!1)}catch(P){console.error("Error saving device set:",P)}},M=async()=>{if(r)try{const P=localStorage.getItem("device_sets");if(!P)return;await j.post(`${N}/device-sets/${e}/devices`,{devices:E},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${C}`}});const F=JSON.parse(P).map(K=>K.deviceSetId===e?{...K,devices:E}:K);localStorage.setItem("device_sets",JSON.stringify(F)),o({...r,devices:E}),w(!1)}catch(P){console.error("Error adding devices:",P)}},O=async P=>{if(!r)return;const z=r.devices.filter(K=>K!==P),F={...r,devices:z};await j.post(`${N}/device-sets/${e}/devices`,{devices:z},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${C}`}});try{const K=localStorage.getItem("device_sets");if(!K)return;const k=JSON.parse(K).map(Y=>Y.deviceSetId===e?F:Y);localStorage.setItem("device_sets",JSON.stringify(k)),o(F),S(z)}catch(K){console.error("Error removing device:",K)}},U=P=>{S(z=>z.includes(P)?z.filter(F=>F!==P):[...z,P])},H=async()=>{if(r)try{await j.delete(`${N}/device-sets/${r.deviceSetId}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${C}`}});const P=localStorage.getItem("device_sets");if(!P)return;const F=JSON.parse(P).filter(K=>K.deviceSetId!==e);localStorage.setItem("device_sets",JSON.stringify(F)),t("/devices/sets")}catch(P){console.error("Error deleting device set:",P)}};if(!r)return d.jsx(en,{children:d.jsx("div",{className:"container mx-auto py-6",children:d.jsx("p",{children:"Loading device set details..."})})});const V=i.filter(P=>r.devices.includes(P.deviceId));return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(we,{variant:"ghost",size:"icon",onClick:()=>t("/devices/sets"),children:[d.jsx(cc,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Back to device sets"})]}),d.jsx("div",{className:"flex-1",children:g?d.jsxs("div",{className:"space-y-2",children:[d.jsx(Ge,{value:u,onChange:P=>f(P.target.value),className:"text-xl font-bold h-auto py-1"}),d.jsx(Mr,{value:m,onChange:P=>h(P.target.value),className:"text-sm text-muted-foreground resize-none",rows:2})]}):d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold",children:r.deviceSetId}),d.jsx("p",{className:"text-muted-foreground",children:r.description})]})}),d.jsx("div",{className:"flex gap-2",children:g?d.jsxs(we,{onClick:A,className:"flex items-center gap-2",children:[d.jsx(Lg,{className:"h-4 w-4"}),"Save"]}):d.jsxs(d.Fragment,{children:[d.jsx(we,{variant:"outline",onClick:()=>v(!0),children:"Edit"}),d.jsxs(_r,{children:[d.jsx(ca,{asChild:!0,children:d.jsx(we,{variant:"destructive",children:"Delete"})}),d.jsxs(Ar,{children:[d.jsxs(Tr,{children:[d.jsx(Rr,{children:"Delete Device Set"}),d.jsx(oo,{children:"Are you sure you want to delete this device set? This action cannot be undone."})]}),d.jsxs(ua,{children:[d.jsx(Ml,{children:d.jsx(we,{variant:"outline",children:"Cancel"})}),d.jsx(we,{variant:"destructive",onClick:H,children:"Delete"})]})]})]})]})})]}),d.jsx(Et,{children:d.jsxs(Nt,{className:"p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("h2",{className:"text-lg font-medium",children:["Devices (",r.devices.length,")"]}),d.jsxs(_r,{open:b,onOpenChange:w,children:[d.jsx(ca,{asChild:!0,children:d.jsxs(we,{size:"sm",className:"flex items-center gap-2",children:[d.jsx($l,{className:"h-4 w-4"}),"Add Devices"]})}),d.jsxs(Ar,{children:[d.jsxs(Tr,{children:[d.jsx(Rr,{children:"Add Devices"}),d.jsx(oo,{children:"Select devices to add to this device set."})]}),d.jsx("div",{className:"py-4",children:d.jsx("div",{className:"border rounded-md p-2 max-h-60 overflow-y-auto",children:i.length===0?d.jsx("p",{className:"text-sm text-muted-foreground p-2",children:"No devices available"}):d.jsx("div",{className:"space-y-2",children:i.map(P=>d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("input",{type:"checkbox",id:`device-${P.deviceId}`,checked:E.includes(P.deviceId),onChange:()=>U(P.deviceId),className:"rounded border-gray-300"}),d.jsxs("label",{htmlFor:`device-${P.deviceId}`,className:"text-sm flex-1",children:[P.deviceId," (",P.ip,")"]}),d.jsx(ut,{variant:"outline",className:"text-xs",children:P.deviceType})]},P.deviceId))})})}),d.jsxs(ua,{children:[d.jsx(we,{variant:"outline",onClick:()=>w(!1),children:"Cancel"}),d.jsx(we,{onClick:M,children:"Save"})]})]})]})]}),d.jsxs(eo,{children:[d.jsx(to,{children:d.jsxs(yt,{children:[d.jsx(Be,{children:"Device ID"}),d.jsx(Be,{children:"IP"}),d.jsx(Be,{children:"Type"}),d.jsx(Be,{children:"Group"}),d.jsx(Be,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(no,{children:V.length===0?d.jsx(yt,{children:d.jsx(De,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No devices in this set"})}):V.map(P=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:P.deviceId}),d.jsx(De,{children:P.ip}),d.jsx(De,{className:"capitalize",children:P.deviceType}),d.jsx(De,{children:P.groupId}),d.jsx(De,{children:d.jsxs(we,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>O(P.deviceId),children:[d.jsx(Wo,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Remove"})]})})]},P.deviceId))})]})]})})]})})}function NH(){const e=rc();return d.jsx(EH,{deviceSetId:e.id})}const H2=6048e5,CH=864e5,td=43200,rS=1440,aS=Symbol.for("constructDateFrom");function ha(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&aS in e?e[aS](t):e instanceof Date?new e.constructor(t):new Date(t)}function qt(e,t){return ha(t||e,e)}let jH={};function yc(){return jH}function ec(e,t){var f,m,h,g;const r=yc(),o=(t==null?void 0:t.weekStartsOn)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((g=(h=r.locale)==null?void 0:h.options)==null?void 0:g.weekStartsOn)??0,i=qt(e,t==null?void 0:t.in),l=i.getDay(),u=(l<o?7:0)+l-o;return i.setDate(i.getDate()-u),i.setHours(0,0,0,0),i}function Hd(e,t){return ec(e,{...t,weekStartsOn:1})}function $2(e,t){const r=qt(e,t==null?void 0:t.in),o=r.getFullYear(),i=ha(r,0);i.setFullYear(o+1,0,4),i.setHours(0,0,0,0);const l=Hd(i),u=ha(r,0);u.setFullYear(o,0,4),u.setHours(0,0,0,0);const f=Hd(u);return r.getTime()>=l.getTime()?o+1:r.getTime()>=f.getTime()?o:o-1}function $d(e){const t=qt(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Tf(e,...t){const r=ha.bind(null,t.find(o=>typeof o=="object"));return t.map(r)}function oS(e,t){const r=qt(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function _H(e,t,r){const[o,i]=Tf(r==null?void 0:r.in,e,t),l=oS(o),u=oS(i),f=+l-$d(l),m=+u-$d(u);return Math.round((f-m)/CH)}function AH(e,t){const r=$2(e,t),o=ha(e,0);return o.setFullYear(r,0,4),o.setHours(0,0,0,0),Hd(o)}function gd(e,t){const r=+qt(e)-+qt(t);return r<0?-1:r>0?1:r}function TH(e){return ha(e,Date.now())}function RH(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function MH(e){return!(!RH(e)&&typeof e!="number"||isNaN(+qt(e)))}function DH(e,t,r){const[o,i]=Tf(r==null?void 0:r.in,e,t),l=o.getFullYear()-i.getFullYear(),u=o.getMonth()-i.getMonth();return l*12+u}function OH(e){return t=>{const r=Math.trunc,o=r(t);return o===0?0:o}}function kH(e,t){return+qt(e)-+qt(t)}function zH(e,t){const r=qt(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function LH(e,t){const r=qt(e,t==null?void 0:t.in),o=r.getMonth();return r.setFullYear(r.getFullYear(),o+1,0),r.setHours(23,59,59,999),r}function PH(e,t){const r=qt(e,t==null?void 0:t.in);return+zH(r,t)==+LH(r,t)}function UH(e,t,r){const[o,i,l]=Tf(r==null?void 0:r.in,e,e,t),u=gd(i,l),f=Math.abs(DH(i,l));if(f<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-u*f);let m=gd(i,l)===-u;PH(o)&&f===1&&gd(o,l)===1&&(m=!1);const h=u*(f-+m);return h===0?0:h}function BH(e,t,r){const o=kH(e,t)/1e3;return OH()(o)}function HH(e,t){const r=qt(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const $H={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IH=(e,t,r)=>{let o;const i=$H[e];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};function Ep(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const VH={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qH={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},YH={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GH={date:Ep({formats:VH,defaultWidth:"full"}),time:Ep({formats:qH,defaultWidth:"full"}),dateTime:Ep({formats:YH,defaultWidth:"full"})},FH={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},XH=(e,t,r,o)=>FH[e];function _l(e){return(t,r)=>{const o=r!=null&&r.context?String(r.context):"standalone";let i;if(o==="formatting"&&e.formattingValues){const u=e.defaultFormattingWidth||e.defaultWidth,f=r!=null&&r.width?String(r.width):u;i=e.formattingValues[f]||e.formattingValues[u]}else{const u=e.defaultWidth,f=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[f]||e.values[u]}const l=e.argumentCallback?e.argumentCallback(t):t;return i[l]}}const WH={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},KH={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ZH={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},QH={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},JH={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},e$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},t$=(e,t)=>{const r=Number(e),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},n$={ordinalNumber:t$,era:_l({values:WH,defaultWidth:"wide"}),quarter:_l({values:KH,defaultWidth:"wide",argumentCallback:e=>e-1}),month:_l({values:ZH,defaultWidth:"wide"}),day:_l({values:QH,defaultWidth:"wide"}),dayPeriod:_l({values:JH,defaultWidth:"wide",formattingValues:e$,defaultFormattingWidth:"wide"})};function Al(e){return(t,r={})=>{const o=r.width,i=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],l=t.match(i);if(!l)return null;const u=l[0],f=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(f)?a$(f,v=>v.test(u)):r$(f,v=>v.test(u));let h;h=e.valueCallback?e.valueCallback(m):m,h=r.valueCallback?r.valueCallback(h):h;const g=t.slice(u.length);return{value:h,rest:g}}}function r$(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function a$(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function o$(e){return(t,r={})=>{const o=t.match(e.matchPattern);if(!o)return null;const i=o[0],l=t.match(e.parsePattern);if(!l)return null;let u=e.valueCallback?e.valueCallback(l[0]):l[0];u=r.valueCallback?r.valueCallback(u):u;const f=t.slice(i.length);return{value:u,rest:f}}}const s$=/^(\d+)(th|st|nd|rd)?/i,i$=/\d+/i,l$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},c$={any:[/^b/i,/^(a|c)/i]},u$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},d$={any:[/1/i,/2/i,/3/i,/4/i]},f$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},h$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},m$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},p$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},g$={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},v$={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},y$={ordinalNumber:o$({matchPattern:s$,parsePattern:i$,valueCallback:e=>parseInt(e,10)}),era:Al({matchPatterns:l$,defaultMatchWidth:"wide",parsePatterns:c$,defaultParseWidth:"any"}),quarter:Al({matchPatterns:u$,defaultMatchWidth:"wide",parsePatterns:d$,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Al({matchPatterns:f$,defaultMatchWidth:"wide",parsePatterns:h$,defaultParseWidth:"any"}),day:Al({matchPatterns:m$,defaultMatchWidth:"wide",parsePatterns:p$,defaultParseWidth:"any"}),dayPeriod:Al({matchPatterns:g$,defaultMatchWidth:"any",parsePatterns:v$,defaultParseWidth:"any"})},I2={code:"en-US",formatDistance:IH,formatLong:GH,formatRelative:XH,localize:n$,match:y$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function x$(e,t){const r=qt(e,t==null?void 0:t.in);return _H(r,HH(r))+1}function b$(e,t){const r=qt(e,t==null?void 0:t.in),o=+Hd(r)-+AH(r);return Math.round(o/H2)+1}function V2(e,t){var g,v,b,w;const r=qt(e,t==null?void 0:t.in),o=r.getFullYear(),i=yc(),l=(t==null?void 0:t.firstWeekContainsDate)??((v=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??i.firstWeekContainsDate??((w=(b=i.locale)==null?void 0:b.options)==null?void 0:w.firstWeekContainsDate)??1,u=ha((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,l),u.setHours(0,0,0,0);const f=ec(u,t),m=ha((t==null?void 0:t.in)||e,0);m.setFullYear(o,0,l),m.setHours(0,0,0,0);const h=ec(m,t);return+r>=+f?o+1:+r>=+h?o:o-1}function w$(e,t){var f,m,h,g;const r=yc(),o=(t==null?void 0:t.firstWeekContainsDate)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(h=r.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,i=V2(e,t),l=ha((t==null?void 0:t.in)||e,0);return l.setFullYear(i,0,o),l.setHours(0,0,0,0),ec(l,t)}function S$(e,t){const r=qt(e,t==null?void 0:t.in),o=+ec(r,t)-+w$(r,t);return Math.round(o/H2)+1}function rt(e,t){const r=e<0?"-":"",o=Math.abs(e).toString().padStart(t,"0");return r+o}const Fa={y(e,t){const r=e.getFullYear(),o=r>0?r:1-r;return rt(t==="yy"?o%100:o,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):rt(r+1,2)},d(e,t){return rt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return rt(e.getHours()%12||12,t.length)},H(e,t){return rt(e.getHours(),t.length)},m(e,t){return rt(e.getMinutes(),t.length)},s(e,t){return rt(e.getSeconds(),t.length)},S(e,t){const r=t.length,o=e.getMilliseconds(),i=Math.trunc(o*Math.pow(10,r-3));return rt(i,t.length)}},Xs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sS={G:function(e,t,r){const o=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const o=e.getFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Fa.y(e,t)},Y:function(e,t,r,o){const i=V2(e,o),l=i>0?i:1-i;if(t==="YY"){const u=l%100;return rt(u,2)}return t==="Yo"?r.ordinalNumber(l,{unit:"year"}):rt(l,t.length)},R:function(e,t){const r=$2(e);return rt(r,t.length)},u:function(e,t){const r=e.getFullYear();return rt(r,t.length)},Q:function(e,t,r){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return rt(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,r){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return rt(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,r){const o=e.getMonth();switch(t){case"M":case"MM":return Fa.M(e,t);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,r){const o=e.getMonth();switch(t){case"L":return String(o+1);case"LL":return rt(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,r,o){const i=S$(e,o);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):rt(i,t.length)},I:function(e,t,r){const o=b$(e);return t==="Io"?r.ordinalNumber(o,{unit:"week"}):rt(o,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Fa.d(e,t)},D:function(e,t,r){const o=x$(e);return t==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):rt(o,t.length)},E:function(e,t,r){const o=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,r,o){const i=e.getDay(),l=(i-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return rt(l,2);case"eo":return r.ordinalNumber(l,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,o){const i=e.getDay(),l=(i-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return rt(l,t.length);case"co":return r.ordinalNumber(l,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const o=e.getDay(),i=o===0?7:o;switch(t){case"i":return String(i);case"ii":return rt(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const o=e.getHours();let i;switch(o===12?i=Xs.noon:o===0?i=Xs.midnight:i=o/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const o=e.getHours();let i;switch(o>=17?i=Xs.evening:o>=12?i=Xs.afternoon:o>=4?i=Xs.morning:i=Xs.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let o=e.getHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Fa.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Fa.H(e,t)},K:function(e,t,r){const o=e.getHours()%12;return t==="Ko"?r.ordinalNumber(o,{unit:"hour"}):rt(o,t.length)},k:function(e,t,r){let o=e.getHours();return o===0&&(o=24),t==="ko"?r.ordinalNumber(o,{unit:"hour"}):rt(o,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fa.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Fa.s(e,t)},S:function(e,t){return Fa.S(e,t)},X:function(e,t,r){const o=e.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return lS(o);case"XXXX":case"XX":return Oo(o);case"XXXXX":case"XXX":default:return Oo(o,":")}},x:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"x":return lS(o);case"xxxx":case"xx":return Oo(o);case"xxxxx":case"xxx":default:return Oo(o,":")}},O:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+iS(o,":");case"OOOO":default:return"GMT"+Oo(o,":")}},z:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+iS(o,":");case"zzzz":default:return"GMT"+Oo(o,":")}},t:function(e,t,r){const o=Math.trunc(+e/1e3);return rt(o,t.length)},T:function(e,t,r){return rt(+e,t.length)}};function iS(e,t=""){const r=e>0?"-":"+",o=Math.abs(e),i=Math.trunc(o/60),l=o%60;return l===0?r+String(i):r+String(i)+t+rt(l,2)}function lS(e,t){return e%60===0?(e>0?"-":"+")+rt(Math.abs(e)/60,2):Oo(e,t)}function Oo(e,t=""){const r=e>0?"-":"+",o=Math.abs(e),i=rt(Math.trunc(o/60),2),l=rt(o%60,2);return r+i+t+l}const cS=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},q2=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},E$=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return cS(e,t);let l;switch(o){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",cS(o,t)).replace("{{time}}",q2(i,t))},N$={p:q2,P:E$},C$=/^D+$/,j$=/^Y+$/,_$=["D","DD","YY","YYYY"];function A$(e){return C$.test(e)}function T$(e){return j$.test(e)}function R$(e,t,r){const o=M$(e,t,r);if(console.warn(o),_$.includes(e))throw new RangeError(o)}function M$(e,t,r){const o=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const D$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,O$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,k$=/^'([^]*?)'?$/,z$=/''/g,L$=/[a-zA-Z]/;function Id(e,t,r){var g,v,b,w;const o=yc(),i=o.locale??I2,l=o.firstWeekContainsDate??((v=(g=o.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??1,u=o.weekStartsOn??((w=(b=o.locale)==null?void 0:b.options)==null?void 0:w.weekStartsOn)??0,f=qt(e,r==null?void 0:r.in);if(!MH(f))throw new RangeError("Invalid time value");let m=t.match(O$).map(E=>{const S=E[0];if(S==="p"||S==="P"){const N=N$[S];return N(E,i.formatLong)}return E}).join("").match(D$).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const S=E[0];if(S==="'")return{isToken:!1,value:P$(E)};if(sS[S])return{isToken:!0,value:E};if(S.match(L$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:E}});i.localize.preprocessor&&(m=i.localize.preprocessor(f,m));const h={firstWeekContainsDate:l,weekStartsOn:u,locale:i};return m.map(E=>{if(!E.isToken)return E.value;const S=E.value;(T$(S)||A$(S))&&R$(S,t,String(e));const N=sS[S[0]];return N(f,S,i.localize,h)}).join("")}function P$(e){const t=e.match(k$);return t?t[1].replace(z$,"'"):e}function U$(e,t,r){const o=yc(),i=(r==null?void 0:r.locale)??o.locale??I2,l=2520,u=gd(e,t);if(isNaN(u))throw new RangeError("Invalid time value");const f=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:u}),[m,h]=Tf(r==null?void 0:r.in,...u>0?[t,e]:[e,t]),g=BH(h,m),v=($d(h)-$d(m))/1e3,b=Math.round((g-v)/60);let w;if(b<2)return b===0?i.formatDistance("lessThanXMinutes",1,f):i.formatDistance("xMinutes",b,f);if(b<45)return i.formatDistance("xMinutes",b,f);if(b<90)return i.formatDistance("aboutXHours",1,f);if(b<rS){const E=Math.round(b/60);return i.formatDistance("aboutXHours",E,f)}else{if(b<l)return i.formatDistance("xDays",1,f);if(b<td){const E=Math.round(b/rS);return i.formatDistance("xDays",E,f)}else if(b<td*2)return w=Math.round(b/td),i.formatDistance("aboutXMonths",w,f)}if(w=UH(h,m),w<12){const E=Math.round(b/td);return i.formatDistance("xMonths",E,f)}else{const E=w%12,S=Math.trunc(w/12);return E<3?i.formatDistance("aboutXYears",S,f):E<9?i.formatDistance("overXYears",S,f):i.formatDistance("almostXYears",S+1,f)}}function ug(e,t){return U$(e,TH(e),t)}function B$(){const e=an(),[t,r]=x.useState([]),[o,i]=x.useState(""),l="http://localhost:8000/api",u=Tn(),f=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:b}=await f.get(`${l}/flow-runs`,{headers:{Authorization:`Bearer ${u}`}});r(b),localStorage.setItem("flowRuns",JSON.stringify(b))})()},[]);const m=t.filter(v=>v.flowId.toLowerCase().includes(o.toLowerCase())||v.deviceSetId.toLowerCase().includes(o.toLowerCase())||v.state.toLowerCase().includes(o.toLowerCase())),h=v=>{switch(console.log("status badge "+v),v){case"running":return d.jsx(ut,{className:"bg-blue-500",children:"Running"});case"finished":return d.jsx(ut,{className:"bg-green-500",children:"Completed"});case"submitted":return d.jsx(ut,{className:"bg-yellow-500",children:"Submitted"});default:return d.jsx(ut,{className:"bg-gray-500",children:"Unknown"})}},g=v=>{switch(v){case"running":return d.jsx(nr,{className:"h-4 w-4 text-blue-500"});case"finished":return d.jsx(Nd,{className:"h-4 w-4 text-green-500"});case"submitted":return d.jsx(nr,{className:"h-4 w-4 text-yellow-500"});default:return d.jsx(Ed,{className:"h-4 w-4 text-gray-500"})}};return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h1",{className:"text-2xl font-bold",children:"Workflow FlowRuns"})}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(Ge,{placeholder:"Search flowRuns...",className:"pl-10",value:o,onChange:v=>i(v.target.value)})]}),d.jsx(Et,{children:d.jsx(Nt,{className:"p-0",children:d.jsxs(eo,{children:[d.jsx(to,{children:d.jsxs(yt,{children:[d.jsx(Be,{children:"Status"}),d.jsx(Be,{children:"Workflow"}),d.jsx(Be,{children:"Device Set"}),d.jsx(Be,{children:"Started"}),d.jsx(Be,{children:"Duration"}),d.jsx(Be,{children:"Devices"}),d.jsx(Be,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(no,{children:m.length===0?d.jsx(yt,{children:d.jsx(De,{colSpan:7,className:"text-center py-4 text-muted-foreground",children:"No flowRuns found"})}):m.map(v=>d.jsxs(yt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>e(`/executions/${v.flowRunId}`),children:[d.jsx(De,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[g(v.state),h(v.state)]})}),d.jsx(De,{className:"font-medium",children:v.flowId}),d.jsx(De,{children:v.deviceSetId}),d.jsxs(De,{children:[ug(new Date(v.startTime))," ago"]}),d.jsx(De,{children:v.endTime?`${Math.round((new Date(v.endTime).getTime()-new Date(v.startTime).getTime())/1e3/60)} min`:"Running..."}),d.jsxs(De,{children:[v.deviceRuns.length," device",v.deviceRuns.length!==1?"s":""]}),d.jsx(De,{children:d.jsx(we,{variant:"outline",size:"sm",onClick:b=>{b.stopPropagation(),e(`/executions/${v.flowRunId}`)},children:"View Details"})})]},v.flowRunId))})]})})})]})})}function H$(){return d.jsx(B$,{})}function $$({flowRunId:e}){const t=an(),[r,o]=x.useState(null),[i,l]=x.useState({});x.useEffect(()=>{const g=()=>{try{const b=localStorage.getItem("flowRuns");if(!b){t("/executions");return}const E=JSON.parse(b).find(S=>S.flowRunId===e);E?o(E):t("/executions")}catch(b){console.error("Error loading flowRun:",b),t("/executions")}},v=()=>{try{const b=localStorage.getItem("devices");if(b){const w=JSON.parse(b),E={};w.forEach(S=>{E[S.device_id]=S}),l(E)}}catch(b){console.error("Error loading devices:",b)}};g(),v()},[e,t]);const u=g=>{switch(g){case"queued":return d.jsx(ut,{className:"bg-yellow-500",children:"Queued"});case"running":return d.jsx(ut,{className:"bg-blue-500",children:"Running"});case"success":return d.jsx(ut,{className:"bg-green-500",children:"Completed"});case"failed":return d.jsx(ut,{className:"bg-red-500",children:"Failed"});default:return d.jsx(ut,{className:"bg-gray-500",children:"Unknown"})}},f=g=>{switch(g){case"submitted":return d.jsx(ut,{className:"bg-yellow-500",children:"Submitted"});case"running":return d.jsx(ut,{className:"bg-blue-500",children:"Running"});case"finished":return d.jsx(ut,{className:"bg-green-500",children:"Finished"});default:return d.jsx(ut,{className:"bg-gray-500",children:"Unknown"})}},m=g=>{switch(console.log("status icon "+g),g){case"running":return d.jsx(nr,{className:"h-4 w-4 text-blue-500"});case"finished":return d.jsx(Nd,{className:"h-4 w-4 text-green-500"});case"submitted":return d.jsx(nr,{className:"h-4 w-4 text-yellow-500"});default:return d.jsx(Ed,{className:"h-4 w-4 text-gray-500"})}},h=g=>{switch(g){case"queued":return d.jsx(nr,{className:"h-4 w-4 text-yellow-500"});case"running":return d.jsx(nr,{className:"h-4 w-4 text-blue-500"});case"success":return d.jsx(Nd,{className:"h-4 w-4 text-green-500"});case"failed":return d.jsx(bE,{className:"h-4 w-4 text-red-500"});default:return d.jsx(Ed,{className:"h-4 w-4 text-gray-500"})}};return r?d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(we,{variant:"ghost",size:"icon",onClick:()=>t("/executions"),children:[d.jsx(cc,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Back to flowRuns"})]}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[m(r.state),r.flowId,f(r.state)]}),d.jsxs("p",{className:"text-muted-foreground",children:["FlowRun started ",ug(new Date(r.startTime))," ago",r.endTime&&` and took ${Math.round((new Date(r.endTime).getTime()-new Date(r.startTime).getTime())/1e3/60)} minutes`]})]})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[d.jsxs(Et,{children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-sm font-medium",children:"Workflow"})}),d.jsxs(Nt,{children:[d.jsx("p",{children:r.flowId}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID: ",r.flowId]})]})]}),d.jsxs(Et,{children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-sm font-medium",children:"Device Set"})}),d.jsxs(Nt,{children:[d.jsx("p",{children:r.deviceSetId}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID: ",r.deviceSetId]})]})]}),d.jsxs(Et,{children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-sm font-medium",children:"Status"})}),d.jsxs(Nt,{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[m(r.state),d.jsx("span",{children:r.state.charAt(0).toUpperCase()+r.state.slice(1)})]}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[r.deviceRuns.filter(g=>g.state==="queued").length," queued,"," ",r.deviceRuns.filter(g=>g.state==="success").length," success,"," ",r.deviceRuns.filter(g=>g.state==="running").length," running,"," ",r.deviceRuns.filter(g=>g.state==="failed").length," failed"]})]})]}),d.jsxs(Et,{children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-sm font-medium",children:"Parameters"})}),d.jsx(Nt,{children:r.args&&Object.keys(r.args).length>0?d.jsx("div",{className:"space-y-1",children:Object.entries(r.args).map(([g,v])=>d.jsxs("div",{className:"flex justify-between text-sm",children:[d.jsxs("span",{className:"font-medium",children:[g,":"]}),d.jsx("span",{className:"text-muted-foreground",children:typeof v=="boolean"?v?"Yes":"No":String(v)})]},g))}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"No parameters used"})})]})]}),d.jsxs(Et,{children:[d.jsx(fn,{children:d.jsx(hn,{children:"Device Runs"})}),d.jsx(Nt,{className:"p-0",children:r.deviceRuns.length===0?"No device runs found":d.jsxs(eo,{children:[d.jsx(to,{children:d.jsxs(yt,{children:[d.jsx(Be,{children:"Status"}),d.jsx(Be,{children:"Device"}),d.jsx(Be,{children:"Host"}),d.jsx(Be,{children:"Started"}),d.jsx(Be,{children:"Duration"}),d.jsx(Be,{className:"w-[100px]",children:"Actions"})]})}),d.jsx(no,{children:r.deviceRuns.map(g=>{var v;return d.jsxs(yt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>t(`/executions/${r==null?void 0:r.flowRunId}/${g.id}`),children:[d.jsx(De,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[h(g.state),u(g.state)]})}),d.jsx(De,{className:"font-medium",children:g.deviceId}),d.jsx(De,{children:((v=i[g.deviceId])==null?void 0:v.host)||"Unknown"}),d.jsxs(De,{children:[ug(new Date(g.actualStartTime))," ago"]}),d.jsx(De,{children:g.endTime?`${Math.round((new Date(g.endTime).getTime()-new Date(g.actualStartTime).getTime())/1e3/60)} min`:"Running..."}),d.jsx(De,{children:d.jsx(we,{variant:"outline",size:"sm",onClick:b=>{b.stopPropagation(),t(`/executions/${r==null?void 0:r.flowRunId}/${g.id}`)},children:"View Logs"})})]},g.id)})})]})})]})]})}):d.jsx(en,{children:d.jsx("div",{className:"container mx-auto py-6",children:d.jsx("p",{children:"Loading flowRun details..."})})})}function I$(){const e=rc();return d.jsx($$,{flowRunId:e.id})}function V$({flowRunId:e,deviceRunId:t}){const r=an(),[o,i]=x.useState(null),[l,u]=x.useState(null),[f,m]=x.useState(null);x.useEffect(()=>{(()=>{try{const w=localStorage.getItem("flowRuns");if(!w){r("/executions");return}const S=JSON.parse(w).find(j=>j.flowRunId===e);if(!S){r("/executions");return}i(S);const N=S.deviceRuns.find(j=>j.id.toString()===t);if(!N){r(`/executions/${e}`);return}u(N);const C=localStorage.getItem("devices");if(C){const A=JSON.parse(C).find(M=>M.device_id===N.deviceId);A&&m(A)}}catch(w){console.log(w),r("/login")}})()},[e,t,r]);const h=b=>{switch(b){case"queued":return d.jsx(ut,{className:"bg-yellow-500",children:"Queued"});case"running":return d.jsx(ut,{className:"bg-blue-500",children:"Running"});case"success":return d.jsx(ut,{className:"bg-green-500",children:"Success"});case"failed":return d.jsx(ut,{className:"bg-red-500",children:"Failed"});default:return d.jsx(ut,{className:"bg-gray-500",children:"Unknown"})}},g=b=>{switch(b){case"queued":return d.jsx(nr,{className:"h-4 w-4 text-yellow-500"});case"running":return d.jsx(nr,{className:"h-4 w-4 text-blue-500"});case"success":return d.jsx(Nd,{className:"h-4 w-4 text-green-500"});case"failed":return d.jsx(bE,{className:"h-4 w-4 text-red-500"});default:return d.jsx(Ed,{className:"h-4 w-4 text-gray-500"})}},v=b=>{switch(b){case"info":return d.jsx(op,{className:"h-4 w-4 text-blue-500"});case"warning":return d.jsx(Vb,{className:"h-4 w-4 text-yellow-500"});case"error":return d.jsx(Ib,{className:"h-4 w-4 text-red-500"});default:return d.jsx(op,{className:"h-4 w-4 text-gray-500"})}};return!o||!l?d.jsx(en,{children:d.jsx("div",{className:"container mx-auto py-6",children:d.jsx("p",{children:"Loading device run details..."})})}):d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(we,{variant:"ghost",size:"icon",onClick:()=>r(`/executions/${e}`),children:[d.jsx(cc,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Back to flowRun"})]}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[g(l.state),l.deviceId,h(l.state)]}),d.jsx("p",{className:"text-muted-foreground",children:f?`${f.host} (${f.device_type})`:l.deviceId})]})]}),d.jsx(Et,{children:d.jsxs(Nt,{className:"p-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-lg font-medium",children:"Device Run Logs"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(op,{className:"h-4 w-4 text-blue-500"}),d.jsx("span",{className:"text-xs",children:"Info"})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Vb,{className:"h-4 w-4 text-yellow-500"}),d.jsx("span",{className:"text-xs",children:"Warning"})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Ib,{className:"h-4 w-4 text-red-500"}),d.jsx("span",{className:"text-xs",children:"Error"})]})]})]}),d.jsxs("div",{className:"border rounded-md overflow-hidden",children:[d.jsx("div",{className:"bg-muted p-2 text-xs font-mono",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{children:["Device: ",l.deviceId]}),d.jsxs("span",{children:["Started: ",Id(new Date(l.actualStartTime),"yyyy-MM-dd HH:mm:ss")]})]})}),d.jsxs("div",{className:"p-4 max-h-[500px] overflow-y-auto font-mono text-sm",children:[l.logs.map((b,w)=>d.jsxs("div",{className:`flex items-start gap-2 p-1 rounded ${b.level==="error"?"bg-red-50":b.level==="warning"?"bg-yellow-50":""}`,children:[d.jsx("div",{className:"pt-0.5",children:v(b.level)}),d.jsx("div",{className:"flex-1",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs text-muted-foreground"}),d.jsx("span",{children:b.message})]})})]},w)),l.state==="running"&&d.jsxs("div",{className:"flex items-center gap-2 p-1 animate-pulse",children:[d.jsx(nr,{className:"h-4 w-4 text-blue-500"}),d.jsx("span",{children:"FlowRun in progress..."})]})]}),d.jsx("div",{className:"bg-muted p-2 text-xs font-mono",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{children:["Status: ",l.state.toUpperCase()]}),d.jsx("span",{children:l.endTime?`Ended: ${Id(new Date(l.endTime),"yyyy-MM-dd HH:mm:ss")}`:"Running..."})]})})]})]})})]})})}function q$(){const e=rc();return d.jsx(V$,{flowRunId:e.id,deviceRunId:e.deviceRunId})}function Y$(){const e=an(),[t,r]=x.useState([]),[o,i]=x.useState(""),l="http://localhost:8000/api",u=Tn(),f=Gn(Qe.create());x.useEffect(()=>{(async()=>{const{data:g}=await f.get(`${l}/groups`,{headers:{Authorization:`Bearer ${u}`}});r(g),localStorage.setItem("groups",JSON.stringify(g))})()},[]);const m=t.filter(h=>h.groupId.toLowerCase().includes(o.toLowerCase())||h.description.toLowerCase().includes(o.toLowerCase()));return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h1",{className:"text-2xl font-bold",children:"My Groups"})}),d.jsxs("div",{className:"relative",children:[d.jsx(es,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(Ge,{placeholder:"Search groups...",className:"pl-10",value:o,onChange:h=>i(h.target.value)})]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.map(h=>d.jsxs(Et,{className:"overflow-hidden",children:[d.jsx(fn,{className:"pb-2",children:d.jsx(hn,{className:"text-lg",children:h.groupId})}),d.jsxs(Nt,{className:"pb-2",children:[d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:h.description}),d.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[d.jsx(uc,{className:"h-4 w-4 text-muted-foreground"}),d.jsxs("span",{children:[h.members.length," members"]})]})]}),d.jsxs(hi,{className:"flex justify-between items-center pt-2",children:[d.jsxs("div",{className:"flex gap-1",children:[h.members.some(g=>g.role==="admin")&&d.jsx(ut,{variant:"outline",className:"text-xs",children:"Admin"}),h.members.some(g=>g.role==="operator")&&d.jsx(ut,{variant:"outline",className:"text-xs",children:"Operator"})]}),d.jsx(we,{variant:"outline",size:"sm",onClick:()=>e(`/groups/${h.groupId}`),children:"View Details"})]})]},h.groupId))}),m.length===0&&d.jsxs("div",{className:"text-center py-12",children:[d.jsx("p",{className:"text-muted-foreground",children:"No groups found"}),o&&d.jsx(we,{variant:"link",onClick:()=>i(""),className:"mt-2",children:"Clear search"})]})]})})}function G$(){return d.jsx(Y$,{})}function F$({groupId:e}){const t=an(),[r,o]=x.useState(null),[i,l]=x.useState([]),u="http://localhost:8000/api",f=Tn(),m=Gn(Qe.create());return x.useEffect(()=>{(()=>{try{(async()=>{const{data:v}=await m.get(`${u}/groups/${e}`,{headers:{Authorization:`Bearer ${f}`}});o(v);const{data:b}=await m.get(`${u}/groups/${e}/members`,{headers:{Authorization:`Bearer ${f}`}});l(b)})()}catch(g){console.error("Error loading group:",g),t("/groups")}})()},[e,t,f,m]),r?d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs(we,{variant:"ghost",size:"icon",onClick:()=>t("/groups"),children:[d.jsx(cc,{className:"h-5 w-5"}),d.jsx("span",{className:"sr-only",children:"Back to groups"})]}),d.jsx("div",{className:"flex-1",children:d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold",children:r.groupId}),d.jsx("p",{className:"text-muted-foreground",children:r.description})]})})]}),d.jsx(Et,{children:d.jsxs(Nt,{className:"p-6",children:[d.jsx("div",{className:"flex items-center justify-between mb-4",children:d.jsxs("h2",{className:"text-lg font-medium",children:["Members (",r.members.length,")"]})}),d.jsxs(eo,{children:[d.jsx(to,{children:d.jsxs(yt,{children:[d.jsx(Be,{children:"Name"}),d.jsx(Be,{children:"Email"}),d.jsx(Be,{children:"Role"})]})}),d.jsx(no,{children:i.map(h=>d.jsxs(yt,{children:[d.jsx(De,{className:"font-medium",children:h.name}),d.jsx(De,{children:h.email}),d.jsx(De,{children:d.jsx(ut,{variant:h.role==="admin"||h.isSuperuser?"default":"outline",children:h.isSuperuser?"Superuser":h.role==="admin"?"Administrator":"Operator"})})]},h.id))})]})]})})]})}):d.jsx(en,{children:d.jsx("div",{className:"container mx-auto py-6",children:d.jsx("p",{children:"Loading group details..."})})})}function X$(){const e=rc();return d.jsx(F$,{groupId:e.id})}const W$=Ig("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Y2({className:e,variant:t,...r}){return d.jsx("div",{"data-slot":"alert",role:"alert",className:Me(W$({variant:t}),e),...r})}function G2({className:e,...t}){return d.jsx("div",{"data-slot":"alert-description",className:Me("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function K$(){const e=an(),[t,r]=x.useState(""),[o,i]=x.useState(""),[l,u]=x.useState(""),[f,m]=x.useState(!1),h=async g=>{g.preventDefault(),m(!0),u("");try{await xz(t,o),e("/dashboard")}catch(v){u(v instanceof Error?v.message:"Failed to login")}finally{m(!1)}};return d.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:d.jsxs(Et,{className:"w-full max-w-md",children:[d.jsxs(fn,{children:[d.jsx(hn,{className:"text-2xl",children:"Login"}),d.jsx(Yo,{children:"Enter your credentials to access your account"})]}),d.jsxs("form",{onSubmit:h,children:[d.jsxs(Nt,{className:"space-y-4",children:[l&&d.jsx(Y2,{variant:"destructive",children:d.jsx(G2,{children:l})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"email",children:"Email"}),d.jsx(Ge,{id:"email",type:"email",placeholder:"m@example.com",value:t,onChange:g=>r(g.target.value),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"password",children:"Password"}),d.jsx(Ge,{id:"password",type:"password",value:o,onChange:g=>i(g.target.value),required:!0})]})]}),d.jsxs(hi,{className:"flex flex-col space-y-4",children:[d.jsx(we,{type:"submit",className:"w-full",disabled:f,children:f?"Logging in...":"Login"}),d.jsxs("div",{className:"text-center text-sm",children:["Don't have an account?"," ",d.jsx(Za,{to:"/register",className:"text-primary hover:underline",children:"Register"})]})]})]})]})})}function Z$(){const e=an(),[t,r]=x.useState(""),[o,i]=x.useState(""),[l,u]=x.useState(""),[f,m]=x.useState(""),[h,g]=x.useState(""),[v,b]=x.useState(!1),w=async E=>{if(E.preventDefault(),b(!0),g(""),l!==f){g("Passwords do not match"),b(!1);return}try{await yz(t,o,l),e("/login?registered=true")}catch(S){g(S instanceof Error?S.message:"Failed to register")}finally{b(!1)}};return d.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:d.jsxs(Et,{className:"w-full max-w-md",children:[d.jsxs(fn,{children:[d.jsx(hn,{className:"text-2xl",children:"Register"}),d.jsx(Yo,{children:"Create a new account to get started"})]}),d.jsxs("form",{onSubmit:w,children:[d.jsxs(Nt,{className:"space-y-4",children:[h&&d.jsx(Y2,{variant:"destructive",children:d.jsx(G2,{children:h})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"name",children:"Full Name"}),d.jsx(Ge,{id:"name",placeholder:"John Doe",value:t,onChange:E=>r(E.target.value),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"email",children:"Email"}),d.jsx(Ge,{id:"email",type:"email",placeholder:"m@example.com",value:o,onChange:E=>i(E.target.value),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"password",children:"Password"}),d.jsx(Ge,{id:"password",type:"password",value:l,onChange:E=>u(E.target.value),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"confirm-password",children:"Confirm Password"}),d.jsx(Ge,{id:"confirm-password",type:"password",value:f,onChange:E=>m(E.target.value),required:!0})]})]}),d.jsxs(hi,{className:"flex flex-col space-y-4",children:[d.jsx(we,{type:"submit",className:"w-full",disabled:v,children:v?"Registering...":"Register"}),d.jsxs("div",{className:"text-center text-sm",children:["Already have an account?"," ",d.jsx(Za,{to:"/login",className:"text-primary hover:underline",children:"Login"})]})]})]})]})})}var Q$=fC();function J$(){return Q$.useSyncExternalStore(eI,()=>!0,()=>!1)}function eI(){return()=>{}}var yv="Avatar",[tI,x9]=fr(yv),[nI,F2]=tI(yv),X2=x.forwardRef((e,t)=>{const{__scopeAvatar:r,...o}=e,[i,l]=x.useState("idle");return d.jsx(nI,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:l,children:d.jsx(Ae.span,{...o,ref:t})})});X2.displayName=yv;var W2="AvatarImage",K2=x.forwardRef((e,t)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:i=()=>{},...l}=e,u=F2(W2,r),f=rI(o,l),m=It(h=>{i(h),u.onImageLoadingStatusChange(h)});return Mt(()=>{f!=="idle"&&m(f)},[f,m]),f==="loaded"?d.jsx(Ae.img,{...l,ref:t,src:o}):null});K2.displayName=W2;var Z2="AvatarFallback",Q2=x.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:o,...i}=e,l=F2(Z2,r),[u,f]=x.useState(o===void 0);return x.useEffect(()=>{if(o!==void 0){const m=window.setTimeout(()=>f(!0),o);return()=>window.clearTimeout(m)}},[o]),u&&l.imageLoadingStatus!=="loaded"?d.jsx(Ae.span,{...i,ref:t}):null});Q2.displayName=Z2;function uS(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function rI(e,{referrerPolicy:t,crossOrigin:r}){const o=J$(),i=x.useRef(null),l=o?(i.current||(i.current=new window.Image),i.current):null,[u,f]=x.useState(()=>uS(l,e));return Mt(()=>{f(uS(l,e))},[l,e]),Mt(()=>{const m=v=>()=>{f(v)};if(!l)return;const h=m("loaded"),g=m("error");return l.addEventListener("load",h),l.addEventListener("error",g),t&&(l.referrerPolicy=t),typeof r=="string"&&(l.crossOrigin=r),()=>{l.removeEventListener("load",h),l.removeEventListener("error",g)}},[l,r,t]),u}var aI=X2,oI=K2,sI=Q2;function iI({className:e,...t}){return d.jsx(aI,{"data-slot":"avatar",className:Me("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function lI({className:e,...t}){return d.jsx(oI,{"data-slot":"avatar-image",className:Me("aspect-square size-full",e),...t})}function cI({className:e,...t}){return d.jsx(sI,{"data-slot":"avatar-fallback",className:Me("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function uI(){const e="http://localhost:8000/api",t=Tn(),r=Gn(Qe.create()),[o,i]=x.useState(null),[l,u]=x.useState({name:"",email:""});x.useEffect(()=>{(async()=>{const{data:g}=await r.get(`${e}/users/me`,{headers:{Authorization:`Bearer ${t}`}});i(g),u({name:g.name,email:g.email})})()},[]);const f=h=>{const{name:g,value:v}=h.target;u({...l,[g]:v})},m=async h=>{if(o===null){console.log("User is null");return}h.preventDefault(),await r.patch(`${e}/users/${o.id}`,{name:l.name,email:l.email},{headers:{Authorization:`Bearer ${t}`}}),i({...o,name:l.name,email:l.email}),alert("Profile updated successfully!")};return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6 space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h1",{className:"text-2xl font-bold",children:"User Profile"})}),d.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[d.jsxs(Et,{className:"md:w-80",children:[d.jsxs(fn,{children:[d.jsx("div",{className:"flex justify-center",children:d.jsxs(iI,{className:"h-24 w-24",children:[d.jsx(lI,{src:"/placeholder.svg?height=96&width=96",alt:o==null?void 0:o.name}),d.jsx(cI,{children:o==null?void 0:o.name.split(" ").map(h=>h[0]).join("")})]})}),d.jsx(hn,{className:"text-center mt-2",children:o==null?void 0:o.name}),d.jsx(Yo,{className:"text-center",children:o==null?void 0:o.email})]}),d.jsxs(Nt,{className:"space-y-2",children:[d.jsx("div",{className:"flex justify-center",children:d.jsxs(ut,{variant:"outline",className:"flex items-center gap-1",children:[d.jsx(Cd,{className:"h-3 w-3"}),o!=null&&o.isSuperuser?"Superuser":(o==null?void 0:o.role)==="admin"?"Administrator":"Operator"]})}),d.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["Member since ",new Date().getFullYear()-2]})]})]}),d.jsx("div",{className:"flex-1",children:d.jsxs(Wd,{defaultValue:"profile",className:"w-full",children:[d.jsx(Kd,{className:"grid w-full grid-cols-1",children:d.jsxs(Vo,{value:"profile",className:"flex items-center gap-2",children:[d.jsx(Cd,{className:"h-4 w-4"}),"Profile"]})}),d.jsx(qo,{value:"profile",className:"space-y-4 pt-4",children:d.jsx(Et,{children:d.jsxs("form",{onSubmit:m,children:[d.jsxs(fn,{children:[d.jsx(hn,{children:"Profile Information"}),d.jsx(Yo,{children:"Update your account information"})]}),d.jsxs(Nt,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"name",children:"Full Name"}),d.jsx(Ge,{id:"name",name:"name",value:l.name,onChange:f})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"email",children:"Email"}),d.jsx(Ge,{id:"email",name:"email",type:"email",value:l.email,onChange:f})]})]}),d.jsx(hi,{children:d.jsxs(we,{type:"submit",className:"flex items-center gap-2 mt-2",children:[d.jsx(Lg,{className:"h-4 w-4"}),"Save Changes"]})})]})})})]})})]})]})})}function dI(){return d.jsx(uI,{})}function fI(){return d.jsx(en,{children:d.jsxs("div",{className:"container mx-auto py-6",children:[d.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Settings"}),d.jsx("div",{className:"bg-muted/50 p-12 rounded-lg text-center",children:d.jsx("p",{className:"text-muted-foreground",children:"Settings page (placeholder)"})})]})})}function hI(e,t){return x.useReducer((r,o)=>t[r][o]??r,e)}var xv="ScrollArea",[J2,b9]=fr(xv),[mI,Fn]=J2(xv),ej=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:o="hover",dir:i,scrollHideDelay:l=600,...u}=e,[f,m]=x.useState(null),[h,g]=x.useState(null),[v,b]=x.useState(null),[w,E]=x.useState(null),[S,N]=x.useState(null),[C,j]=x.useState(0),[A,M]=x.useState(0),[O,U]=x.useState(!1),[H,V]=x.useState(!1),P=qe(t,F=>m(F)),z=sc(i);return d.jsx(mI,{scope:r,type:o,dir:z,scrollHideDelay:l,scrollArea:f,viewport:h,onViewportChange:g,content:v,onContentChange:b,scrollbarX:w,onScrollbarXChange:E,scrollbarXEnabled:O,onScrollbarXEnabledChange:U,scrollbarY:S,onScrollbarYChange:N,scrollbarYEnabled:H,onScrollbarYEnabledChange:V,onCornerWidthChange:j,onCornerHeightChange:M,children:d.jsx(Ae.div,{dir:z,...u,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});ej.displayName=xv;var tj="ScrollAreaViewport",nj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:o,nonce:i,...l}=e,u=Fn(tj,r),f=x.useRef(null),m=qe(t,f,u.onViewportChange);return d.jsxs(d.Fragment,{children:[d.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:i}),d.jsx(Ae.div,{"data-radix-scroll-area-viewport":"",...l,ref:m,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:d.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});nj.displayName=tj;var kr="ScrollAreaScrollbar",rj=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,i=Fn(kr,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:u}=i,f=e.orientation==="horizontal";return x.useEffect(()=>(f?l(!0):u(!0),()=>{f?l(!1):u(!1)}),[f,l,u]),i.type==="hover"?d.jsx(pI,{...o,ref:t,forceMount:r}):i.type==="scroll"?d.jsx(gI,{...o,ref:t,forceMount:r}):i.type==="auto"?d.jsx(aj,{...o,ref:t,forceMount:r}):i.type==="always"?d.jsx(bv,{...o,ref:t}):null});rj.displayName=kr;var pI=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,i=Fn(kr,e.__scopeScrollArea),[l,u]=x.useState(!1);return x.useEffect(()=>{const f=i.scrollArea;let m=0;if(f){const h=()=>{window.clearTimeout(m),u(!0)},g=()=>{m=window.setTimeout(()=>u(!1),i.scrollHideDelay)};return f.addEventListener("pointerenter",h),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(m),f.removeEventListener("pointerenter",h),f.removeEventListener("pointerleave",g)}}},[i.scrollArea,i.scrollHideDelay]),d.jsx(vn,{present:r||l,children:d.jsx(aj,{"data-state":l?"visible":"hidden",...o,ref:t})})}),gI=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,i=Fn(kr,e.__scopeScrollArea),l=e.orientation==="horizontal",u=Mf(()=>m("SCROLL_END"),100),[f,m]=hI("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 x.useEffect(()=>{if(f==="idle"){const h=window.setTimeout(()=>m("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(h)}},[f,i.scrollHideDelay,m]),x.useEffect(()=>{const h=i.viewport,g=l?"scrollLeft":"scrollTop";if(h){let v=h[g];const b=()=>{const w=h[g];v!==w&&(m("SCROLL"),u()),v=w};return h.addEventListener("scroll",b),()=>h.removeEventListener("scroll",b)}},[i.viewport,l,m,u]),d.jsx(vn,{present:r||f!=="hidden",children:d.jsx(bv,{"data-state":f==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:ve(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:ve(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),aj=x.forwardRef((e,t)=>{const r=Fn(kr,e.__scopeScrollArea),{forceMount:o,...i}=e,[l,u]=x.useState(!1),f=e.orientation==="horizontal",m=Mf(()=>{if(r.viewport){const h=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;u(f?h:g)}},10);return ii(r.viewport,m),ii(r.content,m),d.jsx(vn,{present:o||l,children:d.jsx(bv,{"data-state":l?"visible":"hidden",...i,ref:t})})}),bv=x.forwardRef((e,t)=>{const{orientation:r="vertical",...o}=e,i=Fn(kr,e.__scopeScrollArea),l=x.useRef(null),u=x.useRef(0),[f,m]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=cj(f.viewport,f.content),g={...o,sizes:f,onSizesChange:m,hasThumb:h>0&&h<1,onThumbChange:b=>l.current=b,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:b=>u.current=b};function v(b,w){return SI(b,u.current,f,w)}return r==="horizontal"?d.jsx(vI,{...g,ref:t,onThumbPositionChange:()=>{if(i.viewport&&l.current){const b=i.viewport.scrollLeft,w=dS(b,f,i.dir);l.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:b=>{i.viewport&&(i.viewport.scrollLeft=b)},onDragScroll:b=>{i.viewport&&(i.viewport.scrollLeft=v(b,i.dir))}}):r==="vertical"?d.jsx(yI,{...g,ref:t,onThumbPositionChange:()=>{if(i.viewport&&l.current){const b=i.viewport.scrollTop,w=dS(b,f);l.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:b=>{i.viewport&&(i.viewport.scrollTop=b)},onDragScroll:b=>{i.viewport&&(i.viewport.scrollTop=v(b))}}):null}),vI=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:o,...i}=e,l=Fn(kr,e.__scopeScrollArea),[u,f]=x.useState(),m=x.useRef(null),h=qe(t,m,l.onScrollbarXChange);return x.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),d.jsx(sj,{"data-orientation":"horizontal",...i,ref:h,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Rf(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(l.viewport){const b=l.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),dj(b,v)&&g.preventDefault()}},onResize:()=>{m.current&&l.viewport&&u&&o({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:qd(u.paddingLeft),paddingEnd:qd(u.paddingRight)}})}})}),yI=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:o,...i}=e,l=Fn(kr,e.__scopeScrollArea),[u,f]=x.useState(),m=x.useRef(null),h=qe(t,m,l.onScrollbarYChange);return x.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),d.jsx(sj,{"data-orientation":"vertical",...i,ref:h,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Rf(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(l.viewport){const b=l.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),dj(b,v)&&g.preventDefault()}},onResize:()=>{m.current&&l.viewport&&u&&o({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:qd(u.paddingTop),paddingEnd:qd(u.paddingBottom)}})}})}),[xI,oj]=J2(kr),sj=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:o,hasThumb:i,onThumbChange:l,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:h,onWheelScroll:g,onResize:v,...b}=e,w=Fn(kr,r),[E,S]=x.useState(null),N=qe(t,P=>S(P)),C=x.useRef(null),j=x.useRef(""),A=w.viewport,M=o.content-o.viewport,O=It(g),U=It(m),H=Mf(v,10);function V(P){if(C.current){const z=P.clientX-C.current.left,F=P.clientY-C.current.top;h({x:z,y:F})}}return x.useEffect(()=>{const P=z=>{const F=z.target;(E==null?void 0:E.contains(F))&&O(z,M)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[A,E,M,O]),x.useEffect(U,[o,U]),ii(E,H),ii(w.content,H),d.jsx(xI,{scope:r,scrollbar:E,hasThumb:i,onThumbChange:It(l),onThumbPointerUp:It(u),onThumbPositionChange:U,onThumbPointerDown:It(f),children:d.jsx(Ae.div,{...b,ref:N,style:{position:"absolute",...b.style},onPointerDown:ve(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=E.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",w.viewport&&(w.viewport.style.scrollBehavior="auto"),V(P))}),onPointerMove:ve(e.onPointerMove,V),onPointerUp:ve(e.onPointerUp,P=>{const z=P.target;z.hasPointerCapture(P.pointerId)&&z.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=j.current,w.viewport&&(w.viewport.style.scrollBehavior=""),C.current=null})})})}),Vd="ScrollAreaThumb",ij=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,i=oj(Vd,e.__scopeScrollArea);return d.jsx(vn,{present:r||i.hasThumb,children:d.jsx(bI,{ref:t,...o})})}),bI=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:o,...i}=e,l=Fn(Vd,r),u=oj(Vd,r),{onThumbPositionChange:f}=u,m=qe(t,v=>u.onThumbChange(v)),h=x.useRef(void 0),g=Mf(()=>{h.current&&(h.current(),h.current=void 0)},100);return x.useEffect(()=>{const v=l.viewport;if(v){const b=()=>{if(g(),!h.current){const w=EI(v,f);h.current=w,f()}};return f(),v.addEventListener("scroll",b),()=>v.removeEventListener("scroll",b)}},[l.viewport,g,f]),d.jsx(Ae.div,{"data-state":u.hasThumb?"visible":"hidden",...i,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:ve(e.onPointerDownCapture,v=>{const w=v.target.getBoundingClientRect(),E=v.clientX-w.left,S=v.clientY-w.top;u.onThumbPointerDown({x:E,y:S})}),onPointerUp:ve(e.onPointerUp,u.onThumbPointerUp)})});ij.displayName=Vd;var wv="ScrollAreaCorner",lj=x.forwardRef((e,t)=>{const r=Fn(wv,e.__scopeScrollArea),o=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&o?d.jsx(wI,{...e,ref:t}):null});lj.displayName=wv;var wI=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,...o}=e,i=Fn(wv,r),[l,u]=x.useState(0),[f,m]=x.useState(0),h=!!(l&&f);return ii(i.scrollbarX,()=>{var v;const g=((v=i.scrollbarX)==null?void 0:v.offsetHeight)||0;i.onCornerHeightChange(g),m(g)}),ii(i.scrollbarY,()=>{var v;const g=((v=i.scrollbarY)==null?void 0:v.offsetWidth)||0;i.onCornerWidthChange(g),u(g)}),h?d.jsx(Ae.div,{...o,ref:t,style:{width:l,height:f,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function qd(e){return e?parseInt(e,10):0}function cj(e,t){const r=e/t;return isNaN(r)?0:r}function Rf(e){const t=cj(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-r)*t;return Math.max(o,18)}function SI(e,t,r,o="ltr"){const i=Rf(r),l=i/2,u=t||l,f=i-u,m=r.scrollbar.paddingStart+u,h=r.scrollbar.size-r.scrollbar.paddingEnd-f,g=r.content-r.viewport,v=o==="ltr"?[0,g]:[g*-1,0];return uj([m,h],v)(e)}function dS(e,t,r="ltr"){const o=Rf(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-i,u=t.content-t.viewport,f=l-o,m=r==="ltr"?[0,u]:[u*-1,0],h=Rp(e,m);return uj([0,u],[0,f])(h)}function uj(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}function dj(e,t){return e>0&&e<t}var EI=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},o=0;return function i(){const l={left:e.scrollLeft,top:e.scrollTop},u=r.left!==l.left,f=r.top!==l.top;(u||f)&&t(),r=l,o=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(o)};function Mf(e,t){const r=It(e),o=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(o.current),[]),x.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,t)},[r,t])}function ii(e,t){const r=It(t);Mt(()=>{let o=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(o),i.unobserve(e)}}},[e,r])}var NI=ej,CI=nj,jI=lj;function _I({className:e,children:t,...r}){return d.jsxs(NI,{"data-slot":"scroll-area",className:Me("relative",e),...r,children:[d.jsx(CI,{"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}),d.jsx(AI,{}),d.jsx(jI,{})]})}function AI({className:e,orientation:t="vertical",...r}){return d.jsx(rj,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Me("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:d.jsx(ij,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const TI=[{name:"Operations",items:[{type:"operation",name:"Decision",icon:wE,description:"Route based on multiple conditions",inputs:[{id:"in-1",label:"Input"}],outputs:[{id:"out-1",label:"True"},{id:"out-2",label:"False"}],config:{condition:""}}]},{name:"Connection",items:[{type:"connection",name:"Connect",icon:SE,description:"Connect to a remote system",inputs:[{id:"in-1",label:"Input"}],outputs:[{id:"out-1",label:"Output"}],config:{connectionType:"SSH"}},{type:"connection",name:"Command",icon:EE,description:"Execute a command on connected system",inputs:[{id:"in-1",label:"Input"}],outputs:[{id:"out-1",label:"Output"}],config:{command:""}},{type:"connection",name:"Disconnect",icon:zg,description:"Disconnect from remote system",inputs:[{id:"in-1",label:"Input"}],outputs:[{id:"out-1",label:"Output"}],config:{}}]}];function RI({onAddNode:e}){return d.jsxs("div",{className:"w-64 border-r bg-muted/40",children:[d.jsxs("div",{className:"p-4 border-b",children:[d.jsx("h2",{className:"font-medium",children:"Nodes"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Drag nodes to the canvas"})]}),d.jsx(_I,{className:"h-[calc(100vh-10rem)]",children:d.jsx("div",{className:"p-4 space-y-6",children:TI.map(t=>d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-medium mb-2",children:t.name}),d.jsx("div",{className:"space-y-1",children:t.items.map(r=>d.jsxs(we,{variant:"ghost",className:"w-full justify-start text-sm px-2 py-1 h-auto",onClick:()=>e(r.type,{label:r.name,description:r.description,inputs:r.inputs,outputs:r.outputs,config:r.config}),children:[d.jsx(r.icon,{className:"h-4 w-4 mr-2"}),r.name]},r.name))})]},t.name))})})]})}const fS={trigger:CE,schedule:nr,webhook:c4,filter:Tk,split:n4,decision:wE,"send email":Hk,database:Ck,"http request":Ek,"send message":qk,"create document":_k,connect:SE,command:EE,disconnect:zg},MI=(e,t)=>{const r=t.toLowerCase();return fS[e]||fS[r]||CE},DI={trigger:"bg-amber-100 border-amber-300",operation:"bg-sky-100 border-sky-300",action:"bg-emerald-100 border-emerald-300",connection:"bg-purple-100 border-purple-300"},OI=({data:e,isConnectable:t})=>{const r=MI(e.type,e.label),o=DI[e.type]||"bg-gray-100 border-gray-300";return d.jsxs("div",{className:`rounded-md border-2 shadow-sm ${o} p-3 min-w-[180px]`,children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(r,{className:"h-5 w-5"}),d.jsx("div",{className:"font-medium text-sm",children:e.label})]}),e.inputs&&e.inputs.map((i,l)=>d.jsx(si,{type:"target",position:Ce.Left,id:i.id||`input-${l}`,className:"w-3 h-3 bg-blue-500",style:{top:30+l*20},isConnectable:t},i.id||`input-${l}`)),e.outputs&&e.outputs.map((i,l)=>d.jsx(si,{type:"source",position:Ce.Right,id:i.id||`output-${l}`,className:"w-3 h-3 bg-blue-500",style:{top:30+l*20},isConnectable:t},i.id||`output-${l}`)),e.description&&d.jsx("div",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},kI=x.memo(OI);function zI({config:e,updateConfig:t}){return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"email-to",className:"text-xs font-medium block",children:"To:"}),d.jsx(Ge,{id:"email-to",type:"email",value:e.to||"",onChange:r=>t("to",r.target.value),className:"h-8 text-xs",placeholder:"recipient@example.com"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"email-subject",className:"text-xs font-medium block",children:"Subject:"}),d.jsx(Ge,{id:"email-subject",type:"text",value:e.subject||"",onChange:r=>t("subject",r.target.value),className:"h-8 text-xs",placeholder:"Email subject"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"email-body",className:"text-xs font-medium block",children:"Body:"}),d.jsx(Mr,{id:"email-body",value:e.body||"",onChange:r=>t("body",r.target.value),className:"text-xs min-h-[120px] resize-none",placeholder:"Email content..."})]})]})}function LI({config:e,updateConfig:t}){return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"request-url",className:"text-xs font-medium block",children:"URL:"}),d.jsx(Ge,{id:"request-url",type:"text",value:e.url||"",onChange:r=>t("url",r.target.value),className:"h-8 text-xs",placeholder:"https://api.example.com/endpoint"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"request-method",className:"text-xs font-medium block",children:"Method:"}),d.jsxs(rr,{value:e.method||"GET",onValueChange:r=>t("method",r),children:[d.jsx(or,{id:"request-method",className:"h-8 text-xs",children:d.jsx(ar,{placeholder:"Select method"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"GET",children:"GET"}),d.jsx(ct,{value:"POST",children:"POST"}),d.jsx(ct,{value:"PUT",children:"PUT"}),d.jsx(ct,{value:"DELETE",children:"DELETE"}),d.jsx(ct,{value:"PATCH",children:"PATCH"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"request-headers",className:"text-xs font-medium block",children:"Headers (JSON):"}),d.jsx(Mr,{id:"request-headers",value:e.headers||"",onChange:r=>t("headers",r.target.value),className:"text-xs min-h-[80px] resize-none",placeholder:'{"Content-Type": "application/json"}'})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"request-body",className:"text-xs font-medium block",children:"Body (JSON):"}),d.jsx(Mr,{id:"request-body",value:e.body||"",onChange:r=>t("body",r.target.value),className:"text-xs min-h-[80px] resize-none",placeholder:'{"key": "value"}'})]})]})}function PI({config:e,updateConfig:t}){return d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"connect-type",className:"text-xs font-medium block",children:"Connection Type:"}),d.jsxs(rr,{value:e.connectionType||"SSH",onValueChange:r=>t("connectionType",r),children:[d.jsx(or,{id:"connect-type",className:"h-8 text-xs",children:d.jsx(ar,{placeholder:"Select connection type"})}),d.jsxs(sr,{children:[d.jsx(ct,{value:"ssh",children:"SSH"}),d.jsx(ct,{value:"telnet",children:"Telnet"})]})]})]})})}function UI({config:e,updateConfig:t}){const[r,o]=x.useState(e.command||""),i=l=>{const u=l.target.value;o(u),t("command",u)};return x.useEffect(()=>{e.command!==r&&o(e.command)},[e.command]),d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"command",className:"text-xs font-medium block",children:"Command:"}),d.jsx(Mr,{id:"command",value:r,onChange:i,className:"text-xs min-h-[120px] resize-none font-mono",placeholder:"Enter command to execute"})]})})}function BI({config:e,updateConfig:t}){const[r,o]=x.useState(e.condition||""),i=l=>{const u=l.target.value;o(u),t("condition",u)};return x.useEffect(()=>{e.condition!==r&&o(e.condition)},[e.condition]),d.jsx("div",{className:"space-y-3",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"condition",className:"text-xs font-medium block",children:"Condition:"}),d.jsx(Mr,{id:"condition",value:r,onChange:i,className:"text-xs min-h-[120px] resize-none font-mono",placeholder:"Enter condition to execute"})]})})}function nd({config:e,updateConfig:t,fields:r}){return d.jsx("div",{className:"space-y-3",children:r.map(o=>d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Xe,{htmlFor:`field-${o.key}`,className:"text-xs",children:[o.label,":"]}),o.type==="textarea"?d.jsx(Mr,{id:`field-${o.key}`,value:e[o.key]||"",onChange:i=>t(o.key,i.target.value),className:"text-xs min-h-[80px] resize-none",placeholder:o.placeholder}):d.jsx(Ge,{id:`field-${o.key}`,type:o.type,value:e[o.key]||"",onChange:i=>t(o.key,i.target.value),className:"h-8 text-xs",placeholder:o.placeholder})]},o.key))})}function HI(e,t,r,o){switch(t){case"Send Email":return d.jsx(zI,{config:r,updateConfig:o});case"HTTP Request":return d.jsx(LI,{config:r,updateConfig:o});case"Connect":return d.jsx(PI,{config:r,updateConfig:o});case"Command":return d.jsx(UI,{config:r,updateConfig:o});case"Decision":return d.jsx(BI,{config:r,updateConfig:o});case"Database":return d.jsx(nd,{config:r,updateConfig:o,fields:[{key:"operation",label:"Operation",type:"text",placeholder:"select, insert, update, delete"},{key:"query",label:"Query",type:"textarea",placeholder:"SELECT * FROM users"}]});case"Send Message":return d.jsx(nd,{config:r,updateConfig:o,fields:[{key:"channel",label:"Channel",type:"text",placeholder:"#general"},{key:"message",label:"Message",type:"textarea",placeholder:"Your message here"}]});case"Disconnect":return d.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration needed for this node."})}switch(e){case"trigger":return d.jsx(nd,{config:r,updateConfig:o,fields:[{key:"schedule",label:"Schedule",type:"text",placeholder:"0 * * * *"}]});case"operation":return d.jsx(nd,{config:r,updateConfig:o,fields:[{key:"condition",label:"Condition",type:"text",placeholder:"data.value > 10"}]});default:return d.jsx("p",{className:"text-xs text-muted-foreground",children:"This node type doesn't have configurable fields."})}}function $I({parameters:e,onChange:t}){const[r,o]=x.useState({name:""}),i=()=>{if(!r.name)return;const u={name:r.name};t([...e,u]),o({name:""})},l=u=>{t(e.filter(f=>f.name!==u))};return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Workflow Parameters"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Define parameters that can be set when executing this workflow."})]}),e.length>0&&d.jsx("div",{className:"space-y-4",children:e.map(u=>d.jsx("div",{className:"border rounded-md p-3 space-y-3",children:d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("div",{className:"font-medium text-sm",children:u.name}),d.jsxs(we,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground",onClick:()=>l(u.name),children:[d.jsx(Wo,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Remove parameter"})]})]})},u.name))}),d.jsxs("div",{className:"border rounded-md p-3 space-y-3",children:[d.jsx("h4",{className:"text-sm font-medium",children:"Add Parameter"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx(Xe,{htmlFor:"new-param-name",className:"text-xs",children:"Name"}),d.jsx(Ge,{id:"new-param-name",value:r.name||"",onChange:u=>o({...r,name:u.target.value}),className:"h-8 text-xs",placeholder:"e.g., apiKey, timeout, environment"})]}),d.jsx(we,{onClick:i,className:"w-full mt-2",disabled:!r.name,children:"Add Parameter"})]})]})]})}function II({parameters:e,onChange:t}){const[r,o]=x.useState({});x.useEffect(()=>{const l={};e.forEach(u=>{l[u.name]=""}),o(l),t(l)},[e,t]);const i=(l,u)=>{const f={...r,[l]:u};o(f),t(f)};return e.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"This workflow has no parameters."}):d.jsx("div",{className:"space-y-4",children:e.map(l=>d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"flex justify-between items-baseline",children:d.jsx(Xe,{htmlFor:`param-input-${l.name}`,className:"text-sm font-medium",children:l.name})}),d.jsx(Ge,{id:`param-input-${l.name}`,value:r[l.name]||"",onChange:u=>i(l.name,u.target.value),placeholder:`Enter ${l.name}`})]},l.name))})}const VI={customNode:kI};function qI({workflowId:e}){const t=an(),[r,o]=x.useState(null),[i,l,u]=YB([]),[f,m,h]=GB([]),[g,v]=x.useState(null),[b,w]=x.useState("New Workflow"),[E,S]=x.useState("Workflow description"),[N,C]=x.useState([]),[j,A]=x.useState(""),[M,O]=x.useState(!0),[U,H]=x.useState([]),[V,P]=x.useState(!1),[z,F]=x.useState(""),[K,te]=x.useState(""),[k,Y]=x.useState(!1),[D,q]=x.useState(""),B="http://localhost:8000/api",L=Tn(),T=Gn(Qe.create()),[I,X]=x.useState([]),[Z,re]=x.useState({}),[fe,ue]=x.useState("canvas");x.useEffect(()=>{(async()=>{try{const de=async()=>{const{data:Ct}=await T.get(`${B}/users/me`,{headers:{Authorization:`Bearer ${L}`}});o(Ct)},Te=async()=>{const{data:Ct}=await T.get(`${B}/device-sets`,{headers:{Authorization:`Bearer ${L}`}});C(Ct)},Ke=async()=>{const{data:Ct}=await T.get(`${B}/flow-versions`,{params:{flowId:e},headers:{Authorization:`Bearer ${L}`}});H(Ct)};if(de(),Te(),Ke(),e==="new"){O(!1);return}const{data:Le}=await T.get(`${B}/flows/${e}`,{headers:{Authorization:`Bearer ${L}`}});w(Le.flowId),S(Le.description),l(Le.savedState.nodes),m(Le.savedState.edges),console.log("edges are:"),console.log(f)}catch(de){console.error("Error loading data:",de)}O(!1)})()},[e,l,m]);const se=x.useCallback(he=>{m(de=>JC({...he,type:"smoothstep",animated:!0},de))},[m]),me=x.useCallback((he,de)=>{v(de),te("")},[]),pe=x.useCallback((he,de)=>{const Te={id:`node_${Date.now()}`,type:"customNode",position:{x:Math.random()*300+50,y:Math.random()*300+50},data:{...de,type:he}};l(Ke=>Ke.concat(Te))},[l]),ge=x.useCallback((he,de)=>!de||de.trim()===""?(te("Node ID cannot be empty"),!1):i.some(Ke=>Ke.id===de&&Ke.id!==he)?(te("Node ID already exists"),!1):(l(Ke=>Ke.map(Le=>Le.id===he?{...Le,id:de}:Le)),m(Ke=>Ke.map(Le=>Le.source===he?{...Le,source:de}:Le.target===he?{...Le,target:de}:Le)),g&&g.id===he&&v({...g,id:de}),te(""),!0),[i,l,m,g]),Ee=x.useCallback(async()=>{try{const he={nodes:i,edges:f};localStorage.setItem(`workflow_data_${e}`,JSON.stringify(he)),console.log(JSON.stringify(he)),await T.patch(`${B}/flows/${e}`,{savedState:he},{headers:{Authorization:`Bearer ${L}`}});const de=localStorage.getItem("workflows"),Te=de?JSON.parse(de):[],Ke=new Date().toISOString(),Le=Te.findIndex(Ct=>Ct.id===e);if(Le>=0)Te[Le]={...Te[Le],name:b,description:E,deviceSetId:j,groupId:j,updatedAt:Ke,nodeCount:i.length};else{const Ct={id:e==="new"?`workflow-${Date.now()}`:e,name:b,description:E,deviceSetId:j,groupId:j,createdAt:Ke,updatedAt:Ke,nodeCount:i.length};Te.push(Ct)}localStorage.setItem("workflows",JSON.stringify(Te)),alert("Workflow saved!")}catch(he){console.error("Error saving workflow:",he),alert("Failed to save workflow")}},[i,f,e,b,E,j]),Se=x.useCallback(async()=>{try{const he=new Date().toISOString(),de={flowId:e,version:z,createdAt:he,structure:{nodes:i,edges:f},parameters:I.map(Ke=>Ke.name)};await T.post(`${B}/flow-versions`,de,{headers:{Authorization:`Bearer ${L}`}});const Te=[...U,de];H(Te),localStorage.setItem(`workflow_versions_${e}`,JSON.stringify(Te)),F(""),P(!1)}catch(he){console.error("Error saving version:",he),alert("Failed to save version")}},[e,z,i,f,U,I]),Ye=x.useCallback(he=>{try{const de=U.find(Te=>Te.version===he);if(!de){alert("Version not found");return}l(de.structure.nodes),m(de.structure.edges),de.parameters&&X(de.parameters.map(Te=>({name:Te}))),P(!1)}catch(de){console.error("Error loading version:",de),alert("Failed to load version")}},[U,l,m]),We=x.useCallback(async he=>{if(!j){alert("Please select a device set before executing the workflow");return}try{const de=U.find(Le=>Le.version===he);if(!de){alert("Please select a valid workflow version to execute");return}if(!N.find(Le=>Le.deviceSetId===j)){alert("Selected device set not found");return}const Ke={flowId:e,version:de.version,description:"",runType:"manual",deviceSetId:j,args:Z};await T.post(`${B}/flow-runs`,Ke,{headers:{Authorization:`Bearer ${L}`}}),Y(!1),alert(`Workflow version "${de.version}" execution started!`),t("/executions")}catch(de){console.error("Error executing workflow:",de),alert("Failed to execute workflow")}},[e,j,N,U,t,Z]),Je=x.useCallback(()=>{if(U.length===0){alert("Please save at least one version of the workflow before executing");return}q(U[U.length-1].version),Y(!0)},[U]),mt=x.useCallback((he,de,Te)=>{l(Ke=>Ke.map(Le=>{if(Le.id===he){const Ct={...Le.data.config,[de]:Te};return{...Le,data:{...Le.data,config:Ct}}}return Le}))},[l]);return M?d.jsx("div",{className:"flex items-center justify-center h-screen",children:"Loading..."}):d.jsxs("div",{className:"flex flex-col h-screen",children:[d.jsxs("div",{className:"border-b px-3 py-2 flex items-center gap-3",children:[d.jsxs(we,{variant:"ghost",size:"icon",onClick:()=>t("/dashboard"),className:"mr-1",children:[d.jsx(cc,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Back to dashboard"})]}),d.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[d.jsxs("div",{className:"flex-1",children:[d.jsx("h2",{className:"font-medium",children:b}),d.jsx("p",{className:"text-xs text-muted-foreground",children:E})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(rr,{value:j,onValueChange:A,children:[d.jsx(or,{className:"w-[180px] h-8 text-xs",children:d.jsx(ar,{placeholder:"Select device set"})}),d.jsx(sr,{children:N.length===0?d.jsx(ct,{value:"none",disabled:!0,children:"No device sets available"}):N.map(he=>d.jsxs(ct,{value:he.deviceSetId,children:[he.deviceSetId," (",he.devices.length," devices)"]},he.deviceSetId))})]}),d.jsxs(_r,{open:V,onOpenChange:P,children:[d.jsx(ca,{asChild:!0,children:d.jsxs(we,{variant:"outline",size:"sm",className:"flex items-center gap-1 h-8",children:[d.jsx(Dk,{className:"h-3 w-3"}),"Versions"]})}),d.jsxs(Ar,{className:"sm:max-w-[500px]",children:[d.jsxs(Tr,{children:[d.jsx(Rr,{children:"Workflow Versions"}),d.jsx(oo,{children:"Save a new version or load a previous version of this workflow."})]}),d.jsxs("div",{className:"py-4",children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-sm font-medium mb-2",children:"Save New Version"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ge,{placeholder:"Version name",value:z,onChange:he=>F(he.target.value),className:"flex-1",required:!0}),d.jsx(we,{onClick:Se,children:"Save Version"})]})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-medium mb-2",children:"Previous Versions"}),U.length===0?d.jsx("p",{className:"text-sm text-muted-foreground",children:"No saved versions yet."}):d.jsx("div",{className:"max-h-[300px] overflow-y-auto border rounded-md",children:U.slice().reverse().map(he=>d.jsxs("div",{className:"flex items-center justify-between p-3 border-b last:border-b-0 hover:bg-muted/50",children:[d.jsxs("div",{children:[d.jsx("div",{className:"font-medium",children:he.version}),d.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[d.jsx(nr,{className:"h-3 w-3"}),Id(new Date(he.createdAt),"MMM d, yyyy HH:mm")]})]}),d.jsx(we,{variant:"outline",size:"sm",onClick:()=>Ye(he.version),children:"Load"})]},he.version))})]})]})]})]}),d.jsxs(we,{onClick:Ee,size:"sm",variant:"outline",className:"flex items-center gap-1 h-8",children:[d.jsx(Lg,{className:"h-3 w-3"}),"Save"]}),d.jsxs(we,{onClick:Je,size:"sm",variant:"default",className:"flex items-center gap-1 h-8",disabled:!j||U.length===0,children:[d.jsx(Xk,{className:"h-3 w-3"}),"Run"]})]})]})]}),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(RI,{onAddNode:pe}),d.jsx("div",{className:"flex-1 h-full flex flex-col",children:d.jsxs(Wd,{value:fe,onValueChange:ue,className:"relative w-full h-full",children:[d.jsxs(Kd,{className:"absolute mx-2 mt-1 z-40",children:[d.jsx(Vo,{value:"canvas",children:"Canvas"}),d.jsx(Vo,{value:"parameters",children:"Parameters"})]}),d.jsx(qo,{value:"canvas",className:"flex-1 h-full",children:d.jsxs(k2,{nodes:i,edges:f,onNodesChange:u,onEdgesChange:h,onConnect:se,onNodeClick:me,nodeTypes:VI,connectionLineType:ta.SmoothStep,fitView:!0,nodesDraggable:(r==null?void 0:r.isSuperuser)||(r==null?void 0:r.role)!=="operator",nodesConnectable:(r==null?void 0:r.isSuperuser)||(r==null?void 0:r.role)!=="operator",children:[d.jsx(pH,{}),d.jsx(cH,{}),d.jsx(nH,{})]})}),d.jsx(qo,{value:"parameters",className:"flex-1 p-4 overflow-auto",children:d.jsx($I,{parameters:I,onChange:X})})]})}),g&&d.jsxs("div",{className:"w-80 border-l p-4 overflow-auto",children:[d.jsx("h3",{className:"font-medium mb-2",children:g.data.label}),d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:g.data.description}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium mb-1",children:"Node ID"}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(Ge,{value:g.id,onChange:he=>ge(g.id,he.target.value),className:"h-8 text-xs"}),K&&d.jsx("p",{className:"text-xs text-red-500",children:K})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium mb-1",children:"Type"}),d.jsx("p",{className:"text-xs capitalize",children:g.data.type})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium mb-2",children:"Configuration"}),HI(g.data.type,g.data.label,g.data.config,(he,de)=>mt(g.id,he,de))]})]})]}),d.jsx(_r,{open:k,onOpenChange:Y,children:d.jsxs(Ar,{className:"max-w-md",children:[d.jsxs(Tr,{children:[d.jsx(Rr,{children:"Select Workflow Version to Run"}),d.jsx(oo,{children:"Choose which saved version of the workflow you want to execute."})]}),d.jsxs("div",{className:"py-4 space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Xe,{htmlFor:"version-select",children:"Workflow Version"}),d.jsxs(rr,{value:D,onValueChange:he=>{q(he);const de=U.find(Te=>Te.version===he);de&&de.parameters&&X(de.parameters.map(Te=>({name:Te})))},children:[d.jsx(or,{id:"version-select",children:d.jsx(ar,{placeholder:"Select a version"})}),d.jsx(sr,{children:U.map(he=>d.jsxs(ct,{value:he.version,children:[he.version," (",Id(new Date(he.createdAt),"MMM d, yyyy HH:mm"),")"]},he.version))})]})]}),D&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Parameters"}),d.jsx(II,{parameters:I,onChange:re})]})]}),d.jsxs(ua,{children:[d.jsx(we,{variant:"outline",onClick:()=>Y(!1),children:"Cancel"}),d.jsx(we,{onClick:()=>We(D),disabled:!D||I.some(he=>!Z[he.name]),children:"Execute Workflow"})]})]})})]})]})}function YI(){const e=rc();return d.jsx(qI,{workflowId:e.id})}const GI=()=>{const e=Tn();if(!e)return!1;try{const{exp:t}=mz(e);return console.log(t),console.log(Math.floor(Date.now()/1e3)),t>Math.floor(Date.now()/1e3)}catch{return!1}},FI=()=>GI()?d.jsx(xT,{}):d.jsx(NS,{to:"/login",replace:!0});function XI(){return d.jsx(YT,{children:d.jsxs(wT,{children:[d.jsx($t,{path:"/",element:d.jsx(tR,{})}),d.jsxs($t,{element:d.jsx(FI,{}),children:[d.jsx($t,{path:"/admin",element:d.jsx(g5,{})}),d.jsx($t,{path:"/dashboard",element:d.jsx(yH,{})}),d.jsx($t,{path:"/devices",element:d.jsx(bH,{})}),d.jsx($t,{path:"/devices/sets",element:d.jsx(SH,{})}),d.jsx($t,{path:"/devices/sets/:id",element:d.jsx(NH,{})}),d.jsx($t,{path:"/executions",element:d.jsx(H$,{})}),d.jsx($t,{path:"/executions/:id",element:d.jsx(I$,{})}),d.jsx($t,{path:"/executions/:id/:deviceRunId",element:d.jsx(q$,{})}),d.jsx($t,{path:"/groups",element:d.jsx(G$,{})}),d.jsx($t,{path:"/groups/:id",element:d.jsx(X$,{})}),d.jsx($t,{path:"/profile",element:d.jsx(dI,{})}),d.jsx($t,{path:"/settings",element:d.jsx(fI,{})}),d.jsx($t,{path:"/workflow/:id",element:d.jsx(YI,{})})]}),d.jsx($t,{path:"/login",element:d.jsx(K$,{})}),d.jsx($t,{path:"/register",element:d.jsx(Z$,{})})]})})}_A.createRoot(document.getElementById("root")).render(d.jsx(x.StrictMode,{children:d.jsx(XI,{})}));
