better-auth-studio 1.0.47-beta.8 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,705 +0,0 @@
1
- function v5(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const i=Object.getOwnPropertyDescriptor(s,r);i&&Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>s[r]})}}}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 r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function Gh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iw={exports:{}},Xh={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var y5=Symbol.for("react.transitional.element"),w5=Symbol.for("react.fragment");function Fw(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:y5,type:e,key:s,ref:t!==void 0?t:null,props:n}}Xh.Fragment=w5;Xh.jsx=Fw;Xh.jsxs=Fw;Iw.exports=Xh;var a=Iw.exports,Ww={exports:{}},Ze={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var G0=Symbol.for("react.transitional.element"),j5=Symbol.for("react.portal"),N5=Symbol.for("react.fragment"),S5=Symbol.for("react.strict_mode"),C5=Symbol.for("react.profiler"),k5=Symbol.for("react.consumer"),E5=Symbol.for("react.context"),M5=Symbol.for("react.forward_ref"),T5=Symbol.for("react.suspense"),D5=Symbol.for("react.memo"),qw=Symbol.for("react.lazy"),Fp=Symbol.iterator;function _5(e){return e===null||typeof e!="object"?null:(e=Fp&&e[Fp]||e["@@iterator"],typeof e=="function"?e:null)}var Gw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xw=Object.assign,Zw={};function ml(e,t,n){this.props=e,this.context=t,this.refs=Zw,this.updater=n||Gw}ml.prototype.isReactComponent={};ml.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ml.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qw(){}Qw.prototype=ml.prototype;function X0(e,t,n){this.props=e,this.context=t,this.refs=Zw,this.updater=n||Gw}var Z0=X0.prototype=new Qw;Z0.constructor=X0;Xw(Z0,ml.prototype);Z0.isPureReactComponent=!0;var Wp=Array.isArray,zt={H:null,A:null,T:null,S:null,V:null},Kw=Object.prototype.hasOwnProperty;function Q0(e,t,n,s,r,i){return n=i.ref,{$$typeof:G0,type:e,key:t,ref:n!==void 0?n:null,props:i}}function A5(e,t){return Q0(e.type,t,void 0,void 0,void 0,e.props)}function K0(e){return typeof e=="object"&&e!==null&&e.$$typeof===G0}function O5(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var qp=/\/+/g;function Qf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?O5(""+e.key):t.toString(36)}function Gp(){}function z5(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Gp,Gp):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function oo(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case G0:case j5:o=!0;break;case qw:return o=e._init,oo(o(e._payload),t,n,s,r)}}if(o)return r=r(e),o=s===""?"."+Qf(e,0):s,Wp(r)?(n="",o!=null&&(n=o.replace(qp,"$&/")+"/"),oo(r,t,n,"",function(u){return u})):r!=null&&(K0(r)&&(r=A5(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(qp,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=s===""?".":s+":";if(Wp(e))for(var c=0;c<e.length;c++)s=e[c],i=l+Qf(s,c),o+=oo(s,t,n,i,r);else if(c=_5(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,i=l+Qf(s,c++),o+=oo(s,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return oo(z5(e),t,n,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function $d(e,t,n){if(e==null)return e;var s=[],r=0;return oo(e,s,"","",function(i){return t.call(n,i,r++)}),s}function R5(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Xp=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function U5(){}Ze.Children={map:$d,forEach:function(e,t,n){$d(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $d(e,function(){t++}),t},toArray:function(e){return $d(e,function(t){return t})||[]},only:function(e){if(!K0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ze.Component=ml;Ze.Fragment=N5;Ze.Profiler=C5;Ze.PureComponent=X0;Ze.StrictMode=S5;Ze.Suspense=T5;Ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=zt;Ze.__COMPILER_RUNTIME={__proto__:null,c:function(e){return zt.H.useMemoCache(e)}};Ze.cache=function(e){return function(){return e.apply(null,arguments)}};Ze.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=Xw({},e.props),r=e.key,i=void 0;if(t!=null)for(o in t.ref!==void 0&&(i=void 0),t.key!==void 0&&(r=""+t.key),t)!Kw.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(s[o]=t[o]);var o=arguments.length-2;if(o===1)s.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];s.children=l}return Q0(e.type,r,void 0,void 0,i,s)};Ze.createContext=function(e){return e={$$typeof:E5,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:k5,_context:e},e};Ze.createElement=function(e,t,n){var s,r={},i=null;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)Kw.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(s in o=e.defaultProps,o)r[s]===void 0&&(r[s]=o[s]);return Q0(e,i,void 0,void 0,null,r)};Ze.createRef=function(){return{current:null}};Ze.forwardRef=function(e){return{$$typeof:M5,render:e}};Ze.isValidElement=K0;Ze.lazy=function(e){return{$$typeof:qw,_payload:{_status:-1,_result:e},_init:R5}};Ze.memo=function(e,t){return{$$typeof:D5,type:e,compare:t===void 0?null:t}};Ze.startTransition=function(e){var t=zt.T,n={};zt.T=n;try{var s=e(),r=zt.S;r!==null&&r(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(U5,Xp)}catch(i){Xp(i)}finally{zt.T=t}};Ze.unstable_useCacheRefresh=function(){return zt.H.useCacheRefresh()};Ze.use=function(e){return zt.H.use(e)};Ze.useActionState=function(e,t,n){return zt.H.useActionState(e,t,n)};Ze.useCallback=function(e,t){return zt.H.useCallback(e,t)};Ze.useContext=function(e){return zt.H.useContext(e)};Ze.useDebugValue=function(){};Ze.useDeferredValue=function(e,t){return zt.H.useDeferredValue(e,t)};Ze.useEffect=function(e,t,n){var s=zt.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return s.useEffect(e,t)};Ze.useId=function(){return zt.H.useId()};Ze.useImperativeHandle=function(e,t,n){return zt.H.useImperativeHandle(e,t,n)};Ze.useInsertionEffect=function(e,t){return zt.H.useInsertionEffect(e,t)};Ze.useLayoutEffect=function(e,t){return zt.H.useLayoutEffect(e,t)};Ze.useMemo=function(e,t){return zt.H.useMemo(e,t)};Ze.useOptimistic=function(e,t){return zt.H.useOptimistic(e,t)};Ze.useReducer=function(e,t,n){return zt.H.useReducer(e,t,n)};Ze.useRef=function(e){return zt.H.useRef(e)};Ze.useState=function(e){return zt.H.useState(e)};Ze.useSyncExternalStore=function(e,t,n){return zt.H.useSyncExternalStore(e,t,n)};Ze.useTransition=function(){return zt.H.useTransition()};Ze.version="19.1.0";Ww.exports=Ze;var m=Ww.exports;const K=Gh(m),Zh=v5({__proto__:null,default:K},[m]);var Jw={exports:{}},Qh={},e1={exports:{}},t1={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(T,_){var k=T.length;T.push(_);e:for(;0<k;){var D=k-1>>>1,L=T[D];if(0<r(L,_))T[D]=_,T[k]=L,k=D;else break e}}function n(T){return T.length===0?null:T[0]}function s(T){if(T.length===0)return null;var _=T[0],k=T.pop();if(k!==_){T[0]=k;e:for(var D=0,L=T.length,q=L>>>1;D<q;){var O=2*(D+1)-1,B=T[O],X=O+1,Z=T[X];if(0>r(B,k))X<L&&0>r(Z,B)?(T[D]=Z,T[X]=k,D=X):(T[D]=B,T[O]=k,D=O);else if(X<L&&0>r(Z,k))T[D]=Z,T[X]=k,D=X;else break e}}return _}function r(T,_){var k=T.sortIndex-_.sortIndex;return k!==0?k:T.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],h=1,d=null,f=3,x=!1,y=!1,b=!1,w=!1,g=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;function j(T){for(var _=n(u);_!==null;){if(_.callback===null)s(u);else if(_.startTime<=T)s(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function N(T){if(b=!1,j(T),!y)if(n(c)!==null)y=!0,C||(C=!0,z());else{var _=n(u);_!==null&&R(N,_.startTime-T)}}var C=!1,S=-1,M=5,A=-1;function V(){return w?!0:!(e.unstable_now()-A<M)}function $(){if(w=!1,C){var T=e.unstable_now();A=T;var _=!0;try{e:{y=!1,b&&(b=!1,v(S),S=-1),x=!0;var k=f;try{t:{for(j(T),d=n(c);d!==null&&!(d.expirationTime>T&&V());){var D=d.callback;if(typeof D=="function"){d.callback=null,f=d.priorityLevel;var L=D(d.expirationTime<=T);if(T=e.unstable_now(),typeof L=="function"){d.callback=L,j(T),_=!0;break t}d===n(c)&&s(c),j(T)}else s(c);d=n(c)}if(d!==null)_=!0;else{var q=n(u);q!==null&&R(N,q.startTime-T),_=!1}}break e}finally{d=null,f=k,x=!1}_=void 0}}finally{_?z():C=!1}}}var z;if(typeof p=="function")z=function(){p($)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,E=Y.port2;Y.port1.onmessage=$,z=function(){E.postMessage(null)}}else z=function(){g($,0)};function R(T,_){S=g(function(){T(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var k=f;f=_;try{return T()}finally{f=k}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(T,_){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var k=f;f=T;try{return _()}finally{f=k}},e.unstable_scheduleCallback=function(T,_,k){var D=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?D+k:D):k=D,T){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=k+L,T={id:h++,callback:_,priorityLevel:T,startTime:k,expirationTime:L,sortIndex:-1},k>D?(T.sortIndex=k,t(u,T),n(c)===null&&T===n(u)&&(b?(v(S),S=-1):b=!0,R(N,k-D))):(T.sortIndex=L,t(c,T),y||x||(y=!0,C||(C=!0,z()))),T},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(T){var _=f;return function(){var k=f;f=_;try{return T.apply(this,arguments)}finally{f=k}}}})(t1);e1.exports=t1;var $5=e1.exports,n1={exports:{}},Tn={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var L5=m;function s1(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ir(){}var Mn={d:{f:ir,r:function(){throw Error(s1(522))},D:ir,C:ir,L:ir,m:ir,X:ir,S:ir,M:ir},p:0,findDOMNode:null},P5=Symbol.for("react.portal");function H5(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P5,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}var lc=L5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Kh(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Mn;Tn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(s1(299));return H5(e,t,null,n)};Tn.flushSync=function(e){var t=lc.T,n=Mn.p;try{if(lc.T=null,Mn.p=2,e)return e()}finally{lc.T=t,Mn.p=n,Mn.d.f()}};Tn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Mn.d.C(e,t))};Tn.prefetchDNS=function(e){typeof e=="string"&&Mn.d.D(e)};Tn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=Kh(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Mn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:i}):n==="script"&&Mn.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Tn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Kh(t.as,t.crossOrigin);Mn.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Mn.d.M(e)};Tn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=Kh(n,t.crossOrigin);Mn.d.L(e,n,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Tn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Kh(t.as,t.crossOrigin);Mn.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Mn.d.m(e)};Tn.requestFormReset=function(e){Mn.d.r(e)};Tn.unstable_batchedUpdates=function(e,t){return e(t)};Tn.useFormState=function(e,t,n){return lc.H.useFormState(e,t,n)};Tn.useFormStatus=function(){return lc.H.useHostTransitionStatus()};Tn.version="19.1.0";function a1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a1)}catch(e){console.error(e)}}a1(),n1.exports=Tn;var Jh=n1.exports;const r1=Gh(Jh);/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var ln=$5,i1=m,B5=Jh;function oe(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function rd(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Zp(e){if(rd(e)!==e)throw Error(oe(188))}function V5(e){var t=e.alternate;if(!t){if(t=rd(e),t===null)throw Error(oe(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return Zp(r),e;if(i===s)return Zp(r),t;i=i.sibling}throw Error(oe(188))}if(n.return!==s.return)n=r,s=i;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,s=i;break}if(l===s){o=!0,s=r,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,s=r;break}if(l===s){o=!0,s=i,n=r;break}l=l.sibling}if(!o)throw Error(oe(189))}}if(n.alternate!==s)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?e:t}function c1(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=c1(e),t!==null)return t;e=e.sibling}return null}var At=Object.assign,Y5=Symbol.for("react.element"),Ld=Symbol.for("react.transitional.element"),tc=Symbol.for("react.portal"),mo=Symbol.for("react.fragment"),d1=Symbol.for("react.strict_mode"),xx=Symbol.for("react.profiler"),I5=Symbol.for("react.provider"),u1=Symbol.for("react.consumer"),Ra=Symbol.for("react.context"),J0=Symbol.for("react.forward_ref"),gx=Symbol.for("react.suspense"),px=Symbol.for("react.suspense_list"),eg=Symbol.for("react.memo"),pr=Symbol.for("react.lazy"),bx=Symbol.for("react.activity"),F5=Symbol.for("react.memo_cache_sentinel"),Qp=Symbol.iterator;function zl(e){return e===null||typeof e!="object"?null:(e=Qp&&e[Qp]||e["@@iterator"],typeof e=="function"?e:null)}var W5=Symbol.for("react.client.reference");function vx(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===W5?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case mo:return"Fragment";case xx:return"Profiler";case d1:return"StrictMode";case gx:return"Suspense";case px:return"SuspenseList";case bx:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case tc:return"Portal";case Ra:return(e.displayName||"Context")+".Provider";case u1:return(e._context.displayName||"Context")+".Consumer";case J0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case eg:return t=e.displayName||null,t!==null?t:vx(e.type)||"Memo";case pr:t=e._payload,e=e._init;try{return vx(e(t))}catch{}}return null}var nc=Array.isArray,Ye=i1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt=B5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pi={pending:!1,data:null,method:null,action:null},yx=[],xo=-1;function pa(e){return{current:e}}function fn(e){0>xo||(e.current=yx[xo],yx[xo]=null,xo--)}function Rt(e,t){xo++,yx[xo]=e.current,e.current=t}var da=pa(null),Mc=pa(null),Dr=pa(null),Iu=pa(null);function Fu(e,t){switch(Rt(Dr,t),Rt(Mc,e),Rt(da,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nv(t),e=Mj(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}fn(da),Rt(da,e)}function Io(){fn(da),fn(Mc),fn(Dr)}function wx(e){e.memoizedState!==null&&Rt(Iu,e);var t=da.current,n=Mj(t,e.type);t!==n&&(Rt(Mc,e),Rt(da,n))}function Wu(e){Mc.current===e&&(fn(da),fn(Mc)),Iu.current===e&&(fn(Iu),Lc._currentValue=pi)}var jx=Object.prototype.hasOwnProperty,tg=ln.unstable_scheduleCallback,Kf=ln.unstable_cancelCallback,q5=ln.unstable_shouldYield,G5=ln.unstable_requestPaint,ua=ln.unstable_now,X5=ln.unstable_getCurrentPriorityLevel,h1=ln.unstable_ImmediatePriority,f1=ln.unstable_UserBlockingPriority,qu=ln.unstable_NormalPriority,Z5=ln.unstable_LowPriority,m1=ln.unstable_IdlePriority,Q5=ln.log,K5=ln.unstable_setDisableYieldValue,id=null,ns=null;function Cr(e){if(typeof Q5=="function"&&K5(e),ns&&typeof ns.setStrictMode=="function")try{ns.setStrictMode(id,e)}catch{}}var ss=Math.clz32?Math.clz32:tC,J5=Math.log,eC=Math.LN2;function tC(e){return e>>>=0,e===0?32:31-(J5(e)/eC|0)|0}var Pd=256,Hd=4194304;function li(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ef(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~i,s!==0?r=li(s):(o&=l,o!==0?r=li(o):n||(n=l&~e,n!==0&&(r=li(n))))):(l=s&~i,l!==0?r=li(l):o!==0?r=li(o):n||(n=s&~e,n!==0&&(r=li(n)))),r===0?0:t!==0&&t!==r&&!(t&i)&&(i=r&-r,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:r}function od(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nC(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 x1(){var e=Pd;return Pd<<=1,!(Pd&4194048)&&(Pd=256),e}function g1(){var e=Hd;return Hd<<=1,!(Hd&62914560)&&(Hd=4194304),e}function Jf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ld(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function sC(e,t,n,s,r,i){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0<n;){var h=31-ss(n),d=1<<h;l[h]=0,c[h]=-1;var f=u[h];if(f!==null)for(u[h]=null,h=0;h<f.length;h++){var x=f[h];x!==null&&(x.lane&=-536870913)}n&=~d}s!==0&&p1(e,s,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function p1(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-ss(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&4194090}function b1(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ss(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}function ng(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function sg(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function v1(){var e=lt.p;return e!==0?e:(e=window.event,e===void 0?32:Lj(e.type))}function aC(e,t){var n=lt.p;try{return lt.p=e,t()}finally{lt.p=n}}var Qr=Math.random().toString(36).slice(2),jn="__reactFiber$"+Qr,Pn="__reactProps$"+Qr,xl="__reactContainer$"+Qr,Nx="__reactEvents$"+Qr,rC="__reactListeners$"+Qr,iC="__reactHandles$"+Qr,Kp="__reactResources$"+Qr,cd="__reactMarker$"+Qr;function ag(e){delete e[jn],delete e[Pn],delete e[Nx],delete e[rC],delete e[iC]}function go(e){var t=e[jn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[xl]||n[jn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=rv(e);e!==null;){if(n=e[jn])return n;e=rv(e)}return t}e=n,n=e.parentNode}return null}function gl(e){if(e=e[jn]||e[xl]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function sc(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(oe(33))}function To(e){var t=e[Kp];return t||(t=e[Kp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function un(e){e[cd]=!0}var y1=new Set,w1={};function Bi(e,t){Fo(e,t),Fo(e+"Capture",t)}function Fo(e,t){for(w1[e]=t,e=0;e<t.length;e++)y1.add(t[e])}var oC=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]*$"),Jp={},eb={};function lC(e){return jx.call(eb,e)?!0:jx.call(Jp,e)?!1:oC.test(e)?eb[e]=!0:(Jp[e]=!0,!1)}function yu(e,t,n){if(lC(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Bd(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function ka(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}var em,tb;function lo(e){if(em===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);em=t&&t[1]||"",tb=-1<n.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+em+e+tb}var tm=!1;function nm(e,t){if(!e||tm)return"";tm=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(x){var f=x}Reflect.construct(e,[],d)}else{try{d.call()}catch(x){f=x}e.call(d.prototype)}}else{try{throw Error()}catch(x){f=x}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(x){if(x&&f&&typeof x.stack=="string")return[x.stack,f.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=s.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
44
- `),u=l.split(`
45
- `);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===u.length)for(s=c.length-1,r=u.length-1;1<=s&&0<=r&&c[s]!==u[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==u[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==u[r]){var h=`
46
- `+c[s].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=s&&0<=r);break}}}finally{tm=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?lo(n):""}function cC(e){switch(e.tag){case 26:case 27:case 5:return lo(e.type);case 16:return lo("Lazy");case 13:return lo("Suspense");case 19:return lo("SuspenseList");case 0:case 15:return nm(e.type,!1);case 11:return nm(e.type.render,!1);case 1:return nm(e.type,!0);case 31:return lo("Activity");default:return""}}function nb(e){try{var t="";do t+=cC(e),e=e.return;while(e);return t}catch(n){return`
47
- Error generating stack: `+n.message+`
48
- `+n.stack}}function ps(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function j1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dC(e){var t=j1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gu(e){e._valueTracker||(e._valueTracker=dC(e))}function N1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=j1(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Xu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var uC=/[\n"\\]/g;function Ss(e){return e.replace(uC,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Sx(e,t,n,s,r,i,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ps(t)):e.value!==""+ps(t)&&(e.value=""+ps(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Cx(e,o,ps(t)):n!=null?Cx(e,o,ps(n)):s!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ps(l):e.removeAttribute("name")}function S1(e,t,n,s,r,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null))return;n=n!=null?""+ps(n):"",t=t!=null?""+ps(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o)}function Cx(e,t,n){t==="number"&&Xu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Do(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+ps(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function C1(e,t,n){if(t!=null&&(t=""+ps(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+ps(n):""}function k1(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(oe(92));if(nc(s)){if(1<s.length)throw Error(oe(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=ps(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s)}function Wo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hC=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 sb(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||hC.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function E1(e,t,n){if(t!=null&&typeof t!="object")throw Error(oe(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&n[r]!==s&&sb(e,r,s)}else for(var i in t)t.hasOwnProperty(i)&&sb(e,i,t[i])}function rg(e){if(e.indexOf("-")===-1)return!1;switch(e){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 fC=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"]]),mC=/^[\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 wu(e){return mC.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var kx=null;function ig(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var po=null,_o=null;function ab(e){var t=gl(e);if(t&&(e=t.stateNode)){var n=e[Pn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Sx(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ss(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=s[Pn]||null;if(!r)throw Error(oe(90));Sx(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&N1(s)}break e;case"textarea":C1(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Do(e,!!n.multiple,t,!1)}}}var sm=!1;function M1(e,t,n){if(sm)return e(t,n);sm=!0;try{var s=e(t);return s}finally{if(sm=!1,(po!==null||_o!==null)&&(uf(),po&&(t=po,e=_o,_o=po=null,ab(t),e)))for(t=0;t<e.length;t++)ab(e[t])}}function Tc(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Pn]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(oe(231,t,typeof n));return n}var qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ex=!1;if(qa)try{var Rl={};Object.defineProperty(Rl,"passive",{get:function(){Ex=!0}}),window.addEventListener("test",Rl,Rl),window.removeEventListener("test",Rl,Rl)}catch{Ex=!1}var kr=null,og=null,ju=null;function T1(){if(ju)return ju;var e,t=og,n=t.length,s,r="value"in kr?kr.value:kr.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===r[i-s];s++);return ju=r.slice(e,1<s?1-s:void 0)}function Nu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Vd(){return!0}function rb(){return!1}function Hn(e){function t(n,s,r,i,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Vd:rb,this.isPropagationStopped=rb,this}return At(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Vd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Vd)},persist:function(){},isPersistent:Vd}),t}var Vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tf=Hn(Vi),dd=At({},Vi,{view:0,detail:0}),xC=Hn(dd),am,rm,Ul,nf=At({},dd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lg,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ul&&(Ul&&e.type==="mousemove"?(am=e.screenX-Ul.screenX,rm=e.screenY-Ul.screenY):rm=am=0,Ul=e),am)},movementY:function(e){return"movementY"in e?e.movementY:rm}}),ib=Hn(nf),gC=At({},nf,{dataTransfer:0}),pC=Hn(gC),bC=At({},dd,{relatedTarget:0}),im=Hn(bC),vC=At({},Vi,{animationName:0,elapsedTime:0,pseudoElement:0}),yC=Hn(vC),wC=At({},Vi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jC=Hn(wC),NC=At({},Vi,{data:0}),ob=Hn(NC),SC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CC={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"},kC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function EC(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kC[e])?!!t[e]:!1}function lg(){return EC}var MC=At({},dd,{key:function(e){if(e.key){var t=SC[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?CC[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lg,charCode:function(e){return e.type==="keypress"?Nu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TC=Hn(MC),DC=At({},nf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lb=Hn(DC),_C=At({},dd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lg}),AC=Hn(_C),OC=At({},Vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),zC=Hn(OC),RC=At({},nf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),UC=Hn(RC),$C=At({},Vi,{newState:0,oldState:0}),LC=Hn($C),PC=[9,13,27,32],cg=qa&&"CompositionEvent"in window,cc=null;qa&&"documentMode"in document&&(cc=document.documentMode);var HC=qa&&"TextEvent"in window&&!cc,D1=qa&&(!cg||cc&&8<cc&&11>=cc),cb=" ",db=!1;function _1(e,t){switch(e){case"keyup":return PC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function A1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bo=!1;function BC(e,t){switch(e){case"compositionend":return A1(t);case"keypress":return t.which!==32?null:(db=!0,cb);case"textInput":return e=t.data,e===cb&&db?null:e;default:return null}}function VC(e,t){if(bo)return e==="compositionend"||!cg&&_1(e,t)?(e=T1(),ju=og=kr=null,bo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return D1&&t.locale!=="ko"?null:t.data;default:return null}}var YC={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 ub(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!YC[e.type]:t==="textarea"}function O1(e,t,n,s){po?_o?_o.push(s):_o=[s]:po=s,t=fh(t,"onChange"),0<t.length&&(n=new tf("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var dc=null,Dc=null;function IC(e){Cj(e,0)}function sf(e){var t=sc(e);if(N1(t))return e}function hb(e,t){if(e==="change")return t}var z1=!1;if(qa){var om;if(qa){var lm="oninput"in document;if(!lm){var fb=document.createElement("div");fb.setAttribute("oninput","return;"),lm=typeof fb.oninput=="function"}om=lm}else om=!1;z1=om&&(!document.documentMode||9<document.documentMode)}function mb(){dc&&(dc.detachEvent("onpropertychange",R1),Dc=dc=null)}function R1(e){if(e.propertyName==="value"&&sf(Dc)){var t=[];O1(t,Dc,e,ig(e)),M1(IC,t)}}function FC(e,t,n){e==="focusin"?(mb(),dc=t,Dc=n,dc.attachEvent("onpropertychange",R1)):e==="focusout"&&mb()}function WC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sf(Dc)}function qC(e,t){if(e==="click")return sf(t)}function GC(e,t){if(e==="input"||e==="change")return sf(t)}function XC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var os=typeof Object.is=="function"?Object.is:XC;function _c(e,t){if(os(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!jx.call(t,r)||!os(e[r],t[r]))return!1}return!0}function xb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gb(e,t){var n=xb(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xb(n)}}function U1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?U1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xu(e.document)}return t}function dg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var ZC=qa&&"documentMode"in document&&11>=document.documentMode,vo=null,Mx=null,uc=null,Tx=!1;function pb(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tx||vo==null||vo!==Xu(s)||(s=vo,"selectionStart"in s&&dg(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),uc&&_c(uc,s)||(uc=s,s=fh(Mx,"onSelect"),0<s.length&&(t=new tf("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=vo)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yo={animationend:ii("Animation","AnimationEnd"),animationiteration:ii("Animation","AnimationIteration"),animationstart:ii("Animation","AnimationStart"),transitionrun:ii("Transition","TransitionRun"),transitionstart:ii("Transition","TransitionStart"),transitioncancel:ii("Transition","TransitionCancel"),transitionend:ii("Transition","TransitionEnd")},cm={},L1={};qa&&(L1=document.createElement("div").style,"AnimationEvent"in window||(delete yo.animationend.animation,delete yo.animationiteration.animation,delete yo.animationstart.animation),"TransitionEvent"in window||delete yo.transitionend.transition);function Yi(e){if(cm[e])return cm[e];if(!yo[e])return e;var t=yo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in L1)return cm[e]=t[n];return e}var P1=Yi("animationend"),H1=Yi("animationiteration"),B1=Yi("animationstart"),QC=Yi("transitionrun"),KC=Yi("transitionstart"),JC=Yi("transitioncancel"),V1=Yi("transitionend"),Y1=new Map,Dx="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(" ");Dx.push("scrollEnd");function qs(e,t){Y1.set(e,t),Bi(t,[e])}var bb=new WeakMap;function Cs(e,t){if(typeof e=="object"&&e!==null){var n=bb.get(e);return n!==void 0?n:(t={value:e,source:t,stack:nb(t)},bb.set(e,t),t)}return{value:e,source:t,stack:nb(t)}}var hs=[],wo=0,ug=0;function af(){for(var e=wo,t=ug=wo=0;t<e;){var n=hs[t];hs[t++]=null;var s=hs[t];hs[t++]=null;var r=hs[t];hs[t++]=null;var i=hs[t];if(hs[t++]=null,s!==null&&r!==null){var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}i!==0&&I1(n,r,i)}}function rf(e,t,n,s){hs[wo++]=e,hs[wo++]=t,hs[wo++]=n,hs[wo++]=s,ug|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function hg(e,t,n,s){return rf(e,t,n,s),Zu(e)}function pl(e,t){return rf(e,null,null,t),Zu(e)}function I1(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var r=!1,i=e.return;i!==null;)i.childLanes|=n,s=i.alternate,s!==null&&(s.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-ss(n),e=i.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=n|536870912),i):null}function Zu(e){if(50<wc)throw wc=0,Qx=null,Error(oe(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var jo={};function e6(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function es(e,t,n,s){return new e6(e,t,n,s)}function fg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ia(e,t){var n=e.alternate;return n===null?(n=es(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function F1(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Su(e,t,n,s,r,i){var o=0;if(s=e,typeof e=="function")fg(e)&&(o=1);else if(typeof e=="string")o=nk(e,n,da.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case bx:return e=es(31,n,t,r),e.elementType=bx,e.lanes=i,e;case mo:return bi(n.children,r,i,t);case d1:o=8,r|=24;break;case xx:return e=es(12,n,t,r|2),e.elementType=xx,e.lanes=i,e;case gx:return e=es(13,n,t,r),e.elementType=gx,e.lanes=i,e;case px:return e=es(19,n,t,r),e.elementType=px,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I5:case Ra:o=10;break e;case u1:o=9;break e;case J0:o=11;break e;case eg:o=14;break e;case pr:o=16,s=null;break e}o=29,n=Error(oe(130,e===null?"null":typeof e,"")),s=null}return t=es(o,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function bi(e,t,n,s){return e=es(7,e,s,t),e.lanes=n,e}function dm(e,t,n){return e=es(6,e,null,t),e.lanes=n,e}function um(e,t,n){return t=es(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var No=[],So=0,Qu=null,Ku=0,bs=[],vs=0,vi=null,Ua=1,$a="";function ci(e,t){No[So++]=Ku,No[So++]=Qu,Qu=e,Ku=t}function W1(e,t,n){bs[vs++]=Ua,bs[vs++]=$a,bs[vs++]=vi,vi=e;var s=Ua;e=$a;var r=32-ss(s)-1;s&=~(1<<r),n+=1;var i=32-ss(t)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,Ua=1<<32-ss(t)+r|n<<r|s,$a=i+e}else Ua=1<<i|n<<r|s,$a=e}function mg(e){e.return!==null&&(ci(e,1),W1(e,1,0))}function xg(e){for(;e===Qu;)Qu=No[--So],No[So]=null,Ku=No[--So],No[So]=null;for(;e===vi;)vi=bs[--vs],bs[vs]=null,$a=bs[--vs],bs[vs]=null,Ua=bs[--vs],bs[vs]=null}var En=null,Bt=null,ot=!1,yi=null,ra=!1,_x=Error(oe(519));function Ei(e){var t=Error(oe(418,""));throw Ac(Cs(t,e)),_x}function vb(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[jn]=e,t[Pn]=s,n){case"dialog":st("cancel",t),st("close",t);break;case"iframe":case"object":case"embed":st("load",t);break;case"video":case"audio":for(n=0;n<Rc.length;n++)st(Rc[n],t);break;case"source":st("error",t);break;case"img":case"image":case"link":st("error",t),st("load",t);break;case"details":st("toggle",t);break;case"input":st("invalid",t),S1(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0),Gu(t);break;case"select":st("invalid",t);break;case"textarea":st("invalid",t),k1(t,s.value,s.defaultValue,s.children),Gu(t)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||Ej(t.textContent,n)?(s.popover!=null&&(st("beforetoggle",t),st("toggle",t)),s.onScroll!=null&&st("scroll",t),s.onScrollEnd!=null&&st("scrollend",t),s.onClick!=null&&(t.onclick=mf),t=!0):t=!1,t||Ei(e)}function yb(e){for(En=e.return;En;)switch(En.tag){case 5:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:En=En.return}}function $l(e){if(e!==En)return!1;if(!ot)return yb(e),ot=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||s0(e.type,e.memoizedProps)),n=!n),n&&Bt&&Ei(e),yb(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){Bt=Vs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}Bt=null}}else t===27?(t=Bt,Kr(e.type)?(e=i0,i0=null,Bt=e):Bt=t):Bt=En?Vs(e.stateNode.nextSibling):null;return!0}function ud(){Bt=En=null,ot=!1}function wb(){var e=yi;return e!==null&&(Rn===null?Rn=e:Rn.push.apply(Rn,e),yi=null),e}function Ac(e){yi===null?yi=[e]:yi.push(e)}var Ax=pa(null),Ii=null,La=null;function yr(e,t,n){Rt(Ax,t._currentValue),t._currentValue=n}function Fa(e){e._currentValue=Ax.current,fn(Ax)}function Ox(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function zx(e,t,n,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var o=r.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ox(i.return,n,e),s||(o=null);break e}i=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(oe(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),Ox(o,n,e),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function hd(e,t,n,s){e=null;for(var r=t,i=!1;r!==null;){if(!i){if(r.flags&524288)i=!0;else if(r.flags&262144)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(oe(387));if(o=o.memoizedProps,o!==null){var l=r.type;os(r.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(r===Iu.current){if(o=r.alternate,o===null)throw Error(oe(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Lc):e=[Lc])}r=r.return}e!==null&&zx(t,e,n,s),t.flags|=262144}function Ju(e){for(e=e.firstContext;e!==null;){if(!os(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Mi(e){Ii=e,La=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Nn(e){return q1(Ii,e)}function Yd(e,t){return Ii===null&&Mi(e),q1(e,t)}function q1(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},La===null){if(e===null)throw Error(oe(308));La=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else La=La.next=t;return n}var t6=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},n6=ln.unstable_scheduleCallback,s6=ln.unstable_NormalPriority,sn={$$typeof:Ra,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gg(){return{controller:new t6,data:new Map,refCount:0}}function fd(e){e.refCount--,e.refCount===0&&n6(s6,function(){e.controller.abort()})}var hc=null,Rx=0,qo=0,Ao=null;function a6(e,t){if(hc===null){var n=hc=[];Rx=0,qo=Pg(),Ao={status:"pending",value:void 0,then:function(s){n.push(s)}}}return Rx++,t.then(jb,jb),t}function jb(){if(--Rx===0&&hc!==null){Ao!==null&&(Ao.status="fulfilled");var e=hc;hc=null,qo=0,Ao=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function r6(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var Nb=Ye.S;Ye.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&a6(e,t),Nb!==null&&Nb(e,t)};var wi=pa(null);function pg(){var e=wi.current;return e!==null?e:Ct.pooledCache}function Cu(e,t){t===null?Rt(wi,wi.current):Rt(wi,t.pool)}function G1(){var e=pg();return e===null?null:{parent:sn._currentValue,pool:e}}var md=Error(oe(460)),X1=Error(oe(474)),of=Error(oe(542)),Ux={then:function(){}};function Sb(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Id(){}function Z1(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Id,Id),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kb(e),e;default:if(typeof t.status=="string")t.then(Id,Id);else{if(e=Ct,e!==null&&100<e.shellSuspendCounter)throw Error(oe(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kb(e),e}throw fc=t,md}}var fc=null;function Cb(){if(fc===null)throw Error(oe(459));var e=fc;return fc=null,e}function kb(e){if(e===md||e===of)throw Error(oe(483))}var br=!1;function bg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $x(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _r(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ar(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,mt&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Zu(e),I1(e,null,n),t}return rf(e,s,t,n),Zu(e)}function mc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,b1(e,n)}}function hm(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?r=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Lx=!1;function xc(){if(Lx){var e=Ao;if(e!==null)throw e}}function gc(e,t,n,s){Lx=!1;var r=e.updateQueue;br=!1;var i=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c))}if(i!==null){var d=r.baseState;o=0,h=u=c=null,l=i;do{var f=l.lane&-536870913,x=f!==l.lane;if(x?(rt&f)===f:(s&f)===f){f!==0&&f===qo&&(Lx=!0),h!==null&&(h=h.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var y=e,b=l;f=t;var w=n;switch(b.tag){case 1:if(y=b.payload,typeof y=="function"){d=y.call(w,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,f=typeof y=="function"?y.call(w,d,f):y,f==null)break e;d=At({},d,f);break e;case 2:br=!0}}f=l.callback,f!==null&&(e.flags|=64,x&&(e.flags|=8192),x=r.callbacks,x===null?r.callbacks=[f]:x.push(f))}else x={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(u=h=x,c=d):h=h.next=x,o|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;x=l,l=x.next,x.next=null,r.lastBaseUpdate=x,r.shared.pending=null}}while(!0);h===null&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=h,i===null&&(r.shared.lanes=0),Ir|=o,e.lanes=o,e.memoizedState=d}}function Q1(e,t){if(typeof e!="function")throw Error(oe(191,e));e.call(t)}function K1(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Q1(n[e],t)}var Go=pa(null),eh=pa(0);function Eb(e,t){e=Za,Rt(eh,e),Rt(Go,t),Za=e|t.baseLanes}function Px(){Rt(eh,Za),Rt(Go,Go.current)}function vg(){Za=eh.current,fn(Go),fn(eh)}var Vr=0,Je=null,gt=null,Xt=null,th=!1,Oo=!1,Ti=!1,nh=0,Oc=0,zo=null,i6=0;function Wt(){throw Error(oe(321))}function yg(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!os(e[n],t[n]))return!1;return!0}function wg(e,t,n,s,r,i){return Vr=i,Je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ye.H=e===null||e.memoizedState===null?T2:D2,Ti=!1,i=n(s,r),Ti=!1,Oo&&(i=e2(t,n,s,r)),J1(e),i}function J1(e){Ye.H=sh;var t=gt!==null&&gt.next!==null;if(Vr=0,Xt=gt=Je=null,th=!1,Oc=0,zo=null,t)throw Error(oe(300));e===null||hn||(e=e.dependencies,e!==null&&Ju(e)&&(hn=!0))}function e2(e,t,n,s){Je=e;var r=0;do{if(Oo&&(zo=null),Oc=0,Oo=!1,25<=r)throw Error(oe(301));if(r+=1,Xt=gt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}Ye.H=f6,i=t(n,s)}while(Oo);return i}function o6(){var e=Ye.H,t=e.useState()[0];return t=typeof t.then=="function"?xd(t):t,e=e.useState()[0],(gt!==null?gt.memoizedState:null)!==e&&(Je.flags|=1024),t}function jg(){var e=nh!==0;return nh=0,e}function Ng(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Sg(e){if(th){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}th=!1}Vr=0,Xt=gt=Je=null,Oo=!1,Oc=nh=0,zo=null}function On(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Je.memoizedState=Xt=e:Xt=Xt.next=e,Xt}function Zt(){if(gt===null){var e=Je.alternate;e=e!==null?e.memoizedState:null}else e=gt.next;var t=Xt===null?Je.memoizedState:Xt.next;if(t!==null)Xt=t,gt=e;else{if(e===null)throw Je.alternate===null?Error(oe(467)):Error(oe(310));gt=e,e={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Xt===null?Je.memoizedState=Xt=e:Xt=Xt.next=e}return Xt}function Cg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xd(e){var t=Oc;return Oc+=1,zo===null&&(zo=[]),e=Z1(zo,e,t),t=Je,(Xt===null?t.memoizedState:Xt.next)===null&&(t=t.alternate,Ye.H=t===null||t.memoizedState===null?T2:D2),e}function lf(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xd(e);if(e.$$typeof===Ra)return Nn(e)}throw Error(oe(438,String(e)))}function kg(e){var t=null,n=Je.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Je.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Cg(),Je.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=F5;return t.index++,n}function Ga(e,t){return typeof t=="function"?t(e):t}function ku(e){var t=Zt();return Eg(t,gt,e)}function Eg(e,t,n){var s=e.queue;if(s===null)throw Error(oe(311));s.lastRenderedReducer=n;var r=e.baseQueue,i=s.pending;if(i!==null){if(r!==null){var o=r.next;r.next=i.next,i.next=o}t.baseQueue=r=i,s.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var l=o=null,c=null,u=t,h=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(rt&d)===d:(Vr&d)===d){var f=u.revertLane;if(f===0)c!==null&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===qo&&(h=!0);else if((Vr&f)===f){u=u.next,f===qo&&(h=!0);continue}else d={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=d,o=i):c=c.next=d,Je.lanes|=f,Ir|=f;d=u.action,Ti&&n(i,d),i=u.hasEagerState?u.eagerState:n(i,d)}else f={lane:d,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,o=i):c=c.next=f,Je.lanes|=d,Ir|=d;u=u.next}while(u!==null&&u!==t);if(c===null?o=i:c.next=l,!os(i,e.memoizedState)&&(hn=!0,h&&(n=Ao,n!==null)))throw n;e.memoizedState=i,e.baseState=o,e.baseQueue=c,s.lastRenderedState=i}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function fm(e){var t=Zt(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do i=e(i,o.action),o=o.next;while(o!==r);os(i,t.memoizedState)||(hn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function t2(e,t,n){var s=Je,r=Zt(),i=ot;if(i){if(n===void 0)throw Error(oe(407));n=n()}else n=t();var o=!os((gt||r).memoizedState,n);o&&(r.memoizedState=n,hn=!0),r=r.queue;var l=a2.bind(null,s,r,e);if(gd(2048,8,l,[e]),r.getSnapshot!==t||o||Xt!==null&&Xt.memoizedState.tag&1){if(s.flags|=2048,Xo(9,cf(),s2.bind(null,s,r,n,t),null),Ct===null)throw Error(oe(349));i||Vr&124||n2(s,t,n)}return n}function n2(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Je.updateQueue,t===null?(t=Cg(),Je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function s2(e,t,n,s){t.value=n,t.getSnapshot=s,r2(t)&&i2(e)}function a2(e,t,n){return n(function(){r2(t)&&i2(e)})}function r2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!os(e,n)}catch{return!0}}function i2(e){var t=pl(e,2);t!==null&&rs(t,e,2)}function Hx(e){var t=On();if(typeof e=="function"){var n=e;if(e=n(),Ti){Cr(!0);try{n()}finally{Cr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:e},t}function o2(e,t,n,s){return e.baseState=n,Eg(e,gt,typeof s=="function"?s:Ga)}function l6(e,t,n,s,r){if(df(e))throw Error(oe(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};Ye.T!==null?n(!0):i.isTransition=!1,s(i),n=t.pending,n===null?(i.next=t.pending=i,l2(t,i)):(i.next=n.next,t.pending=n.next=i)}}function l2(e,t){var n=t.action,s=t.payload,r=e.state;if(t.isTransition){var i=Ye.T,o={};Ye.T=o;try{var l=n(r,s),c=Ye.S;c!==null&&c(o,l),Mb(e,t,l)}catch(u){Bx(e,t,u)}finally{Ye.T=i}}else try{i=n(r,s),Mb(e,t,i)}catch(u){Bx(e,t,u)}}function Mb(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){Tb(e,t,s)},function(s){return Bx(e,t,s)}):Tb(e,t,n)}function Tb(e,t,n){t.status="fulfilled",t.value=n,c2(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,l2(e,n)))}function Bx(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,c2(t),t=t.next;while(t!==s)}e.action=null}function c2(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function d2(e,t){return t}function Db(e,t){if(ot){var n=Ct.formState;if(n!==null){e:{var s=Je;if(ot){if(Bt){t:{for(var r=Bt,i=ra;r.nodeType!==8;){if(!i){r=null;break t}if(r=Vs(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){Bt=Vs(r.nextSibling),s=r.data==="F!";break e}}Ei(s)}s=!1}s&&(t=n[0])}}return n=On(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d2,lastRenderedState:t},n.queue=s,n=k2.bind(null,Je,s),s.dispatch=n,s=Hx(!1),i=_g.bind(null,Je,!1,s.queue),s=On(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,n=l6.bind(null,Je,r,i,n),r.dispatch=n,s.memoizedState=e,[t,n,!1]}function _b(e){var t=Zt();return u2(t,gt,e)}function u2(e,t,n){if(t=Eg(e,t,d2)[0],e=ku(Ga)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=xd(t)}catch(o){throw o===md?of:o}else s=t;t=Zt();var r=t.queue,i=r.dispatch;return n!==t.memoizedState&&(Je.flags|=2048,Xo(9,cf(),c6.bind(null,r,n),null)),[s,i,e]}function c6(e,t){e.action=t}function Ab(e){var t=Zt(),n=gt;if(n!==null)return u2(t,n,e);Zt(),t=t.memoizedState,n=Zt();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function Xo(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Je.updateQueue,t===null&&(t=Cg(),Je.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function cf(){return{destroy:void 0,resource:void 0}}function h2(){return Zt().memoizedState}function Eu(e,t,n,s){var r=On();s=s===void 0?null:s,Je.flags|=e,r.memoizedState=Xo(1|t,cf(),n,s)}function gd(e,t,n,s){var r=Zt();s=s===void 0?null:s;var i=r.memoizedState.inst;gt!==null&&s!==null&&yg(s,gt.memoizedState.deps)?r.memoizedState=Xo(t,i,n,s):(Je.flags|=e,r.memoizedState=Xo(1|t,i,n,s))}function Ob(e,t){Eu(8390656,8,e,t)}function f2(e,t){gd(2048,8,e,t)}function m2(e,t){return gd(4,2,e,t)}function x2(e,t){return gd(4,4,e,t)}function g2(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function p2(e,t,n){n=n!=null?n.concat([e]):null,gd(4,4,g2.bind(null,t,e),n)}function Mg(){}function b2(e,t){var n=Zt();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&yg(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function v2(e,t){var n=Zt();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&yg(t,s[1]))return s[0];if(s=e(),Ti){Cr(!0);try{e()}finally{Cr(!1)}}return n.memoizedState=[s,t],s}function Tg(e,t,n){return n===void 0||Vr&1073741824?e.memoizedState=t:(e.memoizedState=n,e=cj(),Je.lanes|=e,Ir|=e,n)}function y2(e,t,n,s){return os(n,t)?n:Go.current!==null?(e=Tg(e,n,s),os(e,t)||(hn=!0),e):Vr&42?(e=cj(),Je.lanes|=e,Ir|=e,t):(hn=!0,e.memoizedState=n)}function w2(e,t,n,s,r){var i=lt.p;lt.p=i!==0&&8>i?i:8;var o=Ye.T,l={};Ye.T=l,_g(e,!1,t,n);try{var c=r(),u=Ye.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var h=r6(c,s);pc(e,t,h,as(e))}else pc(e,t,s,as(e))}catch(d){pc(e,t,{then:function(){},status:"rejected",reason:d},as())}finally{lt.p=i,Ye.T=o}}function d6(){}function Vx(e,t,n,s){if(e.tag!==5)throw Error(oe(476));var r=j2(e).queue;w2(e,r,t,pi,n===null?d6:function(){return N2(e),n(s)})}function j2(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pi,baseState:pi,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:pi},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function N2(e){var t=j2(e).next.queue;pc(e,t,{},as())}function Dg(){return Nn(Lc)}function S2(){return Zt().memoizedState}function C2(){return Zt().memoizedState}function u6(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=as();e=_r(n);var s=Ar(t,e,n);s!==null&&(rs(s,t,n),mc(s,t,n)),t={cache:gg()},e.payload=t;return}t=t.return}}function h6(e,t,n){var s=as();n={lane:s,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},df(e)?E2(t,n):(n=hg(e,t,n,s),n!==null&&(rs(n,e,s),M2(n,t,s)))}function k2(e,t,n){var s=as();pc(e,t,n,s)}function pc(e,t,n,s){var r={lane:s,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(df(e))E2(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(r.hasEagerState=!0,r.eagerState=l,os(l,o))return rf(e,t,r,0),Ct===null&&af(),!1}catch{}finally{}if(n=hg(e,t,r,s),n!==null)return rs(n,e,s),M2(n,t,s),!0}return!1}function _g(e,t,n,s){if(s={lane:2,revertLane:Pg(),action:s,hasEagerState:!1,eagerState:null,next:null},df(e)){if(t)throw Error(oe(479))}else t=hg(e,n,s,2),t!==null&&rs(t,e,2)}function df(e){var t=e.alternate;return e===Je||t!==null&&t===Je}function E2(e,t){Oo=th=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function M2(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,b1(e,n)}}var sh={readContext:Nn,use:lf,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},T2={readContext:Nn,use:lf,useCallback:function(e,t){return On().memoizedState=[e,t===void 0?null:t],e},useContext:Nn,useEffect:Ob,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Eu(4194308,4,g2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Eu(4194308,4,e,t)},useInsertionEffect:function(e,t){Eu(4,2,e,t)},useMemo:function(e,t){var n=On();t=t===void 0?null:t;var s=e();if(Ti){Cr(!0);try{e()}finally{Cr(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=On();if(n!==void 0){var r=n(t);if(Ti){Cr(!0);try{n(t)}finally{Cr(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=h6.bind(null,Je,e),[s.memoizedState,e]},useRef:function(e){var t=On();return e={current:e},t.memoizedState=e},useState:function(e){e=Hx(e);var t=e.queue,n=k2.bind(null,Je,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Mg,useDeferredValue:function(e,t){var n=On();return Tg(n,e,t)},useTransition:function(){var e=Hx(!1);return e=w2.bind(null,Je,e.queue,!0,!1),On().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Je,r=On();if(ot){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),Ct===null)throw Error(oe(349));rt&124||n2(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,Ob(a2.bind(null,s,i,e),[e]),s.flags|=2048,Xo(9,cf(),s2.bind(null,s,i,n,t),null),n},useId:function(){var e=On(),t=Ct.identifierPrefix;if(ot){var n=$a,s=Ua;n=(s&~(1<<32-ss(s)-1)).toString(32)+n,t="«"+t+"R"+n,n=nh++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=i6++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Dg,useFormState:Db,useActionState:Db,useOptimistic:function(e){var t=On();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=_g.bind(null,Je,!0,n),n.dispatch=t,[e,t]},useMemoCache:kg,useCacheRefresh:function(){return On().memoizedState=u6.bind(null,Je)}},D2={readContext:Nn,use:lf,useCallback:b2,useContext:Nn,useEffect:f2,useImperativeHandle:p2,useInsertionEffect:m2,useLayoutEffect:x2,useMemo:v2,useReducer:ku,useRef:h2,useState:function(){return ku(Ga)},useDebugValue:Mg,useDeferredValue:function(e,t){var n=Zt();return y2(n,gt.memoizedState,e,t)},useTransition:function(){var e=ku(Ga)[0],t=Zt().memoizedState;return[typeof e=="boolean"?e:xd(e),t]},useSyncExternalStore:t2,useId:S2,useHostTransitionStatus:Dg,useFormState:_b,useActionState:_b,useOptimistic:function(e,t){var n=Zt();return o2(n,gt,e,t)},useMemoCache:kg,useCacheRefresh:C2},f6={readContext:Nn,use:lf,useCallback:b2,useContext:Nn,useEffect:f2,useImperativeHandle:p2,useInsertionEffect:m2,useLayoutEffect:x2,useMemo:v2,useReducer:fm,useRef:h2,useState:function(){return fm(Ga)},useDebugValue:Mg,useDeferredValue:function(e,t){var n=Zt();return gt===null?Tg(n,e,t):y2(n,gt.memoizedState,e,t)},useTransition:function(){var e=fm(Ga)[0],t=Zt().memoizedState;return[typeof e=="boolean"?e:xd(e),t]},useSyncExternalStore:t2,useId:S2,useHostTransitionStatus:Dg,useFormState:Ab,useActionState:Ab,useOptimistic:function(e,t){var n=Zt();return gt!==null?o2(n,gt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:kg,useCacheRefresh:C2},Ro=null,zc=0;function Fd(e){var t=zc;return zc+=1,Ro===null&&(Ro=[]),Z1(Ro,e,t)}function Ll(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Wd(e,t){throw t.$$typeof===Y5?Error(oe(525)):(e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function zb(e){var t=e._init;return t(e._payload)}function _2(e){function t(g,v){if(e){var p=g.deletions;p===null?(g.deletions=[v],g.flags|=16):p.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function s(g){for(var v=new Map;g!==null;)g.key!==null?v.set(g.key,g):v.set(g.index,g),g=g.sibling;return v}function r(g,v){return g=Ia(g,v),g.index=0,g.sibling=null,g}function i(g,v,p){return g.index=p,e?(p=g.alternate,p!==null?(p=p.index,p<v?(g.flags|=67108866,v):p):(g.flags|=67108866,v)):(g.flags|=1048576,v)}function o(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function l(g,v,p,j){return v===null||v.tag!==6?(v=dm(p,g.mode,j),v.return=g,v):(v=r(v,p),v.return=g,v)}function c(g,v,p,j){var N=p.type;return N===mo?h(g,v,p.props.children,j,p.key):v!==null&&(v.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===pr&&zb(N)===v.type)?(v=r(v,p.props),Ll(v,p),v.return=g,v):(v=Su(p.type,p.key,p.props,null,g.mode,j),Ll(v,p),v.return=g,v)}function u(g,v,p,j){return v===null||v.tag!==4||v.stateNode.containerInfo!==p.containerInfo||v.stateNode.implementation!==p.implementation?(v=um(p,g.mode,j),v.return=g,v):(v=r(v,p.children||[]),v.return=g,v)}function h(g,v,p,j,N){return v===null||v.tag!==7?(v=bi(p,g.mode,j,N),v.return=g,v):(v=r(v,p),v.return=g,v)}function d(g,v,p){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=dm(""+v,g.mode,p),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ld:return p=Su(v.type,v.key,v.props,null,g.mode,p),Ll(p,v),p.return=g,p;case tc:return v=um(v,g.mode,p),v.return=g,v;case pr:var j=v._init;return v=j(v._payload),d(g,v,p)}if(nc(v)||zl(v))return v=bi(v,g.mode,p,null),v.return=g,v;if(typeof v.then=="function")return d(g,Fd(v),p);if(v.$$typeof===Ra)return d(g,Yd(g,v),p);Wd(g,v)}return null}function f(g,v,p,j){var N=v!==null?v.key:null;if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return N!==null?null:l(g,v,""+p,j);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ld:return p.key===N?c(g,v,p,j):null;case tc:return p.key===N?u(g,v,p,j):null;case pr:return N=p._init,p=N(p._payload),f(g,v,p,j)}if(nc(p)||zl(p))return N!==null?null:h(g,v,p,j,null);if(typeof p.then=="function")return f(g,v,Fd(p),j);if(p.$$typeof===Ra)return f(g,v,Yd(g,p),j);Wd(g,p)}return null}function x(g,v,p,j,N){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return g=g.get(p)||null,l(v,g,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Ld:return g=g.get(j.key===null?p:j.key)||null,c(v,g,j,N);case tc:return g=g.get(j.key===null?p:j.key)||null,u(v,g,j,N);case pr:var C=j._init;return j=C(j._payload),x(g,v,p,j,N)}if(nc(j)||zl(j))return g=g.get(p)||null,h(v,g,j,N,null);if(typeof j.then=="function")return x(g,v,p,Fd(j),N);if(j.$$typeof===Ra)return x(g,v,p,Yd(v,j),N);Wd(v,j)}return null}function y(g,v,p,j){for(var N=null,C=null,S=v,M=v=0,A=null;S!==null&&M<p.length;M++){S.index>M?(A=S,S=null):A=S.sibling;var V=f(g,S,p[M],j);if(V===null){S===null&&(S=A);break}e&&S&&V.alternate===null&&t(g,S),v=i(V,v,M),C===null?N=V:C.sibling=V,C=V,S=A}if(M===p.length)return n(g,S),ot&&ci(g,M),N;if(S===null){for(;M<p.length;M++)S=d(g,p[M],j),S!==null&&(v=i(S,v,M),C===null?N=S:C.sibling=S,C=S);return ot&&ci(g,M),N}for(S=s(S);M<p.length;M++)A=x(S,g,M,p[M],j),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?M:A.key),v=i(A,v,M),C===null?N=A:C.sibling=A,C=A);return e&&S.forEach(function($){return t(g,$)}),ot&&ci(g,M),N}function b(g,v,p,j){if(p==null)throw Error(oe(151));for(var N=null,C=null,S=v,M=v=0,A=null,V=p.next();S!==null&&!V.done;M++,V=p.next()){S.index>M?(A=S,S=null):A=S.sibling;var $=f(g,S,V.value,j);if($===null){S===null&&(S=A);break}e&&S&&$.alternate===null&&t(g,S),v=i($,v,M),C===null?N=$:C.sibling=$,C=$,S=A}if(V.done)return n(g,S),ot&&ci(g,M),N;if(S===null){for(;!V.done;M++,V=p.next())V=d(g,V.value,j),V!==null&&(v=i(V,v,M),C===null?N=V:C.sibling=V,C=V);return ot&&ci(g,M),N}for(S=s(S);!V.done;M++,V=p.next())V=x(S,g,M,V.value,j),V!==null&&(e&&V.alternate!==null&&S.delete(V.key===null?M:V.key),v=i(V,v,M),C===null?N=V:C.sibling=V,C=V);return e&&S.forEach(function(z){return t(g,z)}),ot&&ci(g,M),N}function w(g,v,p,j){if(typeof p=="object"&&p!==null&&p.type===mo&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Ld:e:{for(var N=p.key;v!==null;){if(v.key===N){if(N=p.type,N===mo){if(v.tag===7){n(g,v.sibling),j=r(v,p.props.children),j.return=g,g=j;break e}}else if(v.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===pr&&zb(N)===v.type){n(g,v.sibling),j=r(v,p.props),Ll(j,p),j.return=g,g=j;break e}n(g,v);break}else t(g,v);v=v.sibling}p.type===mo?(j=bi(p.props.children,g.mode,j,p.key),j.return=g,g=j):(j=Su(p.type,p.key,p.props,null,g.mode,j),Ll(j,p),j.return=g,g=j)}return o(g);case tc:e:{for(N=p.key;v!==null;){if(v.key===N)if(v.tag===4&&v.stateNode.containerInfo===p.containerInfo&&v.stateNode.implementation===p.implementation){n(g,v.sibling),j=r(v,p.children||[]),j.return=g,g=j;break e}else{n(g,v);break}else t(g,v);v=v.sibling}j=um(p,g.mode,j),j.return=g,g=j}return o(g);case pr:return N=p._init,p=N(p._payload),w(g,v,p,j)}if(nc(p))return y(g,v,p,j);if(zl(p)){if(N=zl(p),typeof N!="function")throw Error(oe(150));return p=N.call(p),b(g,v,p,j)}if(typeof p.then=="function")return w(g,v,Fd(p),j);if(p.$$typeof===Ra)return w(g,v,Yd(g,p),j);Wd(g,p)}return typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint"?(p=""+p,v!==null&&v.tag===6?(n(g,v.sibling),j=r(v,p),j.return=g,g=j):(n(g,v),j=dm(p,g.mode,j),j.return=g,g=j),o(g)):n(g,v)}return function(g,v,p,j){try{zc=0;var N=w(g,v,p,j);return Ro=null,N}catch(S){if(S===md||S===of)throw S;var C=es(29,S,null,g.mode);return C.lanes=j,C.return=g,C}finally{}}}var Zo=_2(!0),A2=_2(!1),Ms=pa(null),ha=null;function wr(e){var t=e.alternate;Rt(on,on.current&1),Rt(Ms,e),ha===null&&(t===null||Go.current!==null||t.memoizedState!==null)&&(ha=e)}function O2(e){if(e.tag===22){if(Rt(on,on.current),Rt(Ms,e),ha===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(ha=e)}}else jr()}function jr(){Rt(on,on.current),Rt(Ms,Ms.current)}function Pa(e){fn(Ms),ha===e&&(ha=null),fn(on)}var on=pa(0);function ah(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||r0(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function mm(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:At({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Yx={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=as(),r=_r(s);r.payload=t,n!=null&&(r.callback=n),t=Ar(e,r,s),t!==null&&(rs(t,e,s),mc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=as(),r=_r(s);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=Ar(e,r,s),t!==null&&(rs(t,e,s),mc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=as(),s=_r(n);s.tag=2,t!=null&&(s.callback=t),t=Ar(e,s,n),t!==null&&(rs(t,e,n),mc(t,e,n))}};function Rb(e,t,n,s,r,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,o):t.prototype&&t.prototype.isPureReactComponent?!_c(n,s)||!_c(r,i):!0}function Ub(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Yx.enqueueReplaceState(t,t.state,null)}function Di(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=At({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var rh=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function z2(e){rh(e)}function R2(e){console.error(e)}function U2(e){rh(e)}function ih(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function $b(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Ix(e,t,n){return n=_r(n),n.tag=3,n.payload={element:null},n.callback=function(){ih(e,t)},n}function $2(e){return e=_r(e),e.tag=3,e}function L2(e,t,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=s.value;e.payload=function(){return r(i)},e.callback=function(){$b(t,n,s)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){$b(t,n,s),typeof r!="function"&&(Or===null?Or=new Set([this]):Or.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function m6(e,t,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&hd(t,n,r,!0),n=Ms.current,n!==null){switch(n.tag){case 13:return ha===null?Kx():n.alternate===null&&Yt===0&&(Yt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===Ux?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),Cm(e,s,r)),!1;case 22:return n.flags|=65536,s===Ux?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),Cm(e,s,r)),!1}throw Error(oe(435,n.tag))}return Cm(e,s,r),Kx(),!1}if(ot)return t=Ms.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==_x&&(e=Error(oe(422),{cause:s}),Ac(Cs(e,n)))):(s!==_x&&(t=Error(oe(423),{cause:s}),Ac(Cs(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=Cs(s,n),r=Ix(e.stateNode,s,r),hm(e,r),Yt!==4&&(Yt=2)),!1;var i=Error(oe(520),{cause:s});if(i=Cs(i,n),yc===null?yc=[i]:yc.push(i),Yt!==4&&(Yt=2),t===null)return!0;s=Cs(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Ix(n.stateNode,s,e),hm(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Or===null||!Or.has(i))))return n.flags|=65536,r&=-r,n.lanes|=r,r=$2(r),L2(r,e,n,s),hm(n,r),!1}n=n.return}while(n!==null);return!1}var P2=Error(oe(461)),hn=!1;function xn(e,t,n,s){t.child=e===null?A2(t,null,n,s):Zo(t,e.child,n,s)}function Lb(e,t,n,s,r){n=n.render;var i=t.ref;if("ref"in s){var o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}else o=s;return Mi(t),s=wg(e,t,n,o,i,r),l=jg(),e!==null&&!hn?(Ng(e,t,r),Xa(e,t,r)):(ot&&l&&mg(t),t.flags|=1,xn(e,t,s,r),t.child)}function Pb(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!fg(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,H2(e,t,i,s,r)):(e=Su(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Ag(e,r)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:_c,n(o,s)&&e.ref===t.ref)return Xa(e,t,r)}return t.flags|=1,e=Ia(i,s),e.ref=t.ref,e.return=t,t.child=e}function H2(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(_c(i,s)&&e.ref===t.ref)if(hn=!1,t.pendingProps=s=i,Ag(e,r))e.flags&131072&&(hn=!0);else return t.lanes=e.lanes,Xa(e,t,r)}return Fx(e,t,n,s,r)}function B2(e,t,n){var s=t.pendingProps,r=s.children,i=e!==null?e.memoizedState:null;if(s.mode==="hidden"){if(t.flags&128){if(s=i!==null?i.baseLanes|n:n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;t.childLanes=i&~s}else t.childLanes=0,t.child=null;return Hb(e,t,s,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Cu(t,i!==null?i.cachePool:null),i!==null?Eb(t,i):Px(),O2(t);else return t.lanes=t.childLanes=536870912,Hb(e,t,i!==null?i.baseLanes|n:n,n)}else i!==null?(Cu(t,i.cachePool),Eb(t,i),jr(),t.memoizedState=null):(e!==null&&Cu(t,null),Px(),jr());return xn(e,t,r,n),t.child}function Hb(e,t,n,s){var r=pg();return r=r===null?null:{parent:sn._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Cu(t,null),Px(),O2(t),e!==null&&hd(e,t,s,!0),null}function Mu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(oe(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Fx(e,t,n,s,r){return Mi(t),n=wg(e,t,n,s,void 0,r),s=jg(),e!==null&&!hn?(Ng(e,t,r),Xa(e,t,r)):(ot&&s&&mg(t),t.flags|=1,xn(e,t,n,r),t.child)}function Bb(e,t,n,s,r,i){return Mi(t),t.updateQueue=null,n=e2(t,s,n,r),J1(e),s=jg(),e!==null&&!hn?(Ng(e,t,i),Xa(e,t,i)):(ot&&s&&mg(t),t.flags|=1,xn(e,t,n,i),t.child)}function Vb(e,t,n,s,r){if(Mi(t),t.stateNode===null){var i=jo,o=n.contextType;typeof o=="object"&&o!==null&&(i=Nn(o)),i=new n(s,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Yx,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=s,i.state=t.memoizedState,i.refs={},bg(t),o=n.contextType,i.context=typeof o=="object"&&o!==null?Nn(o):jo,i.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(mm(t,n,o,s),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&Yx.enqueueReplaceState(i,i.state,null),gc(t,s,i,r),xc(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=Di(n,l);i.props=c;var u=i.context,h=n.contextType;o=jo,typeof h=="object"&&h!==null&&(o=Nn(h));var d=n.getDerivedStateFromProps;h=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,h||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||u!==o)&&Ub(t,i,s,o),br=!1;var f=t.memoizedState;i.state=f,gc(t,s,i,r),xc(),u=t.memoizedState,l||f!==u||br?(typeof d=="function"&&(mm(t,n,d,s),u=t.memoizedState),(c=br||Rb(t,n,c,s,f,u,o))?(h||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=u),i.props=s,i.state=u,i.context=o,s=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,$x(e,t),o=t.memoizedProps,h=Di(n,o),i.props=h,d=t.pendingProps,f=i.context,u=n.contextType,c=jo,typeof u=="object"&&u!==null&&(c=Nn(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==d||f!==c)&&Ub(t,i,s,c),br=!1,f=t.memoizedState,i.state=f,gc(t,s,i,r),xc();var x=t.memoizedState;o!==d||f!==x||br||e!==null&&e.dependencies!==null&&Ju(e.dependencies)?(typeof l=="function"&&(mm(t,n,l,s),x=t.memoizedState),(h=br||Rb(t,n,h,s,f,x,c)||e!==null&&e.dependencies!==null&&Ju(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,x,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,x,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=x),i.props=s,i.state=x,i.context=c,s=h):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return i=s,Mu(e,t),s=(t.flags&128)!==0,i||s?(i=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&s?(t.child=Zo(t,e.child,null,r),t.child=Zo(t,null,n,r)):xn(e,t,n,r),t.memoizedState=i.state,e=t.child):e=Xa(e,t,r),e}function Yb(e,t,n,s){return ud(),t.flags|=256,xn(e,t,n,s),t.child}var xm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gm(e){return{baseLanes:e,cachePool:G1()}}function pm(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Es),e}function V2(e,t,n){var s=t.pendingProps,r=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(on.current&2)!==0),o&&(r=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ot){if(r?wr(t):jr(),ot){var l=Bt,c;if(c=l){e:{for(c=l,l=ra;c.nodeType!==8;){if(!l){l=null;break e}if(c=Vs(c.nextSibling),c===null){l=null;break e}}l=c}l!==null?(t.memoizedState={dehydrated:l,treeContext:vi!==null?{id:Ua,overflow:$a}:null,retryLane:536870912,hydrationErrors:null},c=es(18,null,null,0),c.stateNode=l,c.return=t,t.child=c,En=t,Bt=null,c=!0):c=!1}c||Ei(t)}if(l=t.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return r0(l)?t.lanes=32:t.lanes=536870912,null;Pa(t)}return l=s.children,s=s.fallback,r?(jr(),r=t.mode,l=oh({mode:"hidden",children:l},r),s=bi(s,r,n,null),l.return=t,s.return=t,l.sibling=s,t.child=l,r=t.child,r.memoizedState=gm(n),r.childLanes=pm(e,o,n),t.memoizedState=xm,s):(wr(t),Wx(t,l))}if(c=e.memoizedState,c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(wr(t),t.flags&=-257,t=bm(e,t,n)):t.memoizedState!==null?(jr(),t.child=e.child,t.flags|=128,t=null):(jr(),r=s.fallback,l=t.mode,s=oh({mode:"visible",children:s.children},l),r=bi(r,l,n,null),r.flags|=2,s.return=t,r.return=t,s.sibling=r,t.child=s,Zo(t,e.child,null,n),s=t.child,s.memoizedState=gm(n),s.childLanes=pm(e,o,n),t.memoizedState=xm,t=r);else if(wr(t),r0(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var u=o.dgst;o=u,s=Error(oe(419)),s.stack="",s.digest=o,Ac({value:s,source:null,stack:null}),t=bm(e,t,n)}else if(hn||hd(e,t,n,!1),o=(n&e.childLanes)!==0,hn||o){if(o=Ct,o!==null&&(s=n&-n,s=s&42?1:ng(s),s=s&(o.suspendedLanes|n)?0:s,s!==0&&s!==c.retryLane))throw c.retryLane=s,pl(e,s),rs(o,e,s),P2;l.data==="$?"||Kx(),t=bm(e,t,n)}else l.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Bt=Vs(l.nextSibling),En=t,ot=!0,yi=null,ra=!1,e!==null&&(bs[vs++]=Ua,bs[vs++]=$a,bs[vs++]=vi,Ua=e.id,$a=e.overflow,vi=t),t=Wx(t,s.children),t.flags|=4096);return t}return r?(jr(),r=s.fallback,l=t.mode,c=e.child,u=c.sibling,s=Ia(c,{mode:"hidden",children:s.children}),s.subtreeFlags=c.subtreeFlags&65011712,u!==null?r=Ia(u,r):(r=bi(r,l,n,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,s=r,r=t.child,l=e.child.memoizedState,l===null?l=gm(n):(c=l.cachePool,c!==null?(u=sn._currentValue,c=c.parent!==u?{parent:u,pool:u}:c):c=G1(),l={baseLanes:l.baseLanes|n,cachePool:c}),r.memoizedState=l,r.childLanes=pm(e,o,n),t.memoizedState=xm,s):(wr(t),n=e.child,e=n.sibling,n=Ia(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Wx(e,t){return t=oh({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function oh(e,t){return e=es(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function bm(e,t,n){return Zo(t,e.child,null,n),e=Wx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ib(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Ox(e.return,t,n)}function vm(e,t,n,s,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=n,i.tailMode=r)}function Y2(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;if(xn(e,t,s.children,n),s=on.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ib(e,n,t);else if(e.tag===19)Ib(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}switch(Rt(on,s),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ah(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),vm(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ah(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}vm(t,!0,n,null,i);break;case"together":vm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ir|=t.lanes,!(n&t.childLanes))if(e!==null){if(hd(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=Ia(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ia(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ag(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Ju(e)))}function x6(e,t,n){switch(t.tag){case 3:Fu(t,t.stateNode.containerInfo),yr(t,sn,e.memoizedState.cache),ud();break;case 27:case 5:wx(t);break;case 4:Fu(t,t.stateNode.containerInfo);break;case 10:yr(t,t.type,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(wr(t),t.flags|=128,null):n&t.child.childLanes?V2(e,t,n):(wr(t),e=Xa(e,t,n),e!==null?e.sibling:null);wr(t);break;case 19:var r=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(hd(e,t,n,!1),s=(n&t.childLanes)!==0),r){if(s)return Y2(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Rt(on,on.current),s)break;return null;case 22:case 23:return t.lanes=0,B2(e,t,n);case 24:yr(t,sn,e.memoizedState.cache)}return Xa(e,t,n)}function I2(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)hn=!0;else{if(!Ag(e,n)&&!(t.flags&128))return hn=!1,x6(e,t,n);hn=!!(e.flags&131072)}else hn=!1,ot&&t.flags&1048576&&W1(t,Ku,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var s=t.elementType,r=s._init;if(s=r(s._payload),t.type=s,typeof s=="function")fg(s)?(e=Di(s,e),t.tag=1,t=Vb(null,t,s,e,n)):(t.tag=0,t=Fx(null,t,s,e,n));else{if(s!=null){if(r=s.$$typeof,r===J0){t.tag=11,t=Lb(null,t,s,e,n);break e}else if(r===eg){t.tag=14,t=Pb(null,t,s,e,n);break e}}throw t=vx(s)||s,Error(oe(306,t,""))}}return t;case 0:return Fx(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,r=Di(s,t.pendingProps),Vb(e,t,s,r,n);case 3:e:{if(Fu(t,t.stateNode.containerInfo),e===null)throw Error(oe(387));s=t.pendingProps;var i=t.memoizedState;r=i.element,$x(e,t),gc(t,s,null,n);var o=t.memoizedState;if(s=o.cache,yr(t,sn,s),s!==i.cache&&zx(t,[sn],n,!0),xc(),s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Yb(e,t,s,n);break e}else if(s!==r){r=Cs(Error(oe(424)),t),Ac(r),t=Yb(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Bt=Vs(e.firstChild),En=t,ot=!0,yi=null,ra=!0,n=A2(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ud(),s===r){t=Xa(e,t,n);break e}xn(e,t,s,n)}t=t.child}return t;case 26:return Mu(e,t),e===null?(n=ov(t.type,null,t.pendingProps,null))?t.memoizedState=n:ot||(n=t.type,e=t.pendingProps,s=mh(Dr.current).createElement(n),s[jn]=t,s[Pn]=e,pn(s,n,e),un(s),t.stateNode=s):t.memoizedState=ov(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return wx(t),e===null&&ot&&(s=t.stateNode=Dj(t.type,t.pendingProps,Dr.current),En=t,ra=!0,r=Bt,Kr(t.type)?(i0=r,Bt=Vs(s.firstChild)):Bt=r),xn(e,t,t.pendingProps.children,n),Mu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ot&&((r=s=Bt)&&(s=Y6(s,t.type,t.pendingProps,ra),s!==null?(t.stateNode=s,En=t,Bt=Vs(s.firstChild),ra=!1,r=!0):r=!1),r||Ei(t)),wx(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,s0(r,i)?s=null:o!==null&&s0(r,o)&&(t.flags|=32),t.memoizedState!==null&&(r=wg(e,t,o6,null,null,n),Lc._currentValue=r),Mu(e,t),xn(e,t,s,n),t.child;case 6:return e===null&&ot&&((e=n=Bt)&&(n=I6(n,t.pendingProps,ra),n!==null?(t.stateNode=n,En=t,Bt=null,e=!0):e=!1),e||Ei(t)),null;case 13:return V2(e,t,n);case 4:return Fu(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Zo(t,null,s,n):xn(e,t,s,n),t.child;case 11:return Lb(e,t,t.type,t.pendingProps,n);case 7:return xn(e,t,t.pendingProps,n),t.child;case 8:return xn(e,t,t.pendingProps.children,n),t.child;case 12:return xn(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,yr(t,t.type,s.value),xn(e,t,s.children,n),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,Mi(t),r=Nn(r),s=s(r),t.flags|=1,xn(e,t,s,n),t.child;case 14:return Pb(e,t,t.type,t.pendingProps,n);case 15:return H2(e,t,t.type,t.pendingProps,n);case 19:return Y2(e,t,n);case 31:return s=t.pendingProps,n=t.mode,s={mode:s.mode,children:s.children},e===null?(n=oh(s,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Ia(e.child,s),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return B2(e,t,n);case 24:return Mi(t),s=Nn(sn),e===null?(r=pg(),r===null&&(r=Ct,i=gg(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=n),r=i),t.memoizedState={parent:s,cache:r},bg(t),yr(t,sn,r)):(e.lanes&n&&($x(e,t),gc(t,null,null,n),xc()),r=e.memoizedState,i=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),yr(t,sn,s)):(s=i.cache,yr(t,sn,s),s!==r.cache&&zx(t,[sn],n,!0))),xn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(oe(156,t.tag))}function Ea(e){e.flags|=4}function Fb(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Oj(t)){if(t=Ms.current,t!==null&&((rt&4194048)===rt?ha!==null:(rt&62914560)!==rt&&!(rt&536870912)||t!==ha))throw fc=Ux,X1;e.flags|=8192}}function qd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?g1():536870912,e.lanes|=t,Qo|=t)}function Pl(e,t){if(!ot)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function $t(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function g6(e,t,n){var s=t.pendingProps;switch(xg(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(t),null;case 1:return $t(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Fa(sn),Io(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&($l(t)?Ea(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wb())),$t(t),null;case 26:return n=t.memoizedState,e===null?(Ea(t),n!==null?($t(t),Fb(t,n)):($t(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Ea(t),$t(t),Fb(t,n)):($t(t),t.flags&=-16777217):(e.memoizedProps!==s&&Ea(t),$t(t),t.flags&=-16777217),null;case 27:Wu(t),n=Dr.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ea(t);else{if(!s){if(t.stateNode===null)throw Error(oe(166));return $t(t),null}e=da.current,$l(t)?vb(t):(e=Dj(r,s,n),t.stateNode=e,Ea(t))}return $t(t),null;case 5:if(Wu(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ea(t);else{if(!s){if(t.stateNode===null)throw Error(oe(166));return $t(t),null}if(e=da.current,$l(t))vb(t);else{switch(r=mh(Dr.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof s.is=="string"?r.createElement("select",{is:s.is}):r.createElement("select"),s.multiple?e.multiple=!0:s.size&&(e.size=s.size);break;default:e=typeof s.is=="string"?r.createElement(n,{is:s.is}):r.createElement(n)}}e[jn]=t,e[Pn]=s;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(pn(e,n,s),n){case"button":case"input":case"select":case"textarea":e=!!s.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Ea(t)}}return $t(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ea(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(oe(166));if(e=Dr.current,$l(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,r=En,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[jn]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||Ej(e.nodeValue,n)),e||Ei(t)}else e=mh(e).createTextNode(s),e[jn]=t,t.stateNode=e}return $t(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=$l(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(oe(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(oe(317));r[jn]=t}else ud(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$t(t),r=!1}else r=wb(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Pa(t),t):(Pa(t),null)}if(Pa(t),t.flags&128)return t.lanes=n,t;if(n=s!==null,e=e!==null&&e.memoizedState!==null,n){s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool);var i=null;s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==r&&(s.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),qd(t,t.updateQueue),$t(t),null;case 4:return Io(),e===null&&Hg(t.stateNode.containerInfo),$t(t),null;case 10:return Fa(t.type),$t(t),null;case 19:if(fn(on),r=t.memoizedState,r===null)return $t(t),null;if(s=(t.flags&128)!==0,i=r.rendering,i===null)if(s)Pl(r,!1);else{if(Yt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=ah(e),i!==null){for(t.flags|=128,Pl(r,!1),e=i.updateQueue,t.updateQueue=e,qd(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)F1(n,e),n=n.sibling;return Rt(on,on.current&1|2),t.child}e=e.sibling}r.tail!==null&&ua()>ch&&(t.flags|=128,s=!0,Pl(r,!1),t.lanes=4194304)}else{if(!s)if(e=ah(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,qd(t,e),Pl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!ot)return $t(t),null}else 2*ua()-r.renderingStartTime>ch&&n!==536870912&&(t.flags|=128,s=!0,Pl(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=ua(),t.sibling=null,e=on.current,Rt(on,s?e&1|2:e&1),t):($t(t),null);case 22:case 23:return Pa(t),vg(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&($t(t),t.subtreeFlags&6&&(t.flags|=8192)):$t(t),n=t.updateQueue,n!==null&&qd(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&fn(wi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fa(sn),$t(t),null;case 25:return null;case 30:return null}throw Error(oe(156,t.tag))}function p6(e,t){switch(xg(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fa(sn),Io(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Wu(t),null;case 13:if(Pa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));ud()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fn(on),null;case 4:return Io(),null;case 10:return Fa(t.type),null;case 22:case 23:return Pa(t),vg(),e!==null&&fn(wi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fa(sn),null;case 25:return null;default:return null}}function F2(e,t){switch(xg(t),t.tag){case 3:Fa(sn),Io();break;case 26:case 27:case 5:Wu(t);break;case 4:Io();break;case 13:Pa(t);break;case 19:fn(on);break;case 10:Fa(t.type);break;case 22:case 23:Pa(t),vg(),e!==null&&fn(wi);break;case 24:Fa(sn)}}function pd(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){s=void 0;var i=n.create,o=n.inst;s=i(),o.destroy=s}n=n.next}while(n!==r)}}catch(l){Nt(t,t.return,l)}}function Yr(e,t,n){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var i=r.next;s=i;do{if((s.tag&e)===e){var o=s.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(h){Nt(r,c,h)}}}s=s.next}while(s!==i)}}catch(h){Nt(t,t.return,h)}}function W2(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{K1(t,n)}catch(s){Nt(e,e.return,s)}}}function q2(e,t,n){n.props=Di(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Nt(e,t,s)}}function bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(r){Nt(e,t,r)}}function oa(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){Nt(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Nt(e,t,r)}else n.current=null}function G2(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){Nt(e,e.return,r)}}function ym(e,t,n){try{var s=e.stateNode;L6(s,e.type,n,t),s[Pn]=t}catch(r){Nt(e,e.return,r)}}function X2(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kr(e.type)||e.tag===4}function wm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||X2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Kr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qx(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mf));else if(s!==4&&(s===27&&Kr(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qx(e,t,n),e=e.sibling;e!==null;)qx(e,t,n),e=e.sibling}function lh(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Kr(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(lh(e,t,n),e=e.sibling;e!==null;)lh(e,t,n),e=e.sibling}function Z2(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);pn(t,s,n),t[jn]=e,t[Pn]=n}catch(i){Nt(e,e.return,i)}}var Oa=!1,qt=!1,jm=!1,Wb=typeof WeakSet=="function"?WeakSet:Set,dn=null;function b6(e,t){if(e=e.containerInfo,t0=bh,e=$1(e),dg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var x;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==i||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===i&&++h===s&&(c=o),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(n0={focusedElem:e,selectionRange:n},bh=!1,dn=t;dn!==null;)if(t=dn,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,dn=e;else for(;dn!==null;){switch(t=dn,i=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,r=i.memoizedProps,i=i.memoizedState,s=n.stateNode;try{var y=Di(n.type,r,n.elementType===n.type);e=s.getSnapshotBeforeUpdate(y,i),s.__reactInternalSnapshotBeforeUpdate=e}catch(b){Nt(n,n.return,b)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)a0(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":a0(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(oe(163))}if(e=t.sibling,e!==null){e.return=t.return,dn=e;break}dn=t.return}}function Q2(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:or(e,n),s&4&&pd(5,n);break;case 1:if(or(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){Nt(n,n.return,o)}else{var r=Di(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Nt(n,n.return,o)}}s&64&&W2(n),s&512&&bc(n,n.return);break;case 3:if(or(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{K1(e,t)}catch(o){Nt(n,n.return,o)}}break;case 27:t===null&&s&4&&Z2(n);case 26:case 5:or(e,n),t===null&&s&4&&G2(n),s&512&&bc(n,n.return);break;case 12:or(e,n);break;case 13:or(e,n),s&4&&ej(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=E6.bind(null,n),F6(e,n))));break;case 22:if(s=n.memoizedState!==null||Oa,!s){t=t!==null&&t.memoizedState!==null||qt,r=Oa;var i=qt;Oa=s,(qt=t)&&!i?mr(e,n,(n.subtreeFlags&8772)!==0):or(e,n),Oa=r,qt=i}break;case 30:break;default:or(e,n)}}function K2(e){var t=e.alternate;t!==null&&(e.alternate=null,K2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ag(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ot=null,zn=!1;function Ma(e,t,n){for(n=n.child;n!==null;)J2(e,t,n),n=n.sibling}function J2(e,t,n){if(ns&&typeof ns.onCommitFiberUnmount=="function")try{ns.onCommitFiberUnmount(id,n)}catch{}switch(n.tag){case 26:qt||oa(n,t),Ma(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:qt||oa(n,t);var s=Ot,r=zn;Kr(n.type)&&(Ot=n.stateNode,zn=!1),Ma(e,t,n),jc(n.stateNode),Ot=s,zn=r;break;case 5:qt||oa(n,t);case 6:if(s=Ot,r=zn,Ot=null,Ma(e,t,n),Ot=s,zn=r,Ot!==null)if(zn)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(n.stateNode)}catch(i){Nt(n,t,i)}else try{Ot.removeChild(n.stateNode)}catch(i){Nt(n,t,i)}break;case 18:Ot!==null&&(zn?(e=Ot,av(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Bc(e)):av(Ot,n.stateNode));break;case 4:s=Ot,r=zn,Ot=n.stateNode.containerInfo,zn=!0,Ma(e,t,n),Ot=s,zn=r;break;case 0:case 11:case 14:case 15:qt||Yr(2,n,t),qt||Yr(4,n,t),Ma(e,t,n);break;case 1:qt||(oa(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&q2(n,t,s)),Ma(e,t,n);break;case 21:Ma(e,t,n);break;case 22:qt=(s=qt)||n.memoizedState!==null,Ma(e,t,n),qt=s;break;default:Ma(e,t,n)}}function ej(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bc(e)}catch(n){Nt(t,t.return,n)}}function v6(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Wb),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Wb),t;default:throw Error(oe(435,e.tag))}}function Nm(e,t){var n=v6(e);t.forEach(function(s){var r=M6.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}function Yn(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Kr(l.type)){Ot=l.stateNode,zn=!1;break e}break;case 5:Ot=l.stateNode,zn=!1;break e;case 3:case 4:Ot=l.stateNode.containerInfo,zn=!0;break e}l=l.return}if(Ot===null)throw Error(oe(160));J2(i,o,r),Ot=null,zn=!1,i=r.alternate,i!==null&&(i.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)tj(t,e),t=t.sibling}var Rs=null;function tj(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Yn(t,e),In(e),s&4&&(Yr(3,e,e.return),pd(3,e),Yr(5,e,e.return));break;case 1:Yn(t,e),In(e),s&512&&(qt||n===null||oa(n,n.return)),s&64&&Oa&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var r=Rs;if(Yn(t,e),In(e),s&512&&(qt||n===null||oa(n,n.return)),s&4){var i=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":i=r.getElementsByTagName("title")[0],(!i||i[cd]||i[jn]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=r.createElement(s),r.head.insertBefore(i,r.querySelector("head > title"))),pn(i,s,n),i[jn]=e,un(i),s=i;break e;case"link":var o=cv("link","href",r).get(s+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}i=r.createElement(s),pn(i,s,n),r.head.appendChild(i);break;case"meta":if(o=cv("meta","content",r).get(s+(n.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}i=r.createElement(s),pn(i,s,n),r.head.appendChild(i);break;default:throw Error(oe(468,s))}i[jn]=e,un(i),s=i}e.stateNode=s}else dv(r,e.type,e.stateNode);else e.stateNode=lv(r,s,e.memoizedProps);else i!==s?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,s===null?dv(r,e.type,e.stateNode):lv(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&ym(e,e.memoizedProps,n.memoizedProps)}break;case 27:Yn(t,e),In(e),s&512&&(qt||n===null||oa(n,n.return)),n!==null&&s&4&&ym(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Yn(t,e),In(e),s&512&&(qt||n===null||oa(n,n.return)),e.flags&32){r=e.stateNode;try{Wo(r,"")}catch(x){Nt(e,e.return,x)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,ym(e,r,n!==null?n.memoizedProps:r)),s&1024&&(jm=!0);break;case 6:if(Yn(t,e),In(e),s&4){if(e.stateNode===null)throw Error(oe(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(x){Nt(e,e.return,x)}}break;case 3:if(_u=null,r=Rs,Rs=xh(t.containerInfo),Yn(t,e),Rs=r,In(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Bc(t.containerInfo)}catch(x){Nt(e,e.return,x)}jm&&(jm=!1,nj(e));break;case 4:s=Rs,Rs=xh(e.stateNode.containerInfo),Yn(t,e),In(e),Rs=s;break;case 12:Yn(t,e),In(e);break;case 13:Yn(t,e),In(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($g=ua()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Nm(e,s)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,u=Oa,h=qt;if(Oa=u||r,qt=h||c,Yn(t,e),qt=h,Oa=u,In(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||Oa||qt||di(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(i=c.stateNode,r)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var d=c.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;l.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(x){Nt(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(x){Nt(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Nm(e,n))));break;case 19:Yn(t,e),In(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Nm(e,s)));break;case 30:break;case 21:break;default:Yn(t,e),In(e)}}function In(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(X2(s)){n=s;break}s=s.return}if(n==null)throw Error(oe(160));switch(n.tag){case 27:var r=n.stateNode,i=wm(e);lh(e,i,r);break;case 5:var o=n.stateNode;n.flags&32&&(Wo(o,""),n.flags&=-33);var l=wm(e);lh(e,l,o);break;case 3:case 4:var c=n.stateNode.containerInfo,u=wm(e);qx(e,u,c);break;default:throw Error(oe(161))}}catch(h){Nt(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function nj(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;nj(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function or(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Q2(e,t.alternate,t),t=t.sibling}function di(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Yr(4,t,t.return),di(t);break;case 1:oa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&q2(t,t.return,n),di(t);break;case 27:jc(t.stateNode);case 26:case 5:oa(t,t.return),di(t);break;case 22:t.memoizedState===null&&di(t);break;case 30:di(t);break;default:di(t)}e=e.sibling}}function mr(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:mr(r,i,n),pd(4,i);break;case 1:if(mr(r,i,n),s=i,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){Nt(s,s.return,u)}if(s=i,r=s.updateQueue,r!==null){var l=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)Q1(c[r],l)}catch(u){Nt(s,s.return,u)}}n&&o&64&&W2(i),bc(i,i.return);break;case 27:Z2(i);case 26:case 5:mr(r,i,n),n&&s===null&&o&4&&G2(i),bc(i,i.return);break;case 12:mr(r,i,n);break;case 13:mr(r,i,n),n&&o&4&&ej(r,i);break;case 22:i.memoizedState===null&&mr(r,i,n),bc(i,i.return);break;case 30:break;default:mr(r,i,n)}t=t.sibling}}function Og(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&fd(n))}function zg(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fd(e))}function Ks(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sj(e,t,n,s),t=t.sibling}function sj(e,t,n,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Ks(e,t,n,s),r&2048&&pd(9,t);break;case 1:Ks(e,t,n,s);break;case 3:Ks(e,t,n,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fd(e)));break;case 12:if(r&2048){Ks(e,t,n,s),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Nt(t,t.return,c)}}else Ks(e,t,n,s);break;case 13:Ks(e,t,n,s);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Ks(e,t,n,s):vc(e,t):i._visibility&2?Ks(e,t,n,s):(i._visibility|=2,co(e,t,n,s,(t.subtreeFlags&10256)!==0)),r&2048&&Og(o,t);break;case 24:Ks(e,t,n,s),r&2048&&zg(t.alternate,t);break;default:Ks(e,t,n,s)}}function co(e,t,n,s,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var i=e,o=t,l=n,c=s,u=o.flags;switch(o.tag){case 0:case 11:case 15:co(i,o,l,c,r),pd(8,o);break;case 23:break;case 22:var h=o.stateNode;o.memoizedState!==null?h._visibility&2?co(i,o,l,c,r):vc(i,o):(h._visibility|=2,co(i,o,l,c,r)),r&&u&2048&&Og(o.alternate,o);break;case 24:co(i,o,l,c,r),r&&u&2048&&zg(o.alternate,o);break;default:co(i,o,l,c,r)}t=t.sibling}}function vc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,r=s.flags;switch(s.tag){case 22:vc(n,s),r&2048&&Og(s.alternate,s);break;case 24:vc(n,s),r&2048&&zg(s.alternate,s);break;default:vc(n,s)}t=t.sibling}}var ac=8192;function Ji(e){if(e.subtreeFlags&ac)for(e=e.child;e!==null;)aj(e),e=e.sibling}function aj(e){switch(e.tag){case 26:Ji(e),e.flags&ac&&e.memoizedState!==null&&ak(Rs,e.memoizedState,e.memoizedProps);break;case 5:Ji(e);break;case 3:case 4:var t=Rs;Rs=xh(e.stateNode.containerInfo),Ji(e),Rs=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ac,ac=16777216,Ji(e),ac=t):Ji(e));break;default:Ji(e)}}function rj(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];dn=s,oj(s,e)}rj(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ij(e),e=e.sibling}function ij(e){switch(e.tag){case 0:case 11:case 15:Hl(e),e.flags&2048&&Yr(9,e,e.return);break;case 3:Hl(e);break;case 12:Hl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Tu(e)):Hl(e);break;default:Hl(e)}}function Tu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];dn=s,oj(s,e)}rj(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Yr(8,t,t.return),Tu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Tu(t));break;default:Tu(t)}e=e.sibling}}function oj(e,t){for(;dn!==null;){var n=dn;switch(n.tag){case 0:case 11:case 15:Yr(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:fd(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,dn=s;else e:for(n=e;dn!==null;){s=dn;var r=s.sibling,i=s.return;if(K2(s),s===n){dn=null;break e}if(r!==null){r.return=i,dn=r;break e}dn=i}}}var y6={getCacheForType:function(e){var t=Nn(sn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},w6=typeof WeakMap=="function"?WeakMap:Map,mt=0,Ct=null,at=null,rt=0,ft=0,Xn=null,Er=!1,bl=!1,Rg=!1,Za=0,Yt=0,Ir=0,ji=0,Ug=0,Es=0,Qo=0,yc=null,Rn=null,Gx=!1,$g=0,ch=1/0,dh=null,Or=null,gn=0,zr=null,Ko=null,Uo=0,Xx=0,Zx=null,lj=null,wc=0,Qx=null;function as(){if(mt&2&&rt!==0)return rt&-rt;if(Ye.T!==null){var e=qo;return e!==0?e:Pg()}return v1()}function cj(){Es===0&&(Es=!(rt&536870912)||ot?x1():536870912);var e=Ms.current;return e!==null&&(e.flags|=32),Es}function rs(e,t,n){(e===Ct&&(ft===2||ft===9)||e.cancelPendingCommit!==null)&&(Jo(e,0),Mr(e,rt,Es,!1)),ld(e,n),(!(mt&2)||e!==Ct)&&(e===Ct&&(!(mt&2)&&(ji|=n),Yt===4&&Mr(e,rt,Es,!1)),ba(e))}function dj(e,t,n){if(mt&6)throw Error(oe(327));var s=!n&&(t&124)===0&&(t&e.expiredLanes)===0||od(e,t),r=s?S6(e,t):Sm(e,t,!0),i=s;do{if(r===0){bl&&!s&&Mr(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!j6(n)){r=Sm(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;r=yc;var c=l.current.memoizedState.isDehydrated;if(c&&(Jo(l,o).flags|=256),o=Sm(l,o,!1),o!==2){if(Rg&&!c){l.errorRecoveryDisabledLanes|=i,ji|=i,r=4;break e}i=Rn,Rn=r,i!==null&&(Rn===null?Rn=i:Rn.push.apply(Rn,i))}r=o}if(i=!1,r!==2)continue}}if(r===1){Jo(e,0),Mr(e,t,0,!0);break}e:{switch(s=e,i=r,i){case 0:case 1:throw Error(oe(345));case 4:if((t&4194048)!==t)break;case 6:Mr(s,t,Es,!Er);break e;case 2:Rn=null;break;case 3:case 5:break;default:throw Error(oe(329))}if((t&62914560)===t&&(r=$g+300-ua(),10<r)){if(Mr(s,t,Es,!Er),ef(s,0,!0)!==0)break e;s.timeoutHandle=Tj(qb.bind(null,s,n,Rn,dh,Gx,t,Es,ji,Qo,Er,i,2,-0,0),r);break e}qb(s,n,Rn,dh,Gx,t,Es,ji,Qo,Er,i,0,-0,0)}}break}while(!0);ba(e)}function qb(e,t,n,s,r,i,o,l,c,u,h,d,f,x){if(e.timeoutHandle=-1,d=t.subtreeFlags,(d&8192||(d&16785408)===16785408)&&($c={stylesheets:null,count:0,unsuspend:sk},aj(t),d=rk(),d!==null)){e.cancelPendingCommit=d(Xb.bind(null,e,t,i,n,s,r,o,l,c,h,1,f,x)),Mr(e,i,o,!u);return}Xb(e,t,i,n,s,r,o,l,c)}function j6(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!os(i(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mr(e,t,n,s){t&=~Ug,t&=~ji,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var i=31-ss(r),o=1<<i;s[i]=-1,r&=~o}n!==0&&p1(e,n,t)}function uf(){return mt&6?!0:(bd(0),!1)}function Lg(){if(at!==null){if(ft===0)var e=at.return;else e=at,La=Ii=null,Sg(e),Ro=null,zc=0,e=at;for(;e!==null;)F2(e.alternate,e),e=e.return;at=null}}function Jo(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,H6(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Lg(),Ct=e,at=n=Ia(e.current,null),rt=t,ft=0,Xn=null,Er=!1,bl=od(e,t),Rg=!1,Qo=Es=Ug=ji=Ir=Yt=0,Rn=yc=null,Gx=!1,t&8&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-ss(s),i=1<<r;t|=e[r],s&=~i}return Za=t,af(),n}function uj(e,t){Je=null,Ye.H=sh,t===md||t===of?(t=Cb(),ft=3):t===X1?(t=Cb(),ft=4):ft=t===P2?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Xn=t,at===null&&(Yt=1,ih(e,Cs(t,e.current)))}function hj(){var e=Ye.H;return Ye.H=sh,e===null?sh:e}function fj(){var e=Ye.A;return Ye.A=y6,e}function Kx(){Yt=4,Er||(rt&4194048)!==rt&&Ms.current!==null||(bl=!0),!(Ir&134217727)&&!(ji&134217727)||Ct===null||Mr(Ct,rt,Es,!1)}function Sm(e,t,n){var s=mt;mt|=2;var r=hj(),i=fj();(Ct!==e||rt!==t)&&(dh=null,Jo(e,t)),t=!1;var o=Yt;e:do try{if(ft!==0&&at!==null){var l=at,c=Xn;switch(ft){case 8:Lg(),o=6;break e;case 3:case 2:case 9:case 6:Ms.current===null&&(t=!0);var u=ft;if(ft=0,Xn=null,Co(e,l,c,u),n&&bl){o=0;break e}break;default:u=ft,ft=0,Xn=null,Co(e,l,c,u)}}N6(),o=Yt;break}catch(h){uj(e,h)}while(!0);return t&&e.shellSuspendCounter++,La=Ii=null,mt=s,Ye.H=r,Ye.A=i,at===null&&(Ct=null,rt=0,af()),o}function N6(){for(;at!==null;)mj(at)}function S6(e,t){var n=mt;mt|=2;var s=hj(),r=fj();Ct!==e||rt!==t?(dh=null,ch=ua()+500,Jo(e,t)):bl=od(e,t);e:do try{if(ft!==0&&at!==null){t=at;var i=Xn;t:switch(ft){case 1:ft=0,Xn=null,Co(e,t,i,1);break;case 2:case 9:if(Sb(i)){ft=0,Xn=null,Gb(t);break}t=function(){ft!==2&&ft!==9||Ct!==e||(ft=7),ba(e)},i.then(t,t);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:Sb(i)?(ft=0,Xn=null,Gb(t)):(ft=0,Xn=null,Co(e,t,i,7));break;case 5:var o=null;switch(at.tag){case 26:o=at.memoizedState;case 5:case 27:var l=at;if(!o||Oj(o)){ft=0,Xn=null;var c=l.sibling;if(c!==null)at=c;else{var u=l.return;u!==null?(at=u,hf(u)):at=null}break t}}ft=0,Xn=null,Co(e,t,i,5);break;case 6:ft=0,Xn=null,Co(e,t,i,6);break;case 8:Lg(),Yt=6;break e;default:throw Error(oe(462))}}C6();break}catch(h){uj(e,h)}while(!0);return La=Ii=null,Ye.H=s,Ye.A=r,mt=n,at!==null?0:(Ct=null,rt=0,af(),Yt)}function C6(){for(;at!==null&&!q5();)mj(at)}function mj(e){var t=I2(e.alternate,e,Za);e.memoizedProps=e.pendingProps,t===null?hf(e):at=t}function Gb(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bb(n,t,t.pendingProps,t.type,void 0,rt);break;case 11:t=Bb(n,t,t.pendingProps,t.type.render,t.ref,rt);break;case 5:Sg(t);default:F2(n,t),t=at=F1(t,Za),t=I2(n,t,Za)}e.memoizedProps=e.pendingProps,t===null?hf(e):at=t}function Co(e,t,n,s){La=Ii=null,Sg(t),Ro=null,zc=0;var r=t.return;try{if(m6(e,r,t,n,rt)){Yt=1,ih(e,Cs(n,e.current)),at=null;return}}catch(i){if(r!==null)throw at=r,i;Yt=1,ih(e,Cs(n,e.current)),at=null;return}t.flags&32768?(ot||s===1?e=!0:bl||rt&536870912?e=!1:(Er=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ms.current,s!==null&&s.tag===13&&(s.flags|=16384))),xj(t,e)):hf(t)}function hf(e){var t=e;do{if(t.flags&32768){xj(t,Er);return}e=t.return;var n=g6(t.alternate,t,Za);if(n!==null){at=n;return}if(t=t.sibling,t!==null){at=t;return}at=t=e}while(t!==null);Yt===0&&(Yt=5)}function xj(e,t){do{var n=p6(e.alternate,e);if(n!==null){n.flags&=32767,at=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){at=e;return}at=e=n}while(e!==null);Yt=6,at=null}function Xb(e,t,n,s,r,i,o,l,c){e.cancelPendingCommit=null;do ff();while(gn!==0);if(mt&6)throw Error(oe(327));if(t!==null){if(t===e.current)throw Error(oe(177));if(i=t.lanes|t.childLanes,i|=ug,sC(e,n,i,o,l,c),e===Ct&&(at=Ct=null,rt=0),Ko=t,zr=e,Uo=n,Xx=i,Zx=r,lj=s,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,T6(qu,function(){return yj(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=Ye.T,Ye.T=null,r=lt.p,lt.p=2,o=mt,mt|=4;try{b6(e,t,n)}finally{mt=o,lt.p=r,Ye.T=s}}gn=1,gj(),pj(),bj()}}function gj(){if(gn===1){gn=0;var e=zr,t=Ko,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Ye.T,Ye.T=null;var s=lt.p;lt.p=2;var r=mt;mt|=4;try{tj(t,e);var i=n0,o=$1(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&U1(l.ownerDocument.documentElement,l)){if(c!==null&&dg(l)){var u=c.start,h=c.end;if(h===void 0&&(h=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(h,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var x=f.getSelection(),y=l.textContent.length,b=Math.min(c.start,y),w=c.end===void 0?b:Math.min(c.end,y);!x.extend&&b>w&&(o=w,w=b,b=o);var g=gb(l,b),v=gb(l,w);if(g&&v&&(x.rangeCount!==1||x.anchorNode!==g.node||x.anchorOffset!==g.offset||x.focusNode!==v.node||x.focusOffset!==v.offset)){var p=d.createRange();p.setStart(g.node,g.offset),x.removeAllRanges(),b>w?(x.addRange(p),x.extend(v.node,v.offset)):(p.setEnd(v.node,v.offset),x.addRange(p))}}}}for(d=[],x=l;x=x.parentNode;)x.nodeType===1&&d.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<d.length;l++){var j=d[l];j.element.scrollLeft=j.left,j.element.scrollTop=j.top}}bh=!!t0,n0=t0=null}finally{mt=r,lt.p=s,Ye.T=n}}e.current=t,gn=2}}function pj(){if(gn===2){gn=0;var e=zr,t=Ko,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Ye.T,Ye.T=null;var s=lt.p;lt.p=2;var r=mt;mt|=4;try{Q2(e,t.alternate,t)}finally{mt=r,lt.p=s,Ye.T=n}}gn=3}}function bj(){if(gn===4||gn===3){gn=0,G5();var e=zr,t=Ko,n=Uo,s=lj;t.subtreeFlags&10256||t.flags&10256?gn=5:(gn=0,Ko=zr=null,vj(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Or=null),sg(n),t=t.stateNode,ns&&typeof ns.onCommitFiberRoot=="function")try{ns.onCommitFiberRoot(id,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=Ye.T,r=lt.p,lt.p=2,Ye.T=null;try{for(var i=e.onRecoverableError,o=0;o<s.length;o++){var l=s[o];i(l.value,{componentStack:l.stack})}}finally{Ye.T=t,lt.p=r}}Uo&3&&ff(),ba(e),r=e.pendingLanes,n&4194090&&r&42?e===Qx?wc++:(wc=0,Qx=e):wc=0,bd(0)}}function vj(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fd(t)))}function ff(e){return gj(),pj(),bj(),yj()}function yj(){if(gn!==5)return!1;var e=zr,t=Xx;Xx=0;var n=sg(Uo),s=Ye.T,r=lt.p;try{lt.p=32>n?32:n,Ye.T=null,n=Zx,Zx=null;var i=zr,o=Uo;if(gn=0,Ko=zr=null,Uo=0,mt&6)throw Error(oe(331));var l=mt;if(mt|=4,ij(i.current),sj(i,i.current,o,n),mt=l,bd(0,!1),ns&&typeof ns.onPostCommitFiberRoot=="function")try{ns.onPostCommitFiberRoot(id,i)}catch{}return!0}finally{lt.p=r,Ye.T=s,vj(e,t)}}function Zb(e,t,n){t=Cs(n,t),t=Ix(e.stateNode,t,2),e=Ar(e,t,2),e!==null&&(ld(e,2),ba(e))}function Nt(e,t,n){if(e.tag===3)Zb(e,e,n);else for(;t!==null;){if(t.tag===3){Zb(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Or===null||!Or.has(s))){e=Cs(n,e),n=$2(2),s=Ar(t,n,2),s!==null&&(L2(n,s,t,e),ld(s,2),ba(s));break}}t=t.return}}function Cm(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new w6;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(Rg=!0,r.add(n),e=k6.bind(null,e,t,n),t.then(e,e))}function k6(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ct===e&&(rt&n)===n&&(Yt===4||Yt===3&&(rt&62914560)===rt&&300>ua()-$g?!(mt&2)&&Jo(e,0):Ug|=n,Qo===rt&&(Qo=0)),ba(e)}function wj(e,t){t===0&&(t=g1()),e=pl(e,t),e!==null&&(ld(e,t),ba(e))}function E6(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wj(e,n)}function M6(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(oe(314))}s!==null&&s.delete(t),wj(e,n)}function T6(e,t){return tg(e,t)}var uh=null,uo=null,Jx=!1,hh=!1,km=!1,Ni=0;function ba(e){e!==uo&&e.next===null&&(uo===null?uh=uo=e:uo=uo.next=e),hh=!0,Jx||(Jx=!0,_6())}function bd(e,t){if(!km&&hh){km=!0;do for(var n=!1,s=uh;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var i=0;else{var o=s.suspendedLanes,l=s.pingedLanes;i=(1<<31-ss(42|e)+1)-1,i&=r&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,Qb(s,i))}else i=rt,i=ef(s,s===Ct?i:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(i&3)||od(s,i)||(n=!0,Qb(s,i));s=s.next}while(n);km=!1}}function D6(){jj()}function jj(){hh=Jx=!1;var e=0;Ni!==0&&(P6()&&(e=Ni),Ni=0);for(var t=ua(),n=null,s=uh;s!==null;){var r=s.next,i=Nj(s,t);i===0?(s.next=null,n===null?uh=r:n.next=r,r===null&&(uo=n)):(n=s,(e!==0||i&3)&&(hh=!0)),s=r}bd(e)}function Nj(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-ss(i),l=1<<o,c=r[o];c===-1?(!(l&n)||l&s)&&(r[o]=nC(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=Ct,n=rt,n=ef(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(ft===2||ft===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Kf(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||od(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Kf(s),sg(n)){case 2:case 8:n=f1;break;case 32:n=qu;break;case 268435456:n=m1;break;default:n=qu}return s=Sj.bind(null,e),n=tg(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Kf(s),e.callbackPriority=2,e.callbackNode=null,2}function Sj(e,t){if(gn!==0&&gn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ff()&&e.callbackNode!==n)return null;var s=rt;return s=ef(e,e===Ct?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(dj(e,s,t),Nj(e,ua()),e.callbackNode!=null&&e.callbackNode===n?Sj.bind(null,e):null)}function Qb(e,t){if(ff())return null;dj(e,t,!0)}function _6(){B6(function(){mt&6?tg(h1,D6):jj()})}function Pg(){return Ni===0&&(Ni=x1()),Ni}function Kb(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:wu(""+e)}function Jb(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function A6(e,t,n,s,r){if(t==="submit"&&n&&n.stateNode===r){var i=Kb((r[Pn]||null).action),o=s.submitter;o&&(t=(t=o[Pn]||null)?Kb(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new tf("action","action",null,s,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ni!==0){var c=o?Jb(r,o):new FormData(r);Vx(n,{pending:!0,data:c,method:r.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?Jb(r,o):new FormData(r),Vx(n,{pending:!0,data:c,method:r.method,action:i},i,c))},currentTarget:r}]})}}for(var Em=0;Em<Dx.length;Em++){var Mm=Dx[Em],O6=Mm.toLowerCase(),z6=Mm[0].toUpperCase()+Mm.slice(1);qs(O6,"on"+z6)}qs(P1,"onAnimationEnd");qs(H1,"onAnimationIteration");qs(B1,"onAnimationStart");qs("dblclick","onDoubleClick");qs("focusin","onFocus");qs("focusout","onBlur");qs(QC,"onTransitionRun");qs(KC,"onTransitionStart");qs(JC,"onTransitionCancel");qs(V1,"onTransitionEnd");Fo("onMouseEnter",["mouseout","mouseover"]);Fo("onMouseLeave",["mouseout","mouseover"]);Fo("onPointerEnter",["pointerout","pointerover"]);Fo("onPointerLeave",["pointerout","pointerover"]);Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rc="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(" "),R6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rc));function Cj(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(h){rh(h)}r.currentTarget=null,i=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(h){rh(h)}r.currentTarget=null,i=c}}}}function st(e,t){var n=t[Nx];n===void 0&&(n=t[Nx]=new Set);var s=e+"__bubble";n.has(s)||(kj(t,e,2,!1),n.add(s))}function Tm(e,t,n){var s=0;t&&(s|=4),kj(n,e,s,t)}var Gd="_reactListening"+Math.random().toString(36).slice(2);function Hg(e){if(!e[Gd]){e[Gd]=!0,y1.forEach(function(n){n!=="selectionchange"&&(R6.has(n)||Tm(n,!1,e),Tm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gd]||(t[Gd]=!0,Tm("selectionchange",!1,t))}}function kj(e,t,n,s){switch(Lj(t)){case 2:var r=lk;break;case 8:r=ck;break;default:r=Ig}n=r.bind(null,t,n,e),r=void 0,!Ex||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Dm(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=go(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){s=i=o;continue e}l=l.parentNode}}s=s.return}M1(function(){var u=i,h=ig(n),d=[];e:{var f=Y1.get(e);if(f!==void 0){var x=tf,y=e;switch(e){case"keypress":if(Nu(n)===0)break e;case"keydown":case"keyup":x=TC;break;case"focusin":y="focus",x=im;break;case"focusout":y="blur",x=im;break;case"beforeblur":case"afterblur":x=im;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=ib;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=pC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=AC;break;case P1:case H1:case B1:x=yC;break;case V1:x=zC;break;case"scroll":case"scrollend":x=xC;break;case"wheel":x=UC;break;case"copy":case"cut":case"paste":x=jC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=lb;break;case"toggle":case"beforetoggle":x=LC}var b=(t&4)!==0,w=!b&&(e==="scroll"||e==="scrollend"),g=b?f!==null?f+"Capture":null:f;b=[];for(var v=u,p;v!==null;){var j=v;if(p=j.stateNode,j=j.tag,j!==5&&j!==26&&j!==27||p===null||g===null||(j=Tc(v,g),j!=null&&b.push(Uc(v,j,p))),w)break;v=v.return}0<b.length&&(f=new x(f,y,null,n,h),d.push({event:f,listeners:b}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",f&&n!==kx&&(y=n.relatedTarget||n.fromElement)&&(go(y)||y[xl]))break e;if((x||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,x?(y=n.relatedTarget||n.toElement,x=u,y=y?go(y):null,y!==null&&(w=rd(y),b=y.tag,y!==w||b!==5&&b!==27&&b!==6)&&(y=null)):(x=null,y=u),x!==y)){if(b=ib,j="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(b=lb,j="onPointerLeave",g="onPointerEnter",v="pointer"),w=x==null?f:sc(x),p=y==null?f:sc(y),f=new b(j,v+"leave",x,n,h),f.target=w,f.relatedTarget=p,j=null,go(h)===u&&(b=new b(g,v+"enter",y,n,h),b.target=p,b.relatedTarget=w,j=b),w=j,x&&y)t:{for(b=x,g=y,v=0,p=b;p;p=eo(p))v++;for(p=0,j=g;j;j=eo(j))p++;for(;0<v-p;)b=eo(b),v--;for(;0<p-v;)g=eo(g),p--;for(;v--;){if(b===g||g!==null&&b===g.alternate)break t;b=eo(b),g=eo(g)}b=null}else b=null;x!==null&&ev(d,f,x,b,!1),y!==null&&w!==null&&ev(d,w,y,b,!0)}}e:{if(f=u?sc(u):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var N=hb;else if(ub(f))if(z1)N=GC;else{N=WC;var C=FC}else x=f.nodeName,!x||x.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&rg(u.elementType)&&(N=hb):N=qC;if(N&&(N=N(e,u))){O1(d,N,n,h);break e}C&&C(e,f,u),e==="focusout"&&u&&f.type==="number"&&u.memoizedProps.value!=null&&Cx(f,"number",f.value)}switch(C=u?sc(u):window,e){case"focusin":(ub(C)||C.contentEditable==="true")&&(vo=C,Mx=u,uc=null);break;case"focusout":uc=Mx=vo=null;break;case"mousedown":Tx=!0;break;case"contextmenu":case"mouseup":case"dragend":Tx=!1,pb(d,n,h);break;case"selectionchange":if(ZC)break;case"keydown":case"keyup":pb(d,n,h)}var S;if(cg)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else bo?_1(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(D1&&n.locale!=="ko"&&(bo||M!=="onCompositionStart"?M==="onCompositionEnd"&&bo&&(S=T1()):(kr=h,og="value"in kr?kr.value:kr.textContent,bo=!0)),C=fh(u,M),0<C.length&&(M=new ob(M,e,null,n,h),d.push({event:M,listeners:C}),S?M.data=S:(S=A1(n),S!==null&&(M.data=S)))),(S=HC?BC(e,n):VC(e,n))&&(M=fh(u,"onBeforeInput"),0<M.length&&(C=new ob("onBeforeInput","beforeinput",null,n,h),d.push({event:C,listeners:M}),C.data=S)),A6(d,e,u,n,h)}Cj(d,t)})}function Uc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fh(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=Tc(e,n),r!=null&&s.unshift(Uc(e,r,i)),r=Tc(e,t),r!=null&&s.push(Uc(e,r,i))),e.tag===3)return s;e=e.return}return[]}function eo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ev(e,t,n,s,r){for(var i=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===s)break;l!==5&&l!==26&&l!==27||u===null||(c=u,r?(u=Tc(n,i),u!=null&&o.unshift(Uc(n,u,c))):r||(u=Tc(n,i),u!=null&&o.push(Uc(n,u,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var U6=/\r\n?/g,$6=/\u0000|\uFFFD/g;function tv(e){return(typeof e=="string"?e:""+e).replace(U6,`
49
- `).replace($6,"")}function Ej(e,t){return t=tv(t),tv(e)===t}function mf(){}function xt(e,t,n,s,r,i){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Wo(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Wo(e,""+s);break;case"className":Bd(e,"class",s);break;case"tabIndex":Bd(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Bd(e,n,s);break;case"style":E1(e,s,i);break;case"data":if(t!=="object"){Bd(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=wu(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"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 i=="function"&&(n==="formAction"?(t!=="input"&&xt(e,t,"name",r.name,r,null),xt(e,t,"formEncType",r.formEncType,r,null),xt(e,t,"formMethod",r.formMethod,r,null),xt(e,t,"formTarget",r.formTarget,r,null)):(xt(e,t,"encType",r.encType,r,null),xt(e,t,"method",r.method,r,null),xt(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=wu(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=mf);break;case"onScroll":s!=null&&st("scroll",e);break;case"onScrollEnd":s!=null&&st("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(oe(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(oe(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=wu(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":st("beforetoggle",e),st("toggle",e),yu(e,"popover",s);break;case"xlinkActuate":ka(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ka(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ka(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ka(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ka(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ka(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ka(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ka(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ka(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":yu(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=fC.get(n)||n,yu(e,n,s))}}function e0(e,t,n,s,r,i){switch(n){case"style":E1(e,s,i);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(oe(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(oe(60));e.innerHTML=n}}break;case"children":typeof s=="string"?Wo(e,s):(typeof s=="number"||typeof s=="bigint")&&Wo(e,""+s);break;case"onScroll":s!=null&&st("scroll",e);break;case"onScrollEnd":s!=null&&st("scrollend",e);break;case"onClick":s!=null&&(e.onclick=mf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!w1.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),i=e[Pn]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,r),typeof s=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,r);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):yu(e,n,s)}}}function pn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":st("error",e),st("load",e);var s=!1,r=!1,i;for(i in n)if(n.hasOwnProperty(i)){var o=n[i];if(o!=null)switch(i){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(oe(137,t));default:xt(e,t,i,o,n,null)}}r&&xt(e,t,"srcSet",n.srcSet,n,null),s&&xt(e,t,"src",n.src,n,null);return;case"input":st("invalid",e);var l=i=o=r=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var h=n[s];if(h!=null)switch(s){case"name":r=h;break;case"type":o=h;break;case"checked":c=h;break;case"defaultChecked":u=h;break;case"value":i=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(oe(137,t));break;default:xt(e,t,s,h,n,null)}}S1(e,i,l,c,u,o,r,!1),Gu(e);return;case"select":st("invalid",e),s=o=i=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":s=l;default:xt(e,t,r,l,n,null)}t=i,n=o,e.multiple=!!s,t!=null?Do(e,!!s,t,!1):n!=null&&Do(e,!!s,n,!0);return;case"textarea":st("invalid",e),i=r=s=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":s=l;break;case"defaultValue":r=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(oe(91));break;default:xt(e,t,o,l,n,null)}k1(e,s,r,i),Gu(e);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:xt(e,t,c,s,n,null)}return;case"dialog":st("beforetoggle",e),st("toggle",e),st("cancel",e),st("close",e);break;case"iframe":case"object":st("load",e);break;case"video":case"audio":for(s=0;s<Rc.length;s++)st(Rc[s],e);break;case"image":st("error",e),st("load",e);break;case"details":st("toggle",e);break;case"embed":case"source":case"link":st("error",e),st("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(s=n[u],s!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(oe(137,t));default:xt(e,t,u,s,n,null)}return;default:if(rg(t)){for(h in n)n.hasOwnProperty(h)&&(s=n[h],s!==void 0&&e0(e,t,h,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&xt(e,t,l,s,n,null))}function L6(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,o=null,l=null,c=null,u=null,h=null;for(x in n){var d=n[x];if(n.hasOwnProperty(x)&&d!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=d;default:s.hasOwnProperty(x)||xt(e,t,x,null,s,d)}}for(var f in s){var x=s[f];if(d=n[f],s.hasOwnProperty(f)&&(x!=null||d!=null))switch(f){case"type":i=x;break;case"name":r=x;break;case"checked":u=x;break;case"defaultChecked":h=x;break;case"value":o=x;break;case"defaultValue":l=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(oe(137,t));break;default:x!==d&&xt(e,t,f,x,s,d)}}Sx(e,o,l,c,u,h,i,r);return;case"select":x=o=l=f=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":x=c;default:s.hasOwnProperty(i)||xt(e,t,i,null,s,c)}for(r in s)if(i=s[r],c=n[r],s.hasOwnProperty(r)&&(i!=null||c!=null))switch(r){case"value":f=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&xt(e,t,r,i,s,c)}t=l,n=o,s=x,f!=null?Do(e,!!n,f,!1):!!s!=!!n&&(t!=null?Do(e,!!n,t,!0):Do(e,!!n,n?[]:"",!1));return;case"textarea":x=f=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:xt(e,t,l,null,s,r)}for(o in s)if(r=s[o],i=n[o],s.hasOwnProperty(o)&&(r!=null||i!=null))switch(o){case"value":f=r;break;case"defaultValue":x=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(oe(91));break;default:r!==i&&xt(e,t,o,r,s,i)}C1(e,f,x);return;case"option":for(var y in n)if(f=n[y],n.hasOwnProperty(y)&&f!=null&&!s.hasOwnProperty(y))switch(y){case"selected":e.selected=!1;break;default:xt(e,t,y,null,s,f)}for(c in s)if(f=s[c],x=n[c],s.hasOwnProperty(c)&&f!==x&&(f!=null||x!=null))switch(c){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:xt(e,t,c,f,s,x)}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 b in n)f=n[b],n.hasOwnProperty(b)&&f!=null&&!s.hasOwnProperty(b)&&xt(e,t,b,null,s,f);for(u in s)if(f=s[u],x=n[u],s.hasOwnProperty(u)&&f!==x&&(f!=null||x!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(oe(137,t));break;default:xt(e,t,u,f,s,x)}return;default:if(rg(t)){for(var w in n)f=n[w],n.hasOwnProperty(w)&&f!==void 0&&!s.hasOwnProperty(w)&&e0(e,t,w,void 0,s,f);for(h in s)f=s[h],x=n[h],!s.hasOwnProperty(h)||f===x||f===void 0&&x===void 0||e0(e,t,h,f,s,x);return}}for(var g in n)f=n[g],n.hasOwnProperty(g)&&f!=null&&!s.hasOwnProperty(g)&&xt(e,t,g,null,s,f);for(d in s)f=s[d],x=n[d],!s.hasOwnProperty(d)||f===x||f==null&&x==null||xt(e,t,d,f,s,x)}var t0=null,n0=null;function mh(e){return e.nodeType===9?e:e.ownerDocument}function nv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Mj(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function s0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _m=null;function P6(){var e=window.event;return e&&e.type==="popstate"?e===_m?!1:(_m=e,!0):(_m=null,!1)}var Tj=typeof setTimeout=="function"?setTimeout:void 0,H6=typeof clearTimeout=="function"?clearTimeout:void 0,sv=typeof Promise=="function"?Promise:void 0,B6=typeof queueMicrotask=="function"?queueMicrotask:typeof sv<"u"?function(e){return sv.resolve(null).then(e).catch(V6)}:Tj;function V6(e){setTimeout(function(){throw e})}function Kr(e){return e==="head"}function av(e,t){var n=t,s=0,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(0<s&&8>s){n=s;var o=e.ownerDocument;if(n&1&&jc(o.documentElement),n&2&&jc(o.body),n&4)for(n=o.head,jc(n),o=n.firstChild;o;){var l=o.nextSibling,c=o.nodeName;o[cd]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){e.removeChild(i),Bc(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:s=n.charCodeAt(0)-48;else s=0;n=i}while(n);Bc(t)}function a0(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":a0(n),ag(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Y6(e,t,n,s){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[cd])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Vs(e.nextSibling),e===null)break}return null}function I6(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Vs(e.nextSibling),e===null))return null;return e}function r0(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function F6(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Vs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var i0=null;function rv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function Dj(e,t,n){switch(t=mh(n),e){case"html":if(e=t.documentElement,!e)throw Error(oe(452));return e;case"head":if(e=t.head,!e)throw Error(oe(453));return e;case"body":if(e=t.body,!e)throw Error(oe(454));return e;default:throw Error(oe(451))}}function jc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ag(e)}var Ts=new Map,iv=new Set;function xh(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var er=lt.d;lt.d={f:W6,r:q6,D:G6,C:X6,L:Z6,m:Q6,X:J6,S:K6,M:ek};function W6(){var e=er.f(),t=uf();return e||t}function q6(e){var t=gl(e);t!==null&&t.tag===5&&t.type==="form"?N2(t):er.r(e)}var vl=typeof document>"u"?null:document;function _j(e,t,n){var s=vl;if(s&&typeof t=="string"&&t){var r=Ss(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),iv.has(r)||(iv.add(r),e={rel:e,crossOrigin:n,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),pn(t,"link",e),un(t),s.head.appendChild(t)))}}function G6(e){er.D(e),_j("dns-prefetch",e,null)}function X6(e,t){er.C(e,t),_j("preconnect",e,t)}function Z6(e,t,n){er.L(e,t,n);var s=vl;if(s&&e&&t){var r='link[rel="preload"][as="'+Ss(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Ss(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Ss(n.imageSizes)+'"]')):r+='[href="'+Ss(e)+'"]';var i=r;switch(t){case"style":i=el(e);break;case"script":i=yl(e)}Ts.has(i)||(e=At({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ts.set(i,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(vd(i))||t==="script"&&s.querySelector(yd(i))||(t=s.createElement("link"),pn(t,"link",e),un(t),s.head.appendChild(t)))}}function Q6(e,t){er.m(e,t);var n=vl;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ss(s)+'"][href="'+Ss(e)+'"]',i=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=yl(e)}if(!Ts.has(i)&&(e=At({rel:"modulepreload",href:e},t),Ts.set(i,e),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(yd(i)))return}s=n.createElement("link"),pn(s,"link",e),un(s),n.head.appendChild(s)}}}function K6(e,t,n){er.S(e,t,n);var s=vl;if(s&&e){var r=To(s).hoistableStyles,i=el(e);t=t||"default";var o=r.get(i);if(!o){var l={loading:0,preload:null};if(o=s.querySelector(vd(i)))l.loading=5;else{e=At({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ts.get(i))&&Bg(e,n);var c=o=s.createElement("link");un(c),pn(c,"link",e),c._p=new Promise(function(u,h){c.onload=u,c.onerror=h}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Du(o,t,s)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(i,o)}}}function J6(e,t){er.X(e,t);var n=vl;if(n&&e){var s=To(n).hoistableScripts,r=yl(e),i=s.get(r);i||(i=n.querySelector(yd(r)),i||(e=At({src:e,async:!0},t),(t=Ts.get(r))&&Vg(e,t),i=n.createElement("script"),un(i),pn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function ek(e,t){er.M(e,t);var n=vl;if(n&&e){var s=To(n).hoistableScripts,r=yl(e),i=s.get(r);i||(i=n.querySelector(yd(r)),i||(e=At({src:e,async:!0,type:"module"},t),(t=Ts.get(r))&&Vg(e,t),i=n.createElement("script"),un(i),pn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function ov(e,t,n,s){var r=(r=Dr.current)?xh(r):null;if(!r)throw Error(oe(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=el(n.href),n=To(r).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=el(n.href);var i=To(r).hoistableStyles,o=i.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=r.querySelector(vd(e)))&&!i._p&&(o.instance=i,o.state.loading=5),Ts.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ts.set(e,n),i||tk(r,e,n,o.state))),t&&s===null)throw Error(oe(528,""));return o}if(t&&s!==null)throw Error(oe(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=yl(n),n=To(r).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(oe(444,e))}}function el(e){return'href="'+Ss(e)+'"'}function vd(e){return'link[rel="stylesheet"]['+e+"]"}function Aj(e){return At({},e,{"data-precedence":e.precedence,precedence:null})}function tk(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),pn(t,"link",n),un(t),e.head.appendChild(t))}function yl(e){return'[src="'+Ss(e)+'"]'}function yd(e){return"script[async]"+e}function lv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ss(n.href)+'"]');if(s)return t.instance=s,un(s),s;var r=At({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),un(s),pn(s,"style",r),Du(s,n.precedence,e),t.instance=s;case"stylesheet":r=el(n.href);var i=e.querySelector(vd(r));if(i)return t.state.loading|=4,t.instance=i,un(i),i;s=Aj(n),(r=Ts.get(r))&&Bg(s,r),i=(e.ownerDocument||e).createElement("link"),un(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),pn(i,"link",s),t.state.loading|=4,Du(i,n.precedence,e),t.instance=i;case"script":return i=yl(n.src),(r=e.querySelector(yd(i)))?(t.instance=r,un(r),r):(s=n,(r=Ts.get(i))&&(s=At({},n),Vg(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),un(r),pn(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(oe(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,Du(s,n.precedence,e));return t.instance}function Du(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,i=r,o=0;o<s.length;o++){var l=s[o];if(l.dataset.precedence===t)i=l;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Bg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Vg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var _u=null;function cv(e,t,n){if(_u===null){var s=new Map,r=_u=new Map;r.set(n,s)}else r=_u,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var i=n[r];if(!(i[cd]||i[jn]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=s.get(o);l?l.push(i):s.set(o,[i])}}return s}function dv(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function nk(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Oj(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var $c=null;function sk(){}function ak(e,t,n){if($c===null)throw Error(oe(475));var s=$c;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=el(n.href),i=e.querySelector(vd(r));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(s.count++,s=gh.bind(s),e.then(s,s)),t.state.loading|=4,t.instance=i,un(i);return}i=e.ownerDocument||e,n=Aj(n),(r=Ts.get(r))&&Bg(n,r),i=i.createElement("link"),un(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),pn(i,"link",n),t.instance=i}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(s.count++,t=gh.bind(s),e.addEventListener("load",t),e.addEventListener("error",t))}}function rk(){if($c===null)throw Error(oe(475));var e=$c;return e.stylesheets&&e.count===0&&o0(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&o0(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function gh(){if(this.count--,this.count===0){if(this.stylesheets)o0(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ph=null;function o0(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ph=new Map,t.forEach(ik,e),ph=null,gh.call(e))}function ik(e,t){if(!(t.state.loading&4)){var n=ph.get(e);if(n)var s=n.get(null);else{n=new Map,ph.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var o=r[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),s=o)}s&&n.set(null,s)}r=t.instance,o=r.getAttribute("data-precedence"),i=n.get(o)||s,i===s&&n.set(null,r),n.set(o,r),this.count++,s=gh.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Lc={$$typeof:Ra,Provider:null,Consumer:null,_currentValue:pi,_currentValue2:pi,_threadCount:0};function ok(e,t,n,s,r,i,o,l){this.tag=1,this.containerInfo=e,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=Jf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jf(0),this.hiddenUpdates=Jf(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function zj(e,t,n,s,r,i,o,l,c,u,h,d){return e=new ok(e,t,n,o,l,c,u,d),t=1,i===!0&&(t|=24),i=es(3,null,null,t),e.current=i,i.stateNode=e,t=gg(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:s,isDehydrated:n,cache:t},bg(i),e}function Rj(e){return e?(e=jo,e):jo}function Uj(e,t,n,s,r,i){r=Rj(r),s.context===null?s.context=r:s.pendingContext=r,s=_r(t),s.payload={element:n},i=i===void 0?null:i,i!==null&&(s.callback=i),n=Ar(e,s,t),n!==null&&(rs(n,e,t),mc(n,e,t))}function uv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Yg(e,t){uv(e,t),(e=e.alternate)&&uv(e,t)}function $j(e){if(e.tag===13){var t=pl(e,67108864);t!==null&&rs(t,e,67108864),Yg(e,67108864)}}var bh=!0;function lk(e,t,n,s){var r=Ye.T;Ye.T=null;var i=lt.p;try{lt.p=2,Ig(e,t,n,s)}finally{lt.p=i,Ye.T=r}}function ck(e,t,n,s){var r=Ye.T;Ye.T=null;var i=lt.p;try{lt.p=8,Ig(e,t,n,s)}finally{lt.p=i,Ye.T=r}}function Ig(e,t,n,s){if(bh){var r=l0(s);if(r===null)Dm(e,t,s,vh,n),hv(e,s);else if(uk(r,e,t,n,s))s.stopPropagation();else if(hv(e,s),t&4&&-1<dk.indexOf(e)){for(;r!==null;){var i=gl(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=li(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-ss(o);l.entanglements[1]|=c,o&=~c}ba(i),!(mt&6)&&(ch=ua()+500,bd(0))}}break;case 13:l=pl(i,2),l!==null&&rs(l,i,2),uf(),Yg(i,2)}if(i=l0(s),i===null&&Dm(e,t,s,vh,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else Dm(e,t,s,null,n)}}function l0(e){return e=ig(e),Fg(e)}var vh=null;function Fg(e){if(vh=null,e=go(e),e!==null){var t=rd(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vh=e,null}function Lj(e){switch(e){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(X5()){case h1:return 2;case f1:return 8;case qu:case Z5:return 32;case m1:return 268435456;default:return 32}default:return 32}}var c0=!1,Rr=null,Ur=null,$r=null,Pc=new Map,Hc=new Map,Nr=[],dk="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 hv(e,t){switch(e){case"focusin":case"focusout":Rr=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":Pc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hc.delete(t.pointerId)}}function Bl(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=gl(t),t!==null&&$j(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function uk(e,t,n,s,r){switch(t){case"focusin":return Rr=Bl(Rr,e,t,n,s,r),!0;case"dragenter":return Ur=Bl(Ur,e,t,n,s,r),!0;case"mouseover":return $r=Bl($r,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return Pc.set(i,Bl(Pc.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,Hc.set(i,Bl(Hc.get(i)||null,e,t,n,s,r)),!0}return!1}function Pj(e){var t=go(e.target);if(t!==null){var n=rd(t);if(n!==null){if(t=n.tag,t===13){if(t=l1(n),t!==null){e.blockedOn=t,aC(e.priority,function(){if(n.tag===13){var s=as();s=ng(s);var r=pl(n,s);r!==null&&rs(r,n,s),Yg(n,s)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Au(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=l0(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);kx=s,n.target.dispatchEvent(s),kx=null}else return t=gl(n),t!==null&&$j(t),e.blockedOn=n,!1;t.shift()}return!0}function fv(e,t,n){Au(e)&&n.delete(t)}function hk(){c0=!1,Rr!==null&&Au(Rr)&&(Rr=null),Ur!==null&&Au(Ur)&&(Ur=null),$r!==null&&Au($r)&&($r=null),Pc.forEach(fv),Hc.forEach(fv)}function Xd(e,t){e.blockedOn===t&&(e.blockedOn=null,c0||(c0=!0,ln.unstable_scheduleCallback(ln.unstable_NormalPriority,hk)))}var Zd=null;function mv(e){Zd!==e&&(Zd=e,ln.unstable_scheduleCallback(ln.unstable_NormalPriority,function(){Zd===e&&(Zd=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Fg(s||n)===null)continue;break}var i=gl(n);i!==null&&(e.splice(t,3),t-=3,Vx(i,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function Bc(e){function t(c){return Xd(c,e)}Rr!==null&&Xd(Rr,e),Ur!==null&&Xd(Ur,e),$r!==null&&Xd($r,e),Pc.forEach(t),Hc.forEach(t);for(var n=0;n<Nr.length;n++){var s=Nr[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Nr.length&&(n=Nr[0],n.blockedOn===null);)Pj(n),n.blockedOn===null&&Nr.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],i=n[s+1],o=r[Pn]||null;if(typeof i=="function")o||mv(n);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(r=i,o=i[Pn]||null)l=o.formAction;else if(Fg(r)!==null)continue}else l=o.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),mv(n)}}}function Wg(e){this._internalRoot=e}xf.prototype.render=Wg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));var n=t.current,s=as();Uj(n,s,e,t,null,null)};xf.prototype.unmount=Wg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Uj(e.current,2,null,e,null,null),uf(),t[xl]=null}};function xf(e){this._internalRoot=e}xf.prototype.unstable_scheduleHydration=function(e){if(e){var t=v1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nr.length&&t!==0&&t<Nr[n].priority;n++);Nr.splice(n,0,e),n===0&&Pj(e)}};var xv=i1.version;if(xv!=="19.1.0")throw Error(oe(527,xv,"19.1.0"));lt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(oe(188)):(e=Object.keys(e).join(","),Error(oe(268,e)));return e=V5(t),e=e!==null?c1(e):null,e=e===null?null:e.stateNode,e};var fk={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:Ye,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qd.isDisabled&&Qd.supportsFiber)try{id=Qd.inject(fk),ns=Qd}catch{}}Qh.createRoot=function(e,t){if(!o1(e))throw Error(oe(299));var n=!1,s="",r=z2,i=R2,o=U2,l=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(l=t.unstable_transitionCallbacks)),t=zj(e,1,!1,null,null,n,s,r,i,o,l,null),e[xl]=t.current,Hg(e),new Wg(t)};Qh.hydrateRoot=function(e,t,n){if(!o1(e))throw Error(oe(299));var s=!1,r="",i=z2,o=R2,l=U2,c=null,u=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(c=n.unstable_transitionCallbacks),n.formState!==void 0&&(u=n.formState)),t=zj(e,1,!0,t,n??null,s,r,i,o,l,c,u),t.context=Rj(null),n=t.current,s=as(),s=ng(s),r=_r(s),r.callback=null,Ar(n,r,s),n=s,t.current.lanes=n,ld(t,n),ba(t),e[xl]=t.current,Hg(e),new xf(t)};Qh.version="19.1.0";function Hj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hj)}catch(e){console.error(e)}}Hj(),Jw.exports=Qh;var mk=Jw.exports;const xk=Gh(mk);/**
50
- * @remix-run/router v1.23.1
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function Vc(){return Vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Vc.apply(this,arguments)}var Tr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Tr||(Tr={}));const gv="popstate";function gk(e){e===void 0&&(e={});function t(s,r){let{pathname:i,search:o,hash:l}=s.location;return d0("",{pathname:i,search:o,hash:l},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:yh(r)}return bk(t,n,null,e)}function Qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qg(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pk(){return Math.random().toString(36).substr(2,8)}function pv(e,t){return{usr:e.state,key:e.key,idx:t}}function d0(e,t,n,s){return n===void 0&&(n=null),Vc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?wl(t):t,{state:n,key:t&&t.key||s||pk()})}function yh(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function wl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function bk(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:i=!1}=s,o=r.history,l=Tr.Pop,c=null,u=h();u==null&&(u=0,o.replaceState(Vc({},o.state,{idx:u}),""));function h(){return(o.state||{idx:null}).idx}function d(){l=Tr.Pop;let w=h(),g=w==null?null:w-u;u=w,c&&c({action:l,location:b.location,delta:g})}function f(w,g){l=Tr.Push;let v=d0(b.location,w,g);u=h()+1;let p=pv(v,u),j=b.createHref(v);try{o.pushState(p,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;r.location.assign(j)}i&&c&&c({action:l,location:b.location,delta:1})}function x(w,g){l=Tr.Replace;let v=d0(b.location,w,g);u=h();let p=pv(v,u),j=b.createHref(v);o.replaceState(p,"",j),i&&c&&c({action:l,location:b.location,delta:0})}function y(w){let g=r.location.origin!=="null"?r.location.origin:r.location.href,v=typeof w=="string"?w:yh(w);return v=v.replace(/ $/,"%20"),Qt(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let b={get action(){return l},get location(){return e(r,o)},listen(w){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(gv,d),c=w,()=>{r.removeEventListener(gv,d),c=null}},createHref(w){return t(r,w)},createURL:y,encodeLocation(w){let g=y(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:x,go(w){return o.go(w)}};return b}var bv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(bv||(bv={}));function vk(e,t,n){return n===void 0&&(n="/"),yk(e,t,n)}function yk(e,t,n,s){let r=typeof t=="string"?wl(t):t,i=Gg(r.pathname||"/",n);if(i==null)return null;let o=Bj(e);wk(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=Ok(i);l=Dk(o[c],u)}return l}function Bj(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Qt(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=Lr([s,c.relativePath]),h=n.concat(c);i.children&&i.children.length>0&&(Qt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Bj(i.children,t,h,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Mk(u,i.index),routesMeta:h})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))r(i,o);else for(let c of Vj(i.path))r(i,o,c)}),t}function Vj(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let o=Vj(s.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),r&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function wk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Tk(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const jk=/^:[\w-]+$/,Nk=3,Sk=2,Ck=1,kk=10,Ek=-2,vv=e=>e==="*";function Mk(e,t){let n=e.split("/"),s=n.length;return n.some(vv)&&(s+=Ek),t&&(s+=Sk),n.filter(r=>!vv(r)).reduce((r,i)=>r+(jk.test(i)?Nk:i===""?Ck:kk),s)}function Tk(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function Dk(e,t,n){let{routesMeta:s}=e,r={},i="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,h=i==="/"?t:t.slice(i.length)||"/",d=_k({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},h),f=c.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:Lr([i,d.pathname]),pathnameBase:Lk(Lr([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=Lr([i,d.pathnameBase]))}return o}function _k(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=Ak(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],o=i.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:s.reduce((u,h,d)=>{let{paramName:f,isOptional:x}=h;if(f==="*"){let b=l[d]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const y=l[d];return x&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function Ak(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),qg(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 s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function Ok(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qg(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Gg(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const zk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rk=e=>zk.test(e);function Uk(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?wl(e):e,i;if(n)if(Rk(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),qg(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=yv(n.substring(1),"/"):i=yv(n,t)}else i=t;return{pathname:i,search:Pk(s),hash:Hk(r)}}function yv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Am(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function $k(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Yj(e,t){let n=$k(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Ij(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=wl(e):(r=Vc({},e),Qt(!r.pathname||!r.pathname.includes("?"),Am("?","pathname","search",r)),Qt(!r.pathname||!r.pathname.includes("#"),Am("#","pathname","hash",r)),Qt(!r.search||!r.search.includes("#"),Am("#","search","hash",r)));let i=e===""||r.pathname==="",o=i?"/":r.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=Uk(r,l),u=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||h)&&(c.pathname+="/"),c}const Lr=e=>e.join("/").replace(/\/\/+/g,"/"),Lk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Pk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Hk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Bk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Fj=["post","put","patch","delete"];new Set(Fj);const Vk=["get",...Fj];new Set(Vk);/**
59
- * React Router v6.30.2
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function Yc(){return Yc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Yc.apply(this,arguments)}const Xg=m.createContext(null),Yk=m.createContext(null),Fi=m.createContext(null),gf=m.createContext(null),Jr=m.createContext({outlet:null,matches:[],isDataRoute:!1}),Wj=m.createContext(null);function Ik(e,t){let{relative:n}=t===void 0?{}:t;wd()||Qt(!1);let{basename:s,navigator:r}=m.useContext(Fi),{hash:i,pathname:o,search:l}=Gj(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:Lr([s,o])),r.createHref({pathname:c,search:l,hash:i})}function wd(){return m.useContext(gf)!=null}function jl(){return wd()||Qt(!1),m.useContext(gf).location}function qj(e){m.useContext(Fi).static||m.useLayoutEffect(e)}function Gs(){let{isDataRoute:e}=m.useContext(Jr);return e?sE():Fk()}function Fk(){wd()||Qt(!1);let e=m.useContext(Xg),{basename:t,future:n,navigator:s}=m.useContext(Fi),{matches:r}=m.useContext(Jr),{pathname:i}=jl(),o=JSON.stringify(Yj(r,n.v7_relativeSplatPath)),l=m.useRef(!1);return qj(()=>{l.current=!0}),m.useCallback(function(u,h){if(h===void 0&&(h={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=Ij(u,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Lr([t,d.pathname])),(h.replace?s.replace:s.push)(d,h.state,h)},[t,s,o,i,e])}function Zg(){let{matches:e}=m.useContext(Jr),t=e[e.length-1];return t?t.params:{}}function Gj(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=m.useContext(Fi),{matches:r}=m.useContext(Jr),{pathname:i}=jl(),o=JSON.stringify(Yj(r,s.v7_relativeSplatPath));return m.useMemo(()=>Ij(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function Wk(e,t){return qk(e,t)}function qk(e,t,n,s){wd()||Qt(!1);let{navigator:r}=m.useContext(Fi),{matches:i}=m.useContext(Jr),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=jl(),h;if(t){var d;let w=typeof t=="string"?wl(t):t;c==="/"||(d=w.pathname)!=null&&d.startsWith(c)||Qt(!1),h=w}else h=u;let f=h.pathname||"/",x=f;if(c!=="/"){let w=c.replace(/^\//,"").split("/");x="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=vk(e,{pathname:x}),b=Kk(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:Lr([c,r.encodeLocation?r.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:Lr([c,r.encodeLocation?r.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,s);return t&&b?m.createElement(gf.Provider,{value:{location:Yc({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Tr.Pop}},b):b}function Gk(){let e=nE(),t=Bk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:r},n):null,null)}const Xk=m.createElement(Gk,null);class Zk extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Jr.Provider,{value:this.props.routeContext},m.createElement(Wj.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Qk(e){let{routeContext:t,match:n,children:s}=e,r=m.useContext(Xg);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Jr.Provider,{value:t},s)}function Kk(e,t,n,s){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=s)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(r=n)==null?void 0:r.errors;if(l!=null){let h=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);h>=0||Qt(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let h=0;h<o.length;h++){let d=o[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=h),d.route.id){let{loaderData:f,errors:x}=n,y=d.route.loader&&f[d.route.id]===void 0&&(!x||x[d.route.id]===void 0);if(d.route.lazy||y){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((h,d,f)=>{let x,y=!1,b=null,w=null;n&&(x=l&&d.route.id?l[d.route.id]:void 0,b=d.route.errorElement||Xk,c&&(u<0&&f===0?(aE("route-fallback"),y=!0,w=null):u===f&&(y=!0,w=d.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),v=()=>{let p;return x?p=b:y?p=w:d.route.Component?p=m.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=h,m.createElement(Qk,{match:d,routeContext:{outlet:h,matches:g,isDataRoute:n!=null},children:p})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?m.createElement(Zk,{location:n.location,revalidation:n.revalidation,component:b,error:x,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var Xj=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Xj||{}),Zj=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Zj||{});function Jk(e){let t=m.useContext(Xg);return t||Qt(!1),t}function eE(e){let t=m.useContext(Yk);return t||Qt(!1),t}function tE(e){let t=m.useContext(Jr);return t||Qt(!1),t}function Qj(e){let t=tE(),n=t.matches[t.matches.length-1];return n.route.id||Qt(!1),n.route.id}function nE(){var e;let t=m.useContext(Wj),n=eE(),s=Qj();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function sE(){let{router:e}=Jk(Xj.UseNavigateStable),t=Qj(Zj.UseNavigateStable),n=m.useRef(!1);return qj(()=>{n.current=!0}),m.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,Yc({fromRouteId:t},i)))},[e,t])}const wv={};function aE(e,t,n){wv[e]||(wv[e]=!0)}function rE(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function An(e){Qt(!1)}function iE(e){let{basename:t="/",children:n=null,location:s,navigationType:r=Tr.Pop,navigator:i,static:o=!1,future:l}=e;wd()&&Qt(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:i,static:o,future:Yc({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof s=="string"&&(s=wl(s));let{pathname:h="/",search:d="",hash:f="",state:x=null,key:y="default"}=s,b=m.useMemo(()=>{let w=Gg(h,c);return w==null?null:{location:{pathname:w,search:d,hash:f,state:x,key:y},navigationType:r}},[c,h,d,f,x,y,r]);return b==null?null:m.createElement(Fi.Provider,{value:u},m.createElement(gf.Provider,{children:n,value:b}))}function oE(e){let{children:t,location:n}=e;return Wk(u0(t),n)}new Promise(()=>{});function u0(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(s,r)=>{if(!m.isValidElement(s))return;let i=[...t,r];if(s.type===m.Fragment){n.push.apply(n,u0(s.props.children,i));return}s.type!==An&&Qt(!1),!s.props.index||!s.props.children||Qt(!1);let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=u0(s.props.children,i)),n.push(o)}),n}/**
68
- * React Router DOM v6.30.2
69
- *
70
- * Copyright (c) Remix Software Inc.
71
- *
72
- * This source code is licensed under the MIT license found in the
73
- * LICENSE.md file in the root directory of this source tree.
74
- *
75
- * @license MIT
76
- */function h0(){return h0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},h0.apply(this,arguments)}function lE(e,t){if(e==null)return{};var n={},s=Object.keys(e),r,i;for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function cE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dE(e,t){return e.button===0&&(!t||t==="_self")&&!cE(e)}function f0(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(r=>[n,r]):[[n,s]])},[]))}function uE(e,t){let n=f0(e);return t&&t.forEach((s,r)=>{n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)})}),n}const hE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],fE="6";try{window.__reactRouterVersion=fE}catch{}const mE="startTransition",jv=Zh[mE];function xE(e){let{basename:t,children:n,future:s,window:r}=e,i=m.useRef();i.current==null&&(i.current=gk({window:r,v5Compat:!0}));let o=i.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},h=m.useCallback(d=>{u&&jv?jv(()=>c(d)):c(d)},[c,u]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>rE(s),[s]),m.createElement(iE,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const gE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qg=m.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:h,viewTransition:d}=t,f=lE(t,hE),{basename:x}=m.useContext(Fi),y,b=!1;if(typeof u=="string"&&pE.test(u)&&(y=u,gE))try{let p=new URL(window.location.href),j=u.startsWith("//")?new URL(p.protocol+u):new URL(u),N=Gg(j.pathname,x);j.origin===p.origin&&N!=null?u=N+j.search+j.hash:b=!0}catch{}let w=Ik(u,{relative:r}),g=bE(u,{replace:o,state:l,target:c,preventScrollReset:h,relative:r,viewTransition:d});function v(p){s&&s(p),p.defaultPrevented||g(p)}return m.createElement("a",h0({},f,{href:y||w,onClick:b||i?s:v,ref:n,target:c}))});var Nv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Nv||(Nv={}));var Sv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Sv||(Sv={}));function bE(e,t){let{target:n,replace:s,state:r,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Gs(),u=jl(),h=Gj(e,{relative:o});return m.useCallback(d=>{if(dE(d,n)){d.preventDefault();let f=s!==void 0?s:yh(u)===yh(h);c(e,{replace:f,state:r,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,h,s,r,n,e,i,o,l])}function vE(e){let t=m.useRef(f0(e)),n=m.useRef(!1),s=jl(),r=m.useMemo(()=>uE(s.search,n.current?null:t.current),[s.search]),i=Gs(),o=m.useCallback((l,c)=>{const u=f0(typeof l=="function"?l(r):l);n.current=!0,i("?"+u,c)},[i,r]);return[r,o]}function yE(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const wE=e=>{switch(e){case"success":return SE;case"info":return kE;case"warning":return CE;case"error":return EE;default:return null}},jE=Array(12).fill(0),NE=({visible:e,className:t})=>K.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},K.createElement("div",{className:"sonner-spinner"},jE.map((n,s)=>K.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),SE=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),CE=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},K.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),kE=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),EE=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ME=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},K.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),K.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),TE=()=>{const[e,t]=K.useState(document.hidden);return K.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let m0=1;class DE{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:s,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:m0++,o=this.toasts.find(c=>c.id===i),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:s}),{...c,...t,id:i,dismissible:l,title:s}):c):this.addToast({title:s,...r,dismissible:l,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let i=s!==void 0,o;const l=r.then(async u=>{if(o=["resolve",u],K.isValidElement(u))i=!1,this.create({id:s,type:"default",message:u});else if(AE(u)&&!u.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,y=typeof d=="object"&&!K.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:f,...y})}else if(u instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,y=typeof d=="object"&&!K.isValidElement(d)?d:{message:d};this.create({id:s,type:"error",description:f,...y})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description,y=typeof d=="object"&&!K.isValidElement(d)?d:{message:d};this.create({id:s,type:"success",description:f,...y})}}).catch(async u=>{if(o=["reject",u],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(u):n.error,d=typeof n.description=="function"?await n.description(u):n.description,x=typeof h=="object"&&!K.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:d,...x})}}).finally(()=>{i&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,h)=>l.then(()=>o[0]==="reject"?h(o[1]):u(o[1])).catch(h));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(t,n)=>{const s=(n==null?void 0:n.id)||m0++;return this.create({jsx:t(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Un=new DE,_E=(e,t)=>{const n=(t==null?void 0:t.id)||m0++;return Un.addToast({title:e,...t,id:n}),n},AE=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",OE=_E,zE=()=>Un.toasts,RE=()=>Un.getActiveToasts(),P=Object.assign(OE,{success:Un.success,info:Un.info,warning:Un.warning,error:Un.error,custom:Un.custom,message:Un.message,promise:Un.promise,dismiss:Un.dismiss,loading:Un.loading},{getHistory:zE,getToasts:RE});yE("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Kd(e){return e.label!==void 0}const UE=3,$E="24px",LE="16px",Cv=4e3,PE=356,HE=14,BE=45,VE=200;function Js(...e){return e.filter(Boolean).join(" ")}function YE(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const IE=e=>{var t,n,s,r,i,o,l,c,u;const{invert:h,toast:d,unstyled:f,interacting:x,setHeights:y,visibleToasts:b,heights:w,index:g,toasts:v,expanded:p,removeToast:j,defaultRichColors:N,closeButton:C,style:S,cancelButtonStyle:M,actionButtonStyle:A,className:V="",descriptionClassName:$="",duration:z,position:Y,gap:E,expandByDefault:R,classNames:T,icons:_,closeButtonAriaLabel:k="Close toast"}=e,[D,L]=K.useState(null),[q,O]=K.useState(null),[B,X]=K.useState(!1),[Z,ne]=K.useState(!1),[ee,J]=K.useState(!1),[se,pe]=K.useState(!1),[re,he]=K.useState(!1),[fe,ke]=K.useState(0),[Oe,Re]=K.useState(0),Be=K.useRef(d.duration||z||Cv),dt=K.useRef(null),Ie=K.useRef(null),St=g===0,bt=g+1<=b,qe=d.type,et=d.dismissible!==!1,Qe=d.className||"",vt=d.descriptionClassName||"",yt=K.useMemo(()=>w.findIndex(F=>F.toastId===d.id)||0,[w,d.id]),Ht=K.useMemo(()=>{var F;return(F=d.closeButton)!=null?F:C},[d.closeButton,C]),It=K.useMemo(()=>d.duration||z||Cv,[d.duration,z]),te=K.useRef(0),be=K.useRef(0),He=K.useRef(0),I=K.useRef(null),[le,ue]=Y.split("-"),xe=K.useMemo(()=>w.reduce((F,me,Ve)=>Ve>=yt?F:F+me.height,0),[w,yt]),Te=TE(),We=d.invert||h,G=qe==="loading";be.current=K.useMemo(()=>yt*E+xe,[yt,xe]),K.useEffect(()=>{Be.current=It},[It]),K.useEffect(()=>{X(!0)},[]),K.useEffect(()=>{const F=Ie.current;if(F){const me=F.getBoundingClientRect().height;return Re(me),y(Ve=>[{toastId:d.id,height:me,position:d.position},...Ve]),()=>y(Ve=>Ve.filter(tt=>tt.toastId!==d.id))}},[y,d.id]),K.useLayoutEffect(()=>{if(!B)return;const F=Ie.current,me=F.style.height;F.style.height="auto";const Ve=F.getBoundingClientRect().height;F.style.height=me,Re(Ve),y(tt=>tt.find(Ke=>Ke.toastId===d.id)?tt.map(Ke=>Ke.toastId===d.id?{...Ke,height:Ve}:Ke):[{toastId:d.id,height:Ve,position:d.position},...tt])},[B,d.title,d.description,y,d.id,d.jsx,d.action,d.cancel]);const ae=K.useCallback(()=>{ne(!0),ke(be.current),y(F=>F.filter(me=>me.toastId!==d.id)),setTimeout(()=>{j(d)},VE)},[d,j,y,be]);K.useEffect(()=>{if(d.promise&&qe==="loading"||d.duration===1/0||d.type==="loading")return;let F;return p||x||Te?(()=>{if(He.current<te.current){const tt=new Date().getTime()-te.current;Be.current=Be.current-tt}He.current=new Date().getTime()})():(()=>{Be.current!==1/0&&(te.current=new Date().getTime(),F=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),ae()},Be.current))})(),()=>clearTimeout(F)},[p,x,d,qe,Te,ae]),K.useEffect(()=>{d.delete&&(ae(),d.onDismiss==null||d.onDismiss.call(d,d))},[ae,d.delete]);function ye(){var F;if(_!=null&&_.loading){var me;return K.createElement("div",{className:Js(T==null?void 0:T.loader,d==null||(me=d.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":qe==="loading"},_.loading)}return K.createElement(NE,{className:Js(T==null?void 0:T.loader,d==null||(F=d.classNames)==null?void 0:F.loader),visible:qe==="loading"})}const de=d.icon||(_==null?void 0:_[qe])||wE(qe);var Se,W;return K.createElement("li",{tabIndex:0,ref:Ie,className:Js(V,Qe,T==null?void 0:T.toast,d==null||(t=d.classNames)==null?void 0:t.toast,T==null?void 0:T.default,T==null?void 0:T[qe],d==null||(n=d.classNames)==null?void 0:n[qe]),"data-sonner-toast":"","data-rich-colors":(Se=d.richColors)!=null?Se:N,"data-styled":!(d.jsx||d.unstyled||f),"data-mounted":B,"data-promise":!!d.promise,"data-swiped":re,"data-removed":Z,"data-visible":bt,"data-y-position":le,"data-x-position":ue,"data-index":g,"data-front":St,"data-swiping":ee,"data-dismissible":et,"data-type":qe,"data-invert":We,"data-swipe-out":se,"data-swipe-direction":q,"data-expanded":!!(p||R&&B),"data-testid":d.testId,style:{"--index":g,"--toasts-before":g,"--z-index":v.length-g,"--offset":`${Z?fe:be.current}px`,"--initial-height":R?"auto":`${Oe}px`,...S,...d.style},onDragEnd:()=>{J(!1),L(null),I.current=null},onPointerDown:F=>{F.button!==2&&(G||!et||(dt.current=new Date,ke(be.current),F.target.setPointerCapture(F.pointerId),F.target.tagName!=="BUTTON"&&(J(!0),I.current={x:F.clientX,y:F.clientY})))},onPointerUp:()=>{var F,me,Ve;if(se||!et)return;I.current=null;const tt=Number(((F=Ie.current)==null?void 0:F.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nt=Number(((me=Ie.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ke=new Date().getTime()-((Ve=dt.current)==null?void 0:Ve.getTime()),Gt=D==="x"?tt:nt,cn=Math.abs(Gt)/Ke;if(Math.abs(Gt)>=BE||cn>.11){ke(be.current),d.onDismiss==null||d.onDismiss.call(d,d),O(D==="x"?tt>0?"right":"left":nt>0?"down":"up"),ae(),pe(!0);return}else{var en,Ft;(en=Ie.current)==null||en.style.setProperty("--swipe-amount-x","0px"),(Ft=Ie.current)==null||Ft.style.setProperty("--swipe-amount-y","0px")}he(!1),J(!1),L(null)},onPointerMove:F=>{var me,Ve,tt;if(!I.current||!et||((me=window.getSelection())==null?void 0:me.toString().length)>0)return;const Ke=F.clientY-I.current.y,Gt=F.clientX-I.current.x;var cn;const en=(cn=e.swipeDirections)!=null?cn:YE(Y);!D&&(Math.abs(Gt)>1||Math.abs(Ke)>1)&&L(Math.abs(Gt)>Math.abs(Ke)?"x":"y");let Ft={x:0,y:0};const Na=mn=>1/(1.5+Math.abs(mn)/20);if(D==="y"){if(en.includes("top")||en.includes("bottom"))if(en.includes("top")&&Ke<0||en.includes("bottom")&&Ke>0)Ft.y=Ke;else{const mn=Ke*Na(Ke);Ft.y=Math.abs(mn)<Math.abs(Ke)?mn:Ke}}else if(D==="x"&&(en.includes("left")||en.includes("right")))if(en.includes("left")&&Gt<0||en.includes("right")&&Gt>0)Ft.x=Gt;else{const mn=Gt*Na(Gt);Ft.x=Math.abs(mn)<Math.abs(Gt)?mn:Gt}(Math.abs(Ft.x)>0||Math.abs(Ft.y)>0)&&he(!0),(Ve=Ie.current)==null||Ve.style.setProperty("--swipe-amount-x",`${Ft.x}px`),(tt=Ie.current)==null||tt.style.setProperty("--swipe-amount-y",`${Ft.y}px`)}},Ht&&!d.jsx&&qe!=="loading"?K.createElement("button",{"aria-label":k,"data-disabled":G,"data-close-button":!0,onClick:G||!et?()=>{}:()=>{ae(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Js(T==null?void 0:T.closeButton,d==null||(s=d.classNames)==null?void 0:s.closeButton)},(W=_==null?void 0:_.close)!=null?W:ME):null,(qe||d.icon||d.promise)&&d.icon!==null&&((_==null?void 0:_[qe])!==null||d.icon)?K.createElement("div",{"data-icon":"",className:Js(T==null?void 0:T.icon,d==null||(r=d.classNames)==null?void 0:r.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||ye():null,d.type!=="loading"?de:null):null,K.createElement("div",{"data-content":"",className:Js(T==null?void 0:T.content,d==null||(i=d.classNames)==null?void 0:i.content)},K.createElement("div",{"data-title":"",className:Js(T==null?void 0:T.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?K.createElement("div",{"data-description":"",className:Js($,vt,T==null?void 0:T.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),K.isValidElement(d.cancel)?d.cancel:d.cancel&&Kd(d.cancel)?K.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||M,onClick:F=>{Kd(d.cancel)&&et&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,F),ae())},className:Js(T==null?void 0:T.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,K.isValidElement(d.action)?d.action:d.action&&Kd(d.action)?K.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||A,onClick:F=>{Kd(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,F),!F.defaultPrevented&&ae())},className:Js(T==null?void 0:T.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function kv(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function FE(e,t){const n={};return[e,t].forEach((s,r)=>{const i=r===1,o=i?"--mobile-offset":"--offset",l=i?LE:$E;function c(u){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):c(l)}),n}const WE=K.forwardRef(function(t,n){const{id:s,invert:r,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:h,mobileOffset:d,theme:f="light",richColors:x,duration:y,style:b,visibleToasts:w=UE,toastOptions:g,dir:v=kv(),gap:p=HE,icons:j,containerAriaLabel:N="Notifications"}=t,[C,S]=K.useState([]),M=K.useMemo(()=>s?C.filter(B=>B.toasterId===s):C.filter(B=>!B.toasterId),[C,s]),A=K.useMemo(()=>Array.from(new Set([i].concat(M.filter(B=>B.position).map(B=>B.position)))),[M,i]),[V,$]=K.useState([]),[z,Y]=K.useState(!1),[E,R]=K.useState(!1),[T,_]=K.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),k=K.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=K.useRef(null),q=K.useRef(!1),O=K.useCallback(B=>{S(X=>{var Z;return(Z=X.find(ne=>ne.id===B.id))!=null&&Z.delete||Un.dismiss(B.id),X.filter(({id:ne})=>ne!==B.id)})},[]);return K.useEffect(()=>Un.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{S(X=>X.map(Z=>Z.id===B.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{r1.flushSync(()=>{S(X=>{const Z=X.findIndex(ne=>ne.id===B.id);return Z!==-1?[...X.slice(0,Z),{...X[Z],...B},...X.slice(Z+1)]:[B,...X]})})})}),[C]),K.useEffect(()=>{if(f!=="system"){_(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?_("dark"):_("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:X})=>{_(X?"dark":"light")})}catch{B.addListener(({matches:Z})=>{try{_(Z?"dark":"light")}catch(ne){console.error(ne)}})}},[f]),K.useEffect(()=>{C.length<=1&&Y(!1)},[C]),K.useEffect(()=>{const B=X=>{var Z;if(o.every(J=>X[J]||X.code===J)){var ee;Y(!0),(ee=k.current)==null||ee.focus()}X.code==="Escape"&&(document.activeElement===k.current||(Z=k.current)!=null&&Z.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[o]),K.useEffect(()=>{if(k.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,q.current=!1)}},[k.current]),K.createElement("section",{ref:n,"aria-label":`${N} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((B,X)=>{var Z;const[ne,ee]=B.split("-");return M.length?K.createElement("ol",{key:B,dir:v==="auto"?kv():v,tabIndex:-1,ref:k,className:u,"data-sonner-toaster":!0,"data-sonner-theme":T,"data-y-position":ne,"data-x-position":ee,style:{"--front-toast-height":`${((Z=V[0])==null?void 0:Z.height)||0}px`,"--width":`${PE}px`,"--gap":`${p}px`,...b,...FE(h,d)},onBlur:J=>{q.current&&!J.currentTarget.contains(J.relatedTarget)&&(q.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||q.current||(q.current=!0,L.current=J.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{E||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||R(!0)},onPointerUp:()=>R(!1)},M.filter(J=>!J.position&&X===0||J.position===B).map((J,se)=>{var pe,re;return K.createElement(IE,{key:J.id,icons:j,index:se,toast:J,defaultRichColors:x,duration:(pe=g==null?void 0:g.duration)!=null?pe:y,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:w,closeButton:(re=g==null?void 0:g.closeButton)!=null?re:c,interacting:E,position:B,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:O,toasts:M.filter(he=>he.position==J.position),heights:V.filter(he=>he.position==J.position),setHeights:$,expandByDefault:l,gap:p,expanded:z,swipeDirections:t.swipeDirections})})):null}))});function Jt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=Jt(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var qE={value:()=>{}};function pf(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Ou(n)}function Ou(e){this._=e}function GE(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Ou.prototype=pf.prototype={constructor:Ou,on:function(e,t){var n=this._,s=GE(e+"",n),r,i=-1,o=s.length;if(arguments.length<2){for(;++i<o;)if((r=(e=s[i]).type)&&(r=XE(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(r=(e=s[i]).type)n[r]=Ev(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Ev(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ou(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function XE(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Ev(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=qE,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var x0="http://www.w3.org/1999/xhtml";const Mv={svg:"http://www.w3.org/2000/svg",xhtml:x0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bf(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Mv.hasOwnProperty(t)?{space:Mv[t],local:e}:e}function ZE(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===x0&&t.documentElement.namespaceURI===x0?t.createElement(e):t.createElementNS(n,e)}}function QE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Kj(e){var t=bf(e);return(t.local?QE:ZE)(t)}function KE(){}function Kg(e){return e==null?KE:function(){return this.querySelector(e)}}function JE(e){typeof e!="function"&&(e=Kg(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=new Array(o),c,u,h=0;h<o;++h)(c=i[h])&&(u=e.call(c,c.__data__,h,i))&&("__data__"in c&&(u.__data__=c.__data__),l[h]=u);return new ls(s,this._parents)}function eM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function tM(){return[]}function Jj(e){return e==null?tM:function(){return this.querySelectorAll(e)}}function nM(e){return function(){return eM(e.apply(this,arguments))}}function sM(e){typeof e=="function"?e=nM(e):e=Jj(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var o=t[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&(s.push(e.call(c,c.__data__,u,o)),r.push(c));return new ls(s,r)}function eN(e){return function(){return this.matches(e)}}function tN(e){return function(t){return t.matches(e)}}var aM=Array.prototype.find;function rM(e){return function(){return aM.call(this.children,e)}}function iM(){return this.firstElementChild}function oM(e){return this.select(e==null?iM:rM(typeof e=="function"?e:tN(e)))}var lM=Array.prototype.filter;function cM(){return Array.from(this.children)}function dM(e){return function(){return lM.call(this.children,e)}}function uM(e){return this.selectAll(e==null?cM:dM(typeof e=="function"?e:tN(e)))}function hM(e){typeof e!="function"&&(e=eN(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new ls(s,this._parents)}function nN(e){return new Array(e.length)}function fM(){return new ls(this._enter||this._groups.map(nN),this._parents)}function wh(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}wh.prototype={constructor:wh,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 mM(e){return function(){return e}}function xM(e,t,n,s,r,i){for(var o=0,l,c=t.length,u=i.length;o<u;++o)(l=t[o])?(l.__data__=i[o],s[o]=l):n[o]=new wh(e,i[o]);for(;o<c;++o)(l=t[o])&&(r[o]=l)}function gM(e,t,n,s,r,i,o){var l,c,u=new Map,h=t.length,d=i.length,f=new Array(h),x;for(l=0;l<h;++l)(c=t[l])&&(f[l]=x=o.call(c,c.__data__,l,t)+"",u.has(x)?r[l]=c:u.set(x,c));for(l=0;l<d;++l)x=o.call(e,i[l],l,i)+"",(c=u.get(x))?(s[l]=c,c.__data__=i[l],u.delete(x)):n[l]=new wh(e,i[l]);for(l=0;l<h;++l)(c=t[l])&&u.get(f[l])===c&&(r[l]=c)}function pM(e){return e.__data__}function bM(e,t){if(!arguments.length)return Array.from(this,pM);var n=t?gM:xM,s=this._parents,r=this._groups;typeof e!="function"&&(e=mM(e));for(var i=r.length,o=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var h=s[u],d=r[u],f=d.length,x=vM(e.call(h,h&&h.__data__,u,s)),y=x.length,b=l[u]=new Array(y),w=o[u]=new Array(y),g=c[u]=new Array(f);n(h,d,b,w,g,x,t);for(var v=0,p=0,j,N;v<y;++v)if(j=b[v]){for(v>=p&&(p=v+1);!(N=w[p])&&++p<y;);j._next=N||null}}return o=new ls(o,s),o._enter=l,o._exit=c,o}function vM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yM(){return new ls(this._exit||this._groups.map(nN),this._parents)}function wM(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function jM(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,o=Math.min(r,i),l=new Array(r),c=0;c<o;++c)for(var u=n[c],h=s[c],d=u.length,f=l[c]=new Array(d),x,y=0;y<d;++y)(x=u[y]||h[y])&&(f[y]=x);for(;c<r;++c)l[c]=n[c];return new ls(l,this._parents)}function NM(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],o;--r>=0;)(o=s[r])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function SM(e){e||(e=CM);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var o=n[i],l=o.length,c=r[i]=new Array(l),u,h=0;h<l;++h)(u=o[h])&&(c[h]=u);c.sort(t)}return new ls(r,this._parents).order()}function CM(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function kM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function EM(){return Array.from(this)}function MM(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var o=s[r];if(o)return o}return null}function TM(){let e=0;for(const t of this)++e;return e}function DM(){return!this.node()}function _M(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,o=r.length,l;i<o;++i)(l=r[i])&&e.call(l,l.__data__,i,r);return this}function AM(e){return function(){this.removeAttribute(e)}}function OM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zM(e,t){return function(){this.setAttribute(e,t)}}function RM(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function UM(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function $M(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function LM(e,t){var n=bf(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?OM:AM:typeof t=="function"?n.local?$M:UM:n.local?RM:zM)(n,t))}function sN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function PM(e){return function(){this.style.removeProperty(e)}}function HM(e,t,n){return function(){this.style.setProperty(e,t,n)}}function BM(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function VM(e,t,n){return arguments.length>1?this.each((t==null?PM:typeof t=="function"?BM:HM)(e,t,n??"")):tl(this.node(),e)}function tl(e,t){return e.style.getPropertyValue(t)||sN(e).getComputedStyle(e,null).getPropertyValue(t)}function YM(e){return function(){delete this[e]}}function IM(e,t){return function(){this[e]=t}}function FM(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function WM(e,t){return arguments.length>1?this.each((t==null?YM:typeof t=="function"?FM:IM)(e,t)):this.node()[e]}function aN(e){return e.trim().split(/^|\s+/)}function Jg(e){return e.classList||new rN(e)}function rN(e){this._node=e,this._names=aN(e.getAttribute("class")||"")}rN.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 iN(e,t){for(var n=Jg(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function oN(e,t){for(var n=Jg(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function qM(e){return function(){iN(this,e)}}function GM(e){return function(){oN(this,e)}}function XM(e,t){return function(){(t.apply(this,arguments)?iN:oN)(this,e)}}function ZM(e,t){var n=aN(e+"");if(arguments.length<2){for(var s=Jg(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?XM:t?qM:GM)(n,t))}function QM(){this.textContent=""}function KM(e){return function(){this.textContent=e}}function JM(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function e8(e){return arguments.length?this.each(e==null?QM:(typeof e=="function"?JM:KM)(e)):this.node().textContent}function t8(){this.innerHTML=""}function n8(e){return function(){this.innerHTML=e}}function s8(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function a8(e){return arguments.length?this.each(e==null?t8:(typeof e=="function"?s8:n8)(e)):this.node().innerHTML}function r8(){this.nextSibling&&this.parentNode.appendChild(this)}function i8(){return this.each(r8)}function o8(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function l8(){return this.each(o8)}function c8(e){var t=typeof e=="function"?e:Kj(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function d8(){return null}function u8(e,t){var n=typeof e=="function"?e:Kj(e),s=t==null?d8:typeof t=="function"?t:Kg(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function h8(){var e=this.parentNode;e&&e.removeChild(this)}function f8(){return this.each(h8)}function m8(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function x8(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function g8(e){return this.select(e?x8:m8)}function p8(e){return arguments.length?this.property("__data__",e):this.node().__data__}function b8(e){return function(t){e.call(this,t,this.__data__)}}function v8(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function y8(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function w8(e,t,n){return function(){var s=this.__on,r,i=b8(t);if(s){for(var o=0,l=s.length;o<l;++o)if((r=s[o]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function j8(e,t,n){var s=v8(e+""),r,i=s.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,h;c<u;++c)for(r=0,h=l[c];r<i;++r)if((o=s[r]).type===h.type&&o.name===h.name)return h.value}return}for(l=t?w8:y8,r=0;r<i;++r)this.each(l(s[r],t,n));return this}function lN(e,t,n){var s=sN(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function N8(e,t){return function(){return lN(this,e,t)}}function S8(e,t){return function(){return lN(this,e,t.apply(this,arguments))}}function C8(e,t){return this.each((typeof t=="function"?S8:N8)(e,t))}function*k8(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,o;r<i;++r)(o=s[r])&&(yield o)}var cN=[null];function ls(e,t){this._groups=e,this._parents=t}function jd(){return new ls([[document.documentElement]],cN)}function E8(){return this}ls.prototype=jd.prototype={constructor:ls,select:JE,selectAll:sM,selectChild:oM,selectChildren:uM,filter:hM,data:bM,enter:fM,exit:yM,join:wM,merge:jM,selection:E8,order:NM,sort:SM,call:kM,nodes:EM,node:MM,size:TM,empty:DM,each:_M,attr:LM,style:VM,property:WM,classed:ZM,text:e8,html:a8,raise:i8,lower:l8,append:c8,insert:u8,remove:f8,clone:g8,datum:p8,on:j8,dispatch:C8,[Symbol.iterator]:k8};function ts(e){return typeof e=="string"?new ls([[document.querySelector(e)]],[document.documentElement]):new ls([[e]],cN)}function M8(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Us(e,t){if(e=M8(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const T8={passive:!1},Ic={capture:!0,passive:!1};function Om(e){e.stopImmediatePropagation()}function $o(e){e.preventDefault(),e.stopImmediatePropagation()}function dN(e){var t=e.document.documentElement,n=ts(e).on("dragstart.drag",$o,Ic);"onselectstart"in t?n.on("selectstart.drag",$o,Ic):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function uN(e,t){var n=e.document.documentElement,s=ts(e).on("dragstart.drag",null);t&&(s.on("click.drag",$o,Ic),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Jd=e=>()=>e;function g0(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:o,y:l,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}g0.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function D8(e){return!e.ctrlKey&&!e.button}function _8(){return this.parentNode}function A8(e,t){return t??{x:e.x,y:e.y}}function O8(){return navigator.maxTouchPoints||"ontouchstart"in this}function hN(){var e=D8,t=_8,n=A8,s=O8,r={},i=pf("start","drag","end"),o=0,l,c,u,h,d=0;function f(j){j.on("mousedown.drag",x).filter(s).on("touchstart.drag",w).on("touchmove.drag",g,T8).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(j,N){if(!(h||!e.call(this,j,N))){var C=p(this,t.call(this,j,N),j,N,"mouse");C&&(ts(j.view).on("mousemove.drag",y,Ic).on("mouseup.drag",b,Ic),dN(j.view),Om(j),u=!1,l=j.clientX,c=j.clientY,C("start",j))}}function y(j){if($o(j),!u){var N=j.clientX-l,C=j.clientY-c;u=N*N+C*C>d}r.mouse("drag",j)}function b(j){ts(j.view).on("mousemove.drag mouseup.drag",null),uN(j.view,u),$o(j),r.mouse("end",j)}function w(j,N){if(e.call(this,j,N)){var C=j.changedTouches,S=t.call(this,j,N),M=C.length,A,V;for(A=0;A<M;++A)(V=p(this,S,j,N,C[A].identifier,C[A]))&&(Om(j),V("start",j,C[A]))}}function g(j){var N=j.changedTouches,C=N.length,S,M;for(S=0;S<C;++S)(M=r[N[S].identifier])&&($o(j),M("drag",j,N[S]))}function v(j){var N=j.changedTouches,C=N.length,S,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),S=0;S<C;++S)(M=r[N[S].identifier])&&(Om(j),M("end",j,N[S]))}function p(j,N,C,S,M,A){var V=i.copy(),$=Us(A||C,N),z,Y,E;if((E=n.call(j,new g0("beforestart",{sourceEvent:C,target:f,identifier:M,active:o,x:$[0],y:$[1],dx:0,dy:0,dispatch:V}),S))!=null)return z=E.x-$[0]||0,Y=E.y-$[1]||0,function R(T,_,k){var D=$,L;switch(T){case"start":r[M]=R,L=o++;break;case"end":delete r[M],--o;case"drag":$=Us(k||_,N),L=o;break}V.call(T,j,new g0(T,{sourceEvent:_,subject:E,target:f,identifier:M,active:L,x:$[0]+z,y:$[1]+Y,dx:$[0]-D[0],dy:$[1]-D[1],dispatch:V}),S)}}return f.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Jd(!!j),f):e},f.container=function(j){return arguments.length?(t=typeof j=="function"?j:Jd(j),f):t},f.subject=function(j){return arguments.length?(n=typeof j=="function"?j:Jd(j),f):n},f.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:Jd(!!j),f):s},f.on=function(){var j=i.on.apply(i,arguments);return j===i?f:j},f.clickDistance=function(j){return arguments.length?(d=(j=+j)*j,f):Math.sqrt(d)},f}function ep(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fN(e,t){var n=Object.create(e.prototype);for(var s in t)n[s]=t[s];return n}function Nd(){}var Fc=.7,jh=1/Fc,Lo="\\s*([+-]?\\d+)\\s*",Wc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z8=/^#([0-9a-f]{3,8})$/,R8=new RegExp(`^rgb\\(${Lo},${Lo},${Lo}\\)$`),U8=new RegExp(`^rgb\\(${fa},${fa},${fa}\\)$`),$8=new RegExp(`^rgba\\(${Lo},${Lo},${Lo},${Wc}\\)$`),L8=new RegExp(`^rgba\\(${fa},${fa},${fa},${Wc}\\)$`),P8=new RegExp(`^hsl\\(${Wc},${fa},${fa}\\)$`),H8=new RegExp(`^hsla\\(${Wc},${fa},${fa},${Wc}\\)$`),Tv={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};ep(Nd,_i,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Dv,formatHex:Dv,formatHex8:B8,formatHsl:V8,formatRgb:_v,toString:_v});function Dv(){return this.rgb().formatHex()}function B8(){return this.rgb().formatHex8()}function V8(){return mN(this).formatHsl()}function _v(){return this.rgb().formatRgb()}function _i(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=z8.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Av(t):n===3?new $n(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?eu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?eu(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=R8.exec(e))?new $n(t[1],t[2],t[3],1):(t=U8.exec(e))?new $n(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$8.exec(e))?eu(t[1],t[2],t[3],t[4]):(t=L8.exec(e))?eu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=P8.exec(e))?Rv(t[1],t[2]/100,t[3]/100,1):(t=H8.exec(e))?Rv(t[1],t[2]/100,t[3]/100,t[4]):Tv.hasOwnProperty(e)?Av(Tv[e]):e==="transparent"?new $n(NaN,NaN,NaN,0):null}function Av(e){return new $n(e>>16&255,e>>8&255,e&255,1)}function eu(e,t,n,s){return s<=0&&(e=t=n=NaN),new $n(e,t,n,s)}function Y8(e){return e instanceof Nd||(e=_i(e)),e?(e=e.rgb(),new $n(e.r,e.g,e.b,e.opacity)):new $n}function p0(e,t,n,s){return arguments.length===1?Y8(e):new $n(e,t,n,s??1)}function $n(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}ep($n,p0,fN(Nd,{brighter(e){return e=e==null?jh:Math.pow(jh,e),new $n(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fc:Math.pow(Fc,e),new $n(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $n(Si(this.r),Si(this.g),Si(this.b),Nh(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:Ov,formatHex:Ov,formatHex8:I8,formatRgb:zv,toString:zv}));function Ov(){return`#${xi(this.r)}${xi(this.g)}${xi(this.b)}`}function I8(){return`#${xi(this.r)}${xi(this.g)}${xi(this.b)}${xi((isNaN(this.opacity)?1:this.opacity)*255)}`}function zv(){const e=Nh(this.opacity);return`${e===1?"rgb(":"rgba("}${Si(this.r)}, ${Si(this.g)}, ${Si(this.b)}${e===1?")":`, ${e})`}`}function Nh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Si(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xi(e){return e=Si(e),(e<16?"0":"")+e.toString(16)}function Rv(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $s(e,t,n,s)}function mN(e){if(e instanceof $s)return new $s(e.h,e.s,e.l,e.opacity);if(e instanceof Nd||(e=_i(e)),!e)return new $s;if(e instanceof $s)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,r=Math.min(t,n,s),i=Math.max(t,n,s),o=NaN,l=i-r,c=(i+r)/2;return l?(t===i?o=(n-s)/l+(n<s)*6:n===i?o=(s-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+r:2-i-r,o*=60):l=c>0&&c<1?0:o,new $s(o,l,c,e.opacity)}function F8(e,t,n,s){return arguments.length===1?mN(e):new $s(e,t,n,s??1)}function $s(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}ep($s,F8,fN(Nd,{brighter(e){return e=e==null?jh:Math.pow(jh,e),new $s(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fc:Math.pow(Fc,e),new $s(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,n=this.l,s=n+(n<.5?n:1-n)*t,r=2*n-s;return new $n(zm(e>=240?e-240:e+120,r,s),zm(e,r,s),zm(e<120?e+240:e-120,r,s),this.opacity)},clamp(){return new $s(Uv(this.h),tu(this.s),tu(this.l),Nh(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=Nh(this.opacity);return`${e===1?"hsl(":"hsla("}${Uv(this.h)}, ${tu(this.s)*100}%, ${tu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Uv(e){return e=(e||0)%360,e<0?e+360:e}function tu(e){return Math.max(0,Math.min(1,e||0))}function zm(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const tp=e=>()=>e;function W8(e,t){return function(n){return e+n*t}}function q8(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function G8(e){return(e=+e)==1?xN:function(t,n){return n-t?q8(t,n,e):tp(isNaN(t)?n:t)}}function xN(e,t){var n=t-e;return n?W8(e,n):tp(isNaN(e)?t:e)}const Sh=function e(t){var n=G8(t);function s(r,i){var o=n((r=p0(r)).r,(i=p0(i)).r),l=n(r.g,i.g),c=n(r.b,i.b),u=xN(r.opacity,i.opacity);return function(h){return r.r=o(h),r.g=l(h),r.b=c(h),r.opacity=u(h),r+""}}return s.gamma=e,s}(1);function X8(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),r;return function(i){for(r=0;r<n;++r)s[r]=e[r]*(1-i)+t[r]*i;return s}}function Z8(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Q8(e,t){var n=t?t.length:0,s=e?Math.min(n,e.length):0,r=new Array(s),i=new Array(n),o;for(o=0;o<s;++o)r[o]=Nc(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(l){for(o=0;o<s;++o)i[o]=r[o](l);return i}}function K8(e,t){var n=new Date;return e=+e,t=+t,function(s){return n.setTime(e*(1-s)+t*s),n}}function aa(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function J8(e,t){var n={},s={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Nc(e[r],t[r]):s[r]=t[r];return function(i){for(r in n)s[r]=n[r](i);return s}}var b0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rm=new RegExp(b0.source,"g");function eT(e){return function(){return e}}function tT(e){return function(t){return e(t)+""}}function gN(e,t){var n=b0.lastIndex=Rm.lastIndex=0,s,r,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(s=b0.exec(e))&&(r=Rm.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(s=s[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:aa(s,r)})),n=Rm.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?tT(c[0].x):eT(t):(t=c.length,function(u){for(var h=0,d;h<t;++h)l[(d=c[h]).i]=d.x(u);return l.join("")})}function Nc(e,t){var n=typeof t,s;return t==null||n==="boolean"?tp(t):(n==="number"?aa:n==="string"?(s=_i(t))?(t=s,Sh):gN:t instanceof _i?Sh:t instanceof Date?K8:Z8(t)?X8:Array.isArray(t)?Q8:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?J8:aa)(e,t)}var $v=180/Math.PI,v0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pN(e,t,n,s,r,i){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(l=Math.sqrt(n*n+s*s))&&(n/=l,s/=l,c/=l),e*s<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*$v,skewX:Math.atan(c)*$v,scaleX:o,scaleY:l}}var nu;function nT(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?v0:pN(t.a,t.b,t.c,t.d,t.e,t.f)}function sT(e){return e==null||(nu||(nu=document.createElementNS("http://www.w3.org/2000/svg","g")),nu.setAttribute("transform",e),!(e=nu.transform.baseVal.consolidate()))?v0:(e=e.matrix,pN(e.a,e.b,e.c,e.d,e.e,e.f))}function bN(e,t,n,s){function r(u){return u.length?u.pop()+" ":""}function i(u,h,d,f,x,y){if(u!==d||h!==f){var b=x.push("translate(",null,t,null,n);y.push({i:b-4,x:aa(u,d)},{i:b-2,x:aa(h,f)})}else(d||f)&&x.push("translate("+d+t+f+n)}function o(u,h,d,f){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(r(d)+"rotate(",null,s)-2,x:aa(u,h)})):h&&d.push(r(d)+"rotate("+h+s)}function l(u,h,d,f){u!==h?f.push({i:d.push(r(d)+"skewX(",null,s)-2,x:aa(u,h)}):h&&d.push(r(d)+"skewX("+h+s)}function c(u,h,d,f,x,y){if(u!==d||h!==f){var b=x.push(r(x)+"scale(",null,",",null,")");y.push({i:b-4,x:aa(u,d)},{i:b-2,x:aa(h,f)})}else(d!==1||f!==1)&&x.push(r(x)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=e(u),h=e(h),i(u.translateX,u.translateY,h.translateX,h.translateY,d,f),o(u.rotate,h.rotate,d,f),l(u.skewX,h.skewX,d,f),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(x){for(var y=-1,b=f.length,w;++y<b;)d[(w=f[y]).i]=w.x(x);return d.join("")}}}var aT=bN(nT,"px, ","px)","deg)"),rT=bN(sT,", ",")",")"),iT=1e-12;function Lv(e){return((e=Math.exp(e))+1/e)/2}function oT(e){return((e=Math.exp(e))-1/e)/2}function lT(e){return((e=Math.exp(2*e))-1)/(e+1)}const zu=function e(t,n,s){function r(i,o){var l=i[0],c=i[1],u=i[2],h=o[0],d=o[1],f=o[2],x=h-l,y=d-c,b=x*x+y*y,w,g;if(b<iT)g=Math.log(f/u)/t,w=function(S){return[l+S*x,c+S*y,u*Math.exp(t*S*g)]};else{var v=Math.sqrt(b),p=(f*f-u*u+s*b)/(2*u*n*v),j=(f*f-u*u-s*b)/(2*f*n*v),N=Math.log(Math.sqrt(p*p+1)-p),C=Math.log(Math.sqrt(j*j+1)-j);g=(C-N)/t,w=function(S){var M=S*g,A=Lv(N),V=u/(n*v)*(A*lT(t*M+N)-oT(N));return[l+V*x,c+V*y,u*A/Lv(t*M+N)]}}return w.duration=g*1e3*t/Math.SQRT2,w}return r.rho=function(i){var o=Math.max(.001,+i),l=o*o,c=l*l;return e(o,l,c)},r}(Math.SQRT2,2,4);var nl=0,rc=0,Vl=0,vN=1e3,Ch,ic,kh=0,Ai=0,vf=0,qc=typeof performance=="object"&&performance.now?performance:Date,yN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function np(){return Ai||(yN(cT),Ai=qc.now()+vf)}function cT(){Ai=0}function Eh(){this._call=this._time=this._next=null}Eh.prototype=wN.prototype={constructor:Eh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?np():+n)+(t==null?0:+t),!this._next&&ic!==this&&(ic?ic._next=this:Ch=this,ic=this),this._call=e,this._time=n,y0()},stop:function(){this._call&&(this._call=null,this._time=1/0,y0())}};function wN(e,t,n){var s=new Eh;return s.restart(e,t,n),s}function dT(){np(),++nl;for(var e=Ch,t;e;)(t=Ai-e._time)>=0&&e._call.call(void 0,t),e=e._next;--nl}function Pv(){Ai=(kh=qc.now())+vf,nl=rc=0;try{dT()}finally{nl=0,hT(),Ai=0}}function uT(){var e=qc.now(),t=e-kh;t>vN&&(vf-=t,kh=e)}function hT(){for(var e,t=Ch,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ch=n);ic=e,y0(s)}function y0(e){if(!nl){rc&&(rc=clearTimeout(rc));var t=e-Ai;t>24?(e<1/0&&(rc=setTimeout(Pv,e-qc.now()-vf)),Vl&&(Vl=clearInterval(Vl))):(Vl||(kh=qc.now(),Vl=setInterval(uT,vN)),nl=1,yN(Pv))}}function Hv(e,t,n){var s=new Eh;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var fT=pf("start","end","cancel","interrupt"),mT=[],jN=0,Bv=1,w0=2,Ru=3,Vv=4,j0=5,Uu=6;function yf(e,t,n,s,r,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;xT(e,n,{name:t,index:s,group:r,on:fT,tween:mT,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:jN})}function sp(e,t){var n=Xs(e,t);if(n.state>jN)throw new Error("too late; already scheduled");return n}function va(e,t){var n=Xs(e,t);if(n.state>Ru)throw new Error("too late; already running");return n}function Xs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function xT(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=wN(i,0,n.time);function i(u){n.state=Bv,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var h,d,f,x;if(n.state!==Bv)return c();for(h in s)if(x=s[h],x.name===n.name){if(x.state===Ru)return Hv(o);x.state===Vv?(x.state=Uu,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[h]):+h<t&&(x.state=Uu,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[h])}if(Hv(function(){n.state===Ru&&(n.state=Vv,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=w0,n.on.call("start",e,e.__data__,n.index,n.group),n.state===w0){for(n.state=Ru,r=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(x=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=x);r.length=d+1}}function l(u){for(var h=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=j0,1),d=-1,f=r.length;++d<f;)r[d].call(e,h);n.state===j0&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Uu,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function $u(e,t){var n=e.__transition,s,r,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((s=n[o]).name!==t){i=!1;continue}r=s.state>w0&&s.state<j0,s.state=Uu,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[o]}i&&delete e.__transition}}function gT(e){return this.each(function(){$u(this,e)})}function pT(e,t){var n,s;return function(){var r=va(this,e),i=r.tween;if(i!==n){s=n=i;for(var o=0,l=s.length;o<l;++o)if(s[o].name===t){s=s.slice(),s.splice(o,1);break}}r.tween=s}}function bT(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=va(this,e),o=i.tween;if(o!==s){r=(s=o).slice();for(var l={name:t,value:n},c=0,u=r.length;c<u;++c)if(r[c].name===t){r[c]=l;break}c===u&&r.push(l)}i.tween=r}}function vT(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Xs(this.node(),n).tween,r=0,i=s.length,o;r<i;++r)if((o=s[r]).name===e)return o.value;return null}return this.each((t==null?pT:bT)(n,e,t))}function ap(e,t,n){var s=e._id;return e.each(function(){var r=va(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Xs(r,s).value[t]}}function NN(e,t){var n;return(typeof t=="number"?aa:t instanceof _i?Sh:(n=_i(t))?(t=n,Sh):gN)(e,t)}function yT(e){return function(){this.removeAttribute(e)}}function wT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jT(e,t,n){var s,r=n+"",i;return function(){var o=this.getAttribute(e);return o===r?null:o===s?i:i=t(s=o,n)}}function NT(e,t,n){var s,r=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===r?null:o===s?i:i=t(s=o,n)}}function ST(e,t,n){var s,r,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l)))}}function CT(e,t,n){var s,r,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l)))}}function kT(e,t){var n=bf(e),s=n==="transform"?rT:NN;return this.attrTween(e,typeof t=="function"?(n.local?CT:ST)(n,s,ap(this,"attr."+e,t)):t==null?(n.local?wT:yT)(n):(n.local?NT:jT)(n,s,t))}function ET(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function MT(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function TT(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&MT(e,i)),n}return r._value=t,r}function DT(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&ET(e,i)),n}return r._value=t,r}function _T(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=bf(e);return this.tween(n,(s.local?TT:DT)(s,t))}function AT(e,t){return function(){sp(this,e).delay=+t.apply(this,arguments)}}function OT(e,t){return t=+t,function(){sp(this,e).delay=t}}function zT(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?AT:OT)(t,e)):Xs(this.node(),t).delay}function RT(e,t){return function(){va(this,e).duration=+t.apply(this,arguments)}}function UT(e,t){return t=+t,function(){va(this,e).duration=t}}function $T(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?RT:UT)(t,e)):Xs(this.node(),t).duration}function LT(e,t){if(typeof t!="function")throw new Error;return function(){va(this,e).ease=t}}function PT(e){var t=this._id;return arguments.length?this.each(LT(t,e)):Xs(this.node(),t).ease}function HT(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;va(this,e).ease=n}}function BT(e){if(typeof e!="function")throw new Error;return this.each(HT(this._id,e))}function VT(e){typeof e!="function"&&(e=eN(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],o=i.length,l=s[r]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Qa(s,this._parents,this._name,this._id)}function YT(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),o=new Array(s),l=0;l<i;++l)for(var c=t[l],u=n[l],h=c.length,d=o[l]=new Array(h),f,x=0;x<h;++x)(f=c[x]||u[x])&&(d[x]=f);for(;l<s;++l)o[l]=t[l];return new Qa(o,this._parents,this._name,this._id)}function IT(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function FT(e,t,n){var s,r,i=IT(t)?sp:va;return function(){var o=i(this,e),l=o.on;l!==s&&(r=(s=l).copy()).on(t,n),o.on=r}}function WT(e,t){var n=this._id;return arguments.length<2?Xs(this.node(),n).on.on(e):this.each(FT(n,e,t))}function qT(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function GT(){return this.on("end.remove",qT(this._id))}function XT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kg(e));for(var s=this._groups,r=s.length,i=new Array(r),o=0;o<r;++o)for(var l=s[o],c=l.length,u=i[o]=new Array(c),h,d,f=0;f<c;++f)(h=l[f])&&(d=e.call(h,h.__data__,f,l))&&("__data__"in h&&(d.__data__=h.__data__),u[f]=d,yf(u[f],t,n,f,u,Xs(h,n)));return new Qa(i,this._parents,t,n)}function ZT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jj(e));for(var s=this._groups,r=s.length,i=[],o=[],l=0;l<r;++l)for(var c=s[l],u=c.length,h,d=0;d<u;++d)if(h=c[d]){for(var f=e.call(h,h.__data__,d,c),x,y=Xs(h,n),b=0,w=f.length;b<w;++b)(x=f[b])&&yf(x,t,n,b,f,y);i.push(f),o.push(h)}return new Qa(i,o,t,n)}var QT=jd.prototype.constructor;function KT(){return new QT(this._groups,this._parents)}function JT(e,t){var n,s,r;return function(){var i=tl(this,e),o=(this.style.removeProperty(e),tl(this,e));return i===o?null:i===n&&o===s?r:r=t(n=i,s=o)}}function SN(e){return function(){this.style.removeProperty(e)}}function eD(e,t,n){var s,r=n+"",i;return function(){var o=tl(this,e);return o===r?null:o===s?i:i=t(s=o,n)}}function tD(e,t,n){var s,r,i;return function(){var o=tl(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),tl(this,e))),o===c?null:o===s&&c===r?i:(r=c,i=t(s=o,l))}}function nD(e,t){var n,s,r,i="style."+t,o="end."+i,l;return function(){var c=va(this,e),u=c.on,h=c.value[i]==null?l||(l=SN(t)):void 0;(u!==n||r!==h)&&(s=(n=u).copy()).on(o,r=h),c.on=s}}function sD(e,t,n){var s=(e+="")=="transform"?aT:NN;return t==null?this.styleTween(e,JT(e,s)).on("end.style."+e,SN(e)):typeof t=="function"?this.styleTween(e,tD(e,s,ap(this,"style."+e,t))).each(nD(this._id,e)):this.styleTween(e,eD(e,s,t),n).on("end.style."+e,null)}function aD(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function rD(e,t,n){var s,r;function i(){var o=t.apply(this,arguments);return o!==r&&(s=(r=o)&&aD(e,o,n)),s}return i._value=t,i}function iD(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,rD(e,t,n??""))}function oD(e){return function(){this.textContent=e}}function lD(e){return function(){var t=e(this);this.textContent=t??""}}function cD(e){return this.tween("text",typeof e=="function"?lD(ap(this,"text",e)):oD(e==null?"":e+""))}function dD(e){return function(t){this.textContent=e.call(this,t)}}function uD(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&dD(r)),t}return s._value=e,s}function hD(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,uD(e))}function fD(){for(var e=this._name,t=this._id,n=CN(),s=this._groups,r=s.length,i=0;i<r;++i)for(var o=s[i],l=o.length,c,u=0;u<l;++u)if(c=o[u]){var h=Xs(c,t);yf(c,e,n,u,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Qa(s,this._parents,e,n)}function mD(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,o){var l={value:o},c={value:function(){--r===0&&i()}};n.each(function(){var u=va(this,s),h=u.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),r===0&&i()})}var xD=0;function Qa(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function CN(){return++xD}var Ta=jd.prototype;Qa.prototype={constructor:Qa,select:XT,selectAll:ZT,selectChild:Ta.selectChild,selectChildren:Ta.selectChildren,filter:VT,merge:YT,selection:KT,transition:fD,call:Ta.call,nodes:Ta.nodes,node:Ta.node,size:Ta.size,empty:Ta.empty,each:Ta.each,on:WT,attr:kT,attrTween:_T,style:sD,styleTween:iD,text:cD,textTween:hD,remove:GT,tween:vT,delay:zT,duration:$T,ease:PT,easeVarying:BT,end:mD,[Symbol.iterator]:Ta[Symbol.iterator]};function gD(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var pD={time:null,delay:0,duration:250,ease:gD};function bD(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function vD(e){var t,n;e instanceof Qa?(t=e._id,e=e._name):(t=CN(),(n=pD).time=np(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var o=s[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&yf(c,e,t,u,o,n||bD(c,t));return new Qa(s,this._parents,e,t)}jd.prototype.interrupt=gT;jd.prototype.transition=vD;const su=e=>()=>e;function yD(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function Ha(e,t,n){this.k=e,this.x=t,this.y=n}Ha.prototype={constructor:Ha,scale:function(e){return e===1?this:new Ha(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ha(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 wf=new Ha(1,0,0);kN.prototype=Ha.prototype;function kN(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wf;return e.__zoom}function Um(e){e.stopImmediatePropagation()}function Yl(e){e.preventDefault(),e.stopImmediatePropagation()}function wD(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function jD(){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 Yv(){return this.__zoom||wf}function ND(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function SD(){return navigator.maxTouchPoints||"ontouchstart"in this}function CD(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function EN(){var e=wD,t=jD,n=CD,s=ND,r=SD,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=zu,u=pf("start","zoom","end"),h,d,f,x=500,y=150,b=0,w=10;function g(E){E.property("__zoom",Yv).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",$).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(E,R,T,_){var k=E.selection?E.selection():E;k.property("__zoom",Yv),E!==k?N(E,R,T,_):k.interrupt().each(function(){C(this,arguments).event(_).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},g.scaleBy=function(E,R,T,_){g.scaleTo(E,function(){var k=this.__zoom.k,D=typeof R=="function"?R.apply(this,arguments):R;return k*D},T,_)},g.scaleTo=function(E,R,T,_){g.transform(E,function(){var k=t.apply(this,arguments),D=this.__zoom,L=T==null?j(k):typeof T=="function"?T.apply(this,arguments):T,q=D.invert(L),O=typeof R=="function"?R.apply(this,arguments):R;return n(p(v(D,O),L,q),k,o)},T,_)},g.translateBy=function(E,R,T,_){g.transform(E,function(){return n(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),o)},null,_)},g.translateTo=function(E,R,T,_,k){g.transform(E,function(){var D=t.apply(this,arguments),L=this.__zoom,q=_==null?j(D):typeof _=="function"?_.apply(this,arguments):_;return n(wf.translate(q[0],q[1]).scale(L.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof T=="function"?-T.apply(this,arguments):-T),D,o)},_,k)};function v(E,R){return R=Math.max(i[0],Math.min(i[1],R)),R===E.k?E:new Ha(R,E.x,E.y)}function p(E,R,T){var _=R[0]-T[0]*E.k,k=R[1]-T[1]*E.k;return _===E.x&&k===E.y?E:new Ha(E.k,_,k)}function j(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function N(E,R,T,_){E.on("start.zoom",function(){C(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(_).end()}).tween("zoom",function(){var k=this,D=arguments,L=C(k,D).event(_),q=t.apply(k,D),O=T==null?j(q):typeof T=="function"?T.apply(k,D):T,B=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),X=k.__zoom,Z=typeof R=="function"?R.apply(k,D):R,ne=c(X.invert(O).concat(B/X.k),Z.invert(O).concat(B/Z.k));return function(ee){if(ee===1)ee=Z;else{var J=ne(ee),se=B/J[2];ee=new Ha(se,O[0]-J[0]*se,O[1]-J[1]*se)}L.zoom(null,ee)}})}function C(E,R,T){return!T&&E.__zooming||new S(E,R)}function S(E,R){this.that=E,this.args=R,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,R),this.taps=0}S.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,R){return this.mouse&&E!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var R=ts(this.that).datum();u.call(E,this.that,new yD(E,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),R)}};function M(E,...R){if(!e.apply(this,arguments))return;var T=C(this,R).event(E),_=this.__zoom,k=Math.max(i[0],Math.min(i[1],_.k*Math.pow(2,s.apply(this,arguments)))),D=Us(E);if(T.wheel)(T.mouse[0][0]!==D[0]||T.mouse[0][1]!==D[1])&&(T.mouse[1]=_.invert(T.mouse[0]=D)),clearTimeout(T.wheel);else{if(_.k===k)return;T.mouse=[D,_.invert(D)],$u(this),T.start()}Yl(E),T.wheel=setTimeout(L,y),T.zoom("mouse",n(p(v(_,k),T.mouse[0],T.mouse[1]),T.extent,o));function L(){T.wheel=null,T.end()}}function A(E,...R){if(f||!e.apply(this,arguments))return;var T=E.currentTarget,_=C(this,R,!0).event(E),k=ts(E.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",B,!0),D=Us(E,T),L=E.clientX,q=E.clientY;dN(E.view),Um(E),_.mouse=[D,this.__zoom.invert(D)],$u(this),_.start();function O(X){if(Yl(X),!_.moved){var Z=X.clientX-L,ne=X.clientY-q;_.moved=Z*Z+ne*ne>b}_.event(X).zoom("mouse",n(p(_.that.__zoom,_.mouse[0]=Us(X,T),_.mouse[1]),_.extent,o))}function B(X){k.on("mousemove.zoom mouseup.zoom",null),uN(X.view,_.moved),Yl(X),_.event(X).end()}}function V(E,...R){if(e.apply(this,arguments)){var T=this.__zoom,_=Us(E.changedTouches?E.changedTouches[0]:E,this),k=T.invert(_),D=T.k*(E.shiftKey?.5:2),L=n(p(v(T,D),_,k),t.apply(this,R),o);Yl(E),l>0?ts(this).transition().duration(l).call(N,L,_,E):ts(this).call(g.transform,L,_,E)}}function $(E,...R){if(e.apply(this,arguments)){var T=E.touches,_=T.length,k=C(this,R,E.changedTouches.length===_).event(E),D,L,q,O;for(Um(E),L=0;L<_;++L)q=T[L],O=Us(q,this),O=[O,this.__zoom.invert(O),q.identifier],k.touch0?!k.touch1&&k.touch0[2]!==O[2]&&(k.touch1=O,k.taps=0):(k.touch0=O,D=!0,k.taps=1+!!h);h&&(h=clearTimeout(h)),D&&(k.taps<2&&(d=O[0],h=setTimeout(function(){h=null},x)),$u(this),k.start())}}function z(E,...R){if(this.__zooming){var T=C(this,R).event(E),_=E.changedTouches,k=_.length,D,L,q,O;for(Yl(E),D=0;D<k;++D)L=_[D],q=Us(L,this),T.touch0&&T.touch0[2]===L.identifier?T.touch0[0]=q:T.touch1&&T.touch1[2]===L.identifier&&(T.touch1[0]=q);if(L=T.that.__zoom,T.touch1){var B=T.touch0[0],X=T.touch0[1],Z=T.touch1[0],ne=T.touch1[1],ee=(ee=Z[0]-B[0])*ee+(ee=Z[1]-B[1])*ee,J=(J=ne[0]-X[0])*J+(J=ne[1]-X[1])*J;L=v(L,Math.sqrt(ee/J)),q=[(B[0]+Z[0])/2,(B[1]+Z[1])/2],O=[(X[0]+ne[0])/2,(X[1]+ne[1])/2]}else if(T.touch0)q=T.touch0[0],O=T.touch0[1];else return;T.zoom("touch",n(p(L,q,O),T.extent,o))}}function Y(E,...R){if(this.__zooming){var T=C(this,R).event(E),_=E.changedTouches,k=_.length,D,L;for(Um(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),D=0;D<k;++D)L=_[D],T.touch0&&T.touch0[2]===L.identifier?delete T.touch0:T.touch1&&T.touch1[2]===L.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(L=Us(L,this),Math.hypot(d[0]-L[0],d[1]-L[1])<w)){var q=ts(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return g.wheelDelta=function(E){return arguments.length?(s=typeof E=="function"?E:su(+E),g):s},g.filter=function(E){return arguments.length?(e=typeof E=="function"?E:su(!!E),g):e},g.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:su(!!E),g):r},g.extent=function(E){return arguments.length?(t=typeof E=="function"?E:su([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),g):t},g.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],g):[i[0],i[1]]},g.translateExtent=function(E){return arguments.length?(o[0][0]=+E[0][0],o[1][0]=+E[1][0],o[0][1]=+E[0][1],o[1][1]=+E[1][1],g):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},g.constrain=function(E){return arguments.length?(n=E,g):n},g.duration=function(E){return arguments.length?(l=+E,g):l},g.interpolate=function(E){return arguments.length?(c=E,g):c},g.on=function(){var E=u.on.apply(u,arguments);return E===u?g:E},g.clickDistance=function(E){return arguments.length?(b=(E=+E)*E,g):Math.sqrt(b)},g.tapDistance=function(E){return arguments.length?(w=+E,g):w},g}const xa={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Gc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],MN=["Enter"," ","Escape"],TN={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var sl;(function(e){e.Strict="strict",e.Loose="loose"})(sl||(sl={}));var Ci;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ci||(Ci={}));var Xc;(function(e){e.Partial="partial",e.Full="full"})(Xc||(Xc={}));const DN={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Sr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Sr||(Sr={}));var Mh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Mh||(Mh={}));var $e;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})($e||($e={}));const Iv={[$e.Left]:$e.Right,[$e.Right]:$e.Left,[$e.Top]:$e.Bottom,[$e.Bottom]:$e.Top};function _N(e){return e===null?null:e?"valid":"invalid"}const AN=e=>"id"in e&&"source"in e&&"target"in e,kD=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rp=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Sd=(e,t=[0,0])=>{const{width:n,height:s}=tr(e),r=e.origin??t,i=n*r[0],o=s*r[1];return{x:e.position.x-i,y:e.position.y-o}},ED=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const i=typeof r=="string";let o=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(o=i?t.nodeLookup.get(r):rp(r)?r:t.nodeLookup.get(r.id));const l=o?Th(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return jf(s,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Nf(n)},Cd=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=jf(n,Th(r)),s=!0)}),s?Nf(n):{x:0,y:0,width:0,height:0}},ip=(e,t,[n,s,r]=[0,0,1],i=!1,o=!1)=>{const l={...Ed(t,[n,s,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=u;if(o&&!d||f)continue;const x=h.width??u.width??u.initialWidth??null,y=h.height??u.height??u.initialHeight??null,b=Zc(l,rl(u)),w=(x??0)*(y??0),g=i&&b>0;(!u.internals.handleBounds||g||b>=w||u.dragging)&&c.push(u)}return c},MD=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function TD(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function DD({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},o){if(e.size===0)return Promise.resolve(!0);const l=TD(e,o),c=Cd(l),u=op(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??i,(o==null?void 0:o.padding)??.1);return await s.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function ON({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},h=o.origin??s;let d=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)i==null||i("005",xa.error005());else{const x=l.measured.width,y=l.measured.height;x&&y&&(d=[[c,u],[c+x,u+y]])}else l&&il(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const f=il(d)?Oi(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(i==null||i("015",xa.error015())),{position:{x:f.x-c+(o.measured.width??0)*h[0],y:f.y-u+(o.measured.height??0)*h[1]},positionAbsolute:f}}async function _D({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),o=[];for(const f of n){if(f.deletable===!1)continue;const x=i.has(f.id),y=!x&&f.parentId&&o.find(b=>b.id===f.parentId);(x||y)&&o.push(f)}const l=new Set(t.map(f=>f.id)),c=s.filter(f=>f.deletable!==!1),h=MD(o,c);for(const f of c)l.has(f.id)&&!h.find(y=>y.id===f.id)&&h.push(f);if(!r)return{edges:h,nodes:o};const d=await r({nodes:o,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:o}:{edges:[],nodes:[]}:d}const al=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Oi=(e={x:0,y:0},t,n)=>({x:al(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:al(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function zN(e,t,n){const{width:s,height:r}=tr(n),{x:i,y:o}=n.internals.positionAbsolute;return Oi(e,[[i,o],[i+s,o+r]],t)}const Fv=(e,t,n)=>e<t?al(Math.abs(e-t),1,t)/t:e>n?-al(Math.abs(e-n),1,t)/t:0,RN=(e,t,n=15,s=40)=>{const r=Fv(e.x,s,t.width-s)*n,i=Fv(e.y,s,t.height-s)*n;return[r,i]},jf=(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)}),N0=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Nf=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),rl=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=rp(e)?e.internals.positionAbsolute:Sd(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Th=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=rp(e)?e.internals.positionAbsolute:Sd(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},UN=(e,t)=>Nf(jf(N0(e),N0(t))),Zc=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},Wv=e=>Ls(e.width)&&Ls(e.height)&&Ls(e.x)&&Ls(e.y),Ls=e=>!isNaN(e)&&isFinite(e),AD=(e,t)=>{},kd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ed=({x:e,y:t},[n,s,r],i=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-s)/r};return i?kd(l,o):l},Dh=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function to(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function OD(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=to(e,n),r=to(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=to(e.top??e.y??0,n),r=to(e.bottom??e.y??0,n),i=to(e.left??e.x??0,t),o=to(e.right??e.x??0,t);return{top:s,right:o,bottom:r,left:i,x:i+o,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zD(e,t,n,s,r,i){const{x:o,y:l}=Dh(e,[t,n,s]),{x:c,y:u}=Dh({x:e.x+e.width,y:e.y+e.height},[t,n,s]),h=r-c,d=i-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const op=(e,t,n,s,r,i)=>{const o=OD(i,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),h=al(u,s,r),d=e.x+e.width/2,f=e.y+e.height/2,x=t/2-d*h,y=n/2-f*h,b=zD(e,x,y,h,t,n),w={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:x-w.left+w.right,y:y-w.top+w.bottom,zoom:h}},Qc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function il(e){return e!=null&&e!=="parent"}function tr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function $N(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function LN(e,t={width:0,height:0},n,s,r){const i={...e},o=s.get(n);if(o){const l=o.origin||r;i.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function qv(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function RD(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function UD(e){return{...TN,...e||{}}}function Sc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:o}=Ps(e),l=Ed({x:i-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},s),{x:c,y:u}=n?kd(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const lp=e=>({width:e.offsetWidth,height:e.offsetHeight}),PN=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},$D=["INPUT","SELECT","TEXTAREA"];function HN(e){var s,r;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:$D.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const BN=e=>"clientX"in e,Ps=(e,t)=>{var i,o;const n=BN(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Gv=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/s,y:(l.top-n.top)/s,...lp(o)}})};function VN({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+i*.375+l*.375+s*.125,h=Math.abs(c-e),d=Math.abs(u-t);return[c,u,h,d]}function au(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xv({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case $e.Left:return[t-au(t-s,i),n];case $e.Right:return[t+au(s-t,i),n];case $e.Top:return[t,n-au(n-r,i)];case $e.Bottom:return[t,n+au(r-n,i)]}}function YN({sourceX:e,sourceY:t,sourcePosition:n=$e.Bottom,targetX:s,targetY:r,targetPosition:i=$e.Top,curvature:o=.25}){const[l,c]=Xv({pos:n,x1:e,y1:t,x2:s,y2:r,c:o}),[u,h]=Xv({pos:i,x1:s,y1:r,x2:e,y2:t,c:o}),[d,f,x,y]=VN({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:h});return[`M${e},${t} C${l},${c} ${u},${h} ${s},${r}`,d,f,x,y]}function IN({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,o=Math.abs(s-t)/2,l=s<t?s+o:s-o;return[i,l,r,o]}function LD({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:r=!1}){if(s!==void 0)return s;const i=r&&n?1e3:0,o=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return i+o}function PD({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=jf(Th(e),Th(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const o={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return Zc(o,Nf(i))>0}const HD=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,BD=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),FN=(e,t)=>{if(!e.source||!e.target)return t;let n;return AN(e)?n={...e}:n={...e,id:HD(e)},BD(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function WN({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,o,l]=IN({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,o,l]}const Zv={[$e.Left]:{x:-1,y:0},[$e.Right]:{x:1,y:0},[$e.Top]:{x:0,y:-1},[$e.Bottom]:{x:0,y:1}},VD=({source:e,sourcePosition:t=$e.Bottom,target:n})=>t===$e.Left||t===$e.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Qv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function YD({source:e,sourcePosition:t=$e.Bottom,target:n,targetPosition:s=$e.Top,center:r,offset:i,stepPosition:o}){const l=Zv[t],c=Zv[s],u={x:e.x+l.x*i,y:e.y+l.y*i},h={x:n.x+c.x*i,y:n.y+c.y*i},d=VD({source:u,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",x=d[f];let y=[],b,w;const g={x:0,y:0},v={x:0,y:0},[,,p,j]=IN({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(b=r.x??u.x+(h.x-u.x)*o,w=r.y??(u.y+h.y)/2):(b=r.x??(u.x+h.x)/2,w=r.y??u.y+(h.y-u.y)*o);const C=[{x:b,y:u.y},{x:b,y:h.y}],S=[{x:u.x,y:w},{x:h.x,y:w}];l[f]===x?y=f==="x"?C:S:y=f==="x"?S:C}else{const C=[{x:u.x,y:h.y}],S=[{x:h.x,y:u.y}];if(f==="x"?y=l.x===x?S:C:y=l.y===x?C:S,t===s){const z=Math.abs(e[f]-n[f]);if(z<=i){const Y=Math.min(i-1,i-z);l[f]===x?g[f]=(u[f]>e[f]?-1:1)*Y:v[f]=(h[f]>n[f]?-1:1)*Y}}if(t!==s){const z=f==="x"?"y":"x",Y=l[f]===c[z],E=u[z]>h[z],R=u[z]<h[z];(l[f]===1&&(!Y&&E||Y&&R)||l[f]!==1&&(!Y&&R||Y&&E))&&(y=f==="x"?C:S)}const M={x:u.x+g.x,y:u.y+g.y},A={x:h.x+v.x,y:h.y+v.y},V=Math.max(Math.abs(M.x-y[0].x),Math.abs(A.x-y[0].x)),$=Math.max(Math.abs(M.y-y[0].y),Math.abs(A.y-y[0].y));V>=$?(b=(M.x+A.x)/2,w=y[0].y):(b=y[0].x,w=(M.y+A.y)/2)}return[[e,{x:u.x+g.x,y:u.y+g.y},...y,{x:h.x+v.x,y:h.y+v.y},n],b,w,p,j]}function ID(e,t,n,s){const r=Math.min(Qv(e,t)/2,Qv(t,n)/2,s),{x:i,y:o}=t;if(e.x===i&&i===n.x||e.y===o&&o===n.y)return`L${i} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+r*u},${o}Q ${i},${o} ${i},${o+r*h}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${o+r*c}Q ${i},${o} ${i+r*l},${o}`}function S0({sourceX:e,sourceY:t,sourcePosition:n=$e.Bottom,targetX:s,targetY:r,targetPosition:i=$e.Top,borderRadius:o=5,centerX:l,centerY:c,offset:u=20,stepPosition:h=.5}){const[d,f,x,y,b]=YD({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:l,y:c},offset:u,stepPosition:h});return[d.reduce((g,v,p)=>{let j="";return p>0&&p<d.length-1?j=ID(d[p-1],v,d[p+1],o):j=`${p===0?"M":"L"}${v.x} ${v.y}`,g+=j,g},""),f,x,y,b]}function Kv(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function FD(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Kv(t)||!Kv(n))return null;const s=t.internals.handleBounds||Jv(t.handles),r=n.internals.handleBounds||Jv(n.handles),i=ey((s==null?void 0:s.source)??[],e.sourceHandle),o=ey(e.connectionMode===sl.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!o)return(d=e.onError)==null||d.call(e,"008",xa.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||$e.Bottom,c=(o==null?void 0:o.position)||$e.Top,u=Kc(t,i,l),h=Kc(n,o,c);return{sourceX:u.x,sourceY:u.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function Jv(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function Kc(e,t,n=$e.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??tr(e);if(s)return{x:r+o/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case $e.Top:return{x:r+o/2,y:i};case $e.Right:return{x:r+o,y:i+l/2};case $e.Bottom:return{x:r+o/2,y:i+l};case $e.Left:return{x:r,y:i+l/2}}}function ey(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function C0(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function WD(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((o,l)=>([l.markerStart||s,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=C0(c,t);i.has(u)||(o.push({id:u,color:c.color||n,...c}),i.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const qN=1e3,qD=10,cp={nodeOrigin:[0,0],nodeExtent:Gc,elevateNodesOnSelect:!0,defaults:{}},GD={...cp,checkEquality:!0};function dp(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function XD(e,t,n){const s=dp(cp,n);for(const r of e.values())if(r.parentId)up(r,e,t,s);else{const i=Sd(r,s.nodeOrigin),o=il(r.extent)?r.extent:s.nodeExtent,l=Oi(i,o,tr(r));r.internals.positionAbsolute=l}}function ZD(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],s=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&s.push(i)}return{source:n,target:s}}function k0(e,t,n,s){var u,h;const r=dp(GD,s);let i={i:-1},o=e.length>0;const l=new Map(t),c=r!=null&&r.elevateNodesOnSelect?qN:0;t.clear(),n.clear();for(const d of e){let f=l.get(d.id);if(r.checkEquality&&d===(f==null?void 0:f.internals.userNode))t.set(d.id,f);else{const x=Sd(d,r.nodeOrigin),y=il(d.extent)?d.extent:r.nodeExtent,b=Oi(x,y,tr(d));f={...r.defaults,...d,measured:{width:(u=d.measured)==null?void 0:u.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:b,handleBounds:ZD(d,f),z:GN(d,c),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(o=!1),d.parentId&&up(f,t,n,s,i)}return o}function QD(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function up(e,t,n,s,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:l}=dp(cp,s),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}QD(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*qD),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const h=i?qN:0,{x:d,y:f,z:x}=KD(e,u,o,l,h),{positionAbsolute:y}=e.internals,b=d!==y.x||f!==y.y;(b||x!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:d,y:f}:y,z:x}})}function GN(e,t){return(Ls(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function KD(e,t,n,s,r){const{x:i,y:o}=t.internals.positionAbsolute,l=tr(e),c=Sd(e,n),u=il(e.extent)?Oi(c,e.extent,l):c;let h=Oi({x:i+u.x,y:o+u.y},s,l);e.extent==="parent"&&(h=zN(h,l,t));const d=GN(e,r),f=t.internals.z??0;return{x:h.x,y:h.y,z:f>=d?f+1:d}}function hp(e,t,n,s=[0,0]){var o;const r=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=i.get(l.parentId))==null?void 0:o.expandedRect)??rl(c),h=UN(u,l.rect);i.set(l.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var p;const h=c.internals.positionAbsolute,d=tr(c),f=c.origin??s,x=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,y=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,b=Math.max(d.width,Math.round(l.width)),w=Math.max(d.height,Math.round(l.height)),g=(b-d.width)*f[0],v=(w-d.height)*f[1];(x>0||y>0||g||v)&&(r.push({id:u,type:"position",position:{x:c.position.x-x+g,y:c.position.y-y+v}}),(p=n.get(u))==null||p.forEach(j=>{e.some(N=>N.id===j.id)||r.push({id:j.id,type:"position",position:{x:j.position.x+x,y:j.position.y+y}})})),(d.width<l.width||d.height<l.height||x||y)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:b+(x?f[0]*x-g:0),height:w+(y?f[1]*y-v:0)}})}),r}function JD(e,t,n,s,r,i){const o=s==null?void 0:s.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(o),{m22:h}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const f of e.values()){const x=t.get(f.id);if(!x)continue;if(x.hidden){t.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),l=!0;continue}const y=lp(f.nodeElement),b=x.measured.width!==y.width||x.measured.height!==y.height;if(!!(y.width&&y.height&&(b||!x.internals.handleBounds||f.force))){const g=f.nodeElement.getBoundingClientRect(),v=il(x.extent)?x.extent:i;let{positionAbsolute:p}=x.internals;x.parentId&&x.extent==="parent"?p=zN(p,y,t.get(x.parentId)):v&&(p=Oi(p,v,y));const j={...x,measured:y,internals:{...x.internals,positionAbsolute:p,handleBounds:{source:Gv("source",f.nodeElement,g,h,x.id),target:Gv("target",f.nodeElement,g,h,x.id)}}};t.set(x.id,j),x.parentId&&up(j,t,n,{nodeOrigin:r}),l=!0,b&&(c.push({id:x.id,type:"dimensions",dimensions:y}),x.expandParent&&x.parentId&&d.push({id:x.id,parentId:x.parentId,rect:rl(j,r)}))}}if(d.length>0){const f=hp(d,t,n,r);c.push(...f)}return{changes:c,updatedInternals:l}}async function e_({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function ty(e,t,n,s,r,i){let o=r;const l=s.get(o)||new Map;s.set(o,l.set(n,t)),o=`${r}-${e}`;const c=s.get(o)||new Map;if(s.set(o,c.set(n,t)),i){o=`${r}-${e}-${i}`;const u=s.get(o)||new Map;s.set(o,u.set(n,t))}}function XN(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:o=null,targetHandle:l=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${i}-${l}`,h=`${i}-${l}--${r}-${o}`;ty("source",c,h,e,r,o),ty("target",c,u,e,i,l),t.set(s.id,s)}}function ZN(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:ZN(n,t):!1}function ny(e,t,n){var r;let s=e;do{if((r=s==null?void 0:s.matches)!=null&&r.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function t_(e,t,n,s){const r=new Map;for(const[i,o]of e)if((o.selected||o.id===s)&&(!o.parentId||!ZN(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(i);l&&r.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function $m({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var o,l,c;const r=[];for(const[u,h]of t){const d=(o=n.get(u))==null?void 0:o.internals.userNode;d&&r.push({...d,position:h.position,dragging:s})}if(!e)return[r[0],r];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:s}:r[0],r]}function n_({dragItems:e,snapGrid:t,x:n,y:s}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:s-r.distance.y},o=kd(i,t);return{x:o.x-i.x,y:o.y-i.y}}function s_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},h=null,d=!1,f=null,x=!1,y=!1,b=null;function w({noDragClassName:v,handleSelector:p,domNode:j,isSelectable:N,nodeId:C,nodeClickDistance:S=0}){f=ts(j);function M({x:z,y:Y}){const{nodeLookup:E,nodeExtent:R,snapGrid:T,snapToGrid:_,nodeOrigin:k,onNodeDrag:D,onSelectionDrag:L,onError:q,updateNodePositions:O}=t();i={x:z,y:Y};let B=!1;const X=l.size>1,Z=X&&R?N0(Cd(l)):null,ne=X&&_?n_({dragItems:l,snapGrid:T,x:z,y:Y}):null;for(const[ee,J]of l){if(!E.has(ee))continue;let se={x:z-J.distance.x,y:Y-J.distance.y};_&&(se=ne?{x:Math.round(se.x+ne.x),y:Math.round(se.y+ne.y)}:kd(se,T));let pe=null;if(X&&R&&!J.extent&&Z){const{positionAbsolute:fe}=J.internals,ke=fe.x-Z.x+R[0][0],Oe=fe.x+J.measured.width-Z.x2+R[1][0],Re=fe.y-Z.y+R[0][1],Be=fe.y+J.measured.height-Z.y2+R[1][1];pe=[[ke,Re],[Oe,Be]]}const{position:re,positionAbsolute:he}=ON({nodeId:ee,nextPosition:se,nodeLookup:E,nodeExtent:pe||R,nodeOrigin:k,onError:q});B=B||J.position.x!==re.x||J.position.y!==re.y,J.position=re,J.internals.positionAbsolute=he}if(y=y||B,!!B&&(O(l,!0),b&&(s||D||!C&&L))){const[ee,J]=$m({nodeId:C,dragItems:l,nodeLookup:E});s==null||s(b,l,ee,J),D==null||D(b,ee,J),C||L==null||L(b,J)}}async function A(){if(!h)return;const{transform:z,panBy:Y,autoPanSpeed:E,autoPanOnNodeDrag:R}=t();if(!R){c=!1,cancelAnimationFrame(o);return}const[T,_]=RN(u,h,E);(T!==0||_!==0)&&(i.x=(i.x??0)-T/z[2],i.y=(i.y??0)-_/z[2],await Y({x:T,y:_})&&M(i)),o=requestAnimationFrame(A)}function V(z){var X;const{nodeLookup:Y,multiSelectionActive:E,nodesDraggable:R,transform:T,snapGrid:_,snapToGrid:k,selectNodesOnDrag:D,onNodeDragStart:L,onSelectionDragStart:q,unselectNodesAndEdges:O}=t();d=!0,(!D||!N)&&!E&&C&&((X=Y.get(C))!=null&&X.selected||O()),N&&D&&C&&(e==null||e(C));const B=Sc(z.sourceEvent,{transform:T,snapGrid:_,snapToGrid:k,containerBounds:h});if(i=B,l=t_(Y,R,B,C),l.size>0&&(n||L||!C&&q)){const[Z,ne]=$m({nodeId:C,dragItems:l,nodeLookup:Y});n==null||n(z.sourceEvent,l,Z,ne),L==null||L(z.sourceEvent,Z,ne),C||q==null||q(z.sourceEvent,ne)}}const $=hN().clickDistance(S).on("start",z=>{const{domNode:Y,nodeDragThreshold:E,transform:R,snapGrid:T,snapToGrid:_}=t();h=(Y==null?void 0:Y.getBoundingClientRect())||null,x=!1,y=!1,b=z.sourceEvent,E===0&&V(z),i=Sc(z.sourceEvent,{transform:R,snapGrid:T,snapToGrid:_,containerBounds:h}),u=Ps(z.sourceEvent,h)}).on("drag",z=>{const{autoPanOnNodeDrag:Y,transform:E,snapGrid:R,snapToGrid:T,nodeDragThreshold:_,nodeLookup:k}=t(),D=Sc(z.sourceEvent,{transform:E,snapGrid:R,snapToGrid:T,containerBounds:h});if(b=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||C&&!k.has(C))&&(x=!0),!x){if(!c&&Y&&d&&(c=!0,A()),!d){const L=Ps(z.sourceEvent,h),q=L.x-u.x,O=L.y-u.y;Math.sqrt(q*q+O*O)>_&&V(z)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&l&&d&&(u=Ps(z.sourceEvent,h),M(D))}}).on("end",z=>{if(!(!d||x)&&(c=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:Y,updateNodePositions:E,onNodeDragStop:R,onSelectionDragStop:T}=t();if(y&&(E(l,!1),y=!1),r||R||!C&&T){const[_,k]=$m({nodeId:C,dragItems:l,nodeLookup:Y,dragging:!1});r==null||r(z.sourceEvent,l,_,k),R==null||R(z.sourceEvent,_,k),C||T==null||T(z.sourceEvent,k)}}}).filter(z=>{const Y=z.target;return!z.button&&(!v||!ny(Y,`.${v}`,j))&&(!p||ny(Y,p,j))});f.call($)}function g(){f==null||f.on(".drag",null)}return{update:w,destroy:g}}function a_(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Zc(r,rl(i))>0&&s.push(i);return s}const r_=250;function i_(e,t,n,s){var l,c;let r=[],i=1/0;const o=a_(e,n,t+r_);for(const u of o){const h=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of h){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x:f,y:x}=Kc(u,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(x-e.y,2));y>t||(y<i?(r=[{...d,x:f,y:x}],i=y):y===i&&r.push({...d,x:f,y:x}))}}if(!r.length)return null;if(r.length>1){const u=s.type==="source"?"target":"source";return r.find(h=>h.type===u)??r[0]}return r[0]}function QN(e,t,n,s,r,i=!1){var u,h,d;const o=s.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((h=o.internals.handleBounds)==null?void 0:h.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...Kc(o,c,c.position,!0)}:c}function KN(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function o_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const JN=()=>!0;function l_(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:x,onConnectStart:y,onConnect:b,onConnectEnd:w,isValidConnection:g=JN,onReconnectEnd:v,updateConnection:p,getTransform:j,getFromHandle:N,autoPanSpeed:C,dragThreshold:S=1,handleDomNode:M}){const A=PN(e.target);let V=0,$;const{x:z,y:Y}=Ps(e),E=KN(i,M),R=l==null?void 0:l.getBoundingClientRect();let T=!1;if(!R||!E)return;const _=QN(r,E,s,c,t);if(!_)return;let k=Ps(e,R),D=!1,L=null,q=!1,O=null;function B(){if(!h||!R)return;const[re,he]=RN(k,R,C);f({x:re,y:he}),V=requestAnimationFrame(B)}const X={..._,nodeId:r,type:E,position:_.position},Z=c.get(r);let ee={inProgress:!0,isValid:null,from:Kc(Z,X,$e.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:Z,to:k,toHandle:null,toPosition:Iv[X.position],toNode:null,pointer:k};function J(){T=!0,p(ee),y==null||y(e,{nodeId:r,handleId:s,handleType:E})}S===0&&J();function se(re){if(!T){const{x:Oe,y:Re}=Ps(re),Be=Oe-z,dt=Re-Y;if(!(Be*Be+dt*dt>S*S))return;J()}if(!N()||!X){pe(re);return}const he=j();k=Ps(re,R),$=i_(Ed(k,he,!1,[1,1]),n,c,X),D||(B(),D=!0);const fe=e4(re,{handle:$,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:o?"target":"source",isValidConnection:g,doc:A,lib:u,flowId:d,nodeLookup:c});O=fe.handleDomNode,L=fe.connection,q=o_(!!$,fe.isValid);const ke={...ee,isValid:q,to:fe.toHandle&&q?Dh({x:fe.toHandle.x,y:fe.toHandle.y},he):k,toHandle:fe.toHandle,toPosition:q&&fe.toHandle?fe.toHandle.position:Iv[X.position],toNode:fe.toHandle?c.get(fe.toHandle.nodeId):null,pointer:k};p(ke),ee=ke}function pe(re){if(!("touches"in re&&re.touches.length>0)){if(T){($||O)&&L&&q&&(b==null||b(L));const{inProgress:he,...fe}=ee,ke={...fe,toPosition:ee.toHandle?ee.toPosition:null};w==null||w(re,ke),i&&(v==null||v(re,ke))}x(),cancelAnimationFrame(V),D=!1,q=!1,L=null,O=null,A.removeEventListener("mousemove",se),A.removeEventListener("mouseup",pe),A.removeEventListener("touchmove",se),A.removeEventListener("touchend",pe)}}A.addEventListener("mousemove",se),A.addEventListener("mouseup",pe),A.addEventListener("touchmove",se),A.addEventListener("touchend",pe)}function e4(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:o,lib:l,flowId:c,isValidConnection:u=JN,nodeLookup:h}){const d=i==="target",f=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y}=Ps(e),b=o.elementFromPoint(x,y),w=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:f,g={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const v=KN(void 0,w),p=w.getAttribute("data-nodeid"),j=w.getAttribute("data-handleid"),N=w.classList.contains("connectable"),C=w.classList.contains("connectableend");if(!p||!v)return g;const S={source:d?p:s,sourceHandle:d?j:r,target:d?s:p,targetHandle:d?r:j};g.connection=S;const A=N&&C&&(n===sl.Strict?d&&v==="source"||!d&&v==="target":p!==s||j!==r);g.isValid=A&&u(S),g.toHandle=QN(p,v,j,h,n,!0)}return g}const E0={onPointerDown:l_,isValid:e4};function c_({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=ts(e);function i({translateExtent:l,width:c,height:u,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:x=!1}){const y=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const j=n(),N=p.sourceEvent.ctrlKey&&Qc()?10:1,C=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*h,S=j[2]*Math.pow(2,C*N);t.scaleTo(S)};let b=[0,0];const w=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(b=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},g=p=>{const j=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const N=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],C=[N[0]-b[0],N[1]-b[1]];b=N;const S=s()*Math.max(j[2],Math.log(j[2]))*(x?-1:1),M={x:j[0]-C[0]*S,y:j[1]-C[1]*S},A=[[0,0],[c,u]];t.setViewportConstrained({x:M.x,y:M.y,zoom:j[2]},A,l)},v=EN().on("start",w).on("zoom",d?g:null).on("zoom.wheel",f?y:null);r.call(v,{})}function o(){r.on("zoom",null)}return{update:i,destroy:o,pointer:Us}}const Sf=e=>({x:e.x,y:e.y,zoom:e.k}),Lm=({x:e,y:t,zoom:n})=>wf.translate(e,t).scale(n),ko=(e,t)=>e.target.closest(`.${t}`),t4=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),d_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Pm=(e,t=0,n=d_,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},n4=e=>{const t=e.ctrlKey&&Qc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function u_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return h=>{if(ko(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&o){const w=Us(h),g=n4(h),v=d*Math.pow(2,g);s.scaleTo(n,v,w,h);return}const f=h.deltaMode===1?20:1;let x=r===Ci.Vertical?0:h.deltaX*f,y=r===Ci.Horizontal?0:h.deltaY*f;!Qc()&&h.shiftKey&&r!==Ci.Vertical&&(x=h.deltaY*f,y=0),s.translateBy(n,-(x/d)*i,-(y/d)*i,{internal:!0});const b=Sf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(h,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,b))}}function h_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",o=!t&&i&&!s.ctrlKey,l=ko(s,e);if(s.ctrlKey&&i&&l&&s.preventDefault(),o||l)return null;s.preventDefault(),n.call(this,s,r)}}function f_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,o,l;if((i=s.sourceEvent)!=null&&i.internal)return;const r=Sf(s.transform);e.mouseButton=((o=s.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=s.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function m_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var o,l;e.usedRightMouseButton=!!(n&&t4(t,e.mouseButton??0)),(o=i.sourceEvent)!=null&&o.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((l=i.sourceEvent)!=null&&l.internal)&&(r==null||r(i.sourceEvent,Sf(i.transform)))}}function x_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&t4(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&i(o.sourceEvent),e.usedRightMouseButton=!1,s(!1),r)){const c=Sf(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function g_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:h}){return d=>{var w;const f=e||t,x=n&&d.ctrlKey,y=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ko(d,`${u}-flow__node`)||ko(d,`${u}-flow__edge`)))return!0;if(!s&&!f&&!r&&!i&&!n||o||h&&!y||ko(d,l)&&y||ko(d,c)&&(!y||r&&y&&!e)||!n&&d.ctrlKey&&y)return!1;if(!n&&d.type==="touchstart"&&((w=d.touches)==null?void 0:w.length)>1)return d.preventDefault(),!1;if(!f&&!r&&!x&&y||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const b=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||y)&&b}}function p_({domNode:e,minZoom:t,maxZoom:n,translateExtent:s,viewport:r,onPanZoom:i,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=EN().scaleExtent([t,n]).translateExtent(s),f=ts(e).call(d);v({x:r.x,y:r.y,zoom:al(r.zoom,t,n)},[[0,0],[h.width,h.height]],s);const x=f.on("wheel.zoom"),y=f.on("dblclick.zoom");d.wheelDelta(n4);function b($,z){return f?new Promise(Y=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?Nc:zu).transform(Pm(f,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>Y(!0)),$)}):Promise.resolve(!1)}function w({noWheelClassName:$,noPanClassName:z,onPaneContextMenu:Y,userSelectionActive:E,panOnScroll:R,panOnDrag:T,panOnScrollMode:_,panOnScrollSpeed:k,preventScrolling:D,zoomOnPinch:L,zoomOnScroll:q,zoomOnDoubleClick:O,zoomActivationKeyPressed:B,lib:X,onTransformChange:Z,connectionInProgress:ne,paneClickDistance:ee,selectionOnDrag:J}){E&&!u.isZoomingOrPanning&&g();const se=R&&!B&&!E;d.clickDistance(J?1/0:!Ls(ee)||ee<0?0:ee);const pe=se?u_({zoomPanValues:u,noWheelClassName:$,d3Selection:f,d3Zoom:d,panOnScrollMode:_,panOnScrollSpeed:k,zoomOnPinch:L,onPanZoomStart:o,onPanZoom:i,onPanZoomEnd:l}):h_({noWheelClassName:$,preventScrolling:D,d3ZoomHandler:x});if(f.on("wheel.zoom",pe,{passive:!1}),!E){const he=f_({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});d.on("start",he);const fe=m_({zoomPanValues:u,panOnDrag:T,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:Z});d.on("zoom",fe);const ke=x_({zoomPanValues:u,panOnDrag:T,panOnScroll:R,onPaneContextMenu:Y,onPanZoomEnd:l,onDraggingChange:c});d.on("end",ke)}const re=g_({zoomActivationKeyPressed:B,panOnDrag:T,zoomOnScroll:q,panOnScroll:R,zoomOnDoubleClick:O,zoomOnPinch:L,userSelectionActive:E,noPanClassName:z,noWheelClassName:$,lib:X,connectionInProgress:ne});d.filter(re),O?f.on("dblclick.zoom",y):f.on("dblclick.zoom",null)}function g(){d.on("zoom",null)}async function v($,z,Y){const E=Lm($),R=d==null?void 0:d.constrain()(E,z,Y);return R&&await b(R),new Promise(T=>T(R))}async function p($,z){const Y=Lm($);return await b(Y,z),new Promise(E=>E(Y))}function j($){if(f){const z=Lm($),Y=f.property("__zoom");(Y.k!==$.zoom||Y.x!==$.x||Y.y!==$.y)&&(d==null||d.transform(f,z,null,{sync:!0}))}}function N(){const $=f?kN(f.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function C($,z){return f?new Promise(Y=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?Nc:zu).scaleTo(Pm(f,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>Y(!0)),$)}):Promise.resolve(!1)}function S($,z){return f?new Promise(Y=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?Nc:zu).scaleBy(Pm(f,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>Y(!0)),$)}):Promise.resolve(!1)}function M($){d==null||d.scaleExtent($)}function A($){d==null||d.translateExtent($)}function V($){const z=!Ls($)||$<0?0:$;d==null||d.clickDistance(z)}return{update:w,destroy:g,setViewport:p,setViewportConstrained:v,getViewport:N,scaleTo:C,scaleBy:S,setScaleExtent:M,setTranslateExtent:A,syncViewport:j,setClickDistance:V}}var ol;(function(e){e.Line="line",e.Handle="handle"})(ol||(ol={}));function b_({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const o=e-t,l=n-s,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function sy(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function lr(e,t){return Math.max(0,t-e)}function cr(e,t){return Math.max(0,e-t)}function ru(e,t,n){return Math.max(0,t-e,e-n)}function ay(e,t){return e?!t:t}function v_(e,t,n,s,r,i,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:x,ySnapped:y}=n,{minWidth:b,maxWidth:w,minHeight:g,maxHeight:v}=s,{x:p,y:j,width:N,height:C,aspectRatio:S}=e;let M=Math.floor(h?x-e.pointerX:0),A=Math.floor(d?y-e.pointerY:0);const V=N+(c?-M:M),$=C+(u?-A:A),z=-i[0]*N,Y=-i[1]*C;let E=ru(V,b,w),R=ru($,g,v);if(o){let k=0,D=0;c&&M<0?k=lr(p+M+z,o[0][0]):!c&&M>0&&(k=cr(p+V+z,o[1][0])),u&&A<0?D=lr(j+A+Y,o[0][1]):!u&&A>0&&(D=cr(j+$+Y,o[1][1])),E=Math.max(E,k),R=Math.max(R,D)}if(l){let k=0,D=0;c&&M>0?k=cr(p+M,l[0][0]):!c&&M<0&&(k=lr(p+V,l[1][0])),u&&A>0?D=cr(j+A,l[0][1]):!u&&A<0&&(D=lr(j+$,l[1][1])),E=Math.max(E,k),R=Math.max(R,D)}if(r){if(h){const k=ru(V/S,g,v)*S;if(E=Math.max(E,k),o){let D=0;!c&&!u||c&&!u&&f?D=cr(j+Y+V/S,o[1][1])*S:D=lr(j+Y+(c?M:-M)/S,o[0][1])*S,E=Math.max(E,D)}if(l){let D=0;!c&&!u||c&&!u&&f?D=lr(j+V/S,l[1][1])*S:D=cr(j+(c?M:-M)/S,l[0][1])*S,E=Math.max(E,D)}}if(d){const k=ru($*S,b,w)/S;if(R=Math.max(R,k),o){let D=0;!c&&!u||u&&!c&&f?D=cr(p+$*S+z,o[1][0])/S:D=lr(p+(u?A:-A)*S+z,o[0][0])/S,R=Math.max(R,D)}if(l){let D=0;!c&&!u||u&&!c&&f?D=lr(p+$*S,l[1][0])/S:D=cr(p+(u?A:-A)*S,l[0][0])/S,R=Math.max(R,D)}}}A=A+(A<0?R:-R),M=M+(M<0?E:-E),r&&(f?V>$*S?A=(ay(c,u)?-M:M)/S:M=(ay(c,u)?-A:A)*S:h?(A=M/S,u=c):(M=A*S,c=u));const T=c?p+M:p,_=u?j+A:j;return{width:N+(c?-M:M),height:C+(u?-A:A),x:i[0]*M*(c?-1:1)+T,y:i[1]*A*(u?-1:1)+_}}const s4={width:0,height:0,x:0,y:0},y_={...s4,pointerX:0,pointerY:0,aspectRatio:1};function w_(e){return[[0,0],[e.measured.width,e.measured.height]]}function j_(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,o=e.measured.height??0,l=n[0]*i,c=n[1]*o;return[[s-l,r-c],[s+i-l,r+o-c]]}function N_({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=ts(e);let o={controlDirection:sy("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:y,onResizeEnd:b,shouldResize:w}){let g={...s4},v={...y_};o={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:sy(u)};let p,j=null,N=[],C,S,M,A=!1;const V=hN().on("start",$=>{const{nodeLookup:z,transform:Y,snapGrid:E,snapToGrid:R,nodeOrigin:T,paneDomNode:_}=n();if(p=z.get(t),!p)return;j=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:k,ySnapped:D}=Sc($.sourceEvent,{transform:Y,snapGrid:E,snapToGrid:R,containerBounds:j});g={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},v={...g,pointerX:k,pointerY:D,aspectRatio:g.width/g.height},C=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(C=z.get(p.parentId),S=C&&p.extent==="parent"?w_(C):void 0),N=[],M=void 0;for(const[L,q]of z)if(q.parentId===t&&(N.push({id:L,position:{...q.position},extent:q.extent}),q.extent==="parent"||q.expandParent)){const O=j_(q,p,q.origin??T);M?M=[[Math.min(O[0][0],M[0][0]),Math.min(O[0][1],M[0][1])],[Math.max(O[1][0],M[1][0]),Math.max(O[1][1],M[1][1])]]:M=O}x==null||x($,{...g})}).on("drag",$=>{const{transform:z,snapGrid:Y,snapToGrid:E,nodeOrigin:R}=n(),T=Sc($.sourceEvent,{transform:z,snapGrid:Y,snapToGrid:E,containerBounds:j}),_=[];if(!p)return;const{x:k,y:D,width:L,height:q}=g,O={},B=p.origin??R,{width:X,height:Z,x:ne,y:ee}=v_(v,o.controlDirection,T,o.boundaries,o.keepAspectRatio,B,S,M),J=X!==L,se=Z!==q,pe=ne!==k&&J,re=ee!==D&&se;if(!pe&&!re&&!J&&!se)return;if((pe||re||B[0]===1||B[1]===1)&&(O.x=pe?ne:g.x,O.y=re?ee:g.y,g.x=O.x,g.y=O.y,N.length>0)){const Oe=ne-k,Re=ee-D;for(const Be of N)Be.position={x:Be.position.x-Oe+B[0]*(X-L),y:Be.position.y-Re+B[1]*(Z-q)},_.push(Be)}if((J||se)&&(O.width=J&&(!o.resizeDirection||o.resizeDirection==="horizontal")?X:g.width,O.height=se&&(!o.resizeDirection||o.resizeDirection==="vertical")?Z:g.height,g.width=O.width,g.height=O.height),C&&p.expandParent){const Oe=B[0]*(O.width??0);O.x&&O.x<Oe&&(g.x=Oe,v.x=v.x-(O.x-Oe));const Re=B[1]*(O.height??0);O.y&&O.y<Re&&(g.y=Re,v.y=v.y-(O.y-Re))}const he=b_({width:g.width,prevWidth:L,height:g.height,prevHeight:q,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),fe={...g,direction:he};(w==null?void 0:w($,fe))!==!1&&(A=!0,y==null||y($,fe),s(O,_))}).on("end",$=>{A&&(b==null||b($,{...g}),r==null||r({...g}),A=!1)});i.call(V)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var a4={exports:{}},r4={},i4={exports:{}},o4={};/**
77
- * @license React
78
- * use-sync-external-store-shim.production.js
79
- *
80
- * Copyright (c) Meta Platforms, Inc. and affiliates.
81
- *
82
- * This source code is licensed under the MIT license found in the
83
- * LICENSE file in the root directory of this source tree.
84
- */var ll=m;function S_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var C_=typeof Object.is=="function"?Object.is:S_,k_=ll.useState,E_=ll.useEffect,M_=ll.useLayoutEffect,T_=ll.useDebugValue;function D_(e,t){var n=t(),s=k_({inst:{value:n,getSnapshot:t}}),r=s[0].inst,i=s[1];return M_(function(){r.value=n,r.getSnapshot=t,Hm(r)&&i({inst:r})},[e,n,t]),E_(function(){return Hm(r)&&i({inst:r}),e(function(){Hm(r)&&i({inst:r})})},[e]),T_(n),n}function Hm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!C_(e,n)}catch{return!0}}function __(e,t){return t()}var A_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?__:D_;o4.useSyncExternalStore=ll.useSyncExternalStore!==void 0?ll.useSyncExternalStore:A_;i4.exports=o4;var O_=i4.exports;/**
85
- * @license React
86
- * use-sync-external-store-shim/with-selector.production.js
87
- *
88
- * Copyright (c) Meta Platforms, Inc. and affiliates.
89
- *
90
- * This source code is licensed under the MIT license found in the
91
- * LICENSE file in the root directory of this source tree.
92
- */var Cf=m,z_=O_;function R_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var U_=typeof Object.is=="function"?Object.is:R_,$_=z_.useSyncExternalStore,L_=Cf.useRef,P_=Cf.useEffect,H_=Cf.useMemo,B_=Cf.useDebugValue;r4.useSyncExternalStoreWithSelector=function(e,t,n,s,r){var i=L_(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=H_(function(){function c(x){if(!u){if(u=!0,h=x,x=s(x),r!==void 0&&o.hasValue){var y=o.value;if(r(y,x))return d=y}return d=x}if(y=d,U_(h,x))return y;var b=s(x);return r!==void 0&&r(y,b)?(h=x,y):(h=x,d=b)}var u=!1,h,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,s,r]);var l=$_(e,i[0],i[1]);return P_(function(){o.hasValue=!0,o.value=l},[l]),B_(l),l};a4.exports=r4;var V_=a4.exports;const Y_=Gh(V_),I_={},ry=e=>{let t;const n=new Set,s=(h,d)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,x))}},r=()=>t,c={setState:s,getState:r,getInitialState:()=>u,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(I_?"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."),n.clear()}},u=t=e(s,r,c);return c},F_=e=>e?ry(e):ry,{useDebugValue:W_}=K,{useSyncExternalStoreWithSelector:q_}=Y_,G_=e=>e;function l4(e,t=G_,n){const s=q_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return W_(s),s}const iy=(e,t)=>{const n=F_(e),s=(r,i=t)=>l4(n,r,i);return Object.assign(s,n),s},X_=(e,t)=>e?iy(e,t):iy;function Pt(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[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const kf=m.createContext(null),Z_=kf.Provider,c4=xa.error001();function it(e,t){const n=m.useContext(kf);if(n===null)throw new Error(c4);return l4(n,e,t)}function Ut(){const e=m.useContext(kf);if(e===null)throw new Error(c4);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const oy={display:"none"},Q_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},d4="react-flow__node-desc",u4="react-flow__edge-desc",K_="react-flow__aria-live",J_=e=>e.ariaLiveMessage,eA=e=>e.ariaLabelConfig;function tA({rfId:e}){const t=it(J_);return a.jsx("div",{id:`${K_}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Q_,children:t})}function nA({rfId:e,disableKeyboardA11y:t}){const n=it(eA);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${d4}-${e}`,style:oy,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${u4}-${e}`,style:oy,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(tA,{rfId:e})]})}const Ef=m.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const o=`${e}`.split("-");return a.jsx("div",{className:Jt(["react-flow__panel",n,...o]),style:s,ref:i,...r,children:t})});Ef.displayName="Panel";function sA({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(Ef,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const aA=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},iu=e=>e.id;function rA(e,t){return Pt(e.selectedNodes.map(iu),t.selectedNodes.map(iu))&&Pt(e.selectedEdges.map(iu),t.selectedEdges.map(iu))}function iA({onSelectionChange:e}){const t=Ut(),{selectedNodes:n,selectedEdges:s}=it(aA,rA);return m.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const oA=e=>!!e.onSelectionChangeHandlers;function lA({onSelectionChange:e}){const t=it(oA);return e||t?a.jsx(iA,{onSelectionChange:e}):null}const h4=[0,0],cA={x:0,y:0,zoom:1},dA=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig"],ly=[...dA,"rfId"],uA=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),cy={translateExtent:Gc,nodeOrigin:h4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function hA(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=it(uA,Pt),u=Ut();m.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=cy,l()}),[]);const h=m.useRef(cy);return m.useEffect(()=>{for(const d of ly){const f=e[d],x=h.current[d];f!==x&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?s(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?o(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:UD(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}h.current=e},ly.map(d=>e[d])),null}function dy(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fA(e){var s;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const r=dy(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[e]),t!==null?t:(s=dy())!=null&&s.matches?"dark":"light"}const uy=typeof document<"u"?document:null;function Jc(e=null,t={target:uy,actInsideInputWithModifier:!0}){const[n,s]=m.useState(!1),r=m.useRef(!1),i=m.useRef(new Set([])),[o,l]=m.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
93
- `).replace(`
94
-
95
- `,`
96
- +`).split(`
97
- `)),h=u.reduce((d,f)=>d.concat(...f),[]);return[u,h]}return[[],[]]},[e]);return m.useEffect(()=>{const c=(t==null?void 0:t.target)??uy,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var w,g;if(r.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!r.current||r.current&&!u)&&HN(x))return!1;const b=fy(x.code,l);if(i.current.add(x[b]),hy(o,i.current,!1)){const v=((g=(w=x.composedPath)==null?void 0:w.call(x))==null?void 0:g[0])||x.target,p=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(r.current||!p)&&x.preventDefault(),s(!0)}},d=x=>{const y=fy(x.code,l);hy(o,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(x[y]),x.key==="Meta"&&i.current.clear(),r.current=!1},f=()=>{i.current.clear(),s(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,s]),n}function hy(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function fy(e,t){return t.includes(e)?"code":"key"}const mA=()=>{const e=Ut();return m.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:o,panZoom:l}=e.getState(),c=op(t,s,r,i,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},h=n.snapGrid??r,d=n.snapToGrid??i;return Ed(u,s,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),o=Dh(t,n);return{x:o.x+r,y:o.y+i}}}),[])};function f4(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const o=s.get(i.id);o?o.push(i):s.set(i.id,[i])}for(const i of t){const o=s.get(i.id);if(!o){n.push(i);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...i};for(const c of o)xA(c,l);n.push(l)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function xA(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function m4(e,t){return f4(e,t)}function x4(e,t){return f4(e,t)}function ui(e,t){return{id:e,type:"select",selected:t}}function Eo(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const o=t.has(r);!(i.selected===void 0&&!o)&&i.selected!==o&&(n&&(i.selected=o),s.push(ui(i.id,o)))}return s}function my({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function xy(e){return{id:e.id,type:"remove"}}const gy=e=>kD(e),gA=e=>AN(e);function g4(e){return m.forwardRef(e)}const pA=typeof window<"u"?m.useLayoutEffect:m.useEffect;function py(e){const[t,n]=m.useState(BigInt(0)),[s]=m.useState(()=>bA(()=>n(r=>r+BigInt(1))));return pA(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function bA(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const p4=m.createContext(null);function vA({children:e}){const t=Ut(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:x}=t.getState();let y=c;for(const w of l)y=typeof w=="function"?w(y):w;const b=my({items:y,lookup:f});h&&u(y),b.length>0?d==null||d(b):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:g,setNodes:v}=t.getState();w&&v(g)})},[]),s=py(n),r=m.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let x=c;for(const y of l)x=typeof y=="function"?y(x):y;h?u(x):d&&d(my({items:x,lookup:f}))},[]),i=py(r),o=m.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return a.jsx(p4.Provider,{value:o,children:e})}function yA(){const e=m.useContext(p4);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const wA=e=>!!e.panZoom;function fp(){const e=mA(),t=Ut(),n=yA(),s=it(wA),r=m.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var g,v;const{nodeLookup:f,nodeOrigin:x}=t.getState(),y=gy(d)?d:f.get(d.id),b=y.parentId?LN(y.position,y.measured,y.parentId,f,x):y.position,w={...y,position:b,width:((g=y.measured)==null?void 0:g.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return rl(w)},u=(d,f,x={replace:!1})=>{o(y=>y.map(b=>{if(b.id===d){const w=typeof f=="function"?f(b):f;return x.replace&&gy(w)?w:{...b,...w}}return b}))},h=(d,f,x={replace:!1})=>{l(y=>y.map(b=>{if(b.id===d){const w=typeof f=="function"?f(b):f;return x.replace&&gA(w)?w:{...b,...w}}return b}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=i(d))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(x=>[...x,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(x=>[...x,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:x}=t.getState(),[y,b,w]=x;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:y,y:b,zoom:w}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:x,edges:y,onNodesDelete:b,onEdgesDelete:w,triggerNodeChanges:g,triggerEdgeChanges:v,onDelete:p,onBeforeDelete:j}=t.getState(),{nodes:N,edges:C}=await _D({nodesToRemove:d,edgesToRemove:f,nodes:x,edges:y,onBeforeDelete:j}),S=C.length>0,M=N.length>0;if(S){const A=C.map(xy);w==null||w(C),v(A)}if(M){const A=N.map(xy);b==null||b(N),g(A)}return(M||S)&&(p==null||p({nodes:N,edges:C})),{deletedNodes:N,deletedEdges:C}},getIntersectingNodes:(d,f=!0,x)=>{const y=Wv(d),b=y?d:c(d),w=x!==void 0;return b?(x||t.getState().nodes).filter(g=>{const v=t.getState().nodeLookup.get(g.id);if(v&&!y&&(g.id===d.id||!v.internals.positionAbsolute))return!1;const p=rl(w?g:v),j=Zc(p,b);return f&&j>0||j>=p.width*p.height||j>=b.width*b.height}):[]},isNodeIntersecting:(d,f,x=!0)=>{const b=Wv(d)?d:c(d);if(!b)return!1;const w=Zc(b,f);return x&&w>0||w>=f.width*f.height||w>=b.width*b.height},updateNode:u,updateNodeData:(d,f,x={replace:!1})=>{u(d,y=>{const b=typeof f=="function"?f(y):f;return x.replace?{...y,data:b}:{...y,data:{...y.data,...b}}},x)},updateEdge:h,updateEdgeData:(d,f,x={replace:!1})=>{h(d,y=>{const b=typeof f=="function"?f(y):f;return x.replace?{...y,data:b}:{...y,data:{...y.data,...b}}},x)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:x}=t.getState();return ED(d,{nodeLookup:f,nodeOrigin:x})},getHandleConnections:({type:d,id:f,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}-${d}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??RD();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(x=>[...x]),f.promise}}},[]);return m.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const by=e=>e.selected,jA=typeof window<"u"?window:void 0;function NA({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ut(),{deleteElements:s}=fp(),r=Jc(e,{actInsideInputWithModifier:!1}),i=Jc(t,{target:jA});m.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();s({nodes:l.filter(by),edges:o.filter(by)}),n.setState({nodesSelectionActive:!1})}},[r]),m.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function SA(e){const t=Ut();m.useEffect(()=>{const n=()=>{var r,i,o,l;if(!e.current||!(((i=(r=e.current).checkVisibility)==null?void 0:i.call(r))??!0))return!1;const s=lp(e.current);(s.height===0||s.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",xa.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Mf={position:"absolute",width:"100%",height:"100%",top:0,left:0},CA=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function kA({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=Ci.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:x=!0,children:y,noWheelClassName:b,noPanClassName:w,onViewportChange:g,isControlledViewport:v,paneClickDistance:p,selectionOnDrag:j}){const N=Ut(),C=m.useRef(null),{userSelectionActive:S,lib:M,connectionInProgress:A}=it(CA,Pt),V=Jc(f),$=m.useRef();SA(C);const z=m.useCallback(Y=>{g==null||g({x:Y[0],y:Y[1],zoom:Y[2]}),v||N.setState({transform:Y})},[g,v]);return m.useEffect(()=>{if(C.current){$.current=p_({domNode:C.current,minZoom:h,maxZoom:d,translateExtent:u,viewport:c,onDraggingChange:T=>N.setState({paneDragging:T}),onPanZoomStart:(T,_)=>{const{onViewportChangeStart:k,onMoveStart:D}=N.getState();D==null||D(T,_),k==null||k(_)},onPanZoom:(T,_)=>{const{onViewportChange:k,onMove:D}=N.getState();D==null||D(T,_),k==null||k(_)},onPanZoomEnd:(T,_)=>{const{onViewportChangeEnd:k,onMoveEnd:D}=N.getState();D==null||D(T,_),k==null||k(_)}});const{x:Y,y:E,zoom:R}=$.current.getViewport();return N.setState({panZoom:$.current,transform:[Y,E,R],domNode:C.current.closest(".react-flow")}),()=>{var T;(T=$.current)==null||T.destroy()}}},[]),m.useEffect(()=>{var Y;(Y=$.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:V,preventScrolling:x,noPanClassName:w,userSelectionActive:S,noWheelClassName:b,lib:M,onTransformChange:z,connectionInProgress:A,selectionOnDrag:j,paneClickDistance:p})},[e,t,n,s,r,i,o,l,V,x,w,S,b,M,z,A,j,p]),a.jsx("div",{className:"react-flow__renderer",ref:C,style:Mf,children:y})}const EA=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function MA(){const{userSelectionActive:e,userSelectionRect:t}=it(EA,Pt);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Bm=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},TA=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function DA({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xc.Full,panOnDrag:s,paneClickDistance:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:x,children:y}){const b=Ut(),{userSelectionActive:w,elementsSelectable:g,dragging:v,connectionInProgress:p}=it(TA,Pt),j=g&&(e||w),N=m.useRef(null),C=m.useRef(),S=m.useRef(new Set),M=m.useRef(new Set),A=m.useRef(!1),V=k=>{if(A.current||p){A.current=!1;return}c==null||c(k),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},$=k=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){k.preventDefault();return}u==null||u(k)},z=h?k=>h(k):void 0,Y=k=>{A.current&&(k.stopPropagation(),A.current=!1)},E=k=>{var Z,ne;const{domNode:D}=b.getState();if(C.current=D==null?void 0:D.getBoundingClientRect(),!C.current)return;const L=k.target===N.current;if(!L&&!!k.target.closest(".nokey")||!e||!(i&&L||t)||k.button!==0||!k.isPrimary)return;(ne=(Z=k.target)==null?void 0:Z.setPointerCapture)==null||ne.call(Z,k.pointerId),A.current=!1;const{x:B,y:X}=Ps(k.nativeEvent,C.current);b.setState({userSelectionRect:{width:0,height:0,startX:B,startY:X,x:B,y:X}}),L||(k.stopPropagation(),k.preventDefault())},R=k=>{const{userSelectionRect:D,transform:L,nodeLookup:q,edgeLookup:O,connectionLookup:B,triggerNodeChanges:X,triggerEdgeChanges:Z,defaultEdgeOptions:ne,resetSelectedElements:ee}=b.getState();if(!C.current||!D)return;const{x:J,y:se}=Ps(k.nativeEvent,C.current),{startX:pe,startY:re}=D;if(!A.current){const Re=t?0:r;if(Math.hypot(J-pe,se-re)<=Re)return;ee(),o==null||o(k)}A.current=!0;const he={startX:pe,startY:re,x:J<pe?J:pe,y:se<re?se:re,width:Math.abs(J-pe),height:Math.abs(se-re)},fe=S.current,ke=M.current;S.current=new Set(ip(q,he,L,n===Xc.Partial,!0).map(Re=>Re.id)),M.current=new Set;const Oe=(ne==null?void 0:ne.selectable)??!0;for(const Re of S.current){const Be=B.get(Re);if(Be)for(const{edgeId:dt}of Be.values()){const Ie=O.get(dt);Ie&&(Ie.selectable??Oe)&&M.current.add(dt)}}if(!qv(fe,S.current)){const Re=Eo(q,S.current,!0);X(Re)}if(!qv(ke,M.current)){const Re=Eo(O,M.current);Z(Re)}b.setState({userSelectionRect:he,userSelectionActive:!0,nodesSelectionActive:!1})},T=k=>{var D,L;k.button===0&&((L=(D=k.target)==null?void 0:D.releasePointerCapture)==null||L.call(D,k.pointerId),!w&&k.target===N.current&&b.getState().userSelectionRect&&(V==null||V(k)),b.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(l==null||l(k),b.setState({nodesSelectionActive:S.current.size>0})))},_=s===!0||Array.isArray(s)&&s.includes(0);return a.jsxs("div",{className:Jt(["react-flow__pane",{draggable:_,dragging:v,selection:e}]),onClick:j?void 0:Bm(V,N),onContextMenu:Bm($,N),onWheel:Bm(z,N),onPointerEnter:j?void 0:d,onPointerMove:j?R:f,onPointerUp:j?T:void 0,onPointerDownCapture:j?E:void 0,onClickCapture:j?Y:void 0,onPointerLeave:x,ref:N,style:Mf,children:[y,a.jsx(MA,{})]})}function M0({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",xa.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var h;return(h=s==null?void 0:s.current)==null?void 0:h.blur()})):r([e])}function b4({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:o}){const l=Ut(),[c,u]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=s_({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{M0({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),m.useEffect(()=>{var d,f;if(t)(d=h.current)==null||d.destroy();else if(e.current)return(f=h.current)==null||f.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:o}),()=>{var x;(x=h.current)==null||x.destroy()}},[n,s,t,i,e,r]),c}const _A=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function v4(){const e=Ut();return m.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:h}=e.getState(),d=new Map,f=_A(o),x=r?i[0]:5,y=r?i[1]:5,b=n.direction.x*x*n.factor,w=n.direction.y*y*n.factor;for(const[,g]of u){if(!f(g))continue;let v={x:g.internals.positionAbsolute.x+b,y:g.internals.positionAbsolute.y+w};r&&(v=kd(v,i));const{position:p,positionAbsolute:j}=ON({nodeId:g.id,nextPosition:v,nodeLookup:u,nodeExtent:s,nodeOrigin:h,onError:l});g.position=p,g.internals.positionAbsolute=j,d.set(g.id,g)}c(d)},[])}const mp=m.createContext(null),AA=mp.Provider;mp.Consumer;const y4=()=>m.useContext(mp),OA=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),zA=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:o}=s,{fromHandle:l,toHandle:c,isValid:u}=o,h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===sl.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:h&&u}};function RA({type:e="source",position:t=$e.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:h,onTouchStart:d,...f},x){var R,T;const y=o||null,b=e==="target",w=Ut(),g=y4(),{connectOnClick:v,noPanClassName:p,rfId:j}=it(OA,Pt),{connectingFrom:N,connectingTo:C,clickConnecting:S,isPossibleEndHandle:M,connectionInProcess:A,clickConnectionInProcess:V,valid:$}=it(zA(g,y,e),Pt);g||(T=(R=w.getState()).onError)==null||T.call(R,"010",xa.error010());const z=_=>{const{defaultEdgeOptions:k,onConnect:D,hasDefaultEdges:L}=w.getState(),q={...k,..._};if(L){const{edges:O,setEdges:B}=w.getState();B(FN(q,O))}D==null||D(q),l==null||l(q)},Y=_=>{if(!g)return;const k=BN(_.nativeEvent);if(r&&(k&&_.button===0||!k)){const D=w.getState();E0.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:b,handleId:y,nodeId:g,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:D.onConnectEnd,updateConnection:D.updateConnection,onConnect:z,isValidConnection:n||D.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}k?h==null||h(_):d==null||d(_)},E=_=>{const{onClickConnectStart:k,onClickConnectEnd:D,connectionClickStartHandle:L,connectionMode:q,isValidConnection:O,lib:B,rfId:X,nodeLookup:Z,connection:ne}=w.getState();if(!g||!L&&!r)return;if(!L){k==null||k(_.nativeEvent,{nodeId:g,handleId:y,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:g,type:e,id:y}});return}const ee=PN(_.target),J=n||O,{connection:se,isValid:pe}=E0.isValid(_.nativeEvent,{handle:{nodeId:g,id:y,type:e},connectionMode:q,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:J,flowId:X,doc:ee,lib:B,nodeLookup:Z});pe&&se&&z(se);const re=structuredClone(ne);delete re.inProgress,re.toPosition=re.toHandle?re.toHandle.position:null,D==null||D(_,re),w.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":y,"data-nodeid":g,"data-handlepos":t,"data-id":`${j}-${g}-${y}-${e}`,className:Jt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,u,{source:!b,target:b,connectable:s,connectablestart:r,connectableend:i,clickconnecting:S,connectingfrom:N,connectingto:C,valid:$,connectionindicator:s&&(!A||M)&&(A||V?i:r)}]),onMouseDown:Y,onTouchStart:Y,onClick:v?E:void 0,ref:x,...f,children:c})}const ki=m.memo(g4(RA));function UA({data:e,isConnectable:t,sourcePosition:n=$e.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(ki,{type:"source",position:n,isConnectable:t})]})}function $A({data:e,isConnectable:t,targetPosition:n=$e.Top,sourcePosition:s=$e.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(ki,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(ki,{type:"source",position:s,isConnectable:t})]})}function LA(){return null}function PA({data:e,isConnectable:t,targetPosition:n=$e.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(ki,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const _h={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vy={input:UA,default:$A,output:PA,group:LA};function HA(e){var t,n,s,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const BA=e=>{const{width:t,height:n,x:s,y:r}=Cd(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ls(t)?t:null,height:Ls(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function VA({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=Ut(),{width:r,height:i,transformString:o,userSelectionActive:l}=it(BA,Pt),c=v4(),u=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),b4({nodeRef:u}),l||!r||!i)return null;const h=e?f=>{const x=s.getState().nodes.filter(y=>y.selected);e(f,x)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(_h,f.key)&&(f.preventDefault(),c({direction:_h[f.key],factor:f.shiftKey?4:1}))};return a.jsx("div",{className:Jt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:r,height:i}})})}const yy=typeof window<"u"?window:void 0,YA=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function w4({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:y,panActivationKeyCode:b,zoomActivationKeyCode:w,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:p,panOnScroll:j,panOnScrollSpeed:N,panOnScrollMode:C,zoomOnDoubleClick:S,panOnDrag:M,defaultViewport:A,translateExtent:V,minZoom:$,maxZoom:z,preventScrolling:Y,onSelectionContextMenu:E,noWheelClassName:R,noPanClassName:T,disableKeyboardA11y:_,onViewportChange:k,isControlledViewport:D}){const{nodesSelectionActive:L,userSelectionActive:q}=it(YA),O=Jc(u,{target:yy}),B=Jc(b,{target:yy}),X=B||M,Z=B||j,ne=h&&X!==!0,ee=O||q||ne;return NA({deleteKeyCode:c,multiSelectionKeyCode:y}),a.jsx(kA,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:p,panOnScroll:Z,panOnScrollSpeed:N,panOnScrollMode:C,zoomOnDoubleClick:S,panOnDrag:!O&&X,defaultViewport:A,translateExtent:V,minZoom:$,maxZoom:z,zoomActivationKeyCode:w,preventScrolling:Y,noWheelClassName:R,noPanClassName:T,onViewportChange:k,isControlledViewport:D,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(DA,{onSelectionStart:f,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:X,isSelecting:!!ee,selectionMode:d,selectionKeyPressed:O,paneClickDistance:l,selectionOnDrag:ne,children:[e,L&&a.jsx(VA,{onSelectionContextMenu:E,noPanClassName:T,disableKeyboardA11y:_})]})})}w4.displayName="FlowRenderer";const IA=m.memo(w4),FA=e=>t=>e?ip(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function WA(e){return it(m.useCallback(FA(e),[e]),Pt)}const qA=e=>e.updateNodeInternals;function GA(){const e=it(qA),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function XA({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=Ut(),i=m.useRef(null),o=m.useRef(null),l=m.useRef(e.sourcePosition),c=m.useRef(e.targetPosition),u=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{i.current&&!e.hidden&&(!h||o.current!==i.current)&&(o.current&&(s==null||s.unobserve(o.current)),s==null||s.observe(i.current),o.current=i.current)},[h,e.hidden]),m.useEffect(()=>()=>{o.current&&(s==null||s.unobserve(o.current),o.current=null)},[]),m.useEffect(()=>{if(i.current){const d=u.current!==t,f=l.current!==e.sourcePosition,x=c.current!==e.targetPosition;(d||f||x)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function ZA({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:x,disableKeyboardA11y:y,rfId:b,nodeTypes:w,nodeClickDistance:g,onError:v}){const{node:p,internals:j,isParent:N}=it(J=>{const se=J.nodeLookup.get(e),pe=J.parentLookup.has(e);return{node:se,internals:se.internals,isParent:pe}},Pt);let C=p.type||"default",S=(w==null?void 0:w[C])||vy[C];S===void 0&&(v==null||v("003",xa.error003(C)),C="default",S=(w==null?void 0:w.default)||vy.default);const M=!!(p.draggable||l&&typeof p.draggable>"u"),A=!!(p.selectable||c&&typeof p.selectable>"u"),V=!!(p.connectable||u&&typeof p.connectable>"u"),$=!!(p.focusable||h&&typeof p.focusable>"u"),z=Ut(),Y=$N(p),E=XA({node:p,nodeType:C,hasDimensions:Y,resizeObserver:d}),R=b4({nodeRef:E,disabled:p.hidden||!M,noDragClassName:f,handleSelector:p.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:g}),T=v4();if(p.hidden)return null;const _=tr(p),k=HA(p),D=A||M||t||n||s||r,L=n?J=>n(J,{...j.userNode}):void 0,q=s?J=>s(J,{...j.userNode}):void 0,O=r?J=>r(J,{...j.userNode}):void 0,B=i?J=>i(J,{...j.userNode}):void 0,X=o?J=>o(J,{...j.userNode}):void 0,Z=J=>{const{selectNodesOnDrag:se,nodeDragThreshold:pe}=z.getState();A&&(!se||!M||pe>0)&&M0({id:e,store:z,nodeRef:E}),t&&t(J,{...j.userNode})},ne=J=>{if(!(HN(J.nativeEvent)||y)){if(MN.includes(J.key)&&A){const se=J.key==="Escape";M0({id:e,store:z,unselect:se,nodeRef:E})}else if(M&&p.selected&&Object.prototype.hasOwnProperty.call(_h,J.key)){J.preventDefault();const{ariaLabelConfig:se}=z.getState();z.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),T({direction:_h[J.key],factor:J.shiftKey?4:1})}}},ee=()=>{var ke;if(y||!((ke=E.current)!=null&&ke.matches(":focus-visible")))return;const{transform:J,width:se,height:pe,autoPanOnNodeFocus:re,setCenter:he}=z.getState();if(!re)return;ip(new Map([[e,p]]),{x:0,y:0,width:se,height:pe},J,!0).length>0||he(p.position.x+_.width/2,p.position.y+_.height/2,{zoom:J[2]})};return a.jsx("div",{className:Jt(["react-flow__node",`react-flow__node-${C}`,{[x]:M},p.className,{selected:p.selected,selectable:A,parent:N,draggable:M,dragging:R}]),ref:E,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:Y?"visible":"hidden",...p.style,...k},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:q,onMouseLeave:O,onContextMenu:B,onClick:Z,onDoubleClick:X,onKeyDown:$?ne:void 0,tabIndex:$?0:void 0,onFocus:$?ee:void 0,role:p.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${d4}-${b}`,"aria-label":p.ariaLabel,...p.domAttributes,children:a.jsx(AA,{value:e,children:a.jsx(S,{id:e,data:p.data,type:C,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:p.selected??!1,selectable:A,draggable:M,deletable:p.deletable??!0,isConnectable:V,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:R,dragHandle:p.dragHandle,zIndex:j.z,parentId:p.parentId,..._})})})}var QA=m.memo(ZA);const KA=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function j4(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=it(KA,Pt),o=WA(e.onlyRenderVisibleElements),l=GA();return a.jsx("div",{className:"react-flow__nodes",style:Mf,children:o.map(c=>a.jsx(QA,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}j4.displayName="NodeRenderer";const JA=m.memo(j4);function e9(e){return it(m.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);i&&o&&PD({sourceNode:i,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),Pt)}const t9=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},n9=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},wy={[Mh.Arrow]:t9,[Mh.ArrowClosed]:n9};function s9(e){const t=Ut();return m.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(wy,e)?wy[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",xa.error009(e)),null)},[e])}const a9=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=s9(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},N4=({defaultColor:e,rfId:t})=>{const n=it(i=>i.edges),s=it(i=>i.defaultEdgeOptions),r=m.useMemo(()=>WD(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(i=>a.jsx(a9,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};N4.displayName="MarkerDefinitions";var r9=m.memo(N4);function S4({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...h}){const[d,f]=m.useState({x:1,y:0,width:0,height:0}),x=Jt(["react-flow__edge-textwrapper",u]),y=m.useRef(null);return m.useEffect(()=>{if(y.current){const b=y.current.getBBox();f({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:x,visibility:d.width?"visible":"hidden",...h,children:[r&&a.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:s,children:n}),c]}):null}S4.displayName="EdgeText";const i9=m.memo(S4);function Tf({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...h}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...h,d:e,fill:"none",className:Jt(["react-flow__edge-path",h.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,s&&Ls(t)&&Ls(n)?a.jsx(i9,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function jy({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===$e.Left||e===$e.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function C4({sourceX:e,sourceY:t,sourcePosition:n=$e.Bottom,targetX:s,targetY:r,targetPosition:i=$e.Top}){const[o,l]=jy({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,u]=jy({pos:i,x1:s,y1:r,x2:e,y2:t}),[h,d,f,x]=VN({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${s},${r}`,h,d,f,x]}function k4(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:b,markerStart:w,interactionWidth:g})=>{const[v,p,j]=C4({sourceX:n,sourceY:s,sourcePosition:o,targetX:r,targetY:i,targetPosition:l}),N=e.isInternal?void 0:t;return a.jsx(Tf,{id:N,path:v,labelX:p,labelY:j,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:b,markerStart:w,interactionWidth:g})})}const o9=k4({isInternal:!1}),E4=k4({isInternal:!0});o9.displayName="SimpleBezierEdge";E4.displayName="SimpleBezierEdgeInternal";function M4(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:x=$e.Bottom,targetPosition:y=$e.Top,markerEnd:b,markerStart:w,pathOptions:g,interactionWidth:v})=>{const[p,j,N]=S0({sourceX:n,sourceY:s,sourcePosition:x,targetX:r,targetY:i,targetPosition:y,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),C=e.isInternal?void 0:t;return a.jsx(Tf,{id:C,path:p,labelX:j,labelY:N,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:b,markerStart:w,interactionWidth:v})})}const T4=M4({isInternal:!1}),D4=M4({isInternal:!0});T4.displayName="SmoothStepEdge";D4.displayName="SmoothStepEdgeInternal";function _4(e){return m.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return a.jsx(T4,{...n,id:s,pathOptions:m.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const l9=_4({isInternal:!1}),A4=_4({isInternal:!0});l9.displayName="StepEdge";A4.displayName="StepEdgeInternal";function O4(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:b})=>{const[w,g,v]=WN({sourceX:n,sourceY:s,targetX:r,targetY:i}),p=e.isInternal?void 0:t;return a.jsx(Tf,{id:p,path:w,labelX:g,labelY:v,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:b})})}const c9=O4({isInternal:!1}),z4=O4({isInternal:!0});c9.displayName="StraightEdge";z4.displayName="StraightEdgeInternal";function R4(e){return m.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:o=$e.Bottom,targetPosition:l=$e.Top,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:b,markerStart:w,pathOptions:g,interactionWidth:v})=>{const[p,j,N]=YN({sourceX:n,sourceY:s,sourcePosition:o,targetX:r,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),C=e.isInternal?void 0:t;return a.jsx(Tf,{id:C,path:p,labelX:j,labelY:N,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:b,markerStart:w,interactionWidth:v})})}const d9=R4({isInternal:!1}),U4=R4({isInternal:!0});d9.displayName="BezierEdge";U4.displayName="BezierEdgeInternal";const Ny={default:U4,straight:z4,step:A4,smoothstep:D4,simplebezier:E4},Sy={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},u9=(e,t,n)=>n===$e.Left?e-t:n===$e.Right?e+t:e,h9=(e,t,n)=>n===$e.Top?e-t:n===$e.Bottom?e+t:e,Cy="react-flow__edgeupdater";function ky({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:o,className:Jt([Cy,`${Cy}-${l}`]),cx:u9(t,s,e),cy:h9(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function f9({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:x}){const y=Ut(),b=(j,N)=>{if(j.button!==0)return;const{autoPanOnConnect:C,domNode:S,isValidConnection:M,connectionMode:A,connectionRadius:V,lib:$,onConnectStart:z,onConnectEnd:Y,cancelConnection:E,nodeLookup:R,rfId:T,panBy:_,updateConnection:k}=y.getState(),D=N.type==="target",L=(B,X)=>{f(!1),d==null||d(B,n,N.type,X)},q=B=>u==null?void 0:u(n,B),O=(B,X)=>{f(!0),h==null||h(j,n,N.type),z==null||z(B,X)};E0.onPointerDown(j.nativeEvent,{autoPanOnConnect:C,connectionMode:A,connectionRadius:V,domNode:S,handleId:N.id,nodeId:N.nodeId,nodeLookup:R,isTarget:D,edgeUpdaterType:N.type,lib:$,flowId:T,cancelConnection:E,panBy:_,isValidConnection:M,onConnect:q,onConnectStart:O,onConnectEnd:Y,onReconnectEnd:L,updateConnection:k,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},w=j=>b(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=j=>b(j,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>x(!0),p=()=>x(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(ky,{position:l,centerX:s,centerY:r,radius:t,onMouseDown:w,onMouseEnter:v,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&a.jsx(ky,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:p,type:"target"})]})}function m9({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,rfId:y,edgeTypes:b,noPanClassName:w,onError:g,disableKeyboardA11y:v}){let p=it(he=>he.edgeLookup.get(e));const j=it(he=>he.defaultEdgeOptions);p=j?{...j,...p}:p;let N=p.type||"default",C=(b==null?void 0:b[N])||Ny[N];C===void 0&&(g==null||g("011",xa.error011(N)),N="default",C=(b==null?void 0:b.default)||Ny.default);const S=!!(p.focusable||t&&typeof p.focusable>"u"),M=typeof d<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),A=!!(p.selectable||s&&typeof p.selectable>"u"),V=m.useRef(null),[$,z]=m.useState(!1),[Y,E]=m.useState(!1),R=Ut(),{zIndex:T,sourceX:_,sourceY:k,targetX:D,targetY:L,sourcePosition:q,targetPosition:O}=it(m.useCallback(he=>{const fe=he.nodeLookup.get(p.source),ke=he.nodeLookup.get(p.target);if(!fe||!ke)return{zIndex:p.zIndex,...Sy};const Oe=FD({id:e,sourceNode:fe,targetNode:ke,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:he.connectionMode,onError:g});return{zIndex:LD({selected:p.selected,zIndex:p.zIndex,sourceNode:fe,targetNode:ke,elevateOnSelect:he.elevateEdgesOnSelect}),...Oe||Sy}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),Pt),B=m.useMemo(()=>p.markerStart?`url('#${C0(p.markerStart,y)}')`:void 0,[p.markerStart,y]),X=m.useMemo(()=>p.markerEnd?`url('#${C0(p.markerEnd,y)}')`:void 0,[p.markerEnd,y]);if(p.hidden||_===null||k===null||D===null||L===null)return null;const Z=he=>{var Re;const{addSelectedEdges:fe,unselectNodesAndEdges:ke,multiSelectionActive:Oe}=R.getState();A&&(R.setState({nodesSelectionActive:!1}),p.selected&&Oe?(ke({nodes:[],edges:[p]}),(Re=V.current)==null||Re.blur()):fe([e])),r&&r(he,p)},ne=i?he=>{i(he,{...p})}:void 0,ee=o?he=>{o(he,{...p})}:void 0,J=l?he=>{l(he,{...p})}:void 0,se=c?he=>{c(he,{...p})}:void 0,pe=u?he=>{u(he,{...p})}:void 0,re=he=>{var fe;if(!v&&MN.includes(he.key)&&A){const{unselectNodesAndEdges:ke,addSelectedEdges:Oe}=R.getState();he.key==="Escape"?((fe=V.current)==null||fe.blur(),ke({edges:[p]})):Oe([e])}};return a.jsx("svg",{style:{zIndex:T},children:a.jsxs("g",{className:Jt(["react-flow__edge",`react-flow__edge-${N}`,p.className,w,{selected:p.selected,animated:p.animated,inactive:!A&&!r,updating:$,selectable:A}]),onClick:Z,onDoubleClick:ne,onContextMenu:ee,onMouseEnter:J,onMouseMove:se,onMouseLeave:pe,onKeyDown:S?re:void 0,tabIndex:S?0:void 0,role:p.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":S?`${u4}-${y}`:void 0,ref:V,...p.domAttributes,children:[!Y&&a.jsx(C,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:A,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:_,sourceY:k,targetX:D,targetY:L,sourcePosition:q,targetPosition:O,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:B,markerEnd:X,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),M&&a.jsx(f9,{edge:p,isReconnectable:M,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,sourceX:_,sourceY:k,targetX:D,targetY:L,sourcePosition:q,targetPosition:O,setUpdateHover:z,setReconnecting:E})]})})}var x9=m.memo(m9);const g9=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $4({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,disableKeyboardA11y:b}){const{edgesFocusable:w,edgesReconnectable:g,elementsSelectable:v,onError:p}=it(g9,Pt),j=e9(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(r9,{defaultColor:e,rfId:n}),j.map(N=>a.jsx(x9,{id:N,edgesFocusable:w,edgesReconnectable:g,elementsSelectable:v,noPanClassName:r,onReconnect:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,rfId:n,onError:p,edgeTypes:s,disableKeyboardA11y:b},N))]})}$4.displayName="EdgeRenderer";const p9=m.memo($4),b9=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function v9({children:e}){const t=it(b9);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function y9(e){const t=fp(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const w9=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function j9(e){const t=it(w9),n=Ut();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function N9(e){return e.connection.inProgress?{...e.connection,to:Ed(e.connection.to,e.transform)}:{...e.connection}}function S9(e){return N9}function C9(e){const t=S9();return it(t,Pt)}const k9=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function E9({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:o,isValid:l,inProgress:c}=it(k9,Pt);return!(i&&r&&c)?null:a.jsx("svg",{style:e,width:i,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:Jt(["react-flow__connection",_N(l)]),children:a.jsx(L4,{style:t,type:n,CustomComponent:s,isValid:l})})})}const L4=({style:e,type:t=Sr.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:h,toHandle:d,toPosition:f,pointer:x}=C9();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:f,connectionStatus:_N(s),toNode:h,toHandle:d,pointer:x});let y="";const b={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Sr.Bezier:[y]=YN(b);break;case Sr.SimpleBezier:[y]=C4(b);break;case Sr.Step:[y]=S0({...b,borderRadius:0});break;case Sr.SmoothStep:[y]=S0(b);break;default:[y]=WN(b)}return a.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};L4.displayName="ConnectionLine";const M9={};function Ey(e=M9){m.useRef(e),Ut(),m.useEffect(()=>{},[e])}function T9(){Ut(),m.useRef(!1),m.useEffect(()=>{},[])}function P4({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:x,connectionLineType:y,connectionLineStyle:b,connectionLineComponent:w,connectionLineContainerStyle:g,selectionKeyCode:v,selectionOnDrag:p,selectionMode:j,multiSelectionKeyCode:N,panActivationKeyCode:C,zoomActivationKeyCode:S,deleteKeyCode:M,onlyRenderVisibleElements:A,elementsSelectable:V,defaultViewport:$,translateExtent:z,minZoom:Y,maxZoom:E,preventScrolling:R,defaultMarkerColor:T,zoomOnScroll:_,zoomOnPinch:k,panOnScroll:D,panOnScrollSpeed:L,panOnScrollMode:q,zoomOnDoubleClick:O,panOnDrag:B,onPaneClick:X,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:ee,onPaneScroll:J,onPaneContextMenu:se,paneClickDistance:pe,nodeClickDistance:re,onEdgeContextMenu:he,onEdgeMouseEnter:fe,onEdgeMouseMove:ke,onEdgeMouseLeave:Oe,reconnectRadius:Re,onReconnect:Be,onReconnectStart:dt,onReconnectEnd:Ie,noDragClassName:St,noWheelClassName:bt,noPanClassName:qe,disableKeyboardA11y:et,nodeExtent:Qe,rfId:vt,viewport:yt,onViewportChange:Ht}){return Ey(e),Ey(t),T9(),y9(n),j9(yt),a.jsx(IA,{onPaneClick:X,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:ee,onPaneContextMenu:se,onPaneScroll:J,paneClickDistance:pe,deleteKeyCode:M,selectionKeyCode:v,selectionOnDrag:p,selectionMode:j,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:N,panActivationKeyCode:C,zoomActivationKeyCode:S,elementsSelectable:V,zoomOnScroll:_,zoomOnPinch:k,zoomOnDoubleClick:O,panOnScroll:D,panOnScrollSpeed:L,panOnScrollMode:q,panOnDrag:B,defaultViewport:$,translateExtent:z,minZoom:Y,maxZoom:E,onSelectionContextMenu:d,preventScrolling:R,noDragClassName:St,noWheelClassName:bt,noPanClassName:qe,disableKeyboardA11y:et,onViewportChange:Ht,isControlledViewport:!!yt,children:a.jsxs(v9,{children:[a.jsx(p9,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:Be,onReconnectStart:dt,onReconnectEnd:Ie,onlyRenderVisibleElements:A,onEdgeContextMenu:he,onEdgeMouseEnter:fe,onEdgeMouseMove:ke,onEdgeMouseLeave:Oe,reconnectRadius:Re,defaultMarkerColor:T,noPanClassName:qe,disableKeyboardA11y:et,rfId:vt}),a.jsx(E9,{style:b,type:y,component:w,containerStyle:g}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(JA,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:h,nodeClickDistance:re,onlyRenderVisibleElements:A,noPanClassName:qe,noDragClassName:St,disableKeyboardA11y:et,nodeExtent:Qe,rfId:vt}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}P4.displayName="GraphView";const D9=m.memo(P4),My=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:h,nodeExtent:d}={})=>{const f=new Map,x=new Map,y=new Map,b=new Map,w=s??t??[],g=n??e??[],v=h??[0,0],p=d??Gc;XN(y,b,w);const j=k0(g,f,x,{nodeOrigin:v,nodeExtent:p,elevateNodesOnSelect:!1});let N=[0,0,1];if(o&&r&&i){const C=Cd(f,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:S,y:M,zoom:A}=op(C,r,i,c,u,(l==null?void 0:l.padding)??.1);N=[S,M,A]}return{rfId:"1",width:r??0,height:i??0,transform:N,nodes:g,nodesInitialized:j,nodeLookup:f,parentLookup:x,edges:w,edgeLookup:b,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Gc,nodeExtent:p,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:sl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...DN},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:AD,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:TN}},_9=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:d})=>X_((f,x)=>{async function y(){const{nodeLookup:b,panZoom:w,fitViewOptions:g,fitViewResolver:v,width:p,height:j,minZoom:N,maxZoom:C}=x();w&&(await DD({nodes:b,width:p,height:j,panZoom:w,minZoom:N,maxZoom:C},g),v==null||v.resolve(!0),f({fitViewResolver:null}))}return{...My({nodes:e,edges:t,width:r,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:s}),setNodes:b=>{const{nodeLookup:w,parentLookup:g,nodeOrigin:v,elevateNodesOnSelect:p,fitViewQueued:j}=x(),N=k0(b,w,g,{nodeOrigin:v,nodeExtent:d,elevateNodesOnSelect:p,checkEquality:!0});j&&N?(y(),f({nodes:b,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:b,nodesInitialized:N})},setEdges:b=>{const{connectionLookup:w,edgeLookup:g}=x();XN(w,g,b),f({edges:b})},setDefaultNodesAndEdges:(b,w)=>{if(b){const{setNodes:g}=x();g(b),f({hasDefaultNodes:!0})}if(w){const{setEdges:g}=x();g(w),f({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:w,nodeLookup:g,parentLookup:v,domNode:p,nodeOrigin:j,nodeExtent:N,debug:C,fitViewQueued:S}=x(),{changes:M,updatedInternals:A}=JD(b,g,v,p,j,N);A&&(XD(g,v,{nodeOrigin:j,nodeExtent:N}),S?(y(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(M==null?void 0:M.length)>0&&(C&&console.log("React Flow: trigger node changes",M),w==null||w(M)))},updateNodePositions:(b,w=!1)=>{const g=[],v=[],{nodeLookup:p,triggerNodeChanges:j}=x();for(const[N,C]of b){const S=p.get(N),M=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(C!=null&&C.position)),A={id:N,type:"position",position:M?{x:Math.max(0,C.position.x),y:Math.max(0,C.position.y)}:C.position,dragging:w};M&&S.parentId&&g.push({id:N,parentId:S.parentId,rect:{...C.internals.positionAbsolute,width:C.measured.width??0,height:C.measured.height??0}}),v.push(A)}if(g.length>0){const{parentLookup:N,nodeOrigin:C}=x(),S=hp(g,p,N,C);v.push(...S)}j(v)},triggerNodeChanges:b=>{const{onNodesChange:w,setNodes:g,nodes:v,hasDefaultNodes:p,debug:j}=x();if(b!=null&&b.length){if(p){const N=m4(b,v);g(N)}j&&console.log("React Flow: trigger node changes",b),w==null||w(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:w,setEdges:g,edges:v,hasDefaultEdges:p,debug:j}=x();if(b!=null&&b.length){if(p){const N=x4(b,v);g(N)}j&&console.log("React Flow: trigger edge changes",b),w==null||w(b)}},addSelectedNodes:b=>{const{multiSelectionActive:w,edgeLookup:g,nodeLookup:v,triggerNodeChanges:p,triggerEdgeChanges:j}=x();if(w){const N=b.map(C=>ui(C,!0));p(N);return}p(Eo(v,new Set([...b]),!0)),j(Eo(g))},addSelectedEdges:b=>{const{multiSelectionActive:w,edgeLookup:g,nodeLookup:v,triggerNodeChanges:p,triggerEdgeChanges:j}=x();if(w){const N=b.map(C=>ui(C,!0));j(N);return}j(Eo(g,new Set([...b]))),p(Eo(v,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:w}={})=>{const{edges:g,nodes:v,nodeLookup:p,triggerNodeChanges:j,triggerEdgeChanges:N}=x(),C=b||v,S=w||g,M=C.map(V=>{const $=p.get(V.id);return $&&($.selected=!1),ui(V.id,!1)}),A=S.map(V=>ui(V.id,!1));j(M),N(A)},setMinZoom:b=>{const{panZoom:w,maxZoom:g}=x();w==null||w.setScaleExtent([b,g]),f({minZoom:b})},setMaxZoom:b=>{const{panZoom:w,minZoom:g}=x();w==null||w.setScaleExtent([g,b]),f({maxZoom:b})},setTranslateExtent:b=>{var w;(w=x().panZoom)==null||w.setTranslateExtent(b),f({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:w,triggerNodeChanges:g,triggerEdgeChanges:v,elementsSelectable:p}=x();if(!p)return;const j=w.reduce((C,S)=>S.selected?[...C,ui(S.id,!1)]:C,[]),N=b.reduce((C,S)=>S.selected?[...C,ui(S.id,!1)]:C,[]);g(j),v(N)},setNodeExtent:b=>{const{nodes:w,nodeLookup:g,parentLookup:v,nodeOrigin:p,elevateNodesOnSelect:j,nodeExtent:N}=x();b[0][0]===N[0][0]&&b[0][1]===N[0][1]&&b[1][0]===N[1][0]&&b[1][1]===N[1][1]||(k0(w,g,v,{nodeOrigin:p,nodeExtent:b,elevateNodesOnSelect:j,checkEquality:!1}),f({nodeExtent:b}))},panBy:b=>{const{transform:w,width:g,height:v,panZoom:p,translateExtent:j}=x();return e_({delta:b,panZoom:p,transform:w,translateExtent:j,width:g,height:v})},setCenter:async(b,w,g)=>{const{width:v,height:p,maxZoom:j,panZoom:N}=x();if(!N)return Promise.resolve(!1);const C=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:j;return await N.setViewport({x:v/2-b*C,y:p/2-w*C,zoom:C},{duration:g==null?void 0:g.duration,ease:g==null?void 0:g.ease,interpolate:g==null?void 0:g.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...DN}})},updateConnection:b=>{f({connection:b})},reset:()=>f({...My()})}},Object.is);function A9({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:h,nodeExtent:d,children:f}){const[x]=m.useState(()=>_9({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:h,nodeExtent:d}));return a.jsx(Z_,{value:x,children:a.jsx(vA,{children:f})})}function O9({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:h,nodeOrigin:d,nodeExtent:f}){return m.useContext(kf)?a.jsx(a.Fragment,{children:e}):a.jsx(A9,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,children:e})}const z9={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function R9({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:x,onConnectStart:y,onConnectEnd:b,onClickConnectStart:w,onClickConnectEnd:g,onNodeMouseEnter:v,onNodeMouseMove:p,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:C,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:A,onNodesDelete:V,onEdgesDelete:$,onDelete:z,onSelectionChange:Y,onSelectionDragStart:E,onSelectionDrag:R,onSelectionDragStop:T,onSelectionContextMenu:_,onSelectionStart:k,onSelectionEnd:D,onBeforeDelete:L,connectionMode:q,connectionLineType:O=Sr.Bezier,connectionLineStyle:B,connectionLineComponent:X,connectionLineContainerStyle:Z,deleteKeyCode:ne="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:J=!1,selectionMode:se=Xc.Full,panActivationKeyCode:pe="Space",multiSelectionKeyCode:re=Qc()?"Meta":"Control",zoomActivationKeyCode:he=Qc()?"Meta":"Control",snapToGrid:fe,snapGrid:ke,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:Re,nodesDraggable:Be,autoPanOnNodeFocus:dt,nodesConnectable:Ie,nodesFocusable:St,nodeOrigin:bt=h4,edgesFocusable:qe,edgesReconnectable:et,elementsSelectable:Qe=!0,defaultViewport:vt=cA,minZoom:yt=.5,maxZoom:Ht=2,translateExtent:It=Gc,preventScrolling:te=!0,nodeExtent:be,defaultMarkerColor:He="#b1b1b7",zoomOnScroll:I=!0,zoomOnPinch:le=!0,panOnScroll:ue=!1,panOnScrollSpeed:xe=.5,panOnScrollMode:Te=Ci.Free,zoomOnDoubleClick:We=!0,panOnDrag:G=!0,onPaneClick:ae,onPaneMouseEnter:ye,onPaneMouseMove:de,onPaneMouseLeave:Se,onPaneScroll:W,onPaneContextMenu:F,paneClickDistance:me=1,nodeClickDistance:Ve=0,children:tt,onReconnect:nt,onReconnectStart:Ke,onReconnectEnd:Gt,onEdgeContextMenu:cn,onEdgeDoubleClick:en,onEdgeMouseEnter:Ft,onEdgeMouseMove:Na,onEdgeMouseLeave:mn,reconnectRadius:Cn=10,onNodesChange:Ds,onEdgesChange:Ee,noDragClassName:Bn="nodrag",noWheelClassName:Sa="nowheel",noPanClassName:_n="nopan",fitView:_s,fitViewOptions:nr,connectOnClick:kt,attributionPosition:sr,proOptions:ar,defaultEdgeOptions:ni,elevateNodesOnSelect:Vn,elevateEdgesOnSelect:bn,disableKeyboardA11y:tn=!1,autoPanOnConnect:kn,autoPanOnNodeDrag:us,autoPanSpeed:qi,connectionRadius:Ml,isValidConnection:Qs,onError:As,style:si,id:Gi,nodeDragThreshold:Tl,connectionDragThreshold:Rd,viewport:Xi,onViewportChange:wt,width:Zi,height:Qi,colorMode:Dl="light",debug:ai,onScroll:Ca,ariaLabelConfig:_l,...Al},Ki){const ge=Gi||"1",we=fA(Dl),je=m.useCallback(ce=>{ce.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ca==null||Ca(ce)},[Ca]);return a.jsx("div",{"data-testid":"rf__wrapper",...Al,onScroll:je,style:{...si,...z9},ref:Ki,className:Jt(["react-flow",r,we]),id:Gi,role:"application",children:a.jsxs(O9,{nodes:e,edges:t,width:Zi,height:Qi,fitView:_s,fitViewOptions:nr,minZoom:yt,maxZoom:Ht,nodeOrigin:bt,nodeExtent:be,children:[a.jsx(D9,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:p,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:C,nodeTypes:i,edgeTypes:o,connectionLineType:O,connectionLineStyle:B,connectionLineComponent:X,connectionLineContainerStyle:Z,selectionKeyCode:ee,selectionOnDrag:J,selectionMode:se,deleteKeyCode:ne,multiSelectionKeyCode:re,panActivationKeyCode:pe,zoomActivationKeyCode:he,onlyRenderVisibleElements:Oe,defaultViewport:vt,translateExtent:It,minZoom:yt,maxZoom:Ht,preventScrolling:te,zoomOnScroll:I,zoomOnPinch:le,zoomOnDoubleClick:We,panOnScroll:ue,panOnScrollSpeed:xe,panOnScrollMode:Te,panOnDrag:G,onPaneClick:ae,onPaneMouseEnter:ye,onPaneMouseMove:de,onPaneMouseLeave:Se,onPaneScroll:W,onPaneContextMenu:F,paneClickDistance:me,nodeClickDistance:Ve,onSelectionContextMenu:_,onSelectionStart:k,onSelectionEnd:D,onReconnect:nt,onReconnectStart:Ke,onReconnectEnd:Gt,onEdgeContextMenu:cn,onEdgeDoubleClick:en,onEdgeMouseEnter:Ft,onEdgeMouseMove:Na,onEdgeMouseLeave:mn,reconnectRadius:Cn,defaultMarkerColor:He,noDragClassName:Bn,noWheelClassName:Sa,noPanClassName:_n,rfId:ge,disableKeyboardA11y:tn,nodeExtent:be,viewport:Xi,onViewportChange:wt}),a.jsx(hA,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:x,onConnectStart:y,onConnectEnd:b,onClickConnectStart:w,onClickConnectEnd:g,nodesDraggable:Be,autoPanOnNodeFocus:dt,nodesConnectable:Ie,nodesFocusable:St,edgesFocusable:qe,edgesReconnectable:et,elementsSelectable:Qe,elevateNodesOnSelect:Vn,elevateEdgesOnSelect:bn,minZoom:yt,maxZoom:Ht,nodeExtent:be,onNodesChange:Ds,onEdgesChange:Ee,snapToGrid:fe,snapGrid:ke,connectionMode:q,translateExtent:It,connectOnClick:kt,defaultEdgeOptions:ni,fitView:_s,fitViewOptions:nr,onNodesDelete:V,onEdgesDelete:$,onDelete:z,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:A,onSelectionDrag:R,onSelectionDragStart:E,onSelectionDragStop:T,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:_n,nodeOrigin:bt,rfId:ge,autoPanOnConnect:kn,autoPanOnNodeDrag:us,autoPanSpeed:qi,onError:As,connectionRadius:Ml,isValidConnection:Qs,selectNodesOnDrag:Re,nodeDragThreshold:Tl,connectionDragThreshold:Rd,onBeforeDelete:L,debug:ai,ariaLabelConfig:_l}),a.jsx(lA,{onSelectionChange:Y}),tt,a.jsx(sA,{proOptions:ar,position:sr}),a.jsx(nA,{rfId:ge,disableKeyboardA11y:tn})]})})}var U9=g4(R9);function $9(e){const[t,n]=m.useState(e),s=m.useCallback(r=>n(i=>m4(r,i)),[]);return[t,n,s]}function L9(e){const[t,n]=m.useState(e),s=m.useCallback(r=>n(i=>x4(r,i)),[]);return[t,n,s]}function P9({dimensions:e,lineWidth:t,variant:n,className:s}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Jt(["react-flow__background-pattern",n,s])})}function H9({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:Jt(["react-flow__background-pattern","dots",t])})}var Wa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Wa||(Wa={}));const B9={[Wa.Dots]:1,[Wa.Lines]:1,[Wa.Cross]:6},V9=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function H4({id:e,variant:t=Wa.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:o,bgColor:l,style:c,className:u,patternClassName:h}){const d=m.useRef(null),{transform:f,patternId:x}=it(V9,Pt),y=s||B9[t],b=t===Wa.Dots,w=t===Wa.Cross,g=Array.isArray(n)?n:[n,n],v=[g[0]*f[2]||1,g[1]*f[2]||1],p=y*f[2],j=Array.isArray(i)?i:[i,i],N=w?[p,p]:v,C=[j[0]*f[2]||1+N[0]/2,j[1]*f[2]||1+N[1]/2],S=`${x}${e||""}`;return a.jsxs("svg",{className:Jt(["react-flow__background",u]),style:{...c,...Mf,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[a.jsx("pattern",{id:S,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:b?a.jsx(H9,{radius:p/2,className:h}):a.jsx(P9,{dimensions:N,lineWidth:r,variant:t,className:h})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}H4.displayName="Background";const Y9=m.memo(H4);function I9(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function F9(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function W9(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function q9(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function G9(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function ou({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:Jt(["react-flow__controls-button",t]),...n,children:e})}const X9=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function B4({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":x}){const y=Ut(),{isInteractive:b,minZoomReached:w,maxZoomReached:g,ariaLabelConfig:v}=it(X9,Pt),{zoomIn:p,zoomOut:j,fitView:N}=fp(),C=()=>{p(),i==null||i()},S=()=>{j(),o==null||o()},M=()=>{N(r),l==null||l()},A=()=>{y.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},V=f==="horizontal"?"horizontal":"vertical";return a.jsxs(Ef,{className:Jt(["react-flow__controls",V,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":x??v["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(ou,{onClick:C,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:g,children:a.jsx(I9,{})}),a.jsx(ou,{onClick:S,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:w,children:a.jsx(F9,{})})]}),n&&a.jsx(ou,{className:"react-flow__controls-fitview",onClick:M,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:a.jsx(W9,{})}),s&&a.jsx(ou,{className:"react-flow__controls-interactive",onClick:A,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:b?a.jsx(G9,{}):a.jsx(q9,{})}),h]})}B4.displayName="Controls";const Z9=m.memo(B4);function Q9({id:e,x:t,y:n,width:s,height:r,style:i,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:h,shapeRendering:d,selected:f,onClick:x}){const{background:y,backgroundColor:b}=i||{},w=o||y||b;return a.jsx("rect",{className:Jt(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:h,ry:h,width:s,height:r,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:d,onClick:x?g=>x(g,e):void 0})}const K9=m.memo(Q9),J9=e=>e.nodes.map(t=>t.id),Vm=e=>e instanceof Function?e:()=>e;function e7({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=K9,onClick:o}){const l=it(J9,Pt),c=Vm(t),u=Vm(e),h=Vm(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(f=>a.jsx(n7,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:h,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:o,shapeRendering:d},f))})}function t7({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:h,y:d,width:f,height:x}=it(y=>{const{internals:b}=y.nodeLookup.get(e),w=b.userNode,{x:g,y:v}=b.positionAbsolute,{width:p,height:j}=tr(w);return{node:w,x:g,y:v,width:p,height:j}},Pt);return!u||u.hidden||!$N(u)?null:a.jsx(l,{x:h,y:d,width:f,height:x,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:i,shapeRendering:o,onClick:c,id:u.id})}const n7=m.memo(t7);var s7=m.memo(e7);const a7=200,r7=150,i7=e=>!e.hidden,o7=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?UN(Cd(e.nodeLookup,{filter:i7}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},l7="react-flow__minimap-desc";function V4({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:x,onNodeClick:y,pannable:b=!1,zoomable:w=!1,ariaLabel:g,inversePan:v,zoomStep:p=1,offsetScale:j=5}){const N=Ut(),C=m.useRef(null),{boundingRect:S,viewBB:M,rfId:A,panZoom:V,translateExtent:$,flowWidth:z,flowHeight:Y,ariaLabelConfig:E}=it(o7,Pt),R=(e==null?void 0:e.width)??a7,T=(e==null?void 0:e.height)??r7,_=S.width/R,k=S.height/T,D=Math.max(_,k),L=D*R,q=D*T,O=j*D,B=S.x-(L-S.width)/2-O,X=S.y-(q-S.height)/2-O,Z=L+O*2,ne=q+O*2,ee=`${l7}-${A}`,J=m.useRef(0),se=m.useRef();J.current=D,m.useEffect(()=>{if(C.current&&V)return se.current=c_({domNode:C.current,panZoom:V,getTransform:()=>N.getState().transform,getViewScale:()=>J.current}),()=>{var fe;(fe=se.current)==null||fe.destroy()}},[V]),m.useEffect(()=>{var fe;(fe=se.current)==null||fe.update({translateExtent:$,width:z,height:Y,inversePan:v,pannable:b,zoomStep:p,zoomable:w})},[b,w,v,p,$,z,Y]);const pe=x?fe=>{var Re;const[ke,Oe]=((Re=se.current)==null?void 0:Re.pointer(fe))||[0,0];x(fe,{x:ke,y:Oe})}:void 0,re=y?m.useCallback((fe,ke)=>{const Oe=N.getState().nodeLookup.get(ke).internals.userNode;y(fe,Oe)},[]):void 0,he=g??E["minimap.ariaLabel"];return a.jsx(Ef,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*D:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Jt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:R,height:T,viewBox:`${B} ${X} ${Z} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ee,ref:C,onClick:pe,children:[he&&a.jsx("title",{id:ee,children:he}),a.jsx(s7,{onClick:re,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-O},${X-O}h${Z+O*2}v${ne+O*2}h${-Z-O*2}z
98
- M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}V4.displayName="MiniMap";const c7=m.memo(V4),d7=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,u7={[ol.Line]:"right",[ol.Handle]:"bottom-right"};function h7({nodeId:e,position:t,variant:n=ol.Handle,className:s,style:r=void 0,children:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:x=!0,shouldResize:y,onResizeStart:b,onResize:w,onResizeEnd:g}){const v=y4(),p=typeof e=="string"?e:v,j=Ut(),N=m.useRef(null),C=n===ol.Handle,S=it(m.useCallback(d7(C&&x),[C,x]),Pt),M=m.useRef(null),A=t??u7[n];m.useEffect(()=>{if(!(!N.current||!p))return M.current||(M.current=N_({domNode:N.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:$,transform:z,snapGrid:Y,snapToGrid:E,nodeOrigin:R,domNode:T}=j.getState();return{nodeLookup:$,transform:z,snapGrid:Y,snapToGrid:E,nodeOrigin:R,paneDomNode:T}},onChange:($,z)=>{const{triggerNodeChanges:Y,nodeLookup:E,parentLookup:R,nodeOrigin:T}=j.getState(),_=[],k={x:$.x,y:$.y},D=E.get(p);if(D&&D.expandParent&&D.parentId){const L=D.origin??T,q=$.width??D.measured.width??0,O=$.height??D.measured.height??0,B={id:D.id,parentId:D.parentId,rect:{width:q,height:O,...LN({x:$.x??D.position.x,y:$.y??D.position.y},{width:q,height:O},D.parentId,E,L)}},X=hp([B],E,R,T);_.push(...X),k.x=$.x?Math.max(L[0]*q,$.x):void 0,k.y=$.y?Math.max(L[1]*O,$.y):void 0}if(k.x!==void 0&&k.y!==void 0){const L={id:p,type:"position",position:{...k}};_.push(L)}if($.width!==void 0&&$.height!==void 0){const q={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};_.push(q)}for(const L of z){const q={...L,type:"position"};_.push(q)}Y(_)},onEnd:({width:$,height:z})=>{const Y={id:p,type:"dimensions",resizing:!1,dimensions:{width:$,height:z}};j.getState().triggerNodeChanges([Y])}})),M.current.update({controlPosition:A,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:b,onResize:w,onResizeEnd:g,shouldResize:y}),()=>{var $;($=M.current)==null||$.destroy()}},[A,l,c,u,h,d,b,w,g,y]);const V=A.split("-");return a.jsx("div",{className:Jt(["react-flow__resize-control","nodrag",...V,n,s]),ref:N,style:{...r,scale:S,...o&&{[C?"backgroundColor":"borderColor"]:o}},children:i})}m.memo(h7);/**
99
- * @license lucide-react v0.294.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */var f7={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"};/**
104
- * @license lucide-react v0.294.0 - ISC
105
- *
106
- * This source code is licensed under the ISC license.
107
- * See the LICENSE file in the root directory of this source tree.
108
- */const m7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ae=(e,t)=>{const n=m.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...u},h)=>m.createElement("svg",{ref:h,...f7,width:r,height:r,stroke:s,strokeWidth:o?Number(i)*24/Number(r):i,className:["lucide",`lucide-${m7(e)}`,l].join(" "),...u},[...t.map(([d,f])=>m.createElement(d,f)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
109
- * @license lucide-react v0.294.0 - ISC
110
- *
111
- * This source code is licensed under the ISC license.
112
- * See the LICENSE file in the root directory of this source tree.
113
- */const Ty=Ae("AlertCircle",[["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"}]]);/**
114
- * @license lucide-react v0.294.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */const ea=Ae("AlertTriangle",[["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-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
119
- * @license lucide-react v0.294.0 - ISC
120
- *
121
- * This source code is licensed under the ISC license.
122
- * See the LICENSE file in the root directory of this source tree.
123
- */const x7=Ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
124
- * @license lucide-react v0.294.0 - ISC
125
- *
126
- * This source code is licensed under the ISC license.
127
- * See the LICENSE file in the root directory of this source tree.
128
- */const g7=Ae("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
129
- * @license lucide-react v0.294.0 - ISC
130
- *
131
- * This source code is licensed under the ISC license.
132
- * See the LICENSE file in the root directory of this source tree.
133
- */const lu=Ae("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
134
- * @license lucide-react v0.294.0 - ISC
135
- *
136
- * This source code is licensed under the ISC license.
137
- * See the LICENSE file in the root directory of this source tree.
138
- */const Dy=Ae("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
139
- * @license lucide-react v0.294.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */const p7=Ae("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
144
- * @license lucide-react v0.294.0 - ISC
145
- *
146
- * This source code is licensed under the ISC license.
147
- * See the LICENSE file in the root directory of this source tree.
148
- */const sa=Ae("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
149
- * @license lucide-react v0.294.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */const Ah=Ae("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
154
- * @license lucide-react v0.294.0 - ISC
155
- *
156
- * This source code is licensed under the ISC license.
157
- * See the LICENSE file in the root directory of this source tree.
158
- */const nn=Ae("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
159
- * @license lucide-react v0.294.0 - ISC
160
- *
161
- * This source code is licensed under the ISC license.
162
- * See the LICENSE file in the root directory of this source tree.
163
- */const T0=Ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
164
- * @license lucide-react v0.294.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */const Df=Ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
169
- * @license lucide-react v0.294.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */const Y4=Ae("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
174
- * @license lucide-react v0.294.0 - ISC
175
- *
176
- * This source code is licensed under the ISC license.
177
- * See the LICENSE file in the root directory of this source tree.
178
- */const xp=Ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
179
- * @license lucide-react v0.294.0 - ISC
180
- *
181
- * This source code is licensed under the ISC license.
182
- * See the LICENSE file in the root directory of this source tree.
183
- */const b7=Ae("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
184
- * @license lucide-react v0.294.0 - ISC
185
- *
186
- * This source code is licensed under the ISC license.
187
- * See the LICENSE file in the root directory of this source tree.
188
- */const D0=Ae("Clock1",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 14.5 8",key:"12zbmj"}]]);/**
189
- * @license lucide-react v0.294.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */const cu=Ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
194
- * @license lucide-react v0.294.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */const _y=Ae("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
199
- * @license lucide-react v0.294.0 - ISC
200
- *
201
- * This source code is licensed under the ISC license.
202
- * See the LICENSE file in the root directory of this source tree.
203
- */const Ay=Ae("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
204
- * @license lucide-react v0.294.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */const Vt=Ae("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
209
- * @license lucide-react v0.294.0 - ISC
210
- *
211
- * This source code is licensed under the ISC license.
212
- * See the LICENSE file in the root directory of this source tree.
213
- */const Cc=Ae("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
214
- * @license lucide-react v0.294.0 - ISC
215
- *
216
- * This source code is licensed under the ISC license.
217
- * See the LICENSE file in the root directory of this source tree.
218
- */const I4=Ae("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
219
- * @license lucide-react v0.294.0 - ISC
220
- *
221
- * This source code is licensed under the ISC license.
222
- * See the LICENSE file in the root directory of this source tree.
223
- */const Nl=Ae("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
224
- * @license lucide-react v0.294.0 - ISC
225
- *
226
- * This source code is licensed under the ISC license.
227
- * See the LICENSE file in the root directory of this source tree.
228
- */const Oy=Ae("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
229
- * @license lucide-react v0.294.0 - ISC
230
- *
231
- * This source code is licensed under the ISC license.
232
- * See the LICENSE file in the root directory of this source tree.
233
- */const gp=Ae("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
234
- * @license lucide-react v0.294.0 - ISC
235
- *
236
- * This source code is licensed under the ISC license.
237
- * See the LICENSE file in the root directory of this source tree.
238
- */const v7=Ae("Fingerprint",[["path",{d:"M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4",key:"1jc9o5"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2",key:"1mxgy1"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2",key:"1fgabc"}]]);/**
239
- * @license lucide-react v0.294.0 - ISC
240
- *
241
- * This source code is licensed under the ISC license.
242
- * See the LICENSE file in the root directory of this source tree.
243
- */const ys=Ae("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
244
- * @license lucide-react v0.294.0 - ISC
245
- *
246
- * This source code is licensed under the ISC license.
247
- * See the LICENSE file in the root directory of this source tree.
248
- */const y7=Ae("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
249
- * @license lucide-react v0.294.0 - ISC
250
- *
251
- * This source code is licensed under the ISC license.
252
- * See the LICENSE file in the root directory of this source tree.
253
- */const Mo=Ae("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
254
- * @license lucide-react v0.294.0 - ISC
255
- *
256
- * This source code is licensed under the ISC license.
257
- * See the LICENSE file in the root directory of this source tree.
258
- */const Po=Ae("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
259
- * @license lucide-react v0.294.0 - ISC
260
- *
261
- * This source code is licensed under the ISC license.
262
- * See the LICENSE file in the root directory of this source tree.
263
- */const w7=Ae("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
264
- * @license lucide-react v0.294.0 - ISC
265
- *
266
- * This source code is licensed under the ISC license.
267
- * See the LICENSE file in the root directory of this source tree.
268
- */const mi=Ae("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
269
- * @license lucide-react v0.294.0 - ISC
270
- *
271
- * This source code is licensed under the ISC license.
272
- * See the LICENSE file in the root directory of this source tree.
273
- */const Ys=Ae("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
274
- * @license lucide-react v0.294.0 - ISC
275
- *
276
- * This source code is licensed under the ISC license.
277
- * See the LICENSE file in the root directory of this source tree.
278
- */const Lu=Ae("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
279
- * @license lucide-react v0.294.0 - ISC
280
- *
281
- * This source code is licensed under the ISC license.
282
- * See the LICENSE file in the root directory of this source tree.
283
- */const Oh=Ae("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
284
- * @license lucide-react v0.294.0 - ISC
285
- *
286
- * This source code is licensed under the ISC license.
287
- * See the LICENSE file in the root directory of this source tree.
288
- */const j7=Ae("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
289
- * @license lucide-react v0.294.0 - ISC
290
- *
291
- * This source code is licensed under the ISC license.
292
- * See the LICENSE file in the root directory of this source tree.
293
- */const F4=Ae("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
294
- * @license lucide-react v0.294.0 - ISC
295
- *
296
- * This source code is licensed under the ISC license.
297
- * See the LICENSE file in the root directory of this source tree.
298
- */const zi=Ae("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]);/**
299
- * @license lucide-react v0.294.0 - ISC
300
- *
301
- * This source code is licensed under the ISC license.
302
- * See the LICENSE file in the root directory of this source tree.
303
- */const Pr=Ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
304
- * @license lucide-react v0.294.0 - ISC
305
- *
306
- * This source code is licensed under the ISC license.
307
- * See the LICENSE file in the root directory of this source tree.
308
- */const zy=Ae("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
309
- * @license lucide-react v0.294.0 - ISC
310
- *
311
- * This source code is licensed under the ISC license.
312
- * See the LICENSE file in the root directory of this source tree.
313
- */const _0=Ae("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
314
- * @license lucide-react v0.294.0 - ISC
315
- *
316
- * This source code is licensed under the ISC license.
317
- * See the LICENSE file in the root directory of this source tree.
318
- */const Ri=Ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
319
- * @license lucide-react v0.294.0 - ISC
320
- *
321
- * This source code is licensed under the ISC license.
322
- * See the LICENSE file in the root directory of this source tree.
323
- */const N7=Ae("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
324
- * @license lucide-react v0.294.0 - ISC
325
- *
326
- * This source code is licensed under the ISC license.
327
- * See the LICENSE file in the root directory of this source tree.
328
- */const Ho=Ae("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
329
- * @license lucide-react v0.294.0 - ISC
330
- *
331
- * This source code is licensed under the ISC license.
332
- * See the LICENSE file in the root directory of this source tree.
333
- */const yn=Ae("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
334
- * @license lucide-react v0.294.0 - ISC
335
- *
336
- * This source code is licensed under the ISC license.
337
- * See the LICENSE file in the root directory of this source tree.
338
- */const S7=Ae("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
339
- * @license lucide-react v0.294.0 - ISC
340
- *
341
- * This source code is licensed under the ISC license.
342
- * See the LICENSE file in the root directory of this source tree.
343
- */const Ry=Ae("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5h0c-1.4 0-2.5-1.1-2.5-2.5V2",key:"187lwq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/**
344
- * @license lucide-react v0.294.0 - ISC
345
- *
346
- * This source code is licensed under the ISC license.
347
- * See the LICENSE file in the root directory of this source tree.
348
- */const _f=Ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
349
- * @license lucide-react v0.294.0 - ISC
350
- *
351
- * This source code is licensed under the ISC license.
352
- * See the LICENSE file in the root directory of this source tree.
353
- */const C7=Ae("Trash",[["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"}]]);/**
354
- * @license lucide-react v0.294.0 - ISC
355
- *
356
- * This source code is licensed under the ISC license.
357
- * See the LICENSE file in the root directory of this source tree.
358
- */const A0=Ae("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
359
- * @license lucide-react v0.294.0 - ISC
360
- *
361
- * This source code is licensed under the ISC license.
362
- * See the LICENSE file in the root directory of this source tree.
363
- */const Uy=Ae("User",[["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"}]]);/**
364
- * @license lucide-react v0.294.0 - ISC
365
- *
366
- * This source code is licensed under the ISC license.
367
- * See the LICENSE file in the root directory of this source tree.
368
- */const Ui=Ae("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
369
- * @license lucide-react v0.294.0 - ISC
370
- *
371
- * This source code is licensed under the ISC license.
372
- * See the LICENSE file in the root directory of this source tree.
373
- */const W4=Ae("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
374
- * @license lucide-react v0.294.0 - ISC
375
- *
376
- * This source code is licensed under the ISC license.
377
- * See the LICENSE file in the root directory of this source tree.
378
- */const za=Ae("XCircle",[["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"}]]);/**
379
- * @license lucide-react v0.294.0 - ISC
380
- *
381
- * This source code is licensed under the ISC license.
382
- * See the LICENSE file in the root directory of this source tree.
383
- */const an=Ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
384
- * @license lucide-react v0.294.0 - ISC
385
- *
386
- * This source code is licensed under the ISC license.
387
- * See the LICENSE file in the root directory of this source tree.
388
- */const kc=Ae("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function q4(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=q4(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function zh(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=q4(e))&&(s&&(s+=" "),s+=t);return s}const pp="-",k7=e=>{const t=M7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:o=>{const l=o.split(pp);return l[0]===""&&l.length!==1&&l.shift(),G4(l,t)||E7(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},G4=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?G4(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(pp);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},$y=/^\[(.+)\]$/,E7=e=>{if($y.test(e)){const t=$y.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},M7=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return D7(Object.entries(e.classGroups),n).forEach(([i,o])=>{O0(o,s,i,t)}),s},O0=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:Ly(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(T7(r)){O0(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,o])=>{O0(o,Ly(t,i),n,s)})})},Ly=(e,t)=>{let n=e;return t.split(pp).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},T7=e=>e.isThemeGetter,D7=(e,t)=>t?e.map(([n,s])=>{const r=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,r]}):e,_7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return r(i,o),o},set(i,o){n.has(i)?n.set(i,o):r(i,o)}}},X4="!",A7=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,r=t[0],i=t.length,o=l=>{const c=[];let u=0,h=0,d;for(let w=0;w<l.length;w++){let g=l[w];if(u===0){if(g===r&&(s||l.slice(w,w+i)===t)){c.push(l.slice(h,w)),h=w+i;continue}if(g==="/"){d=w;continue}}g==="["?u++:g==="]"&&u--}const f=c.length===0?l:l.substring(h),x=f.startsWith(X4),y=x?f.substring(1):f,b=d&&d>h?d-h:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:b}};return n?l=>n({className:l,parseClassName:o}):o},O7=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},z7=e=>({cache:_7(e.cacheSize),parseClassName:A7(e),...k7(e)}),R7=/\s+/,U7=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=t,i=[],o=e.trim().split(R7);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:x}=n(u);let y=!!x,b=s(y?f.substring(0,x):f);if(!b){if(!y){l=u+(l.length>0?" "+l:l);continue}if(b=s(f),!b){l=u+(l.length>0?" "+l:l);continue}y=!1}const w=O7(h).join(":"),g=d?w+X4:w,v=g+b;if(i.includes(v))continue;i.push(v);const p=r(b,y);for(let j=0;j<p.length;++j){const N=p[j];i.push(g+N)}l=u+(l.length>0?" "+l:l)}return l};function $7(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Z4(t))&&(s&&(s+=" "),s+=n);return s}const Z4=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Z4(e[s]))&&(n&&(n+=" "),n+=t);return n};function L7(e,...t){let n,s,r,i=o;function o(c){const u=t.reduce((h,d)=>d(h),e());return n=z7(u),s=n.cache.get,r=n.cache.set,i=l,l(c)}function l(c){const u=s(c);if(u)return u;const h=U7(c,n);return r(c,h),h}return function(){return i($7.apply(null,arguments))}}const Tt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Q4=/^\[(?:([a-z-]+):)?(.+)\]$/i,P7=/^\d+\/\d+$/,H7=new Set(["px","full","screen"]),B7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V7=/\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$/,Y7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,I7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Da=e=>Bo(e)||H7.has(e)||P7.test(e),dr=e=>Sl(e,"length",J7),Bo=e=>!!e&&!Number.isNaN(Number(e)),Ym=e=>Sl(e,"number",Bo),Il=e=>!!e&&Number.isInteger(Number(e)),W7=e=>e.endsWith("%")&&Bo(e.slice(0,-1)),Xe=e=>Q4.test(e),ur=e=>B7.test(e),q7=new Set(["length","size","percentage"]),G7=e=>Sl(e,q7,K4),X7=e=>Sl(e,"position",K4),Z7=new Set(["image","url"]),Q7=e=>Sl(e,Z7,tO),K7=e=>Sl(e,"",eO),Fl=()=>!0,Sl=(e,t,n)=>{const s=Q4.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},J7=e=>V7.test(e)&&!Y7.test(e),K4=()=>!1,eO=e=>I7.test(e),tO=e=>F7.test(e),nO=()=>{const e=Tt("colors"),t=Tt("spacing"),n=Tt("blur"),s=Tt("brightness"),r=Tt("borderColor"),i=Tt("borderRadius"),o=Tt("borderSpacing"),l=Tt("borderWidth"),c=Tt("contrast"),u=Tt("grayscale"),h=Tt("hueRotate"),d=Tt("invert"),f=Tt("gap"),x=Tt("gradientColorStops"),y=Tt("gradientColorStopPositions"),b=Tt("inset"),w=Tt("margin"),g=Tt("opacity"),v=Tt("padding"),p=Tt("saturate"),j=Tt("scale"),N=Tt("sepia"),C=Tt("skew"),S=Tt("space"),M=Tt("translate"),A=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",Xe,t],z=()=>[Xe,t],Y=()=>["",Da,dr],E=()=>["auto",Bo,Xe],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],T=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],k=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Xe],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[Bo,Xe];return{cacheSize:500,separator:":",theme:{colors:[Fl],spacing:[Da,dr],blur:["none","",ur,Xe],brightness:q(),borderColor:[e],borderRadius:["none","","full",ur,Xe],borderSpacing:z(),borderWidth:Y(),contrast:q(),grayscale:D(),hueRotate:q(),invert:D(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[W7,dr],inset:$(),margin:$(),opacity:q(),padding:z(),saturate:q(),scale:q(),sepia:D(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Xe]}],container:["container"],columns:[{columns:[ur]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),Xe]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Il,Xe]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Xe]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",Il,Xe]}],"grid-cols":[{"grid-cols":[Fl]}],"col-start-end":[{col:["auto",{span:["full",Il,Xe]},Xe]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Fl]}],"row-start-end":[{row:["auto",{span:[Il,Xe]},Xe]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Xe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Xe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[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:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Xe,t]}],"min-w":[{"min-w":[Xe,t,"min","max","fit"]}],"max-w":[{"max-w":[Xe,t,"none","full","min","max","fit","prose",{screen:[ur]},ur]}],h:[{h:[Xe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Xe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Xe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Xe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ur,dr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ym]}],"font-family":[{font:[Fl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Xe]}],"line-clamp":[{"line-clamp":["none",Bo,Ym]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Da,Xe]}],"list-image":[{"list-image":["none",Xe]}],"list-style-type":[{list:["none","disc","decimal",Xe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...T(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Da,dr]}],"underline-offset":[{"underline-offset":["auto",Da,Xe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),X7]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",G7]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Q7]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...T(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:T()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...T()]}],"outline-offset":[{"outline-offset":[Da,Xe]}],"outline-w":[{outline:[Da,dr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Da,dr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ur,K7]}],"shadow-color":[{shadow:[Fl]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ur,Xe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[p]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[p]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Xe]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",Xe]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",Xe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Il,Xe]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Xe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Xe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",Xe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Da,dr,Ym]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},sO=L7(nO);function Pe(...e){return sO(zh(e))}function rn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Py(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fr(...e){return t=>{let n=!1;const s=e.map(r=>{const i=Py(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<s.length;r++){const i=s[r];typeof i=="function"?i():Py(e[r],null)}}}}function ds(...e){return m.useCallback(Fr(...e),e)}function aO(e,t){const n=m.createContext(t),s=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})};s.displayName=e+"Provider";function r(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,r]}function Af(e,t=[]){let n=[];function s(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=d=>{var g;const{scope:f,children:x,...y}=d,b=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,w=m.useMemo(()=>y,Object.values(y));return a.jsx(b.Provider,{value:w,children:x})};u.displayName=i+"Provider";function h(d,f){var b;const x=((b=f==null?void 0:f[e])==null?void 0:b[c])||l,y=m.useContext(x);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,h]}const r=()=>{const i=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[s,rO(r,...t)]}function rO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...l,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function bp(e){const t=iO(e),n=m.forwardRef((s,r)=>{const{children:i,...o}=s,l=m.Children.toArray(i),c=l.find(lO);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function iO(e){const t=m.forwardRef((n,s)=>{const{children:r,...i}=n;if(m.isValidElement(r)){const o=dO(r),l=cO(i,r.props);return r.type!==m.Fragment&&(l.ref=s?Fr(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var J4=Symbol("radix.slottable");function oO(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=J4,t}function lO(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===J4}function cO(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function dO(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sn=uO.reduce((e,t)=>{const n=bp(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function hO(e,t){e&&Jh.flushSync(()=>e.dispatchEvent(t))}function cl(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function fO(e,t=globalThis==null?void 0:globalThis.document){const n=cl(e);m.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var mO="DismissableLayer",z0="dismissableLayer.update",xO="dismissableLayer.pointerDownOutside",gO="dismissableLayer.focusOutside",Hy,e3=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Of=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(e3),[h,d]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=m.useState({}),y=ds(t,S=>d(S)),b=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=b.indexOf(w),v=h?b.indexOf(h):-1,p=u.layersWithOutsidePointerEventsDisabled.size>0,j=v>=g,N=vO(S=>{const M=S.target,A=[...u.branches].some(V=>V.contains(M));!j||A||(r==null||r(S),o==null||o(S),S.defaultPrevented||l==null||l())},f),C=yO(S=>{const M=S.target;[...u.branches].some(V=>V.contains(M))||(i==null||i(S),o==null||o(S),S.defaultPrevented||l==null||l())},f);return fO(S=>{v===u.layers.size-1&&(s==null||s(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Hy=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),By(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Hy)}},[h,f,n,u]),m.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),By())},[h,u]),m.useEffect(()=>{const S=()=>x({});return document.addEventListener(z0,S),()=>document.removeEventListener(z0,S)},[]),a.jsx(Sn.div,{...c,ref:y,style:{pointerEvents:p?j?"auto":"none":void 0,...e.style},onFocusCapture:rn(e.onFocusCapture,C.onFocusCapture),onBlurCapture:rn(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:rn(e.onPointerDownCapture,N.onPointerDownCapture)})});Of.displayName=mO;var pO="DismissableLayerBranch",bO=m.forwardRef((e,t)=>{const n=m.useContext(e3),s=m.useRef(null),r=ds(t,s);return m.useEffect(()=>{const i=s.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(Sn.div,{...e,ref:r})});bO.displayName=pO;function vO(e,t=globalThis==null?void 0:globalThis.document){const n=cl(e),s=m.useRef(!1),r=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!s.current){let c=function(){t3(xO,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function yO(e,t=globalThis==null?void 0:globalThis.document){const n=cl(e),s=m.useRef(!1);return m.useEffect(()=>{const r=i=>{i.target&&!s.current&&t3(gO,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function By(){const e=new CustomEvent(z0);document.dispatchEvent(e)}function t3(e,t,n,{discrete:s}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?hO(r,i):r.dispatchEvent(i)}var Wr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},wO=Zh[" useId ".trim().toString()]||(()=>{}),jO=0;function Is(e){const[t,n]=m.useState(wO());return Wr(()=>{n(s=>s??String(jO++))},[e]),e||(t?`radix-${t}`:"")}const NO=["top","right","bottom","left"],qr=Math.min,Kn=Math.max,Rh=Math.round,du=Math.floor,ma=e=>({x:e,y:e}),SO={left:"right",right:"left",bottom:"top",top:"bottom"},CO={start:"end",end:"start"};function R0(e,t,n){return Kn(e,qr(t,n))}function Ka(e,t){return typeof e=="function"?e(t):e}function Ja(e){return e.split("-")[0]}function Cl(e){return e.split("-")[1]}function vp(e){return e==="x"?"y":"x"}function yp(e){return e==="y"?"height":"width"}const kO=new Set(["top","bottom"]);function la(e){return kO.has(Ja(e))?"y":"x"}function wp(e){return vp(la(e))}function EO(e,t,n){n===void 0&&(n=!1);const s=Cl(e),r=wp(e),i=yp(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Uh(o)),[o,Uh(o)]}function MO(e){const t=Uh(e);return[U0(e),t,U0(t)]}function U0(e){return e.replace(/start|end/g,t=>CO[t])}const Vy=["left","right"],Yy=["right","left"],TO=["top","bottom"],DO=["bottom","top"];function _O(e,t,n){switch(e){case"top":case"bottom":return n?t?Yy:Vy:t?Vy:Yy;case"left":case"right":return t?TO:DO;default:return[]}}function AO(e,t,n,s){const r=Cl(e);let i=_O(Ja(e),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),t&&(i=i.concat(i.map(U0)))),i}function Uh(e){return e.replace(/left|right|bottom|top/g,t=>SO[t])}function OO(e){return{top:0,right:0,bottom:0,left:0,...e}}function n3(e){return typeof e!="number"?OO(e):{top:e,right:e,bottom:e,left:e}}function $h(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function Iy(e,t,n){let{reference:s,floating:r}=e;const i=la(t),o=wp(t),l=yp(o),c=Ja(t),u=i==="y",h=s.x+s.width/2-r.width/2,d=s.y+s.height/2-r.height/2,f=s[l]/2-r[l]/2;let x;switch(c){case"top":x={x:h,y:s.y-r.height};break;case"bottom":x={x:h,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:d};break;case"left":x={x:s.x-r.width,y:d};break;default:x={x:s.x,y:s.y}}switch(Cl(t)){case"start":x[o]-=f*(n&&u?-1:1);break;case"end":x[o]+=f*(n&&u?-1:1);break}return x}const zO=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=Iy(u,s,c),f=s,x={},y=0;for(let b=0;b<l.length;b++){const{name:w,fn:g}=l[b],{x:v,y:p,data:j,reset:N}=await g({x:h,y:d,initialPlacement:s,placement:f,strategy:r,middlewareData:x,rects:u,platform:o,elements:{reference:e,floating:t}});h=v??h,d=p??d,x={...x,[w]:{...x[w],...j}},N&&y<=50&&(y++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(u=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:h,y:d}=Iy(u,f,c)),b=-1)}return{x:h,y:d,placement:f,strategy:r,middlewareData:x}};async function ed(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:x=0}=Ka(t,e),y=n3(x),w=l[f?d==="floating"?"reference":"floating":d],g=$h(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:h,strategy:c})),v=d==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,p=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(p))?await(i.getScale==null?void 0:i.getScale(p))||{x:1,y:1}:{x:1,y:1},N=$h(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:p,strategy:c}):v);return{top:(g.top-N.top+y.top)/j.y,bottom:(N.bottom-g.bottom+y.bottom)/j.y,left:(g.left-N.left+y.left)/j.x,right:(N.right-g.right+y.right)/j.x}}const RO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:h=0}=Ka(e,t)||{};if(u==null)return{};const d=n3(h),f={x:n,y:s},x=wp(r),y=yp(x),b=await o.getDimensions(u),w=x==="y",g=w?"top":"left",v=w?"bottom":"right",p=w?"clientHeight":"clientWidth",j=i.reference[y]+i.reference[x]-f[x]-i.floating[y],N=f[x]-i.reference[x],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let S=C?C[p]:0;(!S||!await(o.isElement==null?void 0:o.isElement(C)))&&(S=l.floating[p]||i.floating[y]);const M=j/2-N/2,A=S/2-b[y]/2-1,V=qr(d[g],A),$=qr(d[v],A),z=V,Y=S-b[y]-$,E=S/2-b[y]/2+M,R=R0(z,E,Y),T=!c.arrow&&Cl(r)!=null&&E!==R&&i.reference[y]/2-(E<z?V:$)-b[y]/2<0,_=T?E<z?E-z:E-Y:0;return{[x]:f[x]+_,data:{[x]:R,centerOffset:E-R-_,...T&&{alignmentOffset:_}},reset:T}}}),UO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...w}=Ka(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Ja(r),v=la(l),p=Ja(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=f||(p||!b?[Uh(l)]:MO(l)),C=y!=="none";!f&&C&&N.push(...AO(l,b,y,j));const S=[l,...N],M=await ed(t,w),A=[];let V=((s=i.flip)==null?void 0:s.overflows)||[];if(h&&A.push(M[g]),d){const E=EO(r,o,j);A.push(M[E[0]],M[E[1]])}if(V=[...V,{placement:r,overflows:A}],!A.every(E=>E<=0)){var $,z;const E=((($=i.flip)==null?void 0:$.index)||0)+1,R=S[E];if(R&&(!(d==="alignment"?v!==la(R):!1)||V.every(k=>la(k.placement)===v?k.overflows[0]>0:!0)))return{data:{index:E,overflows:V},reset:{placement:R}};let T=(z=V.filter(_=>_.overflows[0]<=0).sort((_,k)=>_.overflows[1]-k.overflows[1])[0])==null?void 0:z.placement;if(!T)switch(x){case"bestFit":{var Y;const _=(Y=V.filter(k=>{if(C){const D=la(k.placement);return D===v||D==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(D=>D>0).reduce((D,L)=>D+L,0)]).sort((k,D)=>k[1]-D[1])[0])==null?void 0:Y[0];_&&(T=_);break}case"initialPlacement":T=l;break}if(r!==T)return{reset:{placement:T}}}return{}}}};function Fy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wy(e){return NO.some(t=>e[t]>=0)}const $O=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...r}=Ka(e,t);switch(s){case"referenceHidden":{const i=await ed(t,{...r,elementContext:"reference"}),o=Fy(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Wy(o)}}}case"escaped":{const i=await ed(t,{...r,altBoundary:!0}),o=Fy(i,n.floating);return{data:{escapedOffsets:o,escaped:Wy(o)}}}default:return{}}}}},s3=new Set(["left","top"]);async function LO(e,t){const{placement:n,platform:s,elements:r}=e,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Ja(n),l=Cl(n),c=la(n)==="y",u=s3.has(o)?-1:1,h=i&&c?-1:1,d=Ka(t,e);let{mainAxis:f,crossAxis:x,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof y=="number"&&(x=l==="end"?y*-1:y),c?{x:x*h,y:f*u}:{x:f*u,y:x*h}}const PO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:i,placement:o,middlewareData:l}=t,c=await LO(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:o}}}}},HO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:w=>{let{x:g,y:v}=w;return{x:g,y:v}}},...c}=Ka(e,t),u={x:n,y:s},h=await ed(t,c),d=la(Ja(r)),f=vp(d);let x=u[f],y=u[d];if(i){const w=f==="y"?"top":"left",g=f==="y"?"bottom":"right",v=x+h[w],p=x-h[g];x=R0(v,x,p)}if(o){const w=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=y+h[w],p=y-h[g];y=R0(v,y,p)}const b=l.fn({...t,[f]:x,[d]:y});return{...b,data:{x:b.x-n,y:b.y-s,enabled:{[f]:i,[d]:o}}}}}},BO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:r,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Ka(e,t),h={x:n,y:s},d=la(r),f=vp(d);let x=h[f],y=h[d];const b=Ka(l,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const p=f==="y"?"height":"width",j=i.reference[f]-i.floating[p]+w.mainAxis,N=i.reference[f]+i.reference[p]-w.mainAxis;x<j?x=j:x>N&&(x=N)}if(u){var g,v;const p=f==="y"?"width":"height",j=s3.has(Ja(r)),N=i.reference[d]-i.floating[p]+(j&&((g=o.offset)==null?void 0:g[d])||0)+(j?0:w.crossAxis),C=i.reference[d]+i.reference[p]+(j?0:((v=o.offset)==null?void 0:v[d])||0)-(j?w.crossAxis:0);y<N?y=N:y>C&&(y=C)}return{[f]:x,[d]:y}}}},VO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=Ka(e,t),h=await ed(t,u),d=Ja(r),f=Cl(r),x=la(r)==="y",{width:y,height:b}=i.floating;let w,g;d==="top"||d==="bottom"?(w=d,g=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,w=f==="end"?"top":"bottom");const v=b-h.top-h.bottom,p=y-h.left-h.right,j=qr(b-h[w],v),N=qr(y-h[g],p),C=!t.middlewareData.shift;let S=j,M=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=p),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(S=v),C&&!f){const V=Kn(h.left,0),$=Kn(h.right,0),z=Kn(h.top,0),Y=Kn(h.bottom,0);x?M=y-2*(V!==0||$!==0?V+$:Kn(h.left,h.right)):S=b-2*(z!==0||Y!==0?z+Y:Kn(h.top,h.bottom))}await c({...t,availableWidth:M,availableHeight:S});const A=await o.getDimensions(l.floating);return y!==A.width||b!==A.height?{reset:{rects:!0}}:{}}}};function zf(){return typeof window<"u"}function kl(e){return a3(e)?(e.nodeName||"").toLowerCase():"#document"}function is(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ya(e){var t;return(t=(a3(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function a3(e){return zf()?e instanceof Node||e instanceof is(e).Node:!1}function Fs(e){return zf()?e instanceof Element||e instanceof is(e).Element:!1}function ga(e){return zf()?e instanceof HTMLElement||e instanceof is(e).HTMLElement:!1}function qy(e){return!zf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof is(e).ShadowRoot}const YO=new Set(["inline","contents"]);function Md(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=Ws(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!YO.has(r)}const IO=new Set(["table","td","th"]);function FO(e){return IO.has(kl(e))}const WO=[":popover-open",":modal"];function Rf(e){return WO.some(t=>{try{return e.matches(t)}catch{return!1}})}const qO=["transform","translate","scale","rotate","perspective"],GO=["transform","translate","scale","rotate","perspective","filter"],XO=["paint","layout","strict","content"];function jp(e){const t=Np(),n=Fs(e)?Ws(e):e;return qO.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||GO.some(s=>(n.willChange||"").includes(s))||XO.some(s=>(n.contain||"").includes(s))}function ZO(e){let t=Gr(e);for(;ga(t)&&!dl(t);){if(jp(t))return t;if(Rf(t))return null;t=Gr(t)}return null}function Np(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const QO=new Set(["html","body","#document"]);function dl(e){return QO.has(kl(e))}function Ws(e){return is(e).getComputedStyle(e)}function Uf(e){return Fs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gr(e){if(kl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qy(e)&&e.host||ya(e);return qy(t)?t.host:t}function r3(e){const t=Gr(e);return dl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ga(t)&&Md(t)?t:r3(t)}function td(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=r3(e),i=r===((s=e.ownerDocument)==null?void 0:s.body),o=is(r);if(i){const l=$0(o);return t.concat(o,o.visualViewport||[],Md(r)?r:[],l&&n?td(l):[])}return t.concat(r,td(r,[],n))}function $0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function i3(e){const t=Ws(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=ga(e),i=r?e.offsetWidth:n,o=r?e.offsetHeight:s,l=Rh(n)!==i||Rh(s)!==o;return l&&(n=i,s=o),{width:n,height:s,$:l}}function Sp(e){return Fs(e)?e:e.contextElement}function Vo(e){const t=Sp(e);if(!ga(t))return ma(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:i}=i3(t);let o=(i?Rh(n.width):n.width)/s,l=(i?Rh(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const KO=ma(0);function o3(e){const t=is(e);return!Np()||!t.visualViewport?KO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==is(e)?!1:t}function $i(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Sp(e);let o=ma(1);t&&(s?Fs(s)&&(o=Vo(s)):o=Vo(e));const l=JO(i,n,s)?o3(i):ma(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,h=r.width/o.x,d=r.height/o.y;if(i){const f=is(i),x=s&&Fs(s)?is(s):s;let y=f,b=$0(y);for(;b&&s&&x!==y;){const w=Vo(b),g=b.getBoundingClientRect(),v=Ws(b),p=g.left+(b.clientLeft+parseFloat(v.paddingLeft))*w.x,j=g.top+(b.clientTop+parseFloat(v.paddingTop))*w.y;c*=w.x,u*=w.y,h*=w.x,d*=w.y,c+=p,u+=j,y=is(b),b=$0(y)}}return $h({width:h,height:d,x:c,y:u})}function $f(e,t){const n=Uf(e).scrollLeft;return t?t.left+n:$i(ya(e)).left+n}function l3(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-$f(e,n),r=n.top+t.scrollTop;return{x:s,y:r}}function ez(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const i=r==="fixed",o=ya(s),l=t?Rf(t.floating):!1;if(s===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=ma(1);const h=ma(0),d=ga(s);if((d||!d&&!i)&&((kl(s)!=="body"||Md(o))&&(c=Uf(s)),ga(s))){const x=$i(s);u=Vo(s),h.x=x.x+s.clientLeft,h.y=x.y+s.clientTop}const f=o&&!d&&!i?l3(o,c):ma(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-c.scrollTop*u.y+h.y+f.y}}function tz(e){return Array.from(e.getClientRects())}function nz(e){const t=ya(e),n=Uf(e),s=e.ownerDocument.body,r=Kn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=Kn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+$f(e);const l=-n.scrollTop;return Ws(s).direction==="rtl"&&(o+=Kn(t.clientWidth,s.clientWidth)-r),{width:r,height:i,x:o,y:l}}const Gy=25;function sz(e,t){const n=is(e),s=ya(e),r=n.visualViewport;let i=s.clientWidth,o=s.clientHeight,l=0,c=0;if(r){i=r.width,o=r.height;const h=Np();(!h||h&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const u=$f(s);if(u<=0){const h=s.ownerDocument,d=h.body,f=getComputedStyle(d),x=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,y=Math.abs(s.clientWidth-d.clientWidth-x);y<=Gy&&(i-=y)}else u<=Gy&&(i+=u);return{width:i,height:o,x:l,y:c}}const az=new Set(["absolute","fixed"]);function rz(e,t){const n=$i(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,i=ga(e)?Vo(e):ma(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=r*i.x,u=s*i.y;return{width:o,height:l,x:c,y:u}}function Xy(e,t,n){let s;if(t==="viewport")s=sz(e,n);else if(t==="document")s=nz(ya(e));else if(Fs(t))s=rz(t,n);else{const r=o3(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return $h(s)}function c3(e,t){const n=Gr(e);return n===t||!Fs(n)||dl(n)?!1:Ws(n).position==="fixed"||c3(n,t)}function iz(e,t){const n=t.get(e);if(n)return n;let s=td(e,[],!1).filter(l=>Fs(l)&&kl(l)!=="body"),r=null;const i=Ws(e).position==="fixed";let o=i?Gr(e):e;for(;Fs(o)&&!dl(o);){const l=Ws(o),c=jp(o);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&az.has(r.position)||Md(o)&&!c&&c3(e,o))?s=s.filter(h=>h!==o):r=l,o=Gr(o)}return t.set(e,s),s}function oz(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const o=[...n==="clippingAncestors"?Rf(t)?[]:iz(t,this._c):[].concat(n),s],l=o[0],c=o.reduce((u,h)=>{const d=Xy(t,h,r);return u.top=Kn(d.top,u.top),u.right=qr(d.right,u.right),u.bottom=qr(d.bottom,u.bottom),u.left=Kn(d.left,u.left),u},Xy(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function lz(e){const{width:t,height:n}=i3(e);return{width:t,height:n}}function cz(e,t,n){const s=ga(t),r=ya(t),i=n==="fixed",o=$i(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=ma(0);function u(){c.x=$f(r)}if(s||!s&&!i)if((kl(t)!=="body"||Md(r))&&(l=Uf(t)),s){const x=$i(t,!0,i,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else r&&u();i&&!s&&r&&u();const h=r&&!s&&!i?l3(r,l):ma(0),d=o.left+l.scrollLeft-c.x-h.x,f=o.top+l.scrollTop-c.y-h.y;return{x:d,y:f,width:o.width,height:o.height}}function Im(e){return Ws(e).position==="static"}function Zy(e,t){if(!ga(e)||Ws(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ya(e)===n&&(n=n.ownerDocument.body),n}function d3(e,t){const n=is(e);if(Rf(e))return n;if(!ga(e)){let r=Gr(e);for(;r&&!dl(r);){if(Fs(r)&&!Im(r))return r;r=Gr(r)}return n}let s=Zy(e,t);for(;s&&FO(s)&&Im(s);)s=Zy(s,t);return s&&dl(s)&&Im(s)&&!jp(s)?n:s||ZO(e)||n}const dz=async function(e){const t=this.getOffsetParent||d3,n=this.getDimensions,s=await n(e.floating);return{reference:cz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function uz(e){return Ws(e).direction==="rtl"}const hz={convertOffsetParentRelativeRectToViewportRelativeRect:ez,getDocumentElement:ya,getClippingRect:oz,getOffsetParent:d3,getElementRects:dz,getClientRects:tz,getDimensions:lz,getScale:Vo,isElement:Fs,isRTL:uz};function u3(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fz(e,t){let n=null,s;const r=ya(e);function i(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:h,top:d,width:f,height:x}=u;if(l||t(),!f||!x)return;const y=du(d),b=du(r.clientWidth-(h+f)),w=du(r.clientHeight-(d+x)),g=du(h),p={rootMargin:-y+"px "+-b+"px "+-w+"px "+-g+"px",threshold:Kn(0,qr(1,c))||1};let j=!0;function N(C){const S=C[0].intersectionRatio;if(S!==c){if(!j)return o();S?o(!1,S):s=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!u3(u,e.getBoundingClientRect())&&o(),j=!1}try{n=new IntersectionObserver(N,{...p,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,p)}n.observe(e)}return o(!0),i}function mz(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=Sp(e),h=r||i?[...u?td(u):[],...td(t)]:[];h.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=u&&l?fz(u,n):null;let f=-1,x=null;o&&(x=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var p;(p=x)==null||p.observe(t)})),n()}),u&&!c&&x.observe(u),x.observe(t));let y,b=c?$i(e):null;c&&w();function w(){const g=$i(e);b&&!u3(b,g)&&n(),b=g,y=requestAnimationFrame(w)}return n(),()=>{var g;h.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),d==null||d(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(y)}}const xz=PO,gz=HO,pz=UO,bz=VO,vz=$O,Qy=RO,yz=BO,wz=(e,t,n)=>{const s=new Map,r={platform:hz,...n},i={...r.platform,_c:s};return zO(e,t,{...r,platform:i})};var jz=typeof document<"u",Nz=function(){},Pu=jz?m.useLayoutEffect:Nz;function Lh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Lh(e[s],t[s]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,r[s]))return!1;for(s=n;s--!==0;){const i=r[s];if(!(i==="_owner"&&e.$$typeof)&&!Lh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function h3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ky(e,t){const n=h3(e);return Math.round(t*n)/n}function Fm(e){const t=m.useRef(e);return Pu(()=>{t.current=e}),t}function Sz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:r,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[h,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,x]=m.useState(s);Lh(f,s)||x(s);const[y,b]=m.useState(null),[w,g]=m.useState(null),v=m.useCallback(k=>{k!==C.current&&(C.current=k,b(k))},[]),p=m.useCallback(k=>{k!==S.current&&(S.current=k,g(k))},[]),j=i||y,N=o||w,C=m.useRef(null),S=m.useRef(null),M=m.useRef(h),A=c!=null,V=Fm(c),$=Fm(r),z=Fm(u),Y=m.useCallback(()=>{if(!C.current||!S.current)return;const k={placement:t,strategy:n,middleware:f};$.current&&(k.platform=$.current),wz(C.current,S.current,k).then(D=>{const L={...D,isPositioned:z.current!==!1};E.current&&!Lh(M.current,L)&&(M.current=L,Jh.flushSync(()=>{d(L)}))})},[f,t,n,$,z]);Pu(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(k=>({...k,isPositioned:!1})))},[u]);const E=m.useRef(!1);Pu(()=>(E.current=!0,()=>{E.current=!1}),[]),Pu(()=>{if(j&&(C.current=j),N&&(S.current=N),j&&N){if(V.current)return V.current(j,N,Y);Y()}},[j,N,Y,V,A]);const R=m.useMemo(()=>({reference:C,floating:S,setReference:v,setFloating:p}),[v,p]),T=m.useMemo(()=>({reference:j,floating:N}),[j,N]),_=m.useMemo(()=>{const k={position:n,left:0,top:0};if(!T.floating)return k;const D=Ky(T.floating,h.x),L=Ky(T.floating,h.y);return l?{...k,transform:"translate("+D+"px, "+L+"px)",...h3(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:L}},[n,l,T.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:Y,refs:R,elements:T,floatingStyles:_}),[h,Y,R,T,_])}const Cz=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:r}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Qy({element:s.current,padding:r}).fn(n):{}:s?Qy({element:s,padding:r}).fn(n):{}}}},kz=(e,t)=>({...xz(e),options:[e,t]}),Ez=(e,t)=>({...gz(e),options:[e,t]}),Mz=(e,t)=>({...yz(e),options:[e,t]}),Tz=(e,t)=>({...pz(e),options:[e,t]}),Dz=(e,t)=>({...bz(e),options:[e,t]}),_z=(e,t)=>({...vz(e),options:[e,t]}),Az=(e,t)=>({...Cz(e),options:[e,t]});var Oz="Arrow",f3=m.forwardRef((e,t)=>{const{children:n,width:s=10,height:r=5,...i}=e;return a.jsx(Sn.svg,{...i,ref:t,width:s,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});f3.displayName=Oz;var zz=f3;function Rz(e){const[t,n]=m.useState(void 0);return Wr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var Cp="Popper",[m3,Lf]=Af(Cp),[Uz,x3]=m3(Cp),g3=e=>{const{__scopePopper:t,children:n}=e,[s,r]=m.useState(null);return a.jsx(Uz,{scope:t,anchor:s,onAnchorChange:r,children:n})};g3.displayName=Cp;var p3="PopperAnchor",b3=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...r}=e,i=x3(p3,n),o=m.useRef(null),l=ds(t,o),c=m.useRef(null);return m.useEffect(()=>{const u=c.current;c.current=(s==null?void 0:s.current)||o.current,u!==c.current&&i.onAnchorChange(c.current)}),s?null:a.jsx(Sn.div,{...r,ref:l})});b3.displayName=p3;var kp="PopperContent",[$z,Lz]=m3(kp),v3=m.forwardRef((e,t)=>{var ee,J,se,pe,re,he;const{__scopePopper:n,side:s="bottom",sideOffset:r=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:x="optimized",onPlaced:y,...b}=e,w=x3(kp,n),[g,v]=m.useState(null),p=ds(t,fe=>v(fe)),[j,N]=m.useState(null),C=Rz(j),S=(C==null?void 0:C.width)??0,M=(C==null?void 0:C.height)??0,A=s+(i!=="center"?"-"+i:""),V=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},$=Array.isArray(u)?u:[u],z=$.length>0,Y={padding:V,boundary:$.filter(Hz),altBoundary:z},{refs:E,floatingStyles:R,placement:T,isPositioned:_,middlewareData:k}=Sz({strategy:"fixed",placement:A,whileElementsMounted:(...fe)=>mz(...fe,{animationFrame:x==="always"}),elements:{reference:w.anchor},middleware:[kz({mainAxis:r+M,alignmentAxis:o}),c&&Ez({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Mz():void 0,...Y}),c&&Tz({...Y}),Dz({...Y,apply:({elements:fe,rects:ke,availableWidth:Oe,availableHeight:Re})=>{const{width:Be,height:dt}=ke.reference,Ie=fe.floating.style;Ie.setProperty("--radix-popper-available-width",`${Oe}px`),Ie.setProperty("--radix-popper-available-height",`${Re}px`),Ie.setProperty("--radix-popper-anchor-width",`${Be}px`),Ie.setProperty("--radix-popper-anchor-height",`${dt}px`)}}),j&&Az({element:j,padding:l}),Bz({arrowWidth:S,arrowHeight:M}),f&&_z({strategy:"referenceHidden",...Y})]}),[D,L]=j3(T),q=cl(y);Wr(()=>{_&&(q==null||q())},[_,q]);const O=(ee=k.arrow)==null?void 0:ee.x,B=(J=k.arrow)==null?void 0:J.y,X=((se=k.arrow)==null?void 0:se.centerOffset)!==0,[Z,ne]=m.useState();return Wr(()=>{g&&ne(window.getComputedStyle(g).zIndex)},[g]),a.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:_?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(pe=k.transformOrigin)==null?void 0:pe.x,(re=k.transformOrigin)==null?void 0:re.y].join(" "),...((he=k.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx($z,{scope:n,placedSide:D,onArrowChange:N,arrowX:O,arrowY:B,shouldHideArrow:X,children:a.jsx(Sn.div,{"data-side":D,"data-align":L,...b,ref:p,style:{...b.style,animation:_?void 0:"none"}})})})});v3.displayName=kp;var y3="PopperArrow",Pz={top:"bottom",right:"left",bottom:"top",left:"right"},w3=m.forwardRef(function(t,n){const{__scopePopper:s,...r}=t,i=Lz(y3,s),o=Pz[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(zz,{...r,ref:n,style:{...r.style,display:"block"}})})});w3.displayName=y3;function Hz(e){return e!==null}var Bz=e=>({name:"transformOrigin",options:e,fn(t){var w,g,v;const{placement:n,rects:s,middlewareData:r}=t,o=((w=r.arrow)==null?void 0:w.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,h]=j3(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((g=r.arrow)==null?void 0:g.x)??0)+l/2,x=(((v=r.arrow)==null?void 0:v.y)??0)+c/2;let y="",b="";return u==="bottom"?(y=o?d:`${f}px`,b=`${-c}px`):u==="top"?(y=o?d:`${f}px`,b=`${s.floating.height+c}px`):u==="right"?(y=`${-c}px`,b=o?d:`${x}px`):u==="left"&&(y=`${s.floating.width+c}px`,b=o?d:`${x}px`),{data:{x:y,y:b}}}});function j3(e){const[t,n="center"]=e.split("-");return[t,n]}var N3=g3,Ep=b3,S3=v3,C3=w3,Vz="Portal",Mp=m.forwardRef((e,t)=>{var l;const{container:n,...s}=e,[r,i]=m.useState(!1);Wr(()=>i(!0),[]);const o=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?r1.createPortal(a.jsx(Sn.div,{...s,ref:t}),o):null});Mp.displayName=Vz;function Yz(e,t){return m.useReducer((n,s)=>t[n][s]??n,e)}var Wi=e=>{const{present:t,children:n}=e,s=Iz(t),r=typeof n=="function"?n({present:s.isPresent}):m.Children.only(n),i=ds(s.ref,Fz(r));return typeof n=="function"||s.isPresent?m.cloneElement(r,{ref:i}):null};Wi.displayName="Presence";function Iz(e){const[t,n]=m.useState(),s=m.useRef(null),r=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Yz(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=uu(s.current);i.current=l==="mounted"?u:"none"},[l]),Wr(()=>{const u=s.current,h=r.current;if(h!==e){const f=i.current,x=uu(u);e?c("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&f!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),Wr(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,d=x=>{const b=uu(s.current).includes(CSS.escape(x.animationName));if(x.target===t&&b&&(c("ANIMATION_END"),!r.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},f=x=>{x.target===t&&(i.current=uu(s.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{s.current=u?getComputedStyle(u):null,n(u)},[])}}function uu(e){return(e==null?void 0:e.animationName)||"none"}function Fz(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wz=Zh[" useInsertionEffect ".trim().toString()]||Wr;function Tp({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[r,i,o]=qz({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${s} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,s])}const u=m.useCallback(h=>{var d;if(l){const f=Gz(h)?h(e):h;f!==e&&((d=o.current)==null||d.call(o,f))}else i(h)},[l,e,i,o]);return[c,u]}function qz({defaultProp:e,onChange:t}){const[n,s]=m.useState(e),r=m.useRef(n),i=m.useRef(t);return Wz(()=>{i.current=t},[t]),m.useEffect(()=>{var o;r.current!==n&&((o=i.current)==null||o.call(i,n),r.current=n)},[n,r]),[n,s,i]}function Gz(e){return typeof e=="function"}var Xz=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"}),Zz="VisuallyHidden",k3=m.forwardRef((e,t)=>a.jsx(Sn.span,{...e,ref:t,style:{...Xz,...e.style}}));k3.displayName=Zz;var Qz=k3,[Pf]=Af("Tooltip",[Lf]),Hf=Lf(),E3="TooltipProvider",Kz=700,L0="tooltip.open",[Jz,Dp]=Pf(E3),M3=e=>{const{__scopeTooltip:t,delayDuration:n=Kz,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(Jz,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,s)},[s]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:i})};M3.displayName=E3;var nd="Tooltip",[eR,Bf]=Pf(nd),T3=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=Dp(nd,e.__scopeTooltip),u=Hf(t),[h,d]=m.useState(null),f=Is(),x=m.useRef(0),y=o??c.disableHoverableContent,b=l??c.delayDuration,w=m.useRef(!1),[g,v]=Tp({prop:s,defaultProp:r??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(L0))):c.onClose(),i==null||i(S)},caller:nd}),p=m.useMemo(()=>g?w.current?"delayed-open":"instant-open":"closed",[g]),j=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,w.current=!1,v(!0)},[v]),N=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,v(!1)},[v]),C=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{w.current=!0,v(!0),x.current=0},b)},[b,v]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),a.jsx(N3,{...u,children:a.jsx(eR,{scope:t,contentId:f,open:g,stateAttribute:p,trigger:h,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?C():j()},[c.isOpenDelayedRef,C,j]),onTriggerLeave:m.useCallback(()=>{y?N():(window.clearTimeout(x.current),x.current=0)},[N,y]),onOpen:j,onClose:N,disableHoverableContent:y,children:n})})};T3.displayName=nd;var P0="TooltipTrigger",D3=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=Bf(P0,n),i=Dp(P0,n),o=Hf(n),l=m.useRef(null),c=ds(t,l,r.onTriggerChange),u=m.useRef(!1),h=m.useRef(!1),d=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.jsx(Ep,{asChild:!0,...o,children:a.jsx(Sn.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:rn(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),h.current=!0)}),onPointerLeave:rn(e.onPointerLeave,()=>{r.onTriggerLeave(),h.current=!1}),onPointerDown:rn(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:rn(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:rn(e.onBlur,r.onClose),onClick:rn(e.onClick,r.onClose)})})});D3.displayName=P0;var tR="TooltipPortal",[kV,nR]=Pf(tR,{forceMount:void 0}),ul="TooltipContent",_3=m.forwardRef((e,t)=>{const n=nR(ul,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...i}=e,o=Bf(ul,e.__scopeTooltip);return a.jsx(Wi,{present:s||o.open,children:o.disableHoverableContent?a.jsx(A3,{side:r,...i,ref:t}):a.jsx(sR,{side:r,...i,ref:t})})}),sR=m.forwardRef((e,t)=>{const n=Bf(ul,e.__scopeTooltip),s=Dp(ul,e.__scopeTooltip),r=m.useRef(null),i=ds(t,r),[o,l]=m.useState(null),{trigger:c,onClose:u}=n,h=r.current,{onPointerInTransitChange:d}=s,f=m.useCallback(()=>{l(null),d(!1)},[d]),x=m.useCallback((y,b)=>{const w=y.currentTarget,g={x:y.clientX,y:y.clientY},v=lR(g,w.getBoundingClientRect()),p=cR(g,v),j=dR(b.getBoundingClientRect()),N=hR([...p,...j]);l(N),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&h){const y=w=>x(w,h),b=w=>x(w,c);return c.addEventListener("pointerleave",y),h.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",b)}}},[c,h,x,f]),m.useEffect(()=>{if(o){const y=b=>{const w=b.target,g={x:b.clientX,y:b.clientY},v=(c==null?void 0:c.contains(w))||(h==null?void 0:h.contains(w)),p=!uR(g,o);v?f():p&&(f(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,h,o,u,f]),a.jsx(A3,{...e,ref:i})}),[aR,rR]=Pf(nd,{isInside:!1}),iR=oO("TooltipContent"),A3=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=Bf(ul,n),u=Hf(n),{onClose:h}=c;return m.useEffect(()=>(document.addEventListener(L0,h),()=>document.removeEventListener(L0,h)),[h]),m.useEffect(()=>{if(c.trigger){const d=f=>{const x=f.target;x!=null&&x.contains(c.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,h]),a.jsx(Of,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:a.jsxs(S3,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(iR,{children:s}),a.jsx(aR,{scope:n,isInside:!0,children:a.jsx(Qz,{id:c.contentId,role:"tooltip",children:r||s})})]})})});_3.displayName=ul;var O3="TooltipArrow",oR=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=Hf(n);return rR(O3,n).isInside?null:a.jsx(C3,{...r,...s,ref:t})});oR.displayName=O3;function lR(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,s,r,i)){case i:return"left";case r:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function cR(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function dR(e){const{top:t,right:n,bottom:s,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:s},{x:r,y:s}]}function uR(e,t){const{x:n,y:s}=e;let r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,h=l.y,d=c.x,f=c.y;h>s!=f>s&&n<(d-u)*(s-h)/(f-h)+u&&(r=!r)}return r}function hR(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),fR(t)}function fR(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const r=e[s];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const r=e[s];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(r.y-o.y)>=(i.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var mR=M3,xR=T3,gR=D3,z3=_3;const Wm=mR,qm=xR,Gm=gR,Hu=m.forwardRef(({className:e,sideOffset:t=4,...n},s)=>a.jsx(z3,{ref:s,sideOffset:t,className:Pe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));Hu.displayName=z3.displayName;const pR=320,bR=32,vR=e=>({core:"text-slate-300",organization:"text-blue-300",teams:"text-green-300",twoFactor:"text-purple-300",apiKey:"text-orange-300",passkey:"text-pink-300"})[e]||"text-gray-300",H0=({data:e,targetPosition:t,sourcePosition:n})=>{const s=e,[r,i]=m.useState(!1),[o,l]=m.useState(!1),c="!h-2 !w-2 !min-w-0 !min-h-0 !cursor-grab !border-0 opacity-0 hover:opacity-100 transition-opacity",u=vR(s.plugin||"core");return s.isForeign?a.jsx("div",{className:"relative",children:a.jsxs("div",{className:"text-xs px-3 py-2 border border-gray-600 bg-gray-800 text-gray-200 flex gap-2 items-center rounded-md shadow-lg",id:`${s.name}-foreign-key`,children:[a.jsx(Vt,{size:12,className:"text-gray-400"}),a.jsx("span",{className:"font-medium",children:s.displayName||s.name}),t&&a.jsx(ki,{type:"target",id:s.name,position:t,className:Pe(c)})]})}):a.jsx("div",{className:"relative",children:a.jsxs("div",{className:Pe("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:pR},id:`${s.name}-schema-node`,children:[a.jsxs("div",{className:Pe("px-4 py-3 bg-black border-b border-gray-700 flex items-center justify-between","cursor-pointer select-none"),onClick:()=>i(!r),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Vt,{size:16,className:"text-white"}),a.jsx("span",{className:"text-white font-semibold text-sm",children:s.displayName||s.name})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:h=>{h.stopPropagation(),l(!o)},className:"p-1 hover:bg-gray-800 rounded transition-colors",children:o?a.jsx(I4,{size:12,className:"text-gray-400"}):a.jsx(Nl,{size:12,className:"text-gray-400"})}),r?a.jsx(xp,{size:14,className:"text-gray-400"}):a.jsx(Df,{size:14,className:"text-gray-400"})]})]}),!r&&a.jsx("div",{className:"max-h-96 bg-black overflow-y-auto",children:s.columns.map(h=>a.jsxs("div",{className:Pe("relative flex items-center overflow-x-hidden px-4 py-2 text-xs","bg-black/30 hover:bg-black/40 transition-colors duration-150","border-b border-white/20 last:border-b-0"),style:{minHeight:bR},children:[a.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[h.isPrimary&&a.jsx(Wm,{delayDuration:100,children:a.jsxs(qm,{children:[a.jsx(Gm,{asChild:!0,children:a.jsx(Po,{size:10,className:"text-yellow-400 flex-shrink-0"})}),a.jsx(Hu,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),h.isUnique&&!h.isPrimary&&a.jsx(Wm,{delayDuration:100,children:a.jsxs(qm,{children:[a.jsx(Gm,{asChild:!0,children:a.jsx(v7,{size:10,className:"text-green-400 flex-shrink-0"})}),a.jsx(Hu,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),h.isIdentity&&a.jsx(Wm,{delayDuration:100,children:a.jsxs(qm,{children:[a.jsx(Gm,{asChild:!0,children:a.jsx(y7,{size:10,className:"text-blue-400 flex-shrink-0"})}),a.jsx(Hu,{className:"bg-black border-gray-600 text-white text-xs",children:"Identity"})]})})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[!h.isNullable&&a.jsx("span",{className:"text-red-400 text-xs",children:"*"}),a.jsx("span",{className:"text-white font-medium truncate",children:h.name}),a.jsx("span",{className:"text-gray-400 font-mono text-xs",children:h.format})]}),o&&h.description&&a.jsx("div",{className:"text-gray-500 text-xs mt-1 truncate",children:h.description})]}),a.jsx("div",{className:"ml-2",children:a.jsx("span",{className:Pe("px-2 py-1 rounded text-xs font-medium",u),children:h.plugin})}),a.jsx(ki,{type:"target",id:h.id,position:t||"left",className:Pe(c,"!left-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",left:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}}),a.jsx(ki,{type:"source",id:h.id,position:n||"right",className:Pe(c,"!right-[-8px] !top-1/2 !transform !-translate-y-1/2"),style:{background:"#1f2937",border:"2px solid #374151",right:"-8px",top:"50%",transform:"translateY(-50%)",boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.3)"}})]},h.id))}),s.relationships&&s.relationships.length>0&&a.jsx("div",{className:"px-4 py-2 bg-gray-800 border-t border-gray-700",children:a.jsxs("span",{className:"text-xs text-gray-400",children:[s.relationships.length," relationship",s.relationships.length!==1?"s":""]})})]})})},yR={id:"demo-user-table",name:"user",displayName:"User",isForeign:!1,plugin:"core",columns:[{id:"user-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"core",description:"Unique user identifier"},{id:"user-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"core",description:"User display name"},{id:"user-email",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"email",format:"string",plugin:"core",description:"User email address"},{id:"user-emailVerified",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"emailVerified",format:"boolean",plugin:"core",description:"Email verification status"},{id:"user-image",isPrimary:!1,isNullable:!0,isUnique:!1,isIdentity:!1,name:"image",format:"string",plugin:"core",description:"User profile image URL"},{id:"user-createdAt",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"createdAt",format:"date",plugin:"core",description:"Account creation timestamp"}],relationships:[{type:"one-to-many",target:"session",field:"userId"},{type:"one-to-many",target:"account",field:"userId"}]},wR={id:"demo-organization-table",name:"organization",displayName:"Organization",isForeign:!1,plugin:"organization",columns:[{id:"org-id",isPrimary:!0,isNullable:!1,isUnique:!0,isIdentity:!1,name:"id",format:"string",plugin:"organization",description:"Unique organization identifier"},{id:"org-name",isPrimary:!1,isNullable:!1,isUnique:!1,isIdentity:!1,name:"name",format:"string",plugin:"organization",description:"Organization name"},{id:"org-slug",isPrimary:!1,isNullable:!1,isUnique:!0,isIdentity:!1,name:"slug",format:"string",plugin:"organization",description:"Organization URL slug"}],relationships:[{type:"one-to-many",target:"member",field:"organizationId"}]};function jR(){return a.jsx("div",{className:"min-h-screen bg-black p-8",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-light text-white mb-4",children:"Database Schema Node Demo"}),a.jsx("p",{className:"text-gray-400",children:"Enhanced database schema nodes with dark mode theming, collapsible views, and detailed tooltips."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Core User Table"}),a.jsx(H0,{data:yR,targetPosition:"left",sourcePosition:"right"})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),a.jsx(H0,{data:wR,targetPosition:"left",sourcePosition:"right"})]})]}),a.jsxs("div",{className:"mt-12 p-6 bg-gray-900 rounded-lg border border-gray-700",children:[a.jsx("h3",{className:"text-lg text-white mb-4",children:"Features"}),a.jsxs("ul",{className:"space-y-2 text-gray-300",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Dark Mode Optimized:"})," Designed specifically for dark themes"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Collapsible Views:"})," Click the header to collapse/expand table contents"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Detail Toggle:"})," Show/hide column descriptions with the eye icon"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Plugin Badges:"})," Color-coded plugin indicators"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Interactive Icons:"})," Hover tooltips for primary keys, unique constraints, etc."]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Relationship Counter:"})," Shows number of relationships in footer"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Connection Handles:"})," Invisible handles for React Flow connections"]})]})]})]})})}const R3=m.createContext(void 0);function NR({children:e}){const[t,n]=m.useState({users:0,organizations:0,sessions:0,teams:0}),[s,r]=m.useState(!0),i=m.useCallback(async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{r(!1)}},[]),o=m.useCallback(async()=>{r(!0),await i()},[i]);return m.useEffect(()=>{i()},[i]),a.jsx(R3.Provider,{value:{counts:t,loading:s,refetchCounts:o},children:e})}function Vf(){const e=m.useContext(R3);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}function U3(e,t){const n=m.useRef(null),s=m.useRef(null),r=m.useRef(0),i=m.useRef(!1),o=m.useRef(e),l=m.useRef(t==null?void 0:t.onStatusChange),c=(t==null?void 0:t.maxReconnectAttempts)??5;m.useEffect(()=>{o.current=e},[e]),m.useEffect(()=>{l.current=t==null?void 0:t.onStatusChange},[t==null?void 0:t.onStatusChange]),m.useEffect(()=>{let u=!1;const h=()=>{var d;try{(d=l.current)==null||d.call(l,"connecting");const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;n.current=new WebSocket(x),n.current.onopen=()=>{var y;r.current=0,i.current=!0,(y=l.current)==null||y.call(l,"open"),s.current&&(clearTimeout(s.current),s.current=null)},n.current.onmessage=y=>{try{const b=JSON.parse(y.data);o.current&&o.current(b)}catch{}},n.current.onclose=y=>{var b,w,g,v;if(!u){if(!i.current&&(y.code===1006||y.code===1001)){(b=l.current)==null||b.call(l,"unavailable");return}if((w=l.current)==null||w.call(l,"closed"),r.current<c){r.current++;const p=Math.min(1e3*2**r.current,1e4);(g=l.current)==null||g.call(l,"reconnecting"),s.current=setTimeout(()=>{h()},p)}else(v=l.current)==null||v.call(l,"unavailable")}},n.current.onerror=y=>{var b;(b=l.current)==null||b.call(l,"error")}}catch{}};return h(),()=>{u=!0,n.current&&n.current.close(),s.current&&clearTimeout(s.current)}},[c])}var Jy=1,SR=.9,CR=.8,kR=.17,Xm=.1,Zm=.999,ER=.9999,MR=.99,TR=/[\\\/_+.#"@\[\(\{&]/,DR=/[\\\/_+.#"@\[\(\{&]/g,_R=/[\s-]/,$3=/[\s-]/g;function B0(e,t,n,s,r,i,o){if(i===t.length)return r===e.length?Jy:MR;var l=`${r},${i}`;if(o[l]!==void 0)return o[l];for(var c=s.charAt(i),u=n.indexOf(c,r),h=0,d,f,x,y;u>=0;)d=B0(e,t,n,s,u+1,i+1,o),d>h&&(u===r?d*=Jy:TR.test(e.charAt(u-1))?(d*=CR,x=e.slice(r,u-1).match(DR),x&&r>0&&(d*=Math.pow(Zm,x.length))):_R.test(e.charAt(u-1))?(d*=SR,y=e.slice(r,u-1).match($3),y&&r>0&&(d*=Math.pow(Zm,y.length))):(d*=kR,r>0&&(d*=Math.pow(Zm,u-r))),e.charAt(u)!==t.charAt(i)&&(d*=ER)),(d<Xm&&n.charAt(u-1)===s.charAt(i+1)||s.charAt(i+1)===s.charAt(i)&&n.charAt(u-1)!==s.charAt(i))&&(f=B0(e,t,n,s,u+1,i+2,o),f*Xm>d&&(d=f*Xm)),d>h&&(h=d),u=n.indexOf(c,u+1);return o[l]=h,h}function ew(e){return e.toLowerCase().replace($3," ")}function AR(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,B0(e,t,ew(e),ew(t),0,0,{})}var Qm="focusScope.autoFocusOnMount",Km="focusScope.autoFocusOnUnmount",tw={bubbles:!1,cancelable:!0},OR="FocusScope",_p=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),u=cl(r),h=cl(i),d=m.useRef(null),f=ds(t,b=>c(b)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let b=function(p){if(x.paused||!l)return;const j=p.target;l.contains(j)?d.current=j:xr(d.current,{select:!0})},w=function(p){if(x.paused||!l)return;const j=p.relatedTarget;j!==null&&(l.contains(j)||xr(d.current,{select:!0}))},g=function(p){if(document.activeElement===document.body)for(const N of p)N.removedNodes.length>0&&xr(l)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const v=new MutationObserver(g);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),v.disconnect()}}},[s,l,x.paused]),m.useEffect(()=>{if(l){sw.add(x);const b=document.activeElement;if(!l.contains(b)){const g=new CustomEvent(Qm,tw);l.addEventListener(Qm,u),l.dispatchEvent(g),g.defaultPrevented||(zR(PR(L3(l)),{select:!0}),document.activeElement===b&&xr(l))}return()=>{l.removeEventListener(Qm,u),setTimeout(()=>{const g=new CustomEvent(Km,tw);l.addEventListener(Km,h),l.dispatchEvent(g),g.defaultPrevented||xr(b??document.body,{select:!0}),l.removeEventListener(Km,h),sw.remove(x)},0)}}},[l,u,h,x]);const y=m.useCallback(b=>{if(!n&&!s||x.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,g=document.activeElement;if(w&&g){const v=b.currentTarget,[p,j]=RR(v);p&&j?!b.shiftKey&&g===j?(b.preventDefault(),n&&xr(p,{select:!0})):b.shiftKey&&g===p&&(b.preventDefault(),n&&xr(j,{select:!0})):g===v&&b.preventDefault()}},[n,s,x.paused]);return a.jsx(Sn.div,{tabIndex:-1,...o,ref:f,onKeyDown:y})});_p.displayName=OR;function zR(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(xr(s,{select:t}),document.activeElement!==n)return}function RR(e){const t=L3(e),n=nw(t,e),s=nw(t.reverse(),e);return[n,s]}function L3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nw(e,t){for(const n of e)if(!UR(n,{upTo:t}))return n}function UR(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 $R(e){return e instanceof HTMLInputElement&&"select"in e}function xr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$R(e)&&t&&e.select()}}var sw=LR();function LR(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=aw(e,t),e.unshift(t)},remove(t){var n;e=aw(e,t),(n=e[0])==null||n.resume()}}}function aw(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function PR(e){return e.filter(t=>t.tagName!=="A")}var Jm=0;function P3(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rw()),document.body.insertAdjacentElement("beforeend",e[1]??rw()),Jm++,()=>{Jm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Jm--}},[])}function rw(){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 ia=function(){return ia=Object.assign||function(t){for(var n,s=1,r=arguments.length;s<r;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ia.apply(this,arguments)};function H3(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]]);return n}function HR(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,i;s<r;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}var Bu="right-scroll-bar-position",Vu="width-before-scroll-bar",BR="with-scroll-bars-hidden",VR="--removed-body-scroll-bar-size";function ex(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function YR(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var r=n.value;r!==s&&(n.value=s,n.callback(s,r))}}}})[0];return n.callback=t,n.facade}var IR=typeof window<"u"?m.useLayoutEffect:m.useEffect,iw=new WeakMap;function FR(e,t){var n=YR(null,function(s){return e.forEach(function(r){return ex(r,s)})});return IR(function(){var s=iw.get(n);if(s){var r=new Set(s),i=new Set(e),o=n.current;r.forEach(function(l){i.has(l)||ex(l,null)}),i.forEach(function(l){r.has(l)||ex(l,o)})}iw.set(n,e)},[e]),n}function WR(e){return e}function qR(e,t){t===void 0&&(t=WR);var n=[],s=!1,r={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,s);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(s=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){s=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var h=o;o=[],h.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(h){o.push(h),u()},filter:function(h){return o=o.filter(h),n}}}};return r}function GR(e){e===void 0&&(e={});var t=qR(null);return t.options=ia({async:!0,ssr:!1},e),t}var B3=function(e){var t=e.sideCar,n=H3(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,ia({},n))};B3.isSideCarExport=!0;function XR(e,t){return e.useMedium(t),B3}var V3=GR(),tx=function(){},Yf=m.forwardRef(function(e,t){var n=m.useRef(null),s=m.useState({onScrollCapture:tx,onWheelCapture:tx,onTouchMoveCapture:tx}),r=s[0],i=s[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,x=e.noRelative,y=e.noIsolation,b=e.inert,w=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,p=e.gapMode,j=H3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=f,C=FR([n,t]),S=ia(ia({},j),r);return m.createElement(m.Fragment,null,h&&m.createElement(N,{sideCar:V3,removeScrollBar:u,shards:d,noRelative:x,noIsolation:y,inert:b,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:p}),o?m.cloneElement(m.Children.only(l),ia(ia({},S),{ref:C})):m.createElement(v,ia({},S,{className:c,ref:C}),l))});Yf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yf.classNames={fullWidth:Vu,zeroRight:Bu};var ZR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function QR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ZR();return t&&e.setAttribute("nonce",t),e}function KR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=QR())&&(KR(t,n),JR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tU=function(){var e=eU();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Y3=function(){var e=tU(),t=function(n){var s=n.styles,r=n.dynamic;return e(s,r),null};return t},nU={left:0,top:0,right:0,gap:0},nx=function(e){return parseInt(e||"",10)||0},sU=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[nx(n),nx(s),nx(r)]},aU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nU;var t=sU(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},rU=Y3(),Yo="data-scroll-locked",iU=function(e,t,n,s){var r=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
389
- .`.concat(BR,` {
390
- overflow: hidden `).concat(s,`;
391
- padding-right: `).concat(l,"px ").concat(s,`;
392
- }
393
- body[`).concat(Yo,`] {
394
- overflow: hidden `).concat(s,`;
395
- overscroll-behavior: contain;
396
- `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
397
- padding-left: `.concat(r,`px;
398
- padding-top: `).concat(i,`px;
399
- padding-right: `).concat(o,`px;
400
- margin-left:0;
401
- margin-top:0;
402
- margin-right: `).concat(l,"px ").concat(s,`;
403
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
404
- }
405
-
406
- .`).concat(Bu,` {
407
- right: `).concat(l,"px ").concat(s,`;
408
- }
409
-
410
- .`).concat(Vu,` {
411
- margin-right: `).concat(l,"px ").concat(s,`;
412
- }
413
-
414
- .`).concat(Bu," .").concat(Bu,` {
415
- right: 0 `).concat(s,`;
416
- }
417
-
418
- .`).concat(Vu," .").concat(Vu,` {
419
- margin-right: 0 `).concat(s,`;
420
- }
421
-
422
- body[`).concat(Yo,`] {
423
- `).concat(VR,": ").concat(l,`px;
424
- }
425
- `)},ow=function(){var e=parseInt(document.body.getAttribute(Yo)||"0",10);return isFinite(e)?e:0},oU=function(){m.useEffect(function(){return document.body.setAttribute(Yo,(ow()+1).toString()),function(){var e=ow()-1;e<=0?document.body.removeAttribute(Yo):document.body.setAttribute(Yo,e.toString())}},[])},lU=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,r=s===void 0?"margin":s;oU();var i=m.useMemo(function(){return aU(r)},[r]);return m.createElement(rU,{styles:iU(i,!t,r,n?"":"!important")})},V0=!1;if(typeof window<"u")try{var hu=Object.defineProperty({},"passive",{get:function(){return V0=!0,!0}});window.addEventListener("test",hu,hu),window.removeEventListener("test",hu,hu)}catch{V0=!1}var no=V0?{passive:!1}:!1,cU=function(e){return e.tagName==="TEXTAREA"},I3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!cU(e)&&n[t]==="visible")},dU=function(e){return I3(e,"overflowY")},uU=function(e){return I3(e,"overflowX")},lw=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var r=F3(e,s);if(r){var i=W3(e,s),o=i[1],l=i[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},hU=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},fU=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},F3=function(e,t){return e==="v"?dU(t):uU(t)},W3=function(e,t){return e==="v"?hU(t):fU(t)},mU=function(e,t){return e==="h"&&t==="rtl"?-1:1},xU=function(e,t,n,s,r){var i=mU(e,window.getComputedStyle(t).direction),o=i*s,l=n.target,c=t.contains(l),u=!1,h=o>0,d=0,f=0;do{if(!l)break;var x=W3(e,l),y=x[0],b=x[1],w=x[2],g=b-w-i*y;(y||g)&&F3(e,l)&&(d+=g,f+=y);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},fu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cw=function(e){return[e.deltaX,e.deltaY]},dw=function(e){return e&&"current"in e?e.current:e},gU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pU=function(e){return`
426
- .block-interactivity-`.concat(e,` {pointer-events: none;}
427
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
428
- `)},bU=0,so=[];function vU(e){var t=m.useRef([]),n=m.useRef([0,0]),s=m.useRef(),r=m.useState(bU++)[0],i=m.useState(Y3)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=HR([e.lockRef.current],(e.shards||[]).map(dw),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var g=fu(b),v=n.current,p="deltaX"in b?b.deltaX:v[0]-g[0],j="deltaY"in b?b.deltaY:v[1]-g[1],N,C=b.target,S=Math.abs(p)>Math.abs(j)?"h":"v";if("touches"in b&&S==="h"&&C.type==="range")return!1;var M=lw(S,C);if(!M)return!0;if(M?N=S:(N=S==="v"?"h":"v",M=lw(S,C)),!M)return!1;if(!s.current&&"changedTouches"in b&&(p||j)&&(s.current=N),!N)return!0;var A=s.current||N;return xU(A,w,b,A==="h"?p:j)},[]),c=m.useCallback(function(b){var w=b;if(!(!so.length||so[so.length-1]!==i)){var g="deltaY"in w?cw(w):fu(w),v=t.current.filter(function(N){return N.name===w.type&&(N.target===w.target||w.target===N.shadowParent)&&gU(N.delta,g)})[0];if(v&&v.should){w.cancelable&&w.preventDefault();return}if(!v){var p=(o.current.shards||[]).map(dw).filter(Boolean).filter(function(N){return N.contains(w.target)}),j=p.length>0?l(w,p[0]):!o.current.noIsolation;j&&w.cancelable&&w.preventDefault()}}},[]),u=m.useCallback(function(b,w,g,v){var p={name:b,delta:w,target:g,should:v,shadowParent:yU(g)};t.current.push(p),setTimeout(function(){t.current=t.current.filter(function(j){return j!==p})},1)},[]),h=m.useCallback(function(b){n.current=fu(b),s.current=void 0},[]),d=m.useCallback(function(b){u(b.type,cw(b),b.target,l(b,e.lockRef.current))},[]),f=m.useCallback(function(b){u(b.type,fu(b),b.target,l(b,e.lockRef.current))},[]);m.useEffect(function(){return so.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,no),document.addEventListener("touchmove",c,no),document.addEventListener("touchstart",h,no),function(){so=so.filter(function(b){return b!==i}),document.removeEventListener("wheel",c,no),document.removeEventListener("touchmove",c,no),document.removeEventListener("touchstart",h,no)}},[]);var x=e.removeScrollBar,y=e.inert;return m.createElement(m.Fragment,null,y?m.createElement(i,{styles:pU(r)}):null,x?m.createElement(lU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wU=XR(V3,vU);var Ap=m.forwardRef(function(e,t){return m.createElement(Yf,ia({},e,{ref:t,sideCar:wU}))});Ap.classNames=Yf.classNames;var jU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ao=new WeakMap,mu=new WeakMap,xu={},sx=0,q3=function(e){return e&&(e.host||q3(e.parentNode))},NU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=q3(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},SU=function(e,t,n,s){var r=NU(t,Array.isArray(e)?e:[e]);xu[n]||(xu[n]=new WeakMap);var i=xu[n],o=[],l=new Set,c=new Set(r),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};r.forEach(u);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var x=f.getAttribute(s),y=x!==null&&x!=="false",b=(ao.get(f)||0)+1,w=(i.get(f)||0)+1;ao.set(f,b),i.set(f,w),o.push(f),b===1&&y&&mu.set(f,!0),w===1&&f.setAttribute(n,"true"),y||f.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),l.clear(),sx++,function(){o.forEach(function(d){var f=ao.get(d)-1,x=i.get(d)-1;ao.set(d,f),i.set(d,x),f||(mu.has(d)||d.removeAttribute(s),mu.delete(d)),x||d.removeAttribute(n)}),sx--,sx||(ao=new WeakMap,ao=new WeakMap,mu=new WeakMap,xu={})}},G3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),r=jU(e);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),SU(s,r,n,"aria-hidden")):function(){return null}},If="Dialog",[X3]=Af(If),[CU,Zs]=X3(If),Z3=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[u,h]=Tp({prop:s,defaultProp:r??!1,onChange:i,caller:If});return a.jsx(CU,{scope:t,triggerRef:l,contentRef:c,contentId:Is(),titleId:Is(),descriptionId:Is(),open:u,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};Z3.displayName=If;var Q3="DialogTrigger",kU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Zs(Q3,n),i=ds(t,r.triggerRef);return a.jsx(Sn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Rp(r.open),...s,ref:i,onClick:rn(e.onClick,r.onOpenToggle)})});kU.displayName=Q3;var Op="DialogPortal",[EU,K3]=X3(Op,{forceMount:void 0}),J3=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:r}=e,i=Zs(Op,t);return a.jsx(EU,{scope:t,forceMount:n,children:m.Children.map(s,o=>a.jsx(Wi,{present:n||i.open,children:a.jsx(Mp,{asChild:!0,container:r,children:o})}))})};J3.displayName=Op;var Ph="DialogOverlay",eS=m.forwardRef((e,t)=>{const n=K3(Ph,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=Zs(Ph,e.__scopeDialog);return i.modal?a.jsx(Wi,{present:s||i.open,children:a.jsx(TU,{...r,ref:t})}):null});eS.displayName=Ph;var MU=bp("DialogOverlay.RemoveScroll"),TU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Zs(Ph,n);return a.jsx(Ap,{as:MU,allowPinchZoom:!0,shards:[r.contentRef],children:a.jsx(Sn.div,{"data-state":Rp(r.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Li="DialogContent",tS=m.forwardRef((e,t)=>{const n=K3(Li,e.__scopeDialog),{forceMount:s=n.forceMount,...r}=e,i=Zs(Li,e.__scopeDialog);return a.jsx(Wi,{present:s||i.open,children:i.modal?a.jsx(DU,{...r,ref:t}):a.jsx(_U,{...r,ref:t})})});tS.displayName=Li;var DU=m.forwardRef((e,t)=>{const n=Zs(Li,e.__scopeDialog),s=m.useRef(null),r=ds(t,n.contentRef,s);return m.useEffect(()=>{const i=s.current;if(i)return G3(i)},[]),a.jsx(nS,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rn(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:rn(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:rn(e.onFocusOutside,i=>i.preventDefault())})}),_U=m.forwardRef((e,t)=>{const n=Zs(Li,e.__scopeDialog),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(nS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),nS=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,...o}=e,l=Zs(Li,n),c=m.useRef(null),u=ds(t,c);return P3(),a.jsxs(a.Fragment,{children:[a.jsx(_p,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(Of,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Rp(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(RU,{titleId:l.titleId}),a.jsx($U,{contentRef:c,descriptionId:l.descriptionId})]})]})}),zp="DialogTitle",AU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Zs(zp,n);return a.jsx(Sn.h2,{id:r.titleId,...s,ref:t})});AU.displayName=zp;var sS="DialogDescription",OU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Zs(sS,n);return a.jsx(Sn.p,{id:r.descriptionId,...s,ref:t})});OU.displayName=sS;var aS="DialogClose",zU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,r=Zs(aS,n);return a.jsx(Sn.button,{type:"button",...s,ref:t,onClick:rn(e.onClick,()=>r.onOpenChange(!1))})});zU.displayName=aS;function Rp(e){return e?"open":"closed"}var rS="DialogTitleWarning",[EV,iS]=aO(rS,{contentName:Li,titleName:zp,docsSlug:"dialog"}),RU=({titleId:e})=>{const t=iS(rS),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
429
-
430
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
431
-
432
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},UU="DialogDescriptionWarning",$U=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${iS(UU).contentName}}.`;return m.useEffect(()=>{var i;const r=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},LU=Z3,PU=J3,HU=eS,BU=tS,VU=Symbol.for("react.lazy"),Hh=Zh[" use ".trim().toString()];function YU(e){return typeof e=="object"&&e!==null&&"then"in e}function oS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===VU&&"_payload"in e&&YU(e._payload)}function lS(e){const t=FU(e),n=m.forwardRef((s,r)=>{let{children:i,...o}=s;oS(i)&&typeof Hh=="function"&&(i=Hh(i._payload));const l=m.Children.toArray(i),c=l.find(qU);if(c){const u=c.props.children,h=l.map(d=>d===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...o,ref:r,children:m.isValidElement(u)?m.cloneElement(u,void 0,h):null})}return a.jsx(t,{...o,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var IU=lS("Slot");function FU(e){const t=m.forwardRef((n,s)=>{let{children:r,...i}=n;if(oS(r)&&typeof Hh=="function"&&(r=Hh(r._payload)),m.isValidElement(r)){const o=XU(r),l=GU(i,r.props);return r.type!==m.Fragment&&(l.ref=s?Fr(s,o):o),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WU=Symbol("radix.slottable");function qU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WU}function GU(e,t){const n={...t};for(const s in t){const r=e[s],i=t[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{const c=i(...l);return r(...l),c}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function XU(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ZU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ei=ZU.reduce((e,t)=>{const n=lS(`Primitive.${t}`),s=m.forwardRef((r,i)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),Wl='[cmdk-group=""]',ax='[cmdk-group-items=""]',QU='[cmdk-group-heading=""]',cS='[cmdk-item=""]',uw=`${cS}:not([aria-disabled="true"])`,Y0="cmdk-item-select",ho="data-value",KU=(e,t,n)=>AR(e,t,n),dS=m.createContext(void 0),Td=()=>m.useContext(dS),uS=m.createContext(void 0),Up=()=>m.useContext(uS),hS=m.createContext(void 0),fS=m.forwardRef((e,t)=>{let n=fo(()=>{var O,B;return{search:"",value:(B=(O=e.value)!=null?O:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=fo(()=>new Set),r=fo(()=>new Map),i=fo(()=>new Map),o=fo(()=>new Set),l=mS(e),{label:c,children:u,value:h,onValueChange:d,filter:f,shouldFilter:x,loop:y,disablePointerSelection:b=!1,vimBindings:w=!0,...g}=e,v=Is(),p=Is(),j=Is(),N=m.useRef(null),C=c$();Pi(()=>{if(h!==void 0){let O=h.trim();n.current.value=O,S.emit()}},[h]),Pi(()=>{C(6,Y)},[]);let S=m.useMemo(()=>({subscribe:O=>(o.current.add(O),()=>o.current.delete(O)),snapshot:()=>n.current,setState:(O,B,X)=>{var Z,ne,ee,J;if(!Object.is(n.current[O],B)){if(n.current[O]=B,O==="search")z(),V(),C(1,$);else if(O==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(j);se?se.focus():(Z=document.getElementById(v))==null||Z.focus()}if(C(7,()=>{var se;n.current.selectedItemId=(se=E())==null?void 0:se.id,S.emit()}),X||C(5,Y),((ne=l.current)==null?void 0:ne.value)!==void 0){let se=B??"";(J=(ee=l.current).onValueChange)==null||J.call(ee,se);return}}S.emit()}},emit:()=>{o.current.forEach(O=>O())}}),[]),M=m.useMemo(()=>({value:(O,B,X)=>{var Z;B!==((Z=i.current.get(O))==null?void 0:Z.value)&&(i.current.set(O,{value:B,keywords:X}),n.current.filtered.items.set(O,A(B,X)),C(2,()=>{V(),S.emit()}))},item:(O,B)=>(s.current.add(O),B&&(r.current.has(B)?r.current.get(B).add(O):r.current.set(B,new Set([O]))),C(3,()=>{z(),V(),n.current.value||$(),S.emit()}),()=>{i.current.delete(O),s.current.delete(O),n.current.filtered.items.delete(O);let X=E();C(4,()=>{z(),(X==null?void 0:X.getAttribute("id"))===O&&$(),S.emit()})}),group:O=>(r.current.has(O)||r.current.set(O,new Set),()=>{i.current.delete(O),r.current.delete(O)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:v,inputId:j,labelId:p,listInnerRef:N}),[]);function A(O,B){var X,Z;let ne=(Z=(X=l.current)==null?void 0:X.filter)!=null?Z:KU;return O?ne(O,n.current.search,B):0}function V(){if(!n.current.search||l.current.shouldFilter===!1)return;let O=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(Z=>{let ne=r.current.get(Z),ee=0;ne.forEach(J=>{let se=O.get(J);ee=Math.max(se,ee)}),B.push([Z,ee])});let X=N.current;R().sort((Z,ne)=>{var ee,J;let se=Z.getAttribute("id"),pe=ne.getAttribute("id");return((ee=O.get(pe))!=null?ee:0)-((J=O.get(se))!=null?J:0)}).forEach(Z=>{let ne=Z.closest(ax);ne?ne.appendChild(Z.parentElement===ne?Z:Z.closest(`${ax} > *`)):X.appendChild(Z.parentElement===X?Z:Z.closest(`${ax} > *`))}),B.sort((Z,ne)=>ne[1]-Z[1]).forEach(Z=>{var ne;let ee=(ne=N.current)==null?void 0:ne.querySelector(`${Wl}[${ho}="${encodeURIComponent(Z[0])}"]`);ee==null||ee.parentElement.appendChild(ee)})}function $(){let O=R().find(X=>X.getAttribute("aria-disabled")!=="true"),B=O==null?void 0:O.getAttribute(ho);S.setState("value",B||void 0)}function z(){var O,B,X,Z;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=s.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let ee of s.current){let J=(B=(O=i.current.get(ee))==null?void 0:O.value)!=null?B:"",se=(Z=(X=i.current.get(ee))==null?void 0:X.keywords)!=null?Z:[],pe=A(J,se);n.current.filtered.items.set(ee,pe),pe>0&&ne++}for(let[ee,J]of r.current)for(let se of J)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=ne}function Y(){var O,B,X;let Z=E();Z&&(((O=Z.parentElement)==null?void 0:O.firstChild)===Z&&((X=(B=Z.closest(Wl))==null?void 0:B.querySelector(QU))==null||X.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function E(){var O;return(O=N.current)==null?void 0:O.querySelector(`${cS}[aria-selected="true"]`)}function R(){var O;return Array.from(((O=N.current)==null?void 0:O.querySelectorAll(uw))||[])}function T(O){let B=R()[O];B&&S.setState("value",B.getAttribute(ho))}function _(O){var B;let X=E(),Z=R(),ne=Z.findIndex(J=>J===X),ee=Z[ne+O];(B=l.current)!=null&&B.loop&&(ee=ne+O<0?Z[Z.length-1]:ne+O===Z.length?Z[0]:Z[ne+O]),ee&&S.setState("value",ee.getAttribute(ho))}function k(O){let B=E(),X=B==null?void 0:B.closest(Wl),Z;for(;X&&!Z;)X=O>0?o$(X,Wl):l$(X,Wl),Z=X==null?void 0:X.querySelector(uw);Z?S.setState("value",Z.getAttribute(ho)):_(O)}let D=()=>T(R().length-1),L=O=>{O.preventDefault(),O.metaKey?D():O.altKey?k(1):_(1)},q=O=>{O.preventDefault(),O.metaKey?T(0):O.altKey?k(-1):_(-1)};return m.createElement(ei.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:O=>{var B;(B=g.onKeyDown)==null||B.call(g,O);let X=O.nativeEvent.isComposing||O.keyCode===229;if(!(O.defaultPrevented||X))switch(O.key){case"n":case"j":{w&&O.ctrlKey&&L(O);break}case"ArrowDown":{L(O);break}case"p":case"k":{w&&O.ctrlKey&&q(O);break}case"ArrowUp":{q(O);break}case"Home":{O.preventDefault(),T(0);break}case"End":{O.preventDefault(),D();break}case"Enter":{O.preventDefault();let Z=E();if(Z){let ne=new Event(Y0);Z.dispatchEvent(ne)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:u$},c),Ff(e,O=>m.createElement(uS.Provider,{value:S},m.createElement(dS.Provider,{value:M},O))))}),JU=m.forwardRef((e,t)=>{var n,s;let r=Is(),i=m.useRef(null),o=m.useContext(hS),l=Td(),c=mS(e),u=(s=(n=c.current)==null?void 0:n.forceMount)!=null?s:o==null?void 0:o.forceMount;Pi(()=>{if(!u)return l.item(r,o==null?void 0:o.id)},[u]);let h=xS(r,i,[e.value,e.children,i],e.keywords),d=Up(),f=Xr(C=>C.value&&C.value===h.current),x=Xr(C=>u||l.filter()===!1?!0:C.search?C.filtered.items.get(r)>0:!0);m.useEffect(()=>{let C=i.current;if(!(!C||e.disabled))return C.addEventListener(Y0,y),()=>C.removeEventListener(Y0,y)},[x,e.onSelect,e.disabled]);function y(){var C,S;b(),(S=(C=c.current).onSelect)==null||S.call(C,h.current)}function b(){d.setState("value",h.current,!0)}if(!x)return null;let{disabled:w,value:g,onSelect:v,forceMount:p,keywords:j,...N}=e;return m.createElement(ei.div,{ref:Fr(i,t),...N,id:r,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!f,"data-disabled":!!w,"data-selected":!!f,onPointerMove:w||l.getDisablePointerSelection()?void 0:b,onClick:w?void 0:y},e.children)}),e$=m.forwardRef((e,t)=>{let{heading:n,children:s,forceMount:r,...i}=e,o=Is(),l=m.useRef(null),c=m.useRef(null),u=Is(),h=Td(),d=Xr(x=>r||h.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);Pi(()=>h.group(o),[]),xS(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:r}),[r]);return m.createElement(ei.div,{ref:Fr(l,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ff(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},m.createElement(hS.Provider,{value:f},x))))}),t$=m.forwardRef((e,t)=>{let{alwaysRender:n,...s}=e,r=m.useRef(null),i=Xr(o=>!o.search);return!n&&!i?null:m.createElement(ei.div,{ref:Fr(r,t),...s,"cmdk-separator":"",role:"separator"})}),n$=m.forwardRef((e,t)=>{let{onValueChange:n,...s}=e,r=e.value!=null,i=Up(),o=Xr(u=>u.search),l=Xr(u=>u.selectedItemId),c=Td();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(ei.input,{ref:t,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:r?e.value:o,onChange:u=>{r||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),s$=m.forwardRef((e,t)=>{let{children:n,label:s="Suggestions",...r}=e,i=m.useRef(null),o=m.useRef(null),l=Xr(u=>u.selectedItemId),c=Td();return m.useEffect(()=>{if(o.current&&i.current){let u=o.current,h=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let x=u.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),m.createElement(ei.div,{ref:Fr(i,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":s,id:c.listId},Ff(e,u=>m.createElement("div",{ref:Fr(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),a$=m.forwardRef((e,t)=>{let{open:n,onOpenChange:s,overlayClassName:r,contentClassName:i,container:o,...l}=e;return m.createElement(LU,{open:n,onOpenChange:s},m.createElement(PU,{container:o},m.createElement(HU,{"cmdk-overlay":"",className:r}),m.createElement(BU,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(fS,{ref:t,...l}))))}),r$=m.forwardRef((e,t)=>Xr(n=>n.filtered.count===0)?m.createElement(ei.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),i$=m.forwardRef((e,t)=>{let{progress:n,children:s,label:r="Loading...",...i}=e;return m.createElement(ei.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},Ff(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),ql=Object.assign(fS,{List:s$,Item:JU,Input:n$,Group:e$,Separator:t$,Dialog:a$,Empty:r$,Loading:i$});function o$(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function l$(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function mS(e){let t=m.useRef(e);return Pi(()=>{t.current=e}),t}var Pi=typeof window>"u"?m.useEffect:m.useLayoutEffect;function fo(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Xr(e){let t=Up(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function xS(e,t,n,s=[]){let r=m.useRef(),i=Td();return Pi(()=>{var o;let l=(()=>{var u;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():r.current}})(),c=s.map(u=>u.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(ho,l),r.current=l}),r}var c$=()=>{let[e,t]=m.useState(),n=fo(()=>new Map);return Pi(()=>{n.current.forEach(s=>s()),n.current=new Map},[e]),(s,r)=>{n.current.set(s,r),t({})}};function d$(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ff({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(d$(t),{ref:t.ref},n(t.props.children)):n(t)}var u$={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function h$({isOpen:e,onClose:t}){const n=Gs(),[s,r]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const x=await(await fetch("/api/plugins")).json();o(x)}catch{}})()},[]);const l=d=>i!=null&&i.plugins?i.plugins.some(f=>f.id===d):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:Ui,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:sa,action:()=>n("/organizations"),category:"Navigation",keywords:["org","company","team"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"sessions",title:"Sessions",description:"View active user sessions",icon:Dy,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"tools",title:"Tools",description:"View tools and utilities",icon:W4,action:()=>n("/tools"),category:"Navigation",keywords:["utilities","tools"]},{id:"database",title:"Database",description:"View database and schema",icon:Vt,disabled:!0,action:()=>n("/database"),category:"Navigation",keywords:["database","schema"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:Ho,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:Dy,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:A0,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:Pr,action:()=>n("/organizations"),category:"Actions",keywords:["add","new","org"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"},{id:"invite-user",title:"Invite User",description:"Send invitation to join organization",icon:Oh,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(d=>{var x;const f=s.toLowerCase();return d.title.toLowerCase().includes(f)||d.description.toLowerCase().includes(f)||((x=d.keywords)==null?void 0:x.some(y=>y.toLowerCase().includes(f)))}).reduce((d,f)=>(d[f.category]||(d[f.category]=[]),d[f.category].push(f),d),{});return m.useEffect(()=>{const d=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",d),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),e?a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:a.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:d=>d.stopPropagation(),children:a.jsxs(ql,{className:"p-2",children:[a.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[a.jsx(Ri,{className:"w-4 h-4 text-gray-400 mr-3"}),a.jsx(ql.Input,{value:s,onValueChange:r,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),a.jsx("kbd",{className:"hidden sm:inline-flex items-center px-2 py-1 text-xs text-gray-400 border border-dashed border-white/20 rounded-sm",children:"ESC"})]}),a.jsx(ql.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?a.jsxs("div",{className:"text-center py-8 text-gray-400",children:[a.jsx(Ri,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),a.jsx("p",{children:"No results found"}),a.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([d,f])=>a.jsx(ql.Group,{heading:d,className:"text-xs text-gray-400 font-medium mb-4 px-2",children:f.map(x=>{const y=x.icon,b=x.disabled;return a.jsxs(ql.Item,{value:x.id,disabled:b,onSelect:()=>{b||(x.action(),t())},className:`flex items-center space-x-3 px-0 py-2 rounded-none transition-colors relative ${b?"opacity-40 cursor-not-allowed blur-[0.5px]":"hover:bg-white/5 cursor-pointer"}`,children:[a.jsx(y,{className:"w-4 h-4 text-white"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[x.title,b&&a.jsx(Lu,{className:"w-3 h-3 text-yellow-500"})]}),a.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:b?x.disabledMessage:x.description})]}),!b&&a.jsx(x7,{className:"w-4 h-4 text-gray-400"})]},x.id)})},d))}),a.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const f$={connecting:{label:"Connecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},watching:{label:"Watching",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},refreshing:{label:"Refreshing",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"},up_to_date:{label:"Up-to-date",textClass:"text-emerald-200 border-emerald-400/40",dotClass:"bg-emerald-300"},error:{label:"Reload Failed",textClass:"text-red-200 border-red-500/50",dotClass:"bg-red-400",animate:"animate-pulse"},unavailable:{label:"Watch Off",textClass:"text-gray-300 border-gray-500/40",dotClass:"bg-gray-400"},reconnecting:{label:"Reconnecting",textClass:"text-amber-200 border-amber-400/40",dotClass:"bg-amber-300",animate:"animate-pulse"}};function m$(e){switch(e){case"refreshing":return"refreshing";case"error":return"error";case"up_to_date":case"watching":return"up_to_date";default:return"watching"}}function x$({children:e}){const t=jl(),{counts:n,loading:s}=Vf(),r=Gs(),[i,o]=m.useState(!1),[l,c]=m.useState("v1.0.0"),[u,h]=m.useState({status:"connecting"}),d=m.useRef(!1),f=m.useRef(null),x=m.useRef(!1),y=()=>{f.current&&(clearTimeout(f.current),f.current=null)},b=()=>{y(),f.current=setTimeout(()=>{d.current=!1,h(j=>({...j,status:"up_to_date",updatedAt:Date.now()}))},4e3)};m.useEffect(()=>{const j=N=>{(N.metaKey||N.ctrlKey)&&N.key==="k"&&(N.preventDefault(),o(!0))};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[]),m.useEffect(()=>((async()=>{var N;try{const S=await(await fetch("/api/config")).json();(N=S.studio)!=null&&N.version&&c(`v${S.studio.version}`)}catch{}})(),()=>{y()}),[]);const w=()=>{d.current=!1,x.current=!1,y(),h(j=>({...j,status:"refreshing",updatedAt:Date.now()})),window.location.reload()};U3(j=>{if(j.type==="studio_status"){const N=m$(j.status);N==="up_to_date"&&(d.current=!1,y()),h(C=>({status:N,fileName:j.fileName||C.fileName,updatedAt:j.updatedAt||Date.now()}));return}if(j.type==="config_change_detected"){d.current=!0,b(),h(N=>({...N,status:"refreshing",fileName:j.fileName||N.fileName,updatedAt:Date.now()})),x.current||(x.current=!0,setTimeout(()=>{w()},200));return}if(j.type==="config_changed"){d.current=!1,y(),h(N=>({...N,status:"up_to_date",fileName:j.fileName||N.fileName,updatedAt:j.changedAt||Date.now()}));return}j.type==="connected"&&(d.current=!1,y(),h(N=>({...N,status:"up_to_date",updatedAt:Date.now()})))},{onStatusChange:j=>{h(N=>{if(N.status==="refreshing"&&j!=="unavailable"&&j!=="open")return N;switch(j){case"connecting":return{...N,status:"connecting"};case"open":return y(),d.current?N:{...N,status:"watching",updatedAt:Date.now()};case"reconnecting":case"closed":return{...N,status:"reconnecting"};case"error":return{...N,status:"error"};case"unavailable":return d.current=!1,y(),{...N,status:"unavailable"};default:return N}})}});const g=f$[u.status],v=j=>j>=1e3?`${(j/1e3).toFixed(1).replace(/\.0$/,"")}k`:j.toString(),p=[{name:"Dashboard",href:"/",icon:w7},{name:"Users",href:"/users",icon:Ui,badge:s?"...":v(n.users)},{name:"Organizations",href:"/organizations",icon:sa,badge:s?"...":v(n.organizations)},{name:"Database",href:"/database",icon:Vt},{name:"Tools",href:"/tools",icon:W4},{name:"Settings",href:"/settings",icon:Ho}];return a.jsxs("div",{className:"min-h-screen bg-black",children:[a.jsx("div",{className:"bg-black/70 border-b border-white/15",children:a.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),a.jsx("div",{className:"mb-0 cursor-pointer",onClick:()=>r("/"),children:a.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white gap-2",children:["Better-Auth Studio",a.jsxs("sup",{className:"text-xs text-gray-400 ml-1 mt-0 flex items-center space-x-2",children:[a.jsxs("span",{className:"inline-flex items-center",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:l}),a.jsx("span",{className:"ml-1",children:"]"})]}),a.jsxs("span",{className:`inline-flex items-center rounded border px-1.5 py-0.5 font-normal uppercase tracking-wide text-[9px] ${g.textClass} ${g.animate??""}`,children:[a.jsx("span",{className:`mr-1 h-1.5 w-1.5 rounded-full ${g.dotClass}`}),g.label]}),a.jsx("button",{type:"button",onClick:w,"aria-label":"Hard refresh studio",className:"ml-1 inline-flex items-center rounded border border-dashed border-white/20 p-0.5 text-white/70 transition hover:text-white hover:border-white/50",children:a.jsx(_0,{className:"h-3.5 w-3.5"})})]})]})})]})}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Ri,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>o(!0),className:"pl-10 pr-4 py-2 bg-black border rounded-none border-gray-600 text-white border-dashed border-white/20 focus:ring-2 focus:ring-white focus:border-transparent transition-colors placeholder-gray-400 cursor-pointer",readOnly:!0}),a.jsx("kbd",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 border border-dashed border-white/10 rounded-sm px-1.5 py-0.5",children:"⌘ K"})]}),a.jsxs("a",{href:"https://better-auth-studio.vercel.app/docs",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Docs"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]}),a.jsxs("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",className:"group flex items-center",children:[a.jsx("span",{className:"text-white/70 text-xs mr-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-sm uppercase",children:"Support"}),a.jsx("span",{className:"text-white/70 text-xs ml-2 transition-colors duration-150 group-hover:text-white group-hover:bg-gray-500/20 rounded px-0.5",children:"]"})]})]})]})}),a.jsx("div",{className:"bg-black/50 border-b border-white/10",children:a.jsx("div",{className:"px-6",children:a.jsx("nav",{className:"flex space-x-8",children:p.map(j=>{const N=t.pathname===j.href;return a.jsxs(Qg,{to:j.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${N?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(j.icon,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:[j.name,j.badge&&a.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[a.jsx("span",{className:"mr-0.5",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:j.badge}),a.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},j.name)})})})}),a.jsx("div",{className:"flex-1 p-0",children:e}),a.jsx(h$,{isOpen:i,onClose:()=>o(!1)})]})}function Bh(e){"@babel/helpers - typeof";return Bh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bh(e)}function Hi(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Dn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function wa(e){Dn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Bh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function g$(e,t){Dn(2,arguments);var n=wa(e).getTime(),s=Hi(t);return new Date(n+s)}var p$={};function Wf(){return p$}function b$(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function v$(e){return Dn(1,arguments),e instanceof Date||Bh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function y$(e){if(Dn(1,arguments),!v$(e)&&typeof e!="number")return!1;var t=wa(e);return!isNaN(Number(t))}function w$(e,t){Dn(2,arguments);var n=Hi(t);return g$(e,-n)}var j$=864e5;function N$(e){Dn(1,arguments);var t=wa(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var s=t.getTime(),r=n-s;return Math.floor(r/j$)+1}function Vh(e){Dn(1,arguments);var t=1,n=wa(e),s=n.getUTCDay(),r=(s<t?7:0)+s-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function gS(e){Dn(1,arguments);var t=wa(e),n=t.getUTCFullYear(),s=new Date(0);s.setUTCFullYear(n+1,0,4),s.setUTCHours(0,0,0,0);var r=Vh(s),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=Vh(i);return t.getTime()>=r.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function S$(e){Dn(1,arguments);var t=gS(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var s=Vh(n);return s}var C$=6048e5;function k$(e){Dn(1,arguments);var t=wa(e),n=Vh(t).getTime()-S$(t).getTime();return Math.round(n/C$)+1}function Yh(e,t){var n,s,r,i,o,l,c,u;Dn(1,arguments);var h=Wf(),d=Hi((n=(s=(r=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:h.weekStartsOn)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=wa(e),x=f.getUTCDay(),y=(x<d?7:0)+x-d;return f.setUTCDate(f.getUTCDate()-y),f.setUTCHours(0,0,0,0),f}function pS(e,t){var n,s,r,i,o,l,c,u;Dn(1,arguments);var h=wa(e),d=h.getUTCFullYear(),f=Wf(),x=Hi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&s!==void 0?s:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(x>=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(d+1,0,x),y.setUTCHours(0,0,0,0);var b=Yh(y,t),w=new Date(0);w.setUTCFullYear(d,0,x),w.setUTCHours(0,0,0,0);var g=Yh(w,t);return h.getTime()>=b.getTime()?d+1:h.getTime()>=g.getTime()?d:d-1}function E$(e,t){var n,s,r,i,o,l,c,u;Dn(1,arguments);var h=Wf(),d=Hi((n=(s=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:h.firstWeekContainsDate)!==null&&s!==void 0?s:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=pS(e,t),x=new Date(0);x.setUTCFullYear(f,0,d),x.setUTCHours(0,0,0,0);var y=Yh(x,t);return y}var M$=6048e5;function T$(e,t){Dn(1,arguments);var n=wa(e),s=Yh(n,t).getTime()-E$(n,t).getTime();return Math.round(s/M$)+1}function ut(e,t){for(var n=e<0?"-":"",s=Math.abs(e).toString();s.length<t;)s="0"+s;return n+s}var hr={y:function(t,n){var s=t.getUTCFullYear(),r=s>0?s:1-s;return ut(n==="yy"?r%100:r,n.length)},M:function(t,n){var s=t.getUTCMonth();return n==="M"?String(s+1):ut(s+1,2)},d:function(t,n){return ut(t.getUTCDate(),n.length)},a:function(t,n){var s=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h:function(t,n){return ut(t.getUTCHours()%12||12,n.length)},H:function(t,n){return ut(t.getUTCHours(),n.length)},m:function(t,n){return ut(t.getUTCMinutes(),n.length)},s:function(t,n){return ut(t.getUTCSeconds(),n.length)},S:function(t,n){var s=n.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,s-3));return ut(i,n.length)}},ro={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},D$={G:function(t,n,s){var r=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(t,n,s){if(n==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return s.ordinalNumber(i,{unit:"year"})}return hr.y(t,n)},Y:function(t,n,s,r){var i=pS(t,r),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return ut(l,2)}return n==="Yo"?s.ordinalNumber(o,{unit:"year"}):ut(o,n.length)},R:function(t,n){var s=gS(t);return ut(s,n.length)},u:function(t,n){var s=t.getUTCFullYear();return ut(s,n.length)},Q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return ut(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,s){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return ut(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,s){var r=t.getUTCMonth();switch(n){case"M":case"MM":return hr.M(t,n);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,s){var r=t.getUTCMonth();switch(n){case"L":return String(r+1);case"LL":return ut(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,s,r){var i=T$(t,r);return n==="wo"?s.ordinalNumber(i,{unit:"week"}):ut(i,n.length)},I:function(t,n,s){var r=k$(t);return n==="Io"?s.ordinalNumber(r,{unit:"week"}):ut(r,n.length)},d:function(t,n,s){return n==="do"?s.ordinalNumber(t.getUTCDate(),{unit:"date"}):hr.d(t,n)},D:function(t,n,s){var r=N$(t);return n==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):ut(r,n.length)},E:function(t,n,s){var r=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return ut(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,s,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return ut(o,n.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,s){var r=t.getUTCDay(),i=r===0?7:r;switch(n){case"i":return String(i);case"ii":return ut(i,n.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,s){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(n){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,s){var r=t.getUTCHours(),i;switch(r===12?i=ro.noon:r===0?i=ro.midnight:i=r/12>=1?"pm":"am",n){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,s){var r=t.getUTCHours(),i;switch(r>=17?i=ro.evening:r>=12?i=ro.afternoon:r>=4?i=ro.morning:i=ro.night,n){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,s){if(n==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return hr.h(t,n)},H:function(t,n,s){return n==="Ho"?s.ordinalNumber(t.getUTCHours(),{unit:"hour"}):hr.H(t,n)},K:function(t,n,s){var r=t.getUTCHours()%12;return n==="Ko"?s.ordinalNumber(r,{unit:"hour"}):ut(r,n.length)},k:function(t,n,s){var r=t.getUTCHours();return r===0&&(r=24),n==="ko"?s.ordinalNumber(r,{unit:"hour"}):ut(r,n.length)},m:function(t,n,s){return n==="mo"?s.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):hr.m(t,n)},s:function(t,n,s){return n==="so"?s.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):hr.s(t,n)},S:function(t,n){return hr.S(t,n)},X:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return fw(o);case"XXXX":case"XX":return hi(o);case"XXXXX":case"XXX":default:return hi(o,":")}},x:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return fw(o);case"xxxx":case"xx":return hi(o);case"xxxxx":case"xxx":default:return hi(o,":")}},O:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+hw(o,":");case"OOOO":default:return"GMT"+hi(o,":")}},z:function(t,n,s,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+hw(o,":");case"zzzz":default:return"GMT"+hi(o,":")}},t:function(t,n,s,r){var i=r._originalDate||t,o=Math.floor(i.getTime()/1e3);return ut(o,n.length)},T:function(t,n,s,r){var i=r._originalDate||t,o=i.getTime();return ut(o,n.length)}};function hw(e,t){var n=e>0?"-":"+",s=Math.abs(e),r=Math.floor(s/60),i=s%60;if(i===0)return n+String(r);var o=t;return n+String(r)+o+ut(i,2)}function fw(e,t){if(e%60===0){var n=e>0?"-":"+";return n+ut(Math.abs(e)/60,2)}return hi(e,t)}function hi(e,t){var n=t||"",s=e>0?"-":"+",r=Math.abs(e),i=ut(Math.floor(r/60),2),o=ut(r%60,2);return s+i+n+o}var mw=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},bS=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},_$=function(t,n){var s=t.match(/(P+)(p+)?/)||[],r=s[1],i=s[2];if(!i)return mw(t,n);var o;switch(r){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",mw(r,n)).replace("{{time}}",bS(i,n))},A$={p:bS,P:_$},O$=["D","DD"],z$=["YY","YYYY"];function R$(e){return O$.indexOf(e)!==-1}function U$(e){return z$.indexOf(e)!==-1}function xw(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var $$={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"}},L$=function(t,n,s){var r,i=$$[t];return typeof i=="string"?r=i:n===1?r=i.one:r=i.other.replace("{{count}}",n.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function rx(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,s=e.formats[n]||e.formats[e.defaultWidth];return s}}var P$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},H$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},B$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},V$={date:rx({formats:P$,defaultWidth:"full"}),time:rx({formats:H$,defaultWidth:"full"}),dateTime:rx({formats:B$,defaultWidth:"full"})},Y$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},I$=function(t,n,s,r){return Y$[t]};function Gl(e){return function(t,n){var s=n!=null&&n.context?String(n.context):"standalone",r;if(s==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;r=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}var F$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},W$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},q$={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"]},G$={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"]},X$={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"}},Z$={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"}},Q$=function(t,n){var s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},K$={ordinalNumber:Q$,era:Gl({values:F$,defaultWidth:"wide"}),quarter:Gl({values:W$,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Gl({values:q$,defaultWidth:"wide"}),day:Gl({values:G$,defaultWidth:"wide"}),dayPeriod:Gl({values:X$,defaultWidth:"wide",formattingValues:Z$,defaultFormattingWidth:"wide"})};function Xl(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;var o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?eL(l,function(d){return d.test(o)}):J$(l,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;var h=t.slice(o.length);return{value:u,rest:h}}}function J$(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function eL(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function tL(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.match(e.matchPattern);if(!s)return null;var r=s[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var l=t.slice(r.length);return{value:o,rest:l}}}var nL=/^(\d+)(th|st|nd|rd)?/i,sL=/\d+/i,aL={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},rL={any:[/^b/i,/^(a|c)/i]},iL={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},oL={any:[/1/i,/2/i,/3/i,/4/i]},lL={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},cL={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]},dL={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},uL={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]},hL={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},fL={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}},mL={ordinalNumber:tL({matchPattern:nL,parsePattern:sL,valueCallback:function(t){return parseInt(t,10)}}),era:Xl({matchPatterns:aL,defaultMatchWidth:"wide",parsePatterns:rL,defaultParseWidth:"any"}),quarter:Xl({matchPatterns:iL,defaultMatchWidth:"wide",parsePatterns:oL,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Xl({matchPatterns:lL,defaultMatchWidth:"wide",parsePatterns:cL,defaultParseWidth:"any"}),day:Xl({matchPatterns:dL,defaultMatchWidth:"wide",parsePatterns:uL,defaultParseWidth:"any"}),dayPeriod:Xl({matchPatterns:hL,defaultMatchWidth:"any",parsePatterns:fL,defaultParseWidth:"any"})},xL={code:"en-US",formatDistance:L$,formatLong:V$,formatRelative:I$,localize:K$,match:mL,options:{weekStartsOn:0,firstWeekContainsDate:1}},gL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bL=/^'([^]*?)'?$/,vL=/''/g,yL=/[a-zA-Z]/;function fs(e,t,n){var s,r,i,o,l,c,u,h,d,f,x,y,b,w;Dn(2,arguments);var g=String(t),v=Wf(),p=(s=(r=void 0)!==null&&r!==void 0?r:v.locale)!==null&&s!==void 0?s:xL,j=Hi((i=(o=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:v.firstWeekContainsDate)!==null&&o!==void 0?o:(u=v.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(j>=1&&j<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=Hi((d=(f=(x=(y=void 0)!==null&&y!==void 0?y:void 0)!==null&&x!==void 0?x:v.weekStartsOn)!==null&&f!==void 0?f:(b=v.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&d!==void 0?d:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!p.localize)throw new RangeError("locale must contain localize property");if(!p.formatLong)throw new RangeError("locale must contain formatLong property");var C=wa(e);if(!y$(C))throw new RangeError("Invalid time value");var S=b$(C),M=w$(C,S),A={firstWeekContainsDate:j,weekStartsOn:N,locale:p,_originalDate:C},V=g.match(pL).map(function($){var z=$[0];if(z==="p"||z==="P"){var Y=A$[z];return Y($,p.formatLong)}return $}).join("").match(gL).map(function($){if($==="''")return"'";var z=$[0];if(z==="'")return wL($);var Y=D$[z];if(Y)return U$($)&&xw($,t,String(e)),R$($)&&xw($,t,String(e)),Y(M,$,p.localize,A);if(z.match(yL))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return $}).join("");return V}function wL(e){var t=e.match(bL);return t?t[1].replace(vL,"'"):e}const gw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,pw=zh,vS=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return pw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:i}=t,o=Object.keys(r).map(u=>{const h=n==null?void 0:n[u],d=i==null?void 0:i[u];if(h===null)return null;const f=gw(h)||gw(d);return r[u][f]}),l=n&&Object.entries(n).reduce((u,h)=>{let[d,f]=h;return f===void 0||(u[d]=f),u},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((u,h)=>{let{class:d,className:f,...x}=h;return Object.entries(x).every(y=>{let[b,w]=y;return Array.isArray(w)?w.includes({...i,...l}[b]):{...i,...l}[b]===w})?[...u,d,f]:u},[]);return pw(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},I0=vS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),H=m.forwardRef(({className:e,variant:t,size:n,asChild:s=!1,...r},i)=>{const o=s?IU:"button";return a.jsx(o,{className:Pe(I0({variant:t,size:n,className:e})),ref:i,...r})});H.displayName="Button";function jL(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const ix={},oc={};function gi(e,t){try{const s=(ix[e]||(ix[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return s in oc?oc[s]:bw(s,s.split(":"))}catch{if(e in oc)return oc[e];const n=e==null?void 0:e.match(NL);return n?bw(e,n.slice(1)):NaN}}const NL=/([+-]\d\d):?(\d\d)?/;function bw(e,t){const n=+(t[0]||0),s=+(t[1]||0),r=+(t[2]||0)/60;return oc[e]=n*60+s>0?n*60+s+r:n*60-s-r}class ca extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(gi(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),yS(this),F0(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new ca(...n,t):new ca(Date.now(),t)}withTimeZone(t){return new ca(+this,t)}getTimezoneOffset(){const t=-gi(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),F0(this),+this}[Symbol.for("constructDateFrom")](t){return new ca(+new Date(t),this.timeZone)}}const vw=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!vw.test(e))return;const t=e.replace(vw,"$1UTC");ca.prototype[t]&&(e.startsWith("get")?ca.prototype[e]=function(){return this.internal[t]()}:(ca.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),SL(this),+this},ca.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),F0(this),+this}))});function F0(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-gi(e.timeZone,e)*60))}function SL(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),yS(e)}function yS(e){const t=gi(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),s=new Date(+e);s.setUTCHours(s.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),i=-new Date(+s).getTimezoneOffset(),o=r-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=r-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const u=new Date(+e);u.setUTCSeconds(0);const h=r>0?u.getSeconds():(u.getSeconds()-60)%60,d=Math.round(-(gi(e.timeZone,e)*60))%60;(d||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+h));const f=gi(e.timeZone,e),x=f>0?Math.floor(f):Math.ceil(f),b=-new Date(+e).getTimezoneOffset()-x,w=x!==n,g=b-c;if(w&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const v=gi(e.timeZone,e),p=v>0?Math.floor(v):Math.ceil(v),j=x-p;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class wn extends ca{static tz(t,...n){return n.length?new wn(...n,t):new wn(Date.now(),t)}toISOString(){const[t,n,s]=this.tzComponents(),r=`${t}${n}:${s}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,s,r]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${s} ${n} ${r}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,s,r]=this.tzComponents();return`${t} GMT${n}${s}${r} (${jL(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",s=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),r=String(Math.abs(t)%60).padStart(2,"0");return[n,s,r]}withTimeZone(t){return new wn(+this,t)}[Symbol.for("constructDateFrom")](t){return new wn(+new Date(t),this.timeZone)}}const wS=6048e5,CL=864e5,yw=Symbol.for("constructDateFrom");function Kt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&yw in e?e[yw](t):e instanceof Date?new e.constructor(t):new Date(t)}function pt(e,t){return Kt(t||e,e)}function jS(e,t,n){const s=pt(e,n==null?void 0:n.in);return isNaN(t)?Kt(e,NaN):(t&&s.setDate(s.getDate()+t),s)}function NS(e,t,n){const s=pt(e,n==null?void 0:n.in);if(isNaN(t))return Kt(e,NaN);if(!t)return s;const r=s.getDate(),i=Kt(e,s.getTime());i.setMonth(s.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(s.setFullYear(i.getFullYear(),i.getMonth(),r),s)}let kL={};function Dd(){return kL}function hl(e,t){var l,c,u,h;const n=Dd(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=pt(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?7:0)+i-s;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function sd(e,t){return hl(e,{...t,weekStartsOn:1})}function SS(e,t){const n=pt(e,t==null?void 0:t.in),s=n.getFullYear(),r=Kt(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=sd(r),o=Kt(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const l=sd(o);return n.getTime()>=i.getTime()?s+1:n.getTime()>=l.getTime()?s:s-1}function ww(e){const t=pt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function El(e,...t){const n=Kt.bind(null,t.find(s=>typeof s=="object"));return t.map(n)}function ad(e,t){const n=pt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function CS(e,t,n){const[s,r]=El(n==null?void 0:n.in,e,t),i=ad(s),o=ad(r),l=+i-ww(i),c=+o-ww(o);return Math.round((l-c)/CL)}function EL(e,t){const n=SS(e,t),s=Kt(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),sd(s)}function ML(e,t,n){return jS(e,t*7,n)}function TL(e,t,n){return NS(e,t*12,n)}function DL(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=Kt.bind(null,r));const i=pt(r,s);(!n||n<i||isNaN(+i))&&(n=i)}),Kt(s,n||NaN)}function _L(e,t){let n,s=t==null?void 0:t.in;return e.forEach(r=>{!s&&typeof r=="object"&&(s=Kt.bind(null,r));const i=pt(r,s);(!n||n>i||isNaN(+i))&&(n=i)}),Kt(s,n||NaN)}function AL(e,t,n){const[s,r]=El(n==null?void 0:n.in,e,t);return+ad(s)==+ad(r)}function kS(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function OL(e){return!(!kS(e)&&typeof e!="number"||isNaN(+pt(e)))}function zL(e,t,n){const[s,r]=El(n==null?void 0:n.in,e,t),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function RL(e,t){const n=pt(e,t==null?void 0:t.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function ES(e,t){const[n,s]=El(e,t.start,t.end);return{start:n,end:s}}function UL(e,t){const{start:n,end:s}=ES(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(Kt(n,o)),o.setMonth(o.getMonth()+l);return r?c.reverse():c}function $L(e,t){const n=pt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function LL(e,t){const n=pt(e,t==null?void 0:t.in),s=n.getFullYear();return n.setFullYear(s+1,0,0),n.setHours(23,59,59,999),n}function MS(e,t){const n=pt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function PL(e,t){const{start:n,end:s}=ES(t==null?void 0:t.in,e);let r=+n>+s;const i=r?+n:+s,o=r?s:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(Kt(n,o)),o.setFullYear(o.getFullYear()+l);return r?c.reverse():c}function TS(e,t){var l,c,u,h;const n=Dd(),s=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.weekStartsOn)??0,r=pt(e,t==null?void 0:t.in),i=r.getDay(),o=(i<s?-7:0)+6-(i-s);return r.setDate(r.getDate()+o),r.setHours(23,59,59,999),r}function HL(e,t){return TS(e,{...t,weekStartsOn:1})}const BL={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"}},VL=(e,t,n)=>{let s;const r=BL[e];return typeof r=="string"?s=r:t===1?s=r.one:s=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function ox(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const YL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},IL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},WL={date:ox({formats:YL,defaultWidth:"full"}),time:ox({formats:IL,defaultWidth:"full"}),dateTime:ox({formats:FL,defaultWidth:"full"})},qL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},GL=(e,t,n,s)=>qL[e];function Zl(e){return(t,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let r;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;r=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return r[i]}}const XL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ZL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},QL={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"]},KL={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"]},JL={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"}},eP={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"}},tP=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},nP={ordinalNumber:tP,era:Zl({values:XL,defaultWidth:"wide"}),quarter:Zl({values:ZL,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Zl({values:QL,defaultWidth:"wide"}),day:Zl({values:KL,defaultWidth:"wide"}),dayPeriod:Zl({values:JL,defaultWidth:"wide",formattingValues:eP,defaultFormattingWidth:"wide"})};function Ql(e){return(t,n={})=>{const s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;const o=i[0],l=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?aP(l,d=>d.test(o)):sP(l,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const h=t.slice(o.length);return{value:u,rest:h}}}function sP(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function aP(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function rP(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const r=s[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(r.length);return{value:o,rest:l}}}const iP=/^(\d+)(th|st|nd|rd)?/i,oP=/\d+/i,lP={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},cP={any:[/^b/i,/^(a|c)/i]},dP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},uP={any:[/1/i,/2/i,/3/i,/4/i]},hP={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},fP={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]},mP={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},xP={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]},gP={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},pP={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}},bP={ordinalNumber:rP({matchPattern:iP,parsePattern:oP,valueCallback:e=>parseInt(e,10)}),era:Ql({matchPatterns:lP,defaultMatchWidth:"wide",parsePatterns:cP,defaultParseWidth:"any"}),quarter:Ql({matchPatterns:dP,defaultMatchWidth:"wide",parsePatterns:uP,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ql({matchPatterns:hP,defaultMatchWidth:"wide",parsePatterns:fP,defaultParseWidth:"any"}),day:Ql({matchPatterns:mP,defaultMatchWidth:"wide",parsePatterns:xP,defaultParseWidth:"any"}),dayPeriod:Ql({matchPatterns:gP,defaultMatchWidth:"any",parsePatterns:pP,defaultParseWidth:"any"})},$p={code:"en-US",formatDistance:VL,formatLong:WL,formatRelative:GL,localize:nP,match:bP,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vP(e,t){const n=pt(e,t==null?void 0:t.in);return CS(n,MS(n))+1}function DS(e,t){const n=pt(e,t==null?void 0:t.in),s=+sd(n)-+EL(n);return Math.round(s/wS)+1}function _S(e,t){var h,d,f,x;const n=pt(e,t==null?void 0:t.in),s=n.getFullYear(),r=Dd(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((x=(f=r.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=Kt((t==null?void 0:t.in)||e,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const l=hl(o,t),c=Kt((t==null?void 0:t.in)||e,0);c.setFullYear(s,0,i),c.setHours(0,0,0,0);const u=hl(c,t);return+n>=+l?s+1:+n>=+u?s:s-1}function yP(e,t){var l,c,u,h;const n=Dd(),s=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,r=_S(e,t),i=Kt((t==null?void 0:t.in)||e,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),hl(i,t)}function AS(e,t){const n=pt(e,t==null?void 0:t.in),s=+hl(n,t)-+yP(n,t);return Math.round(s/wS)+1}function ht(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const fr={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return ht(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ht(n+1,2)},d(e,t){return ht(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ht(e.getHours()%12||12,t.length)},H(e,t){return ht(e.getHours(),t.length)},m(e,t){return ht(e.getMinutes(),t.length)},s(e,t){return ht(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return ht(r,t.length)}},io={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},jw={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),r=s>0?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return fr.y(e,t)},Y:function(e,t,n,s){const r=_S(e,s),i=r>0?r:1-r;if(t==="YY"){const o=i%100;return ht(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):ht(i,t.length)},R:function(e,t){const n=SS(e);return ht(n,t.length)},u:function(e,t){const n=e.getFullYear();return ht(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return ht(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return ht(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return fr.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return ht(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const r=AS(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):ht(r,t.length)},I:function(e,t,n){const s=DS(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):ht(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):fr.d(e,t)},D:function(e,t,n){const s=vP(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ht(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ht(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ht(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),r=s===0?7:s;switch(t){case"i":return String(r);case"ii":return ht(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let r;switch(s===12?r=io.noon:s===0?r=io.midnight:r=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let r;switch(s>=17?r=io.evening:s>=12?r=io.afternoon:s>=4?r=io.morning:r=io.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return fr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):fr.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ht(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):ht(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):fr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):fr.s(e,t)},S:function(e,t){return fr.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Sw(s);case"XXXX":case"XX":return fi(s);case"XXXXX":case"XXX":default:return fi(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return Sw(s);case"xxxx":case"xx":return fi(s);case"xxxxx":case"xxx":default:return fi(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nw(s,":");case"OOOO":default:return"GMT"+fi(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nw(s,":");case"zzzz":default:return"GMT"+fi(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return ht(s,t.length)},T:function(e,t,n){return ht(+e,t.length)}};function Nw(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Math.trunc(s/60),i=s%60;return i===0?n+String(r):n+String(r)+t+ht(i,2)}function Sw(e,t){return e%60===0?(e>0?"-":"+")+ht(Math.abs(e)/60,2):fi(e,t)}function fi(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=ht(Math.trunc(s/60),2),i=ht(s%60,2);return n+r+t+i}const Cw=(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"})}},OS=(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"})}},wP=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return Cw(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Cw(s,t)).replace("{{time}}",OS(r,t))},jP={p:OS,P:wP},NP=/^D+$/,SP=/^Y+$/,CP=["D","DD","YY","YYYY"];function kP(e){return NP.test(e)}function EP(e){return SP.test(e)}function MP(e,t,n){const s=TP(e,t,n);if(console.warn(s),CP.includes(e))throw new RangeError(s)}function TP(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const DP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_P=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,AP=/^'([^]*?)'?$/,OP=/''/g,zP=/[a-zA-Z]/;function RP(e,t,n){var h,d,f,x,y,b,w,g;const s=Dd(),r=(n==null?void 0:n.locale)??s.locale??$p,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(f=s.locale)==null?void 0:f.options)==null?void 0:x.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((b=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??s.weekStartsOn??((g=(w=s.locale)==null?void 0:w.options)==null?void 0:g.weekStartsOn)??0,l=pt(e,n==null?void 0:n.in);if(!OL(l))throw new RangeError("Invalid time value");let c=t.match(_P).map(v=>{const p=v[0];if(p==="p"||p==="P"){const j=jP[p];return j(v,r.formatLong)}return v}).join("").match(DP).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const p=v[0];if(p==="'")return{isToken:!1,value:UP(v)};if(jw[p])return{isToken:!0,value:v};if(p.match(zP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:v}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return c.map(v=>{if(!v.isToken)return v.value;const p=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&EP(p)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&kP(p))&&MP(p,t,String(e));const j=jw[p[0]];return j(l,p,r.localize,u)}).join("")}function UP(e){const t=e.match(AP);return t?t[1].replace(OP,"'"):e}function $P(e,t){const n=pt(e,t==null?void 0:t.in),s=n.getFullYear(),r=n.getMonth(),i=Kt(n,0);return i.setFullYear(s,r+1,0),i.setHours(0,0,0,0),i.getDate()}function LP(e,t){return pt(e,t==null?void 0:t.in).getMonth()}function PP(e,t){return pt(e,t==null?void 0:t.in).getFullYear()}function HP(e,t){return+pt(e)>+pt(t)}function BP(e,t){return+pt(e)<+pt(t)}function VP(e,t,n){const[s,r]=El(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()&&s.getMonth()===r.getMonth()}function YP(e,t,n){const[s,r]=El(n==null?void 0:n.in,e,t);return s.getFullYear()===r.getFullYear()}function IP(e,t,n){const s=pt(e,n==null?void 0:n.in),r=s.getFullYear(),i=s.getDate(),o=Kt(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const l=$P(o);return s.setMonth(t,Math.min(i,l)),s}function FP(e,t,n){const s=pt(e,n==null?void 0:n.in);return isNaN(+s)?Kt(e,NaN):(s.setFullYear(t),s)}const kw=5,WP=4;function qP(e,t){const n=t.startOfMonth(e),s=n.getDay()>0?n.getDay():7,r=t.addDays(e,-s+1),i=t.addDays(r,kw*7-1);return t.getMonth(e)===t.getMonth(i)?kw:WP}function zS(e,t){const n=t.startOfMonth(e),s=n.getDay();return s===1?n:s===0?t.addDays(n,-1*6):t.addDays(n,-1*(s-1))}function GP(e,t){const n=zS(e,t),s=qP(e,t);return t.addDays(n,s*7-1)}class cs{constructor(t,n){this.Date=Date,this.today=()=>{var s;return(s=this.overrides)!=null&&s.today?this.overrides.today():this.options.timeZone?wn.tz(this.options.timeZone):new this.Date},this.newDate=(s,r,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(s,r,i):this.options.timeZone?new wn(s,r,i,this.options.timeZone):new Date(s,r,i)},this.addDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(s,r):jS(s,r)},this.addMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(s,r):NS(s,r)},this.addWeeks=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(s,r):ML(s,r)},this.addYears=(s,r)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(s,r):TL(s,r)},this.differenceInCalendarDays=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(s,r):CS(s,r)},this.differenceInCalendarMonths=(s,r)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(s,r):zL(s,r)},this.eachMonthOfInterval=s=>{var r;return(r=this.overrides)!=null&&r.eachMonthOfInterval?this.overrides.eachMonthOfInterval(s):UL(s)},this.eachYearOfInterval=s=>{var l;const r=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(s):PL(s),i=new Set(r.map(c=>this.getYear(c)));if(i.size===r.length)return r;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(s):GP(s,this)},this.endOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.endOfISOWeek?this.overrides.endOfISOWeek(s):HL(s)},this.endOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.endOfMonth?this.overrides.endOfMonth(s):RL(s)},this.endOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(s,r):TS(s,this.options)},this.endOfYear=s=>{var r;return(r=this.overrides)!=null&&r.endOfYear?this.overrides.endOfYear(s):LL(s)},this.format=(s,r,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(s,r,this.options):RP(s,r,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.getISOWeek?this.overrides.getISOWeek(s):DS(s)},this.getMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(s,this.options):LP(s,this.options)},this.getYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(s,this.options):PP(s,this.options)},this.getWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(s,this.options):AS(s,this.options)},this.isAfter=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(s,r):HP(s,r)},this.isBefore=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(s,r):BP(s,r)},this.isDate=s=>{var r;return(r=this.overrides)!=null&&r.isDate?this.overrides.isDate(s):kS(s)},this.isSameDay=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(s,r):AL(s,r)},this.isSameMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(s,r):VP(s,r)},this.isSameYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(s,r):YP(s,r)},this.max=s=>{var r;return(r=this.overrides)!=null&&r.max?this.overrides.max(s):DL(s)},this.min=s=>{var r;return(r=this.overrides)!=null&&r.min?this.overrides.min(s):_L(s)},this.setMonth=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(s,r):IP(s,r)},this.setYear=(s,r)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(s,r):FP(s,r)},this.startOfBroadcastWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(s,this):zS(s,this)},this.startOfDay=s=>{var r;return(r=this.overrides)!=null&&r.startOfDay?this.overrides.startOfDay(s):ad(s)},this.startOfISOWeek=s=>{var r;return(r=this.overrides)!=null&&r.startOfISOWeek?this.overrides.startOfISOWeek(s):sd(s)},this.startOfMonth=s=>{var r;return(r=this.overrides)!=null&&r.startOfMonth?this.overrides.startOfMonth(s):$L(s)},this.startOfWeek=(s,r)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(s,this.options):hl(s,this.options)},this.startOfYear=s=>{var r;return(r=this.overrides)!=null&&r.startOfYear?this.overrides.startOfYear(s):MS(s)},this.options={locale:$p,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),s={};for(let r=0;r<10;r++)s[r.toString()]=n.format(r);return s}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,s=>n[s]||s)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&cs.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:s,numerals:r}=this.options,i=n==null?void 0:n.code;if(i&&cs.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:s,numberingSystem:r}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}cs.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const ja=new cs;class RS{constructor(t,n,s=ja){this.date=t,this.displayMonth=n,this.outside=!!(n&&!s.isSameMonth(t,n)),this.dateLib=s}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class XP{constructor(t,n){this.date=t,this.weeks=n}}class ZP{constructor(t,n){this.days=n,this.weekNumber=t}}function QP(e){return K.createElement("button",{...e})}function KP(e){return K.createElement("span",{...e})}function JP(e){const{size:t=24,orientation:n="left",className:s}=e;return K.createElement("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&K.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&K.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&K.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&K.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function eH(e){const{day:t,modifiers:n,...s}=e;return K.createElement("td",{...s})}function tH(e){const{day:t,modifiers:n,...s}=e,r=K.useRef(null);return K.useEffect(()=>{var i;n.focused&&((i=r.current)==null||i.focus())},[n.focused]),K.createElement("button",{ref:r,...s})}var _e;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(_e||(_e={}));var Lt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Lt||(Lt={}));var Hs;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Hs||(Hs={}));var Zn;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Zn||(Zn={}));function nH(e){const{options:t,className:n,components:s,classNames:r,...i}=e,o=[r[_e.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return K.createElement("span",{"data-disabled":i.disabled,className:r[_e.DropdownRoot]},K.createElement(s.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:u,disabled:h})=>K.createElement(s.Option,{key:c,value:c,disabled:h},u))),K.createElement("span",{className:r[_e.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,K.createElement(s.Chevron,{orientation:"down",size:18,className:r[_e.Chevron]})))}function sH(e){return K.createElement("div",{...e})}function aH(e){return K.createElement("div",{...e})}function rH(e){const{calendarMonth:t,displayIndex:n,...s}=e;return K.createElement("div",{...s},e.children)}function iH(e){const{calendarMonth:t,displayIndex:n,...s}=e;return K.createElement("div",{...s})}function oH(e){return K.createElement("table",{...e})}function lH(e){return K.createElement("div",{...e})}const US=m.createContext(void 0);function _d(){const e=m.useContext(US);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function cH(e){const{components:t}=_d();return K.createElement(t.Dropdown,{...e})}function dH(e){const{onPreviousClick:t,onNextClick:n,previousMonth:s,nextMonth:r,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:u}}=_d(),h=m.useCallback(f=>{r&&(n==null||n(f))},[r,n]),d=m.useCallback(f=>{s&&(t==null||t(f))},[s,t]);return K.createElement("nav",{...i},K.createElement(o.PreviousMonthButton,{type:"button",className:l[_e.PreviousMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":c(s),onClick:d},K.createElement(o.Chevron,{disabled:s?void 0:!0,className:l[_e.Chevron],orientation:"left"})),K.createElement(o.NextMonthButton,{type:"button",className:l[_e.NextMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":u(r),onClick:h},K.createElement(o.Chevron,{disabled:r?void 0:!0,orientation:"right",className:l[_e.Chevron]})))}function uH(e){const{components:t}=_d();return K.createElement(t.Button,{...e})}function hH(e){return K.createElement("option",{...e})}function fH(e){const{components:t}=_d();return K.createElement(t.Button,{...e})}function mH(e){const{rootRef:t,...n}=e;return K.createElement("div",{...n,ref:t})}function xH(e){return K.createElement("select",{...e})}function gH(e){const{week:t,...n}=e;return K.createElement("tr",{...n})}function pH(e){return K.createElement("th",{...e})}function bH(e){return K.createElement("thead",{"aria-hidden":!0},K.createElement("tr",{...e}))}function vH(e){const{week:t,...n}=e;return K.createElement("th",{...n})}function yH(e){return K.createElement("th",{...e})}function wH(e){return K.createElement("tbody",{...e})}function jH(e){const{components:t}=_d();return K.createElement(t.Dropdown,{...e})}const NH=Object.freeze(Object.defineProperty({__proto__:null,Button:QP,CaptionLabel:KP,Chevron:JP,Day:eH,DayButton:tH,Dropdown:nH,DropdownNav:sH,Footer:aH,Month:rH,MonthCaption:iH,MonthGrid:oH,Months:lH,MonthsDropdown:cH,Nav:dH,NextMonthButton:uH,Option:hH,PreviousMonthButton:fH,Root:mH,Select:xH,Week:gH,WeekNumber:vH,WeekNumberHeader:yH,Weekday:pH,Weekdays:bH,Weeks:wH,YearsDropdown:jH},Symbol.toStringTag,{value:"Module"}));function Ba(e,t,n=!1,s=ja){let{from:r,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=s;return r&&i?(o(i,r)<0&&([r,i]=[i,r]),o(t,r)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&r?l(r,t):!1}function $S(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Lp(e){return!!(e&&typeof e=="object"&&"from"in e)}function LS(e){return!!(e&&typeof e=="object"&&"after"in e)}function PS(e){return!!(e&&typeof e=="object"&&"before"in e)}function HS(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function BS(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Va(e,t,n=ja){const s=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:i,isAfter:o}=n;return s.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return r(e,l);if(BS(l,n))return l.includes(e);if(Lp(l))return Ba(l,e,!1,n);if(HS(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if($S(l)){const c=i(l.before,e),u=i(l.after,e),h=c>0,d=u<0;return o(l.before,l.after)?d&&h:h||d}return LS(l)?i(e,l.after)>0:PS(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function SH(e,t,n,s,r){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:u,today:h}=t,{isSameDay:d,isSameMonth:f,startOfMonth:x,isBefore:y,endOfMonth:b,isAfter:w}=r,g=n&&x(n),v=s&&b(s),p={[Lt.focused]:[],[Lt.outside]:[],[Lt.disabled]:[],[Lt.hidden]:[],[Lt.today]:[]},j={};for(const N of e){const{date:C,displayMonth:S}=N,M=!!(S&&!f(C,S)),A=!!(g&&y(C,g)),V=!!(v&&w(C,v)),$=!!(i&&Va(C,i,r)),z=!!(o&&Va(C,o,r))||A||V||!u&&!c&&M||u&&c===!1&&M,Y=d(C,h??r.today());M&&p.outside.push(N),$&&p.disabled.push(N),z&&p.hidden.push(N),Y&&p.today.push(N),l&&Object.keys(l).forEach(E=>{const R=l==null?void 0:l[E];R&&Va(C,R,r)&&(j[E]?j[E].push(N):j[E]=[N])})}return N=>{const C={[Lt.focused]:!1,[Lt.disabled]:!1,[Lt.hidden]:!1,[Lt.outside]:!1,[Lt.today]:!1},S={};for(const M in p){const A=p[M];C[M]=A.some(V=>V===N)}for(const M in j)S[M]=j[M].some(A=>A===N);return{...C,...S}}}function CH(e,t,n={}){return Object.entries(e).filter(([,r])=>r===!0).reduce((r,[i])=>(n[i]?r.push(n[i]):t[Lt[i]]?r.push(t[Lt[i]]):t[Hs[i]]&&r.push(t[Hs[i]]),r),[t[_e.Day]])}function kH(e){return{...NH,...e}}function EH(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,s])=>{n.startsWith("data-")&&(t[n]=s)}),t}function Pp(){const e={};for(const t in _e)e[_e[t]]=`rdp-${_e[t]}`;for(const t in Lt)e[Lt[t]]=`rdp-${Lt[t]}`;for(const t in Hs)e[Hs[t]]=`rdp-${Hs[t]}`;for(const t in Zn)e[Zn[t]]=`rdp-${Zn[t]}`;return e}function VS(e,t,n){return(n??new cs(t)).formatMonthYear(e)}const MH=VS;function TH(e,t,n){return(n??new cs(t)).format(e,"d")}function DH(e,t=ja){return t.format(e,"LLLL")}function _H(e,t,n){return(n??new cs(t)).format(e,"cccccc")}function AH(e,t=ja){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function OH(){return""}function YS(e,t=ja){return t.format(e,"yyyy")}const zH=YS,RH=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:VS,formatDay:TH,formatMonthCaption:MH,formatMonthDropdown:DH,formatWeekNumber:AH,formatWeekNumberHeader:OH,formatWeekdayName:_H,formatYearCaption:zH,formatYearDropdown:YS},Symbol.toStringTag,{value:"Module"}));function UH(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...RH,...e}}function $H(e,t,n,s,r){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:u}=r;return c({start:o(e),end:l(e)}).map(f=>{const x=s.formatMonthDropdown(f,r),y=u(f),b=t&&f<i(t)||n&&f>i(n)||!1;return{value:y,label:x,disabled:b}})}function LH(e,t={},n={}){let s={...t==null?void 0:t[_e.Day]};return Object.entries(e).filter(([,r])=>r===!0).forEach(([r])=>{s={...s,...n==null?void 0:n[r]}}),s}function PH(e,t,n){const s=e.today(),r=t?e.startOfISOWeek(s):e.startOfWeek(s),i=[];for(let o=0;o<7;o++){const l=e.addDays(r,o);i.push(l)}return i}function HH(e,t,n,s,r=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=s,u=i(e),h=o(t),d=l({start:u,end:h});return r&&d.reverse(),d.map(f=>{const x=n.formatYearDropdown(f,s);return{value:c(f),label:x,disabled:!1}})}function IS(e,t,n,s){let r=(s??new cs(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const BH=IS;function FS(e,t,n){return(n??new cs(t)).formatMonthYear(e)}const VH=FS;function YH(e,t,n,s){let r=(s??new cs(n)).format(e,"PPPP");return t!=null&&t.today&&(r=`Today, ${r}`),r}function IH(e){return"Choose the Month"}function FH(){return""}function WH(e){return"Go to the Next Month"}function qH(e){return"Go to the Previous Month"}function GH(e,t,n){return(n??new cs(t)).format(e,"cccc")}function XH(e,t){return`Week ${e}`}function ZH(e){return"Week Number"}function QH(e){return"Choose the Year"}const KH=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:VH,labelDay:BH,labelDayButton:IS,labelGrid:FS,labelGridcell:YH,labelMonthDropdown:IH,labelNav:FH,labelNext:WH,labelPrevious:qH,labelWeekNumber:XH,labelWeekNumberHeader:ZH,labelWeekday:GH,labelYearDropdown:QH},Symbol.toStringTag,{value:"Module"})),Ad=e=>e instanceof HTMLElement?e:null,lx=e=>[...e.querySelectorAll("[data-animated-month]")??[]],JH=e=>Ad(e.querySelector("[data-animated-month]")),cx=e=>Ad(e.querySelector("[data-animated-caption]")),dx=e=>Ad(e.querySelector("[data-animated-weeks]")),eB=e=>Ad(e.querySelector("[data-animated-nav]")),tB=e=>Ad(e.querySelector("[data-animated-weekdays]"));function nB(e,t,{classNames:n,months:s,focused:r,dateLib:i}){const o=m.useRef(null),l=m.useRef(s),c=m.useRef(!1);m.useLayoutEffect(()=>{const u=l.current;if(l.current=s,!t||!e.current||!(e.current instanceof HTMLElement)||s.length===0||u.length===0||s.length!==u.length)return;const h=i.isSameMonth(s[0].date,u[0].date),d=i.isAfter(s[0].date,u[0].date),f=d?n[Zn.caption_after_enter]:n[Zn.caption_before_enter],x=d?n[Zn.weeks_after_enter]:n[Zn.weeks_before_enter],y=o.current,b=e.current.cloneNode(!0);if(b instanceof HTMLElement?(lx(b).forEach(p=>{if(!(p instanceof HTMLElement))return;const j=JH(p);j&&p.contains(j)&&p.removeChild(j);const N=cx(p);N&&N.classList.remove(f);const C=dx(p);C&&C.classList.remove(x)}),o.current=b):o.current=null,c.current||h||r)return;const w=y instanceof HTMLElement?lx(y):[],g=lx(e.current);if(g!=null&&g.every(v=>v instanceof HTMLElement)&&w&&w.every(v=>v instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const v=eB(e.current);v&&(v.style.zIndex="1"),g.forEach((p,j)=>{const N=w[j];if(!N)return;p.style.position="relative",p.style.overflow="hidden";const C=cx(p);C&&C.classList.add(f);const S=dx(p);S&&S.classList.add(x);const M=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),v&&(v.style.zIndex=""),C&&C.classList.remove(f),S&&S.classList.remove(x),p.style.position="",p.style.overflow="",p.contains(N)&&p.removeChild(N)};N.style.pointerEvents="none",N.style.position="absolute",N.style.overflow="hidden",N.setAttribute("aria-hidden","true");const A=tB(N);A&&(A.style.opacity="0");const V=cx(N);V&&(V.classList.add(d?n[Zn.caption_before_exit]:n[Zn.caption_after_exit]),V.addEventListener("animationend",M));const $=dx(N);$&&$.classList.add(d?n[Zn.weeks_before_exit]:n[Zn.weeks_after_exit]),p.insertBefore(N,p.firstChild)})}})}function sB(e,t,n,s){const r=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:u,differenceInCalendarDays:h,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:x,endOfMonth:y,endOfWeek:b,isAfter:w,startOfBroadcastWeek:g,startOfISOWeek:v,startOfWeek:p}=s,j=c?g(r,s):o?v(r):p(r),N=c?f(i):o?x(y(i)):b(y(i)),C=h(N,j),S=d(i,r)+1,M=[];for(let $=0;$<=C;$++){const z=u(j,$);if(t&&w(z,t))break;M.push(z)}const V=(c?35:42)*S;if(l&&M.length<V){const $=V-M.length;for(let z=0;z<$;z++){const Y=u(M[M.length-1],1);M.push(Y)}}return M}function aB(e){const t=[];return e.reduce((n,s)=>{const r=s.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(r.slice())},t.slice())}function rB(e,t,n,s){const{numberOfMonths:r=1}=n,i=[];for(let o=0;o<r;o++){const l=s.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function Ew(e,t,n,s){const{month:r,defaultMonth:i,today:o=s.today(),numberOfMonths:l=1}=e;let c=r||i||o;const{differenceInCalendarMonths:u,addMonths:h,startOfMonth:d}=s;if(n&&u(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&u(c,t)<0&&(c=t),d(c)}function iB(e,t,n,s){const{addDays:r,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:u,getWeek:h,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:x}=s,y=e.reduce((b,w)=>{const g=n.broadcastCalendar?d(w,s):n.ISOWeek?f(w):x(w),v=n.broadcastCalendar?i(w):n.ISOWeek?o(l(w)):c(l(w)),p=t.filter(S=>S>=g&&S<=v),j=n.broadcastCalendar?35:42;if(n.fixedWeeks&&p.length<j){const S=t.filter(M=>{const A=j-p.length;return M>v&&M<=r(v,A)});p.push(...S)}const N=p.reduce((S,M)=>{const A=n.ISOWeek?u(M):h(M),V=S.find(z=>z.weekNumber===A),$=new RS(M,w,s);return V?V.days.push($):S.push(new ZP(A,[$])),S},[]),C=new XP(w,N);return b.push(C),b},[]);return n.reverseMonths?y.reverse():y}function oB(e,t){let{startMonth:n,endMonth:s}=e;const{startOfYear:r,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:u,newDate:h,today:d}=t,{fromYear:f,toYear:x,fromMonth:y,toMonth:b}=e;!n&&y&&(n=y),!n&&f&&(n=t.newDate(f,0,1)),!s&&b&&(s=b),!s&&x&&(s=h(x,11,31));const w=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&w&&(n=r(c(e.today??d(),-100))),s?s=l(s):x?s=h(x,11,31):!s&&w&&(s=u(e.today??d())),[n&&i(n),s&&i(s)]}function lB(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i:1,h=o(e);if(!t)return l(h,u);if(!(c(t,e)<i))return l(h,u)}function cB(e,t,n,s){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=s,u=r?i??1:1,h=o(e);if(!t)return l(h,-u);if(!(c(h,t)<=0))return l(h,-u)}function dB(e){const t=[];return e.reduce((n,s)=>n.concat(s.weeks.slice()),t.slice())}function qf(e,t){const[n,s]=m.useState(e);return[t===void 0?n:t,s]}function uB(e,t){const[n,s]=oB(e,t),{startOfMonth:r,endOfMonth:i}=t,o=Ew(e,n,s,t),[l,c]=qf(o,e.month?o:void 0);m.useEffect(()=>{const C=Ew(e,n,s,t);c(C)},[e.timeZone]);const u=rB(l,s,e,t),h=sB(u,e.endMonth?i(e.endMonth):void 0,e,t),d=iB(u,h,e,t),f=dB(d),x=aB(d),y=cB(l,n,e,t),b=lB(l,s,e,t),{disableNavigation:w,onMonthChange:g}=e,v=C=>f.some(S=>S.days.some(M=>M.isEqualTo(C))),p=C=>{if(w)return;let S=r(C);n&&S<r(n)&&(S=r(n)),s&&S>r(s)&&(S=r(s)),c(S),g==null||g(S)};return{months:d,weeks:f,days:x,navStart:n,navEnd:s,previousMonth:y,nextMonth:b,goToMonth:p,goToDay:C=>{v(C)||p(C.date)}}}var na;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(na||(na={}));function Mw(e){return!e[Lt.disabled]&&!e[Lt.hidden]&&!e[Lt.outside]}function hB(e,t,n,s){let r,i=-1;for(const o of e){const l=t(o);Mw(l)&&(l[Lt.focused]&&i<na.FocusedModifier?(r=o,i=na.FocusedModifier):s!=null&&s.isEqualTo(o)&&i<na.LastFocused?(r=o,i=na.LastFocused):n(o.date)&&i<na.Selected?(r=o,i=na.Selected):l[Lt.today]&&i<na.Today&&(r=o,i=na.Today))}return r||(r=e.find(o=>Mw(t(o)))),r}function fB(e,t,n,s,r,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:u,addMonths:h,addWeeks:d,addYears:f,endOfBroadcastWeek:x,endOfISOWeek:y,endOfWeek:b,max:w,min:g,startOfBroadcastWeek:v,startOfISOWeek:p,startOfWeek:j}=o;let C={day:u,week:d,month:h,year:f,startOfWeek:S=>c?v(S,o):l?p(S):j(S),endOfWeek:S=>c?x(S):l?y(S):b(S)}[e](n,t==="after"?1:-1);return t==="before"&&s?C=w([s,C]):t==="after"&&r&&(C=g([r,C])),C}function WS(e,t,n,s,r,i,o,l=0){if(l>365)return;const c=fB(e,t,n.date,s,r,i,o),u=!!(i.disabled&&Va(c,i.disabled,o)),h=!!(i.hidden&&Va(c,i.hidden,o)),d=c,f=new RS(c,d,o);return!u&&!h?f:WS(e,t,f,s,r,i,o,l+1)}function mB(e,t,n,s,r){const{autoFocus:i}=e,[o,l]=m.useState(),c=hB(t.days,n,s||(()=>!1),o),[u,h]=m.useState(i?c:void 0);return{isFocusTarget:b=>!!(c!=null&&c.isEqualTo(b)),setFocused:h,focused:u,blur:()=>{l(u),h(void 0)},moveFocus:(b,w)=>{if(!u)return;const g=WS(b,w,u,t.navStart,t.navEnd,e,r);g&&(e.disableNavigation&&!t.days.some(p=>p.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function xB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=qf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t,u=x=>(l==null?void 0:l.some(y=>c(y,x)))??!1,{min:h,max:d}=e;return{selected:l,select:(x,y,b)=>{let w=[...l??[]];if(u(x)){if((l==null?void 0:l.length)===h||s&&(l==null?void 0:l.length)===1)return;w=l==null?void 0:l.filter(g=>!c(g,x))}else(l==null?void 0:l.length)===d?w=[x]:w=[...w,x];return r||o(w),r==null||r(w,x,y,b),w},isSelected:u}}function gB(e,t,n=0,s=0,r=!1,i=ja){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:u,isBefore:h}=i;let d;if(!o&&!l)d={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?d={from:o,to:e}:r?d={from:o,to:void 0}:d=void 0:h(e,o)?d={from:e,to:o}:d={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))r?d={from:o,to:l}:d=void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(l,e))d={from:e,to:n>0?void 0:e};else if(h(e,o))d={from:e,to:l};else if(u(e,o))d={from:o,to:e};else if(u(e,l))d={from:o,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const f=i.differenceInCalendarDays(d.to,d.from);s>0&&f>s?d={from:e,to:void 0}:n>1&&f<n&&(d={from:e,to:void 0})}return d}function pB(e,t,n=ja){const s=Array.isArray(t)?t:[t];let r=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(s.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}function Tw(e,t,n=ja){return Ba(e,t.from,!1,n)||Ba(e,t.to,!1,n)||Ba(t,e.from,!1,n)||Ba(t,e.to,!1,n)}function bB(e,t,n=ja){const s=Array.isArray(t)?t:[t];if(s.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Ba(e,l,!1,n):BS(l,n)?l.some(c=>Ba(e,c,!1,n)):Lp(l)?l.from&&l.to?Tw(e,{from:l.from,to:l.to},n):!1:HS(l)?pB(e,l.dayOfWeek,n):$S(l)?n.isAfter(l.before,l.after)?Tw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Va(e.from,l,n)||Va(e.to,l,n):LS(l)||PS(l)?Va(e.from,l,n)||Va(e.to,l,n):!1))return!0;const o=s.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let u=0;u<=c;u++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function vB(e,t){const{disabled:n,excludeDisabled:s,selected:r,required:i,onSelect:o}=e,[l,c]=qf(r,o?r:void 0),u=o?r:l;return{selected:u,select:(f,x,y)=>{const{min:b,max:w}=e,g=f?gB(f,u,b,w,i,t):void 0;return s&&n&&(g!=null&&g.from)&&g.to&&bB({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,x,y),g},isSelected:f=>u&&Ba(u,f,!1,t)}}function yB(e,t){const{selected:n,required:s,onSelect:r}=e,[i,o]=qf(n,r?n:void 0),l=r?n:i,{isSameDay:c}=t;return{selected:l,select:(d,f,x)=>{let y=d;return!s&&l&&l&&c(d,l)&&(y=void 0),r||o(y),r==null||r(y,d,f,x),y},isSelected:d=>l?c(l,d):!1}}function wB(e,t){const n=yB(e,t),s=xB(e,t),r=vB(e,t);switch(e.mode){case"single":return n;case"multiple":return s;case"range":return r;default:return}}function jB(e){var G;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new wn(t.today,t.timeZone)),t.month&&(t.month=new wn(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new wn(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new wn(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new wn(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new wn(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(G=t.selected)==null?void 0:G.map(ae=>new wn(ae,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new wn(t.selected.from,t.timeZone):void 0,to:t.selected.to?new wn(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:s,labels:r,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const ae={...$p,...t.locale};return{dateLib:new cs({locale:ae,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:kH(t.components),formatters:UH(t.formatters),labels:{...KH,...t.labels},locale:ae,classNames:{...Pp(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:u,navLayout:h,numberOfMonths:d=1,onDayBlur:f,onDayClick:x,onDayFocus:y,onDayKeyDown:b,onDayMouseEnter:w,onDayMouseLeave:g,onNextClick:v,onPrevClick:p,showWeekNumber:j,styles:N}=t,{formatCaption:C,formatDay:S,formatMonthDropdown:M,formatWeekNumber:A,formatWeekNumberHeader:V,formatWeekdayName:$,formatYearDropdown:z}=s,Y=uB(t,i),{days:E,months:R,navStart:T,navEnd:_,previousMonth:k,nextMonth:D,goToMonth:L}=Y,q=SH(E,t,T,_,i),{isSelected:O,select:B,selected:X}=wB(t,i)??{},{blur:Z,focused:ne,isFocusTarget:ee,moveFocus:J,setFocused:se}=mB(t,Y,q,O??(()=>!1),i),{labelDayButton:pe,labelGridcell:re,labelGrid:he,labelMonthDropdown:fe,labelNav:ke,labelPrevious:Oe,labelNext:Re,labelWeekday:Be,labelWeekNumber:dt,labelWeekNumberHeader:Ie,labelYearDropdown:St}=r,bt=m.useMemo(()=>PH(i,t.ISOWeek),[i,t.ISOWeek]),qe=u!==void 0||x!==void 0,et=m.useCallback(()=>{k&&(L(k),p==null||p(k))},[k,L,p]),Qe=m.useCallback(()=>{D&&(L(D),v==null||v(D))},[L,D,v]),vt=m.useCallback((ae,ye)=>de=>{de.preventDefault(),de.stopPropagation(),se(ae),B==null||B(ae.date,ye,de),x==null||x(ae.date,ye,de)},[B,x,se]),yt=m.useCallback((ae,ye)=>de=>{se(ae),y==null||y(ae.date,ye,de)},[y,se]),Ht=m.useCallback((ae,ye)=>de=>{Z(),f==null||f(ae.date,ye,de)},[Z,f]),It=m.useCallback((ae,ye)=>de=>{const Se={ArrowLeft:[de.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[de.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[de.shiftKey?"year":"week","after"],ArrowUp:[de.shiftKey?"year":"week","before"],PageUp:[de.shiftKey?"year":"month","before"],PageDown:[de.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Se[de.key]){de.preventDefault(),de.stopPropagation();const[W,F]=Se[de.key];J(W,F)}b==null||b(ae.date,ye,de)},[J,b,t.dir]),te=m.useCallback((ae,ye)=>de=>{w==null||w(ae.date,ye,de)},[w]),be=m.useCallback((ae,ye)=>de=>{g==null||g(ae.date,ye,de)},[g]),He=m.useCallback(ae=>ye=>{const de=Number(ye.target.value),Se=i.setMonth(i.startOfMonth(ae),de);L(Se)},[i,L]),I=m.useCallback(ae=>ye=>{const de=Number(ye.target.value),Se=i.setYear(i.startOfMonth(ae),de);L(Se)},[i,L]),{className:le,style:ue}=m.useMemo(()=>({className:[l[_e.Root],t.className].filter(Boolean).join(" "),style:{...N==null?void 0:N[_e.Root],...t.style}}),[l,t.className,t.style,N]),xe=EH(t),Te=m.useRef(null);nB(Te,!!t.animate,{classNames:l,months:R,focused:ne,dateLib:i});const We={dayPickerProps:t,selected:X,select:B,isSelected:O,months:R,nextMonth:D,previousMonth:k,goToMonth:L,getModifiers:q,components:n,classNames:l,styles:N,labels:r,formatters:s};return K.createElement(US.Provider,{value:We},K.createElement(n.Root,{rootRef:t.animate?Te:void 0,className:le,style:ue,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...xe},K.createElement(n.Months,{className:l[_e.Months],style:N==null?void 0:N[_e.Months]},!t.hideNavigation&&!h&&K.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[_e.Nav],style:N==null?void 0:N[_e.Nav],"aria-label":ke(),onPreviousClick:et,onNextClick:Qe,previousMonth:k,nextMonth:D}),R.map((ae,ye)=>K.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[_e.Month],style:N==null?void 0:N[_e.Month],key:ye,displayIndex:ye,calendarMonth:ae},h==="around"&&!t.hideNavigation&&ye===0&&K.createElement(n.PreviousMonthButton,{type:"button",className:l[_e.PreviousMonthButton],tabIndex:k?void 0:-1,"aria-disabled":k?void 0:!0,"aria-label":Oe(k),onClick:et,"data-animated-button":t.animate?"true":void 0},K.createElement(n.Chevron,{disabled:k?void 0:!0,className:l[_e.Chevron],orientation:t.dir==="rtl"?"right":"left"})),K.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[_e.MonthCaption],style:N==null?void 0:N[_e.MonthCaption],calendarMonth:ae,displayIndex:ye},c!=null&&c.startsWith("dropdown")?K.createElement(n.DropdownNav,{className:l[_e.Dropdowns],style:N==null?void 0:N[_e.Dropdowns]},(()=>{const de=c==="dropdown"||c==="dropdown-months"?K.createElement(n.MonthsDropdown,{key:"month",className:l[_e.MonthsDropdown],"aria-label":fe(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:He(ae.date),options:$H(ae.date,T,_,s,i),style:N==null?void 0:N[_e.Dropdown],value:i.getMonth(ae.date)}):K.createElement("span",{key:"month"},M(ae.date,i)),Se=c==="dropdown"||c==="dropdown-years"?K.createElement(n.YearsDropdown,{key:"year",className:l[_e.YearsDropdown],"aria-label":St(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:I(ae.date),options:HH(T,_,s,i,!!t.reverseYears),style:N==null?void 0:N[_e.Dropdown],value:i.getYear(ae.date)}):K.createElement("span",{key:"year"},z(ae.date,i));return i.getMonthYearOrder()==="year-first"?[Se,de]:[de,Se]})(),K.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},C(ae.date,i.options,i))):K.createElement(n.CaptionLabel,{className:l[_e.CaptionLabel],role:"status","aria-live":"polite"},C(ae.date,i.options,i))),h==="around"&&!t.hideNavigation&&ye===d-1&&K.createElement(n.NextMonthButton,{type:"button",className:l[_e.NextMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":Re(D),onClick:Qe,"data-animated-button":t.animate?"true":void 0},K.createElement(n.Chevron,{disabled:D?void 0:!0,className:l[_e.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ye===d-1&&h==="after"&&!t.hideNavigation&&K.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[_e.Nav],style:N==null?void 0:N[_e.Nav],"aria-label":ke(),onPreviousClick:et,onNextClick:Qe,previousMonth:k,nextMonth:D}),K.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":he(ae.date,i.options,i)||void 0,className:l[_e.MonthGrid],style:N==null?void 0:N[_e.MonthGrid]},!t.hideWeekdays&&K.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[_e.Weekdays],style:N==null?void 0:N[_e.Weekdays]},j&&K.createElement(n.WeekNumberHeader,{"aria-label":Ie(i.options),className:l[_e.WeekNumberHeader],style:N==null?void 0:N[_e.WeekNumberHeader],scope:"col"},V()),bt.map(de=>K.createElement(n.Weekday,{"aria-label":Be(de,i.options,i),className:l[_e.Weekday],key:String(de),style:N==null?void 0:N[_e.Weekday],scope:"col"},$(de,i.options,i)))),K.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[_e.Weeks],style:N==null?void 0:N[_e.Weeks]},ae.weeks.map(de=>K.createElement(n.Week,{className:l[_e.Week],key:de.weekNumber,style:N==null?void 0:N[_e.Week],week:de},j&&K.createElement(n.WeekNumber,{week:de,style:N==null?void 0:N[_e.WeekNumber],"aria-label":dt(de.weekNumber,{locale:o}),className:l[_e.WeekNumber],scope:"row",role:"rowheader"},A(de.weekNumber,i)),de.days.map(Se=>{const{date:W}=Se,F=q(Se);if(F[Lt.focused]=!F.hidden&&!!(ne!=null&&ne.isEqualTo(Se)),F[Hs.selected]=(O==null?void 0:O(W))||F.selected,Lp(X)){const{from:nt,to:Ke}=X;F[Hs.range_start]=!!(nt&&Ke&&i.isSameDay(W,nt)),F[Hs.range_end]=!!(nt&&Ke&&i.isSameDay(W,Ke)),F[Hs.range_middle]=Ba(X,W,!0,i)}const me=LH(F,N,t.modifiersStyles),Ve=CH(F,l,t.modifiersClassNames),tt=!qe&&!F.hidden?re(W,F,i.options,i):void 0;return K.createElement(n.Day,{key:`${i.format(W,"yyyy-MM-dd")}_${i.format(Se.displayMonth,"yyyy-MM")}`,day:Se,modifiers:F,className:Ve.join(" "),style:me,role:"gridcell","aria-selected":F.selected||void 0,"aria-label":tt,"data-day":i.format(W,"yyyy-MM-dd"),"data-month":Se.outside?i.format(W,"yyyy-MM"):void 0,"data-selected":F.selected||void 0,"data-disabled":F.disabled||void 0,"data-hidden":F.hidden||void 0,"data-outside":Se.outside||void 0,"data-focused":F.focused||void 0,"data-today":F.today||void 0},!F.hidden&&qe?K.createElement(n.DayButton,{className:l[_e.DayButton],style:N==null?void 0:N[_e.DayButton],type:"button",day:Se,modifiers:F,disabled:F.disabled||void 0,tabIndex:ee(Se)?0:-1,"aria-label":pe(W,F,i.options,i),onClick:vt(Se,F),onBlur:Ht(Se,F),onFocus:yt(Se,F),onKeyDown:It(Se,F),onMouseEnter:te(Se,F),onMouseLeave:be(Se,F)},S(W,i.options,i)):!F.hidden&&S(Se.date,i.options,i))})))))))),t.footer&&K.createElement(n.Footer,{className:l[_e.Footer],style:N==null?void 0:N[_e.Footer],role:"status","aria-live":"polite"},t.footer)))}function ms({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:s="label",buttonVariant:r="ghost",formatters:i,components:o,...l}){const c=Pp();return a.jsx(jB,{showOutsideDays:n,className:Pe("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:s,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...i},classNames:{root:Pe("w-fit",c.root),months:Pe("relative flex flex-col gap-4 md:flex-row",c.months),month:Pe("flex w-full flex-col gap-4",c.month),nav:Pe("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:Pe(I0({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:Pe(I0({variant:r}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:Pe("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:Pe("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:Pe("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:Pe("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:Pe("select-none font-medium",s==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:Pe("flex",c.weekdays),weekday:Pe("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:Pe("mt-2 flex w-full",c.week),week_number_header:Pe("w-[--cell-size] select-none",c.week_number_header),week_number:Pe("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:Pe("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:Pe("bg-accent rounded-l-md",c.range_start),range_middle:Pe("rounded-none",c.range_middle),range_end:Pe("bg-accent rounded-r-md",c.range_end),today:Pe("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:Pe("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:Pe("text-muted-foreground opacity-50",c.disabled),hidden:Pe("invisible",c.hidden),...t},components:{Root:({className:u,rootRef:h,...d})=>a.jsx("div",{"data-slot":"calendar",ref:h,className:Pe(u),...d}),Chevron:({className:u,orientation:h,...d})=>h==="left"?a.jsx(Y4,{className:Pe("size-4",u),...d}):h==="right"?a.jsx(xp,{className:Pe("size-4",u),...d}):a.jsx(Df,{className:Pe("size-4",u),...d}),DayButton:NB,WeekNumber:({children:u,...h})=>a.jsx("td",{...h,children:a.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:u})}),...o},...l})}function NB({className:e,day:t,modifiers:n,...s}){const r=Pp(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),a.jsx(H,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:Pe("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",r.day,e),...s})}var Gf="Popover",[qS]=Af(Gf,[Lf]),Od=Lf(),[SB,ti]=qS(Gf),GS=e=>{const{__scopePopover:t,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:o=!1}=e,l=Od(t),c=m.useRef(null),[u,h]=m.useState(!1),[d,f]=Tp({prop:s,defaultProp:r??!1,onChange:i,caller:Gf});return a.jsx(N3,{...l,children:a.jsx(SB,{scope:t,contentId:Is(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};GS.displayName=Gf;var XS="PopoverAnchor",CB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=ti(XS,n),i=Od(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=r;return m.useEffect(()=>(o(),()=>l()),[o,l]),a.jsx(Ep,{...i,...s,ref:t})});CB.displayName=XS;var ZS="PopoverTrigger",QS=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=ti(ZS,n),i=Od(n),o=ds(t,r.triggerRef),l=a.jsx(Sn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":n5(r.open),...s,ref:o,onClick:rn(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:a.jsx(Ep,{asChild:!0,...i,children:l})});QS.displayName=ZS;var Hp="PopoverPortal",[kB,EB]=qS(Hp,{forceMount:void 0}),KS=e=>{const{__scopePopover:t,forceMount:n,children:s,container:r}=e,i=ti(Hp,t);return a.jsx(kB,{scope:t,forceMount:n,children:a.jsx(Wi,{present:n||i.open,children:a.jsx(Mp,{asChild:!0,container:r,children:s})})})};KS.displayName=Hp;var fl="PopoverContent",JS=m.forwardRef((e,t)=>{const n=EB(fl,e.__scopePopover),{forceMount:s=n.forceMount,...r}=e,i=ti(fl,e.__scopePopover);return a.jsx(Wi,{present:s||i.open,children:i.modal?a.jsx(TB,{...r,ref:t}):a.jsx(DB,{...r,ref:t})})});JS.displayName=fl;var MB=bp("PopoverContent.RemoveScroll"),TB=m.forwardRef((e,t)=>{const n=ti(fl,e.__scopePopover),s=m.useRef(null),r=ds(t,s),i=m.useRef(!1);return m.useEffect(()=>{const o=s.current;if(o)return G3(o)},[]),a.jsx(Ap,{as:MB,allowPinchZoom:!0,children:a.jsx(e5,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rn(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:rn(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:rn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),DB=m.forwardRef((e,t)=>{const n=ti(fl,e.__scopePopover),s=m.useRef(!1),r=m.useRef(!1);return a.jsx(e5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),e5=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:h,...d}=e,f=ti(fl,n),x=Od(n);return P3(),a.jsx(_p,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:a.jsx(Of,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:a.jsx(S3,{"data-state":n5(f.open),role:"dialog",id:f.contentId,...x,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),t5="PopoverClose",_B=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=ti(t5,n);return a.jsx(Sn.button,{type:"button",...s,ref:t,onClick:rn(e.onClick,()=>r.onOpenChange(!1))})});_B.displayName=t5;var AB="PopoverArrow",OB=m.forwardRef((e,t)=>{const{__scopePopover:n,...s}=e,r=Od(n);return a.jsx(C3,{...r,...s,ref:t})});OB.displayName=AB;function n5(e){return e?"open":"closed"}var zB=GS,RB=QS,UB=KS,s5=JS;const xs=zB,gs=RB,Qn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...s},r)=>a.jsx(UB,{children:a.jsx(s5,{ref:r,align:t,sideOffset:n,className:Pe("z-50 w-auto p-0 rounded-lg border border-white/20 bg-black text-white shadow-lg outline-none 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",e),...s})}));Qn.displayName=s5.displayName;const Dw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),gu=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),_w=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),pu=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M18 6h2v2h-2V6zm-2 4V8h2v2h-2zm-2 2v-2h2v2h-2zm-2 2h2v-2h-2v2zm-2 2h2v-2h-2v2zm-2 0v2h2v-2H8zm-2-2h2v2H6v-2zm0 0H4v-2h2v2z",fill:"currentColor"})}),zs=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),$B=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 2h14v4h6v16H2V2zm18 6h-4v2h2v2h-2v2h2v2h-2v2h2v2h2V8zm-6-4H4v16h2v-2h6v2h2V4zM6 6h2v2H6V6zm6 0h-2v2h2V6zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2zm-6 4h2v2H6v-2zm6 0h-2v2h2v-2z",fill:"currentColor"})}),LB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),vr=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),a5=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),Aa=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),r5=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h8v2H6V2zM4 6V4h2v2H4zm0 8H2V6h2v8zm2 2H4v-2h2v2zm8 0v2H6v-2h8zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm0-8h2v8h-2V6zm0 0V4h-2v2h2z",fill:"currentColor"})}),Kl=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),jt=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M11 0H5v2H3v6h2v2h6V8H5V2h6V0zm0 2h2v6h-2V2zM0 14h2v4h12v2H0v-6zm2 0h12v-2H2v2zm14 0h-2v6h2v-6zM15 0h4v2h-4V0zm4 8h-4v2h4V8zm0-6h2v6h-2V2zm5 12h-2v4h-4v2h6v-6zm-6-2h4v2h-4v-2z",fill:"currentColor"})}),_t=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M5 5h2v2H5V5zm4 4H7V7h2v2zm2 2H9V9h2v2zm2 0h-2v2H9v2H7v2H5v2h2v-2h2v-2h2v-2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2v-2zm2-2v2h-2V9h2zm2-2v2h-2V7h2zm0 0V5h2v2h-2z",fill:"currentColor"})}),i5=({className:e="",size:t=24})=>a.jsx(D0,{size:t,className:Pe(e,"w-4 h-4")}),Ya=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),PB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 4c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4zm0 6c1.38 0 2.5-1.12 2.5-2.5S13.38 11.5 12 11.5 9.5 12.62 9.5 14 10.62 16.5 12 16.5z",fill:"currentColor"})}),ux=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Ec=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),hx=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-1.57.46-3.03 1.24-4.26L16.26 18.76C15.03 19.54 13.57 20 12 20zm6.76-3.74L7.74 5.24C8.97 4.46 10.43 4 12 4c4.41 0 8 3.59 8 8 0 1.57-.46 3.03-1.24 4.26z",fill:"currentColor"})}),ks=e=>a.jsx(Ys,{...e,className:"w-4 h-4 animate-spin"}),HB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),BB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),Jn=({className:e="",size:t=24})=>a.jsx($B,{className:e,size:t}),Aw=({className:e="",size:t=24})=>a.jsx(a5,{className:e,size:t}),_a=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),o5=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4H8v2H6v2h2v2h2v-2h2V8h-2V6zm6 0h-2v2h2V6zm2 0h2v2h-2V6zm-6 8h-2v-2h2v2zm-4 0H6v-2h2v2zm-4 0H2v-2h2v2zm8 4h-2v-2h2v2zm4 0h2v-2h-2v2zm-6 2h2v2h-2v-2zm4 0h2v2h-2v-2z",fill:"currentColor"})}),VB=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),Yu=({className:e="",size:t=24})=>a.jsx(C7,{className:Pe(e,"w-4 h-4"),size:t}),Ow=({className:e="",size:t=24})=>a.jsx(N7,{className:Pe(e,"w-4 h-4"),size:t}),Ih=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-5l6-6-1.41-1.41L11 12.17l-2.59-2.58L7 10.59l4 4z",fill:"currentColor"})}),zw=({className:e="",size:t=24})=>a.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:a.jsx("path",{d:"M12 1h2v8h8v4h-2v-2h-8V5h-2V1zM8 7V5h2v2H8zM6 9V7h2v2H6zm-2 2V9h2v2H4zm10 8v2h-2v2h-2v-8H2v-4h2v2h8v6h2zm2-2v2h-2v-2h2zm2-2v2h-2v-2h2zm0 0h2v-2h-2v2z",fill:"currentColor"})}),Hr=(e,t,n)=>{const s=document.createElement(e),[r,i]=Array.isArray(t)?[void 0,t]:[t,n];return r&&Object.assign(s,r),i==null||i.forEach(o=>s.appendChild(o)),s},YB=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},IB=e=>e.offsetWidth>0&&e.offsetHeight>0,FB=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function WB(e,t,{reverse:n=!1}={}){const s=e.length;for(let r=n?s-1:0;n?r>=0:r<s;n?r--:r++)t(e[r],r)}function qB(e,t,n,s){const r=t.formatToParts(e);n&&r.unshift({type:"prefix",value:n}),s&&r.push({type:"suffix",value:s});const i=[],o=[],l=[],c=[],u={},h=b=>`${b}:${u[b]=(u[b]??-1)+1}`;let d="",f=!1,x=!1;for(const b of r){d+=b.value;const w=b.type==="minusSign"||b.type==="plusSign"?"sign":b.type;w==="integer"?(f=!0,o.push(...b.value.split("").map(g=>({type:w,value:parseInt(g)})))):w==="group"?o.push({type:w,value:b.value}):w==="decimal"?(x=!0,l.push({type:w,value:b.value,key:h(w)})):w==="fraction"?l.push(...b.value.split("").map(g=>({type:w,value:parseInt(g),key:h(w),pos:-1-u[w]}))):(f||x?c:i).push({type:w,value:b.value,key:h(w)})}const y=[];for(let b=o.length-1;b>=0;b--){const w=o[b];y.unshift(w.type==="integer"?{...w,key:h(w.type),pos:u[w.type]}:{...w,key:h(w.type)})}return{pre:i,integer:y,fraction:l,post:c,valueAsString:d,value:typeof e=="string"?parseFloat(e):e}}const GB=String.raw,XB=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),ZB=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),Rw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,Fh="--_number-flow-d-opacity",Bp="--_number-flow-d-width",Wh="--_number-flow-dx",Vp="--_number-flow-d",QB=(()=>{try{return CSS.registerProperty({name:Fh,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Wh,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Bp,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Vp,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),KB="var(--number-flow-char-height, 1em)",gr="var(--number-flow-mask-height, 0.25em)",Uw=`calc(${gr} / 2)`,W0="var(--number-flow-mask-width, 0.5em)",oi=`calc(${W0} / var(--scale-x))`,bu="#000 0, transparent 71%",$w=GB`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${KB} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${Bp}) / var(--width));transform:translateX(var(${Wh})) scaleX(var(--scale-x));margin:0 calc(-1 * ${W0});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${oi},#000 calc(100% - ${oi}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${gr},#000 calc(100% - ${gr}),transparent 100% ),radial-gradient(at bottom right,${bu}),radial-gradient(at bottom left,${bu}),radial-gradient(at top left,${bu}),radial-gradient(at top right,${bu});-webkit-mask-size:100% calc(100% - ${gr} * 2),calc(100% - ${oi} * 2) 100%,${oi} ${gr},${oi} ${gr},${oi} ${gr},${oi} ${gr};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${Uw} ${W0};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${Wh})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${Vp})}.digit__num,.number .section::after{padding:${Uw} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${Fh}))}`,JB=HTMLElement,eV=ZB&&XB&&QB;let vu;class l5 extends JB{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(s=>s.finish()))}set data(t){var n;if(t==null)return;const{pre:s,integer:r,fraction:i,post:o,value:l}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,l):this.trend,this.computedAnimated=eV&&this._animated&&(!this.respectMotionPreference||!(Rw!=null&&Rw.matches))&&IB(this),(n=this.plugins)==null||n.forEach(u=>{var h;return(h=u.onUpdate)==null?void 0:h.call(u,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(s),this._num.update({integer:r,fraction:i}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)vu||(vu=new CSSStyleSheet,vu.replaceSync($w)),this.shadowRoot.adoptedStyleSheets=[vu];else{const c=document.createElement("style");c.textContent=$w,this.shadowRoot.appendChild(c)}this._pre=new Pw(this,s,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new tV(this,r,i),this.shadowRoot.appendChild(this._num.el),this._post=new Pw(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}l5.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class tV{constructor(t,n,s,{className:r,...i}={}){this.flow=t,this._integer=new Lw(t,n,{justify:"right",part:"integer"}),this._fraction=new Lw(t,s,{justify:"left",part:"fraction"}),this._inner=Hr("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=Hr("span",{...i,part:"number",className:`number ${r??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,s=this.el.offsetWidth,r=this._prevWidth-s;this.el.style.setProperty("--width",String(s)),this.el.animate({[Wh]:[`${n}px`,"0px"],[Bp]:[r,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class c5{constructor(t,n,{justify:s,className:r,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=s;const l=n.map(c=>this.addChar(c).el);this.el=Hr("span",{...i,className:`section section--justify-${s} ${r??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...s}={}){const r=t.type==="integer"||t.type==="fraction"?new u5(this,t.type,n?0:t.value,t.pos,{...s,onRemove:this.onCharRemove(t.key)}):new nV(this,t.type,t.value,{...s,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,r),r}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${YB(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,s=new Map,r=this.justify==="left",i=r?"prepend":"append";if(WB(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),s.set(o,l),this.unpop(l),l.present=!0):(l=this.addChar(o,{startDigitsAtZero:!0,animateIn:!0}),n.set(o,l)),this.el[i](l.el)},{reverse:r}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),s.forEach((o,l)=>{o.update(l.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(r=>r.didUpdate(t));const n=t[this.justify],s=this._prevOffset-n;s&&this.children.size&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class Lw extends c5{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s),this.unpop(s)}),this.addNewAndUpdateExisting(t),n.forEach(s=>{s instanceof u5&&s.update(0)}),this.pop(n)}}class Pw extends c5{update(t){const n=new Map;this.children.forEach((s,r)=>{t.find(i=>i.key===r)||n.set(r,s)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class q0{constructor(t,n,{onRemove:s,animateIn:r=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var i;this.el.remove(),(i=this._onRemove)==null||i.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&r&&this.el.animate({[Fh]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=s}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[Fh]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class d5 extends q0{constructor(t,n,s,r){super(t.flow,s,r),this.section=t,this.value=n,this.el=s}}class u5 extends d5{constructor(t,n,s,r,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[r])==null?void 0:l.max)??9)+1,u=Array.from({length:c}).map((d,f)=>{const x=Hr("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==s&&x.setAttribute("inert",""),x.style.setProperty("--n",String(f)),x}),h=Hr("span",{part:`digit ${n}-digit`,className:"digit"},u);h.style.setProperty("--current",String(s)),h.style.setProperty("--length",String(c)),super(t,s,h,i),this.pos=r,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const s=n[this.section.justify]-t[this.section.justify],r=n.width/2;this._prevCenter=this.section.justify==="left"?s+r:s-r}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,s)=>s===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),s=n[this.section.justify]-t[this.section.justify],r=n.width/2,i=this.section.justify==="left"?s+r:s-r,o=this._prevCenter-i;o&&this.el.animate({transform:[`translateX(${o}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const l=this.getDelta();l&&(this.el.classList.add("is-spinning"),this.el.animate({[Vp]:[-l,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const r of this.flow.plugins){const i=(t=r.getDelta)==null?void 0:t.call(r,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,s=this.flow.computedTrend||Math.sign(n);return s<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:s>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class nV extends d5{constructor(t,n,s,r){const i=Hr("span",{className:"symbol__value",textContent:s});super(t,s,Hr("span",{part:`symbol ${n}`,className:"symbol"},[i]),r),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(s,new q0(this.flow,i,{onRemove:this._onChildRemove(s)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const s=this._children.get(t);if(s)s.present=!0;else{const r=Hr("span",{className:"symbol__value",textContent:t});this.el.appendChild(r),this._children.set(t,new q0(this.flow,r,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],s=this._prevOffset-n;s&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var Yw;const sV=parseInt((Yw=m.version.match(/^(\d+)\./))==null?void 0:Yw[1]),Yp=sV>=19,aV=["data","digits"];class Ip extends l5{attributeChangedCallback(t,n,s){this[t]=JSON.parse(s)}}Ip.observedAttributes=Yp?[]:aV;FB("number-flow-react",Ip);const fx={},Hw=Yp?e=>e:JSON.stringify;function Bw(e){const{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:s,animated:r,respectMotionPreference:i,trend:o,plugins:l},c]}class rV extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=Bw(this.props);Object.entries(n).forEach(([s,r])=>{this.el[s]=r??Ip.defaultProps[s]}),t!=null&&t.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t!=null&&t.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),Yp&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){var n;if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>{var s;return(s=this.props.group)==null?void 0:s.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var s;return(s=this.el)==null?void 0:s.didUpdate()}}return null}componentDidUpdate(t,n,s){s==null||s()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:s,data:r,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:u,onAnimationsFinish:h,...d}]=Bw(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:s,...d,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:Hw(c),data:Hw(r)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const iV=m.forwardRef(function({value:t,locales:n,format:s,prefix:r,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),u=m.useContext(oV);u==null||u.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),d=m.useMemo(()=>s?JSON.stringify(s):"",[s]),f=m.useMemo(()=>{var y;const x=fx[y=`${h}:${d}`]??(fx[y]=new Intl.NumberFormat(n,s));return qB(t,x,r,i)},[t,h,d,r,i]);return m.createElement(rV,{...o,group:u,data:f,innerRef:c})}),oV=m.createContext(void 0),lV={notation:"compact",maximumFractionDigits:1};function Bs({value:e,loading:t=!1,className:n,prefix:s,suffix:r,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const d=Number(e);return Number.isFinite(d)?d:0},[e]);if(t)return a.jsxs("span",{className:zh("inline-flex items-baseline",n),children:[s,l,r]});const u=iV,h=typeof o=="boolean"?o?1:0:o;return a.jsxs("span",{className:zh("inline-flex",n),children:[s,a.jsx(u,{value:c,format:i??lV,trend:h,className:"inline-flex"}),r]})}function Ln({id:e,label:t="ID",className:n="",variant:s="inline",nonSliced:r=!1}){const[i,o]=m.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(e),o(!0),P.success("Copied to clipboard"),setTimeout(()=>o(!1),2e3)}catch{P.error("Failed to copy to clipboard")}};return s==="detail"?a.jsxs("div",{className:`flex justify-between items-center ${n}`,children:[a.jsxs("span",{className:"text-gray-400",children:[t,":"]}),a.jsxs("button",{onClick:l,className:"flex items-center gap-2 text-white text-sm hover:text-white/80 transition-colors group",title:"Click to copy",children:[a.jsx("span",{className:"font-mono",children:e}),i?a.jsx(T0,{className:"w-3 h-3 text-green-500"}):a.jsx(Ay,{className:"w-3 h-3 text-gray-400 group-hover:text-white transition-colors"})]})]}):s==="subscript"?a.jsxs("sup",{onClick:l,className:`text-xs text-gray-500 ml-2 cursor-pointer hover:text-white transition-colors inline-flex items-center gap-1 ${n}`,title:"Click to copy User ID",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:r?e:e.slice(0,8)}),a.jsx("span",{className:"ml-1",children:"]"})]}):a.jsxs("button",{onClick:l,className:`flex items-center gap-1.5 text-sm text-gray-400 hover:text-white transition-colors group ${n}`,title:"Click to copy",children:[a.jsxs("span",{children:[t,":"]}),a.jsx("span",{className:"font-mono",children:e}),i?a.jsx(T0,{className:"w-3 h-3 text-green-500"}):a.jsx(Ay,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function Zr({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:s="",defaultCollapsed:r=!1}){const[i,o]=m.useState(r),l=m.useRef(null);m.useEffect(()=>{const d=l.current;!d||i||d.scrollTo({top:d.scrollHeight,behavior:"smooth"})},[i]);const c=d=>{switch(d.type){case"success":return a.jsx(nn,{className:"w-3 h-3 text-green-400"});case"error":return a.jsx(za,{className:"w-3 h-3 text-red-400"});case"progress":return d.status==="running"?a.jsx(Ys,{className:"w-3 h-3 text-blue-400 animate-spin"}):d.status==="completed"?a.jsx(nn,{className:"w-3 h-3 text-green-400"}):d.status==="failed"?a.jsx(za,{className:"w-3 h-3 text-red-400"}):a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return a.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},u=d=>{switch(d.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return d.status==="running"?"text-blue-400":d.status==="completed"?"text-green-400":d.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=d=>d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+d.getMilliseconds().toString().padStart(3,"0");return a.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${s}`,children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(S7,{className:"w-3 h-3 text-green-400"}),a.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[n&&a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),a.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),a.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),a.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?a.jsx(Df,{className:"w-3 h-3"}):a.jsx(b7,{className:"w-3 h-3"})})]})]}),!i&&a.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?a.jsxs("div",{className:"text-gray-500 italic text-xs",children:[a.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(d=>a.jsxs("div",{className:`flex items-start space-x-3 py-1 ${u(d)} text-xs`,children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(d.timestamp)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(d)}),a.jsx("span",{className:"flex-1 min-w-0 break-words",children:d.message})]},d.id)),n&&a.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[a.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),a.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),a.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"flex-1 flex items-center",children:a.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&a.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),a.jsxs("span",{children:["Lines: ",t.length]})]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),a.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const h5=document.createElement("style");h5.textContent=`
433
- @keyframes fadeIn {
434
- from {
435
- opacity: 0;
436
- transform: translateX(-10px);
437
- }
438
- to {
439
- opacity: 1;
440
- transform: translateX(0);
441
- }
442
- }
443
-
444
- .animate-fadeIn {
445
- animation: fadeIn 0.3s ease-out forwards;
446
- }
447
- `;document.head.appendChild(h5);const Le=m.forwardRef(({className:e,type:t,...n},s)=>a.jsx("input",{type:t,className:`flex h-10 w-full border border-dashed border-white/20 bg-black/30 px-3 py-2 text-sm text-white placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,ref:s,...n}));Le.displayName="Input";const Me=m.forwardRef(({className:e,...t},n)=>a.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));Me.displayName="Label";function f5({currentPage:e,totalPages:t,onPageChange:n,totalItems:s,startIndex:r,endIndex:i}){const o=()=>{const u=[],h=[];for(let d=Math.max(2,e-2);d<=Math.min(t-1,e+2);d++)u.push(d);return e-2>2?h.push(1,"..."):h.push(1),h.push(...u),e+2<t-1?h.push("...",t):t>1&&h.push(t),h};if(t<=1)return null;const l=o();return a.jsxs("div",{className:"flex items-center justify-between mt-6",children:[a.jsxs("div",{className:"text-sm text-gray-400",children:["Showing ",r+1," to ",Math.min(i,s)," of ",s," items"]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:e===1,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Y4,{className:"w-4 h-4"}),"Previous"]}),l.map((c,u)=>{if(c==="...")return a.jsx(H,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:a.jsx(j7,{className:"w-4 h-4"})},`dots-${u}`);const h=c,d=e===h;return a.jsx(H,{variant:d?"default":"outline",size:"sm",onClick:()=>n(h),className:d?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:h},h)}),a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===t,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:["Next",a.jsx(xp,{className:"w-4 h-4"})]})]})]})}const zd=m.createContext({isOpen:!1,setIsOpen:()=>{}}),ws=m.forwardRef(({className:e,value:t,onValueChange:n,children:s,...r},i)=>{const[o,l]=m.useState(!1);return a.jsx(zd.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:a.jsx("div",{ref:i,className:`relative ${e}`,...r,children:s})})});ws.displayName="Select";const js=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r,setIsOpen:i}=m.useContext(zd);return a.jsxs("button",{ref:s,type:"button",className:`flex h-10 w-full items-center justify-between border bg-black/30 px-3 py-2 text-sm text-white focus:outline-none focus:ring-1 focus:ring-white focus:border-white/40 disabled:cursor-not-allowed disabled:opacity-50 rounded-none ${e}`,onClick:()=>i(!r),...n,children:[t,a.jsx(Df,{className:`h-4 w-4 text-gray-400 transition-transform ${r?"rotate-180":""}`})]})});js.displayName="SelectTrigger";const Br=m.forwardRef(({className:e,placeholder:t,...n},s)=>{const{value:r}=m.useContext(zd);return a.jsx("span",{ref:s,className:`text-sm text-white ${e}`,...n,children:r||t})});Br.displayName="SelectValue";const Ns=m.forwardRef(({className:e,children:t,...n},s)=>{const{isOpen:r}=m.useContext(zd);return r?a.jsx("div",{ref:s,className:`absolute top-full left-0 right-0 z-[100] mt-1 border border-dashed border-white/20 bg-black rounded-none shadow-lg max-h-60 overflow-y-auto ${e}`,...n,children:t}):null});Ns.displayName="SelectContent";const Fe=m.forwardRef(({className:e,children:t,value:n,...s},r)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(zd);return a.jsx("div",{ref:r,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...s,children:t})});Fe.displayName="SelectItem";function m5(){const e=Gs(),{counts:t,refetchCounts:n}=Vf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[u,h]=m.useState(""),[d,f]=m.useState("all"),[x,y]=m.useState([]),[b,w]=m.useState(1),[g]=m.useState(20),[v,p]=m.useState(!1),[j,N]=m.useState(!1),[C,S]=m.useState(!1),[M,A]=m.useState(!1),[V,$]=m.useState(!1),[z,Y]=m.useState(!1),[E,R]=m.useState(null),[T,_]=m.useState([]),[k,D]=m.useState(!1),[L,q]=m.useState({name:"",slug:""}),[O,B]=m.useState({name:"",slug:""});m.useEffect(()=>{se()},[]);const X=te=>te.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),Z=te=>{const be=X(te);q({name:te,slug:be})},ne=te=>{q(be=>({...be,slug:X(te)}))},ee=te=>{const be=X(te);B({name:te,slug:be})},J=te=>{B(be=>({...be,slug:X(te)}))},se=async()=>{try{const be=await(await fetch("/api/plugins")).json(),He=(be==null?void 0:be.plugins).find(I=>I.id==="organization");c({enabled:!!He,availablePlugins:(be==null?void 0:be.plugins).map(I=>I.id),configPath:be.configPath,organizationPlugin:(be==null?void 0:be.plugins).find(I=>I.id==="organization")}),He?await pe():o(!1)}catch(te){console.error("Failed to check plugin status:",te),c({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},pe=async()=>{try{const be=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:be.organizations.length}),r(be.organizations||[])}catch(te){console.error("Failed to fetch organizations:",te),P.error("Failed to fetch organizations")}finally{o(!1)}},re=async te=>{_([]),D(!0),_([{id:"start",type:"info",message:`Starting organization seeding process for ${te} organizations...`,timestamp:new Date}]);try{const He=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:te})})).json();if(He.success){const I=He.results.map((ue,xe)=>ue.success?{id:`org-${xe}`,type:"progress",message:`Creating organization: ${ue.organization.name} (${ue.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${xe}`,type:"error",message:`Failed to create organization ${xe+1}: ${ue.error}`,timestamp:new Date});_(ue=>[...ue,...I]);const le=He.results.filter(ue=>ue.success).length;_(ue=>[...ue,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${le}/${te} organizations successfully`,timestamp:new Date}]),await pe(),await n()}else _(I=>[...I,{id:"error",type:"error",message:`❌ Seeding failed: ${He.error||"Unknown error"}`,timestamp:new Date}])}catch(be){_(He=>[...He,{id:"error",type:"error",message:`❌ Network error: ${be}`,timestamp:new Date}])}finally{D(!1)}},he=te=>{R(te),$(!0)},fe=te=>{R(te),B({name:te.name,slug:te.slug}),S(!0)},ke=te=>{R(te),A(!0)},Oe=async()=>{if(!L.name){P.error("Please fill in the organization name");return}const te=P.loading("Creating organization...");try{const He=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:L.name,slug:L.slug})})).json();He.success?(await pe(),p(!1),q({name:"",slug:""}),P.success("Organization created successfully!",{id:te})):P.error(`Error creating organization: ${He.error||"Unknown error"}`,{id:te})}catch(be){console.error("Error creating organization:",be),P.error("Error creating organization",{id:te})}},Re=async()=>{if(!E){P.error("No organization selected");return}if(!O.name){P.error("Please fill in the organization name");return}const te=P.loading("Updating organization...");try{const He=await(await fetch(`/api/organizations/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:O.name,slug:O.slug})})).json();He.success?(await pe(),S(!1),R(null),B({name:"",slug:""}),P.success("Organization updated successfully!",{id:te})):P.error(`Error updating organization: ${He.error||"Unknown error"}`,{id:te})}catch(be){console.error("Error updating organization:",be),P.error("Error updating organization",{id:te})}},Be=async()=>{if(!E){P.error("No organization selected");return}const te=P.loading("Deleting organization...");try{const He=await(await fetch(`/api/organizations/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();He.success?(await pe(),await n(),A(!1),R(null),P.success("Organization deleted successfully!",{id:te})):P.error(`Error deleting organization: ${He.error||"Unknown error"}`,{id:te})}catch(be){console.error("Error deleting organization:",be),P.error("Error deleting organization",{id:te})}},dt=()=>{if(s.length===0){P.error("No organizations to export");return}const te=["ID","Name","Slug","Created At","Updated At"],be=s.map(xe=>[xe.id,xe.name||"",xe.slug||"",new Date(xe.createdAt).toLocaleString(),new Date(xe.updatedAt).toLocaleString()]),He=[te.join(","),...be.map(xe=>xe.map(Te=>`"${Te}"`).join(","))].join(`
448
- `),I=new Blob([He],{type:"text/csv;charset=utf-8;"}),le=document.createElement("a"),ue=URL.createObjectURL(I);le.setAttribute("href",ue),le.setAttribute("download",`organizations-export-${new Date().toISOString().split("T")[0]}.csv`),le.style.visibility="hidden",document.body.appendChild(le),le.click(),document.body.removeChild(le),P.success(`Exported ${s.length} organizations to CSV`)},Ie=te=>{x.some(be=>be.type===te)||y([...x,{type:te}])},St=te=>{y(x.filter(be=>be.type!==te))},bt=()=>{y([])},qe=(te,be)=>{y(He=>He.map(I=>I.type===te?{...I,dateRange:be}:I))},et=s.filter(te=>{const be=te.name.toLowerCase().includes(u.toLowerCase())||te.slug.toLowerCase().includes(u.toLowerCase());if(x.length===0)return be;const He=x.every(I=>{var le,ue,xe,Te;switch(I.type){case"createdAt":{if(!((le=I.dateRange)!=null&&le.from)&&!((ue=I.dateRange)!=null&&ue.to))return!0;const We=new Date(te.createdAt);return!((xe=I.dateRange)!=null&&xe.from&&I.dateRange.from>We||(Te=I.dateRange)!=null&&Te.to&&I.dateRange.to<We)}default:return!0}});return be&&He}),Qe=Math.ceil(et.length/g),vt=(b-1)*g,yt=vt+g,Ht=et.slice(vt,yt),It=te=>{w(te)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Ys,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organizations..."})]})}):l&&!l.enabled?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Organizations"}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(sa,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",l.configPath&&a.jsxs("span",{className:"text-gray-400",children:[" (",l.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),l.availablePlugins&&l.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",l.availablePlugins.join(", ")]})}),a.jsx(H,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Organizations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(Bs,{value:t.organizations??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your organizations and teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(H,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:dt,children:[a.jsx(Cc,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(H,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>Y(!0),children:[a.jsx(Vt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(H,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>p(!0),children:[a.jsx(Pr,{className:"w-4 h-4 mr-2"}),"Add Organization"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ri,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{placeholder:"Search organizations...",value:u,onChange:te=>h(te.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(ws,{value:"",onValueChange:Ie,children:[a.jsx(js,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(Pr,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsx(Ns,{children:!x.some(te=>te.type==="createdAt")&&a.jsx(Fe,{value:"createdAt",children:"Created Date"})})]})}),x.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(H,{onClick:bt,children:"Clear all"})})]}),x.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:x.map(te=>{var be,He,I,le;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(gp,{className:"w-3 h-3 text-white"}),te.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Ah,{className:"mr-1 h-3 w-3"}),(be=te.dateRange)!=null&&be.from?fs(te.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:(He=te.dateRange)==null?void 0:He.from,onSelect:ue=>{var xe;return qe("createdAt",{from:ue,to:(xe=te.dateRange)==null?void 0:xe.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Ah,{className:"mr-1 h-3 w-3"}),(I=te.dateRange)!=null&&I.to?fs(te.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:(le=te.dateRange)==null?void 0:le.to,onSelect:ue=>{var xe;return qe("createdAt",{from:(xe=te.dateRange)==null?void 0:xe.from,to:ue})},initialFocus:!0,disabled:ue=>{var xe;return(xe=te.dateRange)!=null&&xe.from?ue<te.dateRange.from:!1},className:"rounded-none"})})]})]}),a.jsx("button",{onClick:()=>St(te.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(an,{className:"w-3 h-3 text-white"})})]},te.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Organization"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Slug"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:et.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(sa,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No organizations found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:u||d!=="all"?"Try adjusting your search or filter criteria":"Get started by creating your first organization"})]}),!u&&d==="all"&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(H,{onClick:()=>p(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(Pr,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),a.jsxs(H,{onClick:()=>Y(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Vt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):Ht.map(te=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>e(`/organizations/${te.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(sa,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:te.name}),a.jsx(Ln,{id:te.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:te.slug}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(te.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(te.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(H,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:be=>{be.stopPropagation(),he(te)},children:a.jsx(Nl,{className:"w-4 h-4"})}),a.jsx(H,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:be=>{be.stopPropagation(),fe(te)},children:a.jsx(zi,{className:"w-4 h-4"})}),a.jsx(H,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:be=>{be.stopPropagation(),ke(te)},children:a.jsx(_f,{className:"w-4 h-4"})})]})})]},te.id))})]})}),a.jsx(f5,{currentPage:b,totalPages:Qe,onPageChange:It,totalItems:et.length,startIndex:vt,endIndex:yt})]}),z&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(sa,{className:"inline mr-2 w-3.5 h-3.5 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Organizations"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Me,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),a.jsx(Le,{id:"organization-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(H,{onClick:()=>{var be;const te=parseInt(((be=document.getElementById("organization-count"))==null?void 0:be.value)||"5",10);re(te)},disabled:k,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:k?a.jsxs(a.Fragment,{children:[a.jsx(Ys,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Vt,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})}),T.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Zr,{title:"Organization Seeding Terminal",lines:T,isRunning:k,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(H,{variant:"outline",onClick:()=>Y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),v&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Organization"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"create-name",value:L.name,onChange:te=>Z(te.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Le,{id:"create-slug",value:L.slug,onChange:te=>ne(te.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{p(!1),q({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:Oe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),C&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:te=>{te.target===te.currentTarget&&(S(!1),R(null),B({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:te=>te.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{S(!1),R(null),B({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(sa,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"edit-name",value:O.name,onChange:te=>ee(te.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Le,{id:"edit-slug",value:O.slug,onChange:te=>J(te.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{S(!1),B({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:Re,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),M&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Organization"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>A(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(sa,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this organization? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>A(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:Be,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),V&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Organization Details"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>$(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(sa,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ln,{id:E.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(E.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(E.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(H,{onClick:()=>$(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function x5(){const e=Gs(),{counts:t,refetchCounts:n}=Vf(),[s,r]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(""),[u,h]=m.useState([]),[d,f]=m.useState(1),[x]=m.useState(20),[y,b]=m.useState(!1),[w,g]=m.useState(!1),[v,p]=m.useState(!1),[j,N]=m.useState(!1),[C,S]=m.useState(!1),[M,A]=m.useState(!1),[V,$]=m.useState(!1),[z,Y]=m.useState(!1),[E,R]=m.useState(null),[T,_]=m.useState(null),[k,D]=m.useState(""),[L,q]=m.useState(),[O,B]=m.useState(!1),[X,Z]=m.useState(""),[ne,ee]=m.useState(""),[J,se]=m.useState(""),[pe,re]=m.useState([]),[he,fe]=m.useState(!1),ke=m.useCallback(async()=>{try{const ae=await(await fetch("/api/users?limit=10000")).json();r(ae.users||[])}catch{}finally{o(!1)}},[]),Oe=m.useCallback(async()=>{try{const ae=await(await fetch("/api/admin/status")).json();B(ae.enabled)}catch{B(!1)}},[]);m.useEffect(()=>{ke(),Oe();const G=()=>{T&&_(null)};return document.addEventListener("click",G),()=>document.removeEventListener("click",G)},[T,Oe,ke]);const Re=async(G,ae)=>{re([]),fe(!0),re([{id:"start",type:"info",message:`Starting user seeding process for ${G} users...`,timestamp:new Date}]);try{const de=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:G,role:ae||void 0})})).json();if(de.success){const Se=de.results.map((F,me)=>F.success?{id:`user-${me}`,type:"progress",message:`Creating user: ${F.user.name} (${F.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${me}`,type:"error",message:`Failed to create user ${me+1}: ${F.error}`,timestamp:new Date});re(F=>[...F,...Se]);const W=de.results.filter(F=>F.success).length;re(F=>[...F,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${W}/${G} users successfully`,timestamp:new Date}]),await ke(),await n()}else re(Se=>[...Se,{id:"error",type:"error",message:`❌ Seeding failed: ${de.error||"Unknown error"}`,timestamp:new Date}])}catch(ye){re(de=>[...de,{id:"error",type:"error",message:`❌ Network error: ${ye}`,timestamp:new Date}])}finally{fe(!1)}},Be=G=>{R(G),N(!0)},dt=G=>{R(G),Z(G.role||""),g(!0)},Ie=G=>{R(G),p(!0)},St=async()=>{var Se,W,F;const G=(Se=document.getElementById("create-name"))==null?void 0:Se.value,ae=(W=document.getElementById("create-email"))==null?void 0:W.value,ye=(F=document.getElementById("create-password"))==null?void 0:F.value;if(!G||!ae||!ye){P.error("Please fill in all fields");return}const de=P.loading("Creating user...");try{const Ve=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:G,email:ae,password:ye,role:J||null})})).json();Ve.success?(await ke(),b(!1),se(""),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",P.success("User created successfully!",{id:de})):P.error(`Error creating user: ${Ve.error||"Unknown error"}`,{id:de})}catch{P.error("Error creating user",{id:de})}},bt=async()=>{var de,Se;if(!E){P.error("No user selected");return}const G=(de=document.getElementById("edit-name"))==null?void 0:de.value,ae=(Se=document.getElementById("edit-email"))==null?void 0:Se.value;if(!G||!ae){P.error("Please fill in all fields");return}const ye=P.loading("Updating user...");try{const F=await(await fetch(`/api/users/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:G,email:ae,role:X||null})})).json();F.success?(await ke(),g(!1),R(null),Z(""),P.success("User updated successfully!",{id:ye})):P.error(`Error updating user: ${F.error||"Unknown error"}`,{id:ye})}catch{P.error("Error updating user",{id:ye})}},qe=async()=>{if(!E){P.error("No user selected");return}const G=P.loading("Deleting user...");try{const ye=await(await fetch(`/api/users/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ye.success?(await ke(),await n(),p(!1),R(null),P.success("User deleted successfully!",{id:G})):P.error(`Error deleting user: ${ye.error||"Unknown error"}`,{id:G})}catch{P.error("Error deleting user",{id:G})}},et=async()=>{if(!E)return;if(!O){P.error("Admin plugin is not enabled");return}const G=P.loading("Banning user...");try{const ae=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:E.id,banReason:k||"No reason provided",banExpiresIn:L})}),ye=await ae.json();ae.ok?(P.success("User banned successfully!",{id:G}),A(!1),D(""),q(void 0),R(null),_(null),ke()):P.error(`Error banning user: ${ye.error||ye.message||"Unknown error"}`,{id:G})}catch{P.error("Error banning user",{id:G})}},Qe=async()=>{if(!E)return;if(!O){P.error("Admin plugin is not enabled");return}const G=P.loading("Unbanning user...");try{const ae=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:E.id})}),ye=await ae.json();ae.ok?(P.success("User unbanned successfully!",{id:G}),$(!1),R(null),_(null),ke()):P.error(`Error unbanning user: ${ye.error||ye.message||"Unknown error"}`,{id:G})}catch{P.error("Error unbanning user",{id:G})}},vt=async()=>{var ye;if(!E){P.error("No user selected");return}const G=(ye=document.getElementById("update-password"))==null?void 0:ye.value;if(!G){P.error("Please enter a new password");return}const ae=P.loading("Updating password...");try{const de=await fetch(`/api/users/${E.id}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:G})}),Se=await de.json();de.ok&&Se.success?(P.success("Password updated successfully!",{id:ae}),Y(!1),R(null),document.getElementById("update-password").value=""):P.error(`Error updating password: ${Se.error||"Unknown error"}`,{id:ae})}catch{P.error("Error updating password",{id:ae})}},yt=()=>{if(s.length===0){P.error("No users to export");return}const G=["ID","Name","Email","Email Verified","Created At","Updated At"],ae=s.map(F=>[F.id,F.name||"",F.email||"",!!F.emailVerified,new Date(F.createdAt).toLocaleString(),new Date(F.updatedAt).toLocaleString()]),ye=[G.join(","),...ae.map(F=>F.map(me=>`"${me}"`).join(","))].join(`
449
- `),de=new Blob([ye],{type:"text/csv;charset=utf-8;"}),Se=document.createElement("a"),W=URL.createObjectURL(de);Se.setAttribute("href",W),Se.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),Se.style.visibility="hidden",document.body.appendChild(Se),Se.click(),document.body.removeChild(Se),P.success(`Exported ${s.length} users to CSV`)},Ht=G=>{u.some(ye=>ye.type===G)||(h(ye=>[...ye,{type:G}]),f(1))},It=G=>{h(ae=>ae.filter(ye=>ye.type!==G)),f(1)},te=(G,ae)=>{h(ye=>ye.map(de=>de.type===G?{...de,value:ae}:de))},be=(G,ae)=>{h(ye=>ye.map(de=>de.type===G?{...de,dateRange:ae}:de))},He=s.filter(G=>{const ae=G.name.toLowerCase().includes(l.toLowerCase())||G.email.toLowerCase().includes(l.toLowerCase());if(u.length===0)return ae;const ye=u.every(de=>{var Se,W,F,me,Ve;switch(de.type){case"emailVerified":return de.value===void 0?!0:G.emailVerified===(de.value==="true");case"banned":return de.value===void 0?!0:G.banned===(de.value==="true");case"active":return G.banned!==!0;case"createdAt":{if(!((Se=de.dateRange)!=null&&Se.from)&&!((W=de.dateRange)!=null&&W.to))return!0;const tt=new Date(G.createdAt);return!((F=de.dateRange)!=null&&F.from&&de.dateRange.from>tt||(me=de.dateRange)!=null&&me.to&&de.dateRange.to<tt)}case"role":return de.value?(Ve=G.role)==null?void 0:Ve.toLowerCase().includes(de.value.toLowerCase()):!0;default:return!0}});return ae&&ye}),I=s.filter(G=>G.banned).length,le=Math.ceil(He.length/x),ue=(d-1)*x,xe=ue+x,Te=He.slice(ue,xe),We=G=>{f(G)};return i?a.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Ys,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(Bs,{value:t.users??0,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),a.jsx("div",{className:"flex items-center space-x-4 mt-2",children:I>0&&a.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[a.jsx(lu,{className:"w-3 h-3"}),a.jsxs("span",{children:[I," Banned"]})]})})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(H,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:yt,children:[a.jsx(Cc,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),a.jsxs(H,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>S(!0),children:[a.jsx(Vt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(H,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>b(!0),children:[a.jsx(A0,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ri,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{placeholder:"Search users...",value:l,onChange:G=>c(G.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(ws,{value:"",onValueChange:Ht,children:[a.jsx(js,{className:"w-[180px]",children:a.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[a.jsx(Pr,{className:"w-4 h-4"}),a.jsx("span",{children:"Add Filter"})]})}),a.jsxs(Ns,{children:[!u.some(G=>G.type==="emailVerified")&&a.jsx(Fe,{value:"emailVerified",children:"Email Verified"}),!u.some(G=>G.type==="banned")&&a.jsx(Fe,{value:"banned",children:"Banned Status"}),!u.some(G=>G.type==="createdAt")&&a.jsx(Fe,{value:"createdAt",children:"Created Date"}),!u.some(G=>G.type==="role")&&a.jsx(Fe,{value:"role",children:"Role"})]})]})}),u.length>0&&a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(H,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),u.length>0&&a.jsx("div",{className:"space-y-3",children:a.jsx("div",{className:"flex flex-wrap gap-3",children:u.map(G=>{var ae,ye,de,Se;return a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[a.jsx(gp,{className:"w-3 h-3 text-white"}),G.type==="emailVerified"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),a.jsxs(ws,{value:G.value||"",onValueChange:W=>te("emailVerified",W),children:[a.jsx(js,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:G.value==="true"?"True":G.value==="false"?"False":"Select"})}),a.jsxs(Ns,{children:[a.jsx(Fe,{value:"true",children:"True"}),a.jsx(Fe,{value:"false",children:"False"})]})]})]}),G.type==="banned"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Banned:"}),a.jsxs(ws,{value:G.value||"",onValueChange:W=>te("banned",W),children:[a.jsx(js,{className:"h-7 w-24 text-xs",children:a.jsx("span",{children:G.value==="true"?"Yes":G.value==="false"?"No":"Select"})}),a.jsxs(Ns,{children:[a.jsx(Fe,{value:"true",children:"Yes"}),a.jsx(Fe,{value:"false",children:"No"})]})]})]}),G.type==="createdAt"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Created:"}),a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Ah,{className:"mr-1 h-3 w-3"}),(ae=G.dateRange)!=null&&ae.from?fs(G.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:(ye=G.dateRange)==null?void 0:ye.from,onSelect:W=>{var F;return be("createdAt",{from:W,to:(F=G.dateRange)==null?void 0:F.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Ah,{className:"mr-1 h-3 w-3"}),(de=G.dateRange)!=null&&de.to?fs(G.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:(Se=G.dateRange)==null?void 0:Se.to,onSelect:W=>{var F;return be("createdAt",{from:(F=G.dateRange)==null?void 0:F.from,to:W})},initialFocus:!0,disabled:W=>{var F;return(F=G.dateRange)!=null&&F.from?W<G.dateRange.from:!1},className:"rounded-none"})})]})]}),G.type==="role"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-white",children:"Role:"}),a.jsx(Le,{type:"text",value:G.value||"",onChange:W=>te("role",W.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),a.jsx("button",{onClick:()=>It(G.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(an,{className:"w-3 h-3 text-white"})})]},G.type)})})})]}),a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"overflow-x-auto overflow-y-hidden",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:Te.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"py-12 px-4 text-center",children:a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Ui,{className:"w-8 h-8 text-white/50"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||u.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&u.length===0&&a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(H,{onClick:()=>b(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[a.jsx(A0,{className:"w-4 h-4 mr-2"}),"Create User"]}),a.jsxs(H,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Vt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):Te.map(G=>a.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${G.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${G.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:G.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${G.id}`,alt:G.name,className:`w-10 h-10 rounded-none border border-dashed ${G.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),G.banned&&a.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:a.jsx(lu,{className:"w-3 h-3 text-white"})})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-white font-light",children:G.name}),G.banned&&a.jsx("span",{className:"px-2 py-0.5 text-[10px] font-semibold bg-red-500/20 border border-red-500/50 text-red-400 rounded-sm uppercase tracking-wide",children:"Banned"})]}),a.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:G.email})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[G.emailVerified?a.jsx(T0,{className:"w-4 h-4 text-green-400"}):a.jsx(Oh,{className:"w-4 h-4 text-yellow-400"}),a.jsx("span",{className:"text-sm text-gray-400",children:G.emailVerified?"Verified":"Not Verified"})]})}),a.jsx("td",{className:"py-4 px-4",children:G.role?a.jsx("span",{className:"px-2 py-1 text-xs font-mono uppercase bg-white/5 border border-dashed border-white/15 text-white/80 rounded-sm tracking-wide",children:G.role}):a.jsx("span",{className:"text-sm text-gray-500",children:"—"})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:a.jsxs("div",{className:"flex flex-col",children:[new Date(G.createdAt).toLocaleDateString(),a.jsx("p",{className:"text-xs",children:new Date(G.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"relative flex items-center justify-end",children:[a.jsx(H,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ae=>{ae.stopPropagation(),_(T===G.id?null:G.id)},children:a.jsx(F4,{className:"w-4 h-4"})}),T===G.id&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:ae=>ae.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ae=>{ae.stopPropagation(),_(null),Be(G)},children:[a.jsx(Nl,{className:"w-4 h-4"}),a.jsx("span",{children:"View"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ae=>{ae.stopPropagation(),_(null),dt(G)},children:[a.jsx(zi,{className:"w-4 h-4"}),a.jsx("span",{children:"Edit User"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:ae=>{ae.stopPropagation(),_(null),R(G),Y(!0)},children:[a.jsx(yn,{className:"w-4 h-4"}),a.jsx("span",{children:"Update Password"})]}),O&&(G.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:ae=>{ae.stopPropagation(),R(G),$(!0),_(null)},children:[a.jsx(lu,{className:"w-4 h-4"}),a.jsx("span",{children:"Unban User"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:ae=>{ae.stopPropagation(),R(G),A(!0),_(null)},children:[a.jsx(lu,{className:"w-4 h-4"}),a.jsx("span",{children:"Ban User"})]})),a.jsx("div",{className:"border-t border-white/10 my-1"}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:ae=>{ae.stopPropagation(),_(null),Ie(G)},children:[a.jsx(_f,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]},G.id))})]})}),a.jsx(f5,{currentPage:d,totalPages:le,onPageChange:We,totalItems:He.length,startIndex:ue,endIndex:xe})]}),C&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"overflow-x-hidden bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(Ui,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{S(!1),ee("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center space-x-2"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center space-x-3",children:a.jsxs("div",{className:"flex-1",children:[a.jsx(Me,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),a.jsx(Le,{id:"user-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Me,{htmlFor:"seed-role",className:"text-sm text-gray-400 font-light",children:"Role (optional)"}),a.jsxs(ws,{className:"bg-black text-white",value:ne,onValueChange:ee,children:[a.jsx(js,{id:"seed-role",className:"mt-1 border border-dashed border-white/20 bg-black text-white rounded-none",children:a.jsx(Br,{placeholder:"Select role (optional)"})}),a.jsxs(Ns,{children:[a.jsx(Fe,{value:"",children:"None"}),a.jsx(Fe,{value:"admin",children:"Admin"}),a.jsx(Fe,{value:"user",children:"User"}),a.jsx(Fe,{value:"mix",children:"Mix (Random)"})]})]})]}),a.jsx(H,{onClick:()=>{var ae;const G=parseInt(((ae=document.getElementById("user-count"))==null?void 0:ae.value)||"5",10);Re(G,ne||void 0)},disabled:he,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:he?a.jsxs(a.Fragment,{children:[a.jsx(Ys,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Vt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),pe.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Zr,{title:"User Seeding Terminal",lines:pe,isRunning:he,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(H,{variant:"outline",onClick:()=>{S(!1),ee("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{b(!1),se("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Le,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),a.jsx(Le,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"create-role",className:"text-sm text-gray-400 font-light",children:"Role"}),a.jsxs(ws,{className:"bg-black text-white",value:J,onValueChange:se,children:[a.jsx(js,{id:"create-role",className:"mt-1 border border-dashed border-white/20 bg-black text-white rounded-none",children:a.jsx(Br,{placeholder:"Select role"})}),a.jsxs(Ns,{children:[a.jsx(Fe,{value:"",children:"None"}),a.jsx(Fe,{value:"admin",children:"Admin"}),a.jsx(Fe,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{b(!1),se("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:St,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),w&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{g(!1),Z("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"edit-name",defaultValue:E.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),a.jsx(Le,{id:"edit-email",type:"email",defaultValue:E.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-role",className:"text-sm text-gray-400 font-light",children:"Role"}),a.jsxs(ws,{value:X,onValueChange:Z,children:[a.jsx(js,{id:"edit-role",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Br,{placeholder:"Select role"})}),a.jsxs(Ns,{children:[a.jsx(Fe,{value:"",children:"None"}),a.jsx(Fe,{value:"admin",children:"Admin"}),a.jsx(Fe,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{g(!1),Z("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:bt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),v&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:qe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),j&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ln,{id:E.id,variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),a.jsx("span",{className:"text-white text-sm",children:E.emailVerified?"Yes":"No"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(E.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(E.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(H,{onClick:()=>N(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),M&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:E.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Le,{id:"banReason",value:k,onChange:G=>D(G.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Le,{id:"banExpires",type:"number",value:L||"",onChange:G=>q(G.target.value?Number(G.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{A(!1),D(""),q(void 0),R(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:et,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),V&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:E.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{$(!1),R(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:Qe,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),z&&E&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{Y(!1),R(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:E.name}),a.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),a.jsx(Le,{id:"update-password",type:"password",placeholder:"Enter new password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{Y(!1),R(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:vt,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const Jl=[{id:"signups",label:"Signups",analyticsKey:"newUsers",barClass:"bg-white/25 border border-white/10",dotClass:"bg-white/25"},{id:"logins",label:"Logins",analyticsKey:"activeUsers",barClass:"bg-white/20 border border-white/10",dotClass:"bg-white/20"},{id:"organizations",label:"Organizations",analyticsKey:"organizations",barClass:"bg-white/15 border border-white/10",dotClass:"bg-white/15"},{id:"teams",label:"Teams",analyticsKey:"teams",barClass:"bg-white/10 border border-white/10",dotClass:"bg-white/10"},{id:"sessions",label:"Sessions",analyticsKey:"sessions",barClass:"bg-white/5 border border-white/10",dotClass:"bg-white/5"}];function cV(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[s,r]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[u,h]=m.useState("1D"),[d,f]=m.useState(null),[x,y]=m.useState(!1),[b,w]=m.useState("Daily"),[g,v]=m.useState("Daily"),[p,j]=m.useState("Daily"),[N,C]=m.useState("Daily"),[S,M]=m.useState(!1),[A,V]=m.useState(!1),[$,z]=m.useState(!1),[Y,E]=m.useState(!1),[R,T]=m.useState(null),[_,k]=m.useState(null),[D,L]=m.useState(null),[q,O]=m.useState(null),[B,X]=m.useState(null),[Z,ne]=m.useState(void 0),[ee,J]=m.useState(void 0),[se,pe]=m.useState(void 0),[re,he]=m.useState(void 0),[fe,ke]=m.useState(void 0),[Oe,Re]=m.useState(void 0),[Be,dt]=m.useState(void 0),[Ie,St]=m.useState(void 0),[bt,qe]=m.useState([]),[et,Qe]=m.useState([]),[vt,yt]=m.useState(0),[Ht,It]=m.useState([]),[te,be]=m.useState([]),[He,I]=m.useState(0),[le,ue]=m.useState(0),[xe,Te]=m.useState(0),[We,G]=m.useState(0),[ae,ye]=m.useState(0),[de,Se]=m.useState(!1),[W,F]=m.useState(!1),[me,Ve]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[tt,nt]=m.useState([]),[Ke,Gt]=m.useState(!1),[cn,en]=m.useState(0),[Ft,Na]=m.useState(0),[mn,Cn]=m.useState(0),[Ds,Ee]=m.useState(0),[Bn,Sa]=m.useState(0),[_n,_s]=m.useState([]),[nr,kt]=m.useState(0),[sr,ar]=m.useState(0),[ni,Vn]=m.useState(0),{counts:bn,loading:tn}=Vf(),kn=Gs(),us=["Daily","Weekly","Monthly","Yearly","Custom"],qi={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},Ml=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),Qs=ge=>ge==null?"...":Ml.format(Number(ge)),As=ge=>ge==null?"...":Number(ge).toLocaleString(),si=m.useMemo(()=>Jl.reduce((ge,we)=>(ge[we.id]=(me[we.id]||[]).reduce((je,ce)=>je+ce,0),ge),{}),[me]),Gi=m.useMemo(()=>Object.values(si).reduce((ge,we)=>ge+we,0),[si]),Tl=(ge,we)=>{const je=ge.currentTarget.getBoundingClientRect();O(we),X({x:je.left+je.width/2,y:je.top})},Xi=(()=>{const ge=[];return R!=null&&R.isOutdated?ge.push({id:"version-check",title:`Update Better-Auth to v${R.latest}`,severity:"high",date:new Date().toISOString().split("T")[0],description:"Your current version is outdated. Update to the latest version to get the latest security fixes, features, and improvements. Run: `pnpm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):R&&ge.push({id:"version-check",title:"Better-Auth is Up to date",severity:"low",date:new Date().toISOString().split("T")[0],description:"You are running the latest version of better-auth. Great job keeping your dependencies up to date!",affectedComponents:["All Components"],status:"applied",cve:""}),ge.push(),ge.push({id:"3",title:"Rate Limiting Configuration",severity:"medium",date:new Date().toISOString().split("T")[0],description:"Configure rate limiting for authentication endpoints to prevent brute force attacks. Better-auth provides built-in rate limiting middleware.",affectedComponents:["Auth Endpoints"],status:"pending"}),ge})(),wt=m.useCallback(async(ge,we,je,ce)=>{try{const Ce=new URLSearchParams({type:ge,period:we});return je&&Ce.append("from",je.toISOString()),ce&&Ce.append("to",ce.toISOString()),await(await fetch(`/api/analytics?${Ce.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const je=await(await fetch("/api/users/all")).json();je!=null&&je.success&&je.users&&_s(je.users)}catch{_s([])}})()},[]),m.useEffect(()=>{(async()=>{try{const je=await(await fetch("/api/stats")).json();je&&r(je.activeUsers||0)}catch{r(0)}})()},[]),m.useEffect(()=>{(async()=>{const we=await wt("users",l,Z,ee);we&&(qe(we.data||[]),Qe(we.labels||[]),yt(we.percentageChange||0))})()},[l,Z,ee,wt]),m.useEffect(()=>{if(_n.length===0){kt(0),ar(0);return}const ge=new Date;let we,je=ge,ce,Ce;if(g==="Custom"){if(!se||!re){kt(0),ar(0);return}we=new Date(se),je=new Date(re),je.setHours(23,59,59,999);const ie=je.getTime()-we.getTime();Ce=new Date(we.getTime()-1),ce=new Date(Ce.getTime()-ie)}else switch(g){case"Daily":we=new Date(ge),we.setHours(0,0,0,0),Ce=new Date(we.getTime()-1),ce=new Date(Ce.getTime()-24*60*60*1e3);break;case"Weekly":we=new Date(ge),we.setDate(ge.getDate()-ge.getDay()),we.setHours(0,0,0,0),Ce=new Date(we.getTime()-1),ce=new Date(Ce.getTime()-7*24*60*60*1e3);break;case"Monthly":we=new Date(ge.getFullYear(),ge.getMonth(),1),we.setHours(0,0,0,0),Ce=new Date(we.getTime()-1),ce=new Date(ge.getFullYear(),ge.getMonth()-1,1),ce.setHours(0,0,0,0);break;case"Yearly":we=new Date(ge.getFullYear(),0,1),we.setHours(0,0,0,0),Ce=new Date(we.getTime()-1),ce=new Date(ge.getFullYear()-1,0,1),ce.setHours(0,0,0,0);break;default:kt(0),ar(0);return}const Ue=_n.filter(ie=>{if(!ie.createdAt)return!1;const ve=new Date(ie.createdAt);return ve>=we&&ve<=je}),De=_n.filter(ie=>{if(!ie.createdAt)return!1;const ve=new Date(ie.createdAt);return ve>=ce&&ve<=Ce}),Ne=Ue.length,U=De.length;let Q=0;U>0?Q=(Ne-U)/U*100:Ne>0&&(Q=100),kt(Ne),ar(Q)},[_n,g,se,re]),m.useEffect(()=>{(async()=>{if(!(u==="Custom"&&(!se||!re))){Gt(!0);try{const[we,je,ce,Ce,Ue]=await Promise.all([wt("newUsers",u,se,re),wt("activeUsers",u,se,re),wt("organizations",u,se,re),wt("teams",u,se,re),wt("sessions",u,se,re)]);we&&(It(we.data||[]),be(we.labels||[])),Ve({signups:(we==null?void 0:we.data)||[],logins:(je==null?void 0:je.data)||[],organizations:(ce==null?void 0:ce.data)||[],teams:(Ce==null?void 0:Ce.data)||[],sessions:(Ue==null?void 0:Ue.data)||[]}),nt((we==null?void 0:we.labels)||(je==null?void 0:je.labels)||(ce==null?void 0:ce.labels)||(Ce==null?void 0:Ce.labels)||(Ue==null?void 0:Ue.labels)||[])}finally{Gt(!1)}}})()},[u,se,re,wt]),m.useEffect(()=>{(async()=>{const we=await wt("activeUsers","1D");we&&I(we.percentageChange||0)})()},[wt]),m.useEffect(()=>{},[bn.organizations,bn.teams,tn]),m.useEffect(()=>{(async()=>{const we=qi[p]||"1D",je=we==="Custom";if(!(je&&(!fe||!Oe))){Se(!0);try{const ce=await wt("organizations",we,je?fe:void 0,je?Oe:void 0);ce&&(G(ce.total||0),ue(ce.percentageChange||0))}catch{G(0),ue(0)}finally{Se(!1)}}})()},[p,fe,Oe,wt]),m.useEffect(()=>{(async()=>{const we=qi[N]||"1D",je=we==="Custom";if(!(je&&(!Be||!Ie))){F(!0);try{const ce=await wt("teams",we,je?Be:void 0,je?Ie:void 0);ce&&(ye(ce.total||0),Te(ce.percentageChange||0))}catch{ye(0),Te(0)}finally{F(!1)}}})()},[N,Be,Ie,wt]),m.useEffect(()=>{(async()=>{const we=await wt("users","1D");we&&en(we.percentageChange||0);const je=await wt("organizations","1D");je&&Na(je.percentageChange||0);const ce=await wt("activeUsers","1D");ce&&Cn(ce.percentageChange||0);const[Ce,Ue,De,Ne,U]=await Promise.all([wt("newUsers","1D"),wt("activeUsers","1D"),wt("organizations","1D"),wt("teams","1D"),wt("sessions","1D")]);Ce?(o(Ce.total||0),Vn(Ce.percentageChange||0)):(o(0),Vn(0));const ie=[(Ce==null?void 0:Ce.total)||0,(Ue==null?void 0:Ue.total)||0,(De==null?void 0:De.total)||0,(Ne==null?void 0:Ne.total)||0,(U==null?void 0:U.total)||0].reduce((Ge,Et)=>Ge+Et,0);Sa(ie);const ze=[(Ce==null?void 0:Ce.previousTotal)||0,(Ue==null?void 0:Ue.previousTotal)||0,(De==null?void 0:De.previousTotal)||0,(Ne==null?void 0:Ne.previousTotal)||0,(U==null?void 0:U.previousTotal)||0].reduce((Ge,Et)=>Ge+Et,0);if(ze>0){const Ge=(ie-ze)/ze*100;Ee(Ge)}else ie>0?Ee(100):Ee(0)})()},[wt]),m.useEffect(()=>{(async()=>{try{const je=await(await fetch("/api/version-check")).json();je&&T({current:je.current||"1.0.0",latest:je.latest||"1.0.0",isOutdated:je.isOutdated||!1})}catch{try{const Ce=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",Ue="1.5.0";T({current:Ce,latest:Ue,isOutdated:Ce!==Ue})}catch{T({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const Zi=ge=>{switch(ge){case"critical":return"bg-white/10 text-white border-white/20";case"high":return"bg-white/10 text-white border-white/20";case"medium":return"bg-white/10 text-gray-300 border-white/20";case"low":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},Qi=ge=>{switch(ge){case"applied":return"bg-white/10 text-white border-white/20";case"scheduled":return"bg-white/10 text-gray-300 border-white/20";case"pending":return"bg-white/10 text-gray-400 border-white/20";default:return"bg-white/10 text-gray-400 border-white/20"}},Dl=ge=>{f(ge),y(!0)},ai=()=>{y(!1),setTimeout(()=>f(null),300)},Ca=(ge,we="users")=>{const je=we==="users"?et:te,Ce={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[ge]||7;if(je&&je.length>0&&je.length===Ce)return ge==="1D"?je.filter((De,Ne)=>Ne%4===0).map(De=>{const Ne=parseInt(De.replace("h",""),10);return Ne===0?"12am":Ne<12?`${Ne}am`:Ne===12?"12pm":`${Ne-12}pm`}):ge==="1W"?je.map(De=>De.length>3?De.substring(0,3):De):ge==="1M"?je.map(De=>{const Ne=De.split(" ");return Ne.length>=2?Ne[1]:De}):ge==="1Y"||ge==="3M"||ge==="6M"?je.map(De=>De.length>3?De.substring(0,3):De):je.map(De=>De.length>3?De.substring(0,3):De);const Ue=new Date;switch(ge){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(De,Ne)=>new Date(Ue.getTime()-(6-Ne)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(De,Ne)=>new Date(Ue.getTime()-(29-Ne)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(De,Ne)=>new Date(Ue.getFullYear(),Ue.getMonth()-(2-Ne),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(De,Ne)=>new Date(Ue.getFullYear(),Ue.getMonth()-(5-Ne),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(De,Ne)=>new Date(Ue.getFullYear(),Ue.getMonth()-(11-Ne),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(De,Ne)=>new Date(Ue.getFullYear(),Ue.getMonth()-(6-Ne),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},_l=(ge,we="users")=>{const je=we==="users"?et:te,Ce={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[ge]||7;if(je&&je.length>0&&je.length===Ce)return ge==="1D"?je.map(De=>{const Ne=parseInt(De.replace("h",""),10);return Ne===0?"12am":Ne<12?`${Ne}am`:Ne===12?"12pm":`${Ne-12}pm`}):ge==="1Y"||ge==="3M"||ge==="6M"?je.map(De=>{const Ne=["January","February","March","April","May","June","July","August","September","October","November","December"],Q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(De);return Q!==-1?Ne[Q]:De}):je;const Ue=new Date;switch(ge){case"1D":return Array.from({length:24},(De,Ne)=>{const U=new Date;return U.setHours(Ne,0,0,0),U.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(De,Ne)=>new Date(Ue.getTime()-(6-Ne)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(De,Ne)=>{const U=new Date(Ue.getTime()-(29-Ne)*24*60*60*1e3),Q=U.toLocaleDateString("en-US",{month:"short"}),ie=U.getDate();return`${Q} ${ie}`});case"3M":return Array.from({length:3},(De,Ne)=>new Date(Ue.getFullYear(),Ue.getMonth()-(2-Ne),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(De,Ne)=>new Date(Ue.getFullYear(),Ue.getMonth()-(5-Ne),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(De,Ne)=>new Date(Ue.getFullYear(),Ue.getMonth()-(11-Ne),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(De,Ne)=>new Date(Ue.getFullYear(),Ue.getMonth()-(6-Ne),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},Al=(ge,we="users")=>{const je=we==="users"?bt:Ht,Ce={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[ge]||7;if(!je||je.length===0)return Array(Ce).fill(0);const Ue=[...je];for(;Ue.length<Ce;)Ue.push(0);const De=Ue.slice(0,Ce),Ne=Math.max(...De,1);return De.map(U=>U/Ne*100)},Ki=()=>{const ge=tt.length>0?tt:Ca(u,"users"),we=ge.map((ce,Ce)=>Jl.reduce((Ue,De)=>{var Ne;return Ue+(((Ne=me[De.id])==null?void 0:Ne[Ce])??0)},0)),je=Math.max(...we,1);return a.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[a.jsx("div",{className:"px-6 overflow-hidden",children:a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-white/5 border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(jt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:tn?"...":Qs(bn.users)}),a.jsxs("div",{className:`flex items-center gap-1 ${cn>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${cn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(cn).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Jn,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),a.jsx("span",{className:"text-white text-lg font-medium",children:tn?"...":Qs(bn.organizations)}),a.jsxs("div",{className:`flex items-center gap-1 ${Ft>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Ft<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Ft).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(zw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),a.jsx("span",{className:"text-white text-lg font-medium",children:tn?"...":Qs(bn.sessions)}),a.jsxs("div",{className:`flex items-center gap-1 ${mn>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${mn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(mn).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Aw,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Activity Hits"}),a.jsx("span",{className:"text-white text-lg font-medium",children:tn?"...":Qs(Bn??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${Ds>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${Ds<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Ds).toFixed(1),"%"]})]})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(jt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),a.jsx("span",{className:"text-white text-lg font-medium",children:tn?"...":Qs(i??0)}),a.jsxs("div",{className:`flex items-center gap-1 ${ni>=0?"text-green-500":"text-red-500"}`,children:[a.jsx("svg",{className:`w-3 h-3 ${ni<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(ni).toFixed(1),"%"]})]})]})]})]})}),a.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(ce=>a.jsx("button",{onClick:()=>c(ce),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===ce?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ce},ce))})]}),a.jsxs("div",{className:"flex justify-between items-end mb-6",children:[a.jsx("p",{className:"text-4xl text-white font-light",children:tn?"...":Qs(bn.users)}),a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[a.jsx("svg",{className:`w-3 h-3 ${vt>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${vt>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(vt).toFixed(1),"%"]})]})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsxs("div",{className:"h-32 relative",children:[a.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:a.jsx("defs",{children:a.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[a.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),a.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),a.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:Al(l,"users").map((ce,Ce)=>{const Ue=_===Ce;return a.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${ce}%`,background:"url(#usersBarGradient)"},onMouseEnter:De=>{const Ne=De.currentTarget.getBoundingClientRect(),U=Ne.left+Ne.width/2,Q=Ne.top,ie=150,ve=60,ze=Math.max(ie/2,Math.min(window.innerWidth-ie/2,U)),Ge=Math.max(ve+10,Math.min(window.innerHeight-10,Q));k(Ce),L({x:ze,y:Ge})},onMouseLeave:()=>{k(null),L(null)},children:a.jsx("div",{className:"w-full h-full",style:{background:"linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05))",opacity:Ue?1:.8}})},Ce)})}),_!==null&&D&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${D.x}px`,top:`${D.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:_l(l,"users")[_]}),a.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[bt[_]!==void 0?bt[_].toLocaleString():"0"," ",a.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),a.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:Ca(l,"users").map((ce,Ce)=>a.jsx("span",{className:"flex-1 text-center truncate",children:ce},Ce))})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),a.jsx("p",{className:"text-4xl text-white font-light mt-1",children:Ke?"...":As(Gi)}),a.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),a.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(ce=>a.jsx("button",{onClick:()=>h(ce),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${u===ce?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ce},ce))})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsx("div",{className:"h-40 flex items-end gap-1",children:ge.map((ce,Ce)=>{const Ue=we[Ce]||0;return a.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:De=>Tl(De,Ce),onMouseLeave:()=>{O(null),X(null)},children:Jl.map(De=>{var Q;const Ne=((Q=me[De.id])==null?void 0:Q[Ce])??0,U=Ue===0||je===0?0:Math.max(Ne/je*100,Ne>0?4:0);return a.jsx("div",{className:`w-full ${De.barClass}`,style:{height:`${U}%`}},`${De.id}-${Ce}`)})},`${ce}-${Ce}`)})}),Ke&&a.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center text-xs uppercase text-gray-400 pointer-events-none",children:"Loading activity..."}),q!==null&&B&&a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${B.x}px`,top:`${B.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg min-w-[180px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:ge[q]||`Bucket ${q+1}`}),a.jsx("div",{className:"space-y-1",children:Jl.map(ce=>{var Ce;return a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${ce.dotClass}`}),ce.label]}),a.jsx("span",{className:"text-white font-medium",children:((Ce=me[ce.id])==null?void 0:Ce[q])??0})]},ce.id)})})]})}),a.jsx("div",{className:`flex justify-between ${u==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:ge.map((ce,Ce)=>a.jsx("span",{className:"flex-1 text-center truncate",children:ce},Ce))}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:Jl.map(ce=>a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`w-2 h-2 rounded-sm ${ce.dotClass}`}),ce.label]}),a.jsx("span",{className:"text-white font-medium",children:Ke?"...":As(si[ce.id]||0)})]},ce.id))})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>M(!S),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(gu,{className:"w-3 h-3"}),a.jsx("span",{children:b})]}),S&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:us.map(ce=>a.jsx("button",{onClick:()=>{w(ce),M(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ce},ce))})]}),b==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(zs,{className:"mr-1 h-3 w-3"}),Z?fs(Z,"MMM dd yyyy"):"From"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:Z,onSelect:ne,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(zs,{className:"mr-1 h-3 w-3"}),ee?fs(ee,"MMM dd yyyy"):"To"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:ee,onSelect:J,initialFocus:!0,disabled:ce=>Z?ce<Z:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:As(s)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${He>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${He>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(He).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>V(!A),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(gu,{className:"w-3 h-3"}),a.jsx("span",{children:g})]}),A&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:us.map(ce=>a.jsx("button",{onClick:()=>{v(ce),V(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ce},ce))})]}),g==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(zs,{className:"mr-1 h-3 w-3"}),se?fs(se,"MMM dd yyyy"):"From"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:se,onSelect:pe,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(zs,{className:"mr-1 h-3 w-3"}),re?fs(re,"MMM dd yyyy"):"To"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:re,onSelect:he,initialFocus:!0,disabled:ce=>se?ce<se:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:As(nr)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${sr>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:sr<0?{transform:"rotate(180deg)"}:{},children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${sr>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(sr).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>z(!$),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(gu,{className:"w-3 h-3"}),a.jsx("span",{children:p})]}),$&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:us.map(ce=>a.jsx("button",{onClick:()=>{j(ce),z(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ce},ce))})]}),p==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(zs,{className:"mr-1 h-3 w-3"}),fe?fs(fe,"MMM dd yyyy"):"From"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:fe,onSelect:ke,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(zs,{className:"mr-1 h-3 w-3"}),Oe?fs(Oe,"MMM dd yyyy"):"To"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:Oe,onSelect:Re,initialFocus:!0,disabled:ce=>fe?ce<fe:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:de?"...":As(We)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${le>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${le>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(le).toFixed(1),"%"]})]})})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>E(!Y),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[a.jsx(gu,{className:"w-3 h-3"}),a.jsx("span",{children:N})]}),Y&&a.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:us.map(ce=>a.jsx("button",{onClick:()=>{C(ce),E(!1)},className:"block border-b border-dashed border-white/5 w-full text-left px-4 py-2 text-xs text-white hover:bg-white/10 transition-colors whitespace-nowrap",children:ce},ce))})]}),N==="Custom"&&a.jsxs("div",{className:"h-0 flex items-center gap-2",children:[a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(zs,{className:"mr-1 h-3 w-3"}),Be?fs(Be,"MMM dd yyyy"):"From"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:Be,onSelect:dt,initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(xs,{children:[a.jsx(gs,{asChild:!0,children:a.jsxs(H,{variant:"outline",className:"h-6 px-2 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(zs,{className:"mr-1 h-3 w-3"}),Ie?fs(Ie,"MMM dd yyyy"):"To"]})}),a.jsx(Qn,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(ms,{mode:"single",selected:Ie,onSelect:St,initialFocus:!0,disabled:ce=>Be?ce<Be:!1,className:"rounded-none"})})]})]})]}),a.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),a.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),a.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),a.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[a.jsx("p",{className:"text-3xl text-white font-light",children:W?"...":As(ae)}),a.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:a.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[a.jsx("svg",{className:`w-3 h-3 ${xe>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:a.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),a.jsxs("span",{className:`text-xs font-medium ${xe>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(xe).toFixed(1),"%"]})]})})]})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),a.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(yn,{className:"w-4 h-4 text-white/60"}),a.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),a.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),a.jsxs("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:[Xi.length===0&&a.jsx("div",{className:"text-sm flex items-center justify-center text-gray-400",children:a.jsxs("div",{className:"flex mt-5 items-center justify-center",children:[a.jsx(yn,{className:"w-4 h-4 text-gray-400 mr-2"}),a.jsx("p",{className:"text-center",children:"No security insights found"})]})}),Xi.map((ce,Ce)=>a.jsx("div",{onClick:()=>Dl(ce),className:"group py-2 border-b border-white/5 cursor-pointer transition-all duration-200 hover:border-white/20",style:{animation:`slideIn 0.3s ease-out ${Ce*.1}s both`},children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:a.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:ce.title})}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${Zi(ce.severity)}`,children:ce.severity}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${Qi(ce.status)}`,children:ce.status})]})]}),a.jsx(g7,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},ce.id))]})]})]})]})]})};return a.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[a.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?Ki():e==="users"?a.jsx(x5,{}):e==="organizations"?a.jsx(m5,{}):Ki()}),t&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(zw,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("button",{onClick:()=>{n(!1),kn("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(jt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),a.jsx(vr,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),kn("/organizations")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(Jn,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),a.jsx(vr,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),kn("/sessions")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(Aw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),a.jsx(vr,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),kn("/database")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(Ya,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),a.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),a.jsx(vr,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),kn("/settings")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(o5,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),a.jsx(vr,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),a.jsxs("button",{onClick:()=>{n(!1),kn("/users")},className:"flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none hover:bg-black/50 transition-colors text-left group",children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:a.jsx(r5,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),a.jsx(vr,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),a.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[a.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),x&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",style:{animation:"fadeIn 0.3s ease-out"},onClick:ai,children:a.jsxs("div",{className:"bg-black border border-white/20 rounded-none max-w-2xl w-full max-h-[80vh] overflow-y-auto",style:{animation:"slideUp 0.3s ease-out"},onClick:ge=>ge.stopPropagation(),children:[a.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(yn,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:d.title})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${Zi(d.severity)}`,children:[d.severity," Severity"]}),a.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${Qi(d.status)}`,children:d.status}),d.cve&&a.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:d.cve})]})]}),a.jsx("button",{onClick:ai,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:a.jsx(_t,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),a.jsx("p",{className:"text-white",children:new Date(d.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),d.description.includes("npm install")?a.jsxs("div",{children:[a.jsx("p",{className:"text-white leading-relaxed mb-3",children:d.description.split("Run:")[0]}),a.jsx("div",{className:"relative group",children:a.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("code",{children:[a.jsx("span",{className:"text-green-400",children:"$"})," ",a.jsx("span",{className:"text-cyan-400",children:"npm"})," ",a.jsx("span",{className:"text-yellow-400",children:"install"})," ",a.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),a.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),P.success("Command copied to clipboard")},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-white/10 rounded",title:"Copy command",children:a.jsx(_a,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):a.jsx("p",{className:"text-white leading-relaxed",children:d.description})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:d.affectedComponents.map((ge,we)=>a.jsxs("div",{className:"flex items-center gap-2 p-3 bg-white/5 border border-white/10 rounded-none",style:{animation:`slideIn 0.3s ease-out ${we*.1}s both`},children:[a.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),a.jsx("span",{className:"text-sm text-white",children:ge})]},we))})]}),a.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:a.jsxs("div",{className:"flex items-start gap-3",children:[d.status==="applied"&&a.jsxs(a.Fragment,{children:[a.jsx(Ih,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),d.status==="scheduled"&&a.jsxs(a.Fragment,{children:[a.jsx(i5,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),d.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsx(VB,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),a.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),a.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:a.jsx(H,{variant:"ghost",onClick:ai,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),a.jsx("style",{children:`
450
- @keyframes fadeIn {
451
- from {
452
- opacity: 0;
453
- }
454
- to {
455
- opacity: 1;
456
- }
457
- }
458
-
459
- @keyframes slideUp {
460
- from {
461
- opacity: 0;
462
- transform: translateY(20px);
463
- }
464
- to {
465
- opacity: 1;
466
- transform: translateY(0);
467
- }
468
- }
469
-
470
- @keyframes slideIn {
471
- from {
472
- opacity: 0;
473
- transform: translateX(-10px);
474
- }
475
- to {
476
- opacity: 1;
477
- transform: translateX(0);
478
- }
479
- }
480
-
481
- .custom-scrollbar::-webkit-scrollbar {
482
- width: 6px;
483
- }
484
-
485
- .custom-scrollbar::-webkit-scrollbar-track {
486
- background: rgba(255, 255, 255, 0.05);
487
- }
488
-
489
- .custom-scrollbar::-webkit-scrollbar-thumb {
490
- background: rgba(255, 255, 255, 0.2);
491
- border-radius: 3px;
492
- }
493
-
494
- .custom-scrollbar::-webkit-scrollbar-thumb:hover {
495
- background: rgba(255, 255, 255, 0.3);
496
- }
497
- `})]})}const Fn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));Fn.displayName="Card";const Wn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));Wn.displayName="CardHeader";const qn=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));qn.displayName="CardTitle";const ta=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Pe("text-sm text-gray-300",e),...t}));ta.displayName="CardDescription";const Gn=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));Gn.displayName="CardContent";const dV=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",e),...t}));dV.displayName="CardFooter";const uV={databaseSchemaNode:H0};function hV(){const[e,t]=m.useState(null),[n,s]=m.useState(!0),[r,i]=m.useState(null),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d,f]=$9([]),[x,y,b]=L9([]),[w,g]=m.useState(null);m.useEffect(()=>(w?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[w]);const v=m.useCallback(async()=>{try{const M=await(await fetch("/api/plugins")).json();M.plugins&&Array.isArray(M.plugins)&&l(M.plugins.filter(A=>A.enabled))}catch{}},[]),p=m.useCallback(async()=>{try{s(!0);const M=await(await fetch("/api/database/schema")).json();M.success?t(M.schema):i(M.error||"Failed to fetch schema")}catch{i("Failed to fetch database schema")}finally{s(!1)}},[]);m.useEffect(()=>{v(),p()},[v,p]),m.useEffect(()=>{if(!e||o.length===0){u([]);return}const S=o.map(M=>{const A=e.tables.filter(Y=>(Y.origin||"core")===M.id),V=A.length,$=A.reduce((Y,E)=>Y+E.fields.length,0),z=A.reduce((Y,E)=>Y+E.relationships.length,0);return{pluginId:M.id,pluginName:M.name||M.id,tableCount:V,fieldCount:$,relationshipCount:z}});u(S.filter(M=>M.tableCount>0))},[e,o]),m.useEffect(()=>{if(!e)return;const S=[],M=[];e.tables.forEach((A,V)=>{const $=A.origin||"core",z=A.fields.map(Y=>({id:`${A.name}-${Y.name}`,isPrimary:Y.primaryKey||!1,isNullable:!Y.required,isUnique:Y.unique||!1,isIdentity:!1,name:Y.name,format:Y.type,plugin:$,description:Y.description}));S.push({id:A.name,type:"databaseSchemaNode",position:{x:V%3*380,y:Math.floor(V/3)*320},data:{name:A.name,displayName:A.displayName,isForeign:!1,plugin:$,columns:z,relationships:A.relationships}})}),e.tables.forEach(A=>{A.relationships.forEach(V=>{const $=A.name,z=V.target,Y=S.find(R=>R.id===$),E=S.find(R=>R.id===z);if(Y&&E){const R=V.type==="one-to-one"?"1:1":V.type==="many-to-one"?"N:1":"1:N";M.push({id:`${$}-${z}-${V.field}`,source:$,target:z,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:R,labelStyle:{fontSize:"11px",fill:"#9ca3af",fontWeight:"500"},labelBgStyle:{fill:"rgba(0, 0, 0, 0.9)",fillOpacity:1,borderRadius:4},markerEnd:{type:"arrowclosed",color:"#6b7280",width:12,height:12}})}})}),d(S),y(M)},[e,d,y]);const j=m.useCallback(S=>y(M=>FN(S,M)),[y]);if(n)return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"animate-pulse",children:[a.jsx("div",{className:"h-8 bg-gray-700 rounded w-1/3 mb-6"}),a.jsx("div",{className:"h-96 bg-gray-700 rounded"})]}),a.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 mt-4",children:"Loading schema..."})]});if(r)return a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"bg-red-900/20 border border-red-500/20 rounded-none p-6",children:[a.jsx("h2",{className:"text-xl font-semibold text-red-400 mb-2",children:"Error Loading Schema"}),a.jsx("p",{className:"text-gray-300",children:r})]})});const N=S=>{if(!S||!e)return;const M=e.tables.find(A=>A.name===S);M&&g(M)},C=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-8",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Schema Visualizer"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Visualize your Better Auth database schema with interactive tables and relationships."})]})}),a.jsxs("div",{className:"flex flex-col items-center space-y-8 mb-4",children:[a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"})]})]}),a.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-6 mt-6",children:[a.jsxs("div",{className:"col-span-1 space-y-4",children:[a.jsxs(Fn,{className:"rounded-none bg-black h-fit shadow-sm border border-white/15",children:[a.jsx(Wn,{className:"border-b border-white/15 pb-3 -pt-2 mb-2",children:a.jsxs(qn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[a.jsx(Ho,{className:"w-4 h-4"}),a.jsx("span",{className:"uppercase font-mono text-xs tracking-tight",children:"Detected Tables"})]})}),a.jsx(Gn,{className:"space-y-3",children:e&&e.tables.length>0?a.jsx("div",{className:"space-y-3 max-h-80 overflow-y-auto pr-1 custom-scroll",children:e.tables.map(S=>a.jsxs("button",{onClick:()=>g(S),className:"w-full text-left border border-white/10 p-3 rounded-none hover:border-white/20 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm text-white",children:[a.jsx("span",{children:S.displayName}),a.jsx("span",{className:"text-xs uppercase font-mono text-gray-400",children:S.origin==="core"?"Core":"Extended"})]}),a.jsxs("div",{className:"text-xs text-gray-400 mt-1",children:[S.fields.length," fields · ",S.relationships.length," relationships"]})]},S.name))}):a.jsx("div",{className:"text-sm text-white/70",children:"No tables detected in Better Auth context"})})]}),e&&a.jsxs(Fn,{className:"rounded-none bg-black shadow-sm border border-white/15",children:[a.jsx(Wn,{className:"border-b border-white/15 pb-3 -pt-2 mb-2",children:a.jsxs(qn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[a.jsx(a5,{className:"w-4 h-4"}),a.jsx("span",{className:"uppercase font-mono text-xs tracking-tight",children:"Schema Summary"})]})}),a.jsxs(Gn,{className:"space-y-3 pt-2",children:[a.jsxs("div",{className:"flex justify-between items-baseline",children:[a.jsx("span",{className:"text-gray-400 uppercase font-mono text-xs tracking-wider",children:"Tables"}),a.jsx("span",{className:"text-white text-sm font-mono font-light",children:e.tables.length})]}),a.jsxs("div",{className:"flex justify-between items-baseline",children:[a.jsx("span",{className:"text-gray-400 uppercase font-mono text-xs tracking-wider",children:"Total Fields"}),a.jsx("span",{className:"text-white text-sm font-mono font-light",children:e.tables.reduce((S,M)=>S+M.fields.length,0)})]}),a.jsxs("div",{className:"flex justify-between items-baseline",children:[a.jsx("span",{className:"text-gray-400 uppercase font-mono text-xs tracking-wider",children:"Relationships"}),a.jsx("span",{className:"text-white text-sm font-mono font-light",children:e.tables.reduce((S,M)=>S+M.relationships.length,0)})]})]})]}),c.length>0&&a.jsxs(Fn,{className:"rounded-none bg-black shadow-sm border border-white/15",children:[a.jsx(Wn,{children:a.jsx(qn,{className:"text-white text-sm",children:"Enabled Plugins"})}),a.jsx(Gn,{className:"space-y-3 text-sm",children:c.map(S=>a.jsxs("div",{className:"p-3 border border-white/15 bg-black/40 rounded-none",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("span",{className:"text-white font-medium capitalize",children:S.pluginName})}),a.jsxs("div",{className:"space-y-1 text-xs text-gray-400",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Tables:"}),a.jsx("span",{className:"text-white/80",children:S.tableCount})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Fields:"}),a.jsx("span",{className:"text-white/80",children:S.fieldCount})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Relationships:"}),a.jsx("span",{className:"text-white/80",children:S.relationshipCount})]})]})]},S.pluginId))})]})]}),a.jsx("div",{className:"col-span-3",children:a.jsx("div",{className:"h-full bg-black border border-white/20 rounded-lg overflow-hidden shadow-xl",children:a.jsxs(U9,{nodes:h,edges:x,onNodesChange:f,onEdgesChange:b,onConnect:j,nodeTypes:uV,fitView:!0,fitViewOptions:{padding:.1,includeHiddenNodes:!1},className:"bg-black",connectionLineType:"smoothstep",defaultEdgeOptions:{style:{stroke:"#6b7280",strokeWidth:2},animated:!1,type:"smoothstep"},nodesDraggable:!0,nodesConnectable:!1,elementsSelectable:!0,children:[a.jsx(Z9,{className:"bg-gray-900 border-white/20 [&>button]:bg-gray-800 [&>button]:border-gray-600 [&>button]:text-white [&>button:hover]:bg-gray-700"}),a.jsx(c7,{className:"bg-gray-900 border-white/20",nodeColor:S=>{var M;return(M=S.data)!=null&&M.isForeign?"#374151":"#1f2937"},maskColor:"rgba(0, 0, 0, 0.9)"}),a.jsx(Y9,{variant:Wa.Dots,gap:20,size:1,color:"#374151"})]})})})]})]});return a.jsxs("div",{className:"h-screen flex flex-col bg-black",children:[C,w&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50",onClick:()=>g(null),children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-5 w-full max-w-3xl max-h-[75vh] overflow-y-auto",onClick:S=>S.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-light text-white",children:w.displayName}),a.jsxs("p",{className:"text-xs text-gray-400 mt-0.5 uppercase font-mono",children:[w.name," · ",w.origin==="core"?"Core":"Extended"]})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>g(null),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/20 border-dashed mb-4"}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h4",{className:"text-xs uppercase font-mono text-gray-400 mb-3 tracking-wider",children:"Fields"}),a.jsx("div",{className:"space-y-0",children:w.fields.map((S,M)=>{const A=w.relationships.find($=>$.field===S.name),V=A&&e?e.tables.find($=>$.name===A.target):null;return a.jsxs("div",{className:`border-b border-dashed border-white/10 py-3 ${M===w.fields.length-1?"border-b-0":""}`,children:[a.jsxs("div",{className:"flex items-start justify-between mb-1.5",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"text-white font-mono text-sm",children:S.name}),S.primaryKey&&a.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:"PK"}),S.unique&&a.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:"UNIQUE"}),!S.required&&a.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:"NULLABLE"}),A&&a.jsx("button",{type:"button",onClick:$=>{$.stopPropagation(),N(A.target)},title:`Relates to ${(V==null?void 0:V.displayName)||A.target}`,className:"p-1 text-gray-300 hover:text-white transition-colors",children:a.jsx(mi,{className:"w-4 h-4"})})]}),a.jsx("span",{className:"text-xs text-gray-400 font-mono uppercase",children:S.type})]}),a.jsxs("div",{className:"ml-0 space-y-0.5",children:[S.description&&a.jsx("p",{className:"text-xs text-gray-500 font-light",children:S.description}),S.defaultValue!==void 0&&a.jsxs("p",{className:"text-xs text-gray-500 font-mono",children:["Default: ",a.jsx("span",{className:"text-gray-400",children:String(S.defaultValue)})]})]})]},S.name)})})]}),w.relationships.length>0&&a.jsxs("div",{className:"mb-6",children:[a.jsx("hr",{className:"border-white/10 border-dashed mb-4"}),a.jsx("h4",{className:"text-xs uppercase font-mono text-gray-400 mb-3 tracking-wider",children:"Relationships"}),a.jsx("div",{className:"space-y-0",children:w.relationships.map((S,M)=>{const A=e==null?void 0:e.tables.find($=>$.name===S.target),V=S.type==="one-to-one"?"1:1":S.type==="many-to-one"?"N:1":"1:N";return a.jsxs("div",{className:`border-b border-dashed border-white/10 py-3 ${M===w.relationships.length-1?"border-b-0":""}`,children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"text-white font-mono text-sm",children:S.field}),a.jsx("span",{className:"text-xs text-gray-400",children:"→"}),a.jsxs("button",{type:"button",onClick:()=>N(S.target),className:"text-white font-mono text-sm underline decoration-dotted hover:text-white/80 flex items-center space-x-1",title:`View ${(A==null?void 0:A.displayName)||S.target} schema`,children:[a.jsx("span",{children:(A==null?void 0:A.displayName)||S.target}),a.jsx(mi,{className:"w-3 h-3 text-white/70"})]})]}),a.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:V})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1 font-mono uppercase ml-0",children:S.type.replace("-"," ")})]},`${S.target}-${S.field}-${M}`)})})]}),a.jsx("div",{className:"border-t border-dashed border-white/20 pt-4 mt-6",children:a.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("span",{className:"text-gray-400 uppercase font-mono text-xs tracking-wider block",children:"Fields"}),a.jsx("p",{className:"text-white text-lg font-mono font-light",children:w.fields.length})]}),a.jsxs("div",{className:"border-l border-dashed border-white/20 pl-6 space-y-1",children:[a.jsx("span",{className:"text-gray-400 uppercase font-mono text-xs tracking-wider block",children:"Relationships"}),a.jsx("p",{className:"text-white text-lg font-mono font-light",children:w.relationships.length})]}),a.jsxs("div",{className:"border-l border-dashed border-white/20 pl-6 space-y-1",children:[a.jsx("span",{className:"text-gray-400 uppercase font-mono text-xs tracking-wider block",children:"Origin"}),a.jsx("p",{className:"text-white text-sm uppercase font-mono font-light",children:w.origin==="core"?"Core":"Extended"})]})]})})]})})]})}const fV=vS("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-white text-black hover:bg-white",secondary:"border-transparent bg-gray-800 text-white hover:bg-gray-800 border border-gray-600",destructive:"border-transparent bg-red-500 text-white hover:bg-red-600",outline:"text-gray-300 border-gray-600",success:"border-transparent bg-green-900 text-green-300",warning:"border-transparent bg-yellow-900 text-yellow-300",error:"border-transparent bg-red-900 text-red-300",info:"border-transparent bg-gray-800 text-white border border-gray-600"}},defaultVariants:{variant:"default"}});function Dt({className:e,variant:t,...n}){return a.jsx("div",{className:Pe(fV({variant:t}),e),...n})}function mV(){const{orgId:e}=Zg(),t=Gs(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState(!0),[f,x]=m.useState("details"),[y,b]=m.useState(!1),[w,g]=m.useState(!1),[v,p]=m.useState(!1),[j,N]=m.useState(!1),[C,S]=m.useState(!1),[M,A]=m.useState(!1),[V,$]=m.useState(!1),[z,Y]=m.useState(!1),[E,R]=m.useState(!1),[T,_]=m.useState(null),[k,D]=m.useState({name:"",slug:""}),[L,q]=m.useState(""),[O,B]=m.useState(""),[X,Z]=m.useState([]),[ne,ee]=m.useState({name:""}),[J,se]=m.useState(!1),[pe,re]=m.useState([]),[he,fe]=m.useState(!1),[ke,Oe]=m.useState([]),[Re,Be]=m.useState(!1);m.useEffect(()=>{e&&(Ie(),bt(),St(),et(),Qe(),qe())},[e]),m.useEffect(()=>{y&&e&&qe()},[]),m.useEffect(()=>{f==="members"&&e&&Qe()},[f,e]),m.useEffect(()=>{f==="invitations"&&e&&et()},[f,e]);const dt=W=>{ee({name:W})},Ie=async()=>{try{const F=await(await fetch(`/api/organizations/${e}`)).json();F.success&&F.organization||F.organization?s(F.organization):P.error("Organization not found")}catch(W){console.error("Failed to fetch organization:",W),P.error("Failed to load organization")}finally{d(!1)}},St=async()=>{try{const F=await(await fetch("/api/plugins/teams/status")).json();b(F.enabled)}catch(W){console.error("Failed to check teams status:",W),b(!1)}},bt=async()=>{try{const F=await(await fetch("/api/plugins/organization/status")).json();g(F.enabled)}catch(W){console.error("Failed to check organization status:",W),g(!1)}},qe=async()=>{try{const F=await(await fetch(`/api/organizations/${e}/teams`)).json();F.success&&i(F.teams||[])}catch(W){console.error("Failed to fetch teams:",W),P.error("Failed to load teams")}},et=async()=>{try{const F=await(await fetch(`/api/organizations/${e}/invitations`)).json();F.success&&l(F.invitations||[])}catch(W){console.error("Failed to fetch invitations:",W),P.error("Failed to load invitations")}},Qe=async()=>{try{const F=await(await fetch(`/api/organizations/${e}/members`)).json();F.success&&u(F.members||[])}catch(W){console.error("Failed to fetch members:",W),P.error("Failed to load members")}},vt=async W=>{re([]),fe(!0),re([{id:"start",type:"info",message:`Starting member seeding process for ${W} members...`,timestamp:new Date}]);try{const me=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(me.success){const Ve=me.results.map((nt,Ke)=>nt.success?{id:`member-${Ke}`,type:"progress",message:`Adding member: ${nt.member.user.name} (${nt.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${Ke}`,type:"error",message:`Failed to add member ${Ke+1}: ${nt.error}`,timestamp:new Date});re(nt=>[...nt,...Ve]);const tt=me.results.filter(nt=>nt.success).length;re(nt=>[...nt,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${tt}/${W} members successfully`,timestamp:new Date}]),await Qe(),P.success(`Successfully added ${tt} members!`)}else re(Ve=>[...Ve,{id:"error",type:"error",message:`❌ Seeding failed: ${me.error||"Unknown error"}`,timestamp:new Date}]),P.error(me.error||"Failed to seed members")}catch(F){re(me=>[...me,{id:"error",type:"error",message:`❌ Network error: ${F}`,timestamp:new Date}]),P.error("Failed to seed members")}finally{fe(!1)}},yt=async W=>{Oe([]),Be(!0),Oe([{id:"start",type:"info",message:`Starting team seeding process for ${W} teams...`,timestamp:new Date}]);try{const me=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(me.success){const Ve=me.results.map((nt,Ke)=>nt.success?{id:`team-${Ke}`,type:"progress",message:`Creating team: ${nt.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${Ke}`,type:"error",message:`Failed to create team ${Ke+1}: ${nt.error}`,timestamp:new Date});Oe(nt=>[...nt,...Ve]);const tt=me.results.filter(nt=>nt.success).length;Oe(nt=>[...nt,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${tt}/${W} teams successfully`,timestamp:new Date}]),await qe(),P.success(`Successfully created ${tt} teams!`)}else Oe(Ve=>[...Ve,{id:"error",type:"error",message:`❌ Seeding failed: ${me.error||"Unknown error"}`,timestamp:new Date}]),P.error(me.error||"Failed to seed teams")}catch(F){Oe(me=>[...me,{id:"error",type:"error",message:`❌ Network error: ${F}`,timestamp:new Date}]),P.error("Failed to seed teams")}finally{Be(!1)}},Ht=async()=>{try{const F=await(await fetch("/api/users/all")).json();F.success&&Z(F.users||[])}catch(W){console.error("Failed to fetch users:",W)}},It=W=>W.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),te=()=>{n&&(D({name:n.name,slug:n.slug}),R(!0))},be=W=>{const F=It(W);D({name:W,slug:F})},He=W=>{D(F=>({...F,slug:It(W)}))},I=async()=>{if(!n){P.error("No organization selected");return}if(!k.name){P.error("Please fill in the organization name");return}const W=P.loading("Updating organization...");try{const me=await(await fetch(`/api/organizations/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k.name,slug:k.slug})})).json();me.success?(await Ie(),R(!1),D({name:"",slug:""}),P.success("Organization updated successfully!",{id:W})):P.error(`Error updating organization: ${me.error||"Unknown error"}`,{id:W})}catch(F){console.error("Error updating organization:",F),P.error("Error updating organization",{id:W})}},le=()=>{Ht(),p(!0)},ue=async()=>{if(!L){P.error("Please enter an email address");return}if(!O){P.error("Please select an inviter");return}se(!0);const W=P.loading("Sending invitation...");try{const me=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:L,role:"member",inviterId:O})})).json();me.success?(await et(),p(!1),q(""),B(""),P.success("Invitation sent successfully!",{id:W})):P.error(`Error sending invitation: ${me.error||"Unknown error"}`,{id:W})}catch(F){console.error("Error sending invitation:",F),P.error("Error sending invitation",{id:W})}finally{se(!1)}},xe=async W=>{const F=P.loading("Cancelling invitation...");try{const Ve=await(await fetch(`/api/invitations/${W}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Ve.success?(await et(),P.success("Invitation cancelled successfully!",{id:F})):P.error(`Error cancelling invitation: ${Ve.error||"Unknown error"}`,{id:F})}catch(me){console.error("Error cancelling invitation:",me),P.error("Error cancelling invitation",{id:F})}},Te=async(W,F)=>{const me=P.loading("Resending invitation...");try{const tt=await(await fetch(`/api/invitations/${W}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();tt.success?(await et(),P.success(`Invitation resent to ${F}!`,{id:me})):P.error(`Error resending invitation: ${tt.error||"Unknown error"}`,{id:me})}catch(Ve){console.error("Error resending invitation:",Ve),P.error("Error resending invitation",{id:me})}},We=async(W,F)=>{const me=P.loading(`Removing ${F}...`);try{const tt=await(await fetch(`/api/members/${W}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();tt.success?(await Qe(),P.success(`${F} removed from organization!`,{id:me})):P.error(`Error removing member: ${tt.error||"Unknown error"}`,{id:me})}catch(Ve){console.error("Error removing member:",Ve),P.error("Error removing member",{id:me})}},G=async()=>{if(!ne.name){P.error("Please enter a team name");return}const W=P.loading("Creating team...");try{const me=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ne.name,organizationId:e})})).json();me.success?(await qe(),A(!1),ee({name:""}),P.success("Team created successfully!",{id:W})):P.error(`Error creating team: ${me.error||"Unknown error"}`,{id:W})}catch(F){console.error("Error creating team:",F),P.error("Error creating team",{id:W})}},ae=async()=>{if(!T||!ne.name){P.error("Please enter a team name");return}const W=P.loading("Updating team...");try{const me=await(await fetch(`/api/teams/${T.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ne.name})})).json();me.success?(await qe(),$(!1),_(null),ee({name:""}),P.success("Team updated successfully!",{id:W})):P.error(`Error updating team: ${me.error||"Unknown error"}`,{id:W})}catch(F){console.error("Error updating team:",F),P.error("Error updating team",{id:W})}},ye=async()=>{if(!T){P.error("No team selected");return}const W=P.loading("Deleting team...");try{const me=await(await fetch(`/api/teams/${T.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();me.success?(await qe(),Y(!1),_(null),P.success("Team deleted successfully!",{id:W})):P.error(`Error deleting team: ${me.error||"Unknown error"}`,{id:W})}catch(F){console.error("Error deleting team:",F),P.error("Error deleting team",{id:W})}},de=W=>{_(W),ee({name:W.name}),$(!0)},Se=W=>{_(W),Y(!0)};return h?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ks,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(H,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(jt,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(H,{onClick:le,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[a.jsx(Aa,{className:"w-4 h-4 mr-2"}),"Invite User"]}),a.jsxs(H,{onClick:te,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(zi,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(Jn,{className:"w-6 h-6 text-white"})}),a.jsx("div",{children:a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:n.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]})})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>x("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(Jn,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Details",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(Bs,{value:0,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(jt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(Bs,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("invitations"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="invitations"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(Aa,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Invitations",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(Bs,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),a.jsxs("button",{onClick:()=>x("teams"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${f==="teams"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(jt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(Bs,{value:r.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),f==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Organization Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),a.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(jt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:c.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(jt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:r.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Aa,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:o.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(zs,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((new Date().getTime()-new Date(n.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:r.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(H,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Ya,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),a.jsxs(H,{onClick:()=>A(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Ec,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),y?r.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:r.map(W=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${W.id}`),children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(jt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:W.name}),a.jsx(Ln,{id:W.id,label:"Team ID"})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:W.memberCount||0}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(W.createdAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(H,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:F=>{F.stopPropagation(),de(W)},children:[a.jsx(zi,{className:"w-4 h-4 mr-1"}),"Edit"]}),a.jsxs(H,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:F=>{F.stopPropagation(),Se(W)},children:[a.jsx(Yu,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},W.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(jt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),a.jsxs(H,{onClick:()=>A(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Ec,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(jt,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Teams in Better Auth Studio, you need to enable the teams feature in your organization plugin configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",a.jsx("span",{className:"text-blue-400",children:"true"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-16",children:"}"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-12",children:"})"})," ",a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),a.jsx(H,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]}),f==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage organization members and their roles"})]})}),c.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:c.map(W=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:W.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${W.user.id}`,alt:W.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:W.user.name}),a.jsx(Ln,{id:W.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:W.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(Dt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:W.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(W.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(H,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>We(W.id,W.user.name),children:[a.jsx(Yu,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},W.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(jt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),a.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[a.jsxs(H,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(jt,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),a.jsxs(H,{onClick:le,className:"bg-white text-white bg-transparent border border-white/20 rounded-none",children:[a.jsx(Aa,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage pending invitations to this organization"})]})}),o.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:o.map(W=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(Aa,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:W.email}),a.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(W.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white capitalize",children:W.role}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs(Dt,{variant:"secondary",className:`text-xs font-normal rounded-none border-dashed flex items-center gap-1 w-fit ${W.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":W.status==="accepted"?"bg-green-900/10 border border-green-500/30 text-green-400/70":"bg-red-900/10 border border-red-500/30 text-red-400/70"}`,children:[W.status==="pending"&&a.jsx(i5,{className:"w-3 h-3"}),W.status==="accepted"&&a.jsx(Ih,{className:"w-3 h-3"}),W.status==="expired"&&a.jsx(_t,{className:"w-3 h-3"}),W.status]})}),a.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(W.expiresAt).toLocaleDateString(),a.jsx("br",{}),a.jsx("span",{className:"text-xs text-gray-400",children:new Date(W.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsxs(H,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>Te(W.id,W.email),children:[a.jsx(Ow,{className:"w-4 h-4 mr-1"}),"Resend"]}),a.jsxs(H,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>xe(W.id),children:[a.jsx(Yu,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},W.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Aa,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),a.jsxs(H,{onClick:le,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Aa,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]}),v&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{p(!1),q(""),B("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),a.jsx(Le,{id:"invite-email",type:"email",value:L,onChange:W=>q(W.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),a.jsxs(ws,{value:O,onValueChange:B,children:[a.jsx(js,{children:a.jsx(Br,{placeholder:"Select an inviter..."})}),a.jsx(Ns,{children:X.map(W=>a.jsx(Fe,{value:W.id,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("img",{src:W.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${W.id}`,alt:W.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),a.jsxs("span",{children:[W.name," (",W.email,")"]})]})},W.id))})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{p(!1),q(""),B("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(H,{onClick:ue,disabled:J,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[J?a.jsx(ks,{className:"w-3 h-3 mr-2 animate-spin"}):a.jsx(Ow,{className:"w-4 h-4 mr-2"}),J?"Sending...":"Send Invitation"]})]})]})}),M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{A(!1),ee({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Le,{id:"team-name",value:ne.name,onChange:W=>dt(W.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{A(!1),ee({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:G,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),V&&T&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{$(!1),ee({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(jt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:T.name}),a.jsx(Ln,{id:T.id,label:"Team ID",variant:"detail"})]})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Le,{id:"edit-team-name",value:ne.name,onChange:W=>dt(W.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{$(!1),ee({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:ae,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),z&&T&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(jt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:T.name}),a.jsx(Ln,{id:T.id,label:"Team ID",variant:"detail"})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>Y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:ye,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Me,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),a.jsx(Le,{id:"member-count",type:"number",min:"1",max:"50",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(H,{onClick:()=>{var F;const W=parseInt(((F=document.getElementById("member-count"))==null?void 0:F.value)||"5");vt(W)},disabled:he,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:he?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(jt,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),pe.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Zr,{title:"Member Seeding Terminal",lines:pe,isRunning:he,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(H,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),C&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Jn,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Me,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),a.jsx(Le,{id:"team-count",type:"number",min:"1",max:"20",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(H,{onClick:()=>{var F;const W=parseInt(((F=document.getElementById("team-count"))==null?void 0:F.value)||"3");yt(W)},disabled:Re,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:Re?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Jn,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),ke.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Zr,{title:"Team Seeding Terminal",lines:ke,isRunning:Re,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(H,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),E&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:W=>{W.target===W.currentTarget&&(R(!1),D({name:"",slug:""}))},children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",onClick:W=>W.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{R(!1),D({name:"",slug:""})},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Jn,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:n.name}),a.jsx("div",{className:"text-sm text-gray-400",children:n.slug})]})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),a.jsx(Le,{id:"edit-name",value:k.name,onChange:W=>be(W.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),a.jsx(Le,{id:"edit-slug",value:k.slug,onChange:W=>He(W.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{R(!1),D({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:I,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx(Qg,{to:"/organizations",children:a.jsxs(H,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(LB,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),a.jsx("br",{}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Jn,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function xV(){const[e,t]=m.useState([]),[n,s]=m.useState(!0),[r,i]=m.useState(""),[o,l]=m.useState("all"),[c,u]=m.useState(!1),[h,d]=m.useState(!1),[f,x]=m.useState(!1),[y,b]=m.useState(!1),[w,g]=m.useState(!1),[v,p]=m.useState(null),[j,N]=m.useState([]),[C,S]=m.useState(!1),M=m.useCallback(async()=>{try{const D=await(await fetch("/api/sessions")).json();t(D.sessions||[])}catch{}finally{s(!1)}},[]);m.useEffect(()=>{M()},[M]);const A=async k=>{N([]),S(!0),N([{id:"start",type:"info",message:`Starting session seeding process for ${k} sessions...`,timestamp:new Date}]);try{const L=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:k})})).json();if(L.success){const q=L.results.map((B,X)=>B.success?{id:`session-${X}`,type:"progress",message:`Creating session: ${B.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${X}`,type:"error",message:`Failed to create session ${X+1}: ${B.error}`,timestamp:new Date});N(B=>[...B,...q]);const O=L.results.filter(B=>B.success).length;N(B=>[...B,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${O}/${k} sessions successfully`,timestamp:new Date}]),await M()}else N(q=>[...q,{id:"error",type:"error",message:`❌ Seeding failed: ${L.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N(L=>[...L,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{S(!1)}},V=async k=>{N([]),S(!0),N([{id:"start",type:"info",message:`Starting account seeding process for ${k} accounts...`,timestamp:new Date}]);try{const L=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:k})})).json();if(L.success){const q=L.results.map((B,X)=>B.success?{id:`account-${X}`,type:"progress",message:`Creating account: ${B.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${X}`,type:"error",message:`Failed to create account ${X+1}: ${B.error}`,timestamp:new Date});N(B=>[...B,...q]);const O=L.results.filter(B=>B.success).length;N(B=>[...B,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${O}/${k} accounts successfully`,timestamp:new Date}]),await M()}else N(q=>[...q,{id:"error",type:"error",message:`❌ Seeding failed: ${L.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N(L=>[...L,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{S(!1)}},$=k=>{p(k),b(!0)},z=k=>{p(k),d(!0)},Y=k=>{p(k),x(!0)},E=async k=>{u(!1)},R=async k=>{d(!1)},T=async()=>{x(!1)},_=e.filter(k=>{const D=k.id.toLowerCase().includes(r.toLowerCase())||k.userId.toLowerCase().includes(r.toLowerCase()),L=o==="all"||o==="active"&&new Date(k.expiresAt)>new Date||o==="expired"&&new Date(k.expiresAt)<=new Date;return D&&L});return n?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(Ys,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(H,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[a.jsx(Vt,{className:"w-4 h-4 mr-2"}),"Seed"]}),a.jsxs(H,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>u(!0),children:[a.jsx(Pr,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ri,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{placeholder:"Search sessions...",value:r,onChange:k=>i(k.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(gp,{className:"w-4 h-4 text-gray-400"}),a.jsxs(ws,{value:o,onValueChange:l,children:[a.jsx(js,{children:a.jsx(Br,{})}),a.jsxs(Ns,{children:[a.jsx(Fe,{value:"all",children:"All"}),a.jsx(Fe,{value:"active",children:"Active"}),a.jsx(Fe,{value:"expired",children:"Expired"})]})]})]})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:_.map(k=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Vt,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",k.id.slice(0,8),"..."]}),a.jsx(Ln,{id:k.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:k.userId}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(k.expiresAt)>new Date?a.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):a.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),a.jsx("span",{className:"text-sm text-gray-400",children:new Date(k.expiresAt)>new Date?"Active":"Expired"})]})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(k.expiresAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(H,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>$(k),children:a.jsx(Nl,{className:"w-4 h-4"})}),a.jsx(H,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>z(k),children:a.jsx(zi,{className:"w-4 h-4"})}),a.jsx(H,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>Y(k),children:a.jsx(_f,{className:"w-4 h-4"})})]})})]},k.id))})]})})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Vt,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Me,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Le,{id:"session-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(H,{onClick:()=>{var D;const k=parseInt(((D=document.getElementById("session-count"))==null?void 0:D.value)||"5",10);A(k)},disabled:C,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:C?a.jsxs(a.Fragment,{children:[a.jsx(Ys,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Vt,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Uy,{className:"w-5 h-5 text-white"}),a.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Me,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),a.jsx(Le,{id:"account-count",type:"number",min:"1",max:"100",defaultValue:"5",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(H,{onClick:()=>{var D;const k=parseInt(((D=document.getElementById("account-count"))==null?void 0:D.value)||"5",10);V(k)},disabled:C,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:C?a.jsxs(a.Fragment,{children:[a.jsx(Ys,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Uy,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),j.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Zr,{title:"Session Seeding Terminal",lines:j,isRunning:C,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:a.jsx(H,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Le,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Le,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:()=>E(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&v&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Vt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",v.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:v.userId})]})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),a.jsx(Le,{id:"edit-user-id",defaultValue:v.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),a.jsx(Le,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(v.expiresAt).toISOString().slice(0,16),className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:()=>R(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&v&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Vt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",v.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:v.userId})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:T,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),y&&v&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(an,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:a.jsx(Vt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-white font-light",children:["Session ",v.id.slice(0,8),"..."]}),a.jsx("div",{className:"text-sm text-gray-400",children:v.userId})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ln,{id:v.id,variant:"detail"}),a.jsx(Ln,{id:v.userId,label:"User ID",variant:"detail"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Status:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(v.expiresAt)>new Date?"Active":"Expired"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Expires:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(v.expiresAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Created:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(v.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"Updated:"}),a.jsx("span",{className:"text-white text-sm",children:new Date(v.updatedAt).toLocaleString()})]})]})]}),a.jsx("div",{className:"flex justify-end mt-6",children:a.jsx(H,{onClick:()=>b(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function gV(){var v,p,j,N,C,S,M,A,V,$,z,Y,E,R,T,_,k,D,L,q,O,B,X,Z,ne,ee,J,se,pe;const[e,t]=m.useState(null),[n,s]=m.useState(null),[r,i]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState(!0),[h,d]=m.useState(null);U3(re=>{re.type==="config_changed"?setTimeout(()=>{f(),x(),y(),b()},500):re.type});const f=m.useCallback(async()=>{var re;try{const fe=await(await fetch("/api/config")).json();(re=fe.studio)!=null&&re.version&&d(`v${fe.studio.version}`),t(fe)}catch{}finally{u(!1)}},[]),x=m.useCallback(async()=>{try{const he=await(await fetch("/api/health")).json();s(he.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform,uptime:"2h 15m"})}catch{s({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS",uptime:"2h 15m"})}},[h]),y=m.useCallback(async()=>{try{const he=await(await fetch("/api/plugins")).json();i(he)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),b=m.useCallback(async()=>{try{const he=await(await fetch("/api/db")).json();l(he)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),w=re=>{switch(re==null?void 0:re.toLowerCase()){case"postgresql":case"postgres":return a.jsxs(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(nn,{className:"w-3 h-3"}),"Connected"]});case"mysql":return a.jsxs(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(nn,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return a.jsxs(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(Mo,{className:"w-3 h-3"}),"Local"]});default:return a.jsxs(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(ea,{className:"w-3 h-3"}),"Unknown"]})}};m.useEffect(()=>{f(),x(),y(),b()},[f,b,y,x]);const g=re=>{switch(re.toLowerCase()){case"google":return a.jsx(ys,{className:"w-5 h-5 text-white"});case"github":return a.jsx(yn,{className:"w-5 h-5 text-white"});case"discord":return a.jsx(ys,{className:"w-5 h-5 text-white"});case"twitter":return a.jsx(ys,{className:"w-5 h-5 text-white"});default:return a.jsx(ys,{className:"w-5 h-5 text-white"})}};return c?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(Ys,{className:"w-6 h-6 text-white animate-spin"})}):a.jsxs("div",{className:"space-y-8",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Ho,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Application"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Basic application configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Gn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ys,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Po,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Lu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Vt,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Database"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Database connection and configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Gn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Vt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:(o==null?void 0:o.displayName)||((v=e==null?void 0:e.database)==null?void 0:v.type)&&((p=e==null?void 0:e.database)==null?void 0:p.type.charAt(0).toUpperCase())+((j=e==null?void 0:e.database)==null?void 0:j.type.slice(1))||"Unknown"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((N=e==null?void 0:e.database)==null?void 0:N.type))&&w((o==null?void 0:o.name)||((C=e==null?void 0:e.database)==null?void 0:C.type)||"")]}),((o==null?void 0:o.dialect)||((S=e==null?void 0:e.database)==null?void 0:S.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Vt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:((M=e==null?void 0:e.database)==null?void 0:M.dialect)||(o==null?void 0:o.dialect)})})]}),((A=e==null?void 0:e.database)==null?void 0:A.url)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Po,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),a.jsxs(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:[a.jsx(nn,{className:"w-3 h-3"}),"Configured"]})]}),((V=e==null?void 0:e.database)==null?void 0:V.casing)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ho,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(_0,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:e.database.debugLogs?a.jsxs(a.Fragment,{children:[a.jsx(ea,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&a.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ea,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:(o==null?void 0:o.message)||"No supported database packages found"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(yn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Providers"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Configured authentication providers"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Gn,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((re,he)=>a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[g(re.type),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:re.type}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:re.clientId?"Configured":"Not configured"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:re.clientId?a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Active"]}):a.jsxs(a.Fragment,{children:[a.jsx(ea,{className:"w-3 h-3"}),"Setup Required"]})})]},he)):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(yn,{className:"w-8 h-8 text-white mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Oh,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Email & Password"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Email authentication settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Gn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Oh,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:($=e==null?void 0:e.emailAndPassword)!=null&&$.enabled?a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(za,{className:"w-3 h-3"}),"Disabled"]})})]}),((z=e==null?void 0:e.emailAndPassword)==null?void 0:z.enabled)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ui,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(Y=e==null?void 0:e.emailAndPassword)!=null&&Y.disableSignUp?a.jsxs(a.Fragment,{children:[a.jsx(za,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(E=e==null?void 0:e.emailAndPassword)!=null&&E.requireEmailVerification?a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Required"]}):a.jsxs(a.Fragment,{children:[a.jsx(ea,{className:"w-3 h-3"}),"Optional"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Lu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),a.jsx("div",{className:"text-right",children:a.jsxs("p",{className:"text-sm font-medium text-white",children:[((R=e==null?void 0:e.emailAndPassword)==null?void 0:R.minPasswordLength)||8," -"," ",((T=e==null?void 0:e.emailAndPassword)==null?void 0:T.maxPasswordLength)||128]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kc,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(_=e==null?void 0:e.emailAndPassword)!=null&&_.autoSignIn?a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ea,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(cu,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Session"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Session management settings"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Gn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(cu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(k=e==null?void 0:e.session)!=null&&k.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(_0,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white",children:(D=e==null?void 0:e.session)!=null&&D.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kc,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(L=e==null?void 0:e.session)!=null&&L.disableSessionRefresh?a.jsxs(a.Fragment,{children:[a.jsx(za,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Vt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(q=e==null?void 0:e.session)!=null&&q.storeSessionInDatabase?a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(Mo,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(yn,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Rate Limiting"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"API rate limiting configuration"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Gn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(O=e==null?void 0:e.rateLimit)!=null&&O.enabled?a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ea,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(cu,{className:"w-5 h-5 text-red-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(B=e==null?void 0:e.rateLimit)!=null&&B.window?`${e.rateLimit.window} seconds`:"10 seconds"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:((X=e==null?void 0:e.rateLimit)==null?void 0:X.max)||100}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Vt,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((Z=e==null?void 0:e.rateLimit)==null?void 0:Z.storage)||"memory"})})]})]})]}),a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Ho,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Advanced"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Advanced configuration options"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Gn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Lu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ne=e==null?void 0:e.advanced)!=null&&ne.useSecureCookies?a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(ea,{className:"w-3 h-3"}),"Disabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(yn,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(ee=e==null?void 0:e.advanced)!=null&&ee.disableCSRFCheck?a.jsxs(a.Fragment,{children:[a.jsx(za,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nl,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(se=(J=e==null?void 0:e.advanced)==null?void 0:J.ipAddress)!=null&&se.disableIpTracking?a.jsxs(a.Fragment,{children:[a.jsx(za,{className:"w-3 h-3"}),"Disabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(p7,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(pe=e==null?void 0:e.telemetry)!=null&&pe.enabled?a.jsxs(a.Fragment,{children:[a.jsx(ea,{className:"w-3 h-3"}),"Enabled"]}):a.jsxs(a.Fragment,{children:[a.jsx(nn,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(Mo,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"System Info"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth Studio system information"]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsxs(Gn,{className:"p-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(kc,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Mo,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ys,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(cu,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Uptime"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Service uptime"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.uptime)||"2h 15m"}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Running"})]})]})]})]}),a.jsxs(Fn,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none lg:col-span-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs(Wn,{className:"space-y-0",children:[a.jsxs(qn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[a.jsx(zy,{className:"w-4 h-4 text-white"}),a.jsx("span",{children:"Plugins"})]}),a.jsxs(ta,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[a.jsxs("svg",{className:"w-3 h-3 inline-flex text-gray-400",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",a.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})," "]}),"Better Auth plugins enabled in your configuration"]})]}),a.jsxs("div",{className:"pr-6",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:(r==null?void 0:r.totalPlugins)||0}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),a.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),a.jsx(Gn,{className:"space-y-0 px-0 pb-0 border-b-none",children:r!=null&&r.plugins&&r.plugins.length>0?a.jsxs(a.Fragment,{children:[r.plugins.map((re,he)=>a.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${he<r.plugins.length-1?"border-b border-white/15":""}`,children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(zy,{className:"w-5 h-5 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-light uppercase text-white",children:re.name.slice(0,1).toUpperCase()+re.name.slice(1).replace("-"," ")}),a.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:re.description})]})]}),a.jsx("div",{className:"text-right flex items-center space-x-2",children:a.jsxs(Dt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400 flex items-center gap-1",children:[a.jsx(nn,{className:"w-3 h-3"}),"Enabled"]})})]},re.id)),r.configPath&&a.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:a.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",a.jsx("span",{className:"text-white font-mono",children:r.configPath})]})})]}):a.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ea,{className:"w-5 h-5 text-yellow-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),a.jsx("p",{className:"text-xs text-gray-400",children:(r==null?void 0:r.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),a.jsx(Dt,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function Vw(){var T,_;const{orgId:e,teamId:t}=Zg(),n=Gs(),[s,r]=m.useState(null),[i,o]=m.useState([]),[l,c]=m.useState(!0),[u,h]=m.useState("details"),[d,f]=m.useState(!1),[x,y]=m.useState(!1),[b,w]=m.useState(""),[g,v]=m.useState([]),[p,j]=m.useState([]),[N,C]=m.useState({name:""}),S=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}`)).json();D.success&&D.team?(r(D.team),C({name:D.team.name})):D.team?(r(D.team),C({name:D.team.name})):P.error("Team not found")}catch{P.error("Failed to load team")}finally{c(!1)}},[t]),M=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}/members`)).json();D.success&&o(D.members||[])}catch{P.error("Failed to load team members")}},[t]),A=async()=>{try{const D=await(await fetch("/api/users?limit=10000")).json(),L=i.map(O=>O.userId),q=(D.users||[]).filter(O=>!L.includes(O.id));v(q)}catch{P.error("Failed to load users")}};m.useEffect(()=>{t&&(S(),M())},[t,S,M]);const V=async()=>{if(!N.name){P.error("Please enter a team name");return}const k=P.loading("Updating team...");try{const L=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name})})).json();L.success?(await S(),y(!1),P.success("Team updated successfully!",{id:k})):P.error(`Error updating team: ${L.error||"Unknown error"}`,{id:k})}catch{P.error("Error updating team",{id:k})}},$=async()=>{if(p.length===0){P.error("Please select at least one user");return}const k=P.loading(`Adding ${p.length} members...`);try{const L=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:p})})).json();L.success?(await M(),f(!1),j([]),w(""),P.success(`Successfully added ${p.length} members!`,{id:k})):P.error(`Error adding members: ${L.error||"Unknown error"}`,{id:k})}catch{P.error("Error adding members",{id:k})}},z=async(k,D)=>{const L=P.loading(`Removing ${D}...`);try{const O=await(await fetch(`/api/team-members/${k}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();O.success?(await M(),P.success(`${D} removed from team!`,{id:L})):P.error(`Error removing member: ${O.error||"Unknown error"}`,{id:L})}catch{P.error("Error removing team member",{id:L})}},Y=()=>{A(),f(!0)},E=k=>{j(D=>D.includes(k)?D.filter(L=>L!==k):[...D,k])},R=g.filter(k=>k.name.toLowerCase().includes(b.toLowerCase())||k.email.toLowerCase().includes(b.toLowerCase()));return l?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ks,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):s?a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${s.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs(H,{onClick:Y,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[a.jsx(Ec,{className:"w-4 h-4 mr-2"}),"Add Members"]}),a.jsxs(H,{onClick:()=>y(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(zi,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(jt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[s.name,t&&a.jsx(Ln,{id:t,variant:"subscript"})]}),a.jsx("div",{className:"flex items-center space-x-2 mt-1",children:s.organization&&a.jsxs(Qg,{to:`/organizations/${s.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[a.jsx(Jn,{className:"w-4 h-4 inline mr-1"}),s.organization.name]})})]})]}),a.jsx("div",{className:"border-b border-white/10",children:a.jsxs("nav",{className:"flex space-x-8",children:[a.jsxs("button",{onClick:()=>h("details"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(jt,{className:"w-4 h-4"}),a.jsx("span",{children:"Details"})]}),a.jsxs("button",{onClick:()=>h("members"),className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[a.jsx(jt,{className:"w-4 h-4"}),a.jsxs("span",{className:"inline-flex items-start",children:["Members",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(Bs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),u==="details"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[a.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Team Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),a.jsx("p",{className:"text-white font-sans mt-1",children:s.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),a.jsx("p",{className:"text-white font-sans mt-1",children:((T=s.organization)==null?void 0:T.name)||"Unknown"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),a.jsx("p",{className:"text-white font-sans mt-1",children:new Date(s.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(jt,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:i.length}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(zs,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((Date.now()-new Date(s.createdAt).getTime())/(1e3*60*60*24))}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Jn,{className:"w-8 h-8 text-white"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl text-white font-sans font-light",children:"1"}),a.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),u==="members"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",a.jsx(Bs,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),a.jsx("tbody",{children:i.map(k=>a.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("img",{src:k.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.user.id}`,alt:k.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:k.user.name}),a.jsx(Ln,{id:k.user.id})]})]})}),a.jsx("td",{className:"py-4 px-4 text-white",children:k.user.email}),a.jsx("td",{className:"py-4 px-4",children:a.jsx(Dt,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:k.role})}),a.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(k.joinedAt).toLocaleDateString()}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(H,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>z(k.id,k.user.name),children:[a.jsx(Yu,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},k.id))})]})})}):a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(jt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),a.jsxs(H,{onClick:Y,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[a.jsx(Ec,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]}),d&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{f(!1),j([]),w("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(r5,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{placeholder:"Search users by name or email...",value:b,onChange:k=>w(k.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),p.length>0&&a.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:a.jsxs("p",{className:"text-blue-400 text-sm",children:[p.length," user",p.length!==1?"s":""," selected"]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:R.length>0?a.jsx("div",{className:"divide-y divide-white/5",children:R.map(k=>a.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${p.includes(k.id)?"bg-blue-900/20":""}`,onClick:()=>E(k.id),children:[a.jsx("input",{type:"checkbox",checked:p.includes(k.id),onChange:()=>E(k.id),className:"rounded border-gray-300"}),a.jsx("img",{src:k.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${k.id}`,alt:k.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-white font-light",children:k.name}),a.jsx("div",{className:"text-sm text-gray-400",children:k.email})]})]},k.id))}):a.jsx("div",{className:"p-8 text-center",children:a.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{f(!1),j([]),w("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsxs(H,{onClick:$,disabled:p.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[a.jsx(Ec,{className:"w-4 h-4 mr-2"}),"Add ",p.length," Member",p.length!==1?"s":""]})]})]})}),x&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:a.jsx(jt,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:s.name}),a.jsx("div",{className:"text-sm text-gray-400",children:(_=s.organization)==null?void 0:_.name})]})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),a.jsx(Le,{id:"edit-team-name",value:N.name,onChange:k=>C({name:k.target.value}),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:V,disabled:N.name===s.name,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx(jt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),a.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function pV(){const e=Gs(),[t,n]=m.useState([]),[s,r]=m.useState(!0),[i,o]=m.useState(null),[l,c]=m.useState(""),[u,h]=m.useState("all"),[d,f]=m.useState(1),[x]=m.useState(20);m.useEffect(()=>{y()},[]);const y=async()=>{try{const C=await(await fetch("/api/plugins")).json(),S=(C==null?void 0:C.plugins).find(M=>M.id==="teams");o({enabled:!!S,availablePlugins:(C==null?void 0:C.plugins).map(M=>M.id),configPath:C.configPath,teamsPlugin:(C==null?void 0:C.plugins).find(M=>M.id==="teams")}),S?await b():r(!1)}catch(N){console.error("Failed to check teams plugin status:",N),o({enabled:!1,error:"Failed to check plugin status"}),r(!1)}},b=async()=>{try{const C=await(await fetch("/api/teams")).json();C.success&&n(C.teams||[])}catch(N){console.error("Failed to fetch teams:",N),P.error("Failed to load teams")}finally{r(!1)}},w=t.filter(N=>{var S;const C=N.name.toLowerCase().includes(l.toLowerCase())||((S=N.organization)==null?void 0:S.name.toLowerCase().includes(l.toLowerCase()));if(u==="all")return C;if(u==="recent"){const M=new Date;return M.setDate(M.getDate()-7),C&&new Date(N.createdAt)>M}return C}),g=d*x,v=g-x,p=w.slice(v,g),j=Math.ceil(w.length/x);return s?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx(Ys,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",a.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:a.jsx(Bs,{value:w.length,className:"text-white font-mono text-sm",prefix:a.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),a.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[a.jsx(Bs,{value:w.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),a.jsxs("span",{children:["team",w.length!==1?"s":""," found"]})]})]}),a.jsx("div",{className:"flex items-center space-x-3",children:a.jsxs(H,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(Pr,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative flex-1 max-w-md",children:[a.jsx(Ri,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(Le,{type:"text",placeholder:"Search teams...",value:l,onChange:N=>c(N.target.value),className:"pl-10 bg-black border-dashed border-white/20 text-white placeholder-gray-400 focus:ring-2 focus:ring-white focus:border-transparent"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(H,{variant:u==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:u==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),a.jsx(H,{variant:u==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:u==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),p.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Ui,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),a.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&a.jsxs(H,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[a.jsx(Pr,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):a.jsx("div",{className:"grid gap-4",children:p.map(N=>{var C;return a.jsx("div",{className:"bg-black/30 border border-white/15 rounded-none p-4 hover:bg-black/40 transition-colors cursor-pointer",onClick:()=>e(`/teams/${N.id}`),children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:a.jsx(Ui,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-medium",children:N.name}),a.jsxs("p",{className:"text-gray-400 text-sm",children:[(C=N.organization)==null?void 0:C.name," • ",N.memberCount||0," members"]})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(Dt,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},N.id)})}),j>1&&a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(H,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,d-1)),disabled:d===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),a.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",d," of ",j]}),a.jsx(H,{variant:"outline",size:"sm",onClick:()=>f(Math.min(j,d+1)),disabled:d===j,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(sa,{className:"w-12 h-12 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),a.jsx("p",{className:"text-gray-300 mb-6",children:"To use Organizations in Better Auth Studio, you need to enable the organization plugin in your Better Auth configuration."}),a.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[a.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),a.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:a.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&a.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),a.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:a.jsxs("pre",{className:"text-sm text-gray-300",children:[a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",a.jsx("span",{className:"text-blue-400",children:"from"})," ",a.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",a.jsx("br",{}),a.jsx("span",{className:"text-blue-400",children:"export const"})," ",a.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",a.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",a.jsx("br",{}),a.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",a.jsx("br",{}),a.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",a.jsx("br",{}),a.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),a.jsx("br",{}),a.jsx("span",{className:"pl-10",children:"]"})," ",a.jsx("br",{}),"}",") ",a.jsx("br",{})]})}),a.jsx("div",{className:"mt-4",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),a.jsx("div",{className:"mt-2",children:a.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),(i==null?void 0:i.availablePlugins)&&i.availablePlugins.length>0&&a.jsx("div",{className:"mb-4",children:a.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),a.jsx(H,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),a.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",a.jsx("a",{href:"https://better-auth.com/docs/plugins/organization",target:"_blank",rel:"noopener noreferrer",className:"text-white hover:underline",children:"Better Auth Organization Plugin Documentation"})]})]})]})})]})}const g5=e=>{if(!e)return a.jsx(ys,{className:"w-6 h-6 text-white"});const t=e.toLowerCase(),n="w-6 h-6 text-white";switch(t){case"github":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 15 15",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M7.5.25a7.25 7.25 0 0 0-2.292 14.13c.363.066.495-.158.495-.35c0-.172-.006-.628-.01-1.233c-2.016.438-2.442-.972-2.442-.972c-.33-.838-.805-1.06-.805-1.06c-.658-.45.05-.441.05-.441c.728.051 1.11.747 1.11.747c.647 1.108 1.697.788 2.11.602c.066-.468.254-.788.46-.969c-1.61-.183-3.302-.805-3.302-3.583a2.8 2.8 0 0 1 .747-1.945c-.075-.184-.324-.92.07-1.92c0 0 .61-.194 1.994.744A6.963 6.963 0 0 1 7.5 3.756A6.97 6.97 0 0 1 9.315 4c1.384-.938 1.992-.743 1.992-.743c.396.998.147 1.735.072 1.919c.465.507.745 1.153.745 1.945c0 2.785-1.695 3.398-3.31 3.577c.26.224.492.667.492 1.343c0 .97-.009 1.751-.009 1.989c0 .194.131.42.499.349A7.25 7.25 0 0 0 7.499.25",clipRule:"evenodd"})});case"google":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 56 56",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M28.458 5c6.167 0 11.346 2.2 15.368 5.804l.323.295l-6.62 6.464c-1.695-1.59-4.666-3.493-9.07-3.493c-6.204 0-11.47 4.093-13.372 9.749c-.47 1.46-.756 3.023-.756 4.64c0 1.615.287 3.18.782 4.639c1.877 5.656 7.142 9.748 13.345 9.748c3.347 0 5.928-.886 7.881-2.176l.251-.17l.307-.222c2.813-2.108 4.144-5.084 4.46-7.169l.03-.22h-12.93v-8.705h22.025c.339 1.46.495 2.867.495 4.795c0 7.142-2.554 13.163-6.985 17.255c-3.884 3.597-9.201 5.682-15.535 5.682c-9.031 0-16.85-5.102-20.772-12.57l-.184-.358l-.222-.457A23.45 23.45 0 0 1 5 28.458c0-3.6.827-7.01 2.28-10.073l.222-.457l.184-.357C11.608 10.1 19.426 5 28.458 5"})});case"apple":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M14.122 4.682c1.35 0 2.781.743 3.8 2.028c-3.34 1.851-2.797 6.674.578 7.963c-.465 1.04-.687 1.505-1.285 2.426c-.835 1.284-2.01 2.884-3.469 2.898c-1.295.012-1.628-.853-3.386-.843c-1.758.01-2.125.858-3.42.846c-1.458-.014-2.573-1.458-3.408-2.743C1.198 13.665.954 9.45 2.394 7.21C3.417 5.616 5.03 4.683 6.548 4.683c1.545 0 2.516.857 3.794.857c1.24 0 1.994-.858 3.78-.858M13.73 0c.18 1.215-.314 2.405-.963 3.247c-.695.902-1.892 1.601-3.05 1.565c-.21-1.163.332-2.36.99-3.167C11.43.755 12.67.074 13.73 0"})});case"discord":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M18.59 5.89c-1.23-.57-2.54-.99-3.92-1.23c-.17.3-.37.71-.5 1.04c-1.46-.22-2.91-.22-4.34 0c-.14-.33-.34-.74-.51-1.04c-1.38.24-2.69.66-3.92 1.23c-2.48 3.74-3.15 7.39-2.82 10.98c1.65 1.23 3.24 1.97 4.81 2.46c.39-.53.73-1.1 1.03-1.69c-.57-.21-1.11-.48-1.62-.79c.14-.1.27-.21.4-.31c3.13 1.46 6.52 1.46 9.61 0c.13.11.26.21.4.31c-.51.31-1.06.57-1.62.79c.3.59.64 1.16 1.03 1.69c1.57-.49 3.17-1.23 4.81-2.46c.39-4.17-.67-7.78-2.82-10.98Zm-9.75 8.78c-.94 0-1.71-.87-1.71-1.94s.75-1.94 1.71-1.94s1.72.87 1.71 1.94c0 1.06-.75 1.94-1.71 1.94m6.31 0c-.94 0-1.71-.87-1.71-1.94s.75-1.94 1.71-1.94s1.72.87 1.71 1.94c0 1.06-.75 1.94-1.71 1.94"})});case"facebook":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 64 64",fill:"#888888",children:a.jsx("path",{d:"M59.5 1h-55C2.5 1 1 2.6 1 4.5v55c0 2 1.6 3.5 3.5 3.5h29.6V38.9h-8v-9.3h8v-6.9c0-8 4.8-12.4 12-12.4c2.4 0 4.8.1 7.2.4V19h-4.8c-3.8 0-4.6 1.8-4.6 4.5v5.9H53l-1.3 9.4h-8v23.8h15.8c2 0 3.5-1.5 3.5-3.5V4.5c-.1-2-1.7-3.5-3.5-3.5"})});case"microsoft":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M2 3h9v9H2zm9 19H2v-9h9zM21 3v9h-9V3zm0 19h-9v-9h9z"})});case"twitter":case"x":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 448 512",fill:"currentColor",children:a.jsx("path",{d:"M64 32C28.7 32 0 60.7 0 96v320c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64zm297.1 84L257.3 234.6L379.4 396h-95.6L209 298.1L123.3 396H75.8l111-126.9L69.7 116h98l67.7 89.5l78.2-89.5zm-37.8 251.6L153.4 142.9h-28.3l171.8 224.7h26.3z"})});case"linkedin":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 448 512",fill:"currentColor",children:a.jsx("path",{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"})});case"gitlab":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 32 32",fill:"currentColor",children:a.jsx("path",{d:"M28.568 12.893l-.037-.094l-3.539-9.235a.92.92 0 0 0-.364-.439a.95.95 0 0 0-1.083.058a.95.95 0 0 0-.314.477l-2.39 7.31h-9.675l-2.39-7.31a.93.93 0 0 0-.313-.478a.95.95 0 0 0-1.083-.058a.93.93 0 0 0-.365.438L3.47 12.794l-.035.093a6.57 6.57 0 0 0 2.18 7.595l.011.01l.033.022l5.39 4.037l2.668 2.019l1.624 1.226c.39.297.931.297 1.322 0l1.624-1.226l2.667-2.019l5.424-4.061l.013-.01a6.574 6.574 0 0 0 2.177-7.588Z"})});case"reddit":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 32 32",fill:"currentColor",children:a.jsx("path",{d:"M16 0C7.164 0 0 7.164 0 16s7.164 16 16 16s16-7.164 16-16S24.836 0 16 0m8.5 10.5a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m-17 0a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5m1.5 6.5c0 1.5 1.5 2.5 3 2.5c.5 0 1-.1 1.5-.3c.5.6 1.2 1 2 1c.8 0 1.5-.4 2-1c.5.2 1 .3 1.5.3c1.5 0 3-1 3-2.5c0-1.5-1.5-2.5-3-2.5c-.5 0-1 .1-1.5.3c-.5-.6-1.2-1-2-1c-.8 0-1.5.4-2 1c-.5-.2-1-.3-1.5-.3c-1.5 0-3 1-3 2.5"})});case"spotify":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,viewBox:"0 0 256 256",fill:"currentColor",children:a.jsx("path",{d:"M128 0C57.308 0 0 57.309 0 128c0 70.696 57.309 128 128 128 70.697 0 128-57.304 128-32.3C256 57.314 198.697.007 127.998.007l.001-.006Zm58.699 184.614c-2.293 3.76-7.215 4.952-10.975 2.644c-30.053-18.357-67.885-22.515-112.44-12.335a7.981 7.981 0 0 1-9.552-6.007 7.968 7.968 0 0 1 6-9.553c48.76-11.14 90.583-6.344 124.323 14.276 3.76 2.308 4.952 7.215 2.644 10.975Zm15.667-34.853c-2.89 4.695-9.034 6.178-13.726 3.289c-34.406-21.148-86.853-27.273-127.548-14.92c-5.278 1.594-10.852-1.38-12.454-6.649c-1.59-5.278 1.386-10.842 6.655-12.446c46.485-14.106 104.275-7.273 143.787 17.007c4.692 2.89 6.175 9.034 3.286 13.72v-.001Zm1.345-36.293C162.457 88.964 94.394 86.71 55.007 98.666c-6.325 1.918-13.014-1.653-14.93-7.978c-1.917-6.328 1.65-13.012 7.98-14.935C93.27 62.027 168.434 64.68 215.929 92.876c5.702 3.376 7.566 10.724 4.188 16.405c-3.362 5.69-10.73 7.565-16.4 4.187h-.006Z"})});case"slack":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2447.6 2452.5",className:n,fill:"currentColor",children:a.jsxs("g",{fill:"currentColor",children:[a.jsx("path",{d:"m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z"}),a.jsx("path",{d:"m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2c-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2c-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z"}),a.jsx("path",{d:"m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z"}),a.jsx("path",{d:"M0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3c-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0"})]})});case"notion":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.28c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514c-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933z"})});case"tiktok":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19.589 6.686a4.793 4.793 0 0 1-3.77-4.245V2h-3.445v13.672a2.896 2.896 0 0 1-5.201 1.743l-.002-.001.002.001a2.895 2.895 0 0 1 3.183-4.51v-3.5a6.329 6.329 0 0 0-5.394 10.692 6.33 6.33 0 0 0 10.857-4.424V8.687a8.182 8.182 0 0 0 4.773 1.526V6.79a4.831 4.831 0 0 1-1.003-.104z"})});case"twitch":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M3.9 2.5a.9.9 0 0 0-.9.9v14.194a.9.9 0 0 0 .9.9h4.116v3.03a.7.7 0 0 0 1.194.494l3.525-3.524h4.643a.9.9 0 0 0 .636-.264l2.722-2.722a.9.9 0 0 0 .264-.636V3.4a.9.9 0 0 0-.9-.9zm7.319 5.2a.75.75 0 0 0-1.5 0v4.272a.75.75 0 1 0 1.5 0zm5.016 0a.75.75 0 0 0-1.5 0v4.272a.75.75 0 1 0 1.5 0z",clipRule:"evenodd"})});case"dropbox":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 528 512",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M264.4 116.3l-132 84.3 132 84.3-132 84.3L0 284.1l132.3-84.3L0 116.3 132.3 32l132.1 84.3zM131.6 395.7l132-84.3 132 84.3-132 84.3-132-84.3zm132.8-111.6l132-84.3-132-83.6L395.7 32 528 116.3l-132.3 84.3L528 284.8l-132.3 84.3-131.3-85z"})});case"linear":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"1.2em",height:"1.2em",viewBox:"0 0 100 100",children:a.jsx("path",{fill:"currentColor",d:"M1.22541 61.5228c-.2225-.9485.90748-1.5459 1.59638-.857L39.3342 97.1782c.6889.6889.0915 1.8189-.857 1.5964C20.0515 94.4522 5.54779 79.9485 1.22541 61.5228ZM.00189135 46.8891c-.01764375.2833.08887215.5599.28957165.7606L52.3503 99.7085c.2007.2007.4773.3075.7606.2896 2.3692-.1476 4.6938-.46 6.9624-.9259c.7645-.157 1.0301-1.0963.4782-1.6481L2.57595 39.4485c-.55186-.5519-1.49117-.2863-1.648174.4782-.465915 2.2686-.77832 4.5932-.92588465 6.9624ZM4.21093 29.7054c-.16649.3738-.08169.8106.20765 1.1l64.77602 64.776c.2894.2894.7262.3742 1.1.2077 1.7861-.7956 3.5171-1.6927 5.1855-2.684c.5521-.328.6373-1.0867.1832-1.5407L8.43566 24.3367c-.45409-.4541-1.21271-.3689-1.54074.1832-.99132 1.6684-1.88843 3.3994-2.68399 5.1855ZM12.6587 18.074c-.3701-.3701-.393-.9637-.0443-1.3541C21.7795 6.45931 35.1114 0 49.9519 0 77.5927 0 100 22.4073 100 50.0481c0 14.8405-6.4593 28.1724-16.7199 37.3375-.3903.3487-.984.3258-1.3542-.0443L12.6587 18.074Z"})});case"huggingface":case"hugging face":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378c0 1.112.178 2.181.503 3.185c.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284c.278.173.48.408.71.694c.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542c.01.026.653 1.552 1.657 2.54c.616.605 1.01 1.223 1.082 1.912c.055.537-.096 1.059-.38 1.572c.637.121 1.294.187 1.967.187c.657 0 1.298-.063 1.921-.178c-.287-.517-.44-1.041-.384-1.581c.07-.69.465-1.307 1.081-1.913c1.004-.987 1.647-2.513 1.657-2.539c.021-.074.083-.285.233-.542c.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952c.23-.286.432-.52.71-.694c.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174a1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094c-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71c-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013a1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921a.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92a.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164c1.607-.007 2.984-1.155 3.572-1.164c.196-.003.305.12.305.454c0 .886-.424 2.328-1.563 3.202c-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026l-.01.008l-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116a1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243a1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444c-.034-.016-.104-.008-.2.022q-.094.03-.216.087q-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096a3 3 0 0 0-.26.219a2 2 0 0 0-.12.121a2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203c0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194c-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858s-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64c-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647s2.822 2.813 2.562 3.244s-1.176-.506-1.176-.506s-2.866-2.567-3.49-1.898s.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405c-.238.839-2.71-1.587-3.216-.642c-.506.946 3.49 2.056 3.522 2.064c1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194c1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858s.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64c.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647s-2.822 2.813-2.562 3.244s1.176-.506 1.176-.506s2.866-2.567 3.49-1.898s-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405c.238.839 2.71-1.587 3.216-.642c.506.946-3.49 2.056-3.522 2.064c-1.29.33-4.568 1.028-5.713-.624"})});case"kick":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 24 24",fill:"#888888",children:a.jsx("path",{d:"M9 3a1 1 0 0 1 1 1v3h1V6a1 1 0 0 1 .883-.993L12 5h1V4a1 1 0 0 1 .883-.993L14 3h6a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-1v1a1 1 0 0 1-.883.993L18 11h-1v2h1a1 1 0 0 1 .993.883L19 14v1h1a1 1 0 0 1 .993.883L21 16v4a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-1h-1a1 1 0 0 1-.993-.883L11 18v-1h-1v3a1 1 0 0 1-.883.993L9 21H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"})});case"zoom":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M1.45 3.334C.648 3.334 0 3.982 0 4.783v4.986c0 1.6 1.298 2.898 2.898 2.898h6.986c.8 0 1.45-.649 1.45-1.45V6.233a2.9 2.9 0 0 0-2.899-2.899zM16 4.643v6.715c0 .544-.618.86-1.059.539l-2.059-1.498a1.33 1.33 0 0 1-.549-1.078V6.679c0-.427.204-.827.55-1.078l2.058-1.498a.667.667 0 0 1 1.059.54",clipRule:"evenodd"})});case"vk":return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.2em",height:"1.2em",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M17.802 12.298s1.617 1.597 2.017 2.336a.1.1 0 0 1 .018.035q.244.409.123.645c-.135.261-.592.392-.747.403h-2.858c-.199 0-.613-.052-1.117-.4c-.385-.269-.768-.712-1.139-1.145c-.554-.643-1.033-1.201-1.518-1.201a.6.6 0 0 0-.18.03c-.367.116-.833.639-.833 2.032c0 .436-.344.684-.585.684H9.674c-.446 0-2.768-.156-4.827-2.327C2.324 10.732.058 5.4.036 5.353c-.141-.345.155-.533.475-.533h2.886c.387 0 .513.234.601.444c.102.241.48 1.205 1.1 2.288c1.004 1.762 1.621 2.479 2.114 2.479a.53.53 0 0 0 .264-.07c.644-.354.524-2.654.494-3.128c0-.092-.001-1.027-.331-1.479c-.236-.324-.638-.45-.881-.496c.065-.094.203-.238.38-.323c.441-.22 1.238-.252 2.029-.252h.439c.858.012 1.08.067 1.392.146c.628.15.64.557.585 1.943c-.016.396-.033.842-.033 1.367c0 .112-.005.237-.005.364c-.019.711-.044 1.512.458 1.841a.4.4 0 0 0 .217.062c.174 0 .695 0 2.108-2.425c.62-1.071 1.1-2.334 1.133-2.429c.028-.053.112-.202.214-.262a.5.5 0 0 1 .236-.056h3.395c.37 0 .621.056.67.196c.082.227-.016.92-1.566 3.016c-.261.349-.49.651-.691.915c-1.405 1.844-1.405 1.937.083 3.337",clipRule:"evenodd"})});case"roblox":return a.jsx("svg",{version:"1.1",id:"svg10",x:"0px",y:"0px",viewBox:"0 0 302.7 302.7",width:"1.2em",height:"1.2em",fill:"currentColor",children:a.jsx("path",{id:"path20",d:"M120.5,271.7c-110.9-28.6-120-31-119.9-31.5C0.7,239.6,62.1,0.5,62.2,0.4c0,0,54,13.8,119.9,30.8S302.1,62,302.2,62c0.2,0,0.2,0.4,0.1,0.9c-0.2,1.5-61.5,239.3-61.7,239.5C240.6,302.5,186.5,288.7,120.5,271.7z M174.9,158c3.2-12.6,5.9-23.1,6-23.4c0.1-0.5-2.3-1.2-23.2-6.6c-12.8-3.3-23.5-5.9-23.6-5.8c-0.3,0.3-12.1,46.6-12,46.7c0.2,0.2,46.7,12.2,46.8,12.1C168.9,180.9,171.6,170.6,174.9,158L174.9,158z"})});default:return a.jsx(ys,{className:"w-6 h-6 text-white"})}};function qh(e){return e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}function p5(e,t,n){let s="",r=0,i=0;for(const o of e)for(r=r<<8|o,i+=8;i>=6;)i-=6,s+=t[r>>i&63];if(i>0&&(s+=t[r<<6-i&63]),n){const o=(4-s.length%4)%4;s+="=".repeat(o)}return s}function b5(e,t){const n=new Map;for(let o=0;o<t.length;o++)n.set(t[o],o);const s=[];let r=0,i=0;for(const o of e){if(o==="=")break;const l=n.get(o);if(l===void 0)throw new Error(`Invalid Base64 character: ${o}`);r=r<<6|l,i+=6,i>=8&&(i-=8,s.push(r>>i&255))}return Uint8Array.from(s)}const bV={encode(e,t={}){const n=qh(!1),s=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return p5(s,n,t.padding??!0)},decode(e){typeof e!="string"&&(e=new TextDecoder().decode(e));const t=e.includes("-")||e.includes("_"),n=qh(t);return b5(e,n)}},vV={encode(e,t={}){const n=qh(!0),s=typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e);return p5(s,n,t.padding??!0)},decode(e){const t=e.includes("-")||e.includes("_"),n=qh(t);return b5(e,n)}};function yV(){const e=typeof globalThis<"u"&&globalThis.crypto;if(e&&typeof e.subtle=="object"&&e.subtle!=null)return e.subtle;throw new Error("crypto.subtle must be defined")}function wV(e,t){return{digest:async n=>{const s=new TextEncoder,r=typeof n=="string"?s.encode(n):n,i=await yV().digest(e,r);return t==="hex"?Array.from(new Uint8Array(i)).map(c=>c.toString(16).padStart(2,"0")).join(""):t==="base64"||t==="base64url"||t==="base64urlnopad"?t.includes("url")?vV.encode(i,{padding:t!=="base64urlnopad"}):bV.encode(i):i}}}const mx=`// Example custom migration script
498
- import { migrateUser } from '@better-auth/migration';
499
-
500
- async function run() {
501
- const legacyUsers = await fetchLegacyUsers();
502
-
503
- for (const user of legacyUsers) {
504
- await migrateUser({
505
- email: user.email,
506
- passwordHash: user.passwordHash,
507
- metadata: user.metadata,
508
- });
509
- }
510
-
511
- return {
512
- migrated: legacyUsers.length,
513
- timestamp: new Date().toISOString(),
514
- };
515
- }
516
-
517
- run().then(console.log).catch(console.error);`,ec=[{id:"clerk",name:"Clerk",description:"Clerk Migration guide",docs:"https://better-auth.com/docs/migrations/clerk",logo:a.jsx("svg",{width:"1em",height:"1em",role:"img",stroke:"currentColor",fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",id:"Clerk--Streamline-Simple-Icons",children:a.jsx("path",{d:"m21.47 20.829 -2.881 -2.881a0.572 0.572 0 0 0 -0.7 -0.084 6.854 6.854 0 0 1 -7.081 0 0.576 0.576 0 0 0 -0.7 0.084l-2.881 2.881a0.576 0.576 0 0 0 -0.103 0.69 0.57 0.57 0 0 0 0.166 0.186 12 12 0 0 0 14.113 0 0.58 0.58 0 0 0 0.239 -0.423 0.576 0.576 0 0 0 -0.172 -0.453Zm0.002 -17.668 -2.88 2.88a0.569 0.569 0 0 1 -0.701 0.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0 -1.222 3.692 6.86 6.86 0 0 0 0.978 3.764 0.573 0.573 0 0 1 -0.083 0.699l-2.881 2.88a0.567 0.567 0 0 1 -0.864 -0.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637 -0.405 0.566 0.566 0 0 1 0.232 0.418 0.57 0.57 0 0 1 -0.168 0.448Zm-7.118 12.261a3.427 3.427 0 1 0 0 -6.854 3.427 3.427 0 0 0 0 6.854Z",fill:"#000000","stroke-width":"1"})}),highlights:["Downloads Clerk CSV export and REST API data.","Migrates passwords, totp secrets, and external accounts.","Respects Better Auth plugins (admin, username, phone-number, two-factor)."],script:`import 'dotenv/config';
518
- import { generateRandomString, symmetricEncrypt } from "better-auth/crypto";
519
- import { clerkClient } from '@clerk/clerk-sdk-node';
520
- import { auth } from "@/lib/auth";
521
- import * as fs from "node:fs/promises";
522
-
523
- function getCSVData(csv: string) {
524
- const lines = csv.split('\\n').filter(line => line.trim());
525
- const headers = lines[0]?.split(',').map(header => header.trim()) || [];
526
- const jsonData = lines.slice(1).map(line => {
527
- const values = line.split(',').map(value => value.trim());
528
- return headers.reduce((obj, header, index) => {
529
- obj[header] = values[index] || '';
530
- return obj;
531
- }, {} as Record<string, string>);
532
- });
533
- return jsonData as Array<{
534
- id: string;
535
- first_name: string;
536
- last_name: string;
537
- username: string;
538
- primary_email_address: string;
539
- primary_phone_number: string;
540
- verified_email_addresses: string;
541
- unverified_email_addresses: string;
542
- verified_phone_numbers: string;
543
- unverified_phone_numbers: string;
544
- totp_secret: string;
545
- password_digest: string;
546
- password_hasher: string;
547
- }>;
548
- }
549
-
550
- async function getClerkUsers(totalUsers: number) {
551
- const clerkUsers: any[] = [];
552
- for (let i = 0; i < totalUsers; i += 500) {
553
- const response = await fetch(\`https://api.clerk.com/v1/users?offset=\${i}&limit=500\`, {
554
- headers: { Authorization: \`Bearer \${process.env.CLERK_SECRET_KEY}\` },
555
- });
556
- if (!response.ok) throw new Error(\`Failed to fetch users: \${response.statusText}\`);
557
- clerkUsers.push(...((await response.json()) as any));
558
- }
559
- return clerkUsers;
560
- }
561
-
562
- export async function generateBackupCodes(secret: string) {
563
- const backupCodes = Array.from({ length: 10 })
564
- .map(() => generateRandomString(10, "a-z", "0-9", "A-Z"))
565
- .map(code => \`\${code.slice(0,5)}-\${code.slice(5)}\`);
566
- return symmetricEncrypt({ data: JSON.stringify(backupCodes), key: secret });
567
- }
568
-
569
- function safeDateConversion(timestamp?: number): Date {
570
- if (!timestamp) return new Date();
571
- const date = new Date(timestamp);
572
- if (isNaN(date.getTime())) return new Date();
573
- const year = date.getFullYear();
574
- if (year < 2000 || year > 2100) return new Date();
575
- return date;
576
- }
577
-
578
- async function migrateFromClerk() {
579
- const exportedUserCSV = await fs.readFile("exported_users.csv", "utf-8");
580
- const jsonData = getCSVData(exportedUserCSV);
581
- const clerkUsers = await getClerkUsers(jsonData.length);
582
-
583
- const ctx = await auth.$context;
584
- const isAdminEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "admin");
585
- const isTwoFactorEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "two-factor");
586
- const isUsernameEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "username");
587
- const isPhoneNumberEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "phone-number");
588
-
589
- for (const user of jsonData) {
590
- const {
591
- id,
592
- first_name,
593
- last_name,
594
- username,
595
- primary_email_address,
596
- primary_phone_number,
597
- verified_email_addresses,
598
- verified_phone_numbers,
599
- totp_secret,
600
- password_digest,
601
- } = user;
602
-
603
- const clerkUser = clerkUsers.find((item) => item?.id === id);
604
-
605
- const createdUser = await ctx.adapter.create({
606
- model: "user",
607
- data: {
608
- id,
609
- email: primary_email_address,
610
- emailVerified: verified_email_addresses.length > 0,
611
- name: \`\${first_name} \${last_name}\`,
612
- image: clerkUser?.image_url,
613
- createdAt: safeDateConversion(clerkUser?.created_at),
614
- updatedAt: safeDateConversion(clerkUser?.updated_at),
615
- ...(isTwoFactorEnabled ? { twoFactorEnabled: clerkUser?.two_factor_enabled } : {}),
616
- ...(isAdminEnabled ? {
617
- banned: clerkUser?.banned,
618
- banExpiresAt: clerkUser?.lockout_expires_in_seconds,
619
- role: "user",
620
- } : {}),
621
- ...(isUsernameEnabled ? { username } : {}),
622
- ...(isPhoneNumberEnabled ? {
623
- phoneNumber: primary_phone_number,
624
- phoneNumberVerified: verified_phone_numbers.length > 0,
625
- } : {}),
626
- },
627
- forceAllowId: true,
628
- }).catch(async () => {
629
- return await ctx.adapter.findOne({
630
- model: 'user',
631
- where: [{ field: 'id', value: id }],
632
- });
633
- });
634
-
635
- const externalAccounts = clerkUser?.external_accounts ?? [];
636
- for (const externalAccount of externalAccounts) {
637
- const {
638
- id: externalId,
639
- provider,
640
- provider_user_id,
641
- approved_scopes,
642
- created_at,
643
- updated_at,
644
- } = externalAccount;
645
-
646
- if (provider === 'credential') {
647
- await ctx.adapter.create({
648
- model: 'account',
649
- data: {
650
- id: externalId,
651
- providerId: provider,
652
- accountId: provider_user_id,
653
- scope: approved_scopes,
654
- userId: createdUser?.id,
655
- createdAt: safeDateConversion(created_at),
656
- updatedAt: safeDateConversion(updated_at),
657
- password: password_digest,
658
- },
659
- });
660
- } else {
661
- await ctx.adapter.create({
662
- model: 'account',
663
- data: {
664
- id: externalId,
665
- providerId: provider.replace('oauth_', ''),
666
- accountId: provider_user_id,
667
- scope: approved_scopes,
668
- userId: createdUser?.id,
669
- createdAt: safeDateConversion(created_at),
670
- updatedAt: safeDateConversion(updated_at),
671
- },
672
- forceAllowId: true,
673
- });
674
- }
675
- }
676
-
677
- if (isTwoFactorEnabled && totp_secret) {
678
- await ctx.adapter.create({
679
- model: 'twoFactor',
680
- data: {
681
- userId: createdUser?.id,
682
- secret: totp_secret,
683
- backupCodes: await generateBackupCodes(totp_secret),
684
- },
685
- });
686
- }
687
- }
688
- }
689
-
690
- migrateFromClerk()
691
- .then(() => {
692
- console.log('Migration completed');
693
- process.exit(0);
694
- })
695
- .catch((error) => {
696
- console.error('Migration failed:', error);
697
- process.exit(1);
698
- });`},{id:"supabase",name:"Supabase",description:"Supabase Migration guide",docs:"https://better-auth.com/docs/migrations/supabase",logo:"",highlights:["Exports Supabase auth.users and auth.identities.","Preserves password hashes and metadata fields.","Supports incremental re-runs with idempotent operations."],disabled:!0},{id:"auth0",name:"Auth0",description:"Auth0 Migration guide",docs:"https://better-auth.com/docs/migrations/auth0",logo:"",highlights:["Uses Auth0 Management API bulk exports.","Keeps password hashes compatible with Better Auth adapters.","Migrates applications and roles to Better Auth format."],disabled:!0},{id:"nextauth",name:"NextAuth.js",description:"NextAuth.js Migration guide",docs:"https://better-auth.com/docs/migrations/nextauth",logo:"",highlights:["Reads users/accounts from your existing NextAuth database.","Moves refresh tokens and OAuth profiles into Better Auth.","Supports Prisma, MySQL, and Postgres NextAuth adapters."],disabled:!0},{id:"custom",name:"Custom Script",description:"Custom Migration guide",docs:"https://better-auth.com/docs/migrations/custom",highlights:["Use Better Auth SDK helpers to insert users safely.","Supports dry-run mode to validate before committing.","Perfect for bespoke data sources or ETL pipelines."],custom:!0}];function jV(){const[e,t]=vE(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[h,d]=m.useState([]),[f,x]=m.useState(""),[y,b]=m.useState(!1),[w,g]=m.useState(""),[v,p]=m.useState(mx),[j,N]=m.useState(!1),[C,S]=m.useState(""),[M,A]=m.useState(""),[V,$]=m.useState("SHA-256"),[z,Y]=m.useState("hex"),[E,R]=m.useState(null),[T,_]=m.useState(!1),[k,D]=m.useState(!1),[L,q]=m.useState(!1),[O,B]=m.useState(null),[X,Z]=m.useState(new Set),[ne,ee]=m.useState(!1),[J,se]=m.useState([]),[pe,re]=m.useState(new Set),[he,fe]=m.useState("json"),[ke,Oe]=m.useState("1000"),[Re,Be]=m.useState(!1),[dt,Ie]=m.useState(!1),[St,bt]=m.useState(""),[qe,et]=m.useState(""),[Qe,vt]=m.useState(null),[yt,Ht]=m.useState(!1),[It,te]=m.useState(null),[be,He]=m.useState(!1),[I,le]=m.useState("api_key"),[ue,xe]=m.useState(""),[Te,We]=m.useState(""),[G,ae]=m.useState("15"),[ye,de]=m.useState(""),[Se,W]=m.useState(`{
699
-
700
- }`),[F,me]=m.useState(null),[Ve,tt]=m.useState(!1),[nt,Ke]=m.useState(!1),[Gt,cn]=m.useState("1"),[en,Ft]=m.useState([]),[Na,mn]=m.useState(""),[Cn,Ds]=m.useState(null);m.useEffect(()=>(L?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[L]),m.useEffect(()=>(nt?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[nt]);const Ee=(U,Q,ie,ve)=>{i(ze=>[...ze,{id:ve??`log-${Date.now()}-${Math.random()}`,type:U,message:Q,timestamp:new Date,status:ie}])},Bn=m.useRef(new Set),Sa=m.useRef(new Set),_n=m.useRef(new Map),_s=m.useRef(null),nr=()=>ec.find(U=>!U.disabled)??ec[0],kt=ec.find(U=>U.id===w)??nr();m.useEffect(()=>{g(y?U=>{var Q;return U||((Q=nr())==null?void 0:Q.id)||""}:"")},[y,nr]);const sr=U=>{g(U),U!=="custom"&&p(mx)},ar=()=>{S(""),A(""),R(null),$("SHA-256"),Y("hex"),N(!0)},ni=async()=>{if(!C.trim()){P.error("Enter a password to hash");return}try{_(!0);const U=M?`${M}:${C}`:C,ie=await wV(V,z).digest(U);R(ie),P.success("Password hashed successfully")}catch(U){P.error("Failed to hash password"),console.error(U)}finally{_(!1)}},Vn=async U=>{try{await navigator.clipboard.writeText(U),P.success("Copied to clipboard")}catch{P.error("Failed to copy to clipboard")}},bn=()=>{_s.current&&!_s.current.closed&&_s.current.close(),_s.current=null},tn=(U,Q,ie,ve,ze)=>{let Ge=_n.current.get(U);Ge||(Ge=new Map,_n.current.set(U,Ge));const Et=Ge.get(ie);if(Et){i(rr=>rr.map(ct=>ct.id===Et?{...ct,type:Q,message:ve,status:ze,timestamp:new Date}:ct));return}const vn=`session-${U}-${ie}-${Date.now()}`;Ge.set(ie,vn),Ee(Q,ve,ze,vn)},kn=(U,Q,ie=0)=>{Bn.current.has(U)||Bn.current.add(U),fetch(`/api/tools/oauth/status?testSessionId=${encodeURIComponent(U)}`).then(ze=>ze.json()).then(ze=>{if(ze.hasResult){Bn.current.delete(U),us(ze.result);return}if(ie+1>=15){Bn.current.delete(U),tn(U,"error","timeout","⌛ Timed out waiting for account creation. Check Better Auth logs.","failed"),bn(),s(null),P.error("OAuth test timed out waiting for account creation");return}setTimeout(()=>kn(U,Q,ie+1),2e3)}).catch(ze=>{ie+1<15?setTimeout(()=>kn(U,Q,ie+1),2e3):(Bn.current.delete(U),tn(U,"error","poll-error",`⚠️ Failed to check OAuth status: ${ze}`,"failed"),bn(),s(null),P.error("Failed to check OAuth status"))})},us=U=>{l(!0);const Q=U.testSessionId;if(U.success){if(Sa.current.has(Q)&&U.userInfo)return;if(tn(Q,"success","waiting","✅ Verified with Better Auth.","completed"),U.userInfo){Sa.current.add(Q);const ie=[U.userInfo.name?`👤 ${U.userInfo.name}`:null,U.userInfo.email?`✉️ ${U.userInfo.email}`:null].filter(Boolean).join(" | "),ve=ie?`✅ ${U.provider} OAuth succeeded — ${ie}`:`✅ ${U.provider} OAuth succeeded!`;tn(Q,"success","completed",ve,"completed"),P.success(`OAuth test for ${U.provider} passed!`),bn(),s(null),_n.current.delete(Q)}else tn(Q,"progress","await-finalize","⌛ OAuth flow finished. Waiting for Better Auth to finalize account...","running"),Bn.current.has(Q)||(Bn.current.add(Q),kn(Q,U.provider))}else{if(Sa.current.has(Q))return;tn(Q,"error","waiting","❌ Verification failed with Better Auth.","failed");const ie=U.error?` — ${U.error}`:"";tn(Q,"error","failed",`❌ ${U.provider} OAuth failed${ie}`,"failed"),P.error(`OAuth test for ${U.provider} failed`),bn(),s(null),_n.current.delete(Q)}U.success||(Sa.current.add(Q),_n.current.delete(Q)),sessionStorage.removeItem("oauth_test_session"),sessionStorage.removeItem(`oauth_test_result_${Q}`)};m.useEffect(()=>{const U=e.get("oauth_test_result");if(U)try{const Q=JSON.parse(decodeURIComponent(U));l(!0),us(Q),t({})}catch{}},[e,t,us]),m.useEffect(()=>{(async()=>{try{const ie=await(await fetch("/api/tools/oauth/providers")).json();ie.success&&ie.providers&&d(ie.providers.filter(ve=>ve.enabled))}catch{}})()},[]);const qi=async()=>{if(h.length===0){P.error("No OAuth providers configured"),Ee("error","❌ No OAuth providers found in configuration","failed"),Ee("info","💡 Please configure at least one OAuth provider in your Better Auth config","failed");return}u(!0)},Ml=async U=>{u(!1),x(""),s("test-oauth"),l(!0),i([]),Ee("info",`🔍 Testing ${U} OAuth...`,"running");const Q=new Date().toISOString();try{Ee("progress","📡 Contacting Better Auth...","running");const ve=await(await fetch("/api/tools/oauth/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:U})})).json();if(ve.success&&ve.startUrl){_n.current.delete(ve.testSessionId),tn(ve.testSessionId,"progress","popup-open",`🌐 Opening ${ve.provider} OAuth popup...`,"running");const ze={testSessionId:ve.testSessionId,provider:ve.provider,providerId:U,startTime:Q};Sa.current.delete(ve.testSessionId),sessionStorage.setItem("oauth_test_session",JSON.stringify(ze));const Ge=600,Et=700,vn=(window.screen.width-Ge)/2,rr=(window.screen.height-Et)/2,ct=window.open(ve.startUrl,"oauth-test",`width=${Ge},height=${Et},left=${vn},top=${rr},scrollbars=yes,resizable=yes`);if(!ct){Ee("error","❌ Failed to open OAuth window. Please allow popups for this site.","failed"),Ee("error","💡 Check your browser popup blocker settings","failed"),P.error("Failed to open OAuth window. Please allow popups."),s(null);return}_s.current=ct;let Mt=!1;const Ol=Os=>{if(Os.origin===window.location.origin){if(Os.data&&Os.data.type==="oauth_test_state"){if(Os.data.status==="redirect")Bn.current.has(ze.testSessionId)||kn(ze.testSessionId,ze.provider);else if(Os.data.status==="error"){Mt=!0;const ri=sessionStorage.getItem("oauth_test_session");let Zf=ve.provider;if(ri)try{Zf=JSON.parse(ri).provider||Zf}catch{}us({success:!1,provider:Zf,testSessionId:Os.data.testSessionId,error:Os.data.error||"Failed to start OAuth test"}),window.removeEventListener("message",Ol),clearInterval(Ud),clearTimeout(Xf),bn()}return}if(Os.data&&Os.data.type==="oauth_test_result"){window.removeEventListener("message",Ol),clearInterval(Ud),clearTimeout(Xf),Mt=!0;const ri=Os.data.result;us(ri),Bn.current.has(ri.testSessionId)||kn(ri.testSessionId,ri.provider),bn()}}};window.addEventListener("message",Ol);const Ud=setInterval(()=>{ct.closed&&(clearInterval(Ud),clearTimeout(Xf),window.removeEventListener("message",Ol),!sessionStorage.getItem(`oauth_test_result_${ze.testSessionId}`)&&!Mt&&(Mt=!0,kn(ze.testSessionId,ze.provider)))},500),Xf=setTimeout(()=>{ct.closed||(clearInterval(Ud),window.removeEventListener("message",Ol),bn(),Mt||(Mt=!0),Ee("error","❌ OAuth test timed out after 5 minutes","failed"),Ee("error","💡 Possible reasons:","failed"),Ee("error"," • Authentication took too long","failed"),Ee("error"," • Provider is not responding","failed"),Ee("error"," • Network connectivity issues","failed"),P.error("OAuth test timed out"),s(null))},5*60*1e3)}else Ee("error",`❌ Failed to initiate OAuth test: ${ve.error||"Unknown error"}`,"failed"),ve.details&&Ee("error",`💡 Details: ${JSON.stringify(ve.details)}`,"failed"),ve.cause&&Ee("error",`💡 Cause: ${ve.cause}`,"failed"),P.error(ve.error||"Failed to start OAuth test"),s(null)}catch(ie){Ee("error",`❌ Network error: ${ie}`,"failed"),P.error("Failed to start OAuth test"),s(null)}},Qs=()=>{b(!0)},As=async(U,Q)=>{const ie=ec.find(ze=>ze.id===U);if(!ie){P.error("Unknown migration provider");return}if(ie.disabled){P.info(`${ie.name} migration is coming soon`);return}b(!1),s("run-migration"),l(!0),i([]);const ve=ze=>new Promise(Ge=>setTimeout(Ge,ze));try{if(Ee("info",`🚀 Preparing ${ie.name} migration...`,"running"),ie.highlights)for(const Et of ie.highlights)await ve(350),Ee("progress",Et,"running");Ee("progress","📡 Sending migration payload to server...","running");const Ge=await(await fetch("/api/tools/migrations/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:ie.id,script:ie.custom?Q:ie.script})})).json();if(Ge.success)Ee("progress","🚀 Migration job acknowledged. Follow server logs for live progress.","running"),Ee("success",`✅ ${ie.name} migration request accepted.`,"completed"),Ge.message&&Ee("info",Ge.message,"completed"),P.success(`${ie.name} migration flow completed`);else throw new Error(Ge.error||"Migration request failed")}catch(ze){Ee("error",`❌ Migration failed: ${ze}`,"failed"),P.error("Migration failed")}finally{s(null)}},si=async()=>{s("validate-config"),l(!0),i([]),B(null),q(!0),Ee("info","Validating Better Auth configuration...","running");try{const Q=await(await fetch("/api/tools/validate-config",{method:"POST",headers:{"Content-Type":"application/json"}})).json();if(Q.success!==void 0)B(Q),Ee("info",`Found ${Q.summary.total} validation checks`,"completed"),Q.summary.errors>0&&Ee("error",`❌ ${Q.summary.errors} error(s) found`,"failed"),Q.summary.warnings>0&&Ee("progress",`⚠️ ${Q.summary.warnings} warning(s) found`,"completed"),Q.summary.passes>0&&Ee("success",`✅ ${Q.summary.passes} check(s) passed`,"completed"),Q.success?P.success("Configuration validation completed successfully"):P.error(`Configuration validation found ${Q.summary.errors} error(s)`);else throw new Error(Q.error||"Failed to validate configuration")}catch(U){Ee("error",`❌ Configuration validation failed: ${U}`,"failed"),P.error("Configuration validation failed")}finally{s(null)}},Gi=async()=>{s("test-db"),l(!0),i([]),Ee("info","Testing database connection...","running");try{const Q=await(await fetch("/api/database/test")).json();await new Promise(ie=>setTimeout(ie,1e3)),Ee("progress","Checking on database con!","running"),Q.success?(Ee("success","✅ Database connection successful!","completed"),Q.result&&Array.isArray(Q.result)&&Q.result.length>0&&(Ee("info","📄 Sample user record (first row):","completed"),Ee("info",JSON.stringify(Q.result[0],null,2),"completed")),P.success("Database connection test successful")):(Ee("error",`❌ Database connection failed: ${Q.error||"Unknown error"}`,"failed"),P.error("Database connection test failed"))}catch(U){Ee("error",`❌ Network error: ${U}`,"failed"),P.error("Failed to test database connection")}finally{s(null)}},Tl=async()=>{s("generate-api-key"),l(!0),i([]),Ee("info","Generating new API key...","running");try{const Q=await(await fetch("/api/tools/generate-api-key",{method:"POST",headers:{"Content-Type":"application/json"}})).json();Q.success&&Q.apiKey?(Ee("success","✅ API key generated successfully!","completed"),Ee("info",`API Key: ${Q.apiKey}`,"completed"),P.success("API key generated successfully")):(Ee("error",`❌ Failed to generate API key: ${Q.error||"Unknown error"}`,"failed"),P.error("Failed to generate API key"))}catch(U){Ee("error",`❌ Network error: ${U}`,"failed"),P.error("Failed to generate API key")}finally{s(null)}},Rd=U=>{if(!U)return"N/A";const Q=new Date(U);return Number.isNaN(Q.getTime())?U:Q.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})},Xi=()=>{ee(!0)},wt=()=>{bt(""),et(""),vt(null),te(null),Ie(!0)},Zi=()=>{cn("1"),Ft([]),mn(""),Ds(null),Ke(!0)},Qi=()=>{const U=Math.min(Math.max(parseInt(Gt)||1,1),100),Q=[];for(let ie=0;ie<U;ie++)try{const ve=crypto.randomUUID();Q.push(ve)}catch{P.error("Failed to generate UUID");return}Ft(Q),P.success(`Generated ${Q.length} UUID(s)`)},Dl=()=>{var rr,ct;const U=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Q=Na.trim();if(!Q){Ds(null);return}if(!U.test(Q)){Ds({isValid:!1});return}const ve=Q.split("-"),ze=(rr=ve[2])==null?void 0:rr[0],Ge=(ct=ve[3])==null?void 0:ct[0];let Et,vn;if(ze){const Mt=parseInt(ze,16);Mt>=1&&Mt<=5?Et=`v${Mt}`:Mt===0&&(Et="v1 (time-based)")}if(Ge){const Mt=parseInt(Ge,16);Mt>=8&&Mt<=11?vn="RFC 4122":Mt>=12&&Mt<=15?vn="Microsoft":Mt>=0&&Mt<=7&&(vn="Reserved")}Ds({isValid:!0,version:Et,variant:vn})},ai=()=>{le("api_key"),xe(""),We(""),ae("15"),de(""),W(`{
701
-
702
- }`),me(null),He(!0)},Ca=async()=>{try{const Q=await(await fetch("/api/database/schema")).json();if(Q.success&&Q.schema&&Q.schema.tables){const ie=Q.schema.tables.map(ve=>({name:ve.name,displayName:ve.displayName||ve.name}));se(ie)}}catch{P.error("Failed to fetch available tables")}};m.useEffect(()=>{ne&&(Ca(),re(new Set))},[ne]);const _l=U=>{re(Q=>{const ie=new Set(Q);return ie.has(U)?ie.delete(U):ie.add(U),ie})},Al=()=>{re(new Set(J.map(U=>U.name)))},Ki=()=>{re(new Set)},ge=async()=>{if(!St.trim()){P.error("Please paste a JWT to decode");return}Ht(!0),te(null),vt(null);try{const Q=await(await fetch("/api/tools/jwt/decode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:St.trim(),secret:qe.trim()||void 0})})).json();if(Q.success)vt(Q),P.success("JWT decoded successfully");else{const ie=Q.error||"Failed to decode JWT";te(ie),P.error(ie)}}catch(U){const Q=U instanceof Error?U.message:"Failed to decode JWT";te(Q),P.error(Q)}finally{Ht(!1)}},we=async()=>{const U=parseInt(G,10);if(isNaN(U)||U<=0){P.error("Please provide a valid expiration (minutes)");return}let Q;if(I==="jwt"){const ie=Se.trim();if(ie.length>0&&ie!=="{"&&ie!=="}")try{Q=JSON.parse(ie)}catch{P.error("Custom claims must be valid JSON");return}}tt(!0),me(null);try{const ve=await(await fetch("/api/tools/token-generator",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:I,subject:ue||void 0,audience:Te||void 0,expiresInMinutes:U,customClaims:Q,secretOverride:ye||void 0})})).json();if(ve.success)me(ve),Ee("success",`✅ Generated ${I.replace("_"," ")} token`,"completed"),P.success("Token generated successfully");else throw new Error(ve.error||"Failed to generate token")}catch(ie){const ve=ie instanceof Error?ie.message:"Failed to generate token";Ee("error",`❌ ${ve}`,"failed"),P.error(ve)}finally{tt(!1)}},je=async()=>{if(pe.size===0){P.error("Please select at least one table to export");return}const U=parseInt(ke,10);if(isNaN(U)||U<=0){P.error("Please enter a valid limit (greater than 0)");return}if(U>1e4){P.error("Limit cannot exceed 10,000 rows per table");return}Be(!0),s("export-data"),l(!0),i([]);try{Ee("info",`📦 Starting export of ${pe.size} table(s)...`,"running"),Ee("progress",`Format: ${he.toUpperCase()} | Limit: ${U} rows per table`,"running");const ie=await(await fetch("/api/tools/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tables:Array.from(pe),format:he,limit:U})})).json();if(ie.success){Ee("success","✅ Export completed successfully!","completed"),ie.rowCounts&&Object.entries(ie.rowCounts).forEach(([Et,vn])=>{Ee("info",` • ${Et}: ${vn} rows`,"completed")}),Ee("info",`Downloading ${ie.filename}...`,"completed");const ve=new Blob([ie.data],{type:ie.contentType||(he==="json"?"application/json":"text/csv")}),ze=window.URL.createObjectURL(ve),Ge=document.createElement("a");Ge.href=ze,Ge.download=ie.filename,document.body.appendChild(Ge),Ge.click(),document.body.removeChild(Ge),window.URL.revokeObjectURL(ze),P.success("Export downloaded successfully"),ee(!1)}else throw new Error(ie.error||"Export failed")}catch(Q){Ee("error",`❌ Export failed: ${Q instanceof Error?Q.message:Q}`,"failed"),P.error("Export failed")}finally{Be(!1),s(null)}},ce=async()=>{s("health-check"),l(!0),i([]),Ee("info","Running Better Auth health check...","running");try{Ee("progress","Testing Better Auth endpoints...","running");const U=await fetch("/api/tools/health-check",{method:"POST"}),Q=await U.json();if(!U.ok)throw new Error(Q.error||Q.message||"Health check failed");Q.success?(Ee("success","✅ Better Auth health check passed","completed"),P.success("Health check passed")):(Ee("error","❌ Better Auth health check failed","failed"),Q.failedEndpoints&&Q.failedEndpoints.length>0&&Q.failedEndpoints.forEach(ie=>{const ve=ie.status?` (Status: ${ie.status})`:"",ze=ie.error?` - ${ie.error}`:"";Ee("error",` • Endpoint ${ie.endpoint}${ve}${ze}`,"failed")}),P.error("Health check failed"))}catch(U){Ee("error",`❌ Health check failed: ${U instanceof Error?U.message:U}`,"failed"),P.error("Health check failed")}finally{s(null)}},Ce=new Set(["test-oauth","test-db","hash-password","health-check","export-data","jwt-decoder","token-generator","validate-config","uuid-generator"]),Ue=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:ys,action:qi,category:"oauth"},{id:"hash-password",name:"Hash Password",description:"Generate SHA hashes",icon:Po,action:ar,category:"utilities"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:Ya,action:Qs,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:Ya,action:Gi,category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:Ih,action:si,category:"utilities"},{id:"generate-api-key",name:"Generate API Key",description:"Generate a new API key",icon:Po,action:Tl,category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:Ry,action:ce,category:"testing"},{id:"export-data",name:"Export Data",description:"Export database tables to JSON or CSV",icon:Cc,action:Xi,category:"database"},{id:"jwt-decoder",name:"JWT Decoder",description:"Inspect tokens and verify claims",icon:yn,action:wt,category:"utilities"},{id:"token-generator",name:"Token Generator",description:"Mint short-lived test tokens",icon:kc,action:ai,category:"utilities"},{id:"uuid-generator",name:"UUID Generator",description:"Generate and validate UUIDs",icon:Oy,action:Zi,category:"utilities"}],Ne=[{id:"oauth",name:"OAuth",icon:ys},{id:"database",name:"Database",icon:Ya},{id:"testing",name:"Testing",icon:Ry},{id:"utilities",name:"Utilities",icon:o5}].map(U=>({...U,tools:Ue.filter(Q=>Q.category===U.id)}));return a.jsxs("div",{className:"space-y-8 bg-black w-full min-h-screen",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:a.jsxs("div",{className:"pb-8",children:[a.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Tools"}),a.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Utility tools for managing and testing your Better Auth setup"})]})}),a.jsxs("div",{className:"flex flex-col items-center space-y-8",children:[a.jsx("hr",{className:"w-full border-white/15 h-px"}),a.jsx("hr",{className:"w-full border-white/15 h-px"})]}),o&&r.length>0&&a.jsxs("div",{className:"mb-6 p-6 gap-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 tracking-wider",children:"Tool Output"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsx(Zr,{title:"Tool Execution Logs",lines:r,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),a.jsx("div",{className:"space-y-8 p-6 gap-8",children:Ne.map(U=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(U.icon,{className:"w-5 h-5 text-white"}),a.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider",children:U.name})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:U.tools.map(Q=>{const ie=Q.icon,ve=n===Q.id,ze=Ce.has(Q.id),Ge=!ze||n!==null&&n!==Q.id||ve;return a.jsxs("button",{onClick:()=>Q.action(),disabled:Ge,className:`relative flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none transition-colors text-left group ${ze?"hover:bg-black/50 disabled:opacity-50 disabled:cursor-not-allowed":"opacity-60 cursor-not-allowed"}`,children:[a.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:ve?a.jsx(ks,{className:"w-6 h-6 text-white animate-spin"}):a.jsx(ie,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-light mb-1",children:Q.name}),a.jsxs("p",{className:"text-xs uppercase font-mono flex items-center text-gray-400",children:[a.jsx(_w,{className:"w-4 h-4 mr-2"}),Q.description]})]}),!ze&&a.jsx("span",{className:"absolute top-2 right-3 text-[10px] font-mono uppercase tracking-[0.2em] text-white/60",children:"Coming Soon"}),a.jsx(vr,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]},Q.id)})})]},U.id))})]}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Po,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Hasher"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400",children:"Algorithm"}),a.jsxs("select",{value:V,onChange:U=>$(U.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[a.jsx("option",{value:"SHA-256",children:"SHA-256"}),a.jsx("option",{value:"SHA-384",children:"SHA-384"}),a.jsx("option",{value:"SHA-512",children:"SHA-512"})]})]}),a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400",children:"Encoding"}),a.jsxs("select",{value:z,onChange:U=>Y(U.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[a.jsx("option",{value:"hex",children:"Hex"}),a.jsx("option",{value:"base64",children:"Base64"}),a.jsx("option",{value:"base64url",children:"Base64 URL"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400",children:"Salt (optional)"}),a.jsx(Le,{value:M,onChange:U=>A(U.target.value),placeholder:"e.g. project-specific-salt",className:"mt-2 bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsxs("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:["Salt is prepended (",a.jsx("span",{className:"text-white/80",children:"salt:password"}),")"]})]}),a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400",children:"Password"}),a.jsxs("div",{className:"relative mt-2",children:[a.jsx(Le,{type:k?"text":"password",value:C,onChange:U=>S(U.target.value),placeholder:"Enter password",className:"bg-black border border-dashed border-white/20 text-white rounded-none pr-10"}),a.jsx("button",{type:"button",onClick:()=>D(U=>!U),className:"absolute inset-y-0 right-0 px-3 flex items-center text-gray-400 hover:text-white","aria-label":k?"Hide password":"Show password",children:k?a.jsx(I4,{className:"w-4 h-4"}):a.jsx(Nl,{className:"w-4 h-4"})})]})]})]}),E&&a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400",children:"Hash Result"}),a.jsxs("div",{className:"mt-2 flex items-center space-x-2",children:[a.jsx(Le,{value:E,readOnly:!0,className:"flex-1 bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx(H,{variant:"outline",size:"icon",onClick:()=>E&&Vn(E),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:a.jsx(_a,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-8 border-t border-dashed border-white/10 pt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"}),a.jsx(H,{onClick:ni,disabled:T,className:"rounded-none",children:T?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-4 h-4 mr-2 animate-spin"}),"Hashing..."]}):"Hash Password"})]})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-8 w-full max-w-2xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ys,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{u(!1),x("")},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"space-y-4",children:h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ys,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 mb-2 text-lg",children:"No OAuth providers configured"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Please configure OAuth providers in your Better Auth configuration"})]}):a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-4 uppercase font-mono",children:["Available Providers (",h.length,")"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-h-96 overflow-y-auto",children:h.map(U=>a.jsxs("button",{onClick:()=>{x(U.id),setTimeout(()=>{Ml(U.id)},100)},className:`w-full flex items-center space-x-4 p-4 border rounded-none transition-all text-left group ${f===U.id?"border-white/50 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/30"}`,children:[a.jsx("div",{className:"flex-shrink-0",children:g5(U.id)}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("p",{className:"text-white uppercase font-mono font-light text-base",children:U.name||U.id})}),a.jsx(vr,{className:`w-5 h-5 transition-colors flex-shrink-0 ${f===U.id?"text-white":"text-gray-400 group-hover:text-white"}`})]},U.id))}),a.jsx("p",{className:"text-xs text-gray-500 mt-4 font-mono uppercase",children:"Click on a provider to start the OAuth test"})]})}),a.jsx("div",{className:"flex justify-end space-x-3 mt-8 pt-6 border-t border-dashed border-white/10",children:a.jsx(H,{variant:"outline",onClick:()=>{u(!1),x("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"})})]})}),y&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/95 border border-dashed border-white/20 p-8 w-full max-w-5xl rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Ya,{className:"w-6 h-6 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Select Migration"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>b(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"space-y-3",children:ec.map(U=>{const Q=(kt==null?void 0:kt.id)===U.id;return a.jsxs("button",{onClick:()=>sr(U.id),disabled:U.disabled,className:`w-full flex items-center space-x-3 p-4 border transition-colors rounded-none text-left ${U.disabled?"border-dashed border-white/10 bg-black/30 cursor-not-allowed opacity-60":Q?"border-white/60 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/40"}`,children:[a.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/10 flex items-center justify-center",children:U.logo?U.logo:a.jsx(_y,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-white uppercase font-mono text-sm",children:U.name}),a.jsx("p",{className:"text-xs uppercase text-gray-400 font-mono mt-1 truncate",children:U.description})]}),U.disabled&&a.jsx("span",{className:"text-[10px] font-mono text-gray-400 uppercase",children:"Coming Soon"})]},U.id)})}),a.jsxs("div",{className:"md:col-span-2 space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/10 flex items-center justify-center",children:kt.logo?kt.logo:a.jsx(_y,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-white -mb-2 text-lg font-light uppercase tracking-wider",children:kt.name}),a.jsx("p",{className:"text-sm mt-0 text-gray-400 uppercase font-mono leading-relaxed",children:kt.description}),a.jsx("div",{className:"flex items-center space-x-2",children:kt.docs&&a.jsx(H,{variant:"ghost",size:"sm",asChild:!0,className:"rounded-none border border-dashed",children:a.jsx("a",{href:kt.docs,target:"_blank",rel:"noreferrer",children:"View Docs"})})})]})]}),kt.highlights&&a.jsx("ul",{className:"space-y-2 text-xs text-gray-300 font-mono bg-black/40 border border-white/10 p-4",children:kt.highlights.map(U=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx("span",{className:"text-white/60 mt-0.5",children:"•"}),a.jsx("span",{children:U})]},U))}),kt.disabled?a.jsxs("div",{className:"space-y-4 text-gray-400 font-mono text-xs",children:[a.jsx("p",{children:"This migration provider is coming soon."}),a.jsxs("p",{children:["Subscribe to updates at"," ",a.jsx("a",{href:"https://better-auth.com",target:"_blank",rel:"noreferrer",className:"text-white underline",children:"better-auth.com"}),"."]})]}):kt.custom?a.jsxs("div",{className:"space-y-3",children:[a.jsx("label",{className:"text-xs uppercase font-mono text-gray-400",children:"Custom Migration Script"}),a.jsx("textarea",{value:v,onChange:U=>p(U.target.value),className:"w-full h-64 bg-black/70 border border-white/10 text-xs text-gray-200 font-mono p-3 rounded-none focus:outline-none focus:ring-0"}),a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(H,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>p(mx),children:"Reset"}),a.jsxs(H,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>Vn(v),children:[a.jsx(_a,{className:"w-4 h-4"}),"Copy Script"]}),a.jsx(H,{className:"rounded-none",onClick:()=>As("custom",v),children:"Run Custom Script"})]})]}):a.jsxs("div",{className:"space-y-3",children:[kt.script&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-mono text-gray-400",children:[a.jsx("span",{children:"Migration Script Preview"}),a.jsxs(H,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>Vn(kt.script),children:[a.jsx(_a,{className:"w-4 h-4"}),"Copy Script"]})]}),a.jsx("pre",{className:"bg-black/70 border border-white/10 text-[11px] text-green-200 font-mono p-4 overflow-auto leading-relaxed h-64",children:a.jsx("code",{children:kt.script})})]}),a.jsx("div",{className:"flex items-center justify-end space-x-2",children:a.jsxs(H,{className:"rounded-none",onClick:()=>As(kt.id),children:["Run ",kt.name," Migration"]})})]})]})]})]})}),ne&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-3xl max-h-[85vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Cc,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Export Data"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ee(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Export Format"}),a.jsxs("div",{className:"flex space-x-4",children:[a.jsx("button",{onClick:()=>fe("json"),className:`px-4 py-2 border rounded-none transition-colors ${he==="json"?"border-white/50 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/30"}`,children:"JSON"}),a.jsx("button",{onClick:()=>fe("csv"),className:`px-4 py-2 border rounded-none transition-colors ${he==="csv"?"border-white/50 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/30"}`,children:"CSV"})]})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"export-limit",className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Row Limit Per Table"}),a.jsx(Le,{id:"export-limit",type:"number",value:ke,onChange:U=>Oe(U.target.value),min:"1",max:"10000",placeholder:"1000",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Maximum 10,000 rows per table (default: 1000)"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs(Me,{className:"text-xs uppercase font-mono text-gray-400",children:["Select Tables (",pe.size," selected)"]}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx(H,{variant:"ghost",size:"sm",onClick:Al,className:"text-xs text-gray-400 hover:text-white rounded-none",children:"Select All"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:Ki,className:"text-xs text-gray-400 hover:text-white rounded-none",children:"Deselect All"})]})]}),a.jsx("div",{className:"border border-dashed border-white/20 rounded-none max-h-64 overflow-y-auto",children:J.length===0?a.jsx("div",{className:"p-4 text-center text-gray-400 text-sm",children:"Loading tables..."}):a.jsx("div",{className:"space-y-0",children:J.map(U=>{const Q=pe.has(U.name);return a.jsx("button",{onClick:()=>_l(U.name),className:`w-full text-left p-3 border-b border-dashed border-white/10 last:border-b-0 transition-colors ${Q?"bg-white/10 border-white/30":"hover:bg-white/5"}`,children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-white text-sm font-mono",children:U.displayName}),a.jsxs("span",{className:"text-xs text-gray-400 ml-2 font-mono",children:["(",U.name,")"]})]}),Q&&a.jsx(pu,{className:"w-4 h-4 text-white"})]})},U.name)})})})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-8 border-t border-dashed border-white/10 pt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>ee(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:je,disabled:Re||pe.size===0,className:"rounded-none",children:Re?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-4 h-4 mr-2 animate-spin"}),"Exporting..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Cc,{className:"w-4 h-4 mr-2"}),"Export"]})})]})]})}),dt&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60]",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(yn,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"JWT Decoder"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Ie(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"JWT Token"}),a.jsx("textarea",{value:St,onChange:U=>bt(U.target.value),placeholder:"Paste JWT here",className:"w-full min-h-[120px] bg-black border border-dashed border-white/20 text-white font-mono text-xs p-3 rounded-none focus:outline-none"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"HMAC Secret (optional)"}),a.jsx(Le,{value:qe,onChange:U=>et(U.target.value),placeholder:"Defaults to Better Auth secret if omitted",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{bt(""),et(""),vt(null),te(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:ge,disabled:yt,className:"rounded-none",children:yt?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-4 h-4 mr-2 animate-spin"}),"Decoding..."]}):"Decode JWT"})]})]}),It&&a.jsx("div",{className:"border border-dashed border-red-500/30 bg-red-500/10 text-red-300 text-xs font-mono p-3 rounded-none",children:It}),Qe&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Signature"}),a.jsx("p",{className:`text-sm ${Qe.verified?"text-green-400":"text-yellow-300"}`,children:Qe.verified?"Verified (HS256)":"Not verified"}),a.jsx("p",{className:"text-gray-400 break-all",children:Qe.signature||"None"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Issued"}),a.jsx("p",{className:"text-white",children:Qe.issuedAtFormatted||"Unknown"}),a.jsx("p",{className:"text-gray-500",children:Qe.issuedAgo||""})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Expires"}),a.jsx("p",{className:`text-white ${Qe.expired?"text-red-300":""}`,children:Qe.expiresAtFormatted||"No expiry"}),a.jsx("p",{className:"text-gray-500",children:Qe.expiresIn||""})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-xs uppercase font-mono text-gray-400",children:"Header"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Vn(JSON.stringify(Qe.header,null,2)),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_a,{className:"w-4 h-4"})})]}),a.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto max-h-64",children:JSON.stringify(Qe.header,null,2)})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-xs uppercase font-mono text-gray-400",children:"Payload"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Vn(JSON.stringify(Qe.payload,null,2)),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_a,{className:"w-4 h-4"})})]}),a.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto max-h-64",children:JSON.stringify(Qe.payload,null,2)})]})]}),Qe.customClaims&&Object.keys(Qe.customClaims).length>0&&a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-2",children:"Custom Claims"}),a.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto max-h-64",children:JSON.stringify(Qe.customClaims,null,2)})]})]})]})]})}),be&&a.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-[60]",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(kc,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Token Generator"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>He(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Token Type"}),a.jsx("div",{className:"flex flex-wrap gap-3",children:[{id:"api_key",label:"API Key"},{id:"jwt",label:"JWT"}].map(U=>a.jsx("button",{onClick:()=>le(U.id),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors ${I===U.id?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:U.label},U.id))})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Subject / User ID (optional)"}),a.jsx(Le,{value:ue,onChange:U=>xe(U.target.value),placeholder:"User identifier or email",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Audience (optional)"}),a.jsx(Le,{value:Te,onChange:U=>We(U.target.value),placeholder:"Audience / app id",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Expires In (minutes)"}),a.jsx(Le,{type:"number",value:G,onChange:U=>ae(U.target.value),min:"1",max:"1440",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),I==="jwt"&&a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Override Secret (optional)"}),a.jsx(Le,{value:ye,onChange:U=>de(U.target.value),placeholder:"Defaults to Better Auth secret",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]})]}),I==="jwt"&&a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Custom Claims (JSON)"}),a.jsx("textarea",{value:Se,onChange:U=>W(U.target.value),placeholder:'{"role":"admin"}',className:"w-full min-h-[120px] bg-black border border-dashed border-white/20 text-white font-mono text-xs p-3 rounded-none focus:outline-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Leave empty to include only default claims (iss, sub, aud, exp, iat, jti)."})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{me(null),xe(""),We(""),W(`{
703
-
704
- }`)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Reset"}),a.jsx(H,{onClick:we,disabled:Ve,className:"rounded-none",children:Ve?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Token"})]}),F&&a.jsxs("div",{className:"space-y-4 border border-dashed border-white/15 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs uppercase font-mono text-gray-400",children:"Generated Token"}),a.jsx("p",{className:"text-white font-mono text-sm break-all mt-1",children:F.token})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Vn(F.token),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_a,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"Type"}),a.jsx("p",{className:"text-white mt-1 capitalize",children:F.type.replace("_"," ")})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"Expires"}),a.jsx("p",{className:"text-white mt-1",children:Rd(F.expiresAt)})]}),F.url&&a.jsxs("div",{className:"col-span-1",children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"URL"}),a.jsx("p",{className:"text-white mt-1 break-all",children:F.url})]})]}),F.metadata&&a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsx("p",{className:"text-xs uppercase font-mono text-gray-400 mb-2",children:"Metadata"}),a.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto",children:JSON.stringify(F.metadata,null,2)})]})]})]})]})}),L&&O&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 overflow-hidden",onClick:U=>{U.target===U.currentTarget&&(q(!1),B(null))},children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",onClick:U=>U.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Ih,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Configuration Validator"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{q(!1),B(null)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"mb-6 p-4 border border-dashed border-white/10",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Summary"}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:O.summary.total}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Total Checks"})]}),a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:O.summary.passes}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Passed"})]}),a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:O.summary.errors}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Errors"})]}),a.jsxs("div",{className:"text-left",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:O.summary.warnings}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Warnings"})]})]})]}),a.jsx("div",{className:"space-y-4",children:Object.entries(O.results.reduce((U,Q)=>(U[Q.category]||(U[Q.category]=[]),U[Q.category].push(Q),U),{})).map(([U,Q])=>{if(U==="OAuth Providers"){const ie=Q.reduce((ve,ze)=>{const Ge=ze.check.match(/^(.+?)\s*-\s*(.+)$/);if(Ge){const Et=Ge[1],vn=Ge[2];ve[Et]||(ve[Et]=[]),ve[Et].push({...ze,check:vn})}else ve.General||(ve.General=[]),ve.General.push(ze);return ve},{});return a.jsxs("div",{className:"border border-dashed border-white/10 p-4",children:[a.jsxs("h4",{className:"text-white font-mono uppercase text-xs mb-4 text-left",children:[U,a.jsxs("span",{className:"text-gray-500 font-normal ml-2",children:["(",Q.length," check",Q.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"space-y-2",children:Object.entries(ie).map(([ve,ze])=>{const Ge=X.has(ve),Et=ze.some(ct=>ct.severity==="error"),vn=ze.some(ct=>ct.severity==="warning"),rr=ze.every(ct=>ct.status==="pass");return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>{Z(ct=>{const Mt=new Set(ct);return Mt.has(ve)?Mt.delete(ve):Mt.add(ve),Mt})},className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(_w,{className:`w-4 h-4 text-white/60 transition-transform ${Ge?"rotate-90":""}`}),a.jsx("span",{className:"text-white font-mono text-sm",children:ve}),a.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["(",ze.length," check",ze.length!==1?"s":"",")"]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[Et&&a.jsx("span",{className:"text-xs text-white/60 font-mono",children:"Error"}),vn&&!Et&&a.jsx("span",{className:"text-xs text-white/60 font-mono",children:"Warning"}),rr&&!Et&&!vn&&a.jsx(pu,{className:"w-4 h-4 text-white/60"})]})]}),Ge&&a.jsx("div",{className:"border-t border-dashed border-white/10 space-y-2 p-2",children:ze.map((ct,Mt)=>a.jsx("div",{className:`p-3 border-l border-dashed border-white/15 ${ct.status==="pass"?"bg-green-600/[8%]":"bg-red-600/[8%]"}`,children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"mt-0.5",children:ct.severity==="error"?a.jsx(za,{className:"w-4 h-4 text-white/60"}):ct.severity==="warning"?a.jsx(Ty,{className:"w-4 h-4 text-white/60"}):ct.status==="pass"?a.jsx(pu,{className:"w-4 h-4 text-white/60"}):a.jsx(Mo,{className:"w-4 h-4 text-white/40"})}),a.jsxs("div",{className:"flex-1 text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[a.jsx("span",{className:"text-white font-mono text-sm",children:ct.check}),a.jsx("span",{className:"text-xs px-2 py-0.5 border border-dashed border-white/20 text-white/60 font-mono",children:ct.status.toUpperCase()})]}),a.jsx("p",{className:"text-gray-300 text-sm",children:ct.message}),ct.suggestion&&a.jsxs("div",{className:"mt-2 p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase mb-1 font-mono",children:"Suggestion"}),a.jsx("p",{className:"text-xs text-gray-300",children:ct.suggestion})]})]})]})},`${ve}-${ct.check}-${Mt}`))})]},ve)})})]},U)}return a.jsxs("div",{className:"border border-dashed border-white/10 p-4",children:[a.jsxs("h4",{className:"text-white font-mono uppercase text-xs mb-4 text-left",children:[U,a.jsxs("span",{className:"text-gray-500 font-normal ml-2",children:["(",Q.length," check",Q.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"space-y-3",children:Q.map((ie,ve)=>a.jsx("div",{className:`p-3 border-l border-dashed border-white/15 ${ie.status==="pass"?"bg-green-600/[8%]":"bg-red-600/[8%]"}`,children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"mt-0.5",children:ie.severity==="error"?a.jsx(za,{className:"w-4 h-4 text-white/60"}):ie.severity==="warning"?a.jsx(Ty,{className:"w-4 h-4 text-white/60"}):ie.status==="pass"?a.jsx(pu,{className:"w-4 h-4 text-white/60"}):a.jsx(Mo,{className:"w-4 h-4 text-white/40"})}),a.jsxs("div",{className:"flex-1 text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[a.jsx("span",{className:"text-white font-mono text-sm",children:ie.check}),a.jsx("span",{className:"text-xs px-2 py-0.5 border border-dashed border-white/20 text-white/60 font-mono",children:ie.status.toUpperCase()})]}),a.jsx("p",{className:"text-gray-300 text-sm",children:ie.message}),ie.suggestion&&a.jsxs("div",{className:"mt-2 p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase mb-1 font-mono",children:"Suggestion"}),a.jsx("p",{className:"text-xs text-gray-300",children:ie.suggestion})]})]})]})},`${ie.category}-${ie.check}-${ve}`))})]},U)})}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsx(H,{variant:"outline",onClick:()=>{q(!1),B(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),nt&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",onClick:U=>{U.target===U.currentTarget&&Ke(!1)},children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",onClick:U=>U.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Oy,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"UUID Generator"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Ke(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generate UUIDs"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Count (1-100)"}),a.jsx(Le,{type:"number",value:Gt,onChange:U=>{const Q=U.target.value;if(Q===""){cn("");return}const ie=parseInt(Q);isNaN(ie)||cn(Q)},onBlur:U=>{const Q=U.target.value,ie=parseInt(Q);isNaN(ie)||ie<1?cn("1"):ie>100?cn("100"):cn(String(ie))},min:"1",max:"100",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{cn("1"),Ft([])},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:Qi,className:"rounded-none",children:"Generate UUIDs"})]})]})]}),a.jsxs("div",{children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Validate UUID"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsx("div",{children:a.jsx(Le,{value:Na,onChange:U=>{mn(U.target.value)},onBlur:Dl,placeholder:"Paste UUID to validate",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"})}),a.jsx("div",{className:"flex items-end justify-end space-x-2",children:a.jsx(H,{variant:"outline",onClick:()=>{mn(""),Ds(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"})})]}),Cn&&a.jsx("div",{className:`mt-2 border border-dashed p-3 rounded-none ${Cn.isValid?"border-white/10 bg-black/40":"border-red-500/30 bg-red-500/10"}`,children:a.jsxs("div",{className:"text-xs font-mono space-y-1",children:[a.jsx("div",{className:`${Cn.isValid?"text-green-400":"text-red-300"}`,children:Cn.isValid?"✓ Valid UUID":"✗ Invalid UUID"}),Cn.isValid&&Cn.version&&a.jsxs("div",{className:"text-gray-400",children:["Version: ",Cn.version]}),Cn.isValid&&Cn.variant&&a.jsxs("div",{className:"text-gray-400",children:["Variant: ",Cn.variant]})]})})]}),en.length>0&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Me,{className:"text-xs uppercase font-mono text-gray-400",children:"Generated UUIDs"}),a.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>Vn(en.join(`
705
- `)),className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(_a,{className:"w-4 h-4 mr-1"}),"Copy All"]})]}),a.jsx("div",{className:"border border-dashed border-white/10 p-3",children:a.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:en.map((U,Q)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs break-all",children:U}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Vn(U),className:"text-gray-400 hover:text-white rounded-none ml-2",children:a.jsx(_a,{className:"w-3 h-3"})})]},Q))})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Version"}),a.jsx("p",{className:"text-white text-sm",children:"v4 (Random)"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Cryptographically random"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm",children:"8-4-4-4-12"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"36 characters"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Standard"}),a.jsx("p",{className:"text-white text-sm",children:"RFC 4122"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Universally unique"})]})]})]})]})})]})}function NV(){const{userId:e}=Zg(),t=Gs(),[n,s]=m.useState(null),[r,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState([]),[f,x]=m.useState(!0),[y,b]=m.useState("details"),[w,g]=m.useState(!1),[v,p]=m.useState(!1),[j,N]=m.useState(!1),[C,S]=m.useState(!1),[M,A]=m.useState(!1),[V,$]=m.useState("random"),[z,Y]=m.useState(!1),[E,R]=m.useState(!1),[T,_]=m.useState(!1),[k,D]=m.useState(""),[L,q]=m.useState(),[O,B]=m.useState(!1),[X,Z]=m.useState(""),[ne,ee]=m.useState([]),[J,se]=m.useState(!1),[pe,re]=m.useState({}),he=m.useRef({}),fe=m.useCallback(async()=>{try{const le=await(await fetch("/api/admin/status")).json();B(le.enabled)}catch{B(!1)}},[]),ke=m.useCallback(async I=>{try{const le=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:I})});if(le.ok){const ue=await le.json();if(ue.success&&ue.location)return ue.location}return null}catch{return null}},[]),Oe=m.useCallback(async I=>{const le=I.filter(Te=>!he.current[Te.id]);if(le.length===0)return;const ue=await Promise.all(le.map(async Te=>{const We=await ke(Te.ipAddress);return We?{sessionId:Te.id,location:We}:null})),xe={};ue.forEach(Te=>{Te&&(xe[Te.sessionId]=Te.location)}),Object.keys(xe).length>0&&(he.current={...he.current,...xe},re(he.current))},[ke]),Re=I=>{if(!I)return"🌍";const le=I.toUpperCase().split("").map(ue=>127397+ue.charCodeAt(0));return String.fromCodePoint(...le)},Be=I=>I?I.replace(/[_-]/g," ").replace(/\b\w/g,le=>le.toUpperCase()):"Unknown Provider",dt=I=>{if(!I)return"Unknown";const le=new Date(I);return Number.isNaN(le.getTime())?"Unknown":le.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},Ie=m.useCallback(async()=>{try{const I=await fetch(`/api/users/${e}`);if(I.ok){const le=await I.json();s(le.user)}else P.error("Failed to fetch user details"),t("/users")}catch{P.error("Failed to fetch user details"),t("/users")}finally{x(!1)}},[e,t]),St=m.useCallback(async()=>{try{const[I,le,ue]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(I.ok){const xe=await I.json();i(xe.memberships||[])}if(le.ok){const xe=await le.json();l(xe.memberships||[])}if(ue.ok){const Te=(await ue.json()).sessions||[];u(Te),Oe(Te)}}catch{}},[e,Oe]),bt=m.useCallback(async()=>{try{const I=await fetch(`/api/users/${e}/accounts`);if(I.ok){const le=await I.json();d(le.accounts||[])}}catch{}},[e]),qe=async()=>{var xe,Te;if(!n)return;const I=(xe=document.getElementById("edit-name"))==null?void 0:xe.value,le=(Te=document.getElementById("edit-email"))==null?void 0:Te.value;if(!I||!le){P.error("Please fill in all fields");return}const ue=P.loading("Updating user...");try{const G=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:I,email:le,role:X||null})})).json();G.success?(s({...n,name:I,email:le,role:X||void 0}),g(!1),Z(""),P.success("User updated successfully!",{id:ue})):P.error(`Error updating user: ${G.error||"Unknown error"}`,{id:ue})}catch{P.error("Error updating user",{id:ue})}},et=async()=>{if(!n)return;const I=P.loading("Deleting user...");try{const ue=await(await fetch(`/api/users/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ue.success?(P.success("User deleted successfully!",{id:I}),t("/users")):P.error(`Error deleting user: ${ue.error||"Unknown error"}`,{id:I})}catch{P.error("Error deleting user",{id:I})}},Qe=async()=>{if(!n)return;if(!O){P.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const I=P.loading("Banning user...");try{const le=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:k||"No reason provided",banExpiresIn:L})}),ue=await le.json();le.ok?(P.success("User banned successfully!",{id:I}),p(!1),D(""),q(void 0),Ie()):le.status===403?P.error("You do not have permission to ban users. Admin role required.",{id:I}):ue.adminPluginEnabled&&ue.instructions?P.error(`${ue.error}`,{id:I,duration:6e3,description:`Use: ${ue.instructions.example}`}):P.error(`Error banning user: ${ue.error||ue.message||"Unknown error"}`,{id:I})}catch{P.error("Error banning user",{id:I})}},vt=async()=>{if(!n)return;if(!O){P.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const I=P.loading("Unbanning user...");try{const le=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),ue=await le.json();le.ok?(P.success("User unbanned successfully!",{id:I}),N(!1),Ie()):le.status===403?P.error("You do not have permission to unban users. Admin role required.",{id:I}):ue.adminPluginEnabled&&ue.instructions?P.error(`${ue.error}`,{id:I,duration:6e3,description:`Use: ${ue.instructions.example}`}):P.error(`Error unbanning user: ${ue.error||ue.message||"Unknown error"}`,{id:I})}catch{P.error("Error unbanning user",{id:I})}},yt=async I=>{const le=P.loading("Removing user from organization...");try{const xe=await(await fetch(`/api/organizations/members/${I}`,{method:"DELETE"})).json();xe.success?(i(Te=>Te.filter(We=>We.id!==I)),St(),P.success("User removed from organization!",{id:le})):P.error(`Error removing user: ${xe.error||"Unknown error"}`,{id:le})}catch{P.error("Error removing user from organization",{id:le})}},Ht=async I=>{const le=P.loading("Removing user from team...");try{const xe=await(await fetch(`/api/teams/members/${I}`,{method:"DELETE"})).json();xe.success?(l(Te=>Te.filter(We=>We.id!==I)),St(),P.success("User removed from team!",{id:le})):P.error(`Error removing user: ${xe.error||"Unknown error"}`,{id:le})}catch{P.error("Error removing user from team",{id:le})}},It=async I=>{const le=P.loading("Deleting session...");try{const xe=await(await fetch(`/api/sessions/${I}`,{method:"DELETE"})).json();xe.success?(u(Te=>Te.filter(We=>We.id!==I)),P.success("Session deleted successfully!",{id:le})):P.error(`Error deleting session: ${xe.error||"Unknown error"}`,{id:le})}catch{P.error("Error deleting session",{id:le})}},te=async I=>{if(!e)return;const le=P.loading("Unlinking account...");try{const ue=await fetch(`/api/users/${e}/accounts/${I}`,{method:"DELETE"}),xe=await ue.json();ue.ok&&xe.success?(d(Te=>Te.filter(We=>We.id!==I)),await bt(),P.success("Account unlinked successfully",{id:le})):P.error(xe.error||"Failed to unlink account",{id:le})}catch{P.error("Failed to unlink account",{id:le})}};m.useEffect(()=>{e&&(Ie(),St(),bt(),fe())},[e,fe,Ie,St,bt]);const be=async(I=3)=>{if(e){ee([]),se(!0),ee([{id:"start",type:"info",message:`Starting session seeding process for ${I} sessions...`,timestamp:new Date}]);try{const ue=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:I})})).json();if(ue.success){const xe=ue.results.map((We,G)=>We.success?{id:`session-${G}`,type:"progress",message:`Creating session ${G+1}: ${We.session.token.substring(0,20)}... from ${We.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${G}`,type:"error",message:`Failed to create session ${G+1}: ${We.error}`,timestamp:new Date});ee(We=>[...We,...xe]);const Te=ue.results.filter(We=>We.success).length;ee(We=>[...We,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${Te}/${I} sessions successfully`,timestamp:new Date}]),St()}else ee(xe=>[...xe,{id:"error",type:"error",message:`❌ Session seeding failed: ${ue.error||"Unknown error"}`,timestamp:new Date}])}catch(le){ee(ue=>[...ue,{id:"error",type:"error",message:`❌ Network error: ${le}`,timestamp:new Date}])}finally{se(!1)}}},He=async(I=3,le="random")=>{if(e){ee([]),se(!0),ee([{id:"start",type:"info",message:`Starting account seeding process for ${I} accounts...`,timestamp:new Date}]);try{const xe=await(await fetch(`/api/users/${e}/seed-accounts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:I,providerId:le})})).json();if(xe.success){const Te=xe.results.map((G,ae)=>{var ye;return G.success?{id:`account-${ae}`,type:"progress",message:`Creating account ${ae+1}: ${G.account.providerId||G.account.provider} (${((ye=G.account.accountId)==null?void 0:ye.substring(0,20))||G.account.id.substring(0,20)}...)`,timestamp:new Date,status:"completed"}:{id:`account-${ae}`,type:"error",message:`Failed to create account ${ae+1}: ${G.error}`,timestamp:new Date}});ee(G=>[...G,...Te]);const We=xe.results.filter(G=>G.success).length;ee(G=>[...G,{id:"complete",type:"success",message:`✅ Account seeding completed! Created ${We}/${I} accounts successfully`,timestamp:new Date}]),bt()}else ee(Te=>[...Te,{id:"error",type:"error",message:`❌ Account seeding failed: ${xe.error||"Unknown error"}`,timestamp:new Date}])}catch(ue){ee(xe=>[...xe,{id:"error",type:"error",message:`❌ Network error: ${ue}`,timestamp:new Date}])}finally{se(!1)}}};return f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Kl,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(Ln,{id:n.id,variant:"subscript"}),n.role&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:n.role}),n.banned&&a.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none",children:"Banned"})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs("div",{className:"relative",children:[a.jsx(H,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:I=>{I.stopPropagation(),_(!T)},children:a.jsx(F4,{className:"w-4 h-4"})}),T&&a.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:I=>I.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:I=>{I.stopPropagation(),_(!1),g(!0),Z(n.role||"")},children:[a.jsx(zi,{className:"w-4 h-4"}),a.jsx("span",{children:"Edit User"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:I=>{I.stopPropagation(),_(!1),Y(!0)},children:[a.jsx(yn,{className:"w-4 h-4"}),a.jsx("span",{children:"Update Password"})]}),O&&(n.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:I=>{I.stopPropagation(),_(!1),N(!0)},children:[a.jsx(hx,{className:"w-4 h-4"}),a.jsx("span",{children:"Unban User"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:I=>{I.stopPropagation(),_(!1),p(!0)},children:[a.jsx(hx,{className:"w-4 h-4"}),a.jsx("span",{children:"Ban User"})]})),a.jsx("div",{className:"border-t border-white/10 my-1"}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:I=>{I.stopPropagation(),_(!1),R(!0)},children:[a.jsx(_f,{className:"w-4 h-4"}),a.jsx("span",{children:"Delete User"})]})]})]})})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/10",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Kl},{id:"organizations",name:"Organizations",icon:Jn,count:r.length},{id:"teams",name:"Teams",icon:jt,count:o.length},{id:"accounts",name:"Accounts",icon:mi,count:h.length},{id:"sessions",name:"Sessions",icon:D0,count:c.length}].map(I=>a.jsxs("button",{onClick:()=>b(I.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${y===I.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(I.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"",children:I.name}),I.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(Bs,{value:I.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},I.id))})}),a.jsxs("div",{className:"p-6",children:[y==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Kl,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Name"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Aa,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(BB,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(HB,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(zs,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Aa,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ya,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.jsx("div",{className:`px-2 rounded-none py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),y==="organizations"&&a.jsx("div",{className:"space-y-4",children:r.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Jn,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):a.jsx("div",{className:"grid gap-4",children:r.map(I=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:I.organization.image?a.jsx("img",{src:I.organization.image,alt:I.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(Jn,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[I.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:I.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",I.organization.slug]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(I.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(I.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>yt(I.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ux,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},I.id))})}),y==="teams"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(jt,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),a.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):a.jsx("div",{className:"grid gap-4",children:o.map(I=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(jt,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[I.team.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:I.team.organizationSlug||I.team.organizationName}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",I.team.organizationSlug||I.team.organizationName]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(I.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(I.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>Ht(I.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ux,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},I.id))})}),y==="accounts"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium text-white",children:"Linked Accounts"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user OAuth account connections"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{ee([]),se(!1),A(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(mi,{className:"w-4 h-4 mr-2"}),"Seed Accounts"]})]}),h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(mi,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Linked Accounts"}),a.jsx("p",{className:"text-gray-400",children:"This user has not connected any accounts yet."})]}):a.jsx("div",{className:"grid gap-4",children:h.map(I=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:g5(I.providerId)}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[Be(I.providerId),a.jsx(Ln,{id:I.accountId,variant:"subscript",nonSliced:!!(I.email||n.email)})]}),a.jsx("p",{className:"text-gray-400 tracking-tight uppercase text-xs font-mono mt-1",children:`ID: ${I.id}`})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[a.jsx("span",{children:"Linked:"}),a.jsx("span",{className:"text-white",children:dt(I.createdAt||I.updatedAt)})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>te(I.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ux,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},I.id))})]}),y==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{ee([]),se(!1),S(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Ya,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(D0,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),a.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):a.jsx("div",{className:"grid gap-4",children:c.map(I=>{var le,ue,xe,Te;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(Dw,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",I.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:I.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(PB,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((le=pe[I.id])==null?void 0:le.city)||"...",","," ",((ue=pe[I.id])==null?void 0:ue.country)||"..."]}),((xe=pe[I.id])==null?void 0:xe.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:Re((Te=pe[I.id])==null?void 0:Te.countryCode)})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(I.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(I.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>It(I.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(hx,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},I.id)})})]})]})]})]}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{g(!1),Z("")},className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n!=null&&n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Kl,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),a.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),a.jsx("input",{id:"edit-name",type:"text",defaultValue:(n==null?void 0:n.name)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),a.jsx("input",{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Role"}),a.jsxs(ws,{className:"bg-black text-white",value:X,onValueChange:Z,children:[a.jsx(js,{className:"w-full border border-dashed border-white/20 bg-black text-white rounded-none",children:a.jsx(Br,{placeholder:"Select role"})}),a.jsxs(Ns,{children:[a.jsx(Fe,{value:"",children:"None"}),a.jsx(Fe,{value:"admin",children:"Admin"}),a.jsx(Fe,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{g(!1),Z("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:qe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),v&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),a.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",a.jsx("strong",{children:n.name})," from accessing the system."]}),a.jsxs("div",{className:"space-y-4 mb-6",children:[a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),a.jsx(Le,{id:"banReason",value:k,onChange:I=>D(I.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),a.jsx(Le,{id:"banExpires",type:"number",value:L||"",onChange:I=>q(I.target.value?Number(I.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{p(!1),D(""),q(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:Qe,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),j&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),a.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",a.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:vt,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),E&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>R(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n.image?a.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):a.jsx(Kl,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:n.name}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>R(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:et,className:"bg-red-500 hover:bg-red-600 text-white border border-red-500 rounded-none",children:"Delete"})]})]})}),z&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Y(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"new-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),a.jsx(Le,{id:"new-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>Y(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),a.jsx(H,{onClick:async()=>{var ue;const I=(ue=document.getElementById("new-password"))==null?void 0:ue.value;if(!I){P.error("Please enter a password");return}const le=P.loading("Updating password...");try{const Te=await(await fetch(`/api/users/${e}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:I})})).json();Te.success?(Y(!1),document.getElementById("new-password").value="",P.success("Password updated successfully!",{id:le})):P.error(`Error updating password: ${Te.error||"Unknown error"}`,{id:le})}catch{P.error("Error updating password",{id:le})}},className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),C&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 overflow-hidden",children:a.jsxs("div",{className:"overflow-x-hidden overflow-y-auto bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none max-h-[90vh]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(Dw,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Me,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),a.jsx(Le,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx(H,{onClick:()=>{var le;const I=parseInt(((le=document.getElementById("session-count"))==null?void 0:le.value)||"3",10);be(I)},disabled:J,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:J?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ya,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),ne.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Zr,{title:"Session Seeding Terminal",lines:ne,isRunning:J,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(H,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),M&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 overflow-hidden",children:a.jsxs("div",{className:"overflow-x-hidden overflow-y-auto bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none max-h-[90vh]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[a.jsx("span",{className:"text-white/50 mr-2",children:"["}),a.jsx(mi,{className:"inline mr-2 w-3 h-3 text-white"}),a.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Accounts"}),a.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>A(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(_t,{className:"w-4 h-4"})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),a.jsx(Le,{id:"account-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(Me,{htmlFor:"account-provider",className:"text-sm text-gray-400 font-light",children:"Provider"}),a.jsxs(ws,{value:V,onValueChange:$,children:[a.jsx(js,{className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Br,{placeholder:"Select provider"})}),a.jsxs(Ns,{className:"bg-black border border-dashed border-white/20",children:[a.jsx(Fe,{value:"random",children:"Mix (Random)"}),a.jsx(Fe,{value:"github",children:"GitHub"}),a.jsx(Fe,{value:"google",children:"Google"}),a.jsx(Fe,{value:"discord",children:"Discord"}),a.jsx(Fe,{value:"facebook",children:"Facebook"}),a.jsx(Fe,{value:"twitter",children:"Twitter"}),a.jsx(Fe,{value:"linkedin",children:"LinkedIn"}),a.jsx(Fe,{value:"apple",children:"Apple"}),a.jsx(Fe,{value:"microsoft",children:"Microsoft"}),a.jsx(Fe,{value:"gitlab",children:"GitLab"}),a.jsx(Fe,{value:"bitbucket",children:"Bitbucket"}),a.jsx(Fe,{value:"spotify",children:"Spotify"}),a.jsx(Fe,{value:"twitch",children:"Twitch"}),a.jsx(Fe,{value:"reddit",children:"Reddit"}),a.jsx(Fe,{value:"slack",children:"Slack"}),a.jsx(Fe,{value:"notion",children:"Notion"}),a.jsx(Fe,{value:"tiktok",children:"TikTok"}),a.jsx(Fe,{value:"zoom",children:"Zoom"})]})]})]})]}),a.jsx(H,{onClick:()=>{var le;const I=parseInt(((le=document.getElementById("account-count"))==null?void 0:le.value)||"3",10);He(I,V)},disabled:J,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:J?a.jsxs(a.Fragment,{children:[a.jsx(ks,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(mi,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]}),ne.length>0&&a.jsx("div",{className:"mt-6",children:a.jsx(Zr,{title:"Account Seeding Terminal",lines:ne,isRunning:J,className:"w-full",defaultCollapsed:!0})})]}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),a.jsx("div",{className:"flex justify-end mt-6 pt-6",children:a.jsx(H,{variant:"outline",onClick:()=>A(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function SV(){return a.jsx(NR,{children:a.jsxs(xE,{children:[a.jsx(x$,{children:a.jsxs(oE,{children:[a.jsx(An,{path:"/",element:a.jsx(cV,{})}),a.jsx(An,{path:"/users",element:a.jsx(x5,{})}),a.jsx(An,{path:"/users/:userId",element:a.jsx(NV,{})}),a.jsx(An,{path:"/organizations",element:a.jsx(m5,{})}),a.jsx(An,{path:"/organizations/:orgId",element:a.jsx(mV,{})}),a.jsx(An,{path:"/teams",element:a.jsx(pV,{})}),a.jsx(An,{path:"/teams/:teamId",element:a.jsx(Vw,{})}),a.jsx(An,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(Vw,{})}),a.jsx(An,{path:"/sessions",element:a.jsx(xV,{})}),a.jsx(An,{path:"/database",element:a.jsx(hV,{})}),a.jsx(An,{path:"/database/demo",element:a.jsx(jR,{})}),a.jsx(An,{path:"/tools",element:a.jsx(jV,{})}),a.jsx(An,{path:"/settings",element:a.jsx(gV,{})})]})}),a.jsx(WE,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})})}xk.createRoot(document.getElementById("root")).render(a.jsx(K.StrictMode,{children:a.jsx(SV,{})}));