better-auth-studio 1.0.30 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,669 @@
1
+ function lk(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function Gm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sw={exports:{}},su={},Cw={exports:{}},Re={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Cl=Symbol.for("react.element"),ck=Symbol.for("react.portal"),dk=Symbol.for("react.fragment"),uk=Symbol.for("react.strict_mode"),hk=Symbol.for("react.profiler"),fk=Symbol.for("react.provider"),mk=Symbol.for("react.context"),pk=Symbol.for("react.forward_ref"),xk=Symbol.for("react.suspense"),gk=Symbol.for("react.memo"),vk=Symbol.for("react.lazy"),Hx=Symbol.iterator;function wk(e){return e===null||typeof e!="object"?null:(e=Hx&&e[Hx]||e["@@iterator"],typeof e=="function"?e:null)}var Ew={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mw=Object.assign,_w={};function Vi(e,t,n){this.props=e,this.context=t,this.refs=_w,this.updater=n||Ew}Vi.prototype.isReactComponent={};Vi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Vi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dw(){}Dw.prototype=Vi.prototype;function Km(e,t,n){this.props=e,this.context=t,this.refs=_w,this.updater=n||Ew}var Qm=Km.prototype=new Dw;Qm.constructor=Km;Mw(Qm,Vi.prototype);Qm.isPureReactComponent=!0;var Vx=Array.isArray,Tw=Object.prototype.hasOwnProperty,Zm={current:null},Pw={key:!0,ref:!0,__self:!0,__source:!0};function Aw(e,t,n){var r,a={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Tw.call(t,r)&&!Pw.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:Cl,type:e,key:i,ref:o,props:a,_owner:Zm.current}}function yk(e,t){return{$$typeof:Cl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Jm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cl}function bk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Yx=/\/+/g;function dh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?bk(""+e.key):t.toString(36)}function Lc(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Cl:case ck:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+dh(o,0):r,Vx(a)?(n="",e!=null&&(n=e.replace(Yx,"$&/")+"/"),Lc(a,t,n,"",function(d){return d})):a!=null&&(Jm(a)&&(a=yk(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Yx,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",Vx(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+dh(i,l);o+=Lc(i,t,n,c,a)}else if(c=wk(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+dh(i,l++),o+=Lc(i,t,n,c,a);else if(i==="object")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 Jl(e,t,n){if(e==null)return e;var r=[],a=0;return Lc(e,r,"","",function(i){return t.call(n,i,a++)}),r}function Nk(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 Zt={current:null},Fc={transition:null},jk={ReactCurrentDispatcher:Zt,ReactCurrentBatchConfig:Fc,ReactCurrentOwner:Zm};function Ow(){throw Error("act(...) is not supported in production builds of React.")}Re.Children={map:Jl,forEach:function(e,t,n){Jl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Jl(e,function(){t++}),t},toArray:function(e){return Jl(e,function(t){return t})||[]},only:function(e){if(!Jm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Component=Vi;Re.Fragment=dk;Re.Profiler=hk;Re.PureComponent=Km;Re.StrictMode=uk;Re.Suspense=xk;Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jk;Re.act=Ow;Re.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Mw({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Zm.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Tw.call(t,c)&&!Pw.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:Cl,type:e.type,key:a,ref:i,props:r,_owner:o}};Re.createContext=function(e){return e={$$typeof:mk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:fk,_context:e},e.Consumer=e};Re.createElement=Aw;Re.createFactory=function(e){var t=Aw.bind(null,e);return t.type=e,t};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:pk,render:e}};Re.isValidElement=Jm;Re.lazy=function(e){return{$$typeof:vk,_payload:{_status:-1,_result:e},_init:Nk}};Re.memo=function(e,t){return{$$typeof:gk,type:e,compare:t===void 0?null:t}};Re.startTransition=function(e){var t=Fc.transition;Fc.transition={};try{e()}finally{Fc.transition=t}};Re.unstable_act=Ow;Re.useCallback=function(e,t){return Zt.current.useCallback(e,t)};Re.useContext=function(e){return Zt.current.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e){return Zt.current.useDeferredValue(e)};Re.useEffect=function(e,t){return Zt.current.useEffect(e,t)};Re.useId=function(){return Zt.current.useId()};Re.useImperativeHandle=function(e,t,n){return Zt.current.useImperativeHandle(e,t,n)};Re.useInsertionEffect=function(e,t){return Zt.current.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return Zt.current.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return Zt.current.useMemo(e,t)};Re.useReducer=function(e,t,n){return Zt.current.useReducer(e,t,n)};Re.useRef=function(e){return Zt.current.useRef(e)};Re.useState=function(e){return Zt.current.useState(e)};Re.useSyncExternalStore=function(e,t,n){return Zt.current.useSyncExternalStore(e,t,n)};Re.useTransition=function(){return Zt.current.useTransition()};Re.version="18.3.1";Cw.exports=Re;var m=Cw.exports;const Q=Gm(m),ep=lk({__proto__:null,default:Q},[m]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var kk=m,Sk=Symbol.for("react.element"),Ck=Symbol.for("react.fragment"),Ek=Object.prototype.hasOwnProperty,Mk=kk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_k={key:!0,ref:!0,__self:!0,__source:!0};function zw(e,t,n){var r,a={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Ek.call(t,r)&&!_k.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:Sk,type:e,key:i,ref:o,props:a,_owner:Mk.current}}su.Fragment=Ck;su.jsx=zw;su.jsxs=zw;Sw.exports=su;var s=Sw.exports,yf={},$w={exports:{}},kn={},Rw={exports:{}},Iw={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(C,_){var z=C.length;C.push(_);e:for(;0<z;){var H=z-1>>>1,P=C[H];if(0<a(P,_))C[H]=_,C[z]=P,z=H;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var _=C[0],z=C.pop();if(z!==_){C[0]=z;e:for(var H=0,P=C.length,B=P>>>1;H<B;){var q=2*(H+1)-1,G=C[q],se=q+1,re=C[se];if(0>a(G,z))se<P&&0>a(re,G)?(C[H]=re,C[se]=z,H=se):(C[H]=G,C[q]=z,H=q);else if(se<P&&0>a(re,z))C[H]=re,C[se]=z,H=se;else break e}}return _}function a(C,_){var z=C.sortIndex-_.sortIndex;return z!==0?z:C.id-_.id}if(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=[],d=[],h=1,u=null,f=3,p=!1,w=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var _=n(d);_!==null;){if(_.callback===null)r(d);else if(_.startTime<=C)r(d),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(d)}}function N(C){if(v=!1,x(C),!w)if(n(c)!==null)w=!0,D(j);else{var _=n(d);_!==null&&T(N,_.startTime-C)}}function j(C,_){w=!1,v&&(v=!1,g(M),M=-1),p=!0;var z=f;try{for(x(_),u=n(c);u!==null&&(!(u.expirationTime>_)||C&&!U());){var H=u.callback;if(typeof H=="function"){u.callback=null,f=u.priorityLevel;var P=H(u.expirationTime<=_);_=e.unstable_now(),typeof P=="function"?u.callback=P:u===n(c)&&r(c),x(_)}else r(c);u=n(c)}if(u!==null)var B=!0;else{var q=n(d);q!==null&&T(N,q.startTime-_),B=!1}return B}finally{u=null,f=z,p=!1}}var k=!1,S=null,M=-1,A=5,I=-1;function U(){return!(e.unstable_now()-I<A)}function $(){if(S!==null){var C=e.unstable_now();I=C;var _=!0;try{_=S(!0,C)}finally{_?L():(k=!1,S=null)}}else k=!1}var L;if(typeof y=="function")L=function(){y($)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,O=E.port2;E.port1.onmessage=$,L=function(){O.postMessage(null)}}else L=function(){b($,0)};function D(C){S=C,k||(k=!0,L())}function T(C,_){M=b(function(){C(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(C){C.callback=null},e.unstable_continueExecution=function(){w||p||(w=!0,D(j))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var z=f;f=_;try{return C()}finally{f=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,_){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var z=f;f=C;try{return _()}finally{f=z}},e.unstable_scheduleCallback=function(C,_,z){var H=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?H+z:H):z=H,C){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=z+P,C={id:h++,callback:_,priorityLevel:C,startTime:z,expirationTime:P,sortIndex:-1},z>H?(C.sortIndex=z,t(d,C),n(c)===null&&C===n(d)&&(v?(g(M),M=-1):v=!0,T(N,z-H))):(C.sortIndex=P,t(c,C),w||p||(w=!0,D(j))),C},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(C){var _=f;return function(){var z=f;f=_;try{return C.apply(this,arguments)}finally{f=z}}}})(Iw);Rw.exports=Iw;var Dk=Rw.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Tk=m,bn=Dk;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var Lw=new Set,Yo={};function za(e,t){Si(e,t),Si(e+"Capture",t)}function Si(e,t){for(Yo[e]=t,e=0;e<t.length;e++)Lw.add(t[e])}var qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bf=Object.prototype.hasOwnProperty,Pk=/^[: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]*$/,Xx={},qx={};function Ak(e){return bf.call(qx,e)?!0:bf.call(Xx,e)?!1:Pk.test(e)?qx[e]=!0:(Xx[e]=!0,!1)}function Ok(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function zk(e,t,n,r){if(t===null||typeof t>"u"||Ok(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Jt(e,t,n,r,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Ft={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ft[e]=new Jt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ft[t]=new Jt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ft[e]=new Jt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ft[e]=new Jt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ft[e]=new Jt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ft[e]=new Jt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ft[e]=new Jt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ft[e]=new Jt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ft[e]=new Jt(e,5,!1,e.toLowerCase(),null,!1,!1)});var tp=/[\-:]([a-z])/g;function np(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(tp,np);Ft[t]=new Jt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(tp,np);Ft[t]=new Jt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(tp,np);Ft[t]=new Jt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ft[e]=new Jt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ft.xlinkHref=new Jt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ft[e]=new Jt(e,1,!1,e.toLowerCase(),null,!0,!0)});function rp(e,t,n,r){var a=Ft.hasOwnProperty(t)?Ft[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(zk(t,n,a,r)&&(n=null),r||a===null?Ak(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ts=Tk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ec=Symbol.for("react.element"),Ja=Symbol.for("react.portal"),ei=Symbol.for("react.fragment"),sp=Symbol.for("react.strict_mode"),Nf=Symbol.for("react.profiler"),Fw=Symbol.for("react.provider"),Uw=Symbol.for("react.context"),ap=Symbol.for("react.forward_ref"),jf=Symbol.for("react.suspense"),kf=Symbol.for("react.suspense_list"),ip=Symbol.for("react.memo"),gs=Symbol.for("react.lazy"),Bw=Symbol.for("react.offscreen"),Gx=Symbol.iterator;function io(e){return e===null||typeof e!="object"?null:(e=Gx&&e[Gx]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Object.assign,uh;function Eo(e){if(uh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);uh=t&&t[1]||""}return`
34
+ `+uh+e}var hh=!1;function fh(e,t){if(!e||hh)return"";hh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var a=d.stack.split(`
35
+ `),i=r.stack.split(`
36
+ `),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
37
+ `+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{hh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Eo(e):""}function $k(e){switch(e.tag){case 5:return Eo(e.type);case 16:return Eo("Lazy");case 13:return Eo("Suspense");case 19:return Eo("SuspenseList");case 0:case 2:case 15:return e=fh(e.type,!1),e;case 11:return e=fh(e.type.render,!1),e;case 1:return e=fh(e.type,!0),e;default:return""}}function Sf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ei:return"Fragment";case Ja:return"Portal";case Nf:return"Profiler";case sp:return"StrictMode";case jf:return"Suspense";case kf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Uw:return(e.displayName||"Context")+".Consumer";case Fw:return(e._context.displayName||"Context")+".Provider";case ap:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ip:return t=e.displayName||null,t!==null?t:Sf(e.type)||"Memo";case gs:t=e._payload,e=e._init;try{return Sf(e(t))}catch{}}return null}function Rk(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Sf(t);case 8:return t===sp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Rs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ww(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ik(e){var t=Ww(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tc(e){e._valueTracker||(e._valueTracker=Ik(e))}function Hw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ww(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ld(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}}function Cf(e,t){var n=t.checked;return xt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Kx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Rs(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vw(e,t){t=t.checked,t!=null&&rp(e,"checked",t,!1)}function Ef(e,t){Vw(e,t);var n=Rs(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mf(e,t.type,Rs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Qx(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Mf(e,t,n){(t!=="number"||ld(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mo=Array.isArray;function fi(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Rs(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function _f(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(oe(91));return xt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Zx(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(oe(92));if(Mo(n)){if(1<n.length)throw Error(oe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Rs(n)}}function Yw(e,t){var n=Rs(t.value),r=Rs(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Jx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Xw(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Df(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Xw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var nc,qw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(nc=nc||document.createElement("div"),nc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Oo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Lk=["Webkit","ms","Moz","O"];Object.keys(Oo).forEach(function(e){Lk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oo[t]=Oo[e]})});function Gw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Oo.hasOwnProperty(e)&&Oo[e]?(""+t).trim():t+"px"}function Kw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=Gw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var Fk=xt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Tf(e,t){if(t){if(Fk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function Pf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Af=null;function op(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Of=null,mi=null,pi=null;function eg(e){if(e=_l(e)){if(typeof Of!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=cu(t),Of(e.stateNode,e.type,t))}}function Qw(e){mi?pi?pi.push(e):pi=[e]:mi=e}function Zw(){if(mi){var e=mi,t=pi;if(pi=mi=null,eg(e),t)for(e=0;e<t.length;e++)eg(t[e])}}function Jw(e,t){return e(t)}function ey(){}var mh=!1;function ty(e,t,n){if(mh)return e(t,n);mh=!0;try{return Jw(e,t,n)}finally{mh=!1,(mi!==null||pi!==null)&&(ey(),Zw())}}function qo(e,t){var n=e.stateNode;if(n===null)return null;var r=cu(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(oe(231,t,typeof n));return n}var zf=!1;if(qr)try{var oo={};Object.defineProperty(oo,"passive",{get:function(){zf=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{zf=!1}function Uk(e,t,n,r,a,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(h){this.onError(h)}}var zo=!1,cd=null,dd=!1,$f=null,Bk={onError:function(e){zo=!0,cd=e}};function Wk(e,t,n,r,a,i,o,l,c){zo=!1,cd=null,Uk.apply(Bk,arguments)}function Hk(e,t,n,r,a,i,o,l,c){if(Wk.apply(this,arguments),zo){if(zo){var d=cd;zo=!1,cd=null}else throw Error(oe(198));dd||(dd=!0,$f=d)}}function $a(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 ny(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 tg(e){if($a(e)!==e)throw Error(oe(188))}function Vk(e){var t=e.alternate;if(!t){if(t=$a(e),t===null)throw Error(oe(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return tg(a),e;if(i===r)return tg(a),t;i=i.sibling}throw Error(oe(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o)throw Error(oe(189))}}if(n.alternate!==r)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?e:t}function ry(e){return e=Vk(e),e!==null?sy(e):null}function sy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=sy(e);if(t!==null)return t;e=e.sibling}return null}var ay=bn.unstable_scheduleCallback,ng=bn.unstable_cancelCallback,Yk=bn.unstable_shouldYield,Xk=bn.unstable_requestPaint,yt=bn.unstable_now,qk=bn.unstable_getCurrentPriorityLevel,lp=bn.unstable_ImmediatePriority,iy=bn.unstable_UserBlockingPriority,ud=bn.unstable_NormalPriority,Gk=bn.unstable_LowPriority,oy=bn.unstable_IdlePriority,au=null,Nr=null;function Kk(e){if(Nr&&typeof Nr.onCommitFiberRoot=="function")try{Nr.onCommitFiberRoot(au,e,void 0,(e.current.flags&128)===128)}catch{}}var er=Math.clz32?Math.clz32:Jk,Qk=Math.log,Zk=Math.LN2;function Jk(e){return e>>>=0,e===0?32:31-(Qk(e)/Zk|0)|0}var rc=64,sc=4194304;function _o(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=_o(l):(i&=o,i!==0&&(r=_o(i)))}else o=n&~a,o!==0?r=_o(o):i!==0&&(r=_o(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-er(t),a=1<<n,r|=e[n],t&=~a;return r}function eS(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-er(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=eS(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Rf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ly(){var e=rc;return rc<<=1,!(rc&4194240)&&(rc=64),e}function ph(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function El(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-er(t),e[t]=n}function nS(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-er(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function cp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-er(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var qe=0;function cy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var dy,dp,uy,hy,fy,If=!1,ac=[],Cs=null,Es=null,Ms=null,Go=new Map,Ko=new Map,ys=[],rS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function rg(e,t){switch(e){case"focusin":case"focusout":Cs=null;break;case"dragenter":case"dragleave":Es=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":Go.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ko.delete(t.pointerId)}}function lo(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=_l(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function sS(e,t,n,r,a){switch(t){case"focusin":return Cs=lo(Cs,e,t,n,r,a),!0;case"dragenter":return Es=lo(Es,e,t,n,r,a),!0;case"mouseover":return Ms=lo(Ms,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Go.set(i,lo(Go.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Ko.set(i,lo(Ko.get(i)||null,e,t,n,r,a)),!0}return!1}function my(e){var t=sa(e.target);if(t!==null){var n=$a(t);if(n!==null){if(t=n.tag,t===13){if(t=ny(n),t!==null){e.blockedOn=t,fy(e.priority,function(){uy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Af=r,n.target.dispatchEvent(r),Af=null}else return t=_l(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function sg(e,t,n){Uc(e)&&n.delete(t)}function aS(){If=!1,Cs!==null&&Uc(Cs)&&(Cs=null),Es!==null&&Uc(Es)&&(Es=null),Ms!==null&&Uc(Ms)&&(Ms=null),Go.forEach(sg),Ko.forEach(sg)}function co(e,t){e.blockedOn===t&&(e.blockedOn=null,If||(If=!0,bn.unstable_scheduleCallback(bn.unstable_NormalPriority,aS)))}function Qo(e){function t(a){return co(a,e)}if(0<ac.length){co(ac[0],e);for(var n=1;n<ac.length;n++){var r=ac[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Cs!==null&&co(Cs,e),Es!==null&&co(Es,e),Ms!==null&&co(Ms,e),Go.forEach(t),Ko.forEach(t),n=0;n<ys.length;n++)r=ys[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ys.length&&(n=ys[0],n.blockedOn===null);)my(n),n.blockedOn===null&&ys.shift()}var xi=ts.ReactCurrentBatchConfig,fd=!0;function iS(e,t,n,r){var a=qe,i=xi.transition;xi.transition=null;try{qe=1,up(e,t,n,r)}finally{qe=a,xi.transition=i}}function oS(e,t,n,r){var a=qe,i=xi.transition;xi.transition=null;try{qe=4,up(e,t,n,r)}finally{qe=a,xi.transition=i}}function up(e,t,n,r){if(fd){var a=Lf(e,t,n,r);if(a===null)Sh(e,t,r,md,n),rg(e,r);else if(sS(a,e,t,n,r))r.stopPropagation();else if(rg(e,r),t&4&&-1<rS.indexOf(e)){for(;a!==null;){var i=_l(a);if(i!==null&&dy(i),i=Lf(e,t,n,r),i===null&&Sh(e,t,r,md,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else Sh(e,t,r,null,n)}}var md=null;function Lf(e,t,n,r){if(md=null,e=op(r),e=sa(e),e!==null)if(t=$a(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ny(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 md=e,null}function py(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(qk()){case lp:return 1;case iy:return 4;case ud:case Gk:return 16;case oy:return 536870912;default:return 16}default:return 16}}var js=null,hp=null,Bc=null;function xy(){if(Bc)return Bc;var e,t=hp,n=t.length,r,a="value"in js?js.value:js.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[i-r];r++);return Bc=a.slice(e,1<r?1-r:void 0)}function Wc(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 ic(){return!0}function ag(){return!1}function Sn(e){function t(n,r,a,i,o){this._reactName=n,this._targetInst=a,this.type=r,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)?ic:ag,this.isPropagationStopped=ag,this}return xt(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=ic)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ic)},persist:function(){},isPersistent:ic}),t}var Yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fp=Sn(Yi),Ml=xt({},Yi,{view:0,detail:0}),lS=Sn(Ml),xh,gh,uo,iu=xt({},Ml,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mp,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!==uo&&(uo&&e.type==="mousemove"?(xh=e.screenX-uo.screenX,gh=e.screenY-uo.screenY):gh=xh=0,uo=e),xh)},movementY:function(e){return"movementY"in e?e.movementY:gh}}),ig=Sn(iu),cS=xt({},iu,{dataTransfer:0}),dS=Sn(cS),uS=xt({},Ml,{relatedTarget:0}),vh=Sn(uS),hS=xt({},Yi,{animationName:0,elapsedTime:0,pseudoElement:0}),fS=Sn(hS),mS=xt({},Yi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pS=Sn(mS),xS=xt({},Yi,{data:0}),og=Sn(xS),gS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vS={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"},wS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wS[e])?!!t[e]:!1}function mp(){return yS}var bS=xt({},Ml,{key:function(e){if(e.key){var t=gS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mp,charCode:function(e){return e.type==="keypress"?Wc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),NS=Sn(bS),jS=xt({},iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lg=Sn(jS),kS=xt({},Ml,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mp}),SS=Sn(kS),CS=xt({},Yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ES=Sn(CS),MS=xt({},iu,{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}),_S=Sn(MS),DS=[9,13,27,32],pp=qr&&"CompositionEvent"in window,$o=null;qr&&"documentMode"in document&&($o=document.documentMode);var TS=qr&&"TextEvent"in window&&!$o,gy=qr&&(!pp||$o&&8<$o&&11>=$o),cg=" ",dg=!1;function vy(e,t){switch(e){case"keyup":return DS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ti=!1;function PS(e,t){switch(e){case"compositionend":return wy(t);case"keypress":return t.which!==32?null:(dg=!0,cg);case"textInput":return e=t.data,e===cg&&dg?null:e;default:return null}}function AS(e,t){if(ti)return e==="compositionend"||!pp&&vy(e,t)?(e=xy(),Bc=hp=js=null,ti=!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 gy&&t.locale!=="ko"?null:t.data;default:return null}}var OS={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 ug(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!OS[e.type]:t==="textarea"}function yy(e,t,n,r){Qw(r),t=pd(t,"onChange"),0<t.length&&(n=new fp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ro=null,Zo=null;function zS(e){Ty(e,0)}function ou(e){var t=si(e);if(Hw(t))return e}function $S(e,t){if(e==="change")return t}var by=!1;if(qr){var wh;if(qr){var yh="oninput"in document;if(!yh){var hg=document.createElement("div");hg.setAttribute("oninput","return;"),yh=typeof hg.oninput=="function"}wh=yh}else wh=!1;by=wh&&(!document.documentMode||9<document.documentMode)}function fg(){Ro&&(Ro.detachEvent("onpropertychange",Ny),Zo=Ro=null)}function Ny(e){if(e.propertyName==="value"&&ou(Zo)){var t=[];yy(t,Zo,e,op(e)),ty(zS,t)}}function RS(e,t,n){e==="focusin"?(fg(),Ro=t,Zo=n,Ro.attachEvent("onpropertychange",Ny)):e==="focusout"&&fg()}function IS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ou(Zo)}function LS(e,t){if(e==="click")return ou(t)}function FS(e,t){if(e==="input"||e==="change")return ou(t)}function US(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rr=typeof Object.is=="function"?Object.is:US;function Jo(e,t){if(rr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!bf.call(t,a)||!rr(e[a],t[a]))return!1}return!0}function mg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pg(e,t){var n=mg(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=mg(n)}}function jy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ky(){for(var e=window,t=ld();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ld(e.document)}return t}function xp(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")}function BS(e){var t=ky(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&jy(n.ownerDocument.documentElement,n)){if(r!==null&&xp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=pg(n,i);var o=pg(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var WS=qr&&"documentMode"in document&&11>=document.documentMode,ni=null,Ff=null,Io=null,Uf=!1;function xg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Uf||ni==null||ni!==ld(r)||(r=ni,"selectionStart"in r&&xp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Io&&Jo(Io,r)||(Io=r,r=pd(Ff,"onSelect"),0<r.length&&(t=new fp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ni)))}function oc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ri={animationend:oc("Animation","AnimationEnd"),animationiteration:oc("Animation","AnimationIteration"),animationstart:oc("Animation","AnimationStart"),transitionend:oc("Transition","TransitionEnd")},bh={},Sy={};qr&&(Sy=document.createElement("div").style,"AnimationEvent"in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),"TransitionEvent"in window||delete ri.transitionend.transition);function lu(e){if(bh[e])return bh[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Sy)return bh[e]=t[n];return e}var Cy=lu("animationend"),Ey=lu("animationiteration"),My=lu("animationstart"),_y=lu("transitionend"),Dy=new Map,gg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ws(e,t){Dy.set(e,t),za(t,[e])}for(var Nh=0;Nh<gg.length;Nh++){var jh=gg[Nh],HS=jh.toLowerCase(),VS=jh[0].toUpperCase()+jh.slice(1);Ws(HS,"on"+VS)}Ws(Cy,"onAnimationEnd");Ws(Ey,"onAnimationIteration");Ws(My,"onAnimationStart");Ws("dblclick","onDoubleClick");Ws("focusin","onFocus");Ws("focusout","onBlur");Ws(_y,"onTransitionEnd");Si("onMouseEnter",["mouseout","mouseover"]);Si("onMouseLeave",["mouseout","mouseover"]);Si("onPointerEnter",["pointerout","pointerover"]);Si("onPointerLeave",["pointerout","pointerover"]);za("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));za("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));za("onBeforeInput",["compositionend","keypress","textInput","paste"]);za("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));za("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));za("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="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(" "),YS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Do));function vg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Hk(r,t,void 0,e),e.currentTarget=null}function Ty(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;vg(a,l,d),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;vg(a,l,d),i=c}}}if(dd)throw e=$f,dd=!1,$f=null,e}function st(e,t){var n=t[Yf];n===void 0&&(n=t[Yf]=new Set);var r=e+"__bubble";n.has(r)||(Py(t,e,2,!1),n.add(r))}function kh(e,t,n){var r=0;t&&(r|=4),Py(n,e,r,t)}var lc="_reactListening"+Math.random().toString(36).slice(2);function el(e){if(!e[lc]){e[lc]=!0,Lw.forEach(function(n){n!=="selectionchange"&&(YS.has(n)||kh(n,!1,e),kh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lc]||(t[lc]=!0,kh("selectionchange",!1,t))}}function Py(e,t,n,r){switch(py(t)){case 1:var a=iS;break;case 4:a=oS;break;default:a=up}n=a.bind(null,t,n,e),a=void 0,!zf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Sh(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=sa(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}ty(function(){var d=i,h=op(n),u=[];e:{var f=Dy.get(e);if(f!==void 0){var p=fp,w=e;switch(e){case"keypress":if(Wc(n)===0)break e;case"keydown":case"keyup":p=NS;break;case"focusin":w="focus",p=vh;break;case"focusout":w="blur",p=vh;break;case"beforeblur":case"afterblur":p=vh;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":p=ig;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=dS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=SS;break;case Cy:case Ey:case My:p=fS;break;case _y:p=ES;break;case"scroll":p=lS;break;case"wheel":p=_S;break;case"copy":case"cut":case"paste":p=pS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=lg}var v=(t&4)!==0,b=!v&&e==="scroll",g=v?f!==null?f+"Capture":null:f;v=[];for(var y=d,x;y!==null;){x=y;var N=x.stateNode;if(x.tag===5&&N!==null&&(x=N,g!==null&&(N=qo(y,g),N!=null&&v.push(tl(y,N,x)))),b)break;y=y.return}0<v.length&&(f=new p(f,w,null,n,h),u.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Af&&(w=n.relatedTarget||n.fromElement)&&(sa(w)||w[Gr]))break e;if((p||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,p?(w=n.relatedTarget||n.toElement,p=d,w=w?sa(w):null,w!==null&&(b=$a(w),w!==b||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=d),p!==w)){if(v=ig,N="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=lg,N="onPointerLeave",g="onPointerEnter",y="pointer"),b=p==null?f:si(p),x=w==null?f:si(w),f=new v(N,y+"leave",p,n,h),f.target=b,f.relatedTarget=x,N=null,sa(h)===d&&(v=new v(g,y+"enter",w,n,h),v.target=x,v.relatedTarget=b,N=v),b=N,p&&w)t:{for(v=p,g=w,y=0,x=v;x;x=Ha(x))y++;for(x=0,N=g;N;N=Ha(N))x++;for(;0<y-x;)v=Ha(v),y--;for(;0<x-y;)g=Ha(g),x--;for(;y--;){if(v===g||g!==null&&v===g.alternate)break t;v=Ha(v),g=Ha(g)}v=null}else v=null;p!==null&&wg(u,f,p,v,!1),w!==null&&b!==null&&wg(u,b,w,v,!0)}}e:{if(f=d?si(d):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var j=$S;else if(ug(f))if(by)j=FS;else{j=IS;var k=RS}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=LS);if(j&&(j=j(e,d))){yy(u,j,n,h);break e}k&&k(e,f,d),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Mf(f,"number",f.value)}switch(k=d?si(d):window,e){case"focusin":(ug(k)||k.contentEditable==="true")&&(ni=k,Ff=d,Io=null);break;case"focusout":Io=Ff=ni=null;break;case"mousedown":Uf=!0;break;case"contextmenu":case"mouseup":case"dragend":Uf=!1,xg(u,n,h);break;case"selectionchange":if(WS)break;case"keydown":case"keyup":xg(u,n,h)}var S;if(pp)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 ti?vy(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(gy&&n.locale!=="ko"&&(ti||M!=="onCompositionStart"?M==="onCompositionEnd"&&ti&&(S=xy()):(js=h,hp="value"in js?js.value:js.textContent,ti=!0)),k=pd(d,M),0<k.length&&(M=new og(M,e,null,n,h),u.push({event:M,listeners:k}),S?M.data=S:(S=wy(n),S!==null&&(M.data=S)))),(S=TS?PS(e,n):AS(e,n))&&(d=pd(d,"onBeforeInput"),0<d.length&&(h=new og("onBeforeInput","beforeinput",null,n,h),u.push({event:h,listeners:d}),h.data=S))}Ty(u,t)})}function tl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pd(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=qo(e,n),i!=null&&r.unshift(tl(e,i,a)),i=qo(e,t),i!=null&&r.push(tl(e,i,a))),e=e.return}return r}function Ha(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function wg(e,t,n,r,a){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,a?(c=qo(n,i),c!=null&&o.unshift(tl(n,c,l))):a||(c=qo(n,i),c!=null&&o.push(tl(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var XS=/\r\n?/g,qS=/\u0000|\uFFFD/g;function yg(e){return(typeof e=="string"?e:""+e).replace(XS,`
38
+ `).replace(qS,"")}function cc(e,t,n){if(t=yg(t),yg(e)!==t&&n)throw Error(oe(425))}function xd(){}var Bf=null,Wf=null;function Hf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vf=typeof setTimeout=="function"?setTimeout:void 0,GS=typeof clearTimeout=="function"?clearTimeout:void 0,bg=typeof Promise=="function"?Promise:void 0,KS=typeof queueMicrotask=="function"?queueMicrotask:typeof bg<"u"?function(e){return bg.resolve(null).then(e).catch(QS)}:Vf;function QS(e){setTimeout(function(){throw e})}function Ch(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Qo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Qo(t)}function _s(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==="$?")break;if(t==="/$")return null}}return e}function Ng(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}var Xi=Math.random().toString(36).slice(2),gr="__reactFiber$"+Xi,nl="__reactProps$"+Xi,Gr="__reactContainer$"+Xi,Yf="__reactEvents$"+Xi,ZS="__reactListeners$"+Xi,JS="__reactHandles$"+Xi;function sa(e){var t=e[gr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Gr]||n[gr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ng(e);e!==null;){if(n=e[gr])return n;e=Ng(e)}return t}e=n,n=e.parentNode}return null}function _l(e){return e=e[gr]||e[Gr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function si(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(oe(33))}function cu(e){return e[nl]||null}var Xf=[],ai=-1;function Hs(e){return{current:e}}function it(e){0>ai||(e.current=Xf[ai],Xf[ai]=null,ai--)}function et(e,t){ai++,Xf[ai]=e.current,e.current=t}var Is={},Xt=Hs(Is),cn=Hs(!1),va=Is;function Ci(e,t){var n=e.type.contextTypes;if(!n)return Is;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function dn(e){return e=e.childContextTypes,e!=null}function gd(){it(cn),it(Xt)}function jg(e,t,n){if(Xt.current!==Is)throw Error(oe(168));et(Xt,t),et(cn,n)}function Ay(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(oe(108,Rk(e)||"Unknown",a));return xt({},n,r)}function vd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Is,va=Xt.current,et(Xt,e),et(cn,cn.current),!0}function kg(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=Ay(e,t,va),r.__reactInternalMemoizedMergedChildContext=e,it(cn),it(Xt),et(Xt,e)):it(cn),et(cn,n)}var Ir=null,du=!1,Eh=!1;function Oy(e){Ir===null?Ir=[e]:Ir.push(e)}function e4(e){du=!0,Oy(e)}function Vs(){if(!Eh&&Ir!==null){Eh=!0;var e=0,t=qe;try{var n=Ir;for(qe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ir=null,du=!1}catch(a){throw Ir!==null&&(Ir=Ir.slice(e+1)),ay(lp,Vs),a}finally{qe=t,Eh=!1}}return null}var ii=[],oi=0,wd=null,yd=0,Rn=[],In=0,wa=null,Lr=1,Fr="";function Zs(e,t){ii[oi++]=yd,ii[oi++]=wd,wd=e,yd=t}function zy(e,t,n){Rn[In++]=Lr,Rn[In++]=Fr,Rn[In++]=wa,wa=e;var r=Lr;e=Fr;var a=32-er(r)-1;r&=~(1<<a),n+=1;var i=32-er(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,Lr=1<<32-er(t)+a|n<<a|r,Fr=i+e}else Lr=1<<i|n<<a|r,Fr=e}function gp(e){e.return!==null&&(Zs(e,1),zy(e,1,0))}function vp(e){for(;e===wd;)wd=ii[--oi],ii[oi]=null,yd=ii[--oi],ii[oi]=null;for(;e===wa;)wa=Rn[--In],Rn[In]=null,Fr=Rn[--In],Rn[In]=null,Lr=Rn[--In],Rn[In]=null}var wn=null,vn=null,lt=!1,Gn=null;function $y(e,t){var n=Fn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Sg(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,wn=e,vn=_s(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,wn=e,vn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=wa!==null?{id:Lr,overflow:Fr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Fn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,wn=e,vn=null,!0):!1;default:return!1}}function qf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gf(e){if(lt){var t=vn;if(t){var n=t;if(!Sg(e,t)){if(qf(e))throw Error(oe(418));t=_s(n.nextSibling);var r=wn;t&&Sg(e,t)?$y(r,n):(e.flags=e.flags&-4097|2,lt=!1,wn=e)}}else{if(qf(e))throw Error(oe(418));e.flags=e.flags&-4097|2,lt=!1,wn=e}}}function Cg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wn=e}function dc(e){if(e!==wn)return!1;if(!lt)return Cg(e),lt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Hf(e.type,e.memoizedProps)),t&&(t=vn)){if(qf(e))throw Ry(),Error(oe(418));for(;t;)$y(e,t),t=_s(t.nextSibling)}if(Cg(e),e.tag===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){var n=e.data;if(n==="/$"){if(t===0){vn=_s(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}vn=null}}else vn=wn?_s(e.stateNode.nextSibling):null;return!0}function Ry(){for(var e=vn;e;)e=_s(e.nextSibling)}function Ei(){vn=wn=null,lt=!1}function wp(e){Gn===null?Gn=[e]:Gn.push(e)}var t4=ts.ReactCurrentBatchConfig;function ho(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(oe(309));var r=n.stateNode}if(!r)throw Error(oe(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(oe(284));if(!n._owner)throw Error(oe(290,e))}return e}function uc(e,t){throw e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Eg(e){var t=e._init;return t(e._payload)}function Iy(e){function t(g,y){if(e){var x=g.deletions;x===null?(g.deletions=[y],g.flags|=16):x.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function a(g,y){return g=As(g,y),g.index=0,g.sibling=null,g}function i(g,y,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<y?(g.flags|=2,y):x):(g.flags|=2,y)):(g.flags|=1048576,y)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,y,x,N){return y===null||y.tag!==6?(y=Oh(x,g.mode,N),y.return=g,y):(y=a(y,x),y.return=g,y)}function c(g,y,x,N){var j=x.type;return j===ei?h(g,y,x.props.children,N,x.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===gs&&Eg(j)===y.type)?(N=a(y,x.props),N.ref=ho(g,y,x),N.return=g,N):(N=Kc(x.type,x.key,x.props,null,g.mode,N),N.ref=ho(g,y,x),N.return=g,N)}function d(g,y,x,N){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=zh(x,g.mode,N),y.return=g,y):(y=a(y,x.children||[]),y.return=g,y)}function h(g,y,x,N,j){return y===null||y.tag!==7?(y=ua(x,g.mode,N,j),y.return=g,y):(y=a(y,x),y.return=g,y)}function u(g,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Oh(""+y,g.mode,x),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ec:return x=Kc(y.type,y.key,y.props,null,g.mode,x),x.ref=ho(g,null,y),x.return=g,x;case Ja:return y=zh(y,g.mode,x),y.return=g,y;case gs:var N=y._init;return u(g,N(y._payload),x)}if(Mo(y)||io(y))return y=ua(y,g.mode,x,null),y.return=g,y;uc(g,y)}return null}function f(g,y,x,N){var j=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return j!==null?null:l(g,y,""+x,N);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ec:return x.key===j?c(g,y,x,N):null;case Ja:return x.key===j?d(g,y,x,N):null;case gs:return j=x._init,f(g,y,j(x._payload),N)}if(Mo(x)||io(x))return j!==null?null:h(g,y,x,N,null);uc(g,x)}return null}function p(g,y,x,N,j){if(typeof N=="string"&&N!==""||typeof N=="number")return g=g.get(x)||null,l(y,g,""+N,j);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case ec:return g=g.get(N.key===null?x:N.key)||null,c(y,g,N,j);case Ja:return g=g.get(N.key===null?x:N.key)||null,d(y,g,N,j);case gs:var k=N._init;return p(g,y,x,k(N._payload),j)}if(Mo(N)||io(N))return g=g.get(x)||null,h(y,g,N,j,null);uc(y,N)}return null}function w(g,y,x,N){for(var j=null,k=null,S=y,M=y=0,A=null;S!==null&&M<x.length;M++){S.index>M?(A=S,S=null):A=S.sibling;var I=f(g,S,x[M],N);if(I===null){S===null&&(S=A);break}e&&S&&I.alternate===null&&t(g,S),y=i(I,y,M),k===null?j=I:k.sibling=I,k=I,S=A}if(M===x.length)return n(g,S),lt&&Zs(g,M),j;if(S===null){for(;M<x.length;M++)S=u(g,x[M],N),S!==null&&(y=i(S,y,M),k===null?j=S:k.sibling=S,k=S);return lt&&Zs(g,M),j}for(S=r(g,S);M<x.length;M++)A=p(S,g,M,x[M],N),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?M:A.key),y=i(A,y,M),k===null?j=A:k.sibling=A,k=A);return e&&S.forEach(function(U){return t(g,U)}),lt&&Zs(g,M),j}function v(g,y,x,N){var j=io(x);if(typeof j!="function")throw Error(oe(150));if(x=j.call(x),x==null)throw Error(oe(151));for(var k=j=null,S=y,M=y=0,A=null,I=x.next();S!==null&&!I.done;M++,I=x.next()){S.index>M?(A=S,S=null):A=S.sibling;var U=f(g,S,I.value,N);if(U===null){S===null&&(S=A);break}e&&S&&U.alternate===null&&t(g,S),y=i(U,y,M),k===null?j=U:k.sibling=U,k=U,S=A}if(I.done)return n(g,S),lt&&Zs(g,M),j;if(S===null){for(;!I.done;M++,I=x.next())I=u(g,I.value,N),I!==null&&(y=i(I,y,M),k===null?j=I:k.sibling=I,k=I);return lt&&Zs(g,M),j}for(S=r(g,S);!I.done;M++,I=x.next())I=p(S,g,M,I.value,N),I!==null&&(e&&I.alternate!==null&&S.delete(I.key===null?M:I.key),y=i(I,y,M),k===null?j=I:k.sibling=I,k=I);return e&&S.forEach(function($){return t(g,$)}),lt&&Zs(g,M),j}function b(g,y,x,N){if(typeof x=="object"&&x!==null&&x.type===ei&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case ec:e:{for(var j=x.key,k=y;k!==null;){if(k.key===j){if(j=x.type,j===ei){if(k.tag===7){n(g,k.sibling),y=a(k,x.props.children),y.return=g,g=y;break e}}else if(k.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===gs&&Eg(j)===k.type){n(g,k.sibling),y=a(k,x.props),y.ref=ho(g,k,x),y.return=g,g=y;break e}n(g,k);break}else t(g,k);k=k.sibling}x.type===ei?(y=ua(x.props.children,g.mode,N,x.key),y.return=g,g=y):(N=Kc(x.type,x.key,x.props,null,g.mode,N),N.ref=ho(g,y,x),N.return=g,g=N)}return o(g);case Ja:e:{for(k=x.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(g,y.sibling),y=a(y,x.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=zh(x,g.mode,N),y.return=g,g=y}return o(g);case gs:return k=x._init,b(g,y,k(x._payload),N)}if(Mo(x))return w(g,y,x,N);if(io(x))return v(g,y,x,N);uc(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(g,y.sibling),y=a(y,x),y.return=g,g=y):(n(g,y),y=Oh(x,g.mode,N),y.return=g,g=y),o(g)):n(g,y)}return b}var Mi=Iy(!0),Ly=Iy(!1),bd=Hs(null),Nd=null,li=null,yp=null;function bp(){yp=li=Nd=null}function Np(e){var t=bd.current;it(bd),e._currentValue=t}function Kf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function gi(e,t){Nd=e,yp=li=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(on=!0),e.firstContext=null)}function Bn(e){var t=e._currentValue;if(yp!==e)if(e={context:e,memoizedValue:t,next:null},li===null){if(Nd===null)throw Error(oe(308));li=e,Nd.dependencies={lanes:0,firstContext:e}}else li=li.next=e;return t}var aa=null;function jp(e){aa===null?aa=[e]:aa.push(e)}function Fy(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,jp(t)):(n.next=a.next,a.next=n),t.interleaved=n,Kr(e,r)}function Kr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var vs=!1;function kp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Vr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ds(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,We&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Kr(e,n)}return a=r.interleaved,a===null?(t.next=t,jp(r)):(t.next=a.next,a.next=t),r.interleaved=t,Kr(e,n)}function Hc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cp(e,n)}}function Mg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jd(e,t,n,r){var a=e.updateQueue;vs=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=d:l.next=d,h.lastBaseUpdate=c))}if(i!==null){var u=a.baseState;o=0,h=d=c=null,l=i;do{var f=l.lane,p=l.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,v=l;switch(f=t,p=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){u=w.call(p,u,f);break e}u=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,f=typeof w=="function"?w.call(p,u,f):w,f==null)break e;u=xt({},u,f);break e;case 2:vs=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=a.effects,f===null?a.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(d=h=p,c=u):h=h.next=p,o|=f;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;f=l,l=f.next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}while(!0);if(h===null&&(c=u),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=h,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);ba|=o,e.lanes=o,e.memoizedState=u}}function _g(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(oe(191,a));a.call(r)}}}var Dl={},jr=Hs(Dl),rl=Hs(Dl),sl=Hs(Dl);function ia(e){if(e===Dl)throw Error(oe(174));return e}function Sp(e,t){switch(et(sl,t),et(rl,e),et(jr,Dl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Df(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Df(t,e)}it(jr),et(jr,t)}function _i(){it(jr),it(rl),it(sl)}function By(e){ia(sl.current);var t=ia(jr.current),n=Df(t,e.type);t!==n&&(et(rl,e),et(jr,n))}function Cp(e){rl.current===e&&(it(jr),it(rl))}var ft=Hs(0);function kd(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==="$?"||n.data==="$!"))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}var Mh=[];function Ep(){for(var e=0;e<Mh.length;e++)Mh[e]._workInProgressVersionPrimary=null;Mh.length=0}var Vc=ts.ReactCurrentDispatcher,_h=ts.ReactCurrentBatchConfig,ya=0,pt=null,Mt=null,Tt=null,Sd=!1,Lo=!1,al=0,n4=0;function Bt(){throw Error(oe(321))}function Mp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rr(e[n],t[n]))return!1;return!0}function _p(e,t,n,r,a,i){if(ya=i,pt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vc.current=e===null||e.memoizedState===null?i4:o4,e=n(r,a),Lo){i=0;do{if(Lo=!1,al=0,25<=i)throw Error(oe(301));i+=1,Tt=Mt=null,t.updateQueue=null,Vc.current=l4,e=n(r,a)}while(Lo)}if(Vc.current=Cd,t=Mt!==null&&Mt.next!==null,ya=0,Tt=Mt=pt=null,Sd=!1,t)throw Error(oe(300));return e}function Dp(){var e=al!==0;return al=0,e}function fr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?pt.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function Wn(){if(Mt===null){var e=pt.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=Tt===null?pt.memoizedState:Tt.next;if(t!==null)Tt=t,Mt=e;else{if(e===null)throw Error(oe(310));Mt=e,e={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Tt===null?pt.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function il(e,t){return typeof t=="function"?t(e):t}function Dh(e){var t=Wn(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=Mt,a=r.baseQueue,i=n.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}r.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,r=r.baseState;var l=o=null,c=null,d=i;do{var h=d.lane;if((ya&h)===h)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var u={lane:h,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=u,o=r):c=c.next=u,pt.lanes|=h,ba|=h}d=d.next}while(d!==null&&d!==i);c===null?o=r:c.next=l,rr(r,t.memoizedState)||(on=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do i=a.lane,pt.lanes|=i,ba|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Th(e){var t=Wn(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);rr(i,t.memoizedState)||(on=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Wy(){}function Hy(e,t){var n=pt,r=Wn(),a=t(),i=!rr(r.memoizedState,a);if(i&&(r.memoizedState=a,on=!0),r=r.queue,Tp(Xy.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Tt!==null&&Tt.memoizedState.tag&1){if(n.flags|=2048,ol(9,Yy.bind(null,n,r,a,t),void 0,null),At===null)throw Error(oe(349));ya&30||Vy(n,t,a)}return a}function Vy(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=pt.updateQueue,t===null?(t={lastEffect:null,stores:null},pt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Yy(e,t,n,r){t.value=n,t.getSnapshot=r,qy(t)&&Gy(e)}function Xy(e,t,n){return n(function(){qy(t)&&Gy(e)})}function qy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rr(e,n)}catch{return!0}}function Gy(e){var t=Kr(e,1);t!==null&&tr(t,e,1,-1)}function Dg(e){var t=fr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:e},t.queue=e,e=e.dispatch=a4.bind(null,pt,e),[t.memoizedState,e]}function ol(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=pt.updateQueue,t===null?(t={lastEffect:null,stores:null},pt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ky(){return Wn().memoizedState}function Yc(e,t,n,r){var a=fr();pt.flags|=e,a.memoizedState=ol(1|t,n,void 0,r===void 0?null:r)}function uu(e,t,n,r){var a=Wn();r=r===void 0?null:r;var i=void 0;if(Mt!==null){var o=Mt.memoizedState;if(i=o.destroy,r!==null&&Mp(r,o.deps)){a.memoizedState=ol(t,n,i,r);return}}pt.flags|=e,a.memoizedState=ol(1|t,n,i,r)}function Tg(e,t){return Yc(8390656,8,e,t)}function Tp(e,t){return uu(2048,8,e,t)}function Qy(e,t){return uu(4,2,e,t)}function Zy(e,t){return uu(4,4,e,t)}function Jy(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function eb(e,t,n){return n=n!=null?n.concat([e]):null,uu(4,4,Jy.bind(null,t,e),n)}function Pp(){}function tb(e,t){var n=Wn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mp(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function nb(e,t){var n=Wn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mp(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function rb(e,t,n){return ya&21?(rr(n,t)||(n=ly(),pt.lanes|=n,ba|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,on=!0),e.memoizedState=n)}function r4(e,t){var n=qe;qe=n!==0&&4>n?n:4,e(!0);var r=_h.transition;_h.transition={};try{e(!1),t()}finally{qe=n,_h.transition=r}}function sb(){return Wn().memoizedState}function s4(e,t,n){var r=Ps(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ab(e))ib(t,n);else if(n=Fy(e,t,n,r),n!==null){var a=Qt();tr(n,e,r,a),ob(n,t,r)}}function a4(e,t,n){var r=Ps(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ab(e))ib(t,a);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(a.hasEagerState=!0,a.eagerState=l,rr(l,o)){var c=t.interleaved;c===null?(a.next=a,jp(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=Fy(e,t,a,r),n!==null&&(a=Qt(),tr(n,e,r,a),ob(n,t,r))}}function ab(e){var t=e.alternate;return e===pt||t!==null&&t===pt}function ib(e,t){Lo=Sd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ob(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cp(e,n)}}var Cd={readContext:Bn,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},i4={readContext:Bn,useCallback:function(e,t){return fr().memoizedState=[e,t===void 0?null:t],e},useContext:Bn,useEffect:Tg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Yc(4194308,4,Jy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yc(4,2,e,t)},useMemo:function(e,t){var n=fr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=s4.bind(null,pt,e),[r.memoizedState,e]},useRef:function(e){var t=fr();return e={current:e},t.memoizedState=e},useState:Dg,useDebugValue:Pp,useDeferredValue:function(e){return fr().memoizedState=e},useTransition:function(){var e=Dg(!1),t=e[0];return e=r4.bind(null,e[1]),fr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pt,a=fr();if(lt){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),At===null)throw Error(oe(349));ya&30||Vy(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Tg(Xy.bind(null,r,i,e),[e]),r.flags|=2048,ol(9,Yy.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=fr(),t=At.identifierPrefix;if(lt){var n=Fr,r=Lr;n=(r&~(1<<32-er(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=al++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=n4++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},o4={readContext:Bn,useCallback:tb,useContext:Bn,useEffect:Tp,useImperativeHandle:eb,useInsertionEffect:Qy,useLayoutEffect:Zy,useMemo:nb,useReducer:Dh,useRef:Ky,useState:function(){return Dh(il)},useDebugValue:Pp,useDeferredValue:function(e){var t=Wn();return rb(t,Mt.memoizedState,e)},useTransition:function(){var e=Dh(il)[0],t=Wn().memoizedState;return[e,t]},useMutableSource:Wy,useSyncExternalStore:Hy,useId:sb,unstable_isNewReconciler:!1},l4={readContext:Bn,useCallback:tb,useContext:Bn,useEffect:Tp,useImperativeHandle:eb,useInsertionEffect:Qy,useLayoutEffect:Zy,useMemo:nb,useReducer:Th,useRef:Ky,useState:function(){return Th(il)},useDebugValue:Pp,useDeferredValue:function(e){var t=Wn();return Mt===null?t.memoizedState=e:rb(t,Mt.memoizedState,e)},useTransition:function(){var e=Th(il)[0],t=Wn().memoizedState;return[e,t]},useMutableSource:Wy,useSyncExternalStore:Hy,useId:sb,unstable_isNewReconciler:!1};function Vn(e,t){if(e&&e.defaultProps){t=xt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Qf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:xt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hu={isMounted:function(e){return(e=e._reactInternals)?$a(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qt(),a=Ps(e),i=Vr(r,a);i.payload=t,n!=null&&(i.callback=n),t=Ds(e,i,a),t!==null&&(tr(t,e,a,r),Hc(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qt(),a=Ps(e),i=Vr(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ds(e,i,a),t!==null&&(tr(t,e,a,r),Hc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qt(),r=Ps(e),a=Vr(n,r);a.tag=2,t!=null&&(a.callback=t),t=Ds(e,a,r),t!==null&&(tr(t,e,r,n),Hc(t,e,r))}};function Pg(e,t,n,r,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Jo(n,r)||!Jo(a,i):!0}function lb(e,t,n){var r=!1,a=Is,i=t.contextType;return typeof i=="object"&&i!==null?i=Bn(i):(a=dn(t)?va:Xt.current,r=t.contextTypes,i=(r=r!=null)?Ci(e,a):Is),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=hu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function Ag(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&hu.enqueueReplaceState(t,t.state,null)}function Zf(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},kp(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Bn(i):(i=dn(t)?va:Xt.current,a.context=Ci(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Qf(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&hu.enqueueReplaceState(a,a.state,null),jd(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Di(e,t){try{var n="",r=t;do n+=$k(r),r=r.return;while(r);var a=n}catch(i){a=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:a,digest:null}}function Ph(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Jf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var c4=typeof WeakMap=="function"?WeakMap:Map;function cb(e,t,n){n=Vr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Md||(Md=!0,cm=r),Jf(e,t)},n}function db(e,t,n){n=Vr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Jf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Jf(e,t),typeof r!="function"&&(Ts===null?Ts=new Set([this]):Ts.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Og(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new c4;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=j4.bind(null,e,t,n),t.then(e,e))}function zg(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $g(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Vr(-1,1),t.tag=2,Ds(n,t,1))),n.lanes|=1),e)}var d4=ts.ReactCurrentOwner,on=!1;function Gt(e,t,n,r){t.child=e===null?Ly(t,null,n,r):Mi(t,e.child,n,r)}function Rg(e,t,n,r,a){n=n.render;var i=t.ref;return gi(t,a),r=_p(e,t,n,r,i,a),n=Dp(),e!==null&&!on?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Qr(e,t,a)):(lt&&n&&gp(t),t.flags|=1,Gt(e,t,r,a),t.child)}function Ig(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!Fp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,ub(e,t,i,r,a)):(e=Kc(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Jo,n(o,r)&&e.ref===t.ref)return Qr(e,t,a)}return t.flags|=1,e=As(i,r),e.ref=t.ref,e.return=t,t.child=e}function ub(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(Jo(i,r)&&e.ref===t.ref)if(on=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(on=!0);else return t.lanes=e.lanes,Qr(e,t,a)}return em(e,t,n,r,a)}function hb(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(di,fn),fn|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,et(di,fn),fn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,et(di,fn),fn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,et(di,fn),fn|=r;return Gt(e,t,a,n),t.child}function fb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function em(e,t,n,r,a){var i=dn(n)?va:Xt.current;return i=Ci(t,i),gi(t,a),n=_p(e,t,n,r,i,a),r=Dp(),e!==null&&!on?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Qr(e,t,a)):(lt&&r&&gp(t),t.flags|=1,Gt(e,t,n,a),t.child)}function Lg(e,t,n,r,a){if(dn(n)){var i=!0;vd(t)}else i=!1;if(gi(t,a),t.stateNode===null)Xc(e,t),lb(t,n,r),Zf(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Bn(d):(d=dn(n)?va:Xt.current,d=Ci(t,d));var h=n.getDerivedStateFromProps,u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==d)&&Ag(t,o,r,d),vs=!1;var f=t.memoizedState;o.state=f,jd(t,r,o,a),c=t.memoizedState,l!==r||f!==c||cn.current||vs?(typeof h=="function"&&(Qf(t,n,h,r),c=t.memoizedState),(l=vs||Pg(t,n,l,r,f,c,d))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=d,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Uy(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Vn(t.type,l),o.props=d,u=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Bn(c):(c=dn(n)?va:Xt.current,c=Ci(t,c));var p=n.getDerivedStateFromProps;(h=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==u||f!==c)&&Ag(t,o,r,c),vs=!1,f=t.memoizedState,o.state=f,jd(t,r,o,a);var w=t.memoizedState;l!==u||f!==w||cn.current||vs?(typeof p=="function"&&(Qf(t,n,p,r),w=t.memoizedState),(d=vs||Pg(t,n,d,r,f,w,c)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),o.props=r,o.state=w,o.context=c,r=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return tm(e,t,n,r,i,a)}function tm(e,t,n,r,a,i){fb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&kg(t,n,!1),Qr(e,t,i);r=t.stateNode,d4.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Mi(t,e.child,null,i),t.child=Mi(t,null,l,i)):Gt(e,t,l,i),t.memoizedState=r.state,a&&kg(t,n,!0),t.child}function mb(e){var t=e.stateNode;t.pendingContext?jg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&jg(e,t.context,!1),Sp(e,t.containerInfo)}function Fg(e,t,n,r,a){return Ei(),wp(a),t.flags|=256,Gt(e,t,n,r),t.child}var nm={dehydrated:null,treeContext:null,retryLane:0};function rm(e){return{baseLanes:e,cachePool:null,transitions:null}}function pb(e,t,n){var r=t.pendingProps,a=ft.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),et(ft,a&1),e===null)return Gf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=pu(o,r,0,null),e=ua(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=rm(n),t.memoizedState=nm,e):Ap(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return u4(e,t,o,r,l,a,n);if(i){i=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=As(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=As(l,i):(i=ua(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?rm(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=nm,r}return i=e.child,e=i.sibling,r=As(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ap(e,t){return t=pu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hc(e,t,n,r){return r!==null&&wp(r),Mi(t,e.child,null,n),e=Ap(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function u4(e,t,n,r,a,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Ph(Error(oe(422))),hc(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=pu({mode:"visible",children:r.children},a,0,null),i=ua(i,a,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Mi(t,e.child,null,o),t.child.memoizedState=rm(o),t.memoizedState=nm,i);if(!(t.mode&1))return hc(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(oe(419)),r=Ph(i,r,void 0),hc(e,t,o,r)}if(l=(o&e.childLanes)!==0,on||l){if(r=At,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Kr(e,a),tr(r,e,a,-1))}return Lp(),r=Ph(Error(oe(421))),hc(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=k4.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,vn=_s(a.nextSibling),wn=t,lt=!0,Gn=null,e!==null&&(Rn[In++]=Lr,Rn[In++]=Fr,Rn[In++]=wa,Lr=e.id,Fr=e.overflow,wa=t),t=Ap(t,r.children),t.flags|=4096,t)}function Ug(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Kf(e.return,t,n)}function Ah(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function xb(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(Gt(e,t,r.children,n),r=ft.current,r&2)r=r&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&&Ug(e,n,t);else if(e.tag===19)Ug(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}r&=1}if(et(ft,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&kd(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Ah(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&kd(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Ah(t,!0,n,null,i);break;case"together":Ah(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ba|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=As(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=As(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function h4(e,t,n){switch(t.tag){case 3:mb(t),Ei();break;case 5:By(t);break;case 1:dn(t.type)&&vd(t);break;case 4:Sp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;et(bd,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(et(ft,ft.current&1),t.flags|=128,null):n&t.child.childLanes?pb(e,t,n):(et(ft,ft.current&1),e=Qr(e,t,n),e!==null?e.sibling:null);et(ft,ft.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return xb(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),et(ft,ft.current),r)break;return null;case 22:case 23:return t.lanes=0,hb(e,t,n)}return Qr(e,t,n)}var gb,sm,vb,wb;gb=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sm=function(){};vb=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,ia(jr.current);var i=null;switch(n){case"input":a=Cf(e,a),r=Cf(e,r),i=[];break;case"select":a=xt({},a,{value:void 0}),r=xt({},r,{value:void 0}),i=[];break;case"textarea":a=_f(e,a),r=_f(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=xd)}Tf(n,r);var o;n=null;for(d in a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Yo.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=a!=null?a[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Yo.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&st("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};wb=function(e,t,n,r){n!==r&&(t.flags|=4)};function fo(e,t){if(!lt)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function f4(e,t,n){var r=t.pendingProps;switch(vp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(t),null;case 1:return dn(t.type)&&gd(),Wt(t),null;case 3:return r=t.stateNode,_i(),it(cn),it(Xt),Ep(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(dc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gn!==null&&(hm(Gn),Gn=null))),sm(e,t),Wt(t),null;case 5:Cp(t);var a=ia(sl.current);if(n=t.type,e!==null&&t.stateNode!=null)vb(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(oe(166));return Wt(t),null}if(e=ia(jr.current),dc(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[gr]=t,r[nl]=i,e=(t.mode&1)!==0,n){case"dialog":st("cancel",r),st("close",r);break;case"iframe":case"object":case"embed":st("load",r);break;case"video":case"audio":for(a=0;a<Do.length;a++)st(Do[a],r);break;case"source":st("error",r);break;case"img":case"image":case"link":st("error",r),st("load",r);break;case"details":st("toggle",r);break;case"input":Kx(r,i),st("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},st("invalid",r);break;case"textarea":Zx(r,i),st("invalid",r)}Tf(n,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&cc(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&cc(r.textContent,l,e),a=["children",""+l]):Yo.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&st("scroll",r)}switch(n){case"input":tc(r),Qx(r,i,!0);break;case"textarea":tc(r),Jx(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=xd)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Xw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[gr]=t,e[nl]=r,gb(e,t,!1,!1),t.stateNode=e;e:{switch(o=Pf(n,r),n){case"dialog":st("cancel",e),st("close",e),a=r;break;case"iframe":case"object":case"embed":st("load",e),a=r;break;case"video":case"audio":for(a=0;a<Do.length;a++)st(Do[a],e);a=r;break;case"source":st("error",e),a=r;break;case"img":case"image":case"link":st("error",e),st("load",e),a=r;break;case"details":st("toggle",e),a=r;break;case"input":Kx(e,r),a=Cf(e,r),st("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=xt({},r,{value:void 0}),st("invalid",e);break;case"textarea":Zx(e,r),a=_f(e,r),st("invalid",e);break;default:a=r}Tf(n,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Kw(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&qw(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Xo(e,c):typeof c=="number"&&Xo(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Yo.hasOwnProperty(i)?c!=null&&i==="onScroll"&&st("scroll",e):c!=null&&rp(e,i,c,o))}switch(n){case"input":tc(e),Qx(e,r,!1);break;case"textarea":tc(e),Jx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Rs(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fi(e,!!r.multiple,i,!1):r.defaultValue!=null&&fi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=xd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Wt(t),null;case 6:if(e&&t.stateNode!=null)wb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(oe(166));if(n=ia(sl.current),ia(jr.current),dc(t)){if(r=t.stateNode,n=t.memoizedProps,r[gr]=t,(i=r.nodeValue!==n)&&(e=wn,e!==null))switch(e.tag){case 3:cc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&cc(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[gr]=t,t.stateNode=r}return Wt(t),null;case 13:if(it(ft),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(lt&&vn!==null&&t.mode&1&&!(t.flags&128))Ry(),Ei(),t.flags|=98560,i=!1;else if(i=dc(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(oe(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(oe(317));i[gr]=t}else Ei(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wt(t),i=!1}else Gn!==null&&(hm(Gn),Gn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ft.current&1?Dt===0&&(Dt=3):Lp())),t.updateQueue!==null&&(t.flags|=4),Wt(t),null);case 4:return _i(),sm(e,t),e===null&&el(t.stateNode.containerInfo),Wt(t),null;case 10:return Np(t.type._context),Wt(t),null;case 17:return dn(t.type)&&gd(),Wt(t),null;case 19:if(it(ft),i=t.memoizedState,i===null)return Wt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)fo(i,!1);else{if(Dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=kd(e),o!==null){for(t.flags|=128,fo(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return et(ft,ft.current&1|2),t.child}e=e.sibling}i.tail!==null&&yt()>Ti&&(t.flags|=128,r=!0,fo(i,!1),t.lanes=4194304)}else{if(!r)if(e=kd(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!lt)return Wt(t),null}else 2*yt()-i.renderingStartTime>Ti&&n!==1073741824&&(t.flags|=128,r=!0,fo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=yt(),t.sibling=null,n=ft.current,et(ft,r?n&1|2:n&1),t):(Wt(t),null);case 22:case 23:return Ip(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fn&1073741824&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function m4(e,t){switch(vp(t),t.tag){case 1:return dn(t.type)&&gd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _i(),it(cn),it(Xt),Ep(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cp(t),null;case 13:if(it(ft),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Ei()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return it(ft),null;case 4:return _i(),null;case 10:return Np(t.type._context),null;case 22:case 23:return Ip(),null;case 24:return null;default:return null}}var fc=!1,Yt=!1,p4=typeof WeakSet=="function"?WeakSet:Set,ye=null;function ci(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){wt(e,t,r)}else n.current=null}function am(e,t,n){try{n()}catch(r){wt(e,t,r)}}var Bg=!1;function x4(e,t){if(Bf=fd,e=ky(),xp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,d=0,h=0,u=e,f=null;t:for(;;){for(var p;u!==n||a!==0&&u.nodeType!==3||(l=o+a),u!==i||r!==0&&u.nodeType!==3||(c=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(p=u.firstChild)!==null;)f=u,u=p;for(;;){if(u===e)break t;if(f===n&&++d===a&&(l=o),f===i&&++h===r&&(c=o),(p=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wf={focusedElem:e,selectionRange:n},fd=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,b=w.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Vn(t.type,v),b);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(N){wt(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return w=Bg,Bg=!1,w}function Fo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&am(t,n,i)}a=a.next}while(a!==r)}}function fu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function im(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function yb(e){var t=e.alternate;t!==null&&(e.alternate=null,yb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gr],delete t[nl],delete t[Yf],delete t[ZS],delete t[JS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bb(e){return e.tag===5||e.tag===3||e.tag===4}function Wg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bb(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.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 om(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xd));else if(r!==4&&(e=e.child,e!==null))for(om(e,t,n),e=e.sibling;e!==null;)om(e,t,n),e=e.sibling}function lm(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(lm(e,t,n),e=e.sibling;e!==null;)lm(e,t,n),e=e.sibling}var It=null,Xn=!1;function ls(e,t,n){for(n=n.child;n!==null;)Nb(e,t,n),n=n.sibling}function Nb(e,t,n){if(Nr&&typeof Nr.onCommitFiberUnmount=="function")try{Nr.onCommitFiberUnmount(au,n)}catch{}switch(n.tag){case 5:Yt||ci(n,t);case 6:var r=It,a=Xn;It=null,ls(e,t,n),It=r,Xn=a,It!==null&&(Xn?(e=It,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):It.removeChild(n.stateNode));break;case 18:It!==null&&(Xn?(e=It,n=n.stateNode,e.nodeType===8?Ch(e.parentNode,n):e.nodeType===1&&Ch(e,n),Qo(e)):Ch(It,n.stateNode));break;case 4:r=It,a=Xn,It=n.stateNode.containerInfo,Xn=!0,ls(e,t,n),It=r,Xn=a;break;case 0:case 11:case 14:case 15:if(!Yt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&am(n,t,o),a=a.next}while(a!==r)}ls(e,t,n);break;case 1:if(!Yt&&(ci(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){wt(n,t,l)}ls(e,t,n);break;case 21:ls(e,t,n);break;case 22:n.mode&1?(Yt=(r=Yt)||n.memoizedState!==null,ls(e,t,n),Yt=r):ls(e,t,n);break;default:ls(e,t,n)}}function Hg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new p4),t.forEach(function(r){var a=S4.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Hn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:It=l.stateNode,Xn=!1;break e;case 3:It=l.stateNode.containerInfo,Xn=!0;break e;case 4:It=l.stateNode.containerInfo,Xn=!0;break e}l=l.return}if(It===null)throw Error(oe(160));Nb(i,o,a),It=null,Xn=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){wt(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)jb(t,e),t=t.sibling}function jb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Hn(t,e),cr(e),r&4){try{Fo(3,e,e.return),fu(3,e)}catch(v){wt(e,e.return,v)}try{Fo(5,e,e.return)}catch(v){wt(e,e.return,v)}}break;case 1:Hn(t,e),cr(e),r&512&&n!==null&&ci(n,n.return);break;case 5:if(Hn(t,e),cr(e),r&512&&n!==null&&ci(n,n.return),e.flags&32){var a=e.stateNode;try{Xo(a,"")}catch(v){wt(e,e.return,v)}}if(r&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Vw(a,i),Pf(l,o);var d=Pf(l,i);for(o=0;o<c.length;o+=2){var h=c[o],u=c[o+1];h==="style"?Kw(a,u):h==="dangerouslySetInnerHTML"?qw(a,u):h==="children"?Xo(a,u):rp(a,h,u,d)}switch(l){case"input":Ef(a,i);break;case"textarea":Yw(a,i);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?fi(a,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?fi(a,!!i.multiple,i.defaultValue,!0):fi(a,!!i.multiple,i.multiple?[]:"",!1))}a[nl]=i}catch(v){wt(e,e.return,v)}}break;case 6:if(Hn(t,e),cr(e),r&4){if(e.stateNode===null)throw Error(oe(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(v){wt(e,e.return,v)}}break;case 3:if(Hn(t,e),cr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Qo(t.containerInfo)}catch(v){wt(e,e.return,v)}break;case 4:Hn(t,e),cr(e);break;case 13:Hn(t,e),cr(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||($p=yt())),r&4&&Hg(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Yt=(d=Yt)||h,Hn(t,e),Yt=d):Hn(t,e),cr(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!h&&e.mode&1)for(ye=e,h=e.child;h!==null;){for(u=ye=h;ye!==null;){switch(f=ye,p=f.child,f.tag){case 0:case 11:case 14:case 15:Fo(4,f,f.return);break;case 1:ci(f,f.return);var w=f.stateNode;if(typeof w.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(v){wt(r,n,v)}}break;case 5:ci(f,f.return);break;case 22:if(f.memoizedState!==null){Yg(u);continue}}p!==null?(p.return=f,ye=p):Yg(u)}h=h.sibling}e:for(h=null,u=e;;){if(u.tag===5){if(h===null){h=u;try{a=u.stateNode,d?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=u.stateNode,c=u.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Gw("display",o))}catch(v){wt(e,e.return,v)}}}else if(u.tag===6){if(h===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(v){wt(e,e.return,v)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:Hn(t,e),cr(e),r&4&&Hg(e);break;case 21:break;default:Hn(t,e),cr(e)}}function cr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(bb(n)){var r=n;break e}n=n.return}throw Error(oe(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Xo(a,""),r.flags&=-33);var i=Wg(e);lm(e,i,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Wg(e);om(e,l,o);break;default:throw Error(oe(161))}}catch(c){wt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function g4(e,t,n){ye=e,kb(e)}function kb(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var a=ye,i=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||fc;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Yt;l=fc;var d=Yt;if(fc=o,(Yt=c)&&!d)for(ye=a;ye!==null;)o=ye,c=o.child,o.tag===22&&o.memoizedState!==null?Xg(a):c!==null?(c.return=o,ye=c):Xg(a);for(;i!==null;)ye=i,kb(i),i=i.sibling;ye=a,fc=l,Yt=d}Vg(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,ye=i):Vg(e)}}function Vg(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Yt||fu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Yt)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Vn(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&_g(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}_g(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var h=d.memoizedState;if(h!==null){var u=h.dehydrated;u!==null&&Qo(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}Yt||t.flags&512&&im(t)}catch(f){wt(t,t.return,f)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Yg(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Xg(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fu(4,t)}catch(c){wt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){wt(t,a,c)}}var i=t.return;try{im(t)}catch(c){wt(t,i,c)}break;case 5:var o=t.return;try{im(t)}catch(c){wt(t,o,c)}}}catch(c){wt(t,t.return,c)}if(t===e){ye=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ye=l;break}ye=t.return}}var v4=Math.ceil,Ed=ts.ReactCurrentDispatcher,Op=ts.ReactCurrentOwner,Un=ts.ReactCurrentBatchConfig,We=0,At=null,jt=null,Lt=0,fn=0,di=Hs(0),Dt=0,ll=null,ba=0,mu=0,zp=0,Uo=null,an=null,$p=0,Ti=1/0,$r=null,Md=!1,cm=null,Ts=null,mc=!1,ks=null,_d=0,Bo=0,dm=null,qc=-1,Gc=0;function Qt(){return We&6?yt():qc!==-1?qc:qc=yt()}function Ps(e){return e.mode&1?We&2&&Lt!==0?Lt&-Lt:t4.transition!==null?(Gc===0&&(Gc=ly()),Gc):(e=qe,e!==0||(e=window.event,e=e===void 0?16:py(e.type)),e):1}function tr(e,t,n,r){if(50<Bo)throw Bo=0,dm=null,Error(oe(185));El(e,n,r),(!(We&2)||e!==At)&&(e===At&&(!(We&2)&&(mu|=n),Dt===4&&bs(e,Lt)),un(e,r),n===1&&We===0&&!(t.mode&1)&&(Ti=yt()+500,du&&Vs()))}function un(e,t){var n=e.callbackNode;tS(e,t);var r=hd(e,e===At?Lt:0);if(r===0)n!==null&&ng(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ng(n),t===1)e.tag===0?e4(qg.bind(null,e)):Oy(qg.bind(null,e)),KS(function(){!(We&6)&&Vs()}),n=null;else{switch(cy(r)){case 1:n=lp;break;case 4:n=iy;break;case 16:n=ud;break;case 536870912:n=oy;break;default:n=ud}n=Pb(n,Sb.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Sb(e,t){if(qc=-1,Gc=0,We&6)throw Error(oe(327));var n=e.callbackNode;if(vi()&&e.callbackNode!==n)return null;var r=hd(e,e===At?Lt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Dd(e,r);else{t=r;var a=We;We|=2;var i=Eb();(At!==e||Lt!==t)&&($r=null,Ti=yt()+500,da(e,t));do try{b4();break}catch(l){Cb(e,l)}while(!0);bp(),Ed.current=i,We=a,jt!==null?t=0:(At=null,Lt=0,t=Dt)}if(t!==0){if(t===2&&(a=Rf(e),a!==0&&(r=a,t=um(e,a))),t===1)throw n=ll,da(e,0),bs(e,r),un(e,yt()),n;if(t===6)bs(e,r);else{if(a=e.current.alternate,!(r&30)&&!w4(a)&&(t=Dd(e,r),t===2&&(i=Rf(e),i!==0&&(r=i,t=um(e,i))),t===1))throw n=ll,da(e,0),bs(e,r),un(e,yt()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(oe(345));case 2:Js(e,an,$r);break;case 3:if(bs(e,r),(r&130023424)===r&&(t=$p+500-yt(),10<t)){if(hd(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Qt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Vf(Js.bind(null,e,an,$r),t);break}Js(e,an,$r);break;case 4:if(bs(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-er(r);i=1<<o,o=t[o],o>a&&(a=o),r&=~i}if(r=a,r=yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*v4(r/1960))-r,10<r){e.timeoutHandle=Vf(Js.bind(null,e,an,$r),r);break}Js(e,an,$r);break;case 5:Js(e,an,$r);break;default:throw Error(oe(329))}}}return un(e,yt()),e.callbackNode===n?Sb.bind(null,e):null}function um(e,t){var n=Uo;return e.current.memoizedState.isDehydrated&&(da(e,t).flags|=256),e=Dd(e,t),e!==2&&(t=an,an=n,t!==null&&hm(t)),e}function hm(e){an===null?an=e:an.push.apply(an,e)}function w4(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!rr(i(),a))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 bs(e,t){for(t&=~zp,t&=~mu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-er(t),r=1<<n;e[n]=-1,t&=~r}}function qg(e){if(We&6)throw Error(oe(327));vi();var t=hd(e,0);if(!(t&1))return un(e,yt()),null;var n=Dd(e,t);if(e.tag!==0&&n===2){var r=Rf(e);r!==0&&(t=r,n=um(e,r))}if(n===1)throw n=ll,da(e,0),bs(e,t),un(e,yt()),n;if(n===6)throw Error(oe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Js(e,an,$r),un(e,yt()),null}function Rp(e,t){var n=We;We|=1;try{return e(t)}finally{We=n,We===0&&(Ti=yt()+500,du&&Vs())}}function Na(e){ks!==null&&ks.tag===0&&!(We&6)&&vi();var t=We;We|=1;var n=Un.transition,r=qe;try{if(Un.transition=null,qe=1,e)return e()}finally{qe=r,Un.transition=n,We=t,!(We&6)&&Vs()}}function Ip(){fn=di.current,it(di)}function da(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,GS(n)),jt!==null)for(n=jt.return;n!==null;){var r=n;switch(vp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&gd();break;case 3:_i(),it(cn),it(Xt),Ep();break;case 5:Cp(r);break;case 4:_i();break;case 13:it(ft);break;case 19:it(ft);break;case 10:Np(r.type._context);break;case 22:case 23:Ip()}n=n.return}if(At=e,jt=e=As(e.current,null),Lt=fn=t,Dt=0,ll=null,zp=mu=ba=0,an=Uo=null,aa!==null){for(t=0;t<aa.length;t++)if(n=aa[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=a,r.next=o}n.pending=r}aa=null}return e}function Cb(e,t){do{var n=jt;try{if(bp(),Vc.current=Cd,Sd){for(var r=pt.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Sd=!1}if(ya=0,Tt=Mt=pt=null,Lo=!1,al=0,Op.current=null,n===null||n.return===null){Dt=1,ll=t,jt=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=Lt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,h=l,u=h.tag;if(!(h.mode&1)&&(u===0||u===11||u===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=zg(o);if(p!==null){p.flags&=-257,$g(p,o,l,i,t),p.mode&1&&Og(i,d,t),t=p,c=d;var w=t.updateQueue;if(w===null){var v=new Set;v.add(c),t.updateQueue=v}else w.add(c);break e}else{if(!(t&1)){Og(i,d,t),Lp();break e}c=Error(oe(426))}}else if(lt&&l.mode&1){var b=zg(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),$g(b,o,l,i,t),wp(Di(c,l));break e}}i=c=Di(c,l),Dt!==4&&(Dt=2),Uo===null?Uo=[i]:Uo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=cb(i,c,t);Mg(i,g);break e;case 1:l=c;var y=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ts===null||!Ts.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var N=db(i,l,t);Mg(i,N);break e}}i=i.return}while(i!==null)}_b(n)}catch(j){t=j,jt===n&&n!==null&&(jt=n=n.return);continue}break}while(!0)}function Eb(){var e=Ed.current;return Ed.current=Cd,e===null?Cd:e}function Lp(){(Dt===0||Dt===3||Dt===2)&&(Dt=4),At===null||!(ba&268435455)&&!(mu&268435455)||bs(At,Lt)}function Dd(e,t){var n=We;We|=2;var r=Eb();(At!==e||Lt!==t)&&($r=null,da(e,t));do try{y4();break}catch(a){Cb(e,a)}while(!0);if(bp(),We=n,Ed.current=r,jt!==null)throw Error(oe(261));return At=null,Lt=0,Dt}function y4(){for(;jt!==null;)Mb(jt)}function b4(){for(;jt!==null&&!Yk();)Mb(jt)}function Mb(e){var t=Tb(e.alternate,e,fn);e.memoizedProps=e.pendingProps,t===null?_b(e):jt=t,Op.current=null}function _b(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=m4(n,t),n!==null){n.flags&=32767,jt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Dt=6,jt=null;return}}else if(n=f4(n,t,fn),n!==null){jt=n;return}if(t=t.sibling,t!==null){jt=t;return}jt=t=e}while(t!==null);Dt===0&&(Dt=5)}function Js(e,t,n){var r=qe,a=Un.transition;try{Un.transition=null,qe=1,N4(e,t,n,r)}finally{Un.transition=a,qe=r}return null}function N4(e,t,n,r){do vi();while(ks!==null);if(We&6)throw Error(oe(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(oe(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(nS(e,i),e===At&&(jt=At=null,Lt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||mc||(mc=!0,Pb(ud,function(){return vi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Un.transition,Un.transition=null;var o=qe;qe=1;var l=We;We|=4,Op.current=null,x4(e,n),jb(n,e),BS(Wf),fd=!!Bf,Wf=Bf=null,e.current=n,g4(n),Xk(),We=l,qe=o,Un.transition=i}else e.current=n;if(mc&&(mc=!1,ks=e,_d=a),i=e.pendingLanes,i===0&&(Ts=null),Kk(n.stateNode),un(e,yt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Md)throw Md=!1,e=cm,cm=null,e;return _d&1&&e.tag!==0&&vi(),i=e.pendingLanes,i&1?e===dm?Bo++:(Bo=0,dm=e):Bo=0,Vs(),null}function vi(){if(ks!==null){var e=cy(_d),t=Un.transition,n=qe;try{if(Un.transition=null,qe=16>e?16:e,ks===null)var r=!1;else{if(e=ks,ks=null,_d=0,We&6)throw Error(oe(331));var a=We;for(We|=4,ye=e.current;ye!==null;){var i=ye,o=i.child;if(ye.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(ye=d;ye!==null;){var h=ye;switch(h.tag){case 0:case 11:case 15:Fo(8,h,i)}var u=h.child;if(u!==null)u.return=h,ye=u;else for(;ye!==null;){h=ye;var f=h.sibling,p=h.return;if(yb(h),h===d){ye=null;break}if(f!==null){f.return=p,ye=f;break}ye=p}}}var w=i.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}ye=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ye=o;else e:for(;ye!==null;){if(i=ye,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Fo(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,ye=g;break e}ye=i.return}}var y=e.current;for(ye=y;ye!==null;){o=ye;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ye=x;else e:for(o=y;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:fu(9,l)}}catch(j){wt(l,l.return,j)}if(l===o){ye=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,ye=N;break e}ye=l.return}}if(We=a,Vs(),Nr&&typeof Nr.onPostCommitFiberRoot=="function")try{Nr.onPostCommitFiberRoot(au,e)}catch{}r=!0}return r}finally{qe=n,Un.transition=t}}return!1}function Gg(e,t,n){t=Di(n,t),t=cb(e,t,1),e=Ds(e,t,1),t=Qt(),e!==null&&(El(e,1,t),un(e,t))}function wt(e,t,n){if(e.tag===3)Gg(e,e,n);else for(;t!==null;){if(t.tag===3){Gg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ts===null||!Ts.has(r))){e=Di(n,e),e=db(t,e,1),t=Ds(t,e,1),e=Qt(),t!==null&&(El(t,1,e),un(t,e));break}}t=t.return}}function j4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qt(),e.pingedLanes|=e.suspendedLanes&n,At===e&&(Lt&n)===n&&(Dt===4||Dt===3&&(Lt&130023424)===Lt&&500>yt()-$p?da(e,0):zp|=n),un(e,t)}function Db(e,t){t===0&&(e.mode&1?(t=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):t=1);var n=Qt();e=Kr(e,t),e!==null&&(El(e,t,n),un(e,n))}function k4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Db(e,n)}function S4(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),Db(e,n)}var Tb;Tb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||cn.current)on=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return on=!1,h4(e,t,n);on=!!(e.flags&131072)}else on=!1,lt&&t.flags&1048576&&zy(t,yd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xc(e,t),e=t.pendingProps;var a=Ci(t,Xt.current);gi(t,n),a=_p(null,t,r,e,a,n);var i=Dp();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dn(r)?(i=!0,vd(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,kp(t),a.updater=hu,t.stateNode=a,a._reactInternals=t,Zf(t,r,e,n),t=tm(null,t,r,!0,i,n)):(t.tag=0,lt&&i&&gp(t),Gt(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xc(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=E4(r),e=Vn(r,e),a){case 0:t=em(null,t,r,e,n);break e;case 1:t=Lg(null,t,r,e,n);break e;case 11:t=Rg(null,t,r,e,n);break e;case 14:t=Ig(null,t,r,Vn(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),em(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Lg(e,t,r,a,n);case 3:e:{if(mb(t),e===null)throw Error(oe(387));r=t.pendingProps,i=t.memoizedState,a=i.element,Uy(e,t),jd(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Di(Error(oe(423)),t),t=Fg(e,t,r,n,a);break e}else if(r!==a){a=Di(Error(oe(424)),t),t=Fg(e,t,r,n,a);break e}else for(vn=_s(t.stateNode.containerInfo.firstChild),wn=t,lt=!0,Gn=null,n=Ly(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ei(),r===a){t=Qr(e,t,n);break e}Gt(e,t,r,n)}t=t.child}return t;case 5:return By(t),e===null&&Gf(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Hf(r,a)?o=null:i!==null&&Hf(r,i)&&(t.flags|=32),fb(e,t),Gt(e,t,o,n),t.child;case 6:return e===null&&Gf(t),null;case 13:return pb(e,t,n);case 4:return Sp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mi(t,null,r,n):Gt(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Rg(e,t,r,a,n);case 7:return Gt(e,t,t.pendingProps,n),t.child;case 8:return Gt(e,t,t.pendingProps.children,n),t.child;case 12:return Gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,et(bd,r._currentValue),r._currentValue=o,i!==null)if(rr(i.value,o)){if(i.children===a.children&&!cn.current){t=Qr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Vr(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?c.next=c:(c.next=h.next,h.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Kf(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(oe(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Kf(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Gt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,gi(t,n),a=Bn(a),r=r(a),t.flags|=1,Gt(e,t,r,n),t.child;case 14:return r=t.type,a=Vn(r,t.pendingProps),a=Vn(r.type,a),Ig(e,t,r,a,n);case 15:return ub(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Xc(e,t),t.tag=1,dn(r)?(e=!0,vd(t)):e=!1,gi(t,n),lb(t,r,a),Zf(t,r,a,n),tm(null,t,r,!0,e,n);case 19:return xb(e,t,n);case 22:return hb(e,t,n)}throw Error(oe(156,t.tag))};function Pb(e,t){return ay(e,t)}function C4(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(e,t,n,r){return new C4(e,t,n,r)}function Fp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function E4(e){if(typeof e=="function")return Fp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ap)return 11;if(e===ip)return 14}return 2}function As(e,t){var n=e.alternate;return n===null?(n=Fn(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&14680064,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}function Kc(e,t,n,r,a,i){var o=2;if(r=e,typeof e=="function")Fp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ei:return ua(n.children,a,i,t);case sp:o=8,a|=8;break;case Nf:return e=Fn(12,n,t,a|2),e.elementType=Nf,e.lanes=i,e;case jf:return e=Fn(13,n,t,a),e.elementType=jf,e.lanes=i,e;case kf:return e=Fn(19,n,t,a),e.elementType=kf,e.lanes=i,e;case Bw:return pu(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fw:o=10;break e;case Uw:o=9;break e;case ap:o=11;break e;case ip:o=14;break e;case gs:o=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Fn(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function ua(e,t,n,r){return e=Fn(7,e,r,t),e.lanes=n,e}function pu(e,t,n,r){return e=Fn(22,e,r,t),e.elementType=Bw,e.lanes=n,e.stateNode={isHidden:!1},e}function Oh(e,t,n){return e=Fn(6,e,null,t),e.lanes=n,e}function zh(e,t,n){return t=Fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function M4(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ph(0),this.expirationTimes=ph(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ph(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Up(e,t,n,r,a,i,o,l,c){return e=new M4(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Fn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},kp(i),e}function _4(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ja,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ab(e){if(!e)return Is;e=e._reactInternals;e:{if($a(e)!==e||e.tag!==1)throw Error(oe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(oe(171))}if(e.tag===1){var n=e.type;if(dn(n))return Ay(e,n,t)}return t}function Ob(e,t,n,r,a,i,o,l,c){return e=Up(n,r,!0,e,a,i,o,l,c),e.context=Ab(null),n=e.current,r=Qt(),a=Ps(n),i=Vr(r,a),i.callback=t??null,Ds(n,i,a),e.current.lanes=a,El(e,a,r),un(e,r),e}function xu(e,t,n,r){var a=t.current,i=Qt(),o=Ps(a);return n=Ab(n),t.context===null?t.context=n:t.pendingContext=n,t=Vr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ds(a,t,o),e!==null&&(tr(e,a,o,i),Hc(e,a,o)),o}function Td(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Kg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bp(e,t){Kg(e,t),(e=e.alternate)&&Kg(e,t)}function D4(){return null}var zb=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wp(e){this._internalRoot=e}gu.prototype.render=Wp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));xu(e,t,null,null)};gu.prototype.unmount=Wp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Na(function(){xu(null,e,null,null)}),t[Gr]=null}};function gu(e){this._internalRoot=e}gu.prototype.unstable_scheduleHydration=function(e){if(e){var t=hy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ys.length&&t!==0&&t<ys[n].priority;n++);ys.splice(n,0,e),n===0&&my(e)}};function Hp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qg(){}function T4(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var d=Td(o);i.call(d)}}var o=Ob(t,r,e,0,null,!1,!1,"",Qg);return e._reactRootContainer=o,e[Gr]=o.current,el(e.nodeType===8?e.parentNode:e),Na(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var d=Td(c);l.call(d)}}var c=Up(e,0,!1,null,null,!1,!1,"",Qg);return e._reactRootContainer=c,e[Gr]=c.current,el(e.nodeType===8?e.parentNode:e),Na(function(){xu(t,c,n,r)}),c}function wu(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=Td(o);l.call(c)}}xu(t,o,e,a)}else o=T4(n,t,e,a,r);return Td(o)}dy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=_o(t.pendingLanes);n!==0&&(cp(t,n|1),un(t,yt()),!(We&6)&&(Ti=yt()+500,Vs()))}break;case 13:Na(function(){var r=Kr(e,1);if(r!==null){var a=Qt();tr(r,e,1,a)}}),Bp(e,1)}};dp=function(e){if(e.tag===13){var t=Kr(e,134217728);if(t!==null){var n=Qt();tr(t,e,134217728,n)}Bp(e,134217728)}};uy=function(e){if(e.tag===13){var t=Ps(e),n=Kr(e,t);if(n!==null){var r=Qt();tr(n,e,t,r)}Bp(e,t)}};hy=function(){return qe};fy=function(e,t){var n=qe;try{return qe=e,t()}finally{qe=n}};Of=function(e,t,n){switch(t){case"input":if(Ef(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=cu(r);if(!a)throw Error(oe(90));Hw(r),Ef(r,a)}}}break;case"textarea":Yw(e,n);break;case"select":t=n.value,t!=null&&fi(e,!!n.multiple,t,!1)}};Jw=Rp;ey=Na;var P4={usingClientEntryPoint:!1,Events:[_l,si,cu,Qw,Zw,Rp]},mo={findFiberByHostInstance:sa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},A4={bundleType:mo.bundleType,version:mo.version,rendererPackageName:mo.rendererPackageName,rendererConfig:mo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ts.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ry(e),e===null?null:e.stateNode},findFiberByHostInstance:mo.findFiberByHostInstance||D4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pc.isDisabled&&pc.supportsFiber)try{au=pc.inject(A4),Nr=pc}catch{}}kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P4;kn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hp(t))throw Error(oe(200));return _4(e,t,null,n)};kn.createRoot=function(e,t){if(!Hp(e))throw Error(oe(299));var n=!1,r="",a=zb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Up(e,1,!1,null,null,n,!1,r,a),e[Gr]=t.current,el(e.nodeType===8?e.parentNode:e),new Wp(t)};kn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return 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=ry(t),e=e===null?null:e.stateNode,e};kn.flushSync=function(e){return Na(e)};kn.hydrate=function(e,t,n){if(!vu(t))throw Error(oe(200));return wu(null,e,t,!0,n)};kn.hydrateRoot=function(e,t,n){if(!Hp(e))throw Error(oe(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",o=zb;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Ob(t,null,e,1,n??null,a,!1,i,o),e[Gr]=t.current,el(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new gu(t)};kn.render=function(e,t,n){if(!vu(t))throw Error(oe(200));return wu(null,e,t,!1,n)};kn.unmountComponentAtNode=function(e){if(!vu(e))throw Error(oe(40));return e._reactRootContainer?(Na(function(){wu(null,null,e,!1,function(){e._reactRootContainer=null,e[Gr]=null})}),!0):!1};kn.unstable_batchedUpdates=Rp;kn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vu(n))throw Error(oe(200));if(e==null||e._reactInternals===void 0)throw Error(oe(38));return wu(e,t,n,!1,r)};kn.version="18.3.1-next-f1338f8080-20240426";function $b(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($b)}catch(e){console.error(e)}}$b(),$w.exports=kn;var yu=$w.exports;const Rb=Gm(yu);var Zg=yu;yf.createRoot=Zg.createRoot,yf.hydrateRoot=Zg.hydrateRoot;/**
41
+ * @remix-run/router v1.23.0
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function cl(){return cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cl.apply(this,arguments)}var Ss;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ss||(Ss={}));const Jg="popstate";function O4(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:l}=r.location;return fm("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Pd(a)}return $4(t,n,null,e)}function kt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ib(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function z4(){return Math.random().toString(36).substr(2,8)}function e0(e,t){return{usr:e.state,key:e.key,idx:t}}function fm(e,t,n,r){return n===void 0&&(n=null),cl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?qi(t):t,{state:n,key:t&&t.key||r||z4()})}function Pd(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function qi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function $4(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l=Ss.Pop,c=null,d=h();d==null&&(d=0,o.replaceState(cl({},o.state,{idx:d}),""));function h(){return(o.state||{idx:null}).idx}function u(){l=Ss.Pop;let b=h(),g=b==null?null:b-d;d=b,c&&c({action:l,location:v.location,delta:g})}function f(b,g){l=Ss.Push;let y=fm(v.location,b,g);d=h()+1;let x=e0(y,d),N=v.createHref(y);try{o.pushState(x,"",N)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(N)}i&&c&&c({action:l,location:v.location,delta:1})}function p(b,g){l=Ss.Replace;let y=fm(v.location,b,g);d=h();let x=e0(y,d),N=v.createHref(y);o.replaceState(x,"",N),i&&c&&c({action:l,location:v.location,delta:0})}function w(b){let g=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof b=="string"?b:Pd(b);return y=y.replace(/ $/,"%20"),kt(g,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,g)}let v={get action(){return l},get location(){return e(a,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Jg,u),c=b,()=>{a.removeEventListener(Jg,u),c=null}},createHref(b){return t(a,b)},createURL:w,encodeLocation(b){let g=w(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:p,go(b){return o.go(b)}};return v}var t0;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(t0||(t0={}));function R4(e,t,n){return n===void 0&&(n="/"),I4(e,t,n)}function I4(e,t,n,r){let a=typeof t=="string"?qi(t):t,i=Vp(a.pathname||"/",n);if(i==null)return null;let o=Lb(e);L4(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=Q4(i);l=q4(o[c],d)}return l}function Lb(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(kt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Os([r,c.relativePath]),h=n.concat(c);i.children&&i.children.length>0&&(kt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Lb(i.children,t,h,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:Y4(d,i.index),routesMeta:h})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of Fb(i.path))a(i,o,c)}),t}function Fb(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=Fb(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function L4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:X4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const F4=/^:[\w-]+$/,U4=3,B4=2,W4=1,H4=10,V4=-2,n0=e=>e==="*";function Y4(e,t){let n=e.split("/"),r=n.length;return n.some(n0)&&(r+=V4),t&&(r+=B4),n.filter(a=>!n0(a)).reduce((a,i)=>a+(F4.test(i)?U4:i===""?W4:H4),r)}function X4(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function q4(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",u=G4({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},h),f=c.route;if(!u)return null;Object.assign(a,u.params),o.push({params:a,pathname:Os([i,u.pathname]),pathnameBase:tC(Os([i,u.pathnameBase])),route:f}),u.pathnameBase!=="/"&&(i=Os([i,u.pathnameBase]))}return o}function G4(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=K4(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((d,h,u)=>{let{paramName:f,isOptional:p}=h;if(f==="*"){let v=l[u]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const w=l[u];return p&&!w?d[f]=void 0:d[f]=(w||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function K4(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ib(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 r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Q4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ib(!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 Vp(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Z4(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?qi(e):e;return{pathname:n?n.startsWith("/")?n:J4(n,t):t,search:nC(r),hash:rC(a)}}function J4(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function $h(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. 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 eC(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ub(e,t){let n=eC(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Bb(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=qi(e):(a=cl({},e),kt(!a.pathname||!a.pathname.includes("?"),$h("?","pathname","search",a)),kt(!a.pathname||!a.pathname.includes("#"),$h("#","pathname","hash",a)),kt(!a.search||!a.search.includes("#"),$h("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),u-=1;a.pathname=f.join("/")}l=u>=0?t[u]:"/"}let c=Z4(a,l),d=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||h)&&(c.pathname+="/"),c}const Os=e=>e.join("/").replace(/\/\/+/g,"/"),tC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),nC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,rC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function sC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Wb=["post","put","patch","delete"];new Set(Wb);const aC=["get",...Wb];new Set(aC);/**
50
+ * React Router v6.30.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 dl(){return dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dl.apply(this,arguments)}const Yp=m.createContext(null),iC=m.createContext(null),Ra=m.createContext(null),bu=m.createContext(null),Ys=m.createContext({outlet:null,matches:[],isDataRoute:!1}),Hb=m.createContext(null);function oC(e,t){let{relative:n}=t===void 0?{}:t;Tl()||kt(!1);let{basename:r,navigator:a}=m.useContext(Ra),{hash:i,pathname:o,search:l}=Yb(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Os([r,o])),a.createHref({pathname:c,search:l,hash:i})}function Tl(){return m.useContext(bu)!=null}function Gi(){return Tl()||kt(!1),m.useContext(bu).location}function Vb(e){m.useContext(Ra).static||m.useLayoutEffect(e)}function Mr(){let{isDataRoute:e}=m.useContext(Ys);return e?yC():lC()}function lC(){Tl()||kt(!1);let e=m.useContext(Yp),{basename:t,future:n,navigator:r}=m.useContext(Ra),{matches:a}=m.useContext(Ys),{pathname:i}=Gi(),o=JSON.stringify(Ub(a,n.v7_relativeSplatPath)),l=m.useRef(!1);return Vb(()=>{l.current=!0}),m.useCallback(function(d,h){if(h===void 0&&(h={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let u=Bb(d,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Os([t,u.pathname])),(h.replace?r.replace:r.push)(u,h.state,h)},[t,r,o,i,e])}function Xp(){let{matches:e}=m.useContext(Ys),t=e[e.length-1];return t?t.params:{}}function Yb(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Ra),{matches:a}=m.useContext(Ys),{pathname:i}=Gi(),o=JSON.stringify(Ub(a,r.v7_relativeSplatPath));return m.useMemo(()=>Bb(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function cC(e,t){return dC(e,t)}function dC(e,t,n,r){Tl()||kt(!1);let{navigator:a}=m.useContext(Ra),{matches:i}=m.useContext(Ys),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=Gi(),h;if(t){var u;let b=typeof t=="string"?qi(t):t;c==="/"||(u=b.pathname)!=null&&u.startsWith(c)||kt(!1),h=b}else h=d;let f=h.pathname||"/",p=f;if(c!=="/"){let b=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(b.length).join("/")}let w=R4(e,{pathname:p}),v=pC(w&&w.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Os([c,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Os([c,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return t&&v?m.createElement(bu.Provider,{value:{location:dl({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Ss.Pop}},v):v}function uC(){let e=wC(),t=sC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={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:a},n):null,null)}const hC=m.createElement(uC,null);class fC 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(Ys.Provider,{value:this.props.routeContext},m.createElement(Hb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mC(e){let{routeContext:t,match:n,children:r}=e,a=m.useContext(Yp);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Ys.Provider,{value:t},r)}function pC(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let h=o.findIndex(u=>u.route.id&&(l==null?void 0:l[u.route.id])!==void 0);h>=0||kt(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let u=o[h];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(d=h),u.route.id){let{loaderData:f,errors:p}=n,w=u.route.loader&&f[u.route.id]===void 0&&(!p||p[u.route.id]===void 0);if(u.route.lazy||w){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((h,u,f)=>{let p,w=!1,v=null,b=null;n&&(p=l&&u.route.id?l[u.route.id]:void 0,v=u.route.errorElement||hC,c&&(d<0&&f===0?(bC("route-fallback"),w=!0,b=null):d===f&&(w=!0,b=u.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),y=()=>{let x;return p?x=v:w?x=b:u.route.Component?x=m.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=h,m.createElement(mC,{match:u,routeContext:{outlet:h,matches:g,isDataRoute:n!=null},children:x})};return n&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?m.createElement(fC,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):y()},null)}var Xb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Xb||{}),qb=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}(qb||{});function xC(e){let t=m.useContext(Yp);return t||kt(!1),t}function gC(e){let t=m.useContext(iC);return t||kt(!1),t}function vC(e){let t=m.useContext(Ys);return t||kt(!1),t}function Gb(e){let t=vC(),n=t.matches[t.matches.length-1];return n.route.id||kt(!1),n.route.id}function wC(){var e;let t=m.useContext(Hb),n=gC(),r=Gb();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function yC(){let{router:e}=xC(Xb.UseNavigateStable),t=Gb(qb.UseNavigateStable),n=m.useRef(!1);return Vb(()=>{n.current=!0}),m.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,dl({fromRouteId:t},i)))},[e,t])}const r0={};function bC(e,t,n){r0[e]||(r0[e]=!0)}function NC(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function nn(e){kt(!1)}function jC(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Ss.Pop,navigator:i,static:o=!1,future:l}=e;Tl()&&kt(!1);let c=t.replace(/^\/*/,"/"),d=m.useMemo(()=>({basename:c,navigator:i,static:o,future:dl({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=qi(r));let{pathname:h="/",search:u="",hash:f="",state:p=null,key:w="default"}=r,v=m.useMemo(()=>{let b=Vp(h,c);return b==null?null:{location:{pathname:b,search:u,hash:f,state:p,key:w},navigationType:a}},[c,h,u,f,p,w,a]);return v==null?null:m.createElement(Ra.Provider,{value:d},m.createElement(bu.Provider,{children:n,value:v}))}function kC(e){let{children:t,location:n}=e;return cC(mm(t),n)}new Promise(()=>{});function mm(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,a)=>{if(!m.isValidElement(r))return;let i=[...t,a];if(r.type===m.Fragment){n.push.apply(n,mm(r.props.children,i));return}r.type!==nn&&kt(!1),!r.props.index||!r.props.children||kt(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=mm(r.props.children,i)),n.push(o)}),n}/**
59
+ * React Router DOM v6.30.1
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 pm(){return pm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pm.apply(this,arguments)}function SC(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function CC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function EC(e,t){return e.button===0&&(!t||t==="_self")&&!CC(e)}function xm(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 r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function MC(e,t){let n=xm(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const _C=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],DC="6";try{window.__reactRouterVersion=DC}catch{}const TC="startTransition",s0=ep[TC];function PC(e){let{basename:t,children:n,future:r,window:a}=e,i=m.useRef();i.current==null&&(i.current=O4({window:a,v5Compat:!0}));let o=i.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:d}=r||{},h=m.useCallback(u=>{d&&s0?s0(()=>c(u)):c(u)},[c,d]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>NC(r),[r]),m.createElement(jC,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const AC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",OC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qp=m.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:h,viewTransition:u}=t,f=SC(t,_C),{basename:p}=m.useContext(Ra),w,v=!1;if(typeof d=="string"&&OC.test(d)&&(w=d,AC))try{let x=new URL(window.location.href),N=d.startsWith("//")?new URL(x.protocol+d):new URL(d),j=Vp(N.pathname,p);N.origin===x.origin&&j!=null?d=j+N.search+N.hash:v=!0}catch{}let b=oC(d,{relative:a}),g=zC(d,{replace:o,state:l,target:c,preventScrollReset:h,relative:a,viewTransition:u});function y(x){r&&r(x),x.defaultPrevented||g(x)}return m.createElement("a",pm({},f,{href:w||b,onClick:v||i?r:y,ref:n,target:c}))});var a0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(a0||(a0={}));var i0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(i0||(i0={}));function zC(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Mr(),d=Gi(),h=Yb(e,{relative:o});return m.useCallback(u=>{if(EC(u,n)){u.preventDefault();let f=r!==void 0?r:Pd(d)===Pd(h);c(e,{replace:f,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,h,r,a,n,e,i,o,l])}function $C(e){let t=m.useRef(xm(e)),n=m.useRef(!1),r=Gi(),a=m.useMemo(()=>MC(r.search,n.current?null:t.current),[r.search]),i=Mr(),o=m.useCallback((l,c)=>{const d=xm(typeof l=="function"?l(a):l);n.current=!0,i("?"+d,c)},[i,a]);return[a,o]}function RC(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 IC=e=>{switch(e){case"success":return UC;case"info":return WC;case"warning":return BC;case"error":return HC;default:return null}},LC=Array(12).fill(0),FC=({visible:e,className:t})=>Q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Q.createElement("div",{className:"sonner-spinner"},LC.map((n,r)=>Q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),UC=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),BC=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Q.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"})),WC=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),HC=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),VC=Q.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"},Q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),YC=()=>{const[e,t]=Q.useState(document.hidden);return Q.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let gm=1;class XC{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:r,...a}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:gm++,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:r}),{...c,...t,id:i,dismissible:l,title:r}):c):this.addToast({title:r,...a,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(r=>r({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 r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,o;const l=a.then(async d=>{if(o=["resolve",d],Q.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(GC(d)&&!d.ok){i=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof u=="object"&&!Q.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(d instanceof Error){i=!1;const u=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,w=typeof u=="object"&&!Q.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(n.success!==void 0){i=!1;const u=typeof n.success=="function"?await n.success(d):n.success,f=typeof n.description=="function"?await n.description(d):n.description,w=typeof u=="object"&&!Q.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:f,...w})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,u=typeof n.description=="function"?await n.description(d):n.description,p=typeof h=="object"&&!Q.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:u,...p})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,h)=>l.then(()=>o[0]==="reject"?h(o[1]):d(o[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||gm++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const rn=new XC,qC=(e,t)=>{const n=(t==null?void 0:t.id)||gm++;return rn.addToast({title:e,...t,id:n}),n},GC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",KC=qC,QC=()=>rn.toasts,ZC=()=>rn.getActiveToasts(),V=Object.assign(KC,{success:rn.success,info:rn.info,warning:rn.warning,error:rn.error,custom:rn.custom,message:rn.message,promise:rn.promise,dismiss:rn.dismiss,loading:rn.loading},{getHistory:QC,getToasts:ZC});RC("[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 xc(e){return e.label!==void 0}const JC=3,eE="24px",tE="16px",o0=4e3,nE=356,rE=14,sE=45,aE=200;function dr(...e){return e.filter(Boolean).join(" ")}function iE(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const oE=e=>{var t,n,r,a,i,o,l,c,d;const{invert:h,toast:u,unstyled:f,interacting:p,setHeights:w,visibleToasts:v,heights:b,index:g,toasts:y,expanded:x,removeToast:N,defaultRichColors:j,closeButton:k,style:S,cancelButtonStyle:M,actionButtonStyle:A,className:I="",descriptionClassName:U="",duration:$,position:L,gap:E,expandByDefault:O,classNames:D,icons:T,closeButtonAriaLabel:C="Close toast"}=e,[_,z]=Q.useState(null),[H,P]=Q.useState(null),[B,q]=Q.useState(!1),[G,se]=Q.useState(!1),[re,Z]=Q.useState(!1),[R,ee]=Q.useState(!1),[J,F]=Q.useState(!1),[K,ne]=Q.useState(0),[ce,ge]=Q.useState(0),ve=Q.useRef(u.duration||$||o0),Ae=Q.useRef(null),Te=Q.useRef(null),tt=g===0,ut=g+1<=v,Le=u.type,Oe=u.dismissible!==!1,Ge=u.className||"",Je=u.descriptionClassName||"",ot=Q.useMemo(()=>b.findIndex(he=>he.toastId===u.id)||0,[b,u.id]),Ot=Q.useMemo(()=>{var he;return(he=u.closeButton)!=null?he:k},[u.closeButton,k]),zt=Q.useMemo(()=>u.duration||$||o0,[u.duration,$]),ae=Q.useRef(0),me=Q.useRef(0),ze=Q.useRef(0),X=Q.useRef(null),[le,W]=L.split("-"),te=Q.useMemo(()=>b.reduce((he,Ve,vt)=>vt>=ot?he:he+Ve.height,0),[b,ot]),de=YC(),Ne=u.invert||h,Se=Le==="loading";me.current=Q.useMemo(()=>ot*E+te,[ot,te]),Q.useEffect(()=>{ve.current=zt},[zt]),Q.useEffect(()=>{q(!0)},[]),Q.useEffect(()=>{const he=Te.current;if(he){const Ve=he.getBoundingClientRect().height;return ge(Ve),w(vt=>[{toastId:u.id,height:Ve,position:u.position},...vt]),()=>w(vt=>vt.filter(Nt=>Nt.toastId!==u.id))}},[w,u.id]),Q.useLayoutEffect(()=>{if(!B)return;const he=Te.current,Ve=he.style.height;he.style.height="auto";const vt=he.getBoundingClientRect().height;he.style.height=Ve,ge(vt),w(Nt=>Nt.find(Qe=>Qe.toastId===u.id)?Nt.map(Qe=>Qe.toastId===u.id?{...Qe,height:vt}:Qe):[{toastId:u.id,height:vt,position:u.position},...Nt])},[B,u.title,u.description,w,u.id,u.jsx,u.action,u.cancel]);const ue=Q.useCallback(()=>{se(!0),ne(me.current),w(he=>he.filter(Ve=>Ve.toastId!==u.id)),setTimeout(()=>{N(u)},aE)},[u,N,w,me]);Q.useEffect(()=>{if(u.promise&&Le==="loading"||u.duration===1/0||u.type==="loading")return;let he;return x||p||de?(()=>{if(ze.current<ae.current){const Nt=new Date().getTime()-ae.current;ve.current=ve.current-Nt}ze.current=new Date().getTime()})():(()=>{ve.current!==1/0&&(ae.current=new Date().getTime(),he=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),ue()},ve.current))})(),()=>clearTimeout(he)},[x,p,u,Le,de,ue]),Q.useEffect(()=>{u.delete&&(ue(),u.onDismiss==null||u.onDismiss.call(u,u))},[ue,u.delete]);function Pe(){var he;if(T!=null&&T.loading){var Ve;return Q.createElement("div",{className:dr(D==null?void 0:D.loader,u==null||(Ve=u.classNames)==null?void 0:Ve.loader,"sonner-loader"),"data-visible":Le==="loading"},T.loading)}return Q.createElement(FC,{className:dr(D==null?void 0:D.loader,u==null||(he=u.classNames)==null?void 0:he.loader),visible:Le==="loading"})}const _e=u.icon||(T==null?void 0:T[Le])||IC(Le);var Fe,bt;return Q.createElement("li",{tabIndex:0,ref:Te,className:dr(I,Ge,D==null?void 0:D.toast,u==null||(t=u.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[Le],u==null||(n=u.classNames)==null?void 0:n[Le]),"data-sonner-toast":"","data-rich-colors":(Fe=u.richColors)!=null?Fe:j,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":B,"data-promise":!!u.promise,"data-swiped":J,"data-removed":G,"data-visible":ut,"data-y-position":le,"data-x-position":W,"data-index":g,"data-front":tt,"data-swiping":re,"data-dismissible":Oe,"data-type":Le,"data-invert":Ne,"data-swipe-out":R,"data-swipe-direction":H,"data-expanded":!!(x||O&&B),"data-testid":u.testId,style:{"--index":g,"--toasts-before":g,"--z-index":y.length-g,"--offset":`${G?K:me.current}px`,"--initial-height":O?"auto":`${ce}px`,...S,...u.style},onDragEnd:()=>{Z(!1),z(null),X.current=null},onPointerDown:he=>{he.button!==2&&(Se||!Oe||(Ae.current=new Date,ne(me.current),he.target.setPointerCapture(he.pointerId),he.target.tagName!=="BUTTON"&&(Z(!0),X.current={x:he.clientX,y:he.clientY})))},onPointerUp:()=>{var he,Ve,vt;if(R||!Oe)return;X.current=null;const Nt=Number(((he=Te.current)==null?void 0:he.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),En=Number(((Ve=Te.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qe=new Date().getTime()-((vt=Ae.current)==null?void 0:vt.getTime()),$t=_==="x"?Nt:En,lr=Math.abs($t)/Qe;if(Math.abs($t)>=sE||lr>.11){ne(me.current),u.onDismiss==null||u.onDismiss.call(u,u),P(_==="x"?Nt>0?"right":"left":En>0?"down":"up"),ue(),ee(!0);return}else{var qt,Rt;(qt=Te.current)==null||qt.style.setProperty("--swipe-amount-x","0px"),(Rt=Te.current)==null||Rt.style.setProperty("--swipe-amount-y","0px")}F(!1),Z(!1),z(null)},onPointerMove:he=>{var Ve,vt,Nt;if(!X.current||!Oe||((Ve=window.getSelection())==null?void 0:Ve.toString().length)>0)return;const Qe=he.clientY-X.current.y,$t=he.clientX-X.current.x;var lr;const qt=(lr=e.swipeDirections)!=null?lr:iE(L);!_&&(Math.abs($t)>1||Math.abs(Qe)>1)&&z(Math.abs($t)>Math.abs(Qe)?"x":"y");let Rt={x:0,y:0};const La=hn=>1/(1.5+Math.abs(hn)/20);if(_==="y"){if(qt.includes("top")||qt.includes("bottom"))if(qt.includes("top")&&Qe<0||qt.includes("bottom")&&Qe>0)Rt.y=Qe;else{const hn=Qe*La(Qe);Rt.y=Math.abs(hn)<Math.abs(Qe)?hn:Qe}}else if(_==="x"&&(qt.includes("left")||qt.includes("right")))if(qt.includes("left")&&$t<0||qt.includes("right")&&$t>0)Rt.x=$t;else{const hn=$t*La($t);Rt.x=Math.abs(hn)<Math.abs($t)?hn:$t}(Math.abs(Rt.x)>0||Math.abs(Rt.y)>0)&&F(!0),(vt=Te.current)==null||vt.style.setProperty("--swipe-amount-x",`${Rt.x}px`),(Nt=Te.current)==null||Nt.style.setProperty("--swipe-amount-y",`${Rt.y}px`)}},Ot&&!u.jsx&&Le!=="loading"?Q.createElement("button",{"aria-label":C,"data-disabled":Se,"data-close-button":!0,onClick:Se||!Oe?()=>{}:()=>{ue(),u.onDismiss==null||u.onDismiss.call(u,u)},className:dr(D==null?void 0:D.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(bt=T==null?void 0:T.close)!=null?bt:VC):null,(Le||u.icon||u.promise)&&u.icon!==null&&((T==null?void 0:T[Le])!==null||u.icon)?Q.createElement("div",{"data-icon":"",className:dr(D==null?void 0:D.icon,u==null||(a=u.classNames)==null?void 0:a.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||Pe():null,u.type!=="loading"?_e:null):null,Q.createElement("div",{"data-content":"",className:dr(D==null?void 0:D.content,u==null||(i=u.classNames)==null?void 0:i.content)},Q.createElement("div",{"data-title":"",className:dr(D==null?void 0:D.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?Q.createElement("div",{"data-description":"",className:dr(U,Je,D==null?void 0:D.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),Q.isValidElement(u.cancel)?u.cancel:u.cancel&&xc(u.cancel)?Q.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||M,onClick:he=>{xc(u.cancel)&&Oe&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,he),ue())},className:dr(D==null?void 0:D.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,Q.isValidElement(u.action)?u.action:u.action&&xc(u.action)?Q.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||A,onClick:he=>{xc(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,he),!he.defaultPrevented&&ue())},className:dr(D==null?void 0:D.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function l0(){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 lE(e,t){const n={};return[e,t].forEach((r,a)=>{const i=a===1,o=i?"--mobile-offset":"--offset",l=i?tE:eE;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const cE=Q.forwardRef(function(t,n){const{id:r,invert:a,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:h,mobileOffset:u,theme:f="light",richColors:p,duration:w,style:v,visibleToasts:b=JC,toastOptions:g,dir:y=l0(),gap:x=rE,icons:N,containerAriaLabel:j="Notifications"}=t,[k,S]=Q.useState([]),M=Q.useMemo(()=>r?k.filter(B=>B.toasterId===r):k.filter(B=>!B.toasterId),[k,r]),A=Q.useMemo(()=>Array.from(new Set([i].concat(M.filter(B=>B.position).map(B=>B.position)))),[M,i]),[I,U]=Q.useState([]),[$,L]=Q.useState(!1),[E,O]=Q.useState(!1),[D,T]=Q.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),C=Q.useRef(null),_=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=Q.useRef(null),H=Q.useRef(!1),P=Q.useCallback(B=>{S(q=>{var G;return(G=q.find(se=>se.id===B.id))!=null&&G.delete||rn.dismiss(B.id),q.filter(({id:se})=>se!==B.id)})},[]);return Q.useEffect(()=>rn.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{S(q=>q.map(G=>G.id===B.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Rb.flushSync(()=>{S(q=>{const G=q.findIndex(se=>se.id===B.id);return G!==-1?[...q.slice(0,G),{...q[G],...B},...q.slice(G+1)]:[B,...q]})})})}),[k]),Q.useEffect(()=>{if(f!=="system"){T(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?T("dark"):T("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:q})=>{T(q?"dark":"light")})}catch{B.addListener(({matches:G})=>{try{T(G?"dark":"light")}catch(se){console.error(se)}})}},[f]),Q.useEffect(()=>{k.length<=1&&L(!1)},[k]),Q.useEffect(()=>{const B=q=>{var G;if(o.every(Z=>q[Z]||q.code===Z)){var re;L(!0),(re=C.current)==null||re.focus()}q.code==="Escape"&&(document.activeElement===C.current||(G=C.current)!=null&&G.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[o]),Q.useEffect(()=>{if(C.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,H.current=!1)}},[C.current]),Q.createElement("section",{ref:n,"aria-label":`${j} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((B,q)=>{var G;const[se,re]=B.split("-");return M.length?Q.createElement("ol",{key:B,dir:y==="auto"?l0():y,tabIndex:-1,ref:C,className:d,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":se,"data-x-position":re,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${nE}px`,"--gap":`${x}px`,...v,...lE(h,u)},onBlur:Z=>{H.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(H.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||H.current||(H.current=!0,z.current=Z.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{E||L(!1)},onDragEnd:()=>L(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},M.filter(Z=>!Z.position&&q===0||Z.position===B).map((Z,R)=>{var ee,J;return Q.createElement(oE,{key:Z.id,icons:N,index:R,toast:Z,defaultRichColors:p,duration:(ee=g==null?void 0:g.duration)!=null?ee:w,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:a,visibleToasts:b,closeButton:(J=g==null?void 0:g.closeButton)!=null?J: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:P,toasts:M.filter(F=>F.position==Z.position),heights:I.filter(F=>F.position==Z.position),setHeights:U,expandByDefault:l,gap:x,expanded:$,swipeDirections:t.swipeDirections})})):null}))});function Ct(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ct(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var dE={value:()=>{}};function Nu(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Qc(n)}function Qc(e){this._=e}function uE(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Qc.prototype=Nu.prototype={constructor:Qc,on:function(e,t){var n=this._,r=uE(e+"",n),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(e=r[i]).type)&&(a=hE(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(a=(e=r[i]).type)n[a]=c0(n[a],e.name,t);else if(t==null)for(a in n)n[a]=c0(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Qc(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,i;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};function hE(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function c0(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=dE,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var vm="http://www.w3.org/1999/xhtml";const d0={svg:"http://www.w3.org/2000/svg",xhtml:vm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ju(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),d0.hasOwnProperty(t)?{space:d0[t],local:e}:e}function fE(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===vm&&t.documentElement.namespaceURI===vm?t.createElement(e):t.createElementNS(n,e)}}function mE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Kb(e){var t=ju(e);return(t.local?mE:fE)(t)}function pE(){}function Gp(e){return e==null?pE:function(){return this.querySelector(e)}}function xE(e){typeof e!="function"&&(e=Gp(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=new Array(o),c,d,h=0;h<o;++h)(c=i[h])&&(d=e.call(c,c.__data__,h,i))&&("__data__"in c&&(d.__data__=c.__data__),l[h]=d);return new Nn(r,this._parents)}function gE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function vE(){return[]}function Qb(e){return e==null?vE:function(){return this.querySelectorAll(e)}}function wE(e){return function(){return gE(e.apply(this,arguments))}}function yE(e){typeof e=="function"?e=wE(e):e=Qb(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var o=t[i],l=o.length,c,d=0;d<l;++d)(c=o[d])&&(r.push(e.call(c,c.__data__,d,o)),a.push(c));return new Nn(r,a)}function Zb(e){return function(){return this.matches(e)}}function Jb(e){return function(t){return t.matches(e)}}var bE=Array.prototype.find;function NE(e){return function(){return bE.call(this.children,e)}}function jE(){return this.firstElementChild}function kE(e){return this.select(e==null?jE:NE(typeof e=="function"?e:Jb(e)))}var SE=Array.prototype.filter;function CE(){return Array.from(this.children)}function EE(e){return function(){return SE.call(this.children,e)}}function ME(e){return this.selectAll(e==null?CE:EE(typeof e=="function"?e:Jb(e)))}function _E(e){typeof e!="function"&&(e=Zb(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=[],c,d=0;d<o;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&l.push(c);return new Nn(r,this._parents)}function e1(e){return new Array(e.length)}function DE(){return new Nn(this._enter||this._groups.map(e1),this._parents)}function Ad(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ad.prototype={constructor:Ad,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 TE(e){return function(){return e}}function PE(e,t,n,r,a,i){for(var o=0,l,c=t.length,d=i.length;o<d;++o)(l=t[o])?(l.__data__=i[o],r[o]=l):n[o]=new Ad(e,i[o]);for(;o<c;++o)(l=t[o])&&(a[o]=l)}function AE(e,t,n,r,a,i,o){var l,c,d=new Map,h=t.length,u=i.length,f=new Array(h),p;for(l=0;l<h;++l)(c=t[l])&&(f[l]=p=o.call(c,c.__data__,l,t)+"",d.has(p)?a[l]=c:d.set(p,c));for(l=0;l<u;++l)p=o.call(e,i[l],l,i)+"",(c=d.get(p))?(r[l]=c,c.__data__=i[l],d.delete(p)):n[l]=new Ad(e,i[l]);for(l=0;l<h;++l)(c=t[l])&&d.get(f[l])===c&&(a[l]=c)}function OE(e){return e.__data__}function zE(e,t){if(!arguments.length)return Array.from(this,OE);var n=t?AE:PE,r=this._parents,a=this._groups;typeof e!="function"&&(e=TE(e));for(var i=a.length,o=new Array(i),l=new Array(i),c=new Array(i),d=0;d<i;++d){var h=r[d],u=a[d],f=u.length,p=$E(e.call(h,h&&h.__data__,d,r)),w=p.length,v=l[d]=new Array(w),b=o[d]=new Array(w),g=c[d]=new Array(f);n(h,u,v,b,g,p,t);for(var y=0,x=0,N,j;y<w;++y)if(N=v[y]){for(y>=x&&(x=y+1);!(j=b[x])&&++x<w;);N._next=j||null}}return o=new Nn(o,r),o._enter=l,o._exit=c,o}function $E(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function RE(){return new Nn(this._exit||this._groups.map(e1),this._parents)}function IE(e,t,n){var r=this.enter(),a=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),r&&a?r.merge(a).order():a}function LE(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,o=Math.min(a,i),l=new Array(a),c=0;c<o;++c)for(var d=n[c],h=r[c],u=d.length,f=l[c]=new Array(u),p,w=0;w<u;++w)(p=d[w]||h[w])&&(f[w]=p);for(;c<a;++c)l[c]=n[c];return new Nn(l,this._parents)}function FE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,i=r[a],o;--a>=0;)(o=r[a])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function UE(e){e||(e=BE);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!f}for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o=n[i],l=o.length,c=a[i]=new Array(l),d,h=0;h<l;++h)(d=o[h])&&(c[h]=d);c.sort(t)}return new Nn(a,this._parents).order()}function BE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function WE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function HE(){return Array.from(this)}function VE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null}function YE(){let e=0;for(const t of this)++e;return e}function XE(){return!this.node()}function qE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],i=0,o=a.length,l;i<o;++i)(l=a[i])&&e.call(l,l.__data__,i,a);return this}function GE(e){return function(){this.removeAttribute(e)}}function KE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function QE(e,t){return function(){this.setAttribute(e,t)}}function ZE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function JE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function e3(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 t3(e,t){var n=ju(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?KE:GE:typeof t=="function"?n.local?e3:JE:n.local?ZE:QE)(n,t))}function t1(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function n3(e){return function(){this.style.removeProperty(e)}}function r3(e,t,n){return function(){this.style.setProperty(e,t,n)}}function s3(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function a3(e,t,n){return arguments.length>1?this.each((t==null?n3:typeof t=="function"?s3:r3)(e,t,n??"")):Pi(this.node(),e)}function Pi(e,t){return e.style.getPropertyValue(t)||t1(e).getComputedStyle(e,null).getPropertyValue(t)}function i3(e){return function(){delete this[e]}}function o3(e,t){return function(){this[e]=t}}function l3(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function c3(e,t){return arguments.length>1?this.each((t==null?i3:typeof t=="function"?l3:o3)(e,t)):this.node()[e]}function n1(e){return e.trim().split(/^|\s+/)}function Kp(e){return e.classList||new r1(e)}function r1(e){this._node=e,this._names=n1(e.getAttribute("class")||"")}r1.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 s1(e,t){for(var n=Kp(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function a1(e,t){for(var n=Kp(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function d3(e){return function(){s1(this,e)}}function u3(e){return function(){a1(this,e)}}function h3(e,t){return function(){(t.apply(this,arguments)?s1:a1)(this,e)}}function f3(e,t){var n=n1(e+"");if(arguments.length<2){for(var r=Kp(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?h3:t?d3:u3)(n,t))}function m3(){this.textContent=""}function p3(e){return function(){this.textContent=e}}function x3(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function g3(e){return arguments.length?this.each(e==null?m3:(typeof e=="function"?x3:p3)(e)):this.node().textContent}function v3(){this.innerHTML=""}function w3(e){return function(){this.innerHTML=e}}function y3(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function b3(e){return arguments.length?this.each(e==null?v3:(typeof e=="function"?y3:w3)(e)):this.node().innerHTML}function N3(){this.nextSibling&&this.parentNode.appendChild(this)}function j3(){return this.each(N3)}function k3(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function S3(){return this.each(k3)}function C3(e){var t=typeof e=="function"?e:Kb(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function E3(){return null}function M3(e,t){var n=typeof e=="function"?e:Kb(e),r=t==null?E3:typeof t=="function"?t:Gp(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _3(){var e=this.parentNode;e&&e.removeChild(this)}function D3(){return this.each(_3)}function T3(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function P3(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function A3(e){return this.select(e?P3:T3)}function O3(e){return arguments.length?this.property("__data__",e):this.node().__data__}function z3(e){return function(t){e.call(this,t,this.__data__)}}function $3(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function R3(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function I3(e,t,n){return function(){var r=this.__on,a,i=z3(t);if(r){for(var o=0,l=r.length;o<l;++o)if((a=r[o]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(a):this.__on=[a]}}function L3(e,t,n){var r=$3(e+""),a,i=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,d=l.length,h;c<d;++c)for(a=0,h=l[c];a<i;++a)if((o=r[a]).type===h.type&&o.name===h.name)return h.value}return}for(l=t?I3:R3,a=0;a<i;++a)this.each(l(r[a],t,n));return this}function i1(e,t,n){var r=t1(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function F3(e,t){return function(){return i1(this,e,t)}}function U3(e,t){return function(){return i1(this,e,t.apply(this,arguments))}}function B3(e,t){return this.each((typeof t=="function"?U3:F3)(e,t))}function*W3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length,o;a<i;++a)(o=r[a])&&(yield o)}var o1=[null];function Nn(e,t){this._groups=e,this._parents=t}function Pl(){return new Nn([[document.documentElement]],o1)}function H3(){return this}Nn.prototype=Pl.prototype={constructor:Nn,select:xE,selectAll:yE,selectChild:kE,selectChildren:ME,filter:_E,data:zE,enter:DE,exit:RE,join:IE,merge:LE,selection:H3,order:FE,sort:UE,call:WE,nodes:HE,node:VE,size:YE,empty:XE,each:qE,attr:t3,style:a3,property:c3,classed:f3,text:g3,html:b3,raise:j3,lower:S3,append:C3,insert:M3,remove:D3,clone:A3,datum:O3,on:L3,dispatch:B3,[Symbol.iterator]:W3};function gn(e){return typeof e=="string"?new Nn([[document.querySelector(e)]],[document.documentElement]):new Nn([[e]],o1)}function V3(e){let t;for(;t=e.sourceEvent;)e=t;return e}function qn(e,t){if(e=V3(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const Y3={passive:!1},ul={capture:!0,passive:!1};function Rh(e){e.stopImmediatePropagation()}function wi(e){e.preventDefault(),e.stopImmediatePropagation()}function l1(e){var t=e.document.documentElement,n=gn(e).on("dragstart.drag",wi,ul);"onselectstart"in t?n.on("selectstart.drag",wi,ul):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function c1(e,t){var n=e.document.documentElement,r=gn(e).on("dragstart.drag",null);t&&(r.on("click.drag",wi,ul),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const gc=e=>()=>e;function wm(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:i,x:o,y:l,dx:c,dy:d,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:r,enumerable:!0,configurable:!0},identifier:{value:a,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:d,enumerable:!0,configurable:!0},_:{value:h}})}wm.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function X3(e){return!e.ctrlKey&&!e.button}function q3(){return this.parentNode}function G3(e,t){return t??{x:e.x,y:e.y}}function K3(){return navigator.maxTouchPoints||"ontouchstart"in this}function d1(){var e=X3,t=q3,n=G3,r=K3,a={},i=Nu("start","drag","end"),o=0,l,c,d,h,u=0;function f(N){N.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",g,Y3).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(N,j){if(!(h||!e.call(this,N,j))){var k=x(this,t.call(this,N,j),N,j,"mouse");k&&(gn(N.view).on("mousemove.drag",w,ul).on("mouseup.drag",v,ul),l1(N.view),Rh(N),d=!1,l=N.clientX,c=N.clientY,k("start",N))}}function w(N){if(wi(N),!d){var j=N.clientX-l,k=N.clientY-c;d=j*j+k*k>u}a.mouse("drag",N)}function v(N){gn(N.view).on("mousemove.drag mouseup.drag",null),c1(N.view,d),wi(N),a.mouse("end",N)}function b(N,j){if(e.call(this,N,j)){var k=N.changedTouches,S=t.call(this,N,j),M=k.length,A,I;for(A=0;A<M;++A)(I=x(this,S,N,j,k[A].identifier,k[A]))&&(Rh(N),I("start",N,k[A]))}}function g(N){var j=N.changedTouches,k=j.length,S,M;for(S=0;S<k;++S)(M=a[j[S].identifier])&&(wi(N),M("drag",N,j[S]))}function y(N){var j=N.changedTouches,k=j.length,S,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),S=0;S<k;++S)(M=a[j[S].identifier])&&(Rh(N),M("end",N,j[S]))}function x(N,j,k,S,M,A){var I=i.copy(),U=qn(A||k,j),$,L,E;if((E=n.call(N,new wm("beforestart",{sourceEvent:k,target:f,identifier:M,active:o,x:U[0],y:U[1],dx:0,dy:0,dispatch:I}),S))!=null)return $=E.x-U[0]||0,L=E.y-U[1]||0,function O(D,T,C){var _=U,z;switch(D){case"start":a[M]=O,z=o++;break;case"end":delete a[M],--o;case"drag":U=qn(C||T,j),z=o;break}I.call(D,N,new wm(D,{sourceEvent:T,subject:E,target:f,identifier:M,active:z,x:U[0]+$,y:U[1]+L,dx:U[0]-_[0],dy:U[1]-_[1],dispatch:I}),S)}}return f.filter=function(N){return arguments.length?(e=typeof N=="function"?N:gc(!!N),f):e},f.container=function(N){return arguments.length?(t=typeof N=="function"?N:gc(N),f):t},f.subject=function(N){return arguments.length?(n=typeof N=="function"?N:gc(N),f):n},f.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:gc(!!N),f):r},f.on=function(){var N=i.on.apply(i,arguments);return N===i?f:N},f.clickDistance=function(N){return arguments.length?(u=(N=+N)*N,f):Math.sqrt(u)},f}function Qp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function u1(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Al(){}var hl=.7,Od=1/hl,yi="\\s*([+-]?\\d+)\\s*",fl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q3=/^#([0-9a-f]{3,8})$/,Z3=new RegExp(`^rgb\\(${yi},${yi},${yi}\\)$`),J3=new RegExp(`^rgb\\(${kr},${kr},${kr}\\)$`),e5=new RegExp(`^rgba\\(${yi},${yi},${yi},${fl}\\)$`),t5=new RegExp(`^rgba\\(${kr},${kr},${kr},${fl}\\)$`),n5=new RegExp(`^hsl\\(${fl},${kr},${kr}\\)$`),r5=new RegExp(`^hsla\\(${fl},${kr},${kr},${fl}\\)$`),u0={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};Qp(Al,ja,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:h0,formatHex:h0,formatHex8:s5,formatHsl:a5,formatRgb:f0,toString:f0});function h0(){return this.rgb().formatHex()}function s5(){return this.rgb().formatHex8()}function a5(){return h1(this).formatHsl()}function f0(){return this.rgb().formatRgb()}function ja(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Q3.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?m0(t):n===3?new ln(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vc(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=Z3.exec(e))?new ln(t[1],t[2],t[3],1):(t=J3.exec(e))?new ln(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=e5.exec(e))?vc(t[1],t[2],t[3],t[4]):(t=t5.exec(e))?vc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=n5.exec(e))?g0(t[1],t[2]/100,t[3]/100,1):(t=r5.exec(e))?g0(t[1],t[2]/100,t[3]/100,t[4]):u0.hasOwnProperty(e)?m0(u0[e]):e==="transparent"?new ln(NaN,NaN,NaN,0):null}function m0(e){return new ln(e>>16&255,e>>8&255,e&255,1)}function vc(e,t,n,r){return r<=0&&(e=t=n=NaN),new ln(e,t,n,r)}function i5(e){return e instanceof Al||(e=ja(e)),e?(e=e.rgb(),new ln(e.r,e.g,e.b,e.opacity)):new ln}function ym(e,t,n,r){return arguments.length===1?i5(e):new ln(e,t,n,r??1)}function ln(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Qp(ln,ym,u1(Al,{brighter(e){return e=e==null?Od:Math.pow(Od,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?hl:Math.pow(hl,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ln(ha(this.r),ha(this.g),ha(this.b),zd(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:p0,formatHex:p0,formatHex8:o5,formatRgb:x0,toString:x0}));function p0(){return`#${oa(this.r)}${oa(this.g)}${oa(this.b)}`}function o5(){return`#${oa(this.r)}${oa(this.g)}${oa(this.b)}${oa((isNaN(this.opacity)?1:this.opacity)*255)}`}function x0(){const e=zd(this.opacity);return`${e===1?"rgb(":"rgba("}${ha(this.r)}, ${ha(this.g)}, ${ha(this.b)}${e===1?")":`, ${e})`}`}function zd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ha(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function oa(e){return e=ha(e),(e<16?"0":"")+e.toString(16)}function g0(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function h1(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof Al||(e=ja(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(n-r)/l+(n<r)*6:n===i?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new Kn(o,l,c,e.opacity)}function l5(e,t,n,r){return arguments.length===1?h1(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qp(Kn,l5,u1(Al,{brighter(e){return e=e==null?Od:Math.pow(Od,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?hl:Math.pow(hl,e),new Kn(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,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new ln(Ih(e>=240?e-240:e+120,a,r),Ih(e,a,r),Ih(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(v0(this.h),wc(this.s),wc(this.l),zd(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=zd(this.opacity);return`${e===1?"hsl(":"hsla("}${v0(this.h)}, ${wc(this.s)*100}%, ${wc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function v0(e){return e=(e||0)%360,e<0?e+360:e}function wc(e){return Math.max(0,Math.min(1,e||0))}function Ih(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 Zp=e=>()=>e;function c5(e,t){return function(n){return e+n*t}}function d5(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function u5(e){return(e=+e)==1?f1:function(t,n){return n-t?d5(t,n,e):Zp(isNaN(t)?n:t)}}function f1(e,t){var n=t-e;return n?c5(e,n):Zp(isNaN(e)?t:e)}const $d=function e(t){var n=u5(t);function r(a,i){var o=n((a=ym(a)).r,(i=ym(i)).r),l=n(a.g,i.g),c=n(a.b,i.b),d=f1(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=l(h),a.b=c(h),a.opacity=d(h),a+""}}return r.gamma=e,r}(1);function h5(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function f5(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function m5(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=Wo(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(l){for(o=0;o<r;++o)i[o]=a[o](l);return i}}function p5(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function x5(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Wo(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var bm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Lh=new RegExp(bm.source,"g");function g5(e){return function(){return e}}function v5(e){return function(t){return e(t)+""}}function m1(e,t){var n=bm.lastIndex=Lh.lastIndex=0,r,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=bm.exec(e))&&(a=Lh.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(r=r[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:xr(r,a)})),n=Lh.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?v5(c[0].x):g5(t):(t=c.length,function(d){for(var h=0,u;h<t;++h)l[(u=c[h]).i]=u.x(d);return l.join("")})}function Wo(e,t){var n=typeof t,r;return t==null||n==="boolean"?Zp(t):(n==="number"?xr:n==="string"?(r=ja(t))?(t=r,$d):m1:t instanceof ja?$d:t instanceof Date?p5:f5(t)?h5:Array.isArray(t)?m5:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?x5:xr)(e,t)}var w0=180/Math.PI,Nm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function p1(e,t,n,r,a,i){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*w0,skewX:Math.atan(c)*w0,scaleX:o,scaleY:l}}var yc;function w5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Nm:p1(t.a,t.b,t.c,t.d,t.e,t.f)}function y5(e){return e==null||(yc||(yc=document.createElementNS("http://www.w3.org/2000/svg","g")),yc.setAttribute("transform",e),!(e=yc.transform.baseVal.consolidate()))?Nm:(e=e.matrix,p1(e.a,e.b,e.c,e.d,e.e,e.f))}function x1(e,t,n,r){function a(d){return d.length?d.pop()+" ":""}function i(d,h,u,f,p,w){if(d!==u||h!==f){var v=p.push("translate(",null,t,null,n);w.push({i:v-4,x:xr(d,u)},{i:v-2,x:xr(h,f)})}else(u||f)&&p.push("translate("+u+t+f+n)}function o(d,h,u,f){d!==h?(d-h>180?h+=360:h-d>180&&(d+=360),f.push({i:u.push(a(u)+"rotate(",null,r)-2,x:xr(d,h)})):h&&u.push(a(u)+"rotate("+h+r)}function l(d,h,u,f){d!==h?f.push({i:u.push(a(u)+"skewX(",null,r)-2,x:xr(d,h)}):h&&u.push(a(u)+"skewX("+h+r)}function c(d,h,u,f,p,w){if(d!==u||h!==f){var v=p.push(a(p)+"scale(",null,",",null,")");w.push({i:v-4,x:xr(d,u)},{i:v-2,x:xr(h,f)})}else(u!==1||f!==1)&&p.push(a(p)+"scale("+u+","+f+")")}return function(d,h){var u=[],f=[];return d=e(d),h=e(h),i(d.translateX,d.translateY,h.translateX,h.translateY,u,f),o(d.rotate,h.rotate,u,f),l(d.skewX,h.skewX,u,f),c(d.scaleX,d.scaleY,h.scaleX,h.scaleY,u,f),d=h=null,function(p){for(var w=-1,v=f.length,b;++w<v;)u[(b=f[w]).i]=b.x(p);return u.join("")}}}var b5=x1(w5,"px, ","px)","deg)"),N5=x1(y5,", ",")",")"),j5=1e-12;function y0(e){return((e=Math.exp(e))+1/e)/2}function k5(e){return((e=Math.exp(e))-1/e)/2}function S5(e){return((e=Math.exp(2*e))-1)/(e+1)}const Zc=function e(t,n,r){function a(i,o){var l=i[0],c=i[1],d=i[2],h=o[0],u=o[1],f=o[2],p=h-l,w=u-c,v=p*p+w*w,b,g;if(v<j5)g=Math.log(f/d)/t,b=function(S){return[l+S*p,c+S*w,d*Math.exp(t*S*g)]};else{var y=Math.sqrt(v),x=(f*f-d*d+r*v)/(2*d*n*y),N=(f*f-d*d-r*v)/(2*f*n*y),j=Math.log(Math.sqrt(x*x+1)-x),k=Math.log(Math.sqrt(N*N+1)-N);g=(k-j)/t,b=function(S){var M=S*g,A=y0(j),I=d/(n*y)*(A*S5(t*M+j)-k5(j));return[l+I*p,c+I*w,d*A/y0(t*M+j)]}}return b.duration=g*1e3*t/Math.SQRT2,b}return a.rho=function(i){var o=Math.max(.001,+i),l=o*o,c=l*l;return e(o,l,c)},a}(Math.SQRT2,2,4);var Ai=0,To=0,po=0,g1=1e3,Rd,Po,Id=0,ka=0,ku=0,ml=typeof performance=="object"&&performance.now?performance:Date,v1=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Jp(){return ka||(v1(C5),ka=ml.now()+ku)}function C5(){ka=0}function Ld(){this._call=this._time=this._next=null}Ld.prototype=w1.prototype={constructor:Ld,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Jp():+n)+(t==null?0:+t),!this._next&&Po!==this&&(Po?Po._next=this:Rd=this,Po=this),this._call=e,this._time=n,jm()},stop:function(){this._call&&(this._call=null,this._time=1/0,jm())}};function w1(e,t,n){var r=new Ld;return r.restart(e,t,n),r}function E5(){Jp(),++Ai;for(var e=Rd,t;e;)(t=ka-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ai}function b0(){ka=(Id=ml.now())+ku,Ai=To=0;try{E5()}finally{Ai=0,_5(),ka=0}}function M5(){var e=ml.now(),t=e-Id;t>g1&&(ku-=t,Id=e)}function _5(){for(var e,t=Rd,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Rd=n);Po=e,jm(r)}function jm(e){if(!Ai){To&&(To=clearTimeout(To));var t=e-ka;t>24?(e<1/0&&(To=setTimeout(b0,e-ml.now()-ku)),po&&(po=clearInterval(po))):(po||(Id=ml.now(),po=setInterval(M5,g1)),Ai=1,v1(b0))}}function N0(e,t,n){var r=new Ld;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var D5=Nu("start","end","cancel","interrupt"),T5=[],y1=0,j0=1,km=2,Jc=3,k0=4,Sm=5,ed=6;function Su(e,t,n,r,a,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;P5(e,n,{name:t,index:r,group:a,on:D5,tween:T5,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:y1})}function ex(e,t){var n=ir(e,t);if(n.state>y1)throw new Error("too late; already scheduled");return n}function _r(e,t){var n=ir(e,t);if(n.state>Jc)throw new Error("too late; already running");return n}function ir(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function P5(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=w1(i,0,n.time);function i(d){n.state=j0,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var h,u,f,p;if(n.state!==j0)return c();for(h in r)if(p=r[h],p.name===n.name){if(p.state===Jc)return N0(o);p.state===k0?(p.state=ed,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[h]):+h<t&&(p.state=ed,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[h])}if(N0(function(){n.state===Jc&&(n.state=k0,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=km,n.on.call("start",e,e.__data__,n.index,n.group),n.state===km){for(n.state=Jc,a=new Array(f=n.tween.length),h=0,u=-1;h<f;++h)(p=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(a[++u]=p);a.length=u+1}}function l(d){for(var h=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=Sm,1),u=-1,f=a.length;++u<f;)a[u].call(e,h);n.state===Sm&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=ed,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function td(e,t){var n=e.__transition,r,a,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}a=r.state>km&&r.state<Sm,r.state=ed,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function A5(e){return this.each(function(){td(this,e)})}function O5(e,t){var n,r;return function(){var a=_r(this,e),i=a.tween;if(i!==n){r=n=i;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}a.tween=r}}function z5(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=_r(this,e),o=i.tween;if(o!==r){a=(r=o).slice();for(var l={name:t,value:n},c=0,d=a.length;c<d;++c)if(a[c].name===t){a[c]=l;break}c===d&&a.push(l)}i.tween=a}}function $5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ir(this.node(),n).tween,a=0,i=r.length,o;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((t==null?O5:z5)(n,e,t))}function tx(e,t,n){var r=e._id;return e.each(function(){var a=_r(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ir(a,r).value[t]}}function b1(e,t){var n;return(typeof t=="number"?xr:t instanceof ja?$d:(n=ja(t))?(t=n,$d):m1)(e,t)}function R5(e){return function(){this.removeAttribute(e)}}function I5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function L5(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}}function F5(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}function U5(e,t,n){var r,a,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===r&&c===a?i:(a=c,i=t(r=o,l)))}}function B5(e,t,n){var r,a,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===r&&c===a?i:(a=c,i=t(r=o,l)))}}function W5(e,t){var n=ju(e),r=n==="transform"?N5:b1;return this.attrTween(e,typeof t=="function"?(n.local?B5:U5)(n,r,tx(this,"attr."+e,t)):t==null?(n.local?I5:R5)(n):(n.local?F5:L5)(n,r,t))}function H5(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function V5(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Y5(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&V5(e,i)),n}return a._value=t,a}function X5(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&H5(e,i)),n}return a._value=t,a}function q5(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 r=ju(e);return this.tween(n,(r.local?Y5:X5)(r,t))}function G5(e,t){return function(){ex(this,e).delay=+t.apply(this,arguments)}}function K5(e,t){return t=+t,function(){ex(this,e).delay=t}}function Q5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?G5:K5)(t,e)):ir(this.node(),t).delay}function Z5(e,t){return function(){_r(this,e).duration=+t.apply(this,arguments)}}function J5(e,t){return t=+t,function(){_r(this,e).duration=t}}function eM(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Z5:J5)(t,e)):ir(this.node(),t).duration}function tM(e,t){if(typeof t!="function")throw new Error;return function(){_r(this,e).ease=t}}function nM(e){var t=this._id;return arguments.length?this.each(tM(t,e)):ir(this.node(),t).ease}function rM(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;_r(this,e).ease=n}}function sM(e){if(typeof e!="function")throw new Error;return this.each(rM(this._id,e))}function aM(e){typeof e!="function"&&(e=Zb(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=[],c,d=0;d<o;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&l.push(c);return new Zr(r,this._parents,this._name,this._id)}function iM(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),o=new Array(r),l=0;l<i;++l)for(var c=t[l],d=n[l],h=c.length,u=o[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||d[p])&&(u[p]=f);for(;l<r;++l)o[l]=t[l];return new Zr(o,this._parents,this._name,this._id)}function oM(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 lM(e,t,n){var r,a,i=oM(t)?ex:_r;return function(){var o=i(this,e),l=o.on;l!==r&&(a=(r=l).copy()).on(t,n),o.on=a}}function cM(e,t){var n=this._id;return arguments.length<2?ir(this.node(),n).on.on(e):this.each(lM(n,e,t))}function dM(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function uM(){return this.on("end.remove",dM(this._id))}function hM(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Gp(e));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var l=r[o],c=l.length,d=i[o]=new Array(c),h,u,f=0;f<c;++f)(h=l[f])&&(u=e.call(h,h.__data__,f,l))&&("__data__"in h&&(u.__data__=h.__data__),d[f]=u,Su(d[f],t,n,f,d,ir(h,n)));return new Zr(i,this._parents,t,n)}function fM(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Qb(e));for(var r=this._groups,a=r.length,i=[],o=[],l=0;l<a;++l)for(var c=r[l],d=c.length,h,u=0;u<d;++u)if(h=c[u]){for(var f=e.call(h,h.__data__,u,c),p,w=ir(h,n),v=0,b=f.length;v<b;++v)(p=f[v])&&Su(p,t,n,v,f,w);i.push(f),o.push(h)}return new Zr(i,o,t,n)}var mM=Pl.prototype.constructor;function pM(){return new mM(this._groups,this._parents)}function xM(e,t){var n,r,a;return function(){var i=Pi(this,e),o=(this.style.removeProperty(e),Pi(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}function N1(e){return function(){this.style.removeProperty(e)}}function gM(e,t,n){var r,a=n+"",i;return function(){var o=Pi(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}function vM(e,t,n){var r,a,i;return function(){var o=Pi(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Pi(this,e))),o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,l))}}function wM(e,t){var n,r,a,i="style."+t,o="end."+i,l;return function(){var c=_r(this,e),d=c.on,h=c.value[i]==null?l||(l=N1(t)):void 0;(d!==n||a!==h)&&(r=(n=d).copy()).on(o,a=h),c.on=r}}function yM(e,t,n){var r=(e+="")=="transform"?b5:b1;return t==null?this.styleTween(e,xM(e,r)).on("end.style."+e,N1(e)):typeof t=="function"?this.styleTween(e,vM(e,r,tx(this,"style."+e,t))).each(wM(this._id,e)):this.styleTween(e,gM(e,r,t),n).on("end.style."+e,null)}function bM(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function NM(e,t,n){var r,a;function i(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&bM(e,o,n)),r}return i._value=t,i}function jM(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,NM(e,t,n??""))}function kM(e){return function(){this.textContent=e}}function SM(e){return function(){var t=e(this);this.textContent=t??""}}function CM(e){return this.tween("text",typeof e=="function"?SM(tx(this,"text",e)):kM(e==null?"":e+""))}function EM(e){return function(t){this.textContent=e.call(this,t)}}function MM(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&EM(a)),t}return r._value=e,r}function _M(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,MM(e))}function DM(){for(var e=this._name,t=this._id,n=j1(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],l=o.length,c,d=0;d<l;++d)if(c=o[d]){var h=ir(c,t);Su(c,e,n,d,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Zr(r,this._parents,e,n)}function TM(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,o){var l={value:o},c={value:function(){--a===0&&i()}};n.each(function(){var d=_r(this,r),h=d.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),d.on=t}),a===0&&i()})}var PM=0;function Zr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function j1(){return++PM}var Or=Pl.prototype;Zr.prototype={constructor:Zr,select:hM,selectAll:fM,selectChild:Or.selectChild,selectChildren:Or.selectChildren,filter:aM,merge:iM,selection:pM,transition:DM,call:Or.call,nodes:Or.nodes,node:Or.node,size:Or.size,empty:Or.empty,each:Or.each,on:cM,attr:W5,attrTween:q5,style:yM,styleTween:jM,text:CM,textTween:_M,remove:uM,tween:$5,delay:Q5,duration:eM,ease:nM,easeVarying:sM,end:TM,[Symbol.iterator]:Or[Symbol.iterator]};function AM(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var OM={time:null,delay:0,duration:250,ease:AM};function zM(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 $M(e){var t,n;e instanceof Zr?(t=e._id,e=e._name):(t=j1(),(n=OM).time=Jp(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],l=o.length,c,d=0;d<l;++d)(c=o[d])&&Su(c,e,t,d,o,n||zM(c,t));return new Zr(r,this._parents,e,t)}Pl.prototype.interrupt=A5;Pl.prototype.transition=$M;const bc=e=>()=>e;function RM(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){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:r,enumerable:!0,configurable:!0},_:{value:a}})}function Ur(e,t,n){this.k=e,this.x=t,this.y=n}Ur.prototype={constructor:Ur,scale:function(e){return e===1?this:new Ur(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ur(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 Cu=new Ur(1,0,0);k1.prototype=Ur.prototype;function k1(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Cu;return e.__zoom}function Fh(e){e.stopImmediatePropagation()}function xo(e){e.preventDefault(),e.stopImmediatePropagation()}function IM(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function LM(){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 S0(){return this.__zoom||Cu}function FM(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UM(){return navigator.maxTouchPoints||"ontouchstart"in this}function BM(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=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(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function S1(){var e=IM,t=LM,n=BM,r=FM,a=UM,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Zc,d=Nu("start","zoom","end"),h,u,f,p=500,w=150,v=0,b=10;function g(E){E.property("__zoom",S0).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",I).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(E,O,D,T){var C=E.selection?E.selection():E;C.property("__zoom",S0),E!==C?j(E,O,D,T):C.interrupt().each(function(){k(this,arguments).event(T).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},g.scaleBy=function(E,O,D,T){g.scaleTo(E,function(){var C=this.__zoom.k,_=typeof O=="function"?O.apply(this,arguments):O;return C*_},D,T)},g.scaleTo=function(E,O,D,T){g.transform(E,function(){var C=t.apply(this,arguments),_=this.__zoom,z=D==null?N(C):typeof D=="function"?D.apply(this,arguments):D,H=_.invert(z),P=typeof O=="function"?O.apply(this,arguments):O;return n(x(y(_,P),z,H),C,o)},D,T)},g.translateBy=function(E,O,D,T){g.transform(E,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,T)},g.translateTo=function(E,O,D,T,C){g.transform(E,function(){var _=t.apply(this,arguments),z=this.__zoom,H=T==null?N(_):typeof T=="function"?T.apply(this,arguments):T;return n(Cu.translate(H[0],H[1]).scale(z.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof D=="function"?-D.apply(this,arguments):-D),_,o)},T,C)};function y(E,O){return O=Math.max(i[0],Math.min(i[1],O)),O===E.k?E:new Ur(O,E.x,E.y)}function x(E,O,D){var T=O[0]-D[0]*E.k,C=O[1]-D[1]*E.k;return T===E.x&&C===E.y?E:new Ur(E.k,T,C)}function N(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function j(E,O,D,T){E.on("start.zoom",function(){k(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(T).end()}).tween("zoom",function(){var C=this,_=arguments,z=k(C,_).event(T),H=t.apply(C,_),P=D==null?N(H):typeof D=="function"?D.apply(C,_):D,B=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),q=C.__zoom,G=typeof O=="function"?O.apply(C,_):O,se=c(q.invert(P).concat(B/q.k),G.invert(P).concat(B/G.k));return function(re){if(re===1)re=G;else{var Z=se(re),R=B/Z[2];re=new Ur(R,P[0]-Z[0]*R,P[1]-Z[1]*R)}z.zoom(null,re)}})}function k(E,O,D){return!D&&E.__zooming||new S(E,O)}function S(E,O){this.that=E,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,O),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,O){return this.mouse&&E!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var O=gn(this.that).datum();d.call(E,this.that,new RM(E,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),O)}};function M(E,...O){if(!e.apply(this,arguments))return;var D=k(this,O).event(E),T=this.__zoom,C=Math.max(i[0],Math.min(i[1],T.k*Math.pow(2,r.apply(this,arguments)))),_=qn(E);if(D.wheel)(D.mouse[0][0]!==_[0]||D.mouse[0][1]!==_[1])&&(D.mouse[1]=T.invert(D.mouse[0]=_)),clearTimeout(D.wheel);else{if(T.k===C)return;D.mouse=[_,T.invert(_)],td(this),D.start()}xo(E),D.wheel=setTimeout(z,w),D.zoom("mouse",n(x(y(T,C),D.mouse[0],D.mouse[1]),D.extent,o));function z(){D.wheel=null,D.end()}}function A(E,...O){if(f||!e.apply(this,arguments))return;var D=E.currentTarget,T=k(this,O,!0).event(E),C=gn(E.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",B,!0),_=qn(E,D),z=E.clientX,H=E.clientY;l1(E.view),Fh(E),T.mouse=[_,this.__zoom.invert(_)],td(this),T.start();function P(q){if(xo(q),!T.moved){var G=q.clientX-z,se=q.clientY-H;T.moved=G*G+se*se>v}T.event(q).zoom("mouse",n(x(T.that.__zoom,T.mouse[0]=qn(q,D),T.mouse[1]),T.extent,o))}function B(q){C.on("mousemove.zoom mouseup.zoom",null),c1(q.view,T.moved),xo(q),T.event(q).end()}}function I(E,...O){if(e.apply(this,arguments)){var D=this.__zoom,T=qn(E.changedTouches?E.changedTouches[0]:E,this),C=D.invert(T),_=D.k*(E.shiftKey?.5:2),z=n(x(y(D,_),T,C),t.apply(this,O),o);xo(E),l>0?gn(this).transition().duration(l).call(j,z,T,E):gn(this).call(g.transform,z,T,E)}}function U(E,...O){if(e.apply(this,arguments)){var D=E.touches,T=D.length,C=k(this,O,E.changedTouches.length===T).event(E),_,z,H,P;for(Fh(E),z=0;z<T;++z)H=D[z],P=qn(H,this),P=[P,this.__zoom.invert(P),H.identifier],C.touch0?!C.touch1&&C.touch0[2]!==P[2]&&(C.touch1=P,C.taps=0):(C.touch0=P,_=!0,C.taps=1+!!h);h&&(h=clearTimeout(h)),_&&(C.taps<2&&(u=P[0],h=setTimeout(function(){h=null},p)),td(this),C.start())}}function $(E,...O){if(this.__zooming){var D=k(this,O).event(E),T=E.changedTouches,C=T.length,_,z,H,P;for(xo(E),_=0;_<C;++_)z=T[_],H=qn(z,this),D.touch0&&D.touch0[2]===z.identifier?D.touch0[0]=H:D.touch1&&D.touch1[2]===z.identifier&&(D.touch1[0]=H);if(z=D.that.__zoom,D.touch1){var B=D.touch0[0],q=D.touch0[1],G=D.touch1[0],se=D.touch1[1],re=(re=G[0]-B[0])*re+(re=G[1]-B[1])*re,Z=(Z=se[0]-q[0])*Z+(Z=se[1]-q[1])*Z;z=y(z,Math.sqrt(re/Z)),H=[(B[0]+G[0])/2,(B[1]+G[1])/2],P=[(q[0]+se[0])/2,(q[1]+se[1])/2]}else if(D.touch0)H=D.touch0[0],P=D.touch0[1];else return;D.zoom("touch",n(x(z,H,P),D.extent,o))}}function L(E,...O){if(this.__zooming){var D=k(this,O).event(E),T=E.changedTouches,C=T.length,_,z;for(Fh(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),_=0;_<C;++_)z=T[_],D.touch0&&D.touch0[2]===z.identifier?delete D.touch0:D.touch1&&D.touch1[2]===z.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(z=qn(z,this),Math.hypot(u[0]-z[0],u[1]-z[1])<b)){var H=gn(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return g.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:bc(+E),g):r},g.filter=function(E){return arguments.length?(e=typeof E=="function"?E:bc(!!E),g):e},g.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:bc(!!E),g):a},g.extent=function(E){return arguments.length?(t=typeof E=="function"?E:bc([[+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=d.on.apply(d,arguments);return E===d?g:E},g.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,g):Math.sqrt(v)},g.tapDistance=function(E){return arguments.length?(b=+E,g):b},g}const Cr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", 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."},pl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],C1=["Enter"," ","Escape"],E1={"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 Oi;(function(e){e.Strict="strict",e.Loose="loose"})(Oi||(Oi={}));var fa;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(fa||(fa={}));var xl;(function(e){e.Partial="partial",e.Full="full"})(xl||(xl={}));const M1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Ns;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ns||(Ns={}));var Fd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Fd||(Fd={}));var Ee;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ee||(Ee={}));const C0={[Ee.Left]:Ee.Right,[Ee.Right]:Ee.Left,[Ee.Top]:Ee.Bottom,[Ee.Bottom]:Ee.Top};function _1(e){return e===null?null:e?"valid":"invalid"}const D1=e=>"id"in e&&"source"in e&&"target"in e,WM=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),nx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ol=(e,t=[0,0])=>{const{width:n,height:r}=ns(e),a=e.origin??t,i=n*a[0],o=r*a[1];return{x:e.position.x-i,y:e.position.y-o}},HM=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const i=typeof a=="string";let o=!t.nodeLookup&&!i?a:void 0;t.nodeLookup&&(o=i?t.nodeLookup.get(a):nx(a)?a:t.nodeLookup.get(a.id));const l=o?Ud(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Eu(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Mu(n)},zl=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const a=Ud(r);n=Eu(n,a)}}),Mu(n)},rx=(e,t,[n,r,a]=[0,0,1],i=!1,o=!1)=>{const l={...Rl(t,[n,r,a]),width:t.width/a,height:t.height/a},c=[];for(const d of e.values()){const{measured:h,selectable:u=!0,hidden:f=!1}=d;if(o&&!u||f)continue;const p=h.width??d.width??d.initialWidth??null,w=h.height??d.height??d.initialHeight??null,v=gl(l,$i(d)),b=(p??0)*(w??0),g=i&&v>0;(!d.internals.handleBounds||g||v>=b||d.dragging)&&c.push(d)}return c},VM=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function YM(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function XM({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:i},o){if(e.size===0)return Promise.resolve(!0);const l=YM(e,o),c=zl(l),d=sx(c,t,n,(o==null?void 0:o.minZoom)??a,(o==null?void 0:o.maxZoom)??i,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{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 T1({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:i}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},h=o.origin??r;let u=o.extent||a;if(o.extent==="parent"&&!o.expandParent)if(!l)i==null||i("005",Cr.error005());else{const p=l.measured.width,w=l.measured.height;p&&w&&(u=[[c,d],[c+p,d+w]])}else l&&Ri(o.extent)&&(u=[[o.extent[0][0]+c,o.extent[0][1]+d],[o.extent[1][0]+c,o.extent[1][1]+d]]);const f=Ri(u)?Sa(t,u,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(i==null||i("015",Cr.error015())),{position:{x:f.x-c+(o.measured.width??0)*h[0],y:f.y-d+(o.measured.height??0)*h[1]},positionAbsolute:f}}async function qM({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const i=new Set(e.map(f=>f.id)),o=[];for(const f of n){if(f.deletable===!1)continue;const p=i.has(f.id),w=!p&&f.parentId&&o.find(v=>v.id===f.parentId);(p||w)&&o.push(f)}const l=new Set(t.map(f=>f.id)),c=r.filter(f=>f.deletable!==!1),h=VM(o,c);for(const f of c)l.has(f.id)&&!h.find(w=>w.id===f.id)&&h.push(f);if(!a)return{edges:h,nodes:o};const u=await a({nodes:o,edges:h});return typeof u=="boolean"?u?{edges:h,nodes:o}:{edges:[],nodes:[]}:u}const zi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Sa=(e={x:0,y:0},t,n)=>({x:zi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:zi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function P1(e,t,n){const{width:r,height:a}=ns(n),{x:i,y:o}=n.internals.positionAbsolute;return Sa(e,[[i,o],[i+r,o+a]],t)}const E0=(e,t,n)=>e<t?zi(Math.abs(e-t),1,t)/t:e>n?-zi(Math.abs(e-n),1,t)/t:0,A1=(e,t,n=15,r=40)=>{const a=E0(e.x,r,t.width-r)*n,i=E0(e.y,r,t.height-r)*n;return[a,i]},Eu=(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)}),Cm=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Mu=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),$i=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=nx(e)?e.internals.positionAbsolute:Ol(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Ud=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=nx(e)?e.internals.positionAbsolute:Ol(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},O1=(e,t)=>Mu(Eu(Cm(e),Cm(t))),gl=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},M0=e=>Qn(e.width)&&Qn(e.height)&&Qn(e.x)&&Qn(e.y),Qn=e=>!isNaN(e)&&isFinite(e),GM=(e,t)=>{},$l=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Rl=({x:e,y:t},[n,r,a],i=!1,o=[1,1])=>{const l={x:(e-n)/a,y:(t-r)/a};return i?$l(l,o):l},Bd=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function Va(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 KM(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Va(e,n),a=Va(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=Va(e.top??e.y??0,n),a=Va(e.bottom??e.y??0,n),i=Va(e.left??e.x??0,t),o=Va(e.right??e.x??0,t);return{top:r,right:o,bottom:a,left:i,x:i+o,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function QM(e,t,n,r,a,i){const{x:o,y:l}=Bd(e,[t,n,r]),{x:c,y:d}=Bd({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=a-c,u=i-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(u)}}const sx=(e,t,n,r,a,i)=>{const o=KM(i,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,d=Math.min(l,c),h=zi(d,r,a),u=e.x+e.width/2,f=e.y+e.height/2,p=t/2-u*h,w=n/2-f*h,v=QM(e,p,w,h,t,n),b={left:Math.min(v.left-o.left,0),top:Math.min(v.top-o.top,0),right:Math.min(v.right-o.right,0),bottom:Math.min(v.bottom-o.bottom,0)};return{x:p-b.left+b.right,y:w-b.top+b.bottom,zoom:h}},vl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ri(e){return e!=null&&e!=="parent"}function ns(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 z1(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 $1(e,t={width:0,height:0},n,r,a){const i={...e},o=r.get(n);if(o){const l=o.origin||a;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 _0(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ZM(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function JM(e){return{...E1,...e||{}}}function Ho(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:i,y:o}=Zn(e),l=Rl({x:i-((a==null?void 0:a.left)??0),y:o-((a==null?void 0:a.top)??0)},r),{x:c,y:d}=n?$l(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const ax=e=>({width:e.offsetWidth,height:e.offsetHeight}),R1=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},e_=["INPUT","SELECT","TEXTAREA"];function I1(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:e_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const L1=e=>"clientX"in e,Zn=(e,t)=>{var i,o;const n=L1(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,a=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},D0=(e,t,n,r,a)=>{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:a,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...ax(o)}})};function F1({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:i,targetControlX:o,targetControlY:l}){const c=e*.125+a*.375+o*.375+n*.125,d=t*.125+i*.375+l*.375+r*.125,h=Math.abs(c-e),u=Math.abs(d-t);return[c,d,h,u]}function Nc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function T0({pos:e,x1:t,y1:n,x2:r,y2:a,c:i}){switch(e){case Ee.Left:return[t-Nc(t-r,i),n];case Ee.Right:return[t+Nc(r-t,i),n];case Ee.Top:return[t,n-Nc(n-a,i)];case Ee.Bottom:return[t,n+Nc(a-n,i)]}}function U1({sourceX:e,sourceY:t,sourcePosition:n=Ee.Bottom,targetX:r,targetY:a,targetPosition:i=Ee.Top,curvature:o=.25}){const[l,c]=T0({pos:n,x1:e,y1:t,x2:r,y2:a,c:o}),[d,h]=T0({pos:i,x1:r,y1:a,x2:e,y2:t,c:o}),[u,f,p,w]=F1({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${e},${t} C${l},${c} ${d},${h} ${r},${a}`,u,f,p,w]}function B1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,i=n<e?n+a:n-a,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[i,l,a,o]}function t_({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r,elevateOnSelect:a=!1}){if(r!==void 0)return r;const i=a&&n?1e3:0,o=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return i+o}function n_({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const i=Eu(Ud(e),Ud(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const o={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return gl(o,Mu(i))>0}const r_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,s_=(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)),W1=(e,t)=>{if(!e.source||!e.target)return t;let n;return D1(e)?n={...e}:n={...e,id:r_(e)},s_(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function H1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,i,o,l]=B1({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,i,o,l]}const P0={[Ee.Left]:{x:-1,y:0},[Ee.Right]:{x:1,y:0},[Ee.Top]:{x:0,y:-1},[Ee.Bottom]:{x:0,y:1}},a_=({source:e,sourcePosition:t=Ee.Bottom,target:n})=>t===Ee.Left||t===Ee.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},A0=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function i_({source:e,sourcePosition:t=Ee.Bottom,target:n,targetPosition:r=Ee.Top,center:a,offset:i,stepPosition:o}){const l=P0[t],c=P0[r],d={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},u=a_({source:d,sourcePosition:t,target:h}),f=u.x!==0?"x":"y",p=u[f];let w=[],v,b;const g={x:0,y:0},y={x:0,y:0},[,,x,N]=B1({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(v=a.x??d.x+(h.x-d.x)*o,b=a.y??(d.y+h.y)/2):(v=a.x??(d.x+h.x)/2,b=a.y??d.y+(h.y-d.y)*o);const k=[{x:v,y:d.y},{x:v,y:h.y}],S=[{x:d.x,y:b},{x:h.x,y:b}];l[f]===p?w=f==="x"?k:S:w=f==="x"?S:k}else{const k=[{x:d.x,y:h.y}],S=[{x:h.x,y:d.y}];if(f==="x"?w=l.x===p?S:k:w=l.y===p?k:S,t===r){const $=Math.abs(e[f]-n[f]);if($<=i){const L=Math.min(i-1,i-$);l[f]===p?g[f]=(d[f]>e[f]?-1:1)*L:y[f]=(h[f]>n[f]?-1:1)*L}}if(t!==r){const $=f==="x"?"y":"x",L=l[f]===c[$],E=d[$]>h[$],O=d[$]<h[$];(l[f]===1&&(!L&&E||L&&O)||l[f]!==1&&(!L&&O||L&&E))&&(w=f==="x"?k:S)}const M={x:d.x+g.x,y:d.y+g.y},A={x:h.x+y.x,y:h.y+y.y},I=Math.max(Math.abs(M.x-w[0].x),Math.abs(A.x-w[0].x)),U=Math.max(Math.abs(M.y-w[0].y),Math.abs(A.y-w[0].y));I>=U?(v=(M.x+A.x)/2,b=w[0].y):(v=w[0].x,b=(M.y+A.y)/2)}return[[e,{x:d.x+g.x,y:d.y+g.y},...w,{x:h.x+y.x,y:h.y+y.y},n],v,b,x,N]}function o_(e,t,n,r){const a=Math.min(A0(e,t)/2,A0(t,n)/2,r),{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 d=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+a*d},${o}Q ${i},${o} ${i},${o+a*h}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${o+a*c}Q ${i},${o} ${i+a*l},${o}`}function Em({sourceX:e,sourceY:t,sourcePosition:n=Ee.Bottom,targetX:r,targetY:a,targetPosition:i=Ee.Top,borderRadius:o=5,centerX:l,centerY:c,offset:d=20,stepPosition:h=.5}){const[u,f,p,w,v]=i_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:i,center:{x:l,y:c},offset:d,stepPosition:h});return[u.reduce((g,y,x)=>{let N="";return x>0&&x<u.length-1?N=o_(u[x-1],y,u[x+1],o):N=`${x===0?"M":"L"}${y.x} ${y.y}`,g+=N,g},""),f,p,w,v]}function O0(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function l_(e){var u;const{sourceNode:t,targetNode:n}=e;if(!O0(t)||!O0(n))return null;const r=t.internals.handleBounds||z0(t.handles),a=n.internals.handleBounds||z0(n.handles),i=$0((r==null?void 0:r.source)??[],e.sourceHandle),o=$0(e.connectionMode===Oi.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!i||!o)return(u=e.onError)==null||u.call(e,"008",Cr.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Ee.Bottom,c=(o==null?void 0:o.position)||Ee.Top,d=wl(t,i,l),h=wl(n,o,c);return{sourceX:d.x,sourceY:d.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function z0(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function wl(e,t,n=Ee.Left,r=!1){const a=((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??ns(e);if(r)return{x:a+o/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Ee.Top:return{x:a+o/2,y:i};case Ee.Right:return{x:a+o,y:i+l/2};case Ee.Bottom:return{x:a+o/2,y:i+l};case Ee.Left:return{x:a,y:i+l/2}}}function $0(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Mm(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function c_(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const i=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const d=Mm(c,t);i.has(d)||(o.push({id:d,color:c.color||n,...c}),i.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const ix={nodeOrigin:[0,0],nodeExtent:pl,elevateNodesOnSelect:!0,defaults:{}},d_={...ix,checkEquality:!0};function ox(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function u_(e,t,n){const r=ox(ix,n);for(const a of e.values())if(a.parentId)lx(a,e,t,r);else{const i=Ol(a,r.nodeOrigin),o=Ri(a.extent)?a.extent:r.nodeExtent,l=Sa(i,o,ns(a));a.internals.positionAbsolute=l}}function h_(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const i={width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&r.push(i)}return{source:n,target:r}}function _m(e,t,n,r){var c,d;const a=ox(d_,r);let i=e.length>0;const o=new Map(t),l=a!=null&&a.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const h of e){let u=o.get(h.id);if(a.checkEquality&&h===(u==null?void 0:u.internals.userNode))t.set(h.id,u);else{const f=Ol(h,a.nodeOrigin),p=Ri(h.extent)?h.extent:a.nodeExtent,w=Sa(f,p,ns(h));u={...a.defaults,...h,measured:{width:(c=h.measured)==null?void 0:c.width,height:(d=h.measured)==null?void 0:d.height},internals:{positionAbsolute:w,handleBounds:h_(h,u),z:V1(h,l),userNode:h}},t.set(h.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(i=!1),h.parentId&&lx(u,t,n,r)}return i}function f_(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 lx(e,t,n,r){const{elevateNodesOnSelect:a,nodeOrigin:i,nodeExtent:o}=ox(ix,r),l=e.parentId,c=t.get(l);if(!c){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}f_(e,n);const d=a?1e3:0,{x:h,y:u,z:f}=m_(e,c,i,o,d),{positionAbsolute:p}=e.internals,w=h!==p.x||u!==p.y;(w||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:u}:p,z:f}})}function V1(e,t){return(Qn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function m_(e,t,n,r,a){const{x:i,y:o}=t.internals.positionAbsolute,l=ns(e),c=Ol(e,n),d=Ri(e.extent)?Sa(c,e.extent,l):c;let h=Sa({x:i+d.x,y:o+d.y},r,l);e.extent==="parent"&&(h=P1(h,l,t));const u=V1(e,a),f=t.internals.z??0;return{x:h.x,y:h.y,z:f>=u?f+1:u}}function cx(e,t,n,r=[0,0]){var o;const a=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const d=((o=i.get(l.parentId))==null?void 0:o.expandedRect)??$i(c),h=O1(d,l.rect);i.set(l.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},d)=>{var x;const h=c.internals.positionAbsolute,u=ns(c),f=c.origin??r,p=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,w=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,v=Math.max(u.width,Math.round(l.width)),b=Math.max(u.height,Math.round(l.height)),g=(v-u.width)*f[0],y=(b-u.height)*f[1];(p>0||w>0||g||y)&&(a.push({id:d,type:"position",position:{x:c.position.x-p+g,y:c.position.y-w+y}}),(x=n.get(d))==null||x.forEach(N=>{e.some(j=>j.id===N.id)||a.push({id:N.id,type:"position",position:{x:N.position.x+p,y:N.position.y+w}})})),(u.width<l.width||u.height<l.height||p||w)&&a.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?f[0]*p-g:0),height:b+(w?f[1]*w-y:0)}})}),a}function p_(e,t,n,r,a,i){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const c=[],d=window.getComputedStyle(o),{m22:h}=new window.DOMMatrixReadOnly(d.transform),u=[];for(const f of e.values()){const p=t.get(f.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}const w=ax(f.nodeElement),v=p.measured.width!==w.width||p.measured.height!==w.height;if(!!(w.width&&w.height&&(v||!p.internals.handleBounds||f.force))){const g=f.nodeElement.getBoundingClientRect(),y=Ri(p.extent)?p.extent:i;let{positionAbsolute:x}=p.internals;p.parentId&&p.extent==="parent"?x=P1(x,w,t.get(p.parentId)):y&&(x=Sa(x,y,w));const N={...p,measured:w,internals:{...p.internals,positionAbsolute:x,handleBounds:{source:D0("source",f.nodeElement,g,h,p.id),target:D0("target",f.nodeElement,g,h,p.id)}}};t.set(p.id,N),p.parentId&&lx(N,t,n,{nodeOrigin:a}),l=!0,v&&(c.push({id:p.id,type:"dimensions",dimensions:w}),p.expandParent&&p.parentId&&u.push({id:p.id,parentId:p.parentId,rect:$i(N,a)}))}}if(u.length>0){const f=cx(u,t,n,a);c.push(...f)}return{changes:c,updatedInternals:l}}async function x_({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,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],[a,i]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function R0(e,t,n,r,a,i){let o=a;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${a}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),i){o=`${a}-${e}-${i}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function Y1(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:i,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:a,target:i,sourceHandle:o,targetHandle:l},d=`${a}-${o}--${i}-${l}`,h=`${i}-${l}--${a}-${o}`;R0("source",c,h,e,a,o),R0("target",c,d,e,i,l),t.set(r.id,r)}}function X1(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:X1(n,t):!1}function I0(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function g_(e,t,n,r){const a=new Map;for(const[i,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!X1(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(i);l&&a.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 a}function Uh({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const a=[];for(const[d,h]of t){const u=(o=n.get(d))==null?void 0:o.internals.userNode;u&&a.push({...u,position:h.position,dragging:r})}if(!e)return[a[0],a];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:r}:a[0],a]}function v_({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:r-a.distance.y},o=$l(i,t);return{x:o.x-i.x,y:o.y-i.y}}function w_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let i={x:null,y:null},o=0,l=new Map,c=!1,d={x:0,y:0},h=null,u=!1,f=null,p=!1,w=!1,v=null;function b({noDragClassName:y,handleSelector:x,domNode:N,isSelectable:j,nodeId:k,nodeClickDistance:S=0}){f=gn(N);function M({x:$,y:L}){const{nodeLookup:E,nodeExtent:O,snapGrid:D,snapToGrid:T,nodeOrigin:C,onNodeDrag:_,onSelectionDrag:z,onError:H,updateNodePositions:P}=t();i={x:$,y:L};let B=!1;const q=l.size>1,G=q&&O?Cm(zl(l)):null,se=q&&T?v_({dragItems:l,snapGrid:D,x:$,y:L}):null;for(const[re,Z]of l){if(!E.has(re))continue;let R={x:$-Z.distance.x,y:L-Z.distance.y};T&&(R=se?{x:Math.round(R.x+se.x),y:Math.round(R.y+se.y)}:$l(R,D));let ee=null;if(q&&O&&!Z.extent&&G){const{positionAbsolute:K}=Z.internals,ne=K.x-G.x+O[0][0],ce=K.x+Z.measured.width-G.x2+O[1][0],ge=K.y-G.y+O[0][1],ve=K.y+Z.measured.height-G.y2+O[1][1];ee=[[ne,ge],[ce,ve]]}const{position:J,positionAbsolute:F}=T1({nodeId:re,nextPosition:R,nodeLookup:E,nodeExtent:ee||O,nodeOrigin:C,onError:H});B=B||Z.position.x!==J.x||Z.position.y!==J.y,Z.position=J,Z.internals.positionAbsolute=F}if(w=w||B,!!B&&(P(l,!0),v&&(r||_||!k&&z))){const[re,Z]=Uh({nodeId:k,dragItems:l,nodeLookup:E});r==null||r(v,l,re,Z),_==null||_(v,re,Z),k||z==null||z(v,Z)}}async function A(){if(!h)return;const{transform:$,panBy:L,autoPanSpeed:E,autoPanOnNodeDrag:O}=t();if(!O){c=!1,cancelAnimationFrame(o);return}const[D,T]=A1(d,h,E);(D!==0||T!==0)&&(i.x=(i.x??0)-D/$[2],i.y=(i.y??0)-T/$[2],await L({x:D,y:T})&&M(i)),o=requestAnimationFrame(A)}function I($){var q;const{nodeLookup:L,multiSelectionActive:E,nodesDraggable:O,transform:D,snapGrid:T,snapToGrid:C,selectNodesOnDrag:_,onNodeDragStart:z,onSelectionDragStart:H,unselectNodesAndEdges:P}=t();u=!0,(!_||!j)&&!E&&k&&((q=L.get(k))!=null&&q.selected||P()),j&&_&&k&&(e==null||e(k));const B=Ho($.sourceEvent,{transform:D,snapGrid:T,snapToGrid:C,containerBounds:h});if(i=B,l=g_(L,O,B,k),l.size>0&&(n||z||!k&&H)){const[G,se]=Uh({nodeId:k,dragItems:l,nodeLookup:L});n==null||n($.sourceEvent,l,G,se),z==null||z($.sourceEvent,G,se),k||H==null||H($.sourceEvent,se)}}const U=d1().clickDistance(S).on("start",$=>{const{domNode:L,nodeDragThreshold:E,transform:O,snapGrid:D,snapToGrid:T}=t();h=(L==null?void 0:L.getBoundingClientRect())||null,p=!1,w=!1,v=$.sourceEvent,E===0&&I($),i=Ho($.sourceEvent,{transform:O,snapGrid:D,snapToGrid:T,containerBounds:h}),d=Zn($.sourceEvent,h)}).on("drag",$=>{const{autoPanOnNodeDrag:L,transform:E,snapGrid:O,snapToGrid:D,nodeDragThreshold:T,nodeLookup:C}=t(),_=Ho($.sourceEvent,{transform:E,snapGrid:O,snapToGrid:D,containerBounds:h});if(v=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||k&&!C.has(k))&&(p=!0),!p){if(!c&&L&&u&&(c=!0,A()),!u){const z=Zn($.sourceEvent,h),H=z.x-d.x,P=z.y-d.y;Math.sqrt(H*H+P*P)>T&&I($)}(i.x!==_.xSnapped||i.y!==_.ySnapped)&&l&&u&&(d=Zn($.sourceEvent,h),M(_))}}).on("end",$=>{if(!(!u||p)&&(c=!1,u=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:L,updateNodePositions:E,onNodeDragStop:O,onSelectionDragStop:D}=t();if(w&&(E(l,!1),w=!1),a||O||!k&&D){const[T,C]=Uh({nodeId:k,dragItems:l,nodeLookup:L,dragging:!1});a==null||a($.sourceEvent,l,T,C),O==null||O($.sourceEvent,T,C),k||D==null||D($.sourceEvent,C)}}}).filter($=>{const L=$.target;return!$.button&&(!y||!I0(L,`.${y}`,N))&&(!x||I0(L,x,N))});f.call(U)}function g(){f==null||f.on(".drag",null)}return{update:b,destroy:g}}function y_(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())gl(a,$i(i))>0&&r.push(i);return r}const b_=250;function N_(e,t,n,r){var l,c;let a=[],i=1/0;const o=y_(e,n,t+b_);for(const d of o){const h=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((c=d.internals.handleBounds)==null?void 0:c.target)??[]];for(const u of h){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;const{x:f,y:p}=wl(d,u,u.position,!0),w=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));w>t||(w<i?(a=[{...u,x:f,y:p}],i=w):w===i&&a.push({...u,x:f,y:p}))}}if(!a.length)return null;if(a.length>1){const d=r.type==="source"?"target":"source";return a.find(h=>h.type===d)??a[0]}return a[0]}function q1(e,t,n,r,a,i=!1){var d,h,u;const o=r.get(e);if(!o)return null;const l=a==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((h=o.internals.handleBounds)==null?void 0:h.source)??[],...((u=o.internals.handleBounds)==null?void 0:u.target)??[]],c=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...wl(o,c,c.position,!0)}:c}function G1(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function j_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const K1=()=>!0;function k_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:i,isTarget:o,domNode:l,nodeLookup:c,lib:d,autoPanOnConnect:h,flowId:u,panBy:f,cancelConnection:p,onConnectStart:w,onConnect:v,onConnectEnd:b,isValidConnection:g=K1,onReconnectEnd:y,updateConnection:x,getTransform:N,getFromHandle:j,autoPanSpeed:k,dragThreshold:S=1,handleDomNode:M}){const A=R1(e.target);let I=0,U;const{x:$,y:L}=Zn(e),E=G1(i,M),O=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!O||!E)return;const T=q1(a,E,r,c,t);if(!T)return;let C=Zn(e,O),_=!1,z=null,H=!1,P=null;function B(){if(!h||!O)return;const[J,F]=A1(C,O,k);f({x:J,y:F}),I=requestAnimationFrame(B)}const q={...T,nodeId:a,type:E,position:T.position},G=c.get(a);let re={inProgress:!0,isValid:null,from:wl(G,q,Ee.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:G,to:C,toHandle:null,toPosition:C0[q.position],toNode:null};function Z(){D=!0,x(re),w==null||w(e,{nodeId:a,handleId:r,handleType:E})}S===0&&Z();function R(J){if(!D){const{x:ce,y:ge}=Zn(J),ve=ce-$,Ae=ge-L;if(!(ve*ve+Ae*Ae>S*S))return;Z()}if(!j()||!q){ee(J);return}const F=N();C=Zn(J,O),U=N_(Rl(C,F,!1,[1,1]),n,c,q),_||(B(),_=!0);const K=Q1(J,{handle:U,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:o?"target":"source",isValidConnection:g,doc:A,lib:d,flowId:u,nodeLookup:c});P=K.handleDomNode,z=K.connection,H=j_(!!U,K.isValid);const ne={...re,isValid:H,to:K.toHandle&&H?Bd({x:K.toHandle.x,y:K.toHandle.y},F):C,toHandle:K.toHandle,toPosition:H&&K.toHandle?K.toHandle.position:C0[q.position],toNode:K.toHandle?c.get(K.toHandle.nodeId):null};H&&U&&re.toHandle&&ne.toHandle&&re.toHandle.type===ne.toHandle.type&&re.toHandle.nodeId===ne.toHandle.nodeId&&re.toHandle.id===ne.toHandle.id&&re.to.x===ne.to.x&&re.to.y===ne.to.y||(x(ne),re=ne)}function ee(J){if(!("touches"in J&&J.touches.length>0)){if(D){(U||P)&&z&&H&&(v==null||v(z));const{inProgress:F,...K}=re,ne={...K,toPosition:re.toHandle?re.toPosition:null};b==null||b(J,ne),i&&(y==null||y(J,ne))}p(),cancelAnimationFrame(I),_=!1,H=!1,z=null,P=null,A.removeEventListener("mousemove",R),A.removeEventListener("mouseup",ee),A.removeEventListener("touchmove",R),A.removeEventListener("touchend",ee)}}A.addEventListener("mousemove",R),A.addEventListener("mouseup",ee),A.addEventListener("touchmove",R),A.addEventListener("touchend",ee)}function Q1(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:i,doc:o,lib:l,flowId:c,isValidConnection:d=K1,nodeLookup:h}){const u=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:p,y:w}=Zn(e),v=o.elementFromPoint(p,w),b=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,g={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const y=G1(void 0,b),x=b.getAttribute("data-nodeid"),N=b.getAttribute("data-handleid"),j=b.classList.contains("connectable"),k=b.classList.contains("connectableend");if(!x||!y)return g;const S={source:u?x:r,sourceHandle:u?N:a,target:u?r:x,targetHandle:u?a:N};g.connection=S;const A=j&&k&&(n===Oi.Strict?u&&y==="source"||!u&&y==="target":x!==r||N!==a);g.isValid=A&&d(S),g.toHandle=q1(x,y,N,h,n,!0)}return g}const Dm={onPointerDown:k_,isValid:Q1};function S_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=gn(e);function i({translateExtent:l,width:c,height:d,zoomStep:h=1,pannable:u=!0,zoomable:f=!0,inversePan:p=!1}){const w=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const N=n(),j=x.sourceEvent.ctrlKey&&vl()?10:1,k=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*h,S=N[2]*Math.pow(2,k*j);t.scaleTo(S)};let v=[0,0];const b=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(v=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},g=x=>{const N=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const j=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],k=[j[0]-v[0],j[1]-v[1]];v=j;const S=r()*Math.max(N[2],Math.log(N[2]))*(p?-1:1),M={x:N[0]-k[0]*S,y:N[1]-k[1]*S},A=[[0,0],[c,d]];t.setViewportConstrained({x:M.x,y:M.y,zoom:N[2]},A,l)},y=S1().on("start",b).on("zoom",u?g:null).on("zoom.wheel",f?w:null);a.call(y,{})}function o(){a.on("zoom",null)}return{update:i,destroy:o,pointer:qn}}const C_=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,_u=e=>({x:e.x,y:e.y,zoom:e.k}),Bh=({x:e,y:t,zoom:n})=>Cu.translate(e,t).scale(n),ui=(e,t)=>e.target.closest(`.${t}`),Z1=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),E_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Wh=(e,t=0,n=E_,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},J1=e=>{const t=e.ctrlKey&&vl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function M_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return h=>{if(ui(h,t))return!1;h.preventDefault(),h.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(h.ctrlKey&&o){const b=qn(h),g=J1(h),y=u*Math.pow(2,g);r.scaleTo(n,y,b,h);return}const f=h.deltaMode===1?20:1;let p=a===fa.Vertical?0:h.deltaX*f,w=a===fa.Horizontal?0:h.deltaY*f;!vl()&&h.shiftKey&&a!==fa.Vertical&&(p=h.deltaY*f,w=0),r.translateBy(n,-(p/u)*i,-(w/u)*i,{internal:!0});const v=_u(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(h,v)),e.isPanScrolling&&(c==null||c(h,v),e.panScrollTimeout=setTimeout(()=>{d==null||d(h,v),e.isPanScrolling=!1},150))}}function __({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const i=r.type==="wheel",o=!t&&i&&!r.ctrlKey,l=ui(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,a)}}function D_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,o,l;if((i=r.sourceEvent)!=null&&i.internal)return;const a=_u(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function T_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return i=>{var o,l;e.usedRightMouseButton=!!(n&&Z1(t,e.mouseButton??0)),(o=i.sourceEvent)!=null&&o.sync||r([i.transform.x,i.transform.y,i.transform.k]),a&&!((l=i.sourceEvent)!=null&&l.internal)&&(a==null||a(i.sourceEvent,_u(i.transform)))}}function P_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:i}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&Z1(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&i(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),a&&C_(e.prevViewport,o.transform))){const c=_u(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(o.sourceEvent,c)},n?150:0)}}}function A_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:d,connectionInProgress:h}){return u=>{var b;const f=e||t,p=n&&u.ctrlKey,w=u.type==="wheel";if(u.button===1&&u.type==="mousedown"&&(ui(u,`${d}-flow__node`)||ui(u,`${d}-flow__edge`)))return!0;if(!r&&!f&&!a&&!i&&!n||o||h&&!w||ui(u,l)&&w||ui(u,c)&&(!w||a&&w&&!e)||!n&&u.ctrlKey&&w)return!1;if(!n&&u.type==="touchstart"&&((b=u.touches)==null?void 0:b.length)>1)return u.preventDefault(),!1;if(!f&&!a&&!p&&w||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||w)&&v}}function O_({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:a,viewport:i,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:d}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),f=S1().clickDistance(!Qn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(a),p=gn(e).call(f);x({x:i.x,y:i.y,zoom:zi(i.zoom,t,n)},[[0,0],[u.width,u.height]],a);const w=p.on("wheel.zoom"),v=p.on("dblclick.zoom");f.wheelDelta(J1);function b($,L){return p?new Promise(E=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Wo:Zc).transform(Wh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function g({noWheelClassName:$,noPanClassName:L,onPaneContextMenu:E,userSelectionActive:O,panOnScroll:D,panOnDrag:T,panOnScrollMode:C,panOnScrollSpeed:_,preventScrolling:z,zoomOnPinch:H,zoomOnScroll:P,zoomOnDoubleClick:B,zoomActivationKeyPressed:q,lib:G,onTransformChange:se,connectionInProgress:re}){O&&!h.isZoomingOrPanning&&y();const R=D&&!q&&!O?M_({zoomPanValues:h,noWheelClassName:$,d3Selection:p,d3Zoom:f,panOnScrollMode:C,panOnScrollSpeed:_,zoomOnPinch:H,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:c}):__({noWheelClassName:$,preventScrolling:z,d3ZoomHandler:w});if(p.on("wheel.zoom",R,{passive:!1}),!O){const J=D_({zoomPanValues:h,onDraggingChange:d,onPanZoomStart:l});f.on("start",J);const F=T_({zoomPanValues:h,panOnDrag:T,onPaneContextMenu:!!E,onPanZoom:o,onTransformChange:se});f.on("zoom",F);const K=P_({zoomPanValues:h,panOnDrag:T,panOnScroll:D,onPaneContextMenu:E,onPanZoomEnd:c,onDraggingChange:d});f.on("end",K)}const ee=A_({zoomActivationKeyPressed:q,panOnDrag:T,zoomOnScroll:P,panOnScroll:D,zoomOnDoubleClick:B,zoomOnPinch:H,userSelectionActive:O,noPanClassName:L,noWheelClassName:$,lib:G,connectionInProgress:re});f.filter(ee),B?p.on("dblclick.zoom",v):p.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x($,L,E){const O=Bh($),D=f==null?void 0:f.constrain()(O,L,E);return D&&await b(D),new Promise(T=>T(D))}async function N($,L){const E=Bh($);return await b(E,L),new Promise(O=>O(E))}function j($){if(p){const L=Bh($),E=p.property("__zoom");(E.k!==$.zoom||E.x!==$.x||E.y!==$.y)&&(f==null||f.transform(p,L,null,{sync:!0}))}}function k(){const $=p?k1(p.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function S($,L){return p?new Promise(E=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Wo:Zc).scaleTo(Wh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function M($,L){return p?new Promise(E=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Wo:Zc).scaleBy(Wh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function A($){f==null||f.scaleExtent($)}function I($){f==null||f.translateExtent($)}function U($){const L=!Qn($)||$<0?0:$;f==null||f.clickDistance(L)}return{update:g,destroy:y,setViewport:N,setViewportConstrained:x,getViewport:k,scaleTo:S,scaleBy:M,setScaleExtent:A,setTranslateExtent:I,syncViewport:j,setClickDistance:U}}var Ii;(function(e){e.Line="line",e.Handle="handle"})(Ii||(Ii={}));function z_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:i}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&a&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function $_(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function cs(e,t){return Math.max(0,t-e)}function ds(e,t){return Math.max(0,e-t)}function jc(e,t,n){return Math.max(0,t-e,e-n)}function L0(e,t){return e?!t:t}function R_(e,t,n,r,a,i,o,l){let{affectsX:c,affectsY:d}=t;const{isHorizontal:h,isVertical:u}=t,f=h&&u,{xSnapped:p,ySnapped:w}=n,{minWidth:v,maxWidth:b,minHeight:g,maxHeight:y}=r,{x,y:N,width:j,height:k,aspectRatio:S}=e;let M=Math.floor(h?p-e.pointerX:0),A=Math.floor(u?w-e.pointerY:0);const I=j+(c?-M:M),U=k+(d?-A:A),$=-i[0]*j,L=-i[1]*k;let E=jc(I,v,b),O=jc(U,g,y);if(o){let C=0,_=0;c&&M<0?C=cs(x+M+$,o[0][0]):!c&&M>0&&(C=ds(x+I+$,o[1][0])),d&&A<0?_=cs(N+A+L,o[0][1]):!d&&A>0&&(_=ds(N+U+L,o[1][1])),E=Math.max(E,C),O=Math.max(O,_)}if(l){let C=0,_=0;c&&M>0?C=ds(x+M,l[0][0]):!c&&M<0&&(C=cs(x+I,l[1][0])),d&&A>0?_=ds(N+A,l[0][1]):!d&&A<0&&(_=cs(N+U,l[1][1])),E=Math.max(E,C),O=Math.max(O,_)}if(a){if(h){const C=jc(I/S,g,y)*S;if(E=Math.max(E,C),o){let _=0;!c&&!d||c&&!d&&f?_=ds(N+L+I/S,o[1][1])*S:_=cs(N+L+(c?M:-M)/S,o[0][1])*S,E=Math.max(E,_)}if(l){let _=0;!c&&!d||c&&!d&&f?_=cs(N+I/S,l[1][1])*S:_=ds(N+(c?M:-M)/S,l[0][1])*S,E=Math.max(E,_)}}if(u){const C=jc(U*S,v,b)/S;if(O=Math.max(O,C),o){let _=0;!c&&!d||d&&!c&&f?_=ds(x+U*S+$,o[1][0])/S:_=cs(x+(d?A:-A)*S+$,o[0][0])/S,O=Math.max(O,_)}if(l){let _=0;!c&&!d||d&&!c&&f?_=cs(x+U*S,l[1][0])/S:_=ds(x+(d?A:-A)*S,l[0][0])/S,O=Math.max(O,_)}}}A=A+(A<0?O:-O),M=M+(M<0?E:-E),a&&(f?I>U*S?A=(L0(c,d)?-M:M)/S:M=(L0(c,d)?-A:A)*S:h?(A=M/S,d=c):(M=A*S,c=d));const D=c?x+M:x,T=d?N+A:N;return{width:j+(c?-M:M),height:k+(d?-A:A),x:i[0]*M*(c?-1:1)+D,y:i[1]*A*(d?-1:1)+T}}const eN={width:0,height:0,x:0,y:0},I_={...eN,pointerX:0,pointerY:0,aspectRatio:1};function L_(e){return[[0,0],[e.measured.width,e.measured.height]]}function F_(e,t,n){const r=t.position.x+e.position.x,a=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[[r-l,a-c],[r+i-l,a+o-c]]}function U_({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const i=gn(e);function o({controlPosition:c,boundaries:d,keepAspectRatio:h,resizeDirection:u,onResizeStart:f,onResize:p,onResizeEnd:w,shouldResize:v}){let b={...eN},g={...I_};const y=$_(c);let x,N=null,j=[],k,S,M,A=!1;const I=d1().on("start",U=>{const{nodeLookup:$,transform:L,snapGrid:E,snapToGrid:O,nodeOrigin:D,paneDomNode:T}=n();if(x=$.get(t),!x)return;N=(T==null?void 0:T.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:_}=Ho(U.sourceEvent,{transform:L,snapGrid:E,snapToGrid:O,containerBounds:N});b={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},g={...b,pointerX:C,pointerY:_,aspectRatio:b.width/b.height},k=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(k=$.get(x.parentId),S=k&&x.extent==="parent"?L_(k):void 0),j=[],M=void 0;for(const[z,H]of $)if(H.parentId===t&&(j.push({id:z,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const P=F_(H,x,H.origin??D);M?M=[[Math.min(P[0][0],M[0][0]),Math.min(P[0][1],M[0][1])],[Math.max(P[1][0],M[1][0]),Math.max(P[1][1],M[1][1])]]:M=P}f==null||f(U,{...b})}).on("drag",U=>{const{transform:$,snapGrid:L,snapToGrid:E,nodeOrigin:O}=n(),D=Ho(U.sourceEvent,{transform:$,snapGrid:L,snapToGrid:E,containerBounds:N}),T=[];if(!x)return;const{x:C,y:_,width:z,height:H}=b,P={},B=x.origin??O,{width:q,height:G,x:se,y:re}=R_(g,y,D,d,h,B,S,M),Z=q!==z,R=G!==H,ee=se!==C&&Z,J=re!==_&&R;if(!ee&&!J&&!Z&&!R)return;if((ee||J||B[0]===1||B[1]===1)&&(P.x=ee?se:b.x,P.y=J?re:b.y,b.x=P.x,b.y=P.y,j.length>0)){const ce=se-C,ge=re-_;for(const ve of j)ve.position={x:ve.position.x-ce+B[0]*(q-z),y:ve.position.y-ge+B[1]*(G-H)},T.push(ve)}if((Z||R)&&(P.width=Z&&(!u||u==="horizontal")?q:b.width,P.height=R&&(!u||u==="vertical")?G:b.height,b.width=P.width,b.height=P.height),k&&x.expandParent){const ce=B[0]*(P.width??0);P.x&&P.x<ce&&(b.x=ce,g.x=g.x-(P.x-ce));const ge=B[1]*(P.height??0);P.y&&P.y<ge&&(b.y=ge,g.y=g.y-(P.y-ge))}const F=z_({width:b.width,prevWidth:z,height:b.height,prevHeight:H,affectsX:y.affectsX,affectsY:y.affectsY}),K={...b,direction:F};(v==null?void 0:v(U,K))!==!1&&(A=!0,p==null||p(U,K),r(P,T))}).on("end",U=>{A&&(w==null||w(U,{...b}),a==null||a({...b}),A=!1)});i.call(I)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}var tN={exports:{}},nN={},rN={exports:{}},sN={};/**
68
+ * @license React
69
+ * use-sync-external-store-shim.production.js
70
+ *
71
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
72
+ *
73
+ * This source code is licensed under the MIT license found in the
74
+ * LICENSE file in the root directory of this source tree.
75
+ */var Li=m;function B_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var W_=typeof Object.is=="function"?Object.is:B_,H_=Li.useState,V_=Li.useEffect,Y_=Li.useLayoutEffect,X_=Li.useDebugValue;function q_(e,t){var n=t(),r=H_({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return Y_(function(){a.value=n,a.getSnapshot=t,Hh(a)&&i({inst:a})},[e,n,t]),V_(function(){return Hh(a)&&i({inst:a}),e(function(){Hh(a)&&i({inst:a})})},[e]),X_(n),n}function Hh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!W_(e,n)}catch{return!0}}function G_(e,t){return t()}var K_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?G_:q_;sN.useSyncExternalStore=Li.useSyncExternalStore!==void 0?Li.useSyncExternalStore:K_;rN.exports=sN;var Q_=rN.exports;/**
76
+ * @license React
77
+ * use-sync-external-store-shim/with-selector.production.js
78
+ *
79
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
80
+ *
81
+ * This source code is licensed under the MIT license found in the
82
+ * LICENSE file in the root directory of this source tree.
83
+ */var Du=m,Z_=Q_;function J_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var eD=typeof Object.is=="function"?Object.is:J_,tD=Z_.useSyncExternalStore,nD=Du.useRef,rD=Du.useEffect,sD=Du.useMemo,aD=Du.useDebugValue;nN.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var i=nD(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=sD(function(){function c(p){if(!d){if(d=!0,h=p,p=r(p),a!==void 0&&o.hasValue){var w=o.value;if(a(w,p))return u=w}return u=p}if(w=u,eD(h,p))return w;var v=r(p);return a!==void 0&&a(w,v)?(h=p,w):(h=p,u=v)}var d=!1,h,u,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,a]);var l=tD(e,i[0],i[1]);return rD(function(){o.hasValue=!0,o.value=l},[l]),aD(l),l};tN.exports=nN;var iD=tN.exports;const oD=Gm(iD),lD={},F0=e=>{let t;const n=new Set,r=(h,u)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(w=>w(t,p))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(lD?"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()}},d=t=e(r,a,c);return c},cD=e=>e?F0(e):F0,{useDebugValue:dD}=Q,{useSyncExternalStoreWithSelector:uD}=oD,hD=e=>e;function aN(e,t=hD,n){const r=uD(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return dD(r),r}const U0=(e,t)=>{const n=cD(e),r=(a,i=t)=>aN(n,a,i);return Object.assign(r,n),r},fD=(e,t)=>e?U0(e,t):U0;function gt(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[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Tu=m.createContext(null),mD=Tu.Provider,iN=Cr.error001();function Be(e,t){const n=m.useContext(Tu);if(n===null)throw new Error(iN);return aN(n,e,t)}function ct(){const e=m.useContext(Tu);if(e===null)throw new Error(iN);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const B0={display:"none"},pD={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},oN="react-flow__node-desc",lN="react-flow__edge-desc",xD="react-flow__aria-live",gD=e=>e.ariaLiveMessage,vD=e=>e.ariaLabelConfig;function wD({rfId:e}){const t=Be(gD);return s.jsx("div",{id:`${xD}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:pD,children:t})}function yD({rfId:e,disableKeyboardA11y:t}){const n=Be(vD);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:`${oN}-${e}`,style:B0,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),s.jsx("div",{id:`${lN}-${e}`,style:B0,children:n["edge.a11yDescription.default"]}),!t&&s.jsx(wD,{rfId:e})]})}const Pu=m.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},i)=>{const o=`${e}`.split("-");return s.jsx("div",{className:Ct(["react-flow__panel",n,...o]),style:r,ref:i,...a,children:t})});Pu.displayName="Panel";function bD({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:s.jsx(Pu,{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:s.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ND=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},kc=e=>e.id;function jD(e,t){return gt(e.selectedNodes.map(kc),t.selectedNodes.map(kc))&&gt(e.selectedEdges.map(kc),t.selectedEdges.map(kc))}function kD({onSelectionChange:e}){const t=ct(),{selectedNodes:n,selectedEdges:r}=Be(ND,jD);return m.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(i=>i(a))},[n,r,e]),null}const SD=e=>!!e.onSelectionChangeHandlers;function CD({onSelectionChange:e}){const t=Be(SD);return e||t?s.jsx(kD,{onSelectionChange:e}):null}const cN=[0,0],ED={x:0,y:0,zoom:1},MD=["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","paneClickDistance","ariaLabelConfig"],W0=[...MD,"rfId"],_D=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,setPaneClickDistance:e.setPaneClickDistance}),H0={translateExtent:pl,nodeOrigin:cN,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function DD(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:i,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=Be(_D,gt),h=ct();m.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=H0,l()}),[]);const u=m.useRef(H0);return m.useEffect(()=>{for(const f of W0){const p=e[f],w=u.current[f];p!==w&&(typeof e[f]>"u"||(f==="nodes"?t(p):f==="edges"?n(p):f==="minZoom"?r(p):f==="maxZoom"?a(p):f==="translateExtent"?i(p):f==="nodeExtent"?o(p):f==="paneClickDistance"?d(p):f==="ariaLabelConfig"?h.setState({ariaLabelConfig:JM(p)}):f==="fitView"?h.setState({fitViewQueued:p}):f==="fitViewOptions"?h.setState({fitViewOptions:p}):h.setState({[f]:p})))}u.current=e},W0.map(f=>e[f])),null}function V0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function TD(e){var r;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const a=V0(),i=()=>n(a!=null&&a.matches?"dark":"light");return i(),a==null||a.addEventListener("change",i),()=>{a==null||a.removeEventListener("change",i)}},[e]),t!==null?t:(r=V0())!=null&&r.matches?"dark":"light"}const Y0=typeof document<"u"?document:null;function yl(e=null,t={target:Y0,actInsideInputWithModifier:!0}){const[n,r]=m.useState(!1),a=m.useRef(!1),i=m.useRef(new Set([])),[o,l]=m.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace("+",`
84
+ `).replace(`
85
+
86
+ `,`
87
+ +`).split(`
88
+ `)),h=d.reduce((u,f)=>u.concat(...f),[]);return[d,h]}return[[],[]]},[e]);return m.useEffect(()=>{const c=(t==null?void 0:t.target)??Y0,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=p=>{var b,g;if(a.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!a.current||a.current&&!d)&&I1(p))return!1;const v=q0(p.code,l);if(i.current.add(p[v]),X0(o,i.current,!1)){const y=((g=(b=p.composedPath)==null?void 0:b.call(p))==null?void 0:g[0])||p.target,x=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(a.current||!x)&&p.preventDefault(),r(!0)}},u=p=>{const w=q0(p.code,l);X0(o,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[w]),p.key==="Meta"&&i.current.clear(),a.current=!1},f=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",u),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",u),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function X0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function q0(e,t){return t.includes(e)?"code":"key"}const PD=()=>{const e=ct();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:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,i],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:i,maxZoom:o,panZoom:l}=e.getState(),c=sx(t,r,a,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:r,snapGrid:a,snapToGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-c},h=n.snapGrid??a,u=n.snapToGrid??i;return Rl(d,r,u,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:i}=r.getBoundingClientRect(),o=Bd(t,n);return{x:o.x+a,y:o.y+i}}}),[])};function dN(e,t){const n=[],r=new Map,a=[];for(const i of e)if(i.type==="add"){a.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const o=r.get(i.id);o?o.push(i):r.set(i.id,[i])}for(const i of t){const o=r.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)AD(c,l);n.push(l)}return a.length&&a.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function AD(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 uN(e,t){return dN(e,t)}function hN(e,t){return dN(e,t)}function ea(e,t){return{id:e,type:"select",selected:t}}function hi(e,t=new Set,n=!1){const r=[];for(const[a,i]of e){const o=t.has(a);!(i.selected===void 0&&!o)&&i.selected!==o&&(n&&(i.selected=o),r.push(ea(i.id,o)))}return r}function G0({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const l=t.get(o.id),c=((a=l==null?void 0:l.internals)==null?void 0:a.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)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function K0(e){return{id:e.id,type:"remove"}}const Q0=e=>WM(e),OD=e=>D1(e);function fN(e){return m.forwardRef(e)}const zD=typeof window<"u"?m.useLayoutEffect:m.useEffect;function Z0(e){const[t,n]=m.useState(BigInt(0)),[r]=m.useState(()=>$D(()=>n(a=>a+BigInt(1))));return zD(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function $D(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const mN=m.createContext(null);function RD({children:e}){const t=ct(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:h,onNodesChange:u,nodeLookup:f,fitViewQueued:p}=t.getState();let w=c;for(const b of l)w=typeof b=="function"?b(w):b;const v=G0({items:w,lookup:f});h&&d(w),v.length>0?u==null||u(v):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:g,setNodes:y}=t.getState();b&&y(g)})},[]),r=Z0(n),a=m.useCallback(l=>{const{edges:c=[],setEdges:d,hasDefaultEdges:h,onEdgesChange:u,edgeLookup:f}=t.getState();let p=c;for(const w of l)p=typeof w=="function"?w(p):w;h?d(p):u&&u(G0({items:p,lookup:f}))},[]),i=Z0(a),o=m.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return s.jsx(mN.Provider,{value:o,children:e})}function ID(){const e=m.useContext(mN);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const LD=e=>!!e.panZoom;function dx(){const e=PD(),t=ct(),n=ID(),r=Be(LD),a=m.useMemo(()=>{const i=u=>t.getState().nodeLookup.get(u),o=u=>{n.nodeQueue.push(u)},l=u=>{n.edgeQueue.push(u)},c=u=>{var g,y;const{nodeLookup:f,nodeOrigin:p}=t.getState(),w=Q0(u)?u:f.get(u.id),v=w.parentId?$1(w.position,w.measured,w.parentId,f,p):w.position,b={...w,position:v,width:((g=w.measured)==null?void 0:g.width)??w.width,height:((y=w.measured)==null?void 0:y.height)??w.height};return $i(b)},d=(u,f,p={replace:!1})=>{o(w=>w.map(v=>{if(v.id===u){const b=typeof f=="function"?f(v):f;return p.replace&&Q0(b)?b:{...v,...b}}return v}))},h=(u,f,p={replace:!1})=>{l(w=>w.map(v=>{if(v.id===u){const b=typeof f=="function"?f(v):f;return p.replace&&OD(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(u=>({...u})),getNode:u=>{var f;return(f=i(u))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:u=[]}=t.getState();return u.map(f=>({...f}))},getEdge:u=>t.getState().edgeLookup.get(u),setNodes:o,setEdges:l,addNodes:u=>{const f=Array.isArray(u)?u:[u];n.nodeQueue.push(p=>[...p,...f])},addEdges:u=>{const f=Array.isArray(u)?u:[u];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:u=[],edges:f=[],transform:p}=t.getState(),[w,v,b]=p;return{nodes:u.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:w,y:v,zoom:b}}},deleteElements:async({nodes:u=[],edges:f=[]})=>{const{nodes:p,edges:w,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:g,triggerEdgeChanges:y,onDelete:x,onBeforeDelete:N}=t.getState(),{nodes:j,edges:k}=await qM({nodesToRemove:u,edgesToRemove:f,nodes:p,edges:w,onBeforeDelete:N}),S=k.length>0,M=j.length>0;if(S){const A=k.map(K0);b==null||b(k),y(A)}if(M){const A=j.map(K0);v==null||v(j),g(A)}return(M||S)&&(x==null||x({nodes:j,edges:k})),{deletedNodes:j,deletedEdges:k}},getIntersectingNodes:(u,f=!0,p)=>{const w=M0(u),v=w?u:c(u),b=p!==void 0;return v?(p||t.getState().nodes).filter(g=>{const y=t.getState().nodeLookup.get(g.id);if(y&&!w&&(g.id===u.id||!y.internals.positionAbsolute))return!1;const x=$i(b?g:y),N=gl(x,v);return f&&N>0||N>=x.width*x.height||N>=v.width*v.height}):[]},isNodeIntersecting:(u,f,p=!0)=>{const v=M0(u)?u:c(u);if(!v)return!1;const b=gl(v,f);return p&&b>0||b>=f.width*f.height||b>=v.width*v.height},updateNode:d,updateNodeData:(u,f,p={replace:!1})=>{d(u,w=>{const v=typeof f=="function"?f(w):f;return p.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},p)},updateEdge:h,updateEdgeData:(u,f,p={replace:!1})=>{h(u,w=>{const v=typeof f=="function"?f(w):f;return p.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},p)},getNodesBounds:u=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return HM(u,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:u,id:f,nodeId:p})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${p}-${u}${f?`-${f}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:u,handleId:f,nodeId:p})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${p}${u?f?`-${u}-${f}`:`-${u}`:""}`))==null?void 0:w.values())??[])},fitView:async u=>{const f=t.getState().fitViewResolver??ZM();return t.setState({fitViewQueued:!0,fitViewOptions:u,fitViewResolver:f}),n.nodeQueue.push(p=>[...p]),f.promise}}},[]);return m.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const J0=e=>e.selected,FD=typeof window<"u"?window:void 0;function UD({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ct(),{deleteElements:r}=dx(),a=yl(e,{actInsideInputWithModifier:!1}),i=yl(t,{target:FD});m.useEffect(()=>{if(a){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(J0),edges:o.filter(J0)}),n.setState({nodesSelectionActive:!1})}},[a]),m.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function BD(e){const t=ct();m.useEffect(()=>{const n=()=>{var a,i,o,l;if(!e.current||!(((i=(a=e.current).checkVisibility)==null?void 0:i.call(a))??!0))return!1;const r=ax(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Cr.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Au={position:"absolute",width:"100%",height:"100%",top:0,left:0},WD=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function HD({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=fa.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:d,minZoom:h,maxZoom:u,zoomActivationKeyCode:f,preventScrolling:p=!0,children:w,noWheelClassName:v,noPanClassName:b,onViewportChange:g,isControlledViewport:y,paneClickDistance:x}){const N=ct(),j=m.useRef(null),{userSelectionActive:k,lib:S,connectionInProgress:M}=Be(WD,gt),A=yl(f),I=m.useRef();BD(j);const U=m.useCallback($=>{g==null||g({x:$[0],y:$[1],zoom:$[2]}),y||N.setState({transform:$})},[g,y]);return m.useEffect(()=>{if(j.current){I.current=O_({domNode:j.current,minZoom:h,maxZoom:u,translateExtent:d,viewport:c,paneClickDistance:x,onDraggingChange:O=>N.setState({paneDragging:O}),onPanZoomStart:(O,D)=>{const{onViewportChangeStart:T,onMoveStart:C}=N.getState();C==null||C(O,D),T==null||T(D)},onPanZoom:(O,D)=>{const{onViewportChange:T,onMove:C}=N.getState();C==null||C(O,D),T==null||T(D)},onPanZoomEnd:(O,D)=>{const{onViewportChangeEnd:T,onMoveEnd:C}=N.getState();C==null||C(O,D),T==null||T(D)}});const{x:$,y:L,zoom:E}=I.current.getViewport();return N.setState({panZoom:I.current,transform:[$,L,E],domNode:j.current.closest(".react-flow")}),()=>{var O;(O=I.current)==null||O.destroy()}}},[]),m.useEffect(()=>{var $;($=I.current)==null||$.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:A,preventScrolling:p,noPanClassName:b,userSelectionActive:k,noWheelClassName:v,lib:S,onTransformChange:U,connectionInProgress:M})},[e,t,n,r,a,i,o,l,A,p,b,k,v,S,U,M]),s.jsx("div",{className:"react-flow__renderer",ref:j,style:Au,children:w})}const VD=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function YD(){const{userSelectionActive:e,userSelectionRect:t}=Be(VD,gt);return e&&t?s.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 Vh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},XD=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function qD({isSelecting:e,selectionKeyPressed:t,selectionMode:n=xl.Full,panOnDrag:r,selectionOnDrag:a,onSelectionStart:i,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:h,onPaneMouseMove:u,onPaneMouseLeave:f,children:p}){const w=ct(),{userSelectionActive:v,elementsSelectable:b,dragging:g,connectionInProgress:y}=Be(XD,gt),x=b&&(e||v),N=m.useRef(null),j=m.useRef(),k=m.useRef(new Set),S=m.useRef(new Set),M=m.useRef(!1),A=m.useRef(!1),I=T=>{if(M.current||y){M.current=!1;return}l==null||l(T),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},U=T=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){T.preventDefault();return}c==null||c(T)},$=d?T=>d(T):void 0,L=T=>{var P,B;const{resetSelectedElements:C,domNode:_}=w.getState();if(j.current=_==null?void 0:_.getBoundingClientRect(),!b||!e||T.button!==0||T.target!==N.current||!j.current)return;(B=(P=T.target)==null?void 0:P.setPointerCapture)==null||B.call(P,T.pointerId),A.current=!0,M.current=!1;const{x:z,y:H}=Zn(T.nativeEvent,j.current);C(),w.setState({userSelectionRect:{width:0,height:0,startX:z,startY:H,x:z,y:H}}),i==null||i(T)},E=T=>{const{userSelectionRect:C,transform:_,nodeLookup:z,edgeLookup:H,connectionLookup:P,triggerNodeChanges:B,triggerEdgeChanges:q,defaultEdgeOptions:G}=w.getState();if(!j.current||!C)return;M.current=!0;const{x:se,y:re}=Zn(T.nativeEvent,j.current),{startX:Z,startY:R}=C,ee={startX:Z,startY:R,x:se<Z?se:Z,y:re<R?re:R,width:Math.abs(se-Z),height:Math.abs(re-R)},J=k.current,F=S.current;k.current=new Set(rx(z,ee,_,n===xl.Partial,!0).map(ne=>ne.id)),S.current=new Set;const K=(G==null?void 0:G.selectable)??!0;for(const ne of k.current){const ce=P.get(ne);if(ce)for(const{edgeId:ge}of ce.values()){const ve=H.get(ge);ve&&(ve.selectable??K)&&S.current.add(ge)}}if(!_0(J,k.current)){const ne=hi(z,k.current,!0);B(ne)}if(!_0(F,S.current)){const ne=hi(H,S.current);q(ne)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},O=T=>{var _,z;if(T.button!==0||!A.current)return;(z=(_=T.target)==null?void 0:_.releasePointerCapture)==null||z.call(_,T.pointerId);const{userSelectionRect:C}=w.getState();!v&&C&&T.target===N.current&&(I==null||I(T)),w.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),o==null||o(T),(t||a)&&(M.current=!1),A.current=!1},D=r===!0||Array.isArray(r)&&r.includes(0);return s.jsxs("div",{className:Ct(["react-flow__pane",{draggable:D,dragging:g,selection:e}]),onClick:x?void 0:Vh(I,N),onContextMenu:Vh(U,N),onWheel:Vh($,N),onPointerEnter:x?void 0:h,onPointerDown:x?L:u,onPointerMove:x?E:u,onPointerUp:x?O:void 0,onPointerLeave:f,ref:N,style:Au,children:[p,s.jsx(YD,{})]})}function Tm({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),d=l.get(e);if(!d){c==null||c("012",Cr.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):a([e])}function pN({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:i,nodeClickDistance:o}){const l=ct(),[c,d]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=w_({getStoreItems:()=>l.getState(),onNodeMouseDown:u=>{Tm({id:u,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),m.useEffect(()=>{var u,f;if(t)(u=h.current)==null||u.destroy();else if(e.current)return(f=h.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:a,nodeClickDistance:o}),()=>{var p;(p=h.current)==null||p.destroy()}},[n,r,t,i,e,a]),c}const GD=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function xN(){const e=ct();return m.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:i,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:d,nodeOrigin:h}=e.getState(),u=new Map,f=GD(o),p=a?i[0]:5,w=a?i[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*w*n.factor;for(const[,g]of d){if(!f(g))continue;let y={x:g.internals.positionAbsolute.x+v,y:g.internals.positionAbsolute.y+b};a&&(y=$l(y,i));const{position:x,positionAbsolute:N}=T1({nodeId:g.id,nextPosition:y,nodeLookup:d,nodeExtent:r,nodeOrigin:h,onError:l});g.position=x,g.internals.positionAbsolute=N,u.set(g.id,g)}c(u)},[])}const ux=m.createContext(null),KD=ux.Provider;ux.Consumer;const gN=()=>m.useContext(ux),QD=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ZD=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:i,connection:o}=r,{fromHandle:l,toHandle:c,isValid:d}=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:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:i===Oi.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:!!a,valid:h&&d}};function JD({type:e="source",position:t=Ee.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:o,onConnect:l,children:c,className:d,onMouseDown:h,onTouchStart:u,...f},p){var O,D;const w=o||null,v=e==="target",b=ct(),g=gN(),{connectOnClick:y,noPanClassName:x,rfId:N}=Be(QD,gt),{connectingFrom:j,connectingTo:k,clickConnecting:S,isPossibleEndHandle:M,connectionInProcess:A,clickConnectionInProcess:I,valid:U}=Be(ZD(g,w,e),gt);g||(D=(O=b.getState()).onError)==null||D.call(O,"010",Cr.error010());const $=T=>{const{defaultEdgeOptions:C,onConnect:_,hasDefaultEdges:z}=b.getState(),H={...C,...T};if(z){const{edges:P,setEdges:B}=b.getState();B(W1(H,P))}_==null||_(H),l==null||l(H)},L=T=>{if(!g)return;const C=L1(T.nativeEvent);if(a&&(C&&T.button===0||!C)){const _=b.getState();Dm.onPointerDown(T.nativeEvent,{handleDomNode:T.currentTarget,autoPanOnConnect:_.autoPanOnConnect,connectionMode:_.connectionMode,connectionRadius:_.connectionRadius,domNode:_.domNode,nodeLookup:_.nodeLookup,lib:_.lib,isTarget:v,handleId:w,nodeId:g,flowId:_.rfId,panBy:_.panBy,cancelConnection:_.cancelConnection,onConnectStart:_.onConnectStart,onConnectEnd:_.onConnectEnd,updateConnection:_.updateConnection,onConnect:$,isValidConnection:n||_.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:_.autoPanSpeed,dragThreshold:_.connectionDragThreshold})}C?h==null||h(T):u==null||u(T)},E=T=>{const{onClickConnectStart:C,onClickConnectEnd:_,connectionClickStartHandle:z,connectionMode:H,isValidConnection:P,lib:B,rfId:q,nodeLookup:G,connection:se}=b.getState();if(!g||!z&&!a)return;if(!z){C==null||C(T.nativeEvent,{nodeId:g,handleId:w,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:g,type:e,id:w}});return}const re=R1(T.target),Z=n||P,{connection:R,isValid:ee}=Dm.isValid(T.nativeEvent,{handle:{nodeId:g,id:w,type:e},connectionMode:H,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:Z,flowId:q,doc:re,lib:B,nodeLookup:G});ee&&R&&$(R);const J=structuredClone(se);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,_==null||_(T,J),b.setState({connectionClickStartHandle:null})};return s.jsx("div",{"data-handleid":w,"data-nodeid":g,"data-handlepos":t,"data-id":`${N}-${g}-${w}-${e}`,className:Ct(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,d,{source:!v,target:v,connectable:r,connectablestart:a,connectableend:i,clickconnecting:S,connectingfrom:j,connectingto:k,valid:U,connectionindicator:r&&(!A||M)&&(A||I?i:a)}]),onMouseDown:L,onTouchStart:L,onClick:y?E:void 0,ref:p,...f,children:c})}const ma=m.memo(fN(JD));function eT({data:e,isConnectable:t,sourcePosition:n=Ee.Bottom}){return s.jsxs(s.Fragment,{children:[e==null?void 0:e.label,s.jsx(ma,{type:"source",position:n,isConnectable:t})]})}function tT({data:e,isConnectable:t,targetPosition:n=Ee.Top,sourcePosition:r=Ee.Bottom}){return s.jsxs(s.Fragment,{children:[s.jsx(ma,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,s.jsx(ma,{type:"source",position:r,isConnectable:t})]})}function nT(){return null}function rT({data:e,isConnectable:t,targetPosition:n=Ee.Top}){return s.jsxs(s.Fragment,{children:[s.jsx(ma,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Wd={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ev={input:eT,default:tT,output:rT,group:nT};function sT(e){var t,n,r,a;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??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const aT=e=>{const{width:t,height:n,x:r,y:a}=zl(e.nodeLookup,{filter:i=>!!i.selected});return{width:Qn(t)?t:null,height:Qn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function iT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ct(),{width:a,height:i,transformString:o,userSelectionActive:l}=Be(aT,gt),c=xN(),d=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=d.current)==null||f.focus({preventScroll:!0})},[n]),pN({nodeRef:d}),l||!a||!i)return null;const h=e?f=>{const p=r.getState().nodes.filter(w=>w.selected);e(f,p)}:void 0,u=f=>{Object.prototype.hasOwnProperty.call(Wd,f.key)&&(f.preventDefault(),c({direction:Wd[f.key],factor:f.shiftKey?4:1}))};return s.jsx("div",{className:Ct(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:s.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:u,style:{width:a,height:i}})})}const tv=typeof window<"u"?window:void 0,oT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function vN({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:h,selectionMode:u,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:w,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:x,panOnScroll:N,panOnScrollSpeed:j,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:M,defaultViewport:A,translateExtent:I,minZoom:U,maxZoom:$,preventScrolling:L,onSelectionContextMenu:E,noWheelClassName:O,noPanClassName:D,disableKeyboardA11y:T,onViewportChange:C,isControlledViewport:_}){const{nodesSelectionActive:z,userSelectionActive:H}=Be(oT),P=yl(d,{target:tv}),B=yl(v,{target:tv}),q=B||M,G=B||N,se=h&&q!==!0,re=P||H||se;return UD({deleteKeyCode:c,multiSelectionKeyCode:w}),s.jsx(HD,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:x,panOnScroll:G,panOnScrollSpeed:j,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:!P&&q,defaultViewport:A,translateExtent:I,minZoom:U,maxZoom:$,zoomActivationKeyCode:b,preventScrolling:L,noWheelClassName:O,noPanClassName:D,onViewportChange:C,isControlledViewport:_,paneClickDistance:l,children:s.jsxs(qD,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:q,isSelecting:!!re,selectionMode:u,selectionKeyPressed:P,selectionOnDrag:se,children:[e,z&&s.jsx(iT,{onSelectionContextMenu:E,noPanClassName:D,disableKeyboardA11y:T})]})})}vN.displayName="FlowRenderer";const lT=m.memo(vN),cT=e=>t=>e?rx(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 dT(e){return Be(m.useCallback(cT(e),[e]),gt)}const uT=e=>e.updateNodeInternals;function hT(){const e=Be(uT),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const i=a.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:a.target,force:!0})}),e(r)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function fT({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=ct(),i=m.useRef(null),o=m.useRef(null),l=m.useRef(e.sourcePosition),c=m.useRef(e.targetPosition),d=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{i.current&&!e.hidden&&(!h||o.current!==i.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(i.current),o.current=i.current)},[h,e.hidden]),m.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),m.useEffect(()=>{if(i.current){const u=d.current!==t,f=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(u||f||p)&&(d.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function mT({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:i,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:d,nodesFocusable:h,resizeObserver:u,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:w,rfId:v,nodeTypes:b,nodeClickDistance:g,onError:y}){const{node:x,internals:N,isParent:j}=Be(Z=>{const R=Z.nodeLookup.get(e),ee=Z.parentLookup.has(e);return{node:R,internals:R.internals,isParent:ee}},gt);let k=x.type||"default",S=(b==null?void 0:b[k])||ev[k];S===void 0&&(y==null||y("003",Cr.error003(k)),k="default",S=(b==null?void 0:b.default)||ev.default);const M=!!(x.draggable||l&&typeof x.draggable>"u"),A=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||d&&typeof x.connectable>"u"),U=!!(x.focusable||h&&typeof x.focusable>"u"),$=ct(),L=z1(x),E=fT({node:x,nodeType:k,hasDimensions:L,resizeObserver:u}),O=pN({nodeRef:E,disabled:x.hidden||!M,noDragClassName:f,handleSelector:x.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:g}),D=xN();if(x.hidden)return null;const T=ns(x),C=sT(x),_=A||M||t||n||r||a,z=n?Z=>n(Z,{...N.userNode}):void 0,H=r?Z=>r(Z,{...N.userNode}):void 0,P=a?Z=>a(Z,{...N.userNode}):void 0,B=i?Z=>i(Z,{...N.userNode}):void 0,q=o?Z=>o(Z,{...N.userNode}):void 0,G=Z=>{const{selectNodesOnDrag:R,nodeDragThreshold:ee}=$.getState();A&&(!R||!M||ee>0)&&Tm({id:e,store:$,nodeRef:E}),t&&t(Z,{...N.userNode})},se=Z=>{if(!(I1(Z.nativeEvent)||w)){if(C1.includes(Z.key)&&A){const R=Z.key==="Escape";Tm({id:e,store:$,unselect:R,nodeRef:E})}else if(M&&x.selected&&Object.prototype.hasOwnProperty.call(Wd,Z.key)){Z.preventDefault();const{ariaLabelConfig:R}=$.getState();$.setState({ariaLiveMessage:R["node.a11yDescription.ariaLiveMessage"]({direction:Z.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),D({direction:Wd[Z.key],factor:Z.shiftKey?4:1})}}},re=()=>{var ne;if(w||!((ne=E.current)!=null&&ne.matches(":focus-visible")))return;const{transform:Z,width:R,height:ee,autoPanOnNodeFocus:J,setCenter:F}=$.getState();if(!J)return;rx(new Map([[e,x]]),{x:0,y:0,width:R,height:ee},Z,!0).length>0||F(x.position.x+T.width/2,x.position.y+T.height/2,{zoom:Z[2]})};return s.jsx("div",{className:Ct(["react-flow__node",`react-flow__node-${k}`,{[p]:M},x.className,{selected:x.selected,selectable:A,parent:j,draggable:M,dragging:O}]),ref:E,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:_?"all":"none",visibility:L?"visible":"hidden",...x.style,...C},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:H,onMouseLeave:P,onContextMenu:B,onClick:G,onDoubleClick:q,onKeyDown:U?se:void 0,tabIndex:U?0:void 0,onFocus:U?re:void 0,role:x.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${oN}-${v}`,"aria-label":x.ariaLabel,...x.domAttributes,children:s.jsx(KD,{value:e,children:s.jsx(S,{id:e,data:x.data,type:k,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:x.selected??!1,selectable:A,draggable:M,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:O,dragHandle:x.dragHandle,zIndex:N.z,parentId:x.parentId,...T})})})}const pT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function wN(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:i}=Be(pT,gt),o=dT(e.onlyRenderVisibleElements),l=hT();return s.jsx("div",{className:"react-flow__nodes",style:Au,children:o.map(c=>s.jsx(mT,{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:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}wN.displayName="NodeRenderer";const xT=m.memo(wN);function gT(e){return Be(m.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const i=n.nodeLookup.get(a.source),o=n.nodeLookup.get(a.target);i&&o&&n_({sourceNode:i,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),gt)}const vT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return s.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},wT=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return s.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},nv={[Fd.Arrow]:vT,[Fd.ArrowClosed]:wT};function yT(e){const t=ct();return m.useMemo(()=>{var a,i;return Object.prototype.hasOwnProperty.call(nv,e)?nv[e]:((i=(a=t.getState()).onError)==null||i.call(a,"009",Cr.error009(e)),null)},[e])}const bT=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=yT(t);return c?s.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:s.jsx(c,{color:n,strokeWidth:o})}):null},yN=({defaultColor:e,rfId:t})=>{const n=Be(i=>i.edges),r=Be(i=>i.defaultEdgeOptions),a=m.useMemo(()=>c_(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?s.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:s.jsx("defs",{children:a.map(i=>s.jsx(bT,{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};yN.displayName="MarkerDefinitions";var NT=m.memo(yN);function bN({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:i,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...h}){const[u,f]=m.useState({x:1,y:0,width:0,height:0}),p=Ct(["react-flow__edge-textwrapper",d]),w=m.useRef(null);return m.useEffect(()=>{if(w.current){const v=w.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?s.jsxs("g",{transform:`translate(${e-u.width/2} ${t-u.height/2})`,className:p,visibility:u.width?"visible":"hidden",...h,children:[a&&s.jsx("rect",{width:u.width+2*o[0],x:-o[0],y:-o[1],height:u.height+2*o[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),s.jsx("text",{className:"react-flow__edge-text",y:u.height/2,dy:"0.3em",ref:w,style:r,children:n}),c]}):null}bN.displayName="EdgeText";const jT=m.memo(bN);function Ou({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:d=20,...h}){return s.jsxs(s.Fragment,{children:[s.jsx("path",{...h,d:e,fill:"none",className:Ct(["react-flow__edge-path",h.className])}),d?s.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&Qn(t)&&Qn(n)?s.jsx(jT,{x:t,y:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function rv({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Ee.Left||e===Ee.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function NN({sourceX:e,sourceY:t,sourcePosition:n=Ee.Bottom,targetX:r,targetY:a,targetPosition:i=Ee.Top}){const[o,l]=rv({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,d]=rv({pos:i,x1:r,y1:a,x2:e,y2:t}),[h,u,f,p]=F1({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${r},${a}`,h,u,f,p]}function jN(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:o,targetPosition:l,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:b,interactionWidth:g})=>{const[y,x,N]=NN({sourceX:n,sourceY:r,sourcePosition:o,targetX:a,targetY:i,targetPosition:l}),j=e.isInternal?void 0:t;return s.jsx(Ou,{id:j,path:y,labelX:x,labelY:N,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:b,interactionWidth:g})})}const kT=jN({isInternal:!1}),kN=jN({isInternal:!0});kT.displayName="SimpleBezierEdge";kN.displayName="SimpleBezierEdgeInternal";function SN(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,sourcePosition:p=Ee.Bottom,targetPosition:w=Ee.Top,markerEnd:v,markerStart:b,pathOptions:g,interactionWidth:y})=>{const[x,N,j]=Em({sourceX:n,sourceY:r,sourcePosition:p,targetX:a,targetY:i,targetPosition:w,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),k=e.isInternal?void 0:t;return s.jsx(Ou,{id:k,path:x,labelX:N,labelY:j,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,markerEnd:v,markerStart:b,interactionWidth:y})})}const CN=SN({isInternal:!1}),EN=SN({isInternal:!0});CN.displayName="SmoothStepEdge";EN.displayName="SmoothStepEdgeInternal";function MN(e){return m.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return s.jsx(CN,{...n,id:r,pathOptions:m.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const ST=MN({isInternal:!1}),_N=MN({isInternal:!0});ST.displayName="StepEdge";_N.displayName="StepEdgeInternal";function DN(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,markerEnd:p,markerStart:w,interactionWidth:v})=>{const[b,g,y]=H1({sourceX:n,sourceY:r,targetX:a,targetY:i}),x=e.isInternal?void 0:t;return s.jsx(Ou,{id:x,path:b,labelX:g,labelY:y,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,markerEnd:p,markerStart:w,interactionWidth:v})})}const CT=DN({isInternal:!1}),TN=DN({isInternal:!0});CT.displayName="StraightEdge";TN.displayName="StraightEdgeInternal";function PN(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:o=Ee.Bottom,targetPosition:l=Ee.Top,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:b,pathOptions:g,interactionWidth:y})=>{const[x,N,j]=U1({sourceX:n,sourceY:r,sourcePosition:o,targetX:a,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),k=e.isInternal?void 0:t;return s.jsx(Ou,{id:k,path:x,labelX:N,labelY:j,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:b,interactionWidth:y})})}const ET=PN({isInternal:!1}),AN=PN({isInternal:!0});ET.displayName="BezierEdge";AN.displayName="BezierEdgeInternal";const sv={default:AN,straight:TN,step:_N,smoothstep:EN,simplebezier:kN},av={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},MT=(e,t,n)=>n===Ee.Left?e-t:n===Ee.Right?e+t:e,_T=(e,t,n)=>n===Ee.Top?e-t:n===Ee.Bottom?e+t:e,iv="react-flow__edgeupdater";function ov({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:i,onMouseOut:o,type:l}){return s.jsx("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:o,className:Ct([iv,`${iv}-${l}`]),cx:MT(t,r,e),cy:_T(n,r,e),r,stroke:"transparent",fill:"transparent"})}function DT({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:d,onReconnectStart:h,onReconnectEnd:u,setReconnecting:f,setUpdateHover:p}){const w=ct(),v=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:k,domNode:S,isValidConnection:M,connectionMode:A,connectionRadius:I,lib:U,onConnectStart:$,onConnectEnd:L,cancelConnection:E,nodeLookup:O,rfId:D,panBy:T,updateConnection:C}=w.getState(),_=j.type==="target",z=(B,q)=>{f(!1),u==null||u(B,n,j.type,q)},H=B=>d==null?void 0:d(n,B),P=(B,q)=>{f(!0),h==null||h(N,n,j.type),$==null||$(B,q)};Dm.onPointerDown(N.nativeEvent,{autoPanOnConnect:k,connectionMode:A,connectionRadius:I,domNode:S,handleId:j.id,nodeId:j.nodeId,nodeLookup:O,isTarget:_,edgeUpdaterType:j.type,lib:U,flowId:D,cancelConnection:E,panBy:T,isValidConnection:M,onConnect:H,onConnectStart:P,onConnectEnd:L,onReconnectEnd:z,updateConnection:C,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},b=N=>v(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=N=>v(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>p(!0),x=()=>p(!1);return s.jsxs(s.Fragment,{children:[(e===!0||e==="source")&&s.jsx(ov,{position:l,centerX:r,centerY:a,radius:t,onMouseDown:b,onMouseEnter:y,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&s.jsx(ov,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:g,onMouseEnter:y,onMouseOut:x,type:"target"})]})}function TT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,reconnectRadius:h,onReconnect:u,onReconnectStart:f,onReconnectEnd:p,rfId:w,edgeTypes:v,noPanClassName:b,onError:g,disableKeyboardA11y:y}){let x=Be(F=>F.edgeLookup.get(e));const N=Be(F=>F.defaultEdgeOptions);x=N?{...N,...x}:x;let j=x.type||"default",k=(v==null?void 0:v[j])||sv[j];k===void 0&&(g==null||g("011",Cr.error011(j)),j="default",k=(v==null?void 0:v.default)||sv.default);const S=!!(x.focusable||t&&typeof x.focusable>"u"),M=typeof u<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),A=!!(x.selectable||r&&typeof x.selectable>"u"),I=m.useRef(null),[U,$]=m.useState(!1),[L,E]=m.useState(!1),O=ct(),{zIndex:D,sourceX:T,sourceY:C,targetX:_,targetY:z,sourcePosition:H,targetPosition:P}=Be(m.useCallback(F=>{const K=F.nodeLookup.get(x.source),ne=F.nodeLookup.get(x.target);if(!K||!ne)return{zIndex:x.zIndex,...av};const ce=l_({id:e,sourceNode:K,targetNode:ne,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:F.connectionMode,onError:g});return{zIndex:t_({selected:x.selected,zIndex:x.zIndex,sourceNode:K,targetNode:ne,elevateOnSelect:F.elevateEdgesOnSelect}),...ce||av}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),gt),B=m.useMemo(()=>x.markerStart?`url('#${Mm(x.markerStart,w)}')`:void 0,[x.markerStart,w]),q=m.useMemo(()=>x.markerEnd?`url('#${Mm(x.markerEnd,w)}')`:void 0,[x.markerEnd,w]);if(x.hidden||T===null||C===null||_===null||z===null)return null;const G=F=>{var ge;const{addSelectedEdges:K,unselectNodesAndEdges:ne,multiSelectionActive:ce}=O.getState();A&&(O.setState({nodesSelectionActive:!1}),x.selected&&ce?(ne({nodes:[],edges:[x]}),(ge=I.current)==null||ge.blur()):K([e])),a&&a(F,x)},se=i?F=>{i(F,{...x})}:void 0,re=o?F=>{o(F,{...x})}:void 0,Z=l?F=>{l(F,{...x})}:void 0,R=c?F=>{c(F,{...x})}:void 0,ee=d?F=>{d(F,{...x})}:void 0,J=F=>{var K;if(!y&&C1.includes(F.key)&&A){const{unselectNodesAndEdges:ne,addSelectedEdges:ce}=O.getState();F.key==="Escape"?((K=I.current)==null||K.blur(),ne({edges:[x]})):ce([e])}};return s.jsx("svg",{style:{zIndex:D},children:s.jsxs("g",{className:Ct(["react-flow__edge",`react-flow__edge-${j}`,x.className,b,{selected:x.selected,animated:x.animated,inactive:!A&&!a,updating:U,selectable:A}]),onClick:G,onDoubleClick:se,onContextMenu:re,onMouseEnter:Z,onMouseMove:R,onMouseLeave:ee,onKeyDown:S?J:void 0,tabIndex:S?0:void 0,role:x.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":S?`${lN}-${w}`:void 0,ref:I,...x.domAttributes,children:[!L&&s.jsx(k,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:A,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:T,sourceY:C,targetX:_,targetY:z,sourcePosition:H,targetPosition:P,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:B,markerEnd:q,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),M&&s.jsx(DT,{edge:x,isReconnectable:M,reconnectRadius:h,onReconnect:u,onReconnectStart:f,onReconnectEnd:p,sourceX:T,sourceY:C,targetX:_,targetY:z,sourcePosition:H,targetPosition:P,setUpdateHover:$,setReconnecting:E})]})})}const PT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ON({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:i,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:h,reconnectRadius:u,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:w,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:g,elementsSelectable:y,onError:x}=Be(PT,gt),N=gT(t);return s.jsxs("div",{className:"react-flow__edges",children:[s.jsx(NT,{defaultColor:e,rfId:n}),N.map(j=>s.jsx(TT,{id:j,edgesFocusable:b,edgesReconnectable:g,elementsSelectable:y,noPanClassName:a,onReconnect:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:h,reconnectRadius:u,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:w,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:v},j))]})}ON.displayName="EdgeRenderer";const AT=m.memo(ON),OT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function zT({children:e}){const t=Be(OT);return s.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function $T(e){const t=dx(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const RT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function IT(e){const t=Be(RT),n=ct();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function LT(e){return e.connection.inProgress?{...e.connection,to:Rl(e.connection.to,e.transform)}:{...e.connection}}function FT(e){return LT}function UT(e){const t=FT();return Be(t,gt)}const BT=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function WT({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:i,height:o,isValid:l,inProgress:c}=Be(BT,gt);return!(i&&a&&c)?null:s.jsx("svg",{style:e,width:i,height:o,className:"react-flow__connectionline react-flow__container",children:s.jsx("g",{className:Ct(["react-flow__connection",_1(l)]),children:s.jsx(zN,{style:t,type:n,CustomComponent:r,isValid:l})})})}const zN=({style:e,type:t=Ns.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:i,fromNode:o,fromHandle:l,fromPosition:c,to:d,toNode:h,toHandle:u,toPosition:f}=UT();if(!a)return;if(n)return s.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:f,connectionStatus:_1(r),toNode:h,toHandle:u});let p="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:f};switch(t){case Ns.Bezier:[p]=U1(w);break;case Ns.SimpleBezier:[p]=NN(w);break;case Ns.Step:[p]=Em({...w,borderRadius:0});break;case Ns.SmoothStep:[p]=Em(w);break;default:[p]=H1(w)}return s.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};zN.displayName="ConnectionLine";const HT={};function lv(e=HT){m.useRef(e),ct(),m.useEffect(()=>{},[e])}function VT(){ct(),m.useRef(!1),m.useEffect(()=>{},[])}function $N({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:i,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:u,onSelectionStart:f,onSelectionEnd:p,connectionLineType:w,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:g,selectionKeyCode:y,selectionOnDrag:x,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:k,zoomActivationKeyCode:S,deleteKeyCode:M,onlyRenderVisibleElements:A,elementsSelectable:I,defaultViewport:U,translateExtent:$,minZoom:L,maxZoom:E,preventScrolling:O,defaultMarkerColor:D,zoomOnScroll:T,zoomOnPinch:C,panOnScroll:_,panOnScrollSpeed:z,panOnScrollMode:H,zoomOnDoubleClick:P,panOnDrag:B,onPaneClick:q,onPaneMouseEnter:G,onPaneMouseMove:se,onPaneMouseLeave:re,onPaneScroll:Z,onPaneContextMenu:R,paneClickDistance:ee,nodeClickDistance:J,onEdgeContextMenu:F,onEdgeMouseEnter:K,onEdgeMouseMove:ne,onEdgeMouseLeave:ce,reconnectRadius:ge,onReconnect:ve,onReconnectStart:Ae,onReconnectEnd:Te,noDragClassName:tt,noWheelClassName:ut,noPanClassName:Le,disableKeyboardA11y:Oe,nodeExtent:Ge,rfId:Je,viewport:ot,onViewportChange:Ot}){return lv(e),lv(t),VT(),$T(n),IT(ot),s.jsx(lT,{onPaneClick:q,onPaneMouseEnter:G,onPaneMouseMove:se,onPaneMouseLeave:re,onPaneContextMenu:R,onPaneScroll:Z,paneClickDistance:ee,deleteKeyCode:M,selectionKeyCode:y,selectionOnDrag:x,selectionMode:N,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:j,panActivationKeyCode:k,zoomActivationKeyCode:S,elementsSelectable:I,zoomOnScroll:T,zoomOnPinch:C,zoomOnDoubleClick:P,panOnScroll:_,panOnScrollSpeed:z,panOnScrollMode:H,panOnDrag:B,defaultViewport:U,translateExtent:$,minZoom:L,maxZoom:E,onSelectionContextMenu:u,preventScrolling:O,noDragClassName:tt,noWheelClassName:ut,noPanClassName:Le,disableKeyboardA11y:Oe,onViewportChange:Ot,isControlledViewport:!!ot,children:s.jsxs(zT,{children:[s.jsx(AT,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:o,onReconnect:ve,onReconnectStart:Ae,onReconnectEnd:Te,onlyRenderVisibleElements:A,onEdgeContextMenu:F,onEdgeMouseEnter:K,onEdgeMouseMove:ne,onEdgeMouseLeave:ce,reconnectRadius:ge,defaultMarkerColor:D,noPanClassName:Le,disableKeyboardA11y:Oe,rfId:Je}),s.jsx(WT,{style:v,type:w,component:b,containerStyle:g}),s.jsx("div",{className:"react-flow__edgelabel-renderer"}),s.jsx(xT,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:h,nodeClickDistance:J,onlyRenderVisibleElements:A,noPanClassName:Le,noDragClassName:tt,disableKeyboardA11y:Oe,nodeExtent:Ge,rfId:Je}),s.jsx("div",{className:"react-flow__viewport-portal"})]})})}$N.displayName="GraphView";const YT=m.memo($N),cv=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:d=2,nodeOrigin:h,nodeExtent:u}={})=>{const f=new Map,p=new Map,w=new Map,v=new Map,b=r??t??[],g=n??e??[],y=h??[0,0],x=u??pl;Y1(w,v,b);const N=_m(g,f,p,{nodeOrigin:y,nodeExtent:x,elevateNodesOnSelect:!1});let j=[0,0,1];if(o&&a&&i){const k=zl(f,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:S,y:M,zoom:A}=sx(k,a,i,c,d,(l==null?void 0:l.padding)??.1);j=[S,M,A]}return{rfId:"1",width:a??0,height:i??0,transform:j,nodes:g,nodesInitialized:N,nodeLookup:f,parentLookup:p,edges:b,edgeLookup:v,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:pl,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Oi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:{...M1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:GM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:E1}},XT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u})=>fD((f,p)=>{async function w(){const{nodeLookup:v,panZoom:b,fitViewOptions:g,fitViewResolver:y,width:x,height:N,minZoom:j,maxZoom:k}=p();b&&(await XM({nodes:v,width:x,height:N,panZoom:b,minZoom:j,maxZoom:k},g),y==null||y.resolve(!0),f({fitViewResolver:null}))}return{...cv({nodes:e,edges:t,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:v=>{const{nodeLookup:b,parentLookup:g,nodeOrigin:y,elevateNodesOnSelect:x,fitViewQueued:N}=p(),j=_m(v,b,g,{nodeOrigin:y,nodeExtent:u,elevateNodesOnSelect:x,checkEquality:!0});N&&j?(w(),f({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:v,nodesInitialized:j})},setEdges:v=>{const{connectionLookup:b,edgeLookup:g}=p();Y1(b,g,v),f({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:g}=p();g(v),f({hasDefaultNodes:!0})}if(b){const{setEdges:g}=p();g(b),f({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:g,parentLookup:y,domNode:x,nodeOrigin:N,nodeExtent:j,debug:k,fitViewQueued:S}=p(),{changes:M,updatedInternals:A}=p_(v,g,y,x,N,j);A&&(u_(g,y,{nodeOrigin:N,nodeExtent:j}),S?(w(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(M==null?void 0:M.length)>0&&(k&&console.log("React Flow: trigger node changes",M),b==null||b(M)))},updateNodePositions:(v,b=!1)=>{const g=[],y=[],{nodeLookup:x,triggerNodeChanges:N}=p();for(const[j,k]of v){const S=x.get(j),M=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(k!=null&&k.position)),A={id:j,type:"position",position:M?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:b};M&&S.parentId&&g.push({id:j,parentId:S.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),y.push(A)}if(g.length>0){const{parentLookup:j,nodeOrigin:k}=p(),S=cx(g,x,j,k);y.push(...S)}N(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:g,nodes:y,hasDefaultNodes:x,debug:N}=p();if(v!=null&&v.length){if(x){const j=uN(v,y);g(j)}N&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:g,edges:y,hasDefaultEdges:x,debug:N}=p();if(v!=null&&v.length){if(x){const j=hN(v,y);g(j)}N&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:g,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:N}=p();if(b){const j=v.map(k=>ea(k,!0));x(j);return}x(hi(y,new Set([...v]),!0)),N(hi(g))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:g,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:N}=p();if(b){const j=v.map(k=>ea(k,!0));N(j);return}N(hi(g,new Set([...v]))),x(hi(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:g,nodes:y,nodeLookup:x,triggerNodeChanges:N,triggerEdgeChanges:j}=p(),k=v||y,S=b||g,M=k.map(I=>{const U=x.get(I.id);return U&&(U.selected=!1),ea(I.id,!1)}),A=S.map(I=>ea(I.id,!1));N(M),j(A)},setMinZoom:v=>{const{panZoom:b,maxZoom:g}=p();b==null||b.setScaleExtent([v,g]),f({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:g}=p();b==null||b.setScaleExtent([g,v]),f({maxZoom:v})},setTranslateExtent:v=>{var b;(b=p().panZoom)==null||b.setTranslateExtent(v),f({translateExtent:v})},setPaneClickDistance:v=>{var b;(b=p().panZoom)==null||b.setClickDistance(v)},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:g,triggerEdgeChanges:y,elementsSelectable:x}=p();if(!x)return;const N=b.reduce((k,S)=>S.selected?[...k,ea(S.id,!1)]:k,[]),j=v.reduce((k,S)=>S.selected?[...k,ea(S.id,!1)]:k,[]);g(N),y(j)},setNodeExtent:v=>{const{nodes:b,nodeLookup:g,parentLookup:y,nodeOrigin:x,elevateNodesOnSelect:N,nodeExtent:j}=p();v[0][0]===j[0][0]&&v[0][1]===j[0][1]&&v[1][0]===j[1][0]&&v[1][1]===j[1][1]||(_m(b,g,y,{nodeOrigin:x,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1}),f({nodeExtent:v}))},panBy:v=>{const{transform:b,width:g,height:y,panZoom:x,translateExtent:N}=p();return x_({delta:v,panZoom:x,transform:b,translateExtent:N,width:g,height:y})},setCenter:async(v,b,g)=>{const{width:y,height:x,maxZoom:N,panZoom:j}=p();if(!j)return Promise.resolve(!1);const k=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:N;return await j.setViewport({x:y/2-v*k,y:x/2-b*k,zoom:k},{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:{...M1}})},updateConnection:v=>{f({connection:v})},reset:()=>f({...cv()})}},Object.is);function qT({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:i,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:d,nodeOrigin:h,nodeExtent:u,children:f}){const[p]=m.useState(()=>XT({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:h,nodeExtent:u}));return s.jsx(mD,{value:p,children:s.jsx(RD,{children:f})})}function GT({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:i,height:o,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:h,nodeOrigin:u,nodeExtent:f}){return m.useContext(Tu)?s.jsx(s.Fragment,{children:e}):s.jsx(qT,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:i,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:h,nodeOrigin:u,nodeExtent:f,children:e})}const KT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function QT({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:i,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:h,onMoveStart:u,onMoveEnd:f,onConnect:p,onConnectStart:w,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:g,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:k,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:A,onNodesDelete:I,onEdgesDelete:U,onDelete:$,onSelectionChange:L,onSelectionDragStart:E,onSelectionDrag:O,onSelectionDragStop:D,onSelectionContextMenu:T,onSelectionStart:C,onSelectionEnd:_,onBeforeDelete:z,connectionMode:H,connectionLineType:P=Ns.Bezier,connectionLineStyle:B,connectionLineComponent:q,connectionLineContainerStyle:G,deleteKeyCode:se="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:Z=!1,selectionMode:R=xl.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:J=vl()?"Meta":"Control",zoomActivationKeyCode:F=vl()?"Meta":"Control",snapToGrid:K,snapGrid:ne,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:ge,nodesDraggable:ve,autoPanOnNodeFocus:Ae,nodesConnectable:Te,nodesFocusable:tt,nodeOrigin:ut=cN,edgesFocusable:Le,edgesReconnectable:Oe,elementsSelectable:Ge=!0,defaultViewport:Je=ED,minZoom:ot=.5,maxZoom:Ot=2,translateExtent:zt=pl,preventScrolling:ae=!0,nodeExtent:me,defaultMarkerColor:ze="#b1b1b7",zoomOnScroll:X=!0,zoomOnPinch:le=!0,panOnScroll:W=!1,panOnScrollSpeed:te=.5,panOnScrollMode:de=fa.Free,zoomOnDoubleClick:Ne=!0,panOnDrag:Se=!0,onPaneClick:ue,onPaneMouseEnter:Pe,onPaneMouseMove:_e,onPaneMouseLeave:Fe,onPaneScroll:bt,onPaneContextMenu:he,paneClickDistance:Ve=0,nodeClickDistance:vt=0,children:Nt,onReconnect:En,onReconnectStart:Qe,onReconnectEnd:$t,onEdgeContextMenu:lr,onEdgeDoubleClick:qt,onEdgeMouseEnter:Rt,onEdgeMouseMove:La,onEdgeMouseLeave:hn,reconnectRadius:Yl=10,onNodesChange:eo,onEdgesChange:to,noDragClassName:eh="nodrag",noWheelClassName:th="nowheel",noPanClassName:qs="nopan",fitView:no,fitViewOptions:Xl,connectOnClick:Fa,attributionPosition:Ua,proOptions:Ba,defaultEdgeOptions:rs,elevateNodesOnSelect:Ar,elevateEdgesOnSelect:ss,disableKeyboardA11y:Gs=!1,autoPanOnConnect:ql,autoPanOnNodeDrag:nh,autoPanSpeed:as,connectionRadius:is,isValidConnection:ro,onError:rh,style:sh,id:ah,nodeDragThreshold:ih,connectionDragThreshold:nt,viewport:Gl,onViewportChange:Kl,width:oh,height:so,colorMode:Ql="light",debug:lh,onScroll:Wa,ariaLabelConfig:Zl,...fe},xe){const pe=ah||"1",ie=TD(Ql),be=m.useCallback(Ce=>{Ce.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Wa==null||Wa(Ce)},[Wa]);return s.jsx("div",{"data-testid":"rf__wrapper",...fe,onScroll:be,style:{...sh,...KT},ref:xe,className:Ct(["react-flow",a,ie]),id:ah,role:"application",children:s.jsxs(GT,{nodes:e,edges:t,width:oh,height:so,fitView:no,fitViewOptions:Xl,minZoom:ot,maxZoom:Ot,nodeOrigin:ut,nodeExtent:me,children:[s.jsx(YT,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:o,connectionLineType:P,connectionLineStyle:B,connectionLineComponent:q,connectionLineContainerStyle:G,selectionKeyCode:re,selectionOnDrag:Z,selectionMode:R,deleteKeyCode:se,multiSelectionKeyCode:J,panActivationKeyCode:ee,zoomActivationKeyCode:F,onlyRenderVisibleElements:ce,defaultViewport:Je,translateExtent:zt,minZoom:ot,maxZoom:Ot,preventScrolling:ae,zoomOnScroll:X,zoomOnPinch:le,zoomOnDoubleClick:Ne,panOnScroll:W,panOnScrollSpeed:te,panOnScrollMode:de,panOnDrag:Se,onPaneClick:ue,onPaneMouseEnter:Pe,onPaneMouseMove:_e,onPaneMouseLeave:Fe,onPaneScroll:bt,onPaneContextMenu:he,paneClickDistance:Ve,nodeClickDistance:vt,onSelectionContextMenu:T,onSelectionStart:C,onSelectionEnd:_,onReconnect:En,onReconnectStart:Qe,onReconnectEnd:$t,onEdgeContextMenu:lr,onEdgeDoubleClick:qt,onEdgeMouseEnter:Rt,onEdgeMouseMove:La,onEdgeMouseLeave:hn,reconnectRadius:Yl,defaultMarkerColor:ze,noDragClassName:eh,noWheelClassName:th,noPanClassName:qs,rfId:pe,disableKeyboardA11y:Gs,nodeExtent:me,viewport:Gl,onViewportChange:Kl}),s.jsx(DD,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:w,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:g,nodesDraggable:ve,autoPanOnNodeFocus:Ae,nodesConnectable:Te,nodesFocusable:tt,edgesFocusable:Le,edgesReconnectable:Oe,elementsSelectable:Ge,elevateNodesOnSelect:Ar,elevateEdgesOnSelect:ss,minZoom:ot,maxZoom:Ot,nodeExtent:me,onNodesChange:eo,onEdgesChange:to,snapToGrid:K,snapGrid:ne,connectionMode:H,translateExtent:zt,connectOnClick:Fa,defaultEdgeOptions:rs,fitView:no,fitViewOptions:Xl,onNodesDelete:I,onEdgesDelete:U,onDelete:$,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:A,onSelectionDrag:O,onSelectionDragStart:E,onSelectionDragStop:D,onMove:h,onMoveStart:u,onMoveEnd:f,noPanClassName:qs,nodeOrigin:ut,rfId:pe,autoPanOnConnect:ql,autoPanOnNodeDrag:nh,autoPanSpeed:as,onError:rh,connectionRadius:is,isValidConnection:ro,selectNodesOnDrag:ge,nodeDragThreshold:ih,connectionDragThreshold:nt,onBeforeDelete:z,paneClickDistance:Ve,debug:lh,ariaLabelConfig:Zl}),s.jsx(CD,{onSelectionChange:L}),Nt,s.jsx(bD,{proOptions:Ba,position:Ua}),s.jsx(yD,{rfId:pe,disableKeyboardA11y:Gs})]})})}var ZT=fN(QT);function JT(e){const[t,n]=m.useState(e),r=m.useCallback(a=>n(i=>uN(a,i)),[]);return[t,n,r]}function eP(e){const[t,n]=m.useState(e),r=m.useCallback(a=>n(i=>hN(a,i)),[]);return[t,n,r]}function tP({dimensions:e,lineWidth:t,variant:n,className:r}){return s.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ct(["react-flow__background-pattern",n,r])})}function nP({radius:e,className:t}){return s.jsx("circle",{cx:e,cy:e,r:e,className:Ct(["react-flow__background-pattern","dots",t])})}var Yr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Yr||(Yr={}));const rP={[Yr.Dots]:1,[Yr.Lines]:1,[Yr.Cross]:6},sP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function RN({id:e,variant:t=Yr.Dots,gap:n=20,size:r,lineWidth:a=1,offset:i=0,color:o,bgColor:l,style:c,className:d,patternClassName:h}){const u=m.useRef(null),{transform:f,patternId:p}=Be(sP,gt),w=r||rP[t],v=t===Yr.Dots,b=t===Yr.Cross,g=Array.isArray(n)?n:[n,n],y=[g[0]*f[2]||1,g[1]*f[2]||1],x=w*f[2],N=Array.isArray(i)?i:[i,i],j=b?[x,x]:y,k=[N[0]*f[2]||1+j[0]/2,N[1]*f[2]||1+j[1]/2],S=`${p}${e||""}`;return s.jsxs("svg",{className:Ct(["react-flow__background",d]),style:{...c,...Au,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:u,"data-testid":"rf__background",children:[s.jsx("pattern",{id:S,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:v?s.jsx(nP,{radius:x/2,className:h}):s.jsx(tP,{dimensions:j,lineWidth:a,variant:t,className:h})}),s.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}RN.displayName="Background";const aP=m.memo(RN);function iP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:s.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function oP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:s.jsx("path",{d:"M0 0h32v4.2H0z"})})}function lP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:s.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 cP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:s.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 dP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:s.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 Sc({children:e,className:t,...n}){return s.jsx("button",{type:"button",className:Ct(["react-flow__controls-button",t]),...n,children:e})}const uP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function IN({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:d,children:h,position:u="bottom-left",orientation:f="vertical","aria-label":p}){const w=ct(),{isInteractive:v,minZoomReached:b,maxZoomReached:g,ariaLabelConfig:y}=Be(uP,gt),{zoomIn:x,zoomOut:N,fitView:j}=dx(),k=()=>{x(),i==null||i()},S=()=>{N(),o==null||o()},M=()=>{j(a),l==null||l()},A=()=>{w.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c==null||c(!v)},I=f==="horizontal"?"horizontal":"vertical";return s.jsxs(Pu,{className:Ct(["react-flow__controls",I,d]),position:u,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&s.jsxs(s.Fragment,{children:[s.jsx(Sc,{onClick:k,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:g,children:s.jsx(iP,{})}),s.jsx(Sc,{onClick:S,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:b,children:s.jsx(oP,{})})]}),n&&s.jsx(Sc,{className:"react-flow__controls-fitview",onClick:M,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:s.jsx(lP,{})}),r&&s.jsx(Sc,{className:"react-flow__controls-interactive",onClick:A,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:v?s.jsx(dP,{}):s.jsx(cP,{})}),h]})}IN.displayName="Controls";const hP=m.memo(IN);function fP({id:e,x:t,y:n,width:r,height:a,style:i,color:o,strokeColor:l,strokeWidth:c,className:d,borderRadius:h,shapeRendering:u,selected:f,onClick:p}){const{background:w,backgroundColor:v}=i||{},b=o||w||v;return s.jsx("rect",{className:Ct(["react-flow__minimap-node",{selected:f},d]),x:t,y:n,rx:h,ry:h,width:r,height:a,style:{fill:b,stroke:l,strokeWidth:c},shapeRendering:u,onClick:p?g=>p(g,e):void 0})}const mP=m.memo(fP),pP=e=>e.nodes.map(t=>t.id),Yh=e=>e instanceof Function?e:()=>e;function xP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:i=mP,onClick:o}){const l=Be(pP,gt),c=Yh(t),d=Yh(e),h=Yh(n),u=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return s.jsx(s.Fragment,{children:l.map(f=>s.jsx(vP,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:i,onClick:o,shapeRendering:u},f))})}function gP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:i,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:d,x:h,y:u,width:f,height:p}=Be(w=>{const{internals:v}=w.nodeLookup.get(e),b=v.userNode,{x:g,y}=v.positionAbsolute,{width:x,height:N}=ns(b);return{node:b,x:g,y,width:x,height:N}},gt);return!d||d.hidden||!z1(d)?null:s.jsx(l,{x:h,y:u,width:f,height:p,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:a,strokeColor:n(d),strokeWidth:i,shapeRendering:o,onClick:c,id:d.id})}const vP=m.memo(gP);var wP=m.memo(xP);const yP=200,bP=150,NP=e=>!e.hidden,jP=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?O1(zl(e.nodeLookup,{filter:NP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},kP="react-flow__minimap-desc";function LN({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:d,maskStrokeColor:h,maskStrokeWidth:u,position:f="bottom-right",onClick:p,onNodeClick:w,pannable:v=!1,zoomable:b=!1,ariaLabel:g,inversePan:y,zoomStep:x=1,offsetScale:N=5}){const j=ct(),k=m.useRef(null),{boundingRect:S,viewBB:M,rfId:A,panZoom:I,translateExtent:U,flowWidth:$,flowHeight:L,ariaLabelConfig:E}=Be(jP,gt),O=(e==null?void 0:e.width)??yP,D=(e==null?void 0:e.height)??bP,T=S.width/O,C=S.height/D,_=Math.max(T,C),z=_*O,H=_*D,P=N*_,B=S.x-(z-S.width)/2-P,q=S.y-(H-S.height)/2-P,G=z+P*2,se=H+P*2,re=`${kP}-${A}`,Z=m.useRef(0),R=m.useRef();Z.current=_,m.useEffect(()=>{if(k.current&&I)return R.current=S_({domNode:k.current,panZoom:I,getTransform:()=>j.getState().transform,getViewScale:()=>Z.current}),()=>{var K;(K=R.current)==null||K.destroy()}},[I]),m.useEffect(()=>{var K;(K=R.current)==null||K.update({translateExtent:U,width:$,height:L,inversePan:y,pannable:v,zoomStep:x,zoomable:b})},[v,b,y,x,U,$,L]);const ee=p?K=>{var ge;const[ne,ce]=((ge=R.current)==null?void 0:ge.pointer(K))||[0,0];p(K,{x:ne,y:ce})}:void 0,J=w?m.useCallback((K,ne)=>{const ce=j.getState().nodeLookup.get(ne).internals.userNode;w(K,ce)},[]):void 0,F=g??E["minimap.ariaLabel"];return s.jsx(Pu,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof u=="number"?u*_:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r: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:Ct(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:s.jsxs("svg",{width:O,height:D,viewBox:`${B} ${q} ${G} ${se}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:k,onClick:ee,children:[F&&s.jsx("title",{id:re,children:F}),s.jsx(wP,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:o,nodeComponent:l}),s.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-P},${q-P}h${G+P*2}v${se+P*2}h${-G-P*2}z
89
+ M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}LN.displayName="MiniMap";const SP=m.memo(LN),CP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,EP={[Ii.Line]:"right",[Ii.Handle]:"bottom-right"};function MP({nodeId:e,position:t,variant:n=Ii.Handle,className:r,style:a=void 0,children:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:u=!1,resizeDirection:f,autoScale:p=!0,shouldResize:w,onResizeStart:v,onResize:b,onResizeEnd:g}){const y=gN(),x=typeof e=="string"?e:y,N=ct(),j=m.useRef(null),k=n===Ii.Handle,S=Be(m.useCallback(CP(k&&p),[k,p]),gt),M=m.useRef(null),A=t??EP[n];m.useEffect(()=>{if(!(!j.current||!x))return M.current||(M.current=U_({domNode:j.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:U,transform:$,snapGrid:L,snapToGrid:E,nodeOrigin:O,domNode:D}=N.getState();return{nodeLookup:U,transform:$,snapGrid:L,snapToGrid:E,nodeOrigin:O,paneDomNode:D}},onChange:(U,$)=>{const{triggerNodeChanges:L,nodeLookup:E,parentLookup:O,nodeOrigin:D}=N.getState(),T=[],C={x:U.x,y:U.y},_=E.get(x);if(_&&_.expandParent&&_.parentId){const z=_.origin??D,H=U.width??_.measured.width??0,P=U.height??_.measured.height??0,B={id:_.id,parentId:_.parentId,rect:{width:H,height:P,...$1({x:U.x??_.position.x,y:U.y??_.position.y},{width:H,height:P},_.parentId,E,z)}},q=cx([B],E,O,D);T.push(...q),C.x=U.x?Math.max(z[0]*H,U.x):void 0,C.y=U.y?Math.max(z[1]*P,U.y):void 0}if(C.x!==void 0&&C.y!==void 0){const z={id:x,type:"position",position:{...C}};T.push(z)}if(U.width!==void 0&&U.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};T.push(H)}for(const z of $){const H={...z,type:"position"};T.push(H)}L(T)},onEnd:({width:U,height:$})=>{const L={id:x,type:"dimensions",resizing:!1,dimensions:{width:U,height:$}};N.getState().triggerNodeChanges([L])}})),M.current.update({controlPosition:A,boundaries:{minWidth:l,minHeight:c,maxWidth:d,maxHeight:h},keepAspectRatio:u,resizeDirection:f,onResizeStart:v,onResize:b,onResizeEnd:g,shouldResize:w}),()=>{var U;(U=M.current)==null||U.destroy()}},[A,l,c,d,h,u,v,b,g,w]);const I=A.split("-");return s.jsx("div",{className:Ct(["react-flow__resize-control","nodrag",...I,n,r]),ref:j,style:{...a,scale:S,...o&&{[k?"backgroundColor":"borderColor"]:o}},children:i})}m.memo(MP);/**
90
+ * @license lucide-react v0.294.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */var _P={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"};/**
95
+ * @license lucide-react v0.294.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const DP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Me=(e,t)=>{const n=m.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...d},h)=>m.createElement("svg",{ref:h,..._P,width:a,height:a,stroke:r,strokeWidth:o?Number(i)*24/Number(a):i,className:["lucide",`lucide-${DP(e)}`,l].join(" "),...d},[...t.map(([u,f])=>m.createElement(u,f)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
100
+ * @license lucide-react v0.294.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const ur=Me("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"}]]);/**
105
+ * @license lucide-react v0.294.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const TP=Me("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
110
+ * @license lucide-react v0.294.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const PP=Me("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
115
+ * @license lucide-react v0.294.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const Cc=Me("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
120
+ * @license lucide-react v0.294.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const dv=Me("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"}]]);/**
125
+ * @license lucide-react v0.294.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const AP=Me("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"}]]);/**
130
+ * @license lucide-react v0.294.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const pr=Me("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"}]]);/**
135
+ * @license lucide-react v0.294.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const Hd=Me("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"}]]);/**
140
+ * @license lucide-react v0.294.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Et=Me("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"}]]);/**
145
+ * @license lucide-react v0.294.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const OP=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
150
+ * @license lucide-react v0.294.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const zu=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
155
+ * @license lucide-react v0.294.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const FN=Me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
160
+ * @license lucide-react v0.294.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const hx=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
165
+ * @license lucide-react v0.294.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const zP=Me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
170
+ * @license lucide-react v0.294.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const uv=Me("Clock1",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 14.5 8",key:"12zbmj"}]]);/**
175
+ * @license lucide-react v0.294.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const Ec=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
180
+ * @license lucide-react v0.294.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const hv=Me("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
185
+ * @license lucide-react v0.294.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const mt=Me("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"}]]);/**
190
+ * @license lucide-react v0.294.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const UN=Me("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"}]]);/**
195
+ * @license lucide-react v0.294.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const $P=Me("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"}]]);/**
200
+ * @license lucide-react v0.294.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const Il=Me("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"}]]);/**
205
+ * @license lucide-react v0.294.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const fx=Me("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
210
+ * @license lucide-react v0.294.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const RP=Me("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"}]]);/**
215
+ * @license lucide-react v0.294.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const IP=Me("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
220
+ * @license lucide-react v0.294.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const Ht=Me("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"}]]);/**
225
+ * @license lucide-react v0.294.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const LP=Me("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"}]]);/**
230
+ * @license lucide-react v0.294.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const Mc=Me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
235
+ * @license lucide-react v0.294.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const Vd=Me("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"}]]);/**
240
+ * @license lucide-react v0.294.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const FP=Me("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"}]]);/**
245
+ * @license lucide-react v0.294.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const Xr=Me("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"}]]);/**
250
+ * @license lucide-react v0.294.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const nd=Me("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"}]]);/**
255
+ * @license lucide-react v0.294.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const Yd=Me("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"}]]);/**
260
+ * @license lucide-react v0.294.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const UP=Me("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"}]]);/**
265
+ * @license lucide-react v0.294.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const BP=Me("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"}]]);/**
270
+ * @license lucide-react v0.294.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const Ca=Me("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"}]]);/**
275
+ * @license lucide-react v0.294.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const zs=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
280
+ * @license lucide-react v0.294.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const fv=Me("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"}]]);/**
285
+ * @license lucide-react v0.294.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const mv=Me("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"}]]);/**
290
+ * @license lucide-react v0.294.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const Ea=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
295
+ * @license lucide-react v0.294.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const bi=Me("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"}]]);/**
300
+ * @license lucide-react v0.294.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const Mn=Me("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
305
+ * @license lucide-react v0.294.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const WP=Me("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
310
+ * @license lucide-react v0.294.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const HP=Me("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
315
+ * @license lucide-react v0.294.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const pv=Me("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"}]]);/**
320
+ * @license lucide-react v0.294.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const mx=Me("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"}]]);/**
325
+ * @license lucide-react v0.294.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const Pm=Me("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"}]]);/**
330
+ * @license lucide-react v0.294.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const xv=Me("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"}]]);/**
335
+ * @license lucide-react v0.294.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const Ma=Me("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"}]]);/**
340
+ * @license lucide-react v0.294.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const BN=Me("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"}]]);/**
345
+ * @license lucide-react v0.294.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const ra=Me("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"}]]);/**
350
+ * @license lucide-react v0.294.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const Pt=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
355
+ * @license lucide-react v0.294.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const Xh=Me("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function WN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=WN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xd(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=WN(e))&&(r&&(r+=" "),r+=t);return r}const px="-",VP=e=>{const t=XP(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(px);return l[0]===""&&l.length!==1&&l.shift(),HN(l,t)||YP(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},HN=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?HN(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(px);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},gv=/^\[(.+)\]$/,YP=e=>{if(gv.test(e)){const t=gv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},XP=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return GP(Object.entries(e.classGroups),n).forEach(([i,o])=>{Am(o,r,i,t)}),r},Am=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:vv(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(qP(a)){Am(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{Am(o,vv(t,i),n,r)})})},vv=(e,t)=>{let n=e;return t.split(px).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},qP=e=>e.isThemeGetter,GP=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,a]}):e,KP=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},VN="!",QP=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let d=0,h=0,u;for(let b=0;b<l.length;b++){let g=l[b];if(d===0){if(g===a&&(r||l.slice(b,b+i)===t)){c.push(l.slice(h,b)),h=b+i;continue}if(g==="/"){u=b;continue}}g==="["?d++:g==="]"&&d--}const f=c.length===0?l:l.substring(h),p=f.startsWith(VN),w=p?f.substring(1):f,v=u&&u>h?u-h:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},ZP=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},JP=e=>({cache:KP(e.cacheSize),parseClassName:QP(e),...VP(e)}),eA=/\s+/,tA=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(eA);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:h,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:p}=n(d);let w=!!p,v=r(w?f.substring(0,p):f);if(!v){if(!w){l=d+(l.length>0?" "+l:l);continue}if(v=r(f),!v){l=d+(l.length>0?" "+l:l);continue}w=!1}const b=ZP(h).join(":"),g=u?b+VN:b,y=g+v;if(i.includes(y))continue;i.push(y);const x=a(v,w);for(let N=0;N<x.length;++N){const j=x[N];i.push(g+j)}l=d+(l.length>0?" "+l:l)}return l};function nA(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=YN(t))&&(r&&(r+=" "),r+=n);return r}const YN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=YN(e[r]))&&(n&&(n+=" "),n+=t);return n};function rA(e,...t){let n,r,a,i=o;function o(c){const d=t.reduce((h,u)=>u(h),e());return n=JP(d),r=n.cache.get,a=n.cache.set,i=l,l(c)}function l(c){const d=r(c);if(d)return d;const h=tA(c,n);return a(c,h),h}return function(){return i(nA.apply(null,arguments))}}const rt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},XN=/^\[(?:([a-z-]+):)?(.+)\]$/i,sA=/^\d+\/\d+$/,aA=new Set(["px","full","screen"]),iA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oA=/\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$/,lA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zr=e=>Ni(e)||aA.has(e)||sA.test(e),us=e=>Ki(e,"length",vA),Ni=e=>!!e&&!Number.isNaN(Number(e)),qh=e=>Ki(e,"number",Ni),go=e=>!!e&&Number.isInteger(Number(e)),uA=e=>e.endsWith("%")&&Ni(e.slice(0,-1)),$e=e=>XN.test(e),hs=e=>iA.test(e),hA=new Set(["length","size","percentage"]),fA=e=>Ki(e,hA,qN),mA=e=>Ki(e,"position",qN),pA=new Set(["image","url"]),xA=e=>Ki(e,pA,yA),gA=e=>Ki(e,"",wA),vo=()=>!0,Ki=(e,t,n)=>{const r=XN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},vA=e=>oA.test(e)&&!lA.test(e),qN=()=>!1,wA=e=>cA.test(e),yA=e=>dA.test(e),bA=()=>{const e=rt("colors"),t=rt("spacing"),n=rt("blur"),r=rt("brightness"),a=rt("borderColor"),i=rt("borderRadius"),o=rt("borderSpacing"),l=rt("borderWidth"),c=rt("contrast"),d=rt("grayscale"),h=rt("hueRotate"),u=rt("invert"),f=rt("gap"),p=rt("gradientColorStops"),w=rt("gradientColorStopPositions"),v=rt("inset"),b=rt("margin"),g=rt("opacity"),y=rt("padding"),x=rt("saturate"),N=rt("scale"),j=rt("sepia"),k=rt("skew"),S=rt("space"),M=rt("translate"),A=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",$e,t],$=()=>[$e,t],L=()=>["",zr,us],E=()=>["auto",Ni,$e],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],T=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",$e],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Ni,$e];return{cacheSize:500,separator:":",theme:{colors:[vo],spacing:[zr,us],blur:["none","",hs,$e],brightness:H(),borderColor:[e],borderRadius:["none","","full",hs,$e],borderSpacing:$(),borderWidth:L(),contrast:H(),grayscale:_(),hueRotate:H(),invert:_(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[uA,us],inset:U(),margin:U(),opacity:H(),padding:$(),saturate:H(),scale:H(),sepia:_(),skew:H(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[hs]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:[...O(),$e]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",go,$e]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",go,$e]}],"grid-cols":[{"grid-cols":[vo]}],"col-start-end":[{col:["auto",{span:["full",go,$e]},$e]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[vo]}],"row-start-end":[{row:["auto",{span:[go,$e]},$e]}],"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",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"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",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[hs]},hs]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",hs,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qh]}],"font-family":[{font:[vo]}],"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",$e]}],"line-clamp":[{"line-clamp":["none",Ni,qh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zr,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"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:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zr,us]}],"underline-offset":[{"underline-offset":["auto",zr,$e]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],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",$e]}],"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:[...O(),mA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[...D(),"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:D()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[zr,$e]}],"outline-w":[{outline:[zr,us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[zr,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",hs,gA]}],"shadow-color":[{shadow:[vo]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...T(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":T()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",hs,$e]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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",$e]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[go,$e]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],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",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zr,us,qh]}],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"]}}},NA=rA(bA);function De(...e){return NA(Xd(e))}function _t(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function wv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _a(...e){return t=>{let n=!1;const r=e.map(a=>{const i=wv(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():wv(e[a],null)}}}}function Cn(...e){return m.useCallback(_a(...e),e)}function jA(e,t){const n=m.createContext(t),r=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function a(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[r,a]}function $u(e,t=[]){let n=[];function r(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const d=u=>{var g;const{scope:f,children:p,...w}=u,v=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,b=m.useMemo(()=>w,Object.values(w));return s.jsx(v.Provider,{value:b,children:p})};d.displayName=i+"Provider";function h(u,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,w=m.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,h]}const a=()=>{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 a.scopeName=e,[r,kA(a,...t)]}function kA(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...l,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Ru(e){const t=CA(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,l=m.Children.toArray(i),c=l.find(MA);if(c){const d=c.props.children,h=l.map(u=>u===c?m.Children.count(d)>1?m.Children.only(null):m.isValidElement(d)?d.props.children:null:u);return s.jsx(t,{...o,ref:a,children:m.isValidElement(d)?m.cloneElement(d,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var SA=Ru("Slot");function CA(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=DA(a),l=_A(i,a.props);return a.type!==m.Fragment&&(l.ref=r?_a(r,o):o),m.cloneElement(a,l)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GN=Symbol("radix.slottable");function EA(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=GN,t}function MA(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GN}function _A(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function DA(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var TA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dt=TA.reduce((e,t)=>{const n=Ru(`Primitive.${t}`),r=m.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function PA(e,t){e&&yu.flushSync(()=>e.dispatchEvent(t))}function Fi(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function AA(e,t=globalThis==null?void 0:globalThis.document){const n=Fi(e);m.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var OA="DismissableLayer",Om="dismissableLayer.update",zA="dismissableLayer.pointerDownOutside",$A="dismissableLayer.focusOutside",yv,KN=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Iu=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=m.useContext(KN),[h,u]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),w=Cn(t,S=>u(S)),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(b),y=h?v.indexOf(h):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,N=y>=g,j=LA(S=>{const M=S.target,A=[...d.branches].some(I=>I.contains(M));!N||A||(a==null||a(S),o==null||o(S),S.defaultPrevented||l==null||l())},f),k=FA(S=>{const M=S.target;[...d.branches].some(I=>I.contains(M))||(i==null||i(S),o==null||o(S),S.defaultPrevented||l==null||l())},f);return AA(S=>{y===d.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(yv=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),bv(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=yv)}},[h,f,n,d]),m.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),bv())},[h,d]),m.useEffect(()=>{const S=()=>p({});return document.addEventListener(Om,S),()=>document.removeEventListener(Om,S)},[]),s.jsx(dt.div,{...c,ref:w,style:{pointerEvents:x?N?"auto":"none":void 0,...e.style},onFocusCapture:_t(e.onFocusCapture,k.onFocusCapture),onBlurCapture:_t(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:_t(e.onPointerDownCapture,j.onPointerDownCapture)})});Iu.displayName=OA;var RA="DismissableLayerBranch",IA=m.forwardRef((e,t)=>{const n=m.useContext(KN),r=m.useRef(null),a=Cn(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(dt.div,{...e,ref:a})});IA.displayName=RA;function LA(e,t=globalThis==null?void 0:globalThis.document){const n=Fi(e),r=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){QN(zA,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function FA(e,t=globalThis==null?void 0:globalThis.document){const n=Fi(e),r=m.useRef(!1);return m.useEffect(()=>{const a=i=>{i.target&&!r.current&&QN($A,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bv(){const e=new CustomEvent(Om);document.dispatchEvent(e)}function QN(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?PA(a,i):a.dispatchEvent(i)}var Ls=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},UA=ep[" useId ".trim().toString()]||(()=>{}),BA=0;function nr(e){const[t,n]=m.useState(UA());return Ls(()=>{n(r=>r??String(BA++))},[e]),e||(t?`radix-${t}`:"")}const WA=["top","right","bottom","left"],Fs=Math.min,xn=Math.max,qd=Math.round,_c=Math.floor,Sr=e=>({x:e,y:e}),HA={left:"right",right:"left",bottom:"top",top:"bottom"},VA={start:"end",end:"start"};function zm(e,t,n){return xn(e,Fs(t,n))}function Jr(e,t){return typeof e=="function"?e(t):e}function es(e){return e.split("-")[0]}function Qi(e){return e.split("-")[1]}function xx(e){return e==="x"?"y":"x"}function gx(e){return e==="y"?"height":"width"}const YA=new Set(["top","bottom"]);function wr(e){return YA.has(es(e))?"y":"x"}function vx(e){return xx(wr(e))}function XA(e,t,n){n===void 0&&(n=!1);const r=Qi(e),a=vx(e),i=gx(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Gd(o)),[o,Gd(o)]}function qA(e){const t=Gd(e);return[$m(e),t,$m(t)]}function $m(e){return e.replace(/start|end/g,t=>VA[t])}const Nv=["left","right"],jv=["right","left"],GA=["top","bottom"],KA=["bottom","top"];function QA(e,t,n){switch(e){case"top":case"bottom":return n?t?jv:Nv:t?Nv:jv;case"left":case"right":return t?GA:KA;default:return[]}}function ZA(e,t,n,r){const a=Qi(e);let i=QA(es(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map($m)))),i}function Gd(e){return e.replace(/left|right|bottom|top/g,t=>HA[t])}function JA(e){return{top:0,right:0,bottom:0,left:0,...e}}function ZN(e){return typeof e!="number"?JA(e):{top:e,right:e,bottom:e,left:e}}function Kd(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function kv(e,t,n){let{reference:r,floating:a}=e;const i=wr(t),o=vx(t),l=gx(o),c=es(t),d=i==="y",h=r.x+r.width/2-a.width/2,u=r.y+r.height/2-a.height/2,f=r[l]/2-a[l]/2;let p;switch(c){case"top":p={x:h,y:r.y-a.height};break;case"bottom":p={x:h,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-a.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Qi(t)){case"start":p[o]-=f*(n&&d?-1:1);break;case"end":p[o]+=f*(n&&d?-1:1);break}return p}const eO=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:u}=kv(d,r,c),f=r,p={},w=0;for(let v=0;v<l.length;v++){const{name:b,fn:g}=l[v],{x:y,y:x,data:N,reset:j}=await g({x:h,y:u,initialPlacement:r,placement:f,strategy:a,middlewareData:p,rects:d,platform:o,elements:{reference:e,floating:t}});h=y??h,u=x??u,p={...p,[b]:{...p[b],...N}},j&&w<=50&&(w++,typeof j=="object"&&(j.placement&&(f=j.placement),j.rects&&(d=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):j.rects),{x:h,y:u}=kv(d,f,c)),v=-1)}return{x:h,y:u,placement:f,strategy:a,middlewareData:p}};async function bl(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Jr(t,e),w=ZN(p),b=l[f?u==="floating"?"reference":"floating":u],g=Kd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:c})),y=u==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),N=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},j=Kd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(g.top-j.top+w.top)/N.y,bottom:(j.bottom-g.bottom+w.bottom)/N.y,left:(g.left-j.left+w.left)/N.x,right:(j.right-g.right+w.right)/N.x}}const tO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=Jr(e,t)||{};if(d==null)return{};const u=ZN(h),f={x:n,y:r},p=vx(a),w=gx(p),v=await o.getDimensions(d),b=p==="y",g=b?"top":"left",y=b?"bottom":"right",x=b?"clientHeight":"clientWidth",N=i.reference[w]+i.reference[p]-f[p]-i.floating[w],j=f[p]-i.reference[p],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let S=k?k[x]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=l.floating[x]||i.floating[w]);const M=N/2-j/2,A=S/2-v[w]/2-1,I=Fs(u[g],A),U=Fs(u[y],A),$=I,L=S-v[w]-U,E=S/2-v[w]/2+M,O=zm($,E,L),D=!c.arrow&&Qi(a)!=null&&E!==O&&i.reference[w]/2-(E<$?I:U)-v[w]/2<0,T=D?E<$?E-$:E-L:0;return{[p]:f[p]+T,data:{[p]:O,centerOffset:E-O-T,...D&&{alignmentOffset:T}},reset:D}}}),nO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...b}=Jr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=es(a),y=wr(l),x=es(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),j=f||(x||!v?[Gd(l)]:qA(l)),k=w!=="none";!f&&k&&j.push(...ZA(l,v,w,N));const S=[l,...j],M=await bl(t,b),A=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&A.push(M[g]),u){const E=XA(a,o,N);A.push(M[E[0]],M[E[1]])}if(I=[...I,{placement:a,overflows:A}],!A.every(E=>E<=0)){var U,$;const E=(((U=i.flip)==null?void 0:U.index)||0)+1,O=S[E];if(O&&(!(u==="alignment"?y!==wr(O):!1)||I.every(C=>wr(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:E,overflows:I},reset:{placement:O}};let D=($=I.filter(T=>T.overflows[0]<=0).sort((T,C)=>T.overflows[1]-C.overflows[1])[0])==null?void 0:$.placement;if(!D)switch(p){case"bestFit":{var L;const T=(L=I.filter(C=>{if(k){const _=wr(C.placement);return _===y||_==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(_=>_>0).reduce((_,z)=>_+z,0)]).sort((C,_)=>C[1]-_[1])[0])==null?void 0:L[0];T&&(D=T);break}case"initialPlacement":D=l;break}if(a!==D)return{reset:{placement:D}}}return{}}}};function Sv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Cv(e){return WA.some(t=>e[t]>=0)}const rO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Jr(e,t);switch(r){case"referenceHidden":{const i=await bl(t,{...a,elementContext:"reference"}),o=Sv(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Cv(o)}}}case"escaped":{const i=await bl(t,{...a,altBoundary:!0}),o=Sv(i,n.floating);return{data:{escapedOffsets:o,escaped:Cv(o)}}}default:return{}}}}},JN=new Set(["left","top"]);async function sO(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=es(n),l=Qi(n),c=wr(n)==="y",d=JN.has(o)?-1:1,h=i&&c?-1:1,u=Jr(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:w}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof w=="number"&&(p=l==="end"?w*-1:w),c?{x:p*h,y:f*d}:{x:f*d,y:p*h}}const aO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await sO(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},iO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x:g,y}=b;return{x:g,y}}},...c}=Jr(e,t),d={x:n,y:r},h=await bl(t,c),u=wr(es(a)),f=xx(u);let p=d[f],w=d[u];if(i){const b=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=p+h[b],x=p-h[g];p=zm(y,p,x)}if(o){const b=u==="y"?"top":"left",g=u==="y"?"bottom":"right",y=w+h[b],x=w-h[g];w=zm(y,w,x)}const v=l.fn({...t,[f]:p,[u]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[u]:o}}}}}},oO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Jr(e,t),h={x:n,y:r},u=wr(a),f=xx(u);let p=h[f],w=h[u];const v=Jr(l,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const x=f==="y"?"height":"width",N=i.reference[f]-i.floating[x]+b.mainAxis,j=i.reference[f]+i.reference[x]-b.mainAxis;p<N?p=N:p>j&&(p=j)}if(d){var g,y;const x=f==="y"?"width":"height",N=JN.has(es(a)),j=i.reference[u]-i.floating[x]+(N&&((g=o.offset)==null?void 0:g[u])||0)+(N?0:b.crossAxis),k=i.reference[u]+i.reference[x]+(N?0:((y=o.offset)==null?void 0:y[u])||0)-(N?b.crossAxis:0);w<j?w=j:w>k&&(w=k)}return{[f]:p,[u]:w}}}},lO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...d}=Jr(e,t),h=await bl(t,d),u=es(a),f=Qi(a),p=wr(a)==="y",{width:w,height:v}=i.floating;let b,g;u==="top"||u==="bottom"?(b=u,g=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=u,b=f==="end"?"top":"bottom");const y=v-h.top-h.bottom,x=w-h.left-h.right,N=Fs(v-h[b],y),j=Fs(w-h[g],x),k=!t.middlewareData.shift;let S=N,M=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=y),k&&!f){const I=xn(h.left,0),U=xn(h.right,0),$=xn(h.top,0),L=xn(h.bottom,0);p?M=w-2*(I!==0||U!==0?I+U:xn(h.left,h.right)):S=v-2*($!==0||L!==0?$+L:xn(h.top,h.bottom))}await c({...t,availableWidth:M,availableHeight:S});const A=await o.getDimensions(l.floating);return w!==A.width||v!==A.height?{reset:{rects:!0}}:{}}}};function Lu(){return typeof window<"u"}function Zi(e){return ej(e)?(e.nodeName||"").toLowerCase():"#document"}function yn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dr(e){var t;return(t=(ej(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ej(e){return Lu()?e instanceof Node||e instanceof yn(e).Node:!1}function sr(e){return Lu()?e instanceof Element||e instanceof yn(e).Element:!1}function Er(e){return Lu()?e instanceof HTMLElement||e instanceof yn(e).HTMLElement:!1}function Ev(e){return!Lu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yn(e).ShadowRoot}const cO=new Set(["inline","contents"]);function Ll(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ar(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!cO.has(a)}const dO=new Set(["table","td","th"]);function uO(e){return dO.has(Zi(e))}const hO=[":popover-open",":modal"];function Fu(e){return hO.some(t=>{try{return e.matches(t)}catch{return!1}})}const fO=["transform","translate","scale","rotate","perspective"],mO=["transform","translate","scale","rotate","perspective","filter"],pO=["paint","layout","strict","content"];function wx(e){const t=yx(),n=sr(e)?ar(e):e;return fO.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mO.some(r=>(n.willChange||"").includes(r))||pO.some(r=>(n.contain||"").includes(r))}function xO(e){let t=Us(e);for(;Er(t)&&!Ui(t);){if(wx(t))return t;if(Fu(t))return null;t=Us(t)}return null}function yx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gO=new Set(["html","body","#document"]);function Ui(e){return gO.has(Zi(e))}function ar(e){return yn(e).getComputedStyle(e)}function Uu(e){return sr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Us(e){if(Zi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ev(e)&&e.host||Dr(e);return Ev(t)?t.host:t}function tj(e){const t=Us(e);return Ui(t)?e.ownerDocument?e.ownerDocument.body:e.body:Er(t)&&Ll(t)?t:tj(t)}function Nl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=tj(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=yn(a);if(i){const l=Rm(o);return t.concat(o,o.visualViewport||[],Ll(a)?a:[],l&&n?Nl(l):[])}return t.concat(a,Nl(a,[],n))}function Rm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nj(e){const t=ar(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Er(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=qd(n)!==i||qd(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function bx(e){return sr(e)?e:e.contextElement}function ji(e){const t=bx(e);if(!Er(t))return Sr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=nj(t);let o=(i?qd(n.width):n.width)/r,l=(i?qd(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const vO=Sr(0);function rj(e){const t=yn(e);return!yx()||!t.visualViewport?vO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yn(e)?!1:t}function Da(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=bx(e);let o=Sr(1);t&&(r?sr(r)&&(o=ji(r)):o=ji(e));const l=wO(i,n,r)?rj(i):Sr(0);let c=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,h=a.width/o.x,u=a.height/o.y;if(i){const f=yn(i),p=r&&sr(r)?yn(r):r;let w=f,v=Rm(w);for(;v&&r&&p!==w;){const b=ji(v),g=v.getBoundingClientRect(),y=ar(v),x=g.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,N=g.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;c*=b.x,d*=b.y,h*=b.x,u*=b.y,c+=x,d+=N,w=yn(v),v=Rm(w)}}return Kd({width:h,height:u,x:c,y:d})}function Bu(e,t){const n=Uu(e).scrollLeft;return t?t.left+n:Da(Dr(e)).left+n}function sj(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Bu(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function yO(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Dr(r),l=t?Fu(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=Sr(1);const h=Sr(0),u=Er(r);if((u||!u&&!i)&&((Zi(r)!=="body"||Ll(o))&&(c=Uu(r)),Er(r))){const p=Da(r);d=ji(r),h.x=p.x+r.clientLeft,h.y=p.y+r.clientTop}const f=o&&!u&&!i?sj(o,c):Sr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+f.x,y:n.y*d.y-c.scrollTop*d.y+h.y+f.y}}function bO(e){return Array.from(e.getClientRects())}function NO(e){const t=Dr(e),n=Uu(e),r=e.ownerDocument.body,a=xn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Bu(e);const l=-n.scrollTop;return ar(r).direction==="rtl"&&(o+=xn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:l}}const Mv=25;function jO(e,t){const n=yn(e),r=Dr(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const h=yx();(!h||h&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=Bu(r);if(d<=0){const h=r.ownerDocument,u=h.body,f=getComputedStyle(u),p=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,w=Math.abs(r.clientWidth-u.clientWidth-p);w<=Mv&&(i-=w)}else d<=Mv&&(i+=d);return{width:i,height:o,x:l,y:c}}const kO=new Set(["absolute","fixed"]);function SO(e,t){const n=Da(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Er(e)?ji(e):Sr(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,d=r*i.y;return{width:o,height:l,x:c,y:d}}function _v(e,t,n){let r;if(t==="viewport")r=jO(e,n);else if(t==="document")r=NO(Dr(e));else if(sr(t))r=SO(t,n);else{const a=rj(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Kd(r)}function aj(e,t){const n=Us(e);return n===t||!sr(n)||Ui(n)?!1:ar(n).position==="fixed"||aj(n,t)}function CO(e,t){const n=t.get(e);if(n)return n;let r=Nl(e,[],!1).filter(l=>sr(l)&&Zi(l)!=="body"),a=null;const i=ar(e).position==="fixed";let o=i?Us(e):e;for(;sr(o)&&!Ui(o);){const l=ar(o),c=wx(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&kO.has(a.position)||Ll(o)&&!c&&aj(e,o))?r=r.filter(h=>h!==o):a=l,o=Us(o)}return t.set(e,r),r}function EO(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Fu(t)?[]:CO(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((d,h)=>{const u=_v(t,h,a);return d.top=xn(u.top,d.top),d.right=Fs(u.right,d.right),d.bottom=Fs(u.bottom,d.bottom),d.left=xn(u.left,d.left),d},_v(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function MO(e){const{width:t,height:n}=nj(e);return{width:t,height:n}}function _O(e,t,n){const r=Er(t),a=Dr(t),i=n==="fixed",o=Da(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Sr(0);function d(){c.x=Bu(a)}if(r||!r&&!i)if((Zi(t)!=="body"||Ll(a))&&(l=Uu(t)),r){const p=Da(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else a&&d();i&&!r&&a&&d();const h=a&&!r&&!i?sj(a,l):Sr(0),u=o.left+l.scrollLeft-c.x-h.x,f=o.top+l.scrollTop-c.y-h.y;return{x:u,y:f,width:o.width,height:o.height}}function Gh(e){return ar(e).position==="static"}function Dv(e,t){if(!Er(e)||ar(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Dr(e)===n&&(n=n.ownerDocument.body),n}function ij(e,t){const n=yn(e);if(Fu(e))return n;if(!Er(e)){let a=Us(e);for(;a&&!Ui(a);){if(sr(a)&&!Gh(a))return a;a=Us(a)}return n}let r=Dv(e,t);for(;r&&uO(r)&&Gh(r);)r=Dv(r,t);return r&&Ui(r)&&Gh(r)&&!wx(r)?n:r||xO(e)||n}const DO=async function(e){const t=this.getOffsetParent||ij,n=this.getDimensions,r=await n(e.floating);return{reference:_O(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function TO(e){return ar(e).direction==="rtl"}const PO={convertOffsetParentRelativeRectToViewportRelativeRect:yO,getDocumentElement:Dr,getClippingRect:EO,getOffsetParent:ij,getElementRects:DO,getClientRects:bO,getDimensions:MO,getScale:ji,isElement:sr,isRTL:TO};function oj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function AO(e,t){let n=null,r;const a=Dr(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:h,top:u,width:f,height:p}=d;if(l||t(),!f||!p)return;const w=_c(u),v=_c(a.clientWidth-(h+f)),b=_c(a.clientHeight-(u+p)),g=_c(h),x={rootMargin:-w+"px "+-v+"px "+-b+"px "+-g+"px",threshold:xn(0,Fs(1,c))||1};let N=!0;function j(k){const S=k[0].intersectionRatio;if(S!==c){if(!N)return o();S?o(!1,S):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!oj(d,e.getBoundingClientRect())&&o(),N=!1}try{n=new IntersectionObserver(j,{...x,root:a.ownerDocument})}catch{n=new IntersectionObserver(j,x)}n.observe(e)}return o(!0),i}function OO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=bx(e),h=a||i?[...d?Nl(d):[],...Nl(t)]:[];h.forEach(g=>{a&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const u=d&&l?AO(d,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(g=>{let[y]=g;y&&y.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),d&&!c&&p.observe(d),p.observe(t));let w,v=c?Da(e):null;c&&b();function b(){const g=Da(e);v&&!oj(v,g)&&n(),v=g,w=requestAnimationFrame(b)}return n(),()=>{var g;h.forEach(y=>{a&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),u==null||u(),(g=p)==null||g.disconnect(),p=null,c&&cancelAnimationFrame(w)}}const zO=aO,$O=iO,RO=nO,IO=lO,LO=rO,Tv=tO,FO=oO,UO=(e,t,n)=>{const r=new Map,a={platform:PO,...n},i={...a.platform,_c:r};return eO(e,t,{...a,platform:i})};var BO=typeof document<"u",WO=function(){},rd=BO?m.useLayoutEffect:WO;function Qd(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,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qd(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Qd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function lj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pv(e,t){const n=lj(e);return Math.round(t*n)/n}function Kh(e){const t=m.useRef(e);return rd(()=>{t.current=e}),t}function HO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[h,u]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);Qd(f,r)||p(r);const[w,v]=m.useState(null),[b,g]=m.useState(null),y=m.useCallback(C=>{C!==k.current&&(k.current=C,v(C))},[]),x=m.useCallback(C=>{C!==S.current&&(S.current=C,g(C))},[]),N=i||w,j=o||b,k=m.useRef(null),S=m.useRef(null),M=m.useRef(h),A=c!=null,I=Kh(c),U=Kh(a),$=Kh(d),L=m.useCallback(()=>{if(!k.current||!S.current)return;const C={placement:t,strategy:n,middleware:f};U.current&&(C.platform=U.current),UO(k.current,S.current,C).then(_=>{const z={..._,isPositioned:$.current!==!1};E.current&&!Qd(M.current,z)&&(M.current=z,yu.flushSync(()=>{u(z)}))})},[f,t,n,U,$]);rd(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,u(C=>({...C,isPositioned:!1})))},[d]);const E=m.useRef(!1);rd(()=>(E.current=!0,()=>{E.current=!1}),[]),rd(()=>{if(N&&(k.current=N),j&&(S.current=j),N&&j){if(I.current)return I.current(N,j,L);L()}},[N,j,L,I,A]);const O=m.useMemo(()=>({reference:k,floating:S,setReference:y,setFloating:x}),[y,x]),D=m.useMemo(()=>({reference:N,floating:j}),[N,j]),T=m.useMemo(()=>{const C={position:n,left:0,top:0};if(!D.floating)return C;const _=Pv(D.floating,h.x),z=Pv(D.floating,h.y);return l?{...C,transform:"translate("+_+"px, "+z+"px)",...lj(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:z}},[n,l,D.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:L,refs:O,elements:D,floatingStyles:T}),[h,L,O,D,T])}const VO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Tv({element:r.current,padding:a}).fn(n):{}:r?Tv({element:r,padding:a}).fn(n):{}}}},YO=(e,t)=>({...zO(e),options:[e,t]}),XO=(e,t)=>({...$O(e),options:[e,t]}),qO=(e,t)=>({...FO(e),options:[e,t]}),GO=(e,t)=>({...RO(e),options:[e,t]}),KO=(e,t)=>({...IO(e),options:[e,t]}),QO=(e,t)=>({...LO(e),options:[e,t]}),ZO=(e,t)=>({...VO(e),options:[e,t]});var JO="Arrow",cj=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(dt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});cj.displayName=JO;var e6=cj;function t6(e){const[t,n]=m.useState(void 0);return Ls(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Nx="Popper",[dj,Wu]=$u(Nx),[n6,uj]=dj(Nx),hj=e=>{const{__scopePopper:t,children:n}=e,[r,a]=m.useState(null);return s.jsx(n6,{scope:t,anchor:r,onAnchorChange:a,children:n})};hj.displayName=Nx;var fj="PopperAnchor",mj=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=uj(fj,n),o=m.useRef(null),l=Cn(t,o),c=m.useRef(null);return m.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||o.current,d!==c.current&&i.onAnchorChange(c.current)}),r?null:s.jsx(dt.div,{...a,ref:l})});mj.displayName=fj;var jx="PopperContent",[r6,s6]=dj(jx),pj=m.forwardRef((e,t)=>{var re,Z,R,ee,J,F;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:w,...v}=e,b=uj(jx,n),[g,y]=m.useState(null),x=Cn(t,K=>y(K)),[N,j]=m.useState(null),k=t6(N),S=(k==null?void 0:k.width)??0,M=(k==null?void 0:k.height)??0,A=r+(i!=="center"?"-"+i:""),I=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},U=Array.isArray(d)?d:[d],$=U.length>0,L={padding:I,boundary:U.filter(i6),altBoundary:$},{refs:E,floatingStyles:O,placement:D,isPositioned:T,middlewareData:C}=HO({strategy:"fixed",placement:A,whileElementsMounted:(...K)=>OO(...K,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[YO({mainAxis:a+M,alignmentAxis:o}),c&&XO({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?qO():void 0,...L}),c&&GO({...L}),KO({...L,apply:({elements:K,rects:ne,availableWidth:ce,availableHeight:ge})=>{const{width:ve,height:Ae}=ne.reference,Te=K.floating.style;Te.setProperty("--radix-popper-available-width",`${ce}px`),Te.setProperty("--radix-popper-available-height",`${ge}px`),Te.setProperty("--radix-popper-anchor-width",`${ve}px`),Te.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),N&&ZO({element:N,padding:l}),o6({arrowWidth:S,arrowHeight:M}),f&&QO({strategy:"referenceHidden",...L})]}),[_,z]=vj(D),H=Fi(w);Ls(()=>{T&&(H==null||H())},[T,H]);const P=(re=C.arrow)==null?void 0:re.x,B=(Z=C.arrow)==null?void 0:Z.y,q=((R=C.arrow)==null?void 0:R.centerOffset)!==0,[G,se]=m.useState();return Ls(()=>{g&&se(window.getComputedStyle(g).zIndex)},[g]),s.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:T?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(ee=C.transformOrigin)==null?void 0:ee.x,(J=C.transformOrigin)==null?void 0:J.y].join(" "),...((F=C.hide)==null?void 0:F.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(r6,{scope:n,placedSide:_,onArrowChange:j,arrowX:P,arrowY:B,shouldHideArrow:q,children:s.jsx(dt.div,{"data-side":_,"data-align":z,...v,ref:x,style:{...v.style,animation:T?void 0:"none"}})})})});pj.displayName=jx;var xj="PopperArrow",a6={top:"bottom",right:"left",bottom:"top",left:"right"},gj=m.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=s6(xj,r),o=a6[i.placedSide];return s.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:s.jsx(e6,{...a,ref:n,style:{...a.style,display:"block"}})})});gj.displayName=xj;function i6(e){return e!==null}var o6=e=>({name:"transformOrigin",options:e,fn(t){var b,g,y;const{placement:n,rects:r,middlewareData:a}=t,o=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,h]=vj(n),u={start:"0%",center:"50%",end:"100%"}[h],f=(((g=a.arrow)==null?void 0:g.x)??0)+l/2,p=(((y=a.arrow)==null?void 0:y.y)??0)+c/2;let w="",v="";return d==="bottom"?(w=o?u:`${f}px`,v=`${-c}px`):d==="top"?(w=o?u:`${f}px`,v=`${r.floating.height+c}px`):d==="right"?(w=`${-c}px`,v=o?u:`${p}px`):d==="left"&&(w=`${r.floating.width+c}px`,v=o?u:`${p}px`),{data:{x:w,y:v}}}});function vj(e){const[t,n="center"]=e.split("-");return[t,n]}var wj=hj,kx=mj,yj=pj,bj=gj,l6="Portal",Sx=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=m.useState(!1);Ls(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Rb.createPortal(s.jsx(dt.div,{...r,ref:t}),o):null});Sx.displayName=l6;function c6(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Ia=e=>{const{present:t,children:n}=e,r=d6(t),a=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Cn(r.ref,u6(a));return typeof n=="function"||r.isPresent?m.cloneElement(a,{ref:i}):null};Ia.displayName="Presence";function d6(e){const[t,n]=m.useState(),r=m.useRef(null),a=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=c6(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=Dc(r.current);i.current=l==="mounted"?d:"none"},[l]),Ls(()=>{const d=r.current,h=a.current;if(h!==e){const f=i.current,p=Dc(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&f!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),Ls(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,u=p=>{const v=Dc(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&v&&(c("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=p=>{p.target===t&&(i.current=Dc(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Dc(e){return(e==null?void 0:e.animationName)||"none"}function u6(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var h6=ep[" useInsertionEffect ".trim().toString()]||Ls;function Cx({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=f6({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const u=h.current;u!==l&&console.warn(`${r} is changing from ${u?"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,r])}const d=m.useCallback(h=>{var u;if(l){const f=m6(h)?h(e):h;f!==e&&((u=o.current)==null||u.call(o,f))}else i(h)},[l,e,i,o]);return[c,d]}function f6({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),a=m.useRef(n),i=m.useRef(t);return h6(()=>{i.current=t},[t]),m.useEffect(()=>{var o;a.current!==n&&((o=i.current)==null||o.call(i,n),a.current=n)},[n,a]),[n,r,i]}function m6(e){return typeof e=="function"}var p6=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"}),x6="VisuallyHidden",Nj=m.forwardRef((e,t)=>s.jsx(dt.span,{...e,ref:t,style:{...p6,...e.style}}));Nj.displayName=x6;var g6=Nj,[Hu]=$u("Tooltip",[Wu]),Vu=Wu(),jj="TooltipProvider",v6=700,Im="tooltip.open",[w6,Ex]=Hu(jj),kj=e=>{const{__scopeTooltip:t,delayDuration:n=v6,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(w6,{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,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:a,children:i})};kj.displayName=jj;var jl="Tooltip",[y6,Yu]=Hu(jl),Sj=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=Ex(jl,e.__scopeTooltip),d=Vu(t),[h,u]=m.useState(null),f=nr(),p=m.useRef(0),w=o??c.disableHoverableContent,v=l??c.delayDuration,b=m.useRef(!1),[g,y]=Cx({prop:r,defaultProp:a??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(Im))):c.onClose(),i==null||i(S)},caller:jl}),x=m.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),N=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,y(!0)},[y]),j=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,y(!0),p.current=0},v)},[v,y]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),s.jsx(wj,{...d,children:s.jsx(y6,{scope:t,contentId:f,open:g,stateAttribute:x,trigger:h,onTriggerChange:u,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?k():N()},[c.isOpenDelayedRef,k,N]),onTriggerLeave:m.useCallback(()=>{w?j():(window.clearTimeout(p.current),p.current=0)},[j,w]),onOpen:N,onClose:j,disableHoverableContent:w,children:n})})};Sj.displayName=jl;var Lm="TooltipTrigger",Cj=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Yu(Lm,n),i=Ex(Lm,n),o=Vu(n),l=m.useRef(null),c=Cn(t,l,a.onTriggerChange),d=m.useRef(!1),h=m.useRef(!1),u=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),s.jsx(kx,{asChild:!0,...o,children:s.jsx(dt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:_t(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:_t(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:_t(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:_t(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:_t(e.onBlur,a.onClose),onClick:_t(e.onClick,a.onClose)})})});Cj.displayName=Lm;var b6="TooltipPortal",[AF,N6]=Hu(b6,{forceMount:void 0}),Bi="TooltipContent",Ej=m.forwardRef((e,t)=>{const n=N6(Bi,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Yu(Bi,e.__scopeTooltip);return s.jsx(Ia,{present:r||o.open,children:o.disableHoverableContent?s.jsx(Mj,{side:a,...i,ref:t}):s.jsx(j6,{side:a,...i,ref:t})})}),j6=m.forwardRef((e,t)=>{const n=Yu(Bi,e.__scopeTooltip),r=Ex(Bi,e.__scopeTooltip),a=m.useRef(null),i=Cn(t,a),[o,l]=m.useState(null),{trigger:c,onClose:d}=n,h=a.current,{onPointerInTransitChange:u}=r,f=m.useCallback(()=>{l(null),u(!1)},[u]),p=m.useCallback((w,v)=>{const b=w.currentTarget,g={x:w.clientX,y:w.clientY},y=M6(g,b.getBoundingClientRect()),x=_6(g,y),N=D6(v.getBoundingClientRect()),j=P6([...x,...N]);l(j),u(!0)},[u]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&h){const w=b=>p(b,h),v=b=>p(b,c);return c.addEventListener("pointerleave",w),h.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",w),h.removeEventListener("pointerleave",v)}}},[c,h,p,f]),m.useEffect(()=>{if(o){const w=v=>{const b=v.target,g={x:v.clientX,y:v.clientY},y=(c==null?void 0:c.contains(b))||(h==null?void 0:h.contains(b)),x=!T6(g,o);y?f():x&&(f(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,h,o,d,f]),s.jsx(Mj,{...e,ref:i})}),[k6,S6]=Hu(jl,{isInside:!1}),C6=EA("TooltipContent"),Mj=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=Yu(Bi,n),d=Vu(n),{onClose:h}=c;return m.useEffect(()=>(document.addEventListener(Im,h),()=>document.removeEventListener(Im,h)),[h]),m.useEffect(()=>{if(c.trigger){const u=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&h()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,h]),s.jsx(Iu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:h,children:s.jsxs(yj,{"data-state":c.stateAttribute,...d,...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:[s.jsx(C6,{children:r}),s.jsx(k6,{scope:n,isInside:!0,children:s.jsx(g6,{id:c.contentId,role:"tooltip",children:a||r})})]})})});Ej.displayName=Bi;var _j="TooltipArrow",E6=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Vu(n);return S6(_j,n).isInside?null:s.jsx(bj,{...a,...r,ref:t})});E6.displayName=_j;function M6(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _6(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function D6(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function T6(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,h=l.y,u=c.x,f=c.y;h>r!=f>r&&n<(u-d)*(r-h)/(f-h)+d&&(a=!a)}return a}function P6(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),A6(t)}function A6(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}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 O6=kj,z6=Sj,$6=Cj,Dj=Ej;const Qh=O6,Zh=z6,Jh=$6,sd=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Dj,{ref:r,sideOffset:t,className:De("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}));sd.displayName=Dj.displayName;const R6=320,I6=32,L6=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",Fm=({data:e,targetPosition:t,sourcePosition:n})=>{const r=e,[a,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",d=L6(r.plugin||"core");return r.isForeign?s.jsx("div",{className:"relative",children:s.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:`${r.name}-foreign-key`,children:[s.jsx(mt,{size:12,className:"text-gray-400"}),s.jsx("span",{className:"font-medium",children:r.displayName||r.name}),t&&s.jsx(ma,{type:"target",id:r.name,position:t,className:De(c)})]})}):s.jsx("div",{className:"relative",children:s.jsxs("div",{className:De("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:R6},id:`${r.name}-schema-node`,children:[s.jsxs("div",{className:De("px-4 py-3 bg-black border-b border-gray-700 flex items-center justify-between","cursor-pointer select-none"),onClick:()=>i(!a),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mt,{size:16,className:"text-white"}),s.jsx("span",{className:"text-white font-semibold text-sm",children:r.displayName||r.name})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:h=>{h.stopPropagation(),l(!o)},className:"p-1 hover:bg-gray-800 rounded transition-colors",children:o?s.jsx($P,{size:12,className:"text-gray-400"}):s.jsx(Il,{size:12,className:"text-gray-400"})}),a?s.jsx(hx,{size:14,className:"text-gray-400"}):s.jsx(zu,{size:14,className:"text-gray-400"})]})]}),!a&&s.jsx("div",{className:"max-h-96 bg-black overflow-y-auto",children:r.columns.map(h=>s.jsxs("div",{className:De("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:I6},children:[s.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[h.isPrimary&&s.jsx(Qh,{delayDuration:100,children:s.jsxs(Zh,{children:[s.jsx(Jh,{asChild:!0,children:s.jsx(Vd,{size:10,className:"text-yellow-400 flex-shrink-0"})}),s.jsx(sd,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),h.isUnique&&!h.isPrimary&&s.jsx(Qh,{delayDuration:100,children:s.jsxs(Zh,{children:[s.jsx(Jh,{asChild:!0,children:s.jsx(RP,{size:10,className:"text-green-400 flex-shrink-0"})}),s.jsx(sd,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),h.isIdentity&&s.jsx(Qh,{delayDuration:100,children:s.jsxs(Zh,{children:[s.jsx(Jh,{asChild:!0,children:s.jsx(LP,{size:10,className:"text-blue-400 flex-shrink-0"})}),s.jsx(sd,{className:"bg-black border-gray-600 text-white text-xs",children:"Identity"})]})})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[!h.isNullable&&s.jsx("span",{className:"text-red-400 text-xs",children:"*"}),s.jsx("span",{className:"text-white font-medium truncate",children:h.name}),s.jsx("span",{className:"text-gray-400 font-mono text-xs",children:h.format})]}),o&&h.description&&s.jsx("div",{className:"text-gray-500 text-xs mt-1 truncate",children:h.description})]}),s.jsx("div",{className:"ml-2",children:s.jsx("span",{className:De("px-2 py-1 rounded text-xs font-medium",d),children:h.plugin})}),s.jsx(ma,{type:"target",id:h.id,position:t||"left",className:De(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)"}}),s.jsx(ma,{type:"source",id:h.id,position:n||"right",className:De(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))}),r.relationships&&r.relationships.length>0&&s.jsx("div",{className:"px-4 py-2 bg-gray-800 border-t border-gray-700",children:s.jsxs("span",{className:"text-xs text-gray-400",children:[r.relationships.length," relationship",r.relationships.length!==1?"s":""]})})]})})},F6={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"}]},U6={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 B6(){return s.jsx("div",{className:"min-h-screen bg-black p-8",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-3xl font-light text-white mb-4",children:"Database Schema Node Demo"}),s.jsx("p",{className:"text-gray-400",children:"Enhanced database schema nodes with dark mode theming, collapsible views, and detailed tooltips."})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl text-white mb-4",children:"Core User Table"}),s.jsx(Fm,{data:F6,targetPosition:"left",sourcePosition:"right"})]}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),s.jsx(Fm,{data:U6,targetPosition:"left",sourcePosition:"right"})]})]}),s.jsxs("div",{className:"mt-12 p-6 bg-gray-900 rounded-lg border border-gray-700",children:[s.jsx("h3",{className:"text-lg text-white mb-4",children:"Features"}),s.jsxs("ul",{className:"space-y-2 text-gray-300",children:[s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Dark Mode Optimized:"})," Designed specifically for dark themes"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Collapsible Views:"})," Click the header to collapse/expand table contents"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Detail Toggle:"})," Show/hide column descriptions with the eye icon"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Plugin Badges:"})," Color-coded plugin indicators"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Interactive Icons:"})," Hover tooltips for primary keys, unique constraints, etc."]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Relationship Counter:"})," Shows number of relationships in footer"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Connection Handles:"})," Invisible handles for React Flow connections"]})]})]})]})})}const Tj=m.createContext(void 0);function W6({children:e}){const[t,n]=m.useState({users:0,organizations:0,sessions:0,teams:0}),[r,a]=m.useState(!0),i=m.useCallback(async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{a(!1)}},[]),o=m.useCallback(async()=>{a(!0),await i()},[i]);return m.useEffect(()=>{i()},[i]),s.jsx(Tj.Provider,{value:{counts:t,loading:r,refetchCounts:o},children:e})}function Xu(){const e=m.useContext(Tj);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}var Av=1,H6=.9,V6=.8,Y6=.17,ef=.1,tf=.999,X6=.9999,q6=.99,G6=/[\\\/_+.#"@\[\(\{&]/,K6=/[\\\/_+.#"@\[\(\{&]/g,Q6=/[\s-]/,Pj=/[\s-]/g;function Um(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?Av:q6;var l=`${a},${i}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(i),d=n.indexOf(c,a),h=0,u,f,p,w;d>=0;)u=Um(e,t,n,r,d+1,i+1,o),u>h&&(d===a?u*=Av:G6.test(e.charAt(d-1))?(u*=V6,p=e.slice(a,d-1).match(K6),p&&a>0&&(u*=Math.pow(tf,p.length))):Q6.test(e.charAt(d-1))?(u*=H6,w=e.slice(a,d-1).match(Pj),w&&a>0&&(u*=Math.pow(tf,w.length))):(u*=Y6,a>0&&(u*=Math.pow(tf,d-a))),e.charAt(d)!==t.charAt(i)&&(u*=X6)),(u<ef&&n.charAt(d-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(d-1)!==r.charAt(i))&&(f=Um(e,t,n,r,d+1,i+2,o),f*ef>u&&(u=f*ef)),u>h&&(h=u),d=n.indexOf(c,d+1);return o[l]=h,h}function Ov(e){return e.toLowerCase().replace(Pj," ")}function Z6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Um(e,t,Ov(e),Ov(t),0,0,{})}var nf="focusScope.autoFocusOnMount",rf="focusScope.autoFocusOnUnmount",zv={bubbles:!1,cancelable:!0},J6="FocusScope",Mx=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),d=Fi(a),h=Fi(i),u=m.useRef(null),f=Cn(t,v=>c(v)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(x){if(p.paused||!l)return;const N=x.target;l.contains(N)?u.current=N:ps(u.current,{select:!0})},b=function(x){if(p.paused||!l)return;const N=x.relatedTarget;N!==null&&(l.contains(N)||ps(u.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const j of x)j.removedNodes.length>0&&ps(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const y=new MutationObserver(g);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),y.disconnect()}}},[r,l,p.paused]),m.useEffect(()=>{if(l){Rv.add(p);const v=document.activeElement;if(!l.contains(v)){const g=new CustomEvent(nf,zv);l.addEventListener(nf,d),l.dispatchEvent(g),g.defaultPrevented||(ez(az(Aj(l)),{select:!0}),document.activeElement===v&&ps(l))}return()=>{l.removeEventListener(nf,d),setTimeout(()=>{const g=new CustomEvent(rf,zv);l.addEventListener(rf,h),l.dispatchEvent(g),g.defaultPrevented||ps(v??document.body,{select:!0}),l.removeEventListener(rf,h),Rv.remove(p)},0)}}},[l,d,h,p]);const w=m.useCallback(v=>{if(!n&&!r||p.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(b&&g){const y=v.currentTarget,[x,N]=tz(y);x&&N?!v.shiftKey&&g===N?(v.preventDefault(),n&&ps(x,{select:!0})):v.shiftKey&&g===x&&(v.preventDefault(),n&&ps(N,{select:!0})):g===y&&v.preventDefault()}},[n,r,p.paused]);return s.jsx(dt.div,{tabIndex:-1,...o,ref:f,onKeyDown:w})});Mx.displayName=J6;function ez(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ps(r,{select:t}),document.activeElement!==n)return}function tz(e){const t=Aj(e),n=$v(t,e),r=$v(t.reverse(),e);return[n,r]}function Aj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $v(e,t){for(const n of e)if(!nz(n,{upTo:t}))return n}function nz(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 rz(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rz(e)&&t&&e.select()}}var Rv=sz();function sz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Iv(e,t),e.unshift(t)},remove(t){var n;e=Iv(e,t),(n=e[0])==null||n.resume()}}}function Iv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function az(e){return e.filter(t=>t.tagName!=="A")}var sf=0;function Oj(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Lv()),document.body.insertAdjacentElement("beforeend",e[1]??Lv()),sf++,()=>{sf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),sf--}},[])}function Lv(){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 vr=function(){return vr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},vr.apply(this,arguments)};function zj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function iz(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ad="right-scroll-bar-position",id="width-before-scroll-bar",oz="with-scroll-bars-hidden",lz="--removed-body-scroll-bar-size";function af(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cz(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var dz=typeof window<"u"?m.useLayoutEffect:m.useEffect,Fv=new WeakMap;function uz(e,t){var n=cz(null,function(r){return e.forEach(function(a){return af(a,r)})});return dz(function(){var r=Fv.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||af(l,null)}),i.forEach(function(l){a.has(l)||af(l,o)})}Fv.set(n,e)},[e]),n}function hz(e){return e}function fz(e,t){t===void 0&&(t=hz);var n=[],r=!1,a={read:function(){if(r)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,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!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)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){o.push(h),d()},filter:function(h){return o=o.filter(h),n}}}};return a}function mz(e){e===void 0&&(e={});var t=fz(null);return t.options=vr({async:!0,ssr:!1},e),t}var $j=function(e){var t=e.sideCar,n=zj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,vr({},n))};$j.isSideCarExport=!0;function pz(e,t){return e.useMedium(t),$j}var Rj=mz(),of=function(){},qu=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:of,onWheelCapture:of,onTouchMoveCapture:of}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,u=e.shards,f=e.sideCar,p=e.noRelative,w=e.noIsolation,v=e.inert,b=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,x=e.gapMode,N=zj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,k=uz([n,t]),S=vr(vr({},N),a);return m.createElement(m.Fragment,null,h&&m.createElement(j,{sideCar:Rj,removeScrollBar:d,shards:u,noRelative:p,noIsolation:w,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:x}),o?m.cloneElement(m.Children.only(l),vr(vr({},S),{ref:k})):m.createElement(y,vr({},S,{className:c,ref:k}),l))});qu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qu.classNames={fullWidth:id,zeroRight:ad};var xz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xz();return t&&e.setAttribute("nonce",t),e}function vz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=gz())&&(vz(t,n),wz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bz=function(){var e=yz();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ij=function(){var e=bz(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Nz={left:0,top:0,right:0,gap:0},lf=function(e){return parseInt(e||"",10)||0},jz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[lf(n),lf(r),lf(a)]},kz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Nz;var t=jz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Sz=Ij(),ki="data-scroll-locked",Cz=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
360
+ .`.concat(oz,` {
361
+ overflow: hidden `).concat(r,`;
362
+ padding-right: `).concat(l,"px ").concat(r,`;
363
+ }
364
+ body[`).concat(ki,`] {
365
+ overflow: hidden `).concat(r,`;
366
+ overscroll-behavior: contain;
367
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
368
+ padding-left: `.concat(a,`px;
369
+ padding-top: `).concat(i,`px;
370
+ padding-right: `).concat(o,`px;
371
+ margin-left:0;
372
+ margin-top:0;
373
+ margin-right: `).concat(l,"px ").concat(r,`;
374
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
375
+ }
376
+
377
+ .`).concat(ad,` {
378
+ right: `).concat(l,"px ").concat(r,`;
379
+ }
380
+
381
+ .`).concat(id,` {
382
+ margin-right: `).concat(l,"px ").concat(r,`;
383
+ }
384
+
385
+ .`).concat(ad," .").concat(ad,` {
386
+ right: 0 `).concat(r,`;
387
+ }
388
+
389
+ .`).concat(id," .").concat(id,` {
390
+ margin-right: 0 `).concat(r,`;
391
+ }
392
+
393
+ body[`).concat(ki,`] {
394
+ `).concat(lz,": ").concat(l,`px;
395
+ }
396
+ `)},Uv=function(){var e=parseInt(document.body.getAttribute(ki)||"0",10);return isFinite(e)?e:0},Ez=function(){m.useEffect(function(){return document.body.setAttribute(ki,(Uv()+1).toString()),function(){var e=Uv()-1;e<=0?document.body.removeAttribute(ki):document.body.setAttribute(ki,e.toString())}},[])},Mz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Ez();var i=m.useMemo(function(){return kz(a)},[a]);return m.createElement(Sz,{styles:Cz(i,!t,a,n?"":"!important")})},Bm=!1;if(typeof window<"u")try{var Tc=Object.defineProperty({},"passive",{get:function(){return Bm=!0,!0}});window.addEventListener("test",Tc,Tc),window.removeEventListener("test",Tc,Tc)}catch{Bm=!1}var Ya=Bm?{passive:!1}:!1,_z=function(e){return e.tagName==="TEXTAREA"},Lj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_z(e)&&n[t]==="visible")},Dz=function(e){return Lj(e,"overflowY")},Tz=function(e){return Lj(e,"overflowX")},Bv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=Fj(e,r);if(a){var i=Uj(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Pz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Az=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Fj=function(e,t){return e==="v"?Dz(t):Tz(t)},Uj=function(e,t){return e==="v"?Pz(t):Az(t)},Oz=function(e,t){return e==="h"&&t==="rtl"?-1:1},zz=function(e,t,n,r,a){var i=Oz(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),d=!1,h=o>0,u=0,f=0;do{if(!l)break;var p=Uj(e,l),w=p[0],v=p[1],b=p[2],g=v-b-i*w;(w||g)&&Fj(e,l)&&(u+=g,f+=w);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(u)<1||!h&&Math.abs(f)<1)&&(d=!0),d},Pc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wv=function(e){return[e.deltaX,e.deltaY]},Hv=function(e){return e&&"current"in e?e.current:e},$z=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Rz=function(e){return`
397
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
398
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
399
+ `)},Iz=0,Xa=[];function Lz(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),a=m.useState(Iz++)[0],i=m.useState(Ij)[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(a));var v=iz([e.lockRef.current],(e.shards||[]).map(Hv),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var g=Pc(v),y=n.current,x="deltaX"in v?v.deltaX:y[0]-g[0],N="deltaY"in v?v.deltaY:y[1]-g[1],j,k=v.target,S=Math.abs(x)>Math.abs(N)?"h":"v";if("touches"in v&&S==="h"&&k.type==="range")return!1;var M=Bv(S,k);if(!M)return!0;if(M?j=S:(j=S==="v"?"h":"v",M=Bv(S,k)),!M)return!1;if(!r.current&&"changedTouches"in v&&(x||N)&&(r.current=j),!j)return!0;var A=r.current||j;return zz(A,b,v,A==="h"?x:N)},[]),c=m.useCallback(function(v){var b=v;if(!(!Xa.length||Xa[Xa.length-1]!==i)){var g="deltaY"in b?Wv(b):Pc(b),y=t.current.filter(function(j){return j.name===b.type&&(j.target===b.target||b.target===j.shadowParent)&&$z(j.delta,g)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var x=(o.current.shards||[]).map(Hv).filter(Boolean).filter(function(j){return j.contains(b.target)}),N=x.length>0?l(b,x[0]):!o.current.noIsolation;N&&b.cancelable&&b.preventDefault()}}},[]),d=m.useCallback(function(v,b,g,y){var x={name:v,delta:b,target:g,should:y,shadowParent:Fz(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(N){return N!==x})},1)},[]),h=m.useCallback(function(v){n.current=Pc(v),r.current=void 0},[]),u=m.useCallback(function(v){d(v.type,Wv(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){d(v.type,Pc(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Xa.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ya),document.addEventListener("touchmove",c,Ya),document.addEventListener("touchstart",h,Ya),function(){Xa=Xa.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ya),document.removeEventListener("touchmove",c,Ya),document.removeEventListener("touchstart",h,Ya)}},[]);var p=e.removeScrollBar,w=e.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:Rz(a)}):null,p?m.createElement(Mz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Fz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Uz=pz(Rj,Lz);var _x=m.forwardRef(function(e,t){return m.createElement(qu,vr({},e,{ref:t,sideCar:Uz}))});_x.classNames=qu.classNames;var Bz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qa=new WeakMap,Ac=new WeakMap,Oc={},cf=0,Bj=function(e){return e&&(e.host||Bj(e.parentNode))},Wz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Bj(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Hz=function(e,t,n,r){var a=Wz(t,Array.isArray(e)?e:[e]);Oc[n]||(Oc[n]=new WeakMap);var i=Oc[n],o=[],l=new Set,c=new Set(a),d=function(u){!u||l.has(u)||(l.add(u),d(u.parentNode))};a.forEach(d);var h=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(f){if(l.has(f))h(f);else try{var p=f.getAttribute(r),w=p!==null&&p!=="false",v=(qa.get(f)||0)+1,b=(i.get(f)||0)+1;qa.set(f,v),i.set(f,b),o.push(f),v===1&&w&&Ac.set(f,!0),b===1&&f.setAttribute(n,"true"),w||f.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),l.clear(),cf++,function(){o.forEach(function(u){var f=qa.get(u)-1,p=i.get(u)-1;qa.set(u,f),i.set(u,p),f||(Ac.has(u)||u.removeAttribute(r),Ac.delete(u)),p||u.removeAttribute(n)}),cf--,cf||(qa=new WeakMap,qa=new WeakMap,Ac=new WeakMap,Oc={})}},Wj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Bz(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Hz(r,a,n,"aria-hidden")):function(){return null}},Gu="Dialog",[Hj]=$u(Gu),[Vz,or]=Hj(Gu),Vj=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[d,h]=Cx({prop:r,defaultProp:a??!1,onChange:i,caller:Gu});return s.jsx(Vz,{scope:t,triggerRef:l,contentRef:c,contentId:nr(),titleId:nr(),descriptionId:nr(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};Vj.displayName=Gu;var Yj="DialogTrigger",Yz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(Yj,n),i=Cn(t,a.triggerRef);return s.jsx(dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Px(a.open),...r,ref:i,onClick:_t(e.onClick,a.onOpenToggle)})});Yz.displayName=Yj;var Dx="DialogPortal",[Xz,Xj]=Hj(Dx,{forceMount:void 0}),qj=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=or(Dx,t);return s.jsx(Xz,{scope:t,forceMount:n,children:m.Children.map(r,o=>s.jsx(Ia,{present:n||i.open,children:s.jsx(Sx,{asChild:!0,container:a,children:o})}))})};qj.displayName=Dx;var Zd="DialogOverlay",Gj=m.forwardRef((e,t)=>{const n=Xj(Zd,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=or(Zd,e.__scopeDialog);return i.modal?s.jsx(Ia,{present:r||i.open,children:s.jsx(Gz,{...a,ref:t})}):null});Gj.displayName=Zd;var qz=Ru("DialogOverlay.RemoveScroll"),Gz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(Zd,n);return s.jsx(_x,{as:qz,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(dt.div,{"data-state":Px(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ta="DialogContent",Kj=m.forwardRef((e,t)=>{const n=Xj(Ta,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=or(Ta,e.__scopeDialog);return s.jsx(Ia,{present:r||i.open,children:i.modal?s.jsx(Kz,{...a,ref:t}):s.jsx(Qz,{...a,ref:t})})});Kj.displayName=Ta;var Kz=m.forwardRef((e,t)=>{const n=or(Ta,e.__scopeDialog),r=m.useRef(null),a=Cn(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Wj(i)},[]),s.jsx(Qj,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:_t(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:_t(e.onFocusOutside,i=>i.preventDefault())})}),Qz=m.forwardRef((e,t)=>{const n=or(Ta,e.__scopeDialog),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(Qj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),Qj=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=or(Ta,n),c=m.useRef(null),d=Cn(t,c);return Oj(),s.jsxs(s.Fragment,{children:[s.jsx(Mx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Iu,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Px(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(t$,{titleId:l.titleId}),s.jsx(r$,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Tx="DialogTitle",Zz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(Tx,n);return s.jsx(dt.h2,{id:a.titleId,...r,ref:t})});Zz.displayName=Tx;var Zj="DialogDescription",Jz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(Zj,n);return s.jsx(dt.p,{id:a.descriptionId,...r,ref:t})});Jz.displayName=Zj;var Jj="DialogClose",e$=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(Jj,n);return s.jsx(dt.button,{type:"button",...r,ref:t,onClick:_t(e.onClick,()=>a.onOpenChange(!1))})});e$.displayName=Jj;function Px(e){return e?"open":"closed"}var e2="DialogTitleWarning",[OF,t2]=jA(e2,{contentName:Ta,titleName:Tx,docsSlug:"dialog"}),t$=({titleId:e})=>{const t=t2(e2),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
400
+
401
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
402
+
403
+ 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},n$="DialogDescriptionWarning",r$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t2(n$).contentName}}.`;return m.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},s$=Vj,a$=qj,i$=Gj,o$=Kj,wo='[cmdk-group=""]',df='[cmdk-group-items=""]',l$='[cmdk-group-heading=""]',n2='[cmdk-item=""]',Vv=`${n2}:not([aria-disabled="true"])`,Wm="cmdk-item-select",Qa="data-value",c$=(e,t,n)=>Z6(e,t,n),r2=m.createContext(void 0),Fl=()=>m.useContext(r2),s2=m.createContext(void 0),Ax=()=>m.useContext(s2),a2=m.createContext(void 0),i2=m.forwardRef((e,t)=>{let n=Za(()=>{var P,B;return{search:"",value:(B=(P=e.value)!=null?P:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Za(()=>new Set),a=Za(()=>new Map),i=Za(()=>new Map),o=Za(()=>new Set),l=o2(e),{label:c,children:d,value:h,onValueChange:u,filter:f,shouldFilter:p,loop:w,disablePointerSelection:v=!1,vimBindings:b=!0,...g}=e,y=nr(),x=nr(),N=nr(),j=m.useRef(null),k=y$();Pa(()=>{if(h!==void 0){let P=h.trim();n.current.value=P,S.emit()}},[h]),Pa(()=>{k(6,L)},[]);let S=m.useMemo(()=>({subscribe:P=>(o.current.add(P),()=>o.current.delete(P)),snapshot:()=>n.current,setState:(P,B,q)=>{var G,se,re,Z;if(!Object.is(n.current[P],B)){if(n.current[P]=B,P==="search")$(),I(),k(1,U);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let R=document.getElementById(N);R?R.focus():(G=document.getElementById(y))==null||G.focus()}if(k(7,()=>{var R;n.current.selectedItemId=(R=E())==null?void 0:R.id,S.emit()}),q||k(5,L),((se=l.current)==null?void 0:se.value)!==void 0){let R=B??"";(Z=(re=l.current).onValueChange)==null||Z.call(re,R);return}}S.emit()}},emit:()=>{o.current.forEach(P=>P())}}),[]),M=m.useMemo(()=>({value:(P,B,q)=>{var G;B!==((G=i.current.get(P))==null?void 0:G.value)&&(i.current.set(P,{value:B,keywords:q}),n.current.filtered.items.set(P,A(B,q)),k(2,()=>{I(),S.emit()}))},item:(P,B)=>(r.current.add(P),B&&(a.current.has(B)?a.current.get(B).add(P):a.current.set(B,new Set([P]))),k(3,()=>{$(),I(),n.current.value||U(),S.emit()}),()=>{i.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let q=E();k(4,()=>{$(),(q==null?void 0:q.getAttribute("id"))===P&&U(),S.emit()})}),group:P=>(a.current.has(P)||a.current.set(P,new Set),()=>{i.current.delete(P),a.current.delete(P)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:N,labelId:x,listInnerRef:j}),[]);function A(P,B){var q,G;let se=(G=(q=l.current)==null?void 0:q.filter)!=null?G:c$;return P?se(P,n.current.search,B):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let P=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(G=>{let se=a.current.get(G),re=0;se.forEach(Z=>{let R=P.get(Z);re=Math.max(R,re)}),B.push([G,re])});let q=j.current;O().sort((G,se)=>{var re,Z;let R=G.getAttribute("id"),ee=se.getAttribute("id");return((re=P.get(ee))!=null?re:0)-((Z=P.get(R))!=null?Z:0)}).forEach(G=>{let se=G.closest(df);se?se.appendChild(G.parentElement===se?G:G.closest(`${df} > *`)):q.appendChild(G.parentElement===q?G:G.closest(`${df} > *`))}),B.sort((G,se)=>se[1]-G[1]).forEach(G=>{var se;let re=(se=j.current)==null?void 0:se.querySelector(`${wo}[${Qa}="${encodeURIComponent(G[0])}"]`);re==null||re.parentElement.appendChild(re)})}function U(){let P=O().find(q=>q.getAttribute("aria-disabled")!=="true"),B=P==null?void 0:P.getAttribute(Qa);S.setState("value",B||void 0)}function $(){var P,B,q,G;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let re of r.current){let Z=(B=(P=i.current.get(re))==null?void 0:P.value)!=null?B:"",R=(G=(q=i.current.get(re))==null?void 0:q.keywords)!=null?G:[],ee=A(Z,R);n.current.filtered.items.set(re,ee),ee>0&&se++}for(let[re,Z]of a.current)for(let R of Z)if(n.current.filtered.items.get(R)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=se}function L(){var P,B,q;let G=E();G&&(((P=G.parentElement)==null?void 0:P.firstChild)===G&&((q=(B=G.closest(wo))==null?void 0:B.querySelector(l$))==null||q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function E(){var P;return(P=j.current)==null?void 0:P.querySelector(`${n2}[aria-selected="true"]`)}function O(){var P;return Array.from(((P=j.current)==null?void 0:P.querySelectorAll(Vv))||[])}function D(P){let B=O()[P];B&&S.setState("value",B.getAttribute(Qa))}function T(P){var B;let q=E(),G=O(),se=G.findIndex(Z=>Z===q),re=G[se+P];(B=l.current)!=null&&B.loop&&(re=se+P<0?G[G.length-1]:se+P===G.length?G[0]:G[se+P]),re&&S.setState("value",re.getAttribute(Qa))}function C(P){let B=E(),q=B==null?void 0:B.closest(wo),G;for(;q&&!G;)q=P>0?v$(q,wo):w$(q,wo),G=q==null?void 0:q.querySelector(Vv);G?S.setState("value",G.getAttribute(Qa)):T(P)}let _=()=>D(O().length-1),z=P=>{P.preventDefault(),P.metaKey?_():P.altKey?C(1):T(1)},H=P=>{P.preventDefault(),P.metaKey?D(0):P.altKey?C(-1):T(-1)};return m.createElement(dt.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:P=>{var B;(B=g.onKeyDown)==null||B.call(g,P);let q=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||q))switch(P.key){case"n":case"j":{b&&P.ctrlKey&&z(P);break}case"ArrowDown":{z(P);break}case"p":case"k":{b&&P.ctrlKey&&H(P);break}case"ArrowUp":{H(P);break}case"Home":{P.preventDefault(),D(0);break}case"End":{P.preventDefault(),_();break}case"Enter":{P.preventDefault();let G=E();if(G){let se=new Event(Wm);G.dispatchEvent(se)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:N$},c),Ku(e,P=>m.createElement(s2.Provider,{value:S},m.createElement(r2.Provider,{value:M},P))))}),d$=m.forwardRef((e,t)=>{var n,r;let a=nr(),i=m.useRef(null),o=m.useContext(a2),l=Fl(),c=o2(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Pa(()=>{if(!d)return l.item(a,o==null?void 0:o.id)},[d]);let h=l2(a,i,[e.value,e.children,i],e.keywords),u=Ax(),f=Bs(k=>k.value&&k.value===h.current),p=Bs(k=>d||l.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);m.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(Wm,w),()=>k.removeEventListener(Wm,w)},[p,e.onSelect,e.disabled]);function w(){var k,S;v(),(S=(k=c.current).onSelect)==null||S.call(k,h.current)}function v(){u.setState("value",h.current,!0)}if(!p)return null;let{disabled:b,value:g,onSelect:y,forceMount:x,keywords:N,...j}=e;return m.createElement(dt.div,{ref:_a(i,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||l.getDisablePointerSelection()?void 0:v,onClick:b?void 0:w},e.children)}),u$=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=nr(),l=m.useRef(null),c=m.useRef(null),d=nr(),h=Fl(),u=Bs(p=>a||h.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Pa(()=>h.group(o),[]),l2(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:a}),[a]);return m.createElement(dt.div,{ref:_a(l,t),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Ku(e,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},m.createElement(a2.Provider,{value:f},p))))}),h$=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=m.useRef(null),i=Bs(o=>!o.search);return!n&&!i?null:m.createElement(dt.div,{ref:_a(a,t),...r,"cmdk-separator":"",role:"separator"})}),f$=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=Ax(),o=Bs(d=>d.search),l=Bs(d=>d.selectedItemId),c=Fl();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(dt.input,{ref:t,...r,"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:a?e.value:o,onChange:d=>{a||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),m$=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=m.useRef(null),o=m.useRef(null),l=Bs(d=>d.selectedItemId),c=Fl();return m.useEffect(()=>{if(o.current&&i.current){let d=o.current,h=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let p=d.offsetHeight;h.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(d),()=>{cancelAnimationFrame(u),f.unobserve(d)}}},[]),m.createElement(dt.div,{ref:_a(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Ku(e,d=>m.createElement("div",{ref:_a(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),p$=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...l}=e;return m.createElement(s$,{open:n,onOpenChange:r},m.createElement(a$,{container:o},m.createElement(i$,{"cmdk-overlay":"",className:a}),m.createElement(o$,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(i2,{ref:t,...l}))))}),x$=m.forwardRef((e,t)=>Bs(n=>n.filtered.count===0)?m.createElement(dt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),g$=m.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return m.createElement(dt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Ku(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),yo=Object.assign(i2,{List:m$,Item:d$,Input:f$,Group:u$,Separator:h$,Dialog:p$,Empty:x$,Loading:g$});function v$(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function w$(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function o2(e){let t=m.useRef(e);return Pa(()=>{t.current=e}),t}var Pa=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Za(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Bs(e){let t=Ax(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function l2(e,t,n,r=[]){let a=m.useRef(),i=Fl();return Pa(()=>{var o;let l=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():a.current}})(),c=r.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(Qa,l),a.current=l}),a}var y$=()=>{let[e,t]=m.useState(),n=Za(()=>new Map);return Pa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function b$(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ku({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(b$(t),{ref:t.ref},n(t.props.children)):n(t)}var N$={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function j$({isOpen:e,onClose:t}){const n=Mr(),[r,a]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const p=await(await fetch("/api/plugins")).json();o(p)}catch{}})()},[]);const l=u=>i!=null&&i.plugins?i.plugins.some(f=>f.id===u):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:Ma,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:pr,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:dv,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:bi,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:dv,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:Pm,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:zs,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:Yd,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(u=>{var p;const f=r.toLowerCase();return u.title.toLowerCase().includes(f)||u.description.toLowerCase().includes(f)||((p=u.keywords)==null?void 0:p.some(w=>w.toLowerCase().includes(f)))}).reduce((u,f)=>(u[f.category]||(u[f.category]=[]),u[f.category].push(f),u),{});return m.useEffect(()=>{const u=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[]),m.useEffect(()=>{const u=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",u),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",u)}},[e,t]),e?s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:s.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:u=>u.stopPropagation(),children:s.jsxs(yo,{className:"p-2",children:[s.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[s.jsx(Ea,{className:"w-4 h-4 text-gray-400 mr-3"}),s.jsx(yo.Input,{value:r,onValueChange:a,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),s.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"})]}),s.jsx(yo.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?s.jsxs("div",{className:"text-center py-8 text-gray-400",children:[s.jsx(Ea,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"No results found"}),s.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([u,f])=>s.jsx("div",{className:"mb-4",children:s.jsx(yo.Group,{heading:u,className:"text-xs text-gray-400 font-medium mb-2 px-2",children:f.map(p=>{const w=p.icon,v=p.disabled;return s.jsxs(yo.Item,{value:p.id,disabled:v,onSelect:()=>{v||(p.action(),t())},className:`flex items-center space-x-3 px-0 py-2 rounded-none transition-colors relative ${v?"opacity-40 cursor-not-allowed blur-[0.5px]":"hover:bg-white/5 cursor-pointer"}`,children:[s.jsx(w,{className:"w-4 h-4 text-white"}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[p.title,v&&s.jsx(nd,{className:"w-3 h-3 text-yellow-500"})]}),s.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:v?p.disabledMessage:p.description})]}),!v&&s.jsx(TP,{className:"w-4 h-4 text-gray-400"})]},p.id)})})},u))}),s.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const Yv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Xv=Xd,c2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Xv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const h=n==null?void 0:n[d],u=i==null?void 0:i[d];if(h===null)return null;const f=Yv(h)||Yv(u);return a[d][f]}),l=n&&Object.entries(n).reduce((d,h)=>{let[u,f]=h;return f===void 0||(d[u]=f),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:u,className:f,...p}=h;return Object.entries(p).every(w=>{let[v,b]=w;return Array.isArray(b)?b.includes({...i,...l}[v]):{...i,...l}[v]===b})?[...d,u,f]:d},[]);return Xv(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Hm=c2("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"}}),Y=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?SA:"button";return s.jsx(o,{className:De(Hm({variant:t,size:n,className:e})),ref:i,...a})});Y.displayName="Button";function k$({children:e}){const t=Gi(),{counts:n,loading:r}=Xu(),[a,i]=m.useState(!1),[o,l]=m.useState("v1.0.0");m.useEffect(()=>{const h=u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),i(!0))};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[]),m.useEffect(()=>{(async()=>{var u;try{const p=await(await fetch("/api/config")).json();(u=p.studio)!=null&&u.version&&l(`v${p.studio.version}`)}catch{}})()},[]);const c=h=>h>=1e3?`${(h/1e3).toFixed(1).replace(/\.0$/,"")}k`:h.toString(),d=[{name:"Dashboard",href:"/",icon:FP},{name:"Users",href:"/users",icon:Ma,badge:r?"...":c(n.users)},{name:"Organizations",href:"/organizations",icon:pr,badge:r?"...":c(n.organizations)},{name:"Database",href:"/database",icon:mt},{name:"Tools",href:"/tools",icon:BN},{name:"Settings",href:"/settings",icon:bi}];return s.jsxs("div",{className:"min-h-screen bg-black",children:[s.jsx("div",{className:"bg-black/70 border-b border-white/15",children:s.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[s.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:s.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),s.jsx("div",{className:"mb-0",children:s.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white",children:["Better-Auth Studio",s.jsxs("sup",{className:"text-sm text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:o}),s.jsx("span",{className:"ml-1",children:"]"})]})]})})]})}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>i(!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}),s.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"})]}),s.jsx("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",children:s.jsx(Y,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Docs"})}),s.jsx("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",children:s.jsx(Y,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Support"})})]})]})}),s.jsx("div",{className:"bg-black/50 border-b border-white/10",children:s.jsx("div",{className:"px-6",children:s.jsx("nav",{className:"flex space-x-8",children:d.map(h=>{const u=t.pathname===h.href;return s.jsxs(qp,{to:h.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[s.jsx(h.icon,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:[h.name,h.badge&&s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:h.badge}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},h.name)})})})}),s.jsx("div",{className:"flex-1 p-0",children:e}),s.jsx(j$,{isOpen:a,onClose:()=>i(!1)})]})}function Jd(e){"@babel/helpers - typeof";return Jd=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},Jd(e)}function Aa(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 en(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Tr(e){en(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Jd(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 S$(e,t){en(2,arguments);var n=Tr(e).getTime(),r=Aa(t);return new Date(n+r)}var C$={};function Qu(){return C$}function E$(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 M$(e){return en(1,arguments),e instanceof Date||Jd(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _$(e){if(en(1,arguments),!M$(e)&&typeof e!="number")return!1;var t=Tr(e);return!isNaN(Number(t))}function D$(e,t){en(2,arguments);var n=Aa(t);return S$(e,-n)}var T$=864e5;function P$(e){en(1,arguments);var t=Tr(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=n-r;return Math.floor(a/T$)+1}function eu(e){en(1,arguments);var t=1,n=Tr(e),r=n.getUTCDay(),a=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-a),n.setUTCHours(0,0,0,0),n}function d2(e){en(1,arguments);var t=Tr(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=eu(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=eu(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function A$(e){en(1,arguments);var t=d2(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=eu(n);return r}var O$=6048e5;function z$(e){en(1,arguments);var t=Tr(e),n=eu(t).getTime()-A$(t).getTime();return Math.round(n/O$)+1}function tu(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Qu(),u=Aa((n=(r=(a=(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&&a!==void 0?a:h.weekStartsOn)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&n!==void 0?n:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Tr(e),p=f.getUTCDay(),w=(p<u?7:0)+p-u;return f.setUTCDate(f.getUTCDate()-w),f.setUTCHours(0,0,0,0),f}function u2(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Tr(e),u=h.getUTCFullYear(),f=Qu(),p=Aa((n=(r=(a=(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&&a!==void 0?a:f.firstWeekContainsDate)!==null&&r!==void 0?r:(c=f.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(u+1,0,p),w.setUTCHours(0,0,0,0);var v=tu(w,t),b=new Date(0);b.setUTCFullYear(u,0,p),b.setUTCHours(0,0,0,0);var g=tu(b,t);return h.getTime()>=v.getTime()?u+1:h.getTime()>=g.getTime()?u:u-1}function $$(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Qu(),u=Aa((n=(r=(a=(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&&a!==void 0?a:h.firstWeekContainsDate)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=u2(e,t),p=new Date(0);p.setUTCFullYear(f,0,u),p.setUTCHours(0,0,0,0);var w=tu(p,t);return w}var R$=6048e5;function I$(e,t){en(1,arguments);var n=Tr(e),r=tu(n,t).getTime()-$$(n,t).getTime();return Math.round(r/R$)+1}function Ye(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var fs={y:function(t,n){var r=t.getUTCFullYear(),a=r>0?r:1-r;return Ye(n==="yy"?a%100:a,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Ye(r+1,2)},d:function(t,n){return Ye(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Ye(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Ye(t.getUTCHours(),n.length)},m:function(t,n){return Ye(t.getUTCMinutes(),n.length)},s:function(t,n){return Ye(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,a=t.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,r-3));return Ye(i,n.length)}},Ga={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},L$={G:function(t,n,r){var a=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var a=t.getUTCFullYear(),i=a>0?a:1-a;return r.ordinalNumber(i,{unit:"year"})}return fs.y(t,n)},Y:function(t,n,r,a){var i=u2(t,a),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return Ye(l,2)}return n==="Yo"?r.ordinalNumber(o,{unit:"year"}):Ye(o,n.length)},R:function(t,n){var r=d2(t);return Ye(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Ye(r,n.length)},Q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(a);case"QQ":return Ye(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(a);case"qq":return Ye(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,n,r){var a=t.getUTCMonth();switch(n){case"M":case"MM":return fs.M(t,n);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,n,r){var a=t.getUTCMonth();switch(n){case"L":return String(a+1);case"LL":return Ye(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,n,r,a){var i=I$(t,a);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):Ye(i,n.length)},I:function(t,n,r){var a=z$(t);return n==="Io"?r.ordinalNumber(a,{unit:"week"}):Ye(a,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):fs.d(t,n)},D:function(t,n,r){var a=P$(t);return n==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):Ye(a,n.length)},E:function(t,n,r){var a=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return Ye(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return Ye(o,n.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var a=t.getUTCDay(),i=a===0?7:a;switch(n){case"i":return String(i);case"ii":return Ye(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,n,r){var a=t.getUTCHours(),i=a/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var a=t.getUTCHours(),i;switch(a===12?i=Ga.noon:a===0?i=Ga.midnight:i=a/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var a=t.getUTCHours(),i;switch(a>=17?i=Ga.evening:a>=12?i=Ga.afternoon:a>=4?i=Ga.morning:i=Ga.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var a=t.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return fs.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):fs.H(t,n)},K:function(t,n,r){var a=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(a,{unit:"hour"}):Ye(a,n.length)},k:function(t,n,r){var a=t.getUTCHours();return a===0&&(a=24),n==="ko"?r.ordinalNumber(a,{unit:"hour"}):Ye(a,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):fs.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):fs.s(t,n)},S:function(t,n){return fs.S(t,n)},X:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Gv(o);case"XXXX":case"XX":return ta(o);case"XXXXX":case"XXX":default:return ta(o,":")}},x:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Gv(o);case"xxxx":case"xx":return ta(o);case"xxxxx":case"xxx":default:return ta(o,":")}},O:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+qv(o,":");case"OOOO":default:return"GMT"+ta(o,":")}},z:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+qv(o,":");case"zzzz":default:return"GMT"+ta(o,":")}},t:function(t,n,r,a){var i=a._originalDate||t,o=Math.floor(i.getTime()/1e3);return Ye(o,n.length)},T:function(t,n,r,a){var i=a._originalDate||t,o=i.getTime();return Ye(o,n.length)}};function qv(e,t){var n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(i===0)return n+String(a);var o=t;return n+String(a)+o+Ye(i,2)}function Gv(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Ye(Math.abs(e)/60,2)}return ta(e,t)}function ta(e,t){var n=t||"",r=e>0?"-":"+",a=Math.abs(e),i=Ye(Math.floor(a/60),2),o=Ye(a%60,2);return r+i+n+o}var Kv=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"})}},h2=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"})}},F$=function(t,n){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return Kv(t,n);var o;switch(a){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}}",Kv(a,n)).replace("{{time}}",h2(i,n))},U$={p:h2,P:F$},B$=["D","DD"],W$=["YY","YYYY"];function H$(e){return B$.indexOf(e)!==-1}function V$(e){return W$.indexOf(e)!==-1}function Qv(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 Y$={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"}},X$=function(t,n,r){var a,i=Y$[t];return typeof i=="string"?a=i:n===1?a=i.one:a=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function uf(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var q$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},G$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},K$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q$={date:uf({formats:q$,defaultWidth:"full"}),time:uf({formats:G$,defaultWidth:"full"}),dateTime:uf({formats:K$,defaultWidth:"full"})},Z$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},J$=function(t,n,r,a){return Z$[t]};function bo(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[c]||e.values[l]}var d=e.argumentCallback?e.argumentCallback(t):t;return a[d]}}var eR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nR={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"]},rR={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"]},sR={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"}},aR={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"}},iR=function(t,n){var r=Number(t),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},oR={ordinalNumber:iR,era:bo({values:eR,defaultWidth:"wide"}),quarter:bo({values:tR,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:bo({values:nR,defaultWidth:"wide"}),day:bo({values:rR,defaultWidth:"wide"}),dayPeriod:bo({values:sR,defaultWidth:"wide",formattingValues:aR,defaultFormattingWidth:"wide"})};function No(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?cR(l,function(u){return u.test(o)}):lR(l,function(u){return u.test(o)}),d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;var h=t.slice(o.length);return{value:d,rest:h}}}function lR(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function cR(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function dR(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var a=r[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(a.length);return{value:o,rest:l}}}var uR=/^(\d+)(th|st|nd|rd)?/i,hR=/\d+/i,fR={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},mR={any:[/^b/i,/^(a|c)/i]},pR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xR={any:[/1/i,/2/i,/3/i,/4/i]},gR={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},vR={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]},wR={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},yR={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]},bR={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},NR={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}},jR={ordinalNumber:dR({matchPattern:uR,parsePattern:hR,valueCallback:function(t){return parseInt(t,10)}}),era:No({matchPatterns:fR,defaultMatchWidth:"wide",parsePatterns:mR,defaultParseWidth:"any"}),quarter:No({matchPatterns:pR,defaultMatchWidth:"wide",parsePatterns:xR,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:No({matchPatterns:gR,defaultMatchWidth:"wide",parsePatterns:vR,defaultParseWidth:"any"}),day:No({matchPatterns:wR,defaultMatchWidth:"wide",parsePatterns:yR,defaultParseWidth:"any"}),dayPeriod:No({matchPatterns:bR,defaultMatchWidth:"any",parsePatterns:NR,defaultParseWidth:"any"})},kR={code:"en-US",formatDistance:X$,formatLong:Q$,formatRelative:J$,localize:oR,match:jR,options:{weekStartsOn:0,firstWeekContainsDate:1}},SR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,CR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ER=/^'([^]*?)'?$/,MR=/''/g,_R=/[a-zA-Z]/;function An(e,t,n){var r,a,i,o,l,c,d,h,u,f,p,w,v,b;en(2,arguments);var g=String(t),y=Qu(),x=(r=(a=void 0)!==null&&a!==void 0?a:y.locale)!==null&&r!==void 0?r:kR,N=Aa((i=(o=(l=(c=void 0)!==null&&c!==void 0?c:void 0)!==null&&l!==void 0?l:y.firstWeekContainsDate)!==null&&o!==void 0?o:(d=y.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Aa((u=(f=(p=(w=void 0)!==null&&w!==void 0?w:void 0)!==null&&p!==void 0?p:y.weekStartsOn)!==null&&f!==void 0?f:(v=y.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var k=Tr(e);if(!_$(k))throw new RangeError("Invalid time value");var S=E$(k),M=D$(k,S),A={firstWeekContainsDate:N,weekStartsOn:j,locale:x,_originalDate:k},I=g.match(CR).map(function(U){var $=U[0];if($==="p"||$==="P"){var L=U$[$];return L(U,x.formatLong)}return U}).join("").match(SR).map(function(U){if(U==="''")return"'";var $=U[0];if($==="'")return DR(U);var L=L$[$];if(L)return V$(U)&&Qv(U,t,String(e)),H$(U)&&Qv(U,t,String(e)),L(M,U,x.localize,A);if($.match(_R))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return U}).join("");return I}function DR(e){var t=e.match(ER);return t?t[1].replace(MR,"'"):e}function TR(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 hf={},Ao={};function la(e,t){try{const r=(hf[e]||(hf[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in Ao?Ao[r]:Zv(r,r.split(":"))}catch{if(e in Ao)return Ao[e];const n=e==null?void 0:e.match(PR);return n?Zv(e,n.slice(1)):NaN}}const PR=/([+-]\d\d):?(\d\d)?/;function Zv(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return Ao[e]=n*60+r>0?n*60+r+a:n*60-r-a}class yr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(la(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)),f2(this),Vm(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new yr(...n,t):new yr(Date.now(),t)}withTimeZone(t){return new yr(+this,t)}getTimezoneOffset(){const t=-la(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Vm(this),+this}[Symbol.for("constructDateFrom")](t){return new yr(+new Date(t),this.timeZone)}}const Jv=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Jv.test(e))return;const t=e.replace(Jv,"$1UTC");yr.prototype[t]&&(e.startsWith("get")?yr.prototype[e]=function(){return this.internal[t]()}:(yr.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),AR(this),+this},yr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Vm(this),+this}))});function Vm(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-la(e.timeZone,e)*60))}function AR(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()),f2(e)}function f2(e){const t=la(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),o=a-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const h=a>0?d.getSeconds():(d.getSeconds()-60)%60,u=Math.round(-(la(e.timeZone,e)*60))%60;(u||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+h));const f=la(e.timeZone,e),p=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-p,b=p!==n,g=v-c;if(b&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const y=la(e.timeZone,e),x=y>0?Math.floor(y):Math.ceil(y),N=p-x;N&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N))}}class Vt extends yr{static tz(t,...n){return n.length?new Vt(...n,t):new Vt(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${TR(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?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new Vt(+this,t)}[Symbol.for("constructDateFrom")](t){return new Vt(+new Date(t),this.timeZone)}}const m2=6048e5,OR=864e5,ew=Symbol.for("constructDateFrom");function St(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ew in e?e[ew](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ke(e,t){return St(t||e,e)}function p2(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(t)?St(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function x2(e,t,n){const r=Ke(e,n==null?void 0:n.in);if(isNaN(t))return St(e,NaN);if(!t)return r;const a=r.getDate(),i=St(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const o=i.getDate();return a>=o?i:(r.setFullYear(i.getFullYear(),i.getMonth(),a),r)}let zR={};function Ul(){return zR}function Wi(e,t){var l,c,d,h;const n=Ul(),r=(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=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function kl(e,t){return Wi(e,{...t,weekStartsOn:1})}function g2(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=St(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=kl(a),o=St(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const l=kl(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function tw(e){const t=Ke(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 Ji(e,...t){const n=St.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Sl(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function v2(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t),i=Sl(r),o=Sl(a),l=+i-tw(i),c=+o-tw(o);return Math.round((l-c)/OR)}function $R(e,t){const n=g2(e,t),r=St(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),kl(r)}function RR(e,t,n){return p2(e,t*7,n)}function IR(e,t,n){return x2(e,t*12,n)}function LR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=St.bind(null,a));const i=Ke(a,r);(!n||n<i||isNaN(+i))&&(n=i)}),St(r,n||NaN)}function FR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=St.bind(null,a));const i=Ke(a,r);(!n||n>i||isNaN(+i))&&(n=i)}),St(r,n||NaN)}function UR(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return+Sl(r)==+Sl(a)}function w2(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function BR(e){return!(!w2(e)&&typeof e!="number"||isNaN(+Ke(e)))}function WR(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t),i=r.getFullYear()-a.getFullYear(),o=r.getMonth()-a.getMonth();return i*12+o}function HR(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function y2(e,t){const[n,r]=Ji(e,t.start,t.end);return{start:n,end:r}}function VR(e,t){const{start:n,end:r}=y2(t==null?void 0:t.in,e);let a=+n>+r;const i=a?+n:+r,o=a?r:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(St(n,o)),o.setMonth(o.getMonth()+l);return a?c.reverse():c}function YR(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function XR(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function b2(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function qR(e,t){const{start:n,end:r}=y2(t==null?void 0:t.in,e);let a=+n>+r;const i=a?+n:+r,o=a?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(St(n,o)),o.setFullYear(o.getFullYear()+l);return a?c.reverse():c}function N2(e,t){var l,c,d,h;const n=Ul(),r=(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=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),i=a.getDay(),o=(i<r?-7:0)+6-(i-r);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function GR(e,t){return N2(e,{...t,weekStartsOn:1})}const KR={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"}},QR=(e,t,n)=>{let r;const a=KR[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ff(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ZR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},JR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},e8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},t8={date:ff({formats:ZR,defaultWidth:"full"}),time:ff({formats:JR,defaultWidth:"full"}),dateTime:ff({formats:e8,defaultWidth:"full"})},n8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},r8=(e,t,n,r)=>n8[e];function jo(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const s8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},i8={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"]},o8={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"]},l8={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"}},c8={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"}},d8=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},u8={ordinalNumber:d8,era:jo({values:s8,defaultWidth:"wide"}),quarter:jo({values:a8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:jo({values:i8,defaultWidth:"wide"}),day:jo({values:o8,defaultWidth:"wide"}),dayPeriod:jo({values:l8,defaultWidth:"wide",formattingValues:c8,defaultFormattingWidth:"wide"})};function ko(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?f8(l,u=>u.test(o)):h8(l,u=>u.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(o.length);return{value:d,rest:h}}}function h8(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function f8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function m8(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[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(a.length);return{value:o,rest:l}}}const p8=/^(\d+)(th|st|nd|rd)?/i,x8=/\d+/i,g8={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},v8={any:[/^b/i,/^(a|c)/i]},w8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},y8={any:[/1/i,/2/i,/3/i,/4/i]},b8={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},N8={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]},j8={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},k8={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]},S8={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},C8={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}},E8={ordinalNumber:m8({matchPattern:p8,parsePattern:x8,valueCallback:e=>parseInt(e,10)}),era:ko({matchPatterns:g8,defaultMatchWidth:"wide",parsePatterns:v8,defaultParseWidth:"any"}),quarter:ko({matchPatterns:w8,defaultMatchWidth:"wide",parsePatterns:y8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ko({matchPatterns:b8,defaultMatchWidth:"wide",parsePatterns:N8,defaultParseWidth:"any"}),day:ko({matchPatterns:j8,defaultMatchWidth:"wide",parsePatterns:k8,defaultParseWidth:"any"}),dayPeriod:ko({matchPatterns:S8,defaultMatchWidth:"any",parsePatterns:C8,defaultParseWidth:"any"})},Ox={code:"en-US",formatDistance:QR,formatLong:t8,formatRelative:r8,localize:u8,match:E8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function M8(e,t){const n=Ke(e,t==null?void 0:t.in);return v2(n,b2(n))+1}function j2(e,t){const n=Ke(e,t==null?void 0:t.in),r=+kl(n)-+$R(n);return Math.round(r/m2)+1}function k2(e,t){var h,u,f,p;const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=Ul(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(f=a.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=St((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=Wi(o,t),c=St((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Wi(c,t);return+n>=+l?r+1:+n>=+d?r:r-1}function _8(e,t){var l,c,d,h;const n=Ul(),r=(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=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,a=k2(e,t),i=St((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Wi(i,t)}function S2(e,t){const n=Ke(e,t==null?void 0:t.in),r=+Wi(n,t)-+_8(n,t);return Math.round(r/m2)+1}function Xe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ms={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Xe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Xe(n+1,2)},d(e,t){return Xe(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 Xe(e.getHours()%12||12,t.length)},H(e,t){return Xe(e.getHours(),t.length)},m(e,t){return Xe(e.getMinutes(),t.length)},s(e,t){return Xe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Xe(a,t.length)}},Ka={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},nw={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return ms.y(e,t)},Y:function(e,t,n,r){const a=k2(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return Xe(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Xe(i,t.length)},R:function(e,t){const n=g2(e);return Xe(n,t.length)},u:function(e,t){const n=e.getFullYear();return Xe(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Xe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Xe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ms.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Xe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=S2(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Xe(a,t.length)},I:function(e,t,n){const r=j2(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Xe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ms.d(e,t)},D:function(e,t,n){const r=M8(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Xe(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":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"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Xe(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Xe(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Xe(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Ka.noon:r===0?a=Ka.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Ka.evening:r>=12?a=Ka.afternoon:r>=4?a=Ka.morning:a=Ka.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ms.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ms.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Xe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Xe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ms.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ms.s(e,t)},S:function(e,t){return ms.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return sw(r);case"XXXX":case"XX":return na(r);case"XXXXX":case"XXX":default:return na(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return sw(r);case"xxxx":case"xx":return na(r);case"xxxxx":case"xxx":default:return na(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rw(r,":");case"OOOO":default:return"GMT"+na(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rw(r,":");case"zzzz":default:return"GMT"+na(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Xe(r,t.length)},T:function(e,t,n){return Xe(+e,t.length)}};function rw(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Xe(i,2)}function sw(e,t){return e%60===0?(e>0?"-":"+")+Xe(Math.abs(e)/60,2):na(e,t)}function na(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Xe(Math.trunc(r/60),2),i=Xe(r%60,2);return n+a+t+i}const aw=(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"})}},C2=(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"})}},D8=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return aw(e,t);let i;switch(r){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}}",aw(r,t)).replace("{{time}}",C2(a,t))},T8={p:C2,P:D8},P8=/^D+$/,A8=/^Y+$/,O8=["D","DD","YY","YYYY"];function z8(e){return P8.test(e)}function $8(e){return A8.test(e)}function R8(e,t,n){const r=I8(e,t,n);if(console.warn(r),O8.includes(e))throw new RangeError(r)}function I8(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const L8=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,F8=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,U8=/^'([^]*?)'?$/,B8=/''/g,W8=/[a-zA-Z]/;function H8(e,t,n){var h,u,f,p,w,v,b,g;const r=Ul(),a=(n==null?void 0:n.locale)??r.locale??Ox,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((g=(b=r.locale)==null?void 0:b.options)==null?void 0:g.weekStartsOn)??0,l=Ke(e,n==null?void 0:n.in);if(!BR(l))throw new RangeError("Invalid time value");let c=t.match(F8).map(y=>{const x=y[0];if(x==="p"||x==="P"){const N=T8[x];return N(y,a.formatLong)}return y}).join("").match(L8).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:V8(y)};if(nw[x])return{isToken:!0,value:y};if(x.match(W8))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(y=>{if(!y.isToken)return y.value;const x=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&$8(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&z8(x))&&R8(x,t,String(e));const N=nw[x[0]];return N(l,x,a.localize,d)}).join("")}function V8(e){const t=e.match(U8);return t?t[1].replace(B8,"'"):e}function Y8(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),i=St(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function X8(e,t){return Ke(e,t==null?void 0:t.in).getMonth()}function q8(e,t){return Ke(e,t==null?void 0:t.in).getFullYear()}function G8(e,t){return+Ke(e)>+Ke(t)}function K8(e,t){return+Ke(e)<+Ke(t)}function Q8(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function Z8(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()}function J8(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=r.getFullYear(),i=r.getDate(),o=St(e,0);o.setFullYear(a,t,15),o.setHours(0,0,0,0);const l=Y8(o);return r.setMonth(t,Math.min(i,l)),r}function eI(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(+r)?St(e,NaN):(r.setFullYear(t),r)}const iw=5,tI=4;function nI(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),i=t.addDays(a,iw*7-1);return t.getMonth(e)===t.getMonth(i)?iw:tI}function E2(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function rI(e,t){const n=E2(e,t),r=nI(e,t);return t.addDays(n,r*7-1)}class jn{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Vt.tz(this.options.timeZone):new this.Date},this.newDate=(r,a,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(r,a,i):this.options.timeZone?new Vt(r,a,i,this.options.timeZone):new Date(r,a,i)},this.addDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,a):p2(r,a)},this.addMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,a):x2(r,a)},this.addWeeks=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,a):RR(r,a)},this.addYears=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,a):IR(r,a)},this.differenceInCalendarDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):v2(r,a)},this.differenceInCalendarMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):WR(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):VR(r)},this.eachYearOfInterval=r=>{var l;const a=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):qR(r),i=new Set(a.map(c=>this.getYear(c)));if(i.size===a.length)return a;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):rI(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):GR(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):HR(r)},this.endOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,a):N2(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):XR(r)},this.format=(r,a,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(r,a,this.options):H8(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):j2(r)},this.getMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):X8(r,this.options)},this.getYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):q8(r,this.options)},this.getWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):S2(r,this.options)},this.isAfter=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,a):G8(r,a)},this.isBefore=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,a):K8(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):w2(r)},this.isSameDay=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,a):UR(r,a)},this.isSameMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,a):Q8(r,a)},this.isSameYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,a):Z8(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):LR(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):FR(r)},this.setMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,a):J8(r,a)},this.setYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,a):eI(r,a)},this.startOfBroadcastWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):E2(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):Sl(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):kl(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):YR(r)},this.startOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Wi(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):b2(r)},this.options={locale:Ox,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&jn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,i=n==null?void 0:n.code;if(i&&jn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}jn.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 Pr=new jn;class M2{constructor(t,n,r=Pr){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class sI{constructor(t,n){this.date=t,this.weeks=n}}class aI{constructor(t,n){this.days=n,this.weekNumber=t}}function iI(e){return Q.createElement("button",{...e})}function oI(e){return Q.createElement("span",{...e})}function lI(e){const{size:t=24,orientation:n="left",className:r}=e;return Q.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Q.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Q.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Q.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Q.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function cI(e){const{day:t,modifiers:n,...r}=e;return Q.createElement("td",{...r})}function dI(e){const{day:t,modifiers:n,...r}=e,a=Q.useRef(null);return Q.useEffect(()=>{var i;n.focused&&((i=a.current)==null||i.focus())},[n.focused]),Q.createElement("button",{ref:a,...r})}var ke;(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"})(ke||(ke={}));var ht;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ht||(ht={}));var Jn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Jn||(Jn={}));var mn;(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"})(mn||(mn={}));function uI(e){const{options:t,className:n,components:r,classNames:a,...i}=e,o=[a[ke.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return Q.createElement("span",{"data-disabled":i.disabled,className:a[ke.DropdownRoot]},Q.createElement(r.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:h})=>Q.createElement(r.Option,{key:c,value:c,disabled:h},d))),Q.createElement("span",{className:a[ke.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,Q.createElement(r.Chevron,{orientation:"down",size:18,className:a[ke.Chevron]})))}function hI(e){return Q.createElement("div",{...e})}function fI(e){return Q.createElement("div",{...e})}function mI(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement("div",{...r},e.children)}function pI(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement("div",{...r})}function xI(e){return Q.createElement("table",{...e})}function gI(e){return Q.createElement("div",{...e})}const _2=m.createContext(void 0);function Bl(){const e=m.useContext(_2);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function vI(e){const{components:t}=Bl();return Q.createElement(t.Dropdown,{...e})}function wI(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Bl(),h=m.useCallback(f=>{a&&(n==null||n(f))},[a,n]),u=m.useCallback(f=>{r&&(t==null||t(f))},[r,t]);return Q.createElement("nav",{...i},Q.createElement(o.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:u},Q.createElement(o.Chevron,{disabled:r?void 0:!0,className:l[ke.Chevron],orientation:"left"})),Q.createElement(o.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":d(a),onClick:h},Q.createElement(o.Chevron,{disabled:a?void 0:!0,orientation:"right",className:l[ke.Chevron]})))}function yI(e){const{components:t}=Bl();return Q.createElement(t.Button,{...e})}function bI(e){return Q.createElement("option",{...e})}function NI(e){const{components:t}=Bl();return Q.createElement(t.Button,{...e})}function jI(e){const{rootRef:t,...n}=e;return Q.createElement("div",{...n,ref:t})}function kI(e){return Q.createElement("select",{...e})}function SI(e){const{week:t,...n}=e;return Q.createElement("tr",{...n})}function CI(e){return Q.createElement("th",{...e})}function EI(e){return Q.createElement("thead",{"aria-hidden":!0},Q.createElement("tr",{...e}))}function MI(e){const{week:t,...n}=e;return Q.createElement("th",{...n})}function _I(e){return Q.createElement("th",{...e})}function DI(e){return Q.createElement("tbody",{...e})}function TI(e){const{components:t}=Bl();return Q.createElement(t.Dropdown,{...e})}const PI=Object.freeze(Object.defineProperty({__proto__:null,Button:iI,CaptionLabel:oI,Chevron:lI,Day:cI,DayButton:dI,Dropdown:uI,DropdownNav:hI,Footer:fI,Month:mI,MonthCaption:pI,MonthGrid:xI,Months:gI,MonthsDropdown:vI,Nav:wI,NextMonthButton:yI,Option:bI,PreviousMonthButton:NI,Root:jI,Select:kI,Week:SI,WeekNumber:MI,WeekNumberHeader:_I,Weekday:CI,Weekdays:EI,Weeks:DI,YearsDropdown:TI},Symbol.toStringTag,{value:"Module"}));function Br(e,t,n=!1,r=Pr){let{from:a,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=r;return a&&i?(o(i,a)<0&&([a,i]=[i,a]),o(t,a)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&a?l(a,t):!1}function D2(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function zx(e){return!!(e&&typeof e=="object"&&"from"in e)}function T2(e){return!!(e&&typeof e=="object"&&"after"in e)}function P2(e){return!!(e&&typeof e=="object"&&"before"in e)}function A2(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function O2(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Wr(e,t,n=Pr){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:i,isAfter:o}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return a(e,l);if(O2(l,n))return l.includes(e);if(zx(l))return Br(l,e,!1,n);if(A2(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(D2(l)){const c=i(l.before,e),d=i(l.after,e),h=c>0,u=d<0;return o(l.before,l.after)?u&&h:h||u}return T2(l)?i(e,l.after)>0:P2(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function AI(e,t,n,r,a){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:h}=t,{isSameDay:u,isSameMonth:f,startOfMonth:p,isBefore:w,endOfMonth:v,isAfter:b}=a,g=n&&p(n),y=r&&v(r),x={[ht.focused]:[],[ht.outside]:[],[ht.disabled]:[],[ht.hidden]:[],[ht.today]:[]},N={};for(const j of e){const{date:k,displayMonth:S}=j,M=!!(S&&!f(k,S)),A=!!(g&&w(k,g)),I=!!(y&&b(k,y)),U=!!(i&&Wr(k,i,a)),$=!!(o&&Wr(k,o,a))||A||I||!d&&!c&&M||d&&c===!1&&M,L=u(k,h??a.today());M&&x.outside.push(j),U&&x.disabled.push(j),$&&x.hidden.push(j),L&&x.today.push(j),l&&Object.keys(l).forEach(E=>{const O=l==null?void 0:l[E];O&&Wr(k,O,a)&&(N[E]?N[E].push(j):N[E]=[j])})}return j=>{const k={[ht.focused]:!1,[ht.disabled]:!1,[ht.hidden]:!1,[ht.outside]:!1,[ht.today]:!1},S={};for(const M in x){const A=x[M];k[M]=A.some(I=>I===j)}for(const M in N)S[M]=N[M].some(A=>A===j);return{...k,...S}}}function OI(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):t[ht[i]]?a.push(t[ht[i]]):t[Jn[i]]&&a.push(t[Jn[i]]),a),[t[ke.Day]])}function zI(e){return{...PI,...e}}function $I(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,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function $x(){const e={};for(const t in ke)e[ke[t]]=`rdp-${ke[t]}`;for(const t in ht)e[ht[t]]=`rdp-${ht[t]}`;for(const t in Jn)e[Jn[t]]=`rdp-${Jn[t]}`;for(const t in mn)e[mn[t]]=`rdp-${mn[t]}`;return e}function z2(e,t,n){return(n??new jn(t)).formatMonthYear(e)}const RI=z2;function II(e,t,n){return(n??new jn(t)).format(e,"d")}function LI(e,t=Pr){return t.format(e,"LLLL")}function FI(e,t,n){return(n??new jn(t)).format(e,"cccccc")}function UI(e,t=Pr){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function BI(){return""}function $2(e,t=Pr){return t.format(e,"yyyy")}const WI=$2,HI=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:z2,formatDay:II,formatMonthCaption:RI,formatMonthDropdown:LI,formatWeekNumber:UI,formatWeekNumberHeader:BI,formatWeekdayName:FI,formatYearCaption:WI,formatYearDropdown:$2},Symbol.toStringTag,{value:"Module"}));function VI(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...HI,...e}}function YI(e,t,n,r,a){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=a;return c({start:o(e),end:l(e)}).map(f=>{const p=r.formatMonthDropdown(f,a),w=d(f),v=t&&f<i(t)||n&&f>i(n)||!1;return{value:w,label:p,disabled:v}})}function XI(e,t={},n={}){let r={...t==null?void 0:t[ke.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function qI(e,t,n){const r=e.today(),a=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let o=0;o<7;o++){const l=e.addDays(a,o);i.push(l)}return i}function GI(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=r,d=i(e),h=o(t),u=l({start:d,end:h});return a&&u.reverse(),u.map(f=>{const p=n.formatYearDropdown(f,r);return{value:c(f),label:p,disabled:!1}})}function R2(e,t,n,r){let a=(r??new jn(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const KI=R2;function I2(e,t,n){return(n??new jn(t)).formatMonthYear(e)}const QI=I2;function ZI(e,t,n,r){let a=(r??new jn(n)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function JI(e){return"Choose the Month"}function eL(){return""}function tL(e){return"Go to the Next Month"}function nL(e){return"Go to the Previous Month"}function rL(e,t,n){return(n??new jn(t)).format(e,"cccc")}function sL(e,t){return`Week ${e}`}function aL(e){return"Week Number"}function iL(e){return"Choose the Year"}const oL=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:QI,labelDay:KI,labelDayButton:R2,labelGrid:I2,labelGridcell:ZI,labelMonthDropdown:JI,labelNav:eL,labelNext:tL,labelPrevious:nL,labelWeekNumber:sL,labelWeekNumberHeader:aL,labelWeekday:rL,labelYearDropdown:iL},Symbol.toStringTag,{value:"Module"})),Wl=e=>e instanceof HTMLElement?e:null,mf=e=>[...e.querySelectorAll("[data-animated-month]")??[]],lL=e=>Wl(e.querySelector("[data-animated-month]")),pf=e=>Wl(e.querySelector("[data-animated-caption]")),xf=e=>Wl(e.querySelector("[data-animated-weeks]")),cL=e=>Wl(e.querySelector("[data-animated-nav]")),dL=e=>Wl(e.querySelector("[data-animated-weekdays]"));function uL(e,t,{classNames:n,months:r,focused:a,dateLib:i}){const o=m.useRef(null),l=m.useRef(r),c=m.useRef(!1);m.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const h=i.isSameMonth(r[0].date,d[0].date),u=i.isAfter(r[0].date,d[0].date),f=u?n[mn.caption_after_enter]:n[mn.caption_before_enter],p=u?n[mn.weeks_after_enter]:n[mn.weeks_before_enter],w=o.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(mf(v).forEach(x=>{if(!(x instanceof HTMLElement))return;const N=lL(x);N&&x.contains(N)&&x.removeChild(N);const j=pf(x);j&&j.classList.remove(f);const k=xf(x);k&&k.classList.remove(p)}),o.current=v):o.current=null,c.current||h||a)return;const b=w instanceof HTMLElement?mf(w):[],g=mf(e.current);if(g!=null&&g.every(y=>y instanceof HTMLElement)&&b&&b.every(y=>y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const y=cL(e.current);y&&(y.style.zIndex="1"),g.forEach((x,N)=>{const j=b[N];if(!j)return;x.style.position="relative",x.style.overflow="hidden";const k=pf(x);k&&k.classList.add(f);const S=xf(x);S&&S.classList.add(p);const M=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),k&&k.classList.remove(f),S&&S.classList.remove(p),x.style.position="",x.style.overflow="",x.contains(j)&&x.removeChild(j)};j.style.pointerEvents="none",j.style.position="absolute",j.style.overflow="hidden",j.setAttribute("aria-hidden","true");const A=dL(j);A&&(A.style.opacity="0");const I=pf(j);I&&(I.classList.add(u?n[mn.caption_before_exit]:n[mn.caption_after_exit]),I.addEventListener("animationend",M));const U=xf(j);U&&U.classList.add(u?n[mn.weeks_before_exit]:n[mn.weeks_after_exit]),x.insertBefore(j,x.firstChild)})}})}function hL(e,t,n,r){const a=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:h,differenceInCalendarMonths:u,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:w,endOfWeek:v,isAfter:b,startOfBroadcastWeek:g,startOfISOWeek:y,startOfWeek:x}=r,N=c?g(a,r):o?y(a):x(a),j=c?f(i):o?p(w(i)):v(w(i)),k=h(j,N),S=u(i,a)+1,M=[];for(let U=0;U<=k;U++){const $=d(N,U);if(t&&b($,t))break;M.push($)}const I=(c?35:42)*S;if(l&&M.length<I){const U=I-M.length;for(let $=0;$<U;$++){const L=d(M[M.length-1],1);M.push(L)}}return M}function fL(e){const t=[];return e.reduce((n,r)=>{const a=r.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function mL(e,t,n,r){const{numberOfMonths:a=1}=n,i=[];for(let o=0;o<a;o++){const l=r.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function ow(e,t,n,r){const{month:a,defaultMonth:i,today:o=r.today(),numberOfMonths:l=1}=e;let c=a||i||o;const{differenceInCalendarMonths:d,addMonths:h,startOfMonth:u}=r;if(n&&d(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&d(c,t)<0&&(c=t),u(c)}function pL(e,t,n,r){const{addDays:a,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:h,startOfBroadcastWeek:u,startOfISOWeek:f,startOfWeek:p}=r,w=e.reduce((v,b)=>{const g=n.broadcastCalendar?u(b,r):n.ISOWeek?f(b):p(b),y=n.broadcastCalendar?i(b):n.ISOWeek?o(l(b)):c(l(b)),x=t.filter(S=>S>=g&&S<=y),N=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<N){const S=t.filter(M=>{const A=N-x.length;return M>y&&M<=a(y,A)});x.push(...S)}const j=x.reduce((S,M)=>{const A=n.ISOWeek?d(M):h(M),I=S.find($=>$.weekNumber===A),U=new M2(M,b,r);return I?I.days.push(U):S.push(new aI(A,[U])),S},[]),k=new sI(b,j);return v.push(k),v},[]);return n.reverseMonths?w.reverse():w}function xL(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:h,today:u}=t,{fromYear:f,toYear:p,fromMonth:w,toMonth:v}=e;!n&&w&&(n=w),!n&&f&&(n=t.newDate(f,0,1)),!r&&v&&(r=v),!r&&p&&(r=h(p,11,31));const b=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&b&&(n=a(c(e.today??u(),-100))),r?r=l(r):p?r=h(p,11,31):!r&&b&&(r=d(e.today??u())),[n&&i(n),r&&i(r)]}function gL(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=a?i:1,h=o(e);if(!t)return l(h,d);if(!(c(t,e)<i))return l(h,d)}function vL(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=a?i??1:1,h=o(e);if(!t)return l(h,-d);if(!(c(h,t)<=0))return l(h,-d)}function wL(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Zu(e,t){const[n,r]=m.useState(e);return[t===void 0?n:t,r]}function yL(e,t){const[n,r]=xL(e,t),{startOfMonth:a,endOfMonth:i}=t,o=ow(e,n,r,t),[l,c]=Zu(o,e.month?o:void 0);m.useEffect(()=>{const k=ow(e,n,r,t);c(k)},[e.timeZone]);const d=mL(l,r,e,t),h=hL(d,e.endMonth?i(e.endMonth):void 0,e,t),u=pL(d,h,e,t),f=wL(u),p=fL(u),w=vL(l,n,e,t),v=gL(l,r,e,t),{disableNavigation:b,onMonthChange:g}=e,y=k=>f.some(S=>S.days.some(M=>M.isEqualTo(k))),x=k=>{if(b)return;let S=a(k);n&&S<a(n)&&(S=a(n)),r&&S>a(r)&&(S=a(r)),c(S),g==null||g(S)};return{months:u,weeks:f,days:p,navStart:n,navEnd:r,previousMonth:w,nextMonth:v,goToMonth:x,goToDay:k=>{y(k)||x(k.date)}}}var mr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(mr||(mr={}));function lw(e){return!e[ht.disabled]&&!e[ht.hidden]&&!e[ht.outside]}function bL(e,t,n,r){let a,i=-1;for(const o of e){const l=t(o);lw(l)&&(l[ht.focused]&&i<mr.FocusedModifier?(a=o,i=mr.FocusedModifier):r!=null&&r.isEqualTo(o)&&i<mr.LastFocused?(a=o,i=mr.LastFocused):n(o.date)&&i<mr.Selected?(a=o,i=mr.Selected):l[ht.today]&&i<mr.Today&&(a=o,i=mr.Today))}return a||(a=e.find(o=>lw(t(o)))),a}function NL(e,t,n,r,a,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:h,addWeeks:u,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:w,endOfWeek:v,max:b,min:g,startOfBroadcastWeek:y,startOfISOWeek:x,startOfWeek:N}=o;let k={day:d,week:u,month:h,year:f,startOfWeek:S=>c?y(S,o):l?x(S):N(S),endOfWeek:S=>c?p(S):l?w(S):v(S)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=b([r,k]):t==="after"&&a&&(k=g([a,k])),k}function L2(e,t,n,r,a,i,o,l=0){if(l>365)return;const c=NL(e,t,n.date,r,a,i,o),d=!!(i.disabled&&Wr(c,i.disabled,o)),h=!!(i.hidden&&Wr(c,i.hidden,o)),u=c,f=new M2(c,u,o);return!d&&!h?f:L2(e,t,f,r,a,i,o,l+1)}function jL(e,t,n,r,a){const{autoFocus:i}=e,[o,l]=m.useState(),c=bL(t.days,n,r||(()=>!1),o),[d,h]=m.useState(i?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:h,focused:d,blur:()=>{l(d),h(void 0)},moveFocus:(v,b)=>{if(!d)return;const g=L2(v,b,d,t.navStart,t.navEnd,e,a);g&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function kL(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=Zu(n,a?n:void 0),l=a?n:i,{isSameDay:c}=t,d=p=>(l==null?void 0:l.some(w=>c(w,p)))??!1,{min:h,max:u}=e;return{selected:l,select:(p,w,v)=>{let b=[...l??[]];if(d(p)){if((l==null?void 0:l.length)===h||r&&(l==null?void 0:l.length)===1)return;b=l==null?void 0:l.filter(g=>!c(g,p))}else(l==null?void 0:l.length)===u?b=[p]:b=[...b,p];return a||o(b),a==null||a(b,p,w,v),b},isSelected:d}}function SL(e,t,n=0,r=0,a=!1,i=Pr){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:h}=i;let u;if(!o&&!l)u={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?u={from:o,to:e}:a?u={from:o,to:void 0}:u=void 0:h(e,o)?u={from:e,to:o}:u={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))a?u={from:o,to:l}:u=void 0;else if(c(o,e))u={from:o,to:n>0?void 0:e};else if(c(l,e))u={from:e,to:n>0?void 0:e};else if(h(e,o))u={from:e,to:l};else if(d(e,o))u={from:o,to:e};else if(d(e,l))u={from:o,to:e};else throw new Error("Invalid range");if(u!=null&&u.from&&(u!=null&&u.to)){const f=i.differenceInCalendarDays(u.to,u.from);r>0&&f>r?u={from:e,to:void 0}:n>1&&f<n&&(u={from:e,to:void 0})}return u}function CL(e,t,n=Pr){const r=Array.isArray(t)?t:[t];let a=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function cw(e,t,n=Pr){return Br(e,t.from,!1,n)||Br(e,t.to,!1,n)||Br(t,e.from,!1,n)||Br(t,e.to,!1,n)}function EL(e,t,n=Pr){const r=Array.isArray(t)?t:[t];if(r.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Br(e,l,!1,n):O2(l,n)?l.some(c=>Br(e,c,!1,n)):zx(l)?l.from&&l.to?cw(e,{from:l.from,to:l.to},n):!1:A2(l)?CL(e,l.dayOfWeek,n):D2(l)?n.isAfter(l.before,l.after)?cw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Wr(e.from,l,n)||Wr(e.to,l,n):T2(l)||P2(l)?Wr(e.from,l,n)||Wr(e.to,l,n):!1))return!0;const o=r.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function ML(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:i,onSelect:o}=e,[l,c]=Zu(a,o?a:void 0),d=o?a:l;return{selected:d,select:(f,p,w)=>{const{min:v,max:b}=e,g=f?SL(f,d,v,b,i,t):void 0;return r&&n&&(g!=null&&g.from)&&g.to&&EL({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,p,w),g},isSelected:f=>d&&Br(d,f,!1,t)}}function _L(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=Zu(n,a?n:void 0),l=a?n:i,{isSameDay:c}=t;return{selected:l,select:(u,f,p)=>{let w=u;return!r&&l&&l&&c(u,l)&&(w=void 0),a||o(w),a==null||a(w,u,f,p),w},isSelected:u=>l?c(l,u):!1}}function DL(e,t){const n=_L(e,t),r=kL(e,t),a=ML(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function TL(e){var Se;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Vt(t.today,t.timeZone)),t.month&&(t.month=new Vt(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Vt(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Vt(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Vt(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Vt(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(Se=t.selected)==null?void 0:Se.map(ue=>new Vt(ue,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Vt(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Vt(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const ue={...Ox,...t.locale};return{dateLib:new jn({locale:ue,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:zI(t.components),formatters:VI(t.formatters),labels:{...oL,...t.labels},locale:ue,classNames:{...$x(),...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:d,navLayout:h,numberOfMonths:u=1,onDayBlur:f,onDayClick:p,onDayFocus:w,onDayKeyDown:v,onDayMouseEnter:b,onDayMouseLeave:g,onNextClick:y,onPrevClick:x,showWeekNumber:N,styles:j}=t,{formatCaption:k,formatDay:S,formatMonthDropdown:M,formatWeekNumber:A,formatWeekNumberHeader:I,formatWeekdayName:U,formatYearDropdown:$}=r,L=yL(t,i),{days:E,months:O,navStart:D,navEnd:T,previousMonth:C,nextMonth:_,goToMonth:z}=L,H=AI(E,t,D,T,i),{isSelected:P,select:B,selected:q}=DL(t,i)??{},{blur:G,focused:se,isFocusTarget:re,moveFocus:Z,setFocused:R}=jL(t,L,H,P??(()=>!1),i),{labelDayButton:ee,labelGridcell:J,labelGrid:F,labelMonthDropdown:K,labelNav:ne,labelPrevious:ce,labelNext:ge,labelWeekday:ve,labelWeekNumber:Ae,labelWeekNumberHeader:Te,labelYearDropdown:tt}=a,ut=m.useMemo(()=>qI(i,t.ISOWeek),[i,t.ISOWeek]),Le=d!==void 0||p!==void 0,Oe=m.useCallback(()=>{C&&(z(C),x==null||x(C))},[C,z,x]),Ge=m.useCallback(()=>{_&&(z(_),y==null||y(_))},[z,_,y]),Je=m.useCallback((ue,Pe)=>_e=>{_e.preventDefault(),_e.stopPropagation(),R(ue),B==null||B(ue.date,Pe,_e),p==null||p(ue.date,Pe,_e)},[B,p,R]),ot=m.useCallback((ue,Pe)=>_e=>{R(ue),w==null||w(ue.date,Pe,_e)},[w,R]),Ot=m.useCallback((ue,Pe)=>_e=>{G(),f==null||f(ue.date,Pe,_e)},[G,f]),zt=m.useCallback((ue,Pe)=>_e=>{const Fe={ArrowLeft:[_e.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[_e.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[_e.shiftKey?"year":"week","after"],ArrowUp:[_e.shiftKey?"year":"week","before"],PageUp:[_e.shiftKey?"year":"month","before"],PageDown:[_e.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Fe[_e.key]){_e.preventDefault(),_e.stopPropagation();const[bt,he]=Fe[_e.key];Z(bt,he)}v==null||v(ue.date,Pe,_e)},[Z,v,t.dir]),ae=m.useCallback((ue,Pe)=>_e=>{b==null||b(ue.date,Pe,_e)},[b]),me=m.useCallback((ue,Pe)=>_e=>{g==null||g(ue.date,Pe,_e)},[g]),ze=m.useCallback(ue=>Pe=>{const _e=Number(Pe.target.value),Fe=i.setMonth(i.startOfMonth(ue),_e);z(Fe)},[i,z]),X=m.useCallback(ue=>Pe=>{const _e=Number(Pe.target.value),Fe=i.setYear(i.startOfMonth(ue),_e);z(Fe)},[i,z]),{className:le,style:W}=m.useMemo(()=>({className:[l[ke.Root],t.className].filter(Boolean).join(" "),style:{...j==null?void 0:j[ke.Root],...t.style}}),[l,t.className,t.style,j]),te=$I(t),de=m.useRef(null);uL(de,!!t.animate,{classNames:l,months:O,focused:se,dateLib:i});const Ne={dayPickerProps:t,selected:q,select:B,isSelected:P,months:O,nextMonth:_,previousMonth:C,goToMonth:z,getModifiers:H,components:n,classNames:l,styles:j,labels:a,formatters:r};return Q.createElement(_2.Provider,{value:Ne},Q.createElement(n.Root,{rootRef:t.animate?de:void 0,className:le,style:W,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"],...te},Q.createElement(n.Months,{className:l[ke.Months],style:j==null?void 0:j[ke.Months]},!t.hideNavigation&&!h&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:j==null?void 0:j[ke.Nav],"aria-label":ne(),onPreviousClick:Oe,onNextClick:Ge,previousMonth:C,nextMonth:_}),O.map((ue,Pe)=>Q.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[ke.Month],style:j==null?void 0:j[ke.Month],key:Pe,displayIndex:Pe,calendarMonth:ue},h==="around"&&!t.hideNavigation&&Pe===0&&Q.createElement(n.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:C?void 0:-1,"aria-disabled":C?void 0:!0,"aria-label":ce(C),onClick:Oe,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:C?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Q.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[ke.MonthCaption],style:j==null?void 0:j[ke.MonthCaption],calendarMonth:ue,displayIndex:Pe},c!=null&&c.startsWith("dropdown")?Q.createElement(n.DropdownNav,{className:l[ke.Dropdowns],style:j==null?void 0:j[ke.Dropdowns]},(()=>{const _e=c==="dropdown"||c==="dropdown-months"?Q.createElement(n.MonthsDropdown,{key:"month",className:l[ke.MonthsDropdown],"aria-label":K(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:ze(ue.date),options:YI(ue.date,D,T,r,i),style:j==null?void 0:j[ke.Dropdown],value:i.getMonth(ue.date)}):Q.createElement("span",{key:"month"},M(ue.date,i)),Fe=c==="dropdown"||c==="dropdown-years"?Q.createElement(n.YearsDropdown,{key:"year",className:l[ke.YearsDropdown],"aria-label":tt(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:X(ue.date),options:GI(D,T,r,i,!!t.reverseYears),style:j==null?void 0:j[ke.Dropdown],value:i.getYear(ue.date)}):Q.createElement("span",{key:"year"},$(ue.date,i));return i.getMonthYearOrder()==="year-first"?[Fe,_e]:[_e,Fe]})(),Q.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"}},k(ue.date,i.options,i))):Q.createElement(n.CaptionLabel,{className:l[ke.CaptionLabel],role:"status","aria-live":"polite"},k(ue.date,i.options,i))),h==="around"&&!t.hideNavigation&&Pe===u-1&&Q.createElement(n.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:_?void 0:-1,"aria-disabled":_?void 0:!0,"aria-label":ge(_),onClick:Ge,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:_?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Pe===u-1&&h==="after"&&!t.hideNavigation&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:j==null?void 0:j[ke.Nav],"aria-label":ne(),onPreviousClick:Oe,onNextClick:Ge,previousMonth:C,nextMonth:_}),Q.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":F(ue.date,i.options,i)||void 0,className:l[ke.MonthGrid],style:j==null?void 0:j[ke.MonthGrid]},!t.hideWeekdays&&Q.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[ke.Weekdays],style:j==null?void 0:j[ke.Weekdays]},N&&Q.createElement(n.WeekNumberHeader,{"aria-label":Te(i.options),className:l[ke.WeekNumberHeader],style:j==null?void 0:j[ke.WeekNumberHeader],scope:"col"},I()),ut.map(_e=>Q.createElement(n.Weekday,{"aria-label":ve(_e,i.options,i),className:l[ke.Weekday],key:String(_e),style:j==null?void 0:j[ke.Weekday],scope:"col"},U(_e,i.options,i)))),Q.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[ke.Weeks],style:j==null?void 0:j[ke.Weeks]},ue.weeks.map(_e=>Q.createElement(n.Week,{className:l[ke.Week],key:_e.weekNumber,style:j==null?void 0:j[ke.Week],week:_e},N&&Q.createElement(n.WeekNumber,{week:_e,style:j==null?void 0:j[ke.WeekNumber],"aria-label":Ae(_e.weekNumber,{locale:o}),className:l[ke.WeekNumber],scope:"row",role:"rowheader"},A(_e.weekNumber,i)),_e.days.map(Fe=>{const{date:bt}=Fe,he=H(Fe);if(he[ht.focused]=!he.hidden&&!!(se!=null&&se.isEqualTo(Fe)),he[Jn.selected]=(P==null?void 0:P(bt))||he.selected,zx(q)){const{from:En,to:Qe}=q;he[Jn.range_start]=!!(En&&Qe&&i.isSameDay(bt,En)),he[Jn.range_end]=!!(En&&Qe&&i.isSameDay(bt,Qe)),he[Jn.range_middle]=Br(q,bt,!0,i)}const Ve=XI(he,j,t.modifiersStyles),vt=OI(he,l,t.modifiersClassNames),Nt=!Le&&!he.hidden?J(bt,he,i.options,i):void 0;return Q.createElement(n.Day,{key:`${i.format(bt,"yyyy-MM-dd")}_${i.format(Fe.displayMonth,"yyyy-MM")}`,day:Fe,modifiers:he,className:vt.join(" "),style:Ve,role:"gridcell","aria-selected":he.selected||void 0,"aria-label":Nt,"data-day":i.format(bt,"yyyy-MM-dd"),"data-month":Fe.outside?i.format(bt,"yyyy-MM"):void 0,"data-selected":he.selected||void 0,"data-disabled":he.disabled||void 0,"data-hidden":he.hidden||void 0,"data-outside":Fe.outside||void 0,"data-focused":he.focused||void 0,"data-today":he.today||void 0},!he.hidden&&Le?Q.createElement(n.DayButton,{className:l[ke.DayButton],style:j==null?void 0:j[ke.DayButton],type:"button",day:Fe,modifiers:he,disabled:he.disabled||void 0,tabIndex:re(Fe)?0:-1,"aria-label":ee(bt,he,i.options,i),onClick:Je(Fe,he),onBlur:Ot(Fe,he),onFocus:ot(Fe,he),onKeyDown:zt(Fe,he),onMouseEnter:ae(Fe,he),onMouseLeave:me(Fe,he)},S(bt,i.options,i)):!he.hidden&&S(Fe.date,i.options,i))})))))))),t.footer&&Q.createElement(n.Footer,{className:l[ke.Footer],style:j==null?void 0:j[ke.Footer],role:"status","aria-live":"polite"},t.footer)))}function On({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:o,...l}){const c=$x();return s.jsx(TL,{showOutsideDays:n,className:De("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:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:De("w-fit",c.root),months:De("relative flex flex-col gap-4 md:flex-row",c.months),month:De("flex w-full flex-col gap-4",c.month),nav:De("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:De(Hm({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:De(Hm({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:De("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:De("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:De("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:De("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:De("select-none font-medium",r==="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:De("flex",c.weekdays),weekday:De("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:De("mt-2 flex w-full",c.week),week_number_header:De("w-[--cell-size] select-none",c.week_number_header),week_number:De("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:De("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:De("bg-accent rounded-l-md",c.range_start),range_middle:De("rounded-none",c.range_middle),range_end:De("bg-accent rounded-r-md",c.range_end),today:De("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:De("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:De("text-muted-foreground opacity-50",c.disabled),hidden:De("invisible",c.hidden),...t},components:{Root:({className:d,rootRef:h,...u})=>s.jsx("div",{"data-slot":"calendar",ref:h,className:De(d),...u}),Chevron:({className:d,orientation:h,...u})=>h==="left"?s.jsx(FN,{className:De("size-4",d),...u}):h==="right"?s.jsx(hx,{className:De("size-4",d),...u}):s.jsx(zu,{className:De("size-4",d),...u}),DayButton:PL,WeekNumber:({children:d,...h})=>s.jsx("td",{...h,children:s.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...o},...l})}function PL({className:e,day:t,modifiers:n,...r}){const a=$x(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),s.jsx(Y,{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:De("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",a.day,e),...r})}var Ju="Popover",[F2]=$u(Ju,[Wu]),Hl=Wu(),[AL,Xs]=F2(Ju),U2=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Hl(t),c=m.useRef(null),[d,h]=m.useState(!1),[u,f]=Cx({prop:r,defaultProp:a??!1,onChange:i,caller:Ju});return s.jsx(wj,{...l,children:s.jsx(AL,{scope:t,contentId:nr(),triggerRef:c,open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};U2.displayName=Ju;var B2="PopoverAnchor",OL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(B2,n),i=Hl(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return m.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(kx,{...i,...r,ref:t})});OL.displayName=B2;var W2="PopoverTrigger",H2=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(W2,n),i=Hl(n),o=Cn(t,a.triggerRef),l=s.jsx(dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":G2(a.open),...r,ref:o,onClick:_t(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(kx,{asChild:!0,...i,children:l})});H2.displayName=W2;var Rx="PopoverPortal",[zL,$L]=F2(Rx,{forceMount:void 0}),V2=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Xs(Rx,t);return s.jsx(zL,{scope:t,forceMount:n,children:s.jsx(Ia,{present:n||i.open,children:s.jsx(Sx,{asChild:!0,container:a,children:r})})})};V2.displayName=Rx;var Hi="PopoverContent",Y2=m.forwardRef((e,t)=>{const n=$L(Hi,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Xs(Hi,e.__scopePopover);return s.jsx(Ia,{present:r||i.open,children:i.modal?s.jsx(IL,{...a,ref:t}):s.jsx(LL,{...a,ref:t})})});Y2.displayName=Hi;var RL=Ru("PopoverContent.RemoveScroll"),IL=m.forwardRef((e,t)=>{const n=Xs(Hi,e.__scopePopover),r=m.useRef(null),a=Cn(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return Wj(o)},[]),s.jsx(_x,{as:RL,allowPinchZoom:!0,children:s.jsx(X2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_t(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:_t(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),LL=m.forwardRef((e,t)=>{const n=Xs(Hi,e.__scopePopover),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(X2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),X2=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...u}=e,f=Xs(Hi,n),p=Hl(n);return Oj(),s.jsx(Mx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Iu,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:s.jsx(yj,{"data-state":G2(f.open),role:"dialog",id:f.contentId,...p,...u,ref:t,style:{...u.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)"}})})})}),q2="PopoverClose",FL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(q2,n);return s.jsx(dt.button,{type:"button",...r,ref:t,onClick:_t(e.onClick,()=>a.onOpenChange(!1))})});FL.displayName=q2;var UL="PopoverArrow",BL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Hl(n);return s.jsx(bj,{...a,...r,ref:t})});BL.displayName=UL;function G2(e){return e?"open":"closed"}var WL=U2,HL=H2,VL=V2,K2=Y2;const zn=WL,$n=HL,pn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},a)=>s.jsx(VL,{children:s.jsx(K2,{ref:a,align:t,sideOffset:n,className:De("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),...r})}));pn.displayName=K2.displayName;const dw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),zc=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),YL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),Yn=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),XL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),qL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),ws=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),GL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),Rr=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),Q2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),$c=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),Ze=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),Kt=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),Z2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2h-2v2h2v2h-2v2h-2v2H9V8H7V6H5V4H3v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2V8h2V6h2V4h-2v2h-2v2h-2v2h-2V6h2V4h2V2zm-2 12h2v2h-2v-2zm-2-2h2v2h-2v-2zm-2-2h2v2H9v-2zm-2-2h2v2H7v-2zm8 6h2v2h-2v-2zm2-2h2v2h-2v-2zm2-2h2v2h-2v-2zm2-2h-2v-2h2v2z",fill:"currentColor"})}),Hr=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),KL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),uw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Vo=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),gf=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),ca=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2v4h2V2h-2zm0 16v4h2v-4h-2zm8-8h4v2h-4v-2zM2 10h4v2H2v-2zm15.07-5.07l2.83 2.83-1.41 1.41-2.83-2.83 1.41-1.41zm-8.28 8.28l2.83 2.83-1.41 1.41-2.83-2.83 1.41-1.41zm8.28 8.28l1.41 1.41-2.83 2.83-1.41-1.41 2.83-2.83zm-8.28-8.28l1.41 1.41-2.83 2.83-1.41-1.41 2.83-2.83z",fill:"currentColor"})}),QL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),ZL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),Ln=({className:e="",size:t=24})=>s.jsx(XL,{className:e,size:t}),hw=({className:e="",size:t=24})=>s.jsx(GL,{className:e,size:t}),Ym=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),J2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),JL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),od=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M10 2h4v2h6v2h-2v14H6V6H4V4h6V2zM8 6v14h8V6H8zm2 2h2v10h-2V8zm4 0h2v10h-2V8z",fill:"currentColor"})}),fw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 4h20v2H2V4zm0 4h18v2H2V8zm0 4h16v2H2v-2zm0 4h14v2H2v-2z",fill:"currentColor"})}),Ix=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),mw=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),$s=(e,t,n)=>{const r=document.createElement(e),[a,i]=Array.isArray(t)?[void 0,t]:[t,n];return a&&Object.assign(r,a),i==null||i.forEach(o=>r.appendChild(o)),r},eF=(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},tF=e=>e.offsetWidth>0&&e.offsetHeight>0,nF=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function rF(e,t,{reverse:n=!1}={}){const r=e.length;for(let a=n?r-1:0;n?a>=0:a<r;n?a--:a++)t(e[a],a)}function sF(e,t,n,r){const a=t.formatToParts(e);n&&a.unshift({type:"prefix",value:n}),r&&a.push({type:"suffix",value:r});const i=[],o=[],l=[],c=[],d={},h=v=>`${v}:${d[v]=(d[v]??-1)+1}`;let u="",f=!1,p=!1;for(const v of a){u+=v.value;const b=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;b==="integer"?(f=!0,o.push(...v.value.split("").map(g=>({type:b,value:parseInt(g)})))):b==="group"?o.push({type:b,value:v.value}):b==="decimal"?(p=!0,l.push({type:b,value:v.value,key:h(b)})):b==="fraction"?l.push(...v.value.split("").map(g=>({type:b,value:parseInt(g),key:h(b),pos:-1-d[b]}))):(f||p?c:i).push({type:b,value:v.value,key:h(b)})}const w=[];for(let v=o.length-1;v>=0;v--){const b=o[v];w.unshift(b.type==="integer"?{...b,key:h(b.type),pos:d[b.type]}:{...b,key:h(b.type)})}return{pre:i,integer:w,fraction:l,post:c,valueAsString:u,value:typeof e=="string"?parseFloat(e):e}}const aF=String.raw,iF=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),oF=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),pw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,nu="--_number-flow-d-opacity",Lx="--_number-flow-d-width",ru="--_number-flow-dx",Fx="--_number-flow-d",lF=(()=>{try{return CSS.registerProperty({name:nu,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:ru,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Lx,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Fx,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),cF="var(--number-flow-char-height, 1em)",xs="var(--number-flow-mask-height, 0.25em)",xw=`calc(${xs} / 2)`,Xm="var(--number-flow-mask-width, 0.5em)",Qs=`calc(${Xm} / var(--scale-x))`,Rc="#000 0, transparent 71%",gw=aF`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${cF} !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(${Lx}) / var(--width));transform:translateX(var(${ru})) scaleX(var(--scale-x));margin:0 calc(-1 * ${Xm});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Qs},#000 calc(100% - ${Qs}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${xs},#000 calc(100% - ${xs}),transparent 100% ),radial-gradient(at bottom right,${Rc}),radial-gradient(at bottom left,${Rc}),radial-gradient(at top left,${Rc}),radial-gradient(at top right,${Rc});-webkit-mask-size:100% calc(100% - ${xs} * 2),calc(100% - ${Qs} * 2) 100%,${Qs} ${xs},${Qs} ${xs},${Qs} ${xs},${Qs} ${xs};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${xw} ${Xm};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${ru})))}: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(${Fx})}.digit__num,.number .section::after{padding:${xw} 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(${nu}))}`,dF=HTMLElement,uF=oF&&iF&&lF;let Ic;class ek extends dF{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(r=>r.finish()))}set data(t){var n;if(t==null)return;const{pre:r,integer:a,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=uF&&this._animated&&(!this.respectMotionPreference||!(pw!=null&&pw.matches))&&tF(this),(n=this.plugins)==null||n.forEach(d=>{var h;return(h=d.onUpdate)==null?void 0:h.call(d,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(r),this._num.update({integer:a,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)Ic||(Ic=new CSSStyleSheet,Ic.replaceSync(gw)),this.shadowRoot.adoptedStyleSheets=[Ic];else{const c=document.createElement("style");c.textContent=gw,this.shadowRoot.appendChild(c)}this._pre=new ww(this,r,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new hF(this,a,i),this.shadowRoot.appendChild(this._num.el),this._post=new ww(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}}ek.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 hF{constructor(t,n,r,{className:a,...i}={}){this.flow=t,this._integer=new vw(t,n,{justify:"right",part:"integer"}),this._fraction=new vw(t,r,{justify:"left",part:"fraction"}),this._inner=$s("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=$s("span",{...i,part:"number",className:`number ${a??""}`},[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,r=this.el.offsetWidth,a=this._prevWidth-r;this.el.style.setProperty("--width",String(r)),this.el.animate({[ru]:[`${n}px`,"0px"],[Lx]:[a,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class tk{constructor(t,n,{justify:r,className:a,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=r;const l=n.map(c=>this.addChar(c).el);this.el=$s("span",{...i,className:`section section--justify-${r} ${a??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...r}={}){const a=t.type==="integer"||t.type==="fraction"?new rk(this,t.type,n?0:t.value,t.pos,{...r,onRemove:this.onCharRemove(t.key)}):new fF(this,t.type,t.value,{...r,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,a),a}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]=`${eF(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,r=new Map,a=this.justify==="left",i=a?"prepend":"append";if(rF(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),r.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:a}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),r.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(a=>a.didUpdate(t));const n=t[this.justify],r=this._prevOffset-n;r&&this.children.size&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class vw extends tk{update(t){const n=new Map;this.children.forEach((r,a)=>{t.find(i=>i.key===a)||n.set(a,r),this.unpop(r)}),this.addNewAndUpdateExisting(t),n.forEach(r=>{r instanceof rk&&r.update(0)}),this.pop(n)}}class ww extends tk{update(t){const n=new Map;this.children.forEach((r,a)=>{t.find(i=>i.key===a)||n.set(a,r)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class qm{constructor(t,n,{onRemove:r,animateIn:a=!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&&a&&this.el.animate({[nu]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=r}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({[nu]: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 nk extends qm{constructor(t,n,r,a){super(t.flow,r,a),this.section=t,this.value=n,this.el=r}}class rk extends nk{constructor(t,n,r,a,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[a])==null?void 0:l.max)??9)+1,d=Array.from({length:c}).map((u,f)=>{const p=$s("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==r&&p.setAttribute("inert",""),p.style.setProperty("--n",String(f)),p}),h=$s("span",{part:`digit ${n}-digit`,className:"digit"},d);h.style.setProperty("--current",String(r)),h.style.setProperty("--length",String(c)),super(t,r,h,i),this.pos=a,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=d,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const r=n[this.section.justify]-t[this.section.justify],a=n.width/2;this._prevCenter=this.section.justify==="left"?r+a:r-a}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,r)=>r===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),r=n[this.section.justify]-t[this.section.justify],a=n.width/2,i=this.section.justify==="left"?r+a:r-a,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({[Fx]:[-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 a of this.flow.plugins){const i=(t=a.getDelta)==null?void 0:t.call(a,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,r=this.flow.computedTrend||Math.sign(n);return r<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:r>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class fF extends nk{constructor(t,n,r,a){const i=$s("span",{className:"symbol__value",textContent:r});super(t,r,$s("span",{part:`symbol ${n}`,className:"symbol"},[i]),a),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(r,new qm(this.flow,i,{onRemove:this._onChildRemove(r)}))}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 r=this._children.get(t);if(r)r.present=!0;else{const a=$s("span",{className:"symbol__value",textContent:t});this.el.appendChild(a),this._children.set(t,new qm(this.flow,a,{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],r=this._prevOffset-n;r&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var kw;const mF=parseInt((kw=m.version.match(/^(\d+)\./))==null?void 0:kw[1]),Ux=mF>=19,pF=["data","digits"];class Bx extends ek{attributeChangedCallback(t,n,r){this[t]=JSON.parse(r)}}Bx.observedAttributes=Ux?[]:pF;nF("number-flow-react",Bx);const vf={},yw=Ux?e=>e:JSON.stringify;function bw(e){const{transformTiming:t,spinTiming:n,opacityTiming:r,animated:a,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:r,animated:a,respectMotionPreference:i,trend:o,plugins:l},c]}class xF extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=bw(this.props);Object.entries(n).forEach(([r,a])=>{this.el[r]=a??Bx.defaultProps[r]}),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(),Ux&&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 r;return(r=this.props.group)==null?void 0:r.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var r;return(r=this.el)==null?void 0:r.didUpdate()}}return null}componentDidUpdate(t,n,r){r==null||r()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:r,data:a,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:d,onAnimationsFinish:h,...u}]=bw(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:r,...u,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:yw(c),data:yw(a)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const gF=m.forwardRef(function({value:t,locales:n,format:r,prefix:a,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),d=m.useContext(vF);d==null||d.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),u=m.useMemo(()=>r?JSON.stringify(r):"",[r]),f=m.useMemo(()=>{var w;const p=vf[w=`${h}:${u}`]??(vf[w]=new Intl.NumberFormat(n,r));return sF(t,p,a,i)},[t,h,u,a,i]);return m.createElement(xF,{...o,group:d,data:f,innerRef:c})}),vF=m.createContext(void 0),wF={notation:"compact",maximumFractionDigits:1};function br({value:e,loading:t=!1,className:n,prefix:r,suffix:a,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const u=Number(e);return Number.isFinite(u)?u:0},[e]);if(t)return s.jsxs("span",{className:Xd("inline-flex items-baseline",n),children:[r,l,a]});const d=gF,h=typeof o=="boolean"?o?1:0:o;return s.jsxs("span",{className:Xd("inline-flex items-baseline",n),children:[r,s.jsx(d,{value:c,format:i??wF,trend:h,className:"inline-flex"}),a]})}function Oa({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:r="",defaultCollapsed:a=!1}){const[i,o]=m.useState(a),l=m.useRef(null);m.useEffect(()=>{const u=l.current;!u||i||u.scrollTo({top:u.scrollHeight,behavior:"smooth"})},[i]);const c=u=>{switch(u.type){case"success":return s.jsx(Et,{className:"w-3 h-3 text-green-400"});case"error":return s.jsx(ra,{className:"w-3 h-3 text-red-400"});case"progress":return u.status==="running"?s.jsx(Xr,{className:"w-3 h-3 text-blue-400 animate-spin"}):u.status==="completed"?s.jsx(Et,{className:"w-3 h-3 text-green-400"}):u.status==="failed"?s.jsx(ra,{className:"w-3 h-3 text-red-400"}):s.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return s.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},d=u=>{switch(u.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return u.status==="running"?"text-blue-400":u.status==="completed"?"text-green-400":u.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=u=>u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+u.getMilliseconds().toString().padStart(3,"0");return s.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${r}`,children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(HP,{className:"w-3 h-3 text-green-400"}),s.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[n&&s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),s.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),s.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),s.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?s.jsx(zu,{className:"w-3 h-3"}):s.jsx(zP,{className:"w-3 h-3"})})]})]}),!i&&s.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?s.jsxs("div",{className:"text-gray-500 italic text-xs",children:[s.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(u=>s.jsxs("div",{className:`flex items-start space-x-3 py-1 ${d(u)} text-xs`,children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(u.timestamp)}),s.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),s.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(u)}),s.jsx("span",{className:"flex-1 min-w-0 break-words",children:u.message})]},u.id)),n&&s.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),s.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),s.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 flex items-center",children:s.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&s.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),s.jsxs("span",{children:["Lines: ",t.length]})]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),s.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const sk=document.createElement("style");sk.textContent=`
404
+ @keyframes fadeIn {
405
+ from {
406
+ opacity: 0;
407
+ transform: translateX(-10px);
408
+ }
409
+ to {
410
+ opacity: 1;
411
+ transform: translateX(0);
412
+ }
413
+ }
414
+
415
+ .animate-fadeIn {
416
+ animation: fadeIn 0.3s ease-out forwards;
417
+ }
418
+ `;document.head.appendChild(sk);const Ie=m.forwardRef(({className:e,type:t,...n},r)=>s.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:r,...n}));Ie.displayName="Input";const He=m.forwardRef(({className:e,...t},n)=>s.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));He.displayName="Label";function ak({currentPage:e,totalPages:t,onPageChange:n,totalItems:r,startIndex:a,endIndex:i}){const o=()=>{const d=[],h=[];for(let u=Math.max(2,e-2);u<=Math.min(t-1,e+2);u++)d.push(u);return e-2>2?h.push(1,"..."):h.push(1),h.push(...d),e+2<t-1?h.push("...",t):t>1&&h.push(t),h};if(t<=1)return null;const l=o();return s.jsxs("div",{className:"flex items-center justify-between mt-6",children:[s.jsxs("div",{className:"text-sm text-gray-400",children:["Showing ",a+1," to ",Math.min(i,r)," of ",r," items"]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsxs(Y,{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:[s.jsx(FN,{className:"w-4 h-4"}),"Previous"]}),l.map((c,d)=>{if(c==="...")return s.jsx(Y,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:s.jsx(UP,{className:"w-4 h-4"})},`dots-${d}`);const h=c,u=e===h;return s.jsx(Y,{variant:u?"default":"outline",size:"sm",onClick:()=>n(h),className:u?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:h},h)}),s.jsxs(Y,{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",s.jsx(hx,{className:"w-4 h-4"})]})]})]})}const Vl=m.createContext({isOpen:!1,setIsOpen:()=>{}}),pa=m.forwardRef(({className:e,value:t,onValueChange:n,children:r,...a},i)=>{const[o,l]=m.useState(!1);return s.jsx(Vl.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:s.jsx("div",{ref:i,className:`relative ${e}`,...a,children:r})})});pa.displayName="Select";const xa=m.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:a,setIsOpen:i}=m.useContext(Vl);return s.jsxs("button",{ref:r,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(!a),...n,children:[t,s.jsx(zu,{className:`h-4 w-4 text-gray-400 transition-transform ${a?"rotate-180":""}`})]})});xa.displayName="SelectTrigger";const Wx=m.forwardRef(({className:e,placeholder:t,...n},r)=>{const{value:a}=m.useContext(Vl);return s.jsx("span",{ref:r,className:`text-sm text-white ${e}`,...n,children:a||t})});Wx.displayName="SelectValue";const ga=m.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:a}=m.useContext(Vl);return a?s.jsx("div",{ref:r,className:`absolute top-full left-0 right-0 z-50 mt-1 border border-dashed border-white/20 bg-black/90 rounded-none shadow-lg ${e}`,...n,children:t}):null});ga.displayName="SelectContent";const sn=m.forwardRef(({className:e,children:t,value:n,...r},a)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(Vl);return s.jsx("div",{ref:a,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...r,children:t})});sn.displayName="SelectItem";function ik(){const e=Mr(),{counts:t,refetchCounts:n}=Xu(),[r,a]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[d,h]=m.useState(""),[u,f]=m.useState("all"),[p,w]=m.useState([]),[v,b]=m.useState(1),[g]=m.useState(20),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(!1),[M,A]=m.useState(!1),[I,U]=m.useState(!1),[$,L]=m.useState(!1),[E,O]=m.useState(null),[D,T]=m.useState([]),[C,_]=m.useState(!1),[z,H]=m.useState({name:"",slug:""}),[P,B]=m.useState({name:"",slug:""});m.useEffect(()=>{R()},[]);const q=ae=>ae.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),G=ae=>{const me=q(ae);H({name:ae,slug:me})},se=ae=>{H(me=>({...me,slug:q(ae)}))},re=ae=>{const me=q(ae);B({name:ae,slug:me})},Z=ae=>{B(me=>({...me,slug:q(ae)}))},R=async()=>{try{const me=await(await fetch("/api/plugins")).json(),ze=(me==null?void 0:me.plugins).find(X=>X.id==="organization");c({enabled:!!ze,availablePlugins:(me==null?void 0:me.plugins).map(X=>X.id),configPath:me.configPath,organizationPlugin:(me==null?void 0:me.plugins).find(X=>X.id==="organization")}),ze?await ee():o(!1)}catch(ae){console.error("Failed to check plugin status:",ae),c({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},ee=async()=>{try{const me=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:me.organizations.length}),a(me.organizations||[])}catch(ae){console.error("Failed to fetch organizations:",ae),V.error("Failed to fetch organizations")}finally{o(!1)}},J=async ae=>{T([]),_(!0),T([{id:"start",type:"info",message:`Starting organization seeding process for ${ae} organizations...`,timestamp:new Date}]);try{const ze=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:ae})})).json();if(ze.success){const X=ze.results.map((W,te)=>W.success?{id:`org-${te}`,type:"progress",message:`Creating organization: ${W.organization.name} (${W.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${te}`,type:"error",message:`Failed to create organization ${te+1}: ${W.error}`,timestamp:new Date});T(W=>[...W,...X]);const le=ze.results.filter(W=>W.success).length;T(W=>[...W,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${le}/${ae} organizations successfully`,timestamp:new Date}]),await ee(),await n()}else T(X=>[...X,{id:"error",type:"error",message:`❌ Seeding failed: ${ze.error||"Unknown error"}`,timestamp:new Date}])}catch(me){T(ze=>[...ze,{id:"error",type:"error",message:`❌ Network error: ${me}`,timestamp:new Date}])}finally{_(!1)}},F=ae=>{O(ae),U(!0)},K=ae=>{O(ae),B({name:ae.name,slug:ae.slug}),S(!0)},ne=ae=>{O(ae),A(!0)},ce=async()=>{if(!z.name){V.error("Please fill in the organization name");return}const ae=V.loading("Creating organization...");try{const ze=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z.name,slug:z.slug})})).json();ze.success?(await ee(),x(!1),H({name:"",slug:""}),V.success("Organization created successfully!",{id:ae})):V.error(`Error creating organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error creating organization:",me),V.error("Error creating organization",{id:ae})}},ge=async()=>{if(!E){V.error("No organization selected");return}if(!P.name){V.error("Please fill in the organization name");return}const ae=V.loading("Updating organization...");try{const ze=await(await fetch(`/api/organizations/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,slug:P.slug})})).json();ze.success?(await ee(),S(!1),O(null),B({name:"",slug:""}),V.success("Organization updated successfully!",{id:ae})):V.error(`Error updating organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error updating organization:",me),V.error("Error updating organization",{id:ae})}},ve=async()=>{if(!E){V.error("No organization selected");return}const ae=V.loading("Deleting organization...");try{const ze=await(await fetch(`/api/organizations/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ze.success?(await ee(),await n(),A(!1),O(null),V.success("Organization deleted successfully!",{id:ae})):V.error(`Error deleting organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error deleting organization:",me),V.error("Error deleting organization",{id:ae})}},Ae=()=>{if(r.length===0){V.error("No organizations to export");return}const ae=["ID","Name","Slug","Created At","Updated At"],me=r.map(te=>[te.id,te.name||"",te.slug||"",new Date(te.createdAt).toLocaleString(),new Date(te.updatedAt).toLocaleString()]),ze=[ae.join(","),...me.map(te=>te.map(de=>`"${de}"`).join(","))].join(`
419
+ `),X=new Blob([ze],{type:"text/csv;charset=utf-8;"}),le=document.createElement("a"),W=URL.createObjectURL(X);le.setAttribute("href",W),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),V.success(`Exported ${r.length} organizations to CSV`)},Te=ae=>{p.some(me=>me.type===ae)||w([...p,{type:ae}])},tt=ae=>{w(p.filter(me=>me.type!==ae))},ut=()=>{w([])},Le=(ae,me)=>{w(ze=>ze.map(X=>X.type===ae?{...X,dateRange:me}:X))},Oe=r.filter(ae=>{const me=ae.name.toLowerCase().includes(d.toLowerCase())||ae.slug.toLowerCase().includes(d.toLowerCase());if(p.length===0)return me;const ze=p.every(X=>{var le,W,te,de;switch(X.type){case"createdAt":{if(!((le=X.dateRange)!=null&&le.from)&&!((W=X.dateRange)!=null&&W.to))return!0;const Ne=new Date(ae.createdAt);return!((te=X.dateRange)!=null&&te.from&&X.dateRange.from>Ne||(de=X.dateRange)!=null&&de.to&&X.dateRange.to<Ne)}default:return!0}});return me&&ze}),Ge=Math.ceil(Oe.length/g),Je=(v-1)*g,ot=Je+g,Ot=Oe.slice(Je,ot),zt=ae=>{b(ae)};return i?s.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(Xr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading organizations..."})]})}):l&&!l.enabled?s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl text-white font-light",children:"Organizations"}),s.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx(pr,{className:"w-12 h-12 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),s.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."}),s.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[s.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),s.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:s.jsxs("li",{children:["Import the plugin in your auth configuration file",l.configPath&&s.jsxs("span",{className:"text-gray-400",children:[" (",l.configPath,")"]}),":"]})}),s.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:s.jsxs("pre",{className:"text-sm text-gray-300",children:[s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"export const"})," ",s.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",s.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",s.jsx("br",{}),s.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),s.jsx("br",{}),s.jsx("span",{className:"pl-10",children:"]"})," ",s.jsx("br",{}),"}",") ",s.jsx("br",{})]})}),s.jsx("div",{className:"mt-4",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),s.jsx("div",{className:"mt-2",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),l.availablePlugins&&l.availablePlugins.length>0&&s.jsx("div",{className:"mb-4",children:s.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",l.availablePlugins.join(", ")]})}),s.jsx(Y,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),s.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",s.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"})]})]})]})})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Organizations",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(br,{value:t.organizations??0,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),s.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your organizations and teams"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:Ae,children:[s.jsx(UN,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>L(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>x(!0),children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Add Organization"]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search organizations...",value:d,onChange:ae=>h(ae.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(pa,{value:"",onValueChange:Te,children:[s.jsx(xa,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(zs,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsx(ga,{children:!p.some(ae=>ae.type==="createdAt")&&s.jsx(sn,{value:"createdAt",children:"Created Date"})})]})}),p.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(Y,{onClick:ut,children:"Clear all"})})]}),p.length>0&&s.jsx("div",{className:"space-y-3",children:s.jsx("div",{className:"flex flex-wrap gap-3",children:p.map(ae=>{var me,ze,X,le;return s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[s.jsx(fx,{className:"w-3 h-3 text-white"}),ae.type==="createdAt"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Created:"}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(me=ae.dateRange)!=null&&me.from?An(ae.dateRange.from,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(ze=ae.dateRange)==null?void 0:ze.from,onSelect:W=>{var te;return Le("createdAt",{from:W,to:(te=ae.dateRange)==null?void 0:te.to})},initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(X=ae.dateRange)!=null&&X.to?An(ae.dateRange.to,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(le=ae.dateRange)==null?void 0:le.to,onSelect:W=>{var te;return Le("createdAt",{from:(te=ae.dateRange)==null?void 0:te.from,to:W})},initialFocus:!0,disabled:W=>{var te;return(te=ae.dateRange)!=null&&te.from?W<ae.dateRange.from:!1},className:"rounded-none"})})]})]}),s.jsx("button",{onClick:()=>tt(ae.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:s.jsx(Pt,{className:"w-3 h-3 text-white"})})]},ae.type)})})})]}),s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Organization"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Slug"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:Oe.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:s.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-8 h-8 text-white/50"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium text-lg",children:"No organizations found"}),s.jsx("p",{className:"text-gray-400 text-sm mt-1",children:d||u!=="all"?"Try adjusting your search or filter criteria":"Get started by creating your first organization"})]}),!d&&u==="all"&&s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{onClick:()=>x(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),s.jsxs(Y,{onClick:()=>L(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):Ot.map(ae=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>e(`/organizations/${ae.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:ae.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",ae.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:ae.slug}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:s.jsxs("div",{className:"flex flex-col",children:[new Date(ae.createdAt).toLocaleDateString(),s.jsx("p",{className:"text-xs",children:new Date(ae.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:me=>{me.stopPropagation(),F(ae)},children:s.jsx(Il,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:me=>{me.stopPropagation(),K(ae)},children:s.jsx(Ca,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:me=>{me.stopPropagation(),ne(ae)},children:s.jsx(mx,{className:"w-4 h-4"})})]})})]},ae.id))})]})}),s.jsx(ak,{currentPage:v,totalPages:Ge,onPageChange:zt,totalItems:Oe.length,startIndex:Je,endIndex:ot})]}),$&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.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:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(pr,{className:"inline mr-2 w-3.5 h-3.5 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Organizations"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),s.jsx(Ie,{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"})]}),s.jsx(Y,{onClick:()=>{var me;const ae=parseInt(((me=document.getElementById("organization-count"))==null?void 0:me.value)||"5",10);J(ae)},disabled:C,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:C?s.jsxs(s.Fragment,{children:[s.jsx(Xr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})}),D.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Organization Seeding Terminal",lines:D,isRunning:C,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(Y,{variant:"outline",onClick:()=>L(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create Organization"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"create-name",value:z.name,onChange:ae=>G(ae.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),s.jsx(Ie,{id:"create-slug",value:z.slug,onChange:ae=>se(ae.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{x(!1),H({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),k&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"edit-name",value:P.name,onChange:ae=>re(ae.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),s.jsx(Ie,{id:"edit-slug",value:P.slug,onChange:ae=>Z(ae.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{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"}),s.jsx(Y,{onClick:ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),M&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Organization"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>A(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this organization? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>A(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ve,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),I&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Organization Details"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(pr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:E.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(Y,{onClick:()=>U(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function ok(){const e=Mr(),{counts:t,refetchCounts:n}=Xu(),[r,a]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(""),[d,h]=m.useState([]),[u,f]=m.useState(1),[p]=m.useState(20),[w,v]=m.useState(!1),[b,g]=m.useState(!1),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(!1),[M,A]=m.useState(!1),[I,U]=m.useState(!1),[$,L]=m.useState(!1),[E,O]=m.useState(null),[D,T]=m.useState(null),[C,_]=m.useState(""),[z,H]=m.useState(),[P,B]=m.useState(!1),[q,G]=m.useState([]),[se,re]=m.useState(!1),Z=m.useCallback(async()=>{try{const le=await(await fetch("/api/users?limit=10000")).json();a(le.users||[])}catch{}finally{o(!1)}},[]),R=m.useCallback(async()=>{try{const le=await(await fetch("/api/admin/status")).json();B(le.enabled)}catch{B(!1)}},[]);m.useEffect(()=>{Z(),R();const X=()=>{D&&T(null)};return document.addEventListener("click",X),()=>document.removeEventListener("click",X)},[D,R,Z]);const ee=async X=>{G([]),re(!0),G([{id:"start",type:"info",message:`Starting user seeding process for ${X} users...`,timestamp:new Date}]);try{const W=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:X})})).json();if(W.success){const te=W.results.map((Ne,Se)=>Ne.success?{id:`user-${Se}`,type:"progress",message:`Creating user: ${Ne.user.name} (${Ne.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${Se}`,type:"error",message:`Failed to create user ${Se+1}: ${Ne.error}`,timestamp:new Date});G(Ne=>[...Ne,...te]);const de=W.results.filter(Ne=>Ne.success).length;G(Ne=>[...Ne,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${de}/${X} users successfully`,timestamp:new Date}]),await Z(),await n()}else G(te=>[...te,{id:"error",type:"error",message:`❌ Seeding failed: ${W.error||"Unknown error"}`,timestamp:new Date}])}catch(le){G(W=>[...W,{id:"error",type:"error",message:`❌ Network error: ${le}`,timestamp:new Date}])}finally{re(!1)}},J=X=>{O(X),j(!0)},F=X=>{O(X),g(!0)},K=X=>{O(X),x(!0)},ne=async()=>{var de,Ne,Se;const X=(de=document.getElementById("create-name"))==null?void 0:de.value,le=(Ne=document.getElementById("create-email"))==null?void 0:Ne.value,W=(Se=document.getElementById("create-password"))==null?void 0:Se.value;if(!X||!le||!W){V.error("Please fill in all fields");return}const te=V.loading("Creating user...");try{const Pe=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:X,email:le,password:W})})).json();Pe.success?(await Z(),v(!1),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",V.success("User created successfully!",{id:te})):V.error(`Error creating user: ${Pe.error||"Unknown error"}`,{id:te})}catch{V.error("Error creating user",{id:te})}},ce=async()=>{var te,de;if(!E){V.error("No user selected");return}const X=(te=document.getElementById("edit-name"))==null?void 0:te.value,le=(de=document.getElementById("edit-email"))==null?void 0:de.value;if(!X||!le){V.error("Please fill in all fields");return}const W=V.loading("Updating user...");try{const Se=await(await fetch(`/api/users/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:X,email:le})})).json();Se.success?(await Z(),g(!1),O(null),V.success("User updated successfully!",{id:W})):V.error(`Error updating user: ${Se.error||"Unknown error"}`,{id:W})}catch{V.error("Error updating user",{id:W})}},ge=async()=>{if(!E){V.error("No user selected");return}const X=V.loading("Deleting user...");try{const W=await(await fetch(`/api/users/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();W.success?(await Z(),await n(),x(!1),O(null),V.success("User deleted successfully!",{id:X})):V.error(`Error deleting user: ${W.error||"Unknown error"}`,{id:X})}catch{V.error("Error deleting user",{id:X})}},ve=async()=>{if(!E)return;if(!P){V.error("Admin plugin is not enabled");return}const X=V.loading("Banning user...");try{const le=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:E.id,banReason:C||"No reason provided",banExpiresIn:z})}),W=await le.json();le.ok?(V.success("User banned successfully!",{id:X}),A(!1),_(""),H(void 0),O(null),T(null),Z()):V.error(`Error banning user: ${W.error||W.message||"Unknown error"}`,{id:X})}catch{V.error("Error banning user",{id:X})}},Ae=async()=>{if(!E)return;if(!P){V.error("Admin plugin is not enabled");return}const X=V.loading("Unbanning user...");try{const le=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:E.id})}),W=await le.json();le.ok?(V.success("User unbanned successfully!",{id:X}),U(!1),O(null),T(null),Z()):V.error(`Error unbanning user: ${W.error||W.message||"Unknown error"}`,{id:X})}catch{V.error("Error unbanning user",{id:X})}},Te=async()=>{var W;if(!E){V.error("No user selected");return}const X=(W=document.getElementById("update-password"))==null?void 0:W.value;if(!X){V.error("Please enter a new password");return}const le=V.loading("Updating password...");try{const te=await fetch(`/api/users/${E.id}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:X})}),de=await te.json();te.ok&&de.success?(V.success("Password updated successfully!",{id:le}),L(!1),O(null),document.getElementById("update-password").value=""):V.error(`Error updating password: ${de.error||"Unknown error"}`,{id:le})}catch{V.error("Error updating password",{id:le})}},tt=()=>{if(r.length===0){V.error("No users to export");return}const X=["ID","Name","Email","Email Verified","Created At","Updated At"],le=r.map(Se=>[Se.id,Se.name||"",Se.email||"",!!Se.emailVerified,new Date(Se.createdAt).toLocaleString(),new Date(Se.updatedAt).toLocaleString()]),W=[X.join(","),...le.map(Se=>Se.map(ue=>`"${ue}"`).join(","))].join(`
420
+ `),te=new Blob([W],{type:"text/csv;charset=utf-8;"}),de=document.createElement("a"),Ne=URL.createObjectURL(te);de.setAttribute("href",Ne),de.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),de.style.visibility="hidden",document.body.appendChild(de),de.click(),document.body.removeChild(de),V.success(`Exported ${r.length} users to CSV`)},ut=X=>{d.some(W=>W.type===X)||(h(W=>[...W,{type:X}]),f(1))},Le=X=>{h(le=>le.filter(W=>W.type!==X)),f(1)},Oe=(X,le)=>{h(W=>W.map(te=>te.type===X?{...te,value:le}:te))},Ge=(X,le)=>{h(W=>W.map(te=>te.type===X?{...te,dateRange:le}:te))},Je=r.filter(X=>{const le=X.name.toLowerCase().includes(l.toLowerCase())||X.email.toLowerCase().includes(l.toLowerCase());if(d.length===0)return le;const W=d.every(te=>{var de,Ne,Se,ue,Pe;switch(te.type){case"emailVerified":return te.value===void 0?!0:X.emailVerified===(te.value==="true");case"banned":return te.value===void 0?!0:X.banned===(te.value==="true");case"active":return X.banned!==!0;case"createdAt":{if(!((de=te.dateRange)!=null&&de.from)&&!((Ne=te.dateRange)!=null&&Ne.to))return!0;const _e=new Date(X.createdAt);return!((Se=te.dateRange)!=null&&Se.from&&te.dateRange.from>_e||(ue=te.dateRange)!=null&&ue.to&&te.dateRange.to<_e)}case"role":return te.value?(Pe=X.role)==null?void 0:Pe.toLowerCase().includes(te.value.toLowerCase()):!0;default:return!0}});return le&&W}),ot=r.filter(X=>X.banned).length,Ot=Math.ceil(Je.length/p),zt=(u-1)*p,ae=zt+p,me=Je.slice(zt,ae),ze=X=>{f(X)};return i?s.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(Xr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(br,{value:t.users??0,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),s.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),s.jsx("div",{className:"flex items-center space-x-4 mt-2",children:ot>0&&s.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[s.jsx(Cc,{className:"w-3 h-3"}),s.jsxs("span",{children:[ot," Banned"]})]})})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:tt,children:[s.jsx(UN,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>S(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[s.jsx(Pm,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search users...",value:l,onChange:X=>c(X.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(pa,{value:"",onValueChange:ut,children:[s.jsx(xa,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(zs,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsxs(ga,{children:[!d.some(X=>X.type==="emailVerified")&&s.jsx(sn,{value:"emailVerified",children:"Email Verified"}),!d.some(X=>X.type==="banned")&&s.jsx(sn,{value:"banned",children:"Banned Status"}),!d.some(X=>X.type==="createdAt")&&s.jsx(sn,{value:"createdAt",children:"Created Date"}),!d.some(X=>X.type==="role")&&s.jsx(sn,{value:"role",children:"Role"})]})]})}),d.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(Y,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),d.length>0&&s.jsx("div",{className:"space-y-3",children:s.jsx("div",{className:"flex flex-wrap gap-3",children:d.map(X=>{var le,W,te,de;return s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[s.jsx(fx,{className:"w-3 h-3 text-white"}),X.type==="emailVerified"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),s.jsxs(pa,{value:X.value||"",onValueChange:Ne=>Oe("emailVerified",Ne),children:[s.jsx(xa,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:X.value==="true"?"True":X.value==="false"?"False":"Select"})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"true",children:"True"}),s.jsx(sn,{value:"false",children:"False"})]})]})]}),X.type==="banned"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Banned:"}),s.jsxs(pa,{value:X.value||"",onValueChange:Ne=>Oe("banned",Ne),children:[s.jsx(xa,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:X.value==="true"?"Yes":X.value==="false"?"No":"Select"})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"true",children:"Yes"}),s.jsx(sn,{value:"false",children:"No"})]})]})]}),X.type==="createdAt"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Created:"}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(le=X.dateRange)!=null&&le.from?An(X.dateRange.from,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(W=X.dateRange)==null?void 0:W.from,onSelect:Ne=>{var Se;return Ge("createdAt",{from:Ne,to:(Se=X.dateRange)==null?void 0:Se.to})},initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Hd,{className:"mr-1 h-3 w-3"}),(te=X.dateRange)!=null&&te.to?An(X.dateRange.to,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(de=X.dateRange)==null?void 0:de.to,onSelect:Ne=>{var Se;return Ge("createdAt",{from:(Se=X.dateRange)==null?void 0:Se.from,to:Ne})},initialFocus:!0,disabled:Ne=>{var Se;return(Se=X.dateRange)!=null&&Se.from?Ne<X.dateRange.from:!1},className:"rounded-none"})})]})]}),X.type==="role"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Role:"}),s.jsx(Ie,{type:"text",value:X.value||"",onChange:Ne=>Oe("role",Ne.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),s.jsx("button",{onClick:()=>Le(X.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:s.jsx(Pt,{className:"w-3 h-3 text-white"})})]},X.type)})})})]}),s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:me.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:s.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(Ma,{className:"w-8 h-8 text-white/50"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),s.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||d.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&d.length===0&&s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(Pm,{className:"w-4 h-4 mr-2"}),"Create User"]}),s.jsxs(Y,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):me.map(X=>s.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${X.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${X.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:X.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${X.id}`,alt:X.name,className:`w-10 h-10 rounded-none border border-dashed ${X.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),X.banned&&s.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:s.jsx(Cc,{className:"w-3 h-3 text-white"})})]}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"text-white font-light",children:X.name}),X.banned&&s.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"})]}),s.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:X.email})]})]})}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[X.emailVerified?s.jsx(OP,{className:"w-4 h-4 text-green-400"}):s.jsx(Yd,{className:"w-4 h-4 text-yellow-400"}),s.jsx("span",{className:"text-sm text-gray-400",children:X.emailVerified?"Verified":"Not Verified"})]})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:s.jsxs("div",{className:"flex flex-col",children:[new Date(X.createdAt).toLocaleDateString(),s.jsx("p",{className:"text-xs",children:new Date(X.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"relative flex items-center justify-end",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:le=>{le.stopPropagation(),T(D===X.id?null:X.id)},children:s.jsx(BP,{className:"w-4 h-4"})}),D===X.id&&s.jsxs("div",{className:"absolute right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg z-50",onClick:le=>le.stopPropagation(),children:[s.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:le=>{le.stopPropagation(),T(null),J(X)},children:[s.jsx(Il,{className:"w-4 h-4"}),s.jsx("span",{children:"View Details"})]}),s.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:le=>{le.stopPropagation(),T(null),F(X)},children:[s.jsx(Ca,{className:"w-4 h-4"}),s.jsx("span",{children:"Edit User"})]}),s.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:le=>{le.stopPropagation(),T(null),O(X),L(!0)},children:[s.jsx(Mn,{className:"w-4 h-4"}),s.jsx("span",{children:"Update Password"})]}),P&&(X.banned?s.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:le=>{le.stopPropagation(),O(X),U(!0),T(null)},children:[s.jsx(Cc,{className:"w-4 h-4"}),s.jsx("span",{children:"Unban User"})]}):s.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:le=>{le.stopPropagation(),O(X),A(!0),T(null)},children:[s.jsx(Cc,{className:"w-4 h-4"}),s.jsx("span",{children:"Ban User"})]})),s.jsx("div",{className:"border-t border-white/10 my-1"}),s.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:le=>{le.stopPropagation(),T(null),K(X)},children:[s.jsx(mx,{className:"w-4 h-4"}),s.jsx("span",{children:"Delete User"})]})]})]})})]},X.id))})]})}),s.jsx(ak,{currentPage:u,totalPages:Ot,onPageChange:ze,totalItems:Je.length,startIndex:zt,endIndex:ae})]}),k&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.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:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(Ma,{className:"inline mr-2 w-3 h-3 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center space-x-2"}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),s.jsx(Ie,{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"})]}),s.jsx(Y,{onClick:()=>{var le;const X=parseInt(((le=document.getElementById("user-count"))==null?void 0:le.value)||"5",10);ee(X)},disabled:se,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:se?s.jsxs(s.Fragment,{children:[s.jsx(Xr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),q.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"User Seeding Terminal",lines:q,isRunning:se,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(Y,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),w&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Ie,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),s.jsx(Ie,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ne,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),b&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.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"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"edit-name",defaultValue:E.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Ie,{id:"edit-email",type:"email",defaultValue:E.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.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"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ge,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),N&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.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"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:E.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),s.jsx("span",{className:"text-white text-sm",children:E.emailVerified?"Yes":"No"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(E.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(Y,{onClick:()=>j(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),M&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),s.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",s.jsx("strong",{children:E.name})," from accessing the system."]}),s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),s.jsx(Ie,{id:"banReason",value:C,onChange:X=>_(X.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),s.jsx(Ie,{id:"banExpires",type:"number",value:z||"",onChange:X=>H(X.target.value?Number(X.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{A(!1),_(""),H(void 0),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ve,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),I&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),s.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",s.jsx("strong",{children:E.name}),"? This will restore their access to the system."]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{U(!1),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:Ae,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),$&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{L(!1),O(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.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"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),s.jsx(Ie,{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"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{L(!1),O(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:Te,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const So=[{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 yF(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[r,a]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[d,h]=m.useState("1D"),[u,f]=m.useState(null),[p,w]=m.useState(!1),[v,b]=m.useState("Daily"),[g,y]=m.useState("Daily"),[x,N]=m.useState("Daily"),[j,k]=m.useState("Daily"),[S,M]=m.useState(!1),[A,I]=m.useState(!1),[U,$]=m.useState(!1),[L,E]=m.useState(!1),[O,D]=m.useState(null),[T,C]=m.useState(null),[_,z]=m.useState(null),[H,P]=m.useState(null),[B,q]=m.useState(null),[G,se]=m.useState(void 0),[re,Z]=m.useState(void 0),[R,ee]=m.useState(void 0),[J,F]=m.useState(void 0),[K,ne]=m.useState(void 0),[ce,ge]=m.useState(void 0),[ve,Ae]=m.useState(void 0),[Te,tt]=m.useState(void 0),[ut,Le]=m.useState([]),[Oe,Ge]=m.useState([]),[Je,ot]=m.useState(0),[Ot,zt]=m.useState([]),[ae,me]=m.useState([]),[ze,X]=m.useState(0),[le,W]=m.useState(0),[te,de]=m.useState(0),[Ne,Se]=m.useState(0),[ue,Pe]=m.useState(0),[_e,Fe]=m.useState(!1),[bt,he]=m.useState(!1),[Ve,vt]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[Nt,En]=m.useState([]),[Qe,$t]=m.useState(!1),[lr,qt]=m.useState(0),[Rt,La]=m.useState(0),[hn,Yl]=m.useState(0),[eo,to]=m.useState(0),[eh,th]=m.useState(0),[qs,no]=m.useState([]),[Xl,Fa]=m.useState(0),[Ua,Ba]=m.useState(0),{counts:rs,loading:Ar}=Xu(),ss=Mr(),Gs=["Daily","Weekly","Monthly","Yearly","Custom"],ql={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},nh=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),as=fe=>fe==null?"...":nh.format(Number(fe)),is=fe=>fe==null?"...":Number(fe).toLocaleString(),ro=m.useMemo(()=>So.reduce((fe,xe)=>(fe[xe.id]=(Ve[xe.id]||[]).reduce((pe,ie)=>pe+ie,0),fe),{}),[Ve]),rh=m.useMemo(()=>Object.values(ro).reduce((fe,xe)=>fe+xe,0),[ro]),sh=(fe,xe)=>{const pe=fe.currentTarget.getBoundingClientRect();P(xe),q({x:pe.left+pe.width/2,y:pe.top})},ih=(()=>{const fe=[];return O!=null&&O.isOutdated?fe.push({id:"version-check",title:`Update Better-Auth to v${O.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: `npm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):O&&fe.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:""}),fe.push({id:"1",title:"Session Token Rotation",severity:"high",date:"2024-01-15",description:"Ensure session tokens are rotated regularly to prevent session fixation attacks. Better-auth supports automatic token rotation on security-sensitive operations.",affectedComponents:["Session Management","Auth Core"],status:"applied",cve:""}),fe})(),nt=m.useCallback(async(fe,xe,pe,ie)=>{try{const be=new URLSearchParams({type:fe,period:xe});return pe&&be.append("from",pe.toISOString()),ie&&be.append("to",ie.toISOString()),await(await fetch(`/api/analytics?${be.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/users/all")).json();pe!=null&&pe.success&&pe.users&&no(pe.users)}catch{no([])}})()},[]),m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/stats")).json();pe&&(a(pe.activeUsers||0),o(pe.totalUsers||0))}catch{a(0),o(0)}})()},[]),m.useEffect(()=>{(async()=>{const xe=await nt("users",l,G,re);xe&&(Le(xe.data||[]),Ge(xe.labels||[]),ot(xe.percentageChange||0))})()},[l,G,re,nt]),m.useEffect(()=>{if(qs.length===0){Fa(0),Ba(0);return}const fe=new Date;let xe,pe=fe,ie,be;if(g==="Custom"){if(!R||!J){Fa(0),Ba(0);return}xe=new Date(R),pe=new Date(J),pe.setHours(23,59,59,999);const Ut=pe.getTime()-xe.getTime();be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-Ut)}else switch(g){case"Daily":xe=new Date(fe),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-24*60*60*1e3);break;case"Weekly":xe=new Date(fe),xe.setDate(fe.getDate()-fe.getDay()),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(be.getTime()-7*24*60*60*1e3);break;case"Monthly":xe=new Date(fe.getFullYear(),fe.getMonth(),1),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(fe.getFullYear(),fe.getMonth()-1,1),ie.setHours(0,0,0,0);break;case"Yearly":xe=new Date(fe.getFullYear(),0,1),xe.setHours(0,0,0,0),be=new Date(xe.getTime()-1),ie=new Date(fe.getFullYear()-1,0,1),ie.setHours(0,0,0,0);break;default:Fa(0),Ba(0);return}const Ce=qs.filter(Ut=>{if(!Ut.createdAt)return!1;const os=new Date(Ut.createdAt);return os>=xe&&os<=pe}),je=qs.filter(Ut=>{if(!Ut.createdAt)return!1;const os=new Date(Ut.createdAt);return os>=ie&&os<=be}),we=Ce.length,Ue=je.length;let tn=0;Ue>0?tn=(we-Ue)/Ue*100:we>0&&(tn=100),Fa(we),Ba(tn)},[qs,g,R,J]),m.useEffect(()=>{(async()=>{if(!(d==="Custom"&&(!R||!J))){$t(!0);try{const[xe,pe,ie,be,Ce]=await Promise.all([nt("newUsers",d,R,J),nt("activeUsers",d,R,J),nt("organizations",d,R,J),nt("teams",d,R,J),nt("sessions",d,R,J)]);xe&&(zt(xe.data||[]),me(xe.labels||[])),vt({signups:(xe==null?void 0:xe.data)||[],logins:(pe==null?void 0:pe.data)||[],organizations:(ie==null?void 0:ie.data)||[],teams:(be==null?void 0:be.data)||[],sessions:(Ce==null?void 0:Ce.data)||[]}),En((xe==null?void 0:xe.labels)||(pe==null?void 0:pe.labels)||(ie==null?void 0:ie.labels)||(be==null?void 0:be.labels)||(Ce==null?void 0:Ce.labels)||[])}finally{$t(!1)}}})()},[d,R,J,nt]),m.useEffect(()=>{(async()=>{const xe=await nt("activeUsers","1D");xe&&X(xe.percentageChange||0)})()},[nt]),m.useEffect(()=>{},[rs.organizations,rs.teams,Ar]),m.useEffect(()=>{(async()=>{const xe=ql[x]||"1D",pe=xe==="Custom";if(!(pe&&(!K||!ce))){Fe(!0);try{const ie=await nt("organizations",xe,pe?K:void 0,pe?ce:void 0);ie&&(Se(ie.total||0),W(ie.percentageChange||0))}catch{Se(0),W(0)}finally{Fe(!1)}}})()},[x,K,ce,nt]),m.useEffect(()=>{(async()=>{const xe=ql[j]||"1D",pe=xe==="Custom";if(!(pe&&(!ve||!Te))){he(!0);try{const ie=await nt("teams",xe,pe?ve:void 0,pe?Te:void 0);ie&&(Pe(ie.total||0),de(ie.percentageChange||0))}catch{Pe(0),de(0)}finally{he(!1)}}})()},[j,ve,Te,nt]),m.useEffect(()=>{(async()=>{const xe=await nt("users","1D");xe&&qt(xe.percentageChange||0);const pe=await nt("organizations","1D");pe&&La(pe.percentageChange||0);const ie=await nt("activeUsers","1D");ie&&Yl(ie.percentageChange||0);const[be,Ce,je,we,Ue]=await Promise.all([nt("newUsers","1D"),nt("activeUsers","1D"),nt("organizations","1D"),nt("teams","1D"),nt("sessions","1D")]),Ut=[(be==null?void 0:be.total)||0,(Ce==null?void 0:Ce.total)||0,(je==null?void 0:je.total)||0,(we==null?void 0:we.total)||0,(Ue==null?void 0:Ue.total)||0].reduce((Ks,ch)=>Ks+ch,0);th(Ut);const ao=[(be==null?void 0:be.previousTotal)||0,(Ce==null?void 0:Ce.previousTotal)||0,(je==null?void 0:je.previousTotal)||0,(we==null?void 0:we.previousTotal)||0,(Ue==null?void 0:Ue.previousTotal)||0].reduce((Ks,ch)=>Ks+ch,0);if(ao>0){const Ks=(Ut-ao)/ao*100;to(Ks)}else Ut>0?to(100):to(0)})()},[nt]),m.useEffect(()=>{(async()=>{try{const pe=await(await fetch("/api/version-check")).json();pe&&D({current:pe.current||"1.0.0",latest:pe.latest||"1.0.0",isOutdated:pe.isOutdated||!1})}catch{try{const be=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",Ce="1.5.0";D({current:be,latest:Ce,isOutdated:be!==Ce})}catch{D({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const Gl=fe=>{switch(fe){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"}},Kl=fe=>{switch(fe){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"}},oh=fe=>{f(fe),w(!0)},so=()=>{w(!1),setTimeout(()=>f(null),300)},Ql=(fe,xe="users")=>{const pe=xe==="users"?Oe:ae,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(pe&&pe.length>0&&pe.length===be)return fe==="1D"?pe.filter((je,we)=>we%4===0).map(je=>{const we=parseInt(je.replace("h",""),10);return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):fe==="1W"?pe.map(je=>je.length>3?je.substring(0,3):je):fe==="1M"?pe.map(je=>{const we=je.split(" ");return we.length>=2?we[1]:je}):fe==="1Y"||fe==="3M"||fe==="6M"?pe.map(je=>je.length>3?je.substring(0,3):je):pe.map(je=>je.length>3?je.substring(0,3):je);const Ce=new Date;switch(fe){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(je,we)=>new Date(Ce.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(je,we)=>new Date(Ce.getTime()-(29-we)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},lh=(fe,xe="users")=>{const pe=xe==="users"?Oe:ae,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(pe&&pe.length>0&&pe.length===be)return fe==="1D"?pe.map(je=>{const we=parseInt(je.replace("h",""),10);return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):fe==="1Y"||fe==="3M"||fe==="6M"?pe.map(je=>{const we=["January","February","March","April","May","June","July","August","September","October","November","December"],tn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(je);return tn!==-1?we[tn]:je}):pe;const Ce=new Date;switch(fe){case"1D":return Array.from({length:24},(je,we)=>{const Ue=new Date;return Ue.setHours(we,0,0,0),Ue.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(je,we)=>new Date(Ce.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(je,we)=>{const Ue=new Date(Ce.getTime()-(29-we)*24*60*60*1e3),tn=Ue.toLocaleDateString("en-US",{month:"short"}),Ut=Ue.getDate();return`${tn} ${Ut}`});case"3M":return Array.from({length:3},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(je,we)=>new Date(Ce.getFullYear(),Ce.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},Wa=(fe,xe="users")=>{const pe=xe==="users"?ut:Ot,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[fe]||7;if(!pe||pe.length===0)return Array(be).fill(0);const Ce=[...pe];for(;Ce.length<be;)Ce.push(0);const je=Ce.slice(0,be),we=Math.max(...je,1);return je.map(Ue=>Ue/we*100)},Zl=()=>{const fe=Nt.length>0?Nt:Ql(d,"users"),xe=fe.map((ie,be)=>So.reduce((Ce,je)=>{var we;return Ce+(((we=Ve[je.id])==null?void 0:we[be])??0)},0)),pe=Math.max(...xe,1);return s.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[s.jsx("div",{className:"px-6 overflow-hidden",children:s.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:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":as(rs.users)}),s.jsxs("div",{className:`flex items-center gap-1 ${lr>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${lr<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(lr).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(Ln,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":as(rs.organizations)}),s.jsxs("div",{className:`flex items-center gap-1 ${Rt>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${Rt<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Rt).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(mw,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":as(rs.sessions)}),s.jsxs("div",{className:`flex items-center gap-1 ${hn>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${hn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(hn).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(hw,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Activity Hits"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":as(eh??0)}),s.jsxs("div",{className:`flex items-center gap-1 ${eo>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${eo<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(eo).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":as(i??0)}),s.jsxs("div",{className:"flex items-center gap-1 text-green-500",children:[s.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsx("span",{className:"text-sm font-medium",children:"18%"})]})]})]})]})}),s.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(ie=>s.jsx("button",{onClick:()=>c(ie),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===ie?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ie},ie))})]}),s.jsxs("div",{className:"flex justify-between items-end mb-6",children:[s.jsx("p",{className:"text-4xl text-white font-light",children:Ar?"...":as(rs.users)}),s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[s.jsx("svg",{className:`w-3 h-3 ${Je>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${Je>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Je).toFixed(1),"%"]})]})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsxs("div",{className:"h-32 relative",children:[s.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),s.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),s.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:Wa(l,"users").map((ie,be)=>{const Ce=T===be;return s.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${ie}%`,background:"url(#usersBarGradient)"},onMouseEnter:je=>{const we=je.currentTarget.getBoundingClientRect(),Ue=we.left+we.width/2,tn=we.top,Ut=150,os=60,ao=Math.max(Ut/2,Math.min(window.innerWidth-Ut/2,Ue)),Ks=Math.max(os+10,Math.min(window.innerHeight-10,tn));C(be),z({x:ao,y:Ks})},onMouseLeave:()=>{C(null),z(null)},children:s.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:Ce?1:.8}})},be)})}),T!==null&&_&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${_.x}px`,top:`${_.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:lh(l,"users")[T]}),s.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[ut[T]!==void 0?ut[T].toLocaleString():"0"," ",s.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),s.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:Ql(l,"users").map((ie,be)=>s.jsx("span",{className:"flex-1 text-center truncate",children:ie},be))})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),s.jsx("p",{className:"text-4xl text-white font-light mt-1",children:Qe?"...":is(rh)}),s.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(ie=>s.jsx("button",{onClick:()=>h(ie),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${d===ie?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ie},ie))})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsx("div",{className:"h-40 flex items-end gap-1",children:fe.map((ie,be)=>{const Ce=xe[be]||0;return s.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:je=>sh(je,be),onMouseLeave:()=>{P(null),q(null)},children:So.map(je=>{var tn;const we=((tn=Ve[je.id])==null?void 0:tn[be])??0,Ue=Ce===0||pe===0?0:Math.max(we/pe*100,we>0?4:0);return s.jsx("div",{className:`w-full ${je.barClass}`,style:{height:`${Ue}%`}},`${je.id}-${be}`)})},`${ie}-${be}`)})}),Qe&&s.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..."}),H!==null&&B&&s.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:s.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg min-w-[180px]",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:fe[H]||`Bucket ${H+1}`}),s.jsx("div",{className:"space-y-1",children:So.map(ie=>{var be;return s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[s.jsx("span",{className:`w-2 h-2 rounded-sm ${ie.dotClass}`}),ie.label]}),s.jsx("span",{className:"text-white font-medium",children:((be=Ve[ie.id])==null?void 0:be[H])??0})]},ie.id)})})]})}),s.jsx("div",{className:`flex justify-between ${d==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:fe.map((ie,be)=>s.jsx("span",{className:"flex-1 text-center truncate",children:ie},be))}),s.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:So.map(ie=>s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`w-2 h-2 rounded-sm ${ie.dotClass}`}),ie.label]}),s.jsx("span",{className:"text-white font-medium",children:Qe?"...":is(ro[ie.id]||0)})]},ie.id))})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.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:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:v})]}),S&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{b(ie),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:ie},ie))})]}),v==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),G?An(G,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:G,onSelect:se,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),re?An(re,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:re,onSelect:Z,initialFocus:!0,disabled:ie=>G?ie<G:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:is(r)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${ze>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${ze>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ze).toFixed(1),"%"]})]})})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>I(!A),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:g})]}),A&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{y(ie),I(!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:ie},ie))})]}),g==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),R?An(R,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:R,onSelect:ee,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),J?An(J,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:J,onSelect:F,initialFocus:!0,disabled:ie=>R?ie<R:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:is(Xl)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${Ua>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:Ua<0?{transform:"rotate(180deg)"}:{},children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${Ua>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Ua).toFixed(1),"%"]})]})})]})]})]}),s.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>$(!U),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:x})]}),U&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{N(ie),$(!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:ie},ie))})]}),x==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),K?An(K,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:K,onSelect:ne,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),ce?An(ce,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:ce,onSelect:ge,initialFocus:!0,disabled:ie=>K?ie<K:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:_e?"...":is(Ne)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.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:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${le>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(le).toFixed(1),"%"]})]})})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>E(!L),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(zc,{className:"w-3 h-3"}),s.jsx("span",{children:j})]}),L&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Gs.map(ie=>s.jsx("button",{onClick:()=>{k(ie),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:ie},ie))})]}),j==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),ve?An(ve,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:ve,onSelect:Ae,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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:[s.jsx(Yn,{className:"mr-1 h-3 w-3"}),Te?An(Te,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:Te,onSelect:tt,initialFocus:!0,disabled:ie=>ve?ie<ve:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light",children:bt?"...":is(ue)}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${te>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${te>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(te).toFixed(1),"%"]})]})})]})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Mn,{className:"w-4 h-4 text-white/60"}),s.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),s.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),s.jsx("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:ih.map((ie,be)=>s.jsx("div",{onClick:()=>oh(ie),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 ${be*.1}s both`},children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:s.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:ie.title})}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${Gl(ie.severity)}`,children:ie.severity}),s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${Kl(ie.status)}`,children:ie.status})]})]}),s.jsx(PP,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},ie.id))})]})]})]})]})};return s.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[s.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?Zl():e==="users"?s.jsx(ok,{}):e==="organizations"?s.jsx(ik,{}):Zl()}),t&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mw,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Ze,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Ln,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(hw,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Hr,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),s.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(J2,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Q2,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),s.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[s.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),p&&u&&s.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:so,children:s.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:fe=>fe.stopPropagation(),children:[s.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Mn,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light",children:u.title})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${Gl(u.severity)}`,children:[u.severity," Severity"]}),s.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${Kl(u.status)}`,children:u.status}),u.cve&&s.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:u.cve})]})]}),s.jsx("button",{onClick:so,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:s.jsx(Kt,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),s.jsx("p",{className:"text-white",children:new Date(u.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),u.description.includes("npm install")?s.jsxs("div",{children:[s.jsx("p",{className:"text-white leading-relaxed mb-3",children:u.description.split("Run:")[0]}),s.jsx("div",{className:"relative group",children:s.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("code",{children:[s.jsx("span",{className:"text-green-400",children:"$"})," ",s.jsx("span",{className:"text-cyan-400",children:"npm"})," ",s.jsx("span",{className:"text-yellow-400",children:"install"})," ",s.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),V.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:s.jsx(Ym,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):s.jsx("p",{className:"text-white leading-relaxed",children:u.description})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:u.affectedComponents.map((fe,xe)=>s.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 ${xe*.1}s both`},children:[s.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),s.jsx("span",{className:"text-sm text-white",children:fe})]},xe))})]}),s.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:s.jsxs("div",{className:"flex items-start gap-3",children:[u.status==="applied"&&s.jsxs(s.Fragment,{children:[s.jsx(Ix,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),u.status==="scheduled"&&s.jsxs(s.Fragment,{children:[s.jsx(Z2,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),u.status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(JL,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),s.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:s.jsx(Y,{variant:"ghost",onClick:so,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),s.jsx("style",{children:`
421
+ @keyframes fadeIn {
422
+ from {
423
+ opacity: 0;
424
+ }
425
+ to {
426
+ opacity: 1;
427
+ }
428
+ }
429
+
430
+ @keyframes slideUp {
431
+ from {
432
+ opacity: 0;
433
+ transform: translateY(20px);
434
+ }
435
+ to {
436
+ opacity: 1;
437
+ transform: translateY(0);
438
+ }
439
+ }
440
+
441
+ @keyframes slideIn {
442
+ from {
443
+ opacity: 0;
444
+ transform: translateX(-10px);
445
+ }
446
+ to {
447
+ opacity: 1;
448
+ transform: translateX(0);
449
+ }
450
+ }
451
+
452
+ .custom-scrollbar::-webkit-scrollbar {
453
+ width: 6px;
454
+ }
455
+
456
+ .custom-scrollbar::-webkit-scrollbar-track {
457
+ background: rgba(255, 255, 255, 0.05);
458
+ }
459
+
460
+ .custom-scrollbar::-webkit-scrollbar-thumb {
461
+ background: rgba(255, 255, 255, 0.2);
462
+ border-radius: 3px;
463
+ }
464
+
465
+ .custom-scrollbar::-webkit-scrollbar-thumb:hover {
466
+ background: rgba(255, 255, 255, 0.3);
467
+ }
468
+ `})]})}const _n=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:De("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));_n.displayName="Card";const Dn=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:De("flex flex-col space-y-1.5 p-6",e),...t}));Dn.displayName="CardHeader";const Tn=m.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:De("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));Tn.displayName="CardTitle";const hr=m.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:De("text-sm text-gray-300",e),...t}));hr.displayName="CardDescription";const Pn=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:De("p-6 pt-0",e),...t}));Pn.displayName="CardContent";const bF=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:De("flex items-center p-6 pt-0",e),...t}));bF.displayName="CardFooter";const NF={databaseSchemaNode:Fm},Nw=[{name:"organization",displayName:"Organization",description:"Multi-tenant organization support",color:"bg-blue-500"},{name:"teams",displayName:"Teams",description:"Team management within organizations",color:"bg-green-500"},{name:"twoFactor",displayName:"Two Factor",description:"Two-factor authentication support",color:"bg-purple-500"},{name:"apiKey",displayName:"API Key",description:"API key authentication",color:"bg-orange-500"},{name:"passkey",displayName:"Passkey",description:"WebAuthn passkey support",color:"bg-pink-500"}];function jF(){const[e,t]=m.useState(null),[n,r]=m.useState(!0),[a,i]=m.useState(null),[o,l]=m.useState([]),[c,d]=m.useState([]),[h,u,f]=JT([]),[p,w,v]=eP([]),b=m.useCallback(k=>{const S=Nw.find(M=>M.name===k);return(S==null?void 0:S.color)||"bg-gray-500"},[]),g=m.useCallback((k,S,M)=>{if(k==="user"||k==="session"||k==="account"||k==="verification")return"core";for(const A of M)if(k===A||k.includes(A))return A;return"core"},[]),y=m.useCallback(async()=>{try{const S=await(await fetch("/api/plugins")).json();if(S.plugins&&Array.isArray(S.plugins)){const M=S.plugins.map(A=>({name:A.id,displayName:A.name||A.id,description:A.description||`${A.id} plugin for Better Auth`,color:b(A.id)}));d(M),l(M.map(A=>A.name))}}catch{d(Nw),l(["organization"])}},[b]),x=m.useCallback(async k=>{try{r(!0);const S=k.length>0?`?plugins=${k.join(",")}`:"",A=await(await fetch(`/api/database/schema${S}`)).json();A.success?t(A.schema):i(A.error||"Failed to fetch schema")}catch{i("Failed to fetch database schema")}finally{r(!1)}},[]);m.useEffect(()=>{y()},[y]),m.useEffect(()=>{o.length>0&&x(o)},[o,x]),m.useEffect(()=>{if(!e)return;const k=[],S=[];e.tables.forEach((M,A)=>{const I=M.fields.map(U=>({id:`${M.name}-${U.name}`,isPrimary:U.primaryKey||!1,isNullable:!U.required,isUnique:U.unique||!1,isIdentity:!1,name:U.name,format:U.type,plugin:g(M.name,U.name,o)}));k.push({id:M.name,type:"databaseSchemaNode",position:{x:A%3*380,y:Math.floor(A/3)*320},data:{name:M.name,displayName:M.displayName,isForeign:!1,plugin:g(M.name,"",o),columns:I.map(U=>{var $;return{...U,description:(($=M.fields.find(L=>L.name===U.name))==null?void 0:$.description)||""}}),relationships:M.relationships}})}),e.tables.forEach(M=>{M.relationships.forEach(A=>{if(A.type==="many-to-one")return;const I=M.name,U=A.target,$=k.find(E=>E.id===I),L=k.find(E=>E.id===U);if($&&L){const E=A.type==="one-to-one"?"1:1":"1:N";S.push({id:`${I}-${U}-${A.field}`,source:I,target:U,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:E,labelStyle:{fontSize:"11px",fill:"#9ca3af",fontWeight:"500"},labelBgStyle:{fill:"rgba(0, 0, 0, 0.9)",fillOpacity:1,rx:4,ry:4},markerEnd:{type:"arrowclosed",color:"#6b7280",width:12,height:12}})}})}),u(k),w(S)},[e,o,u,w,g]);const N=m.useCallback(k=>w(S=>W1(k,S)),[w]);if(n)return s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"animate-pulse",children:[s.jsx("div",{className:"h-8 bg-gray-700 rounded w-1/3 mb-6"}),s.jsx("div",{className:"h-96 bg-gray-700 rounded"})]}),s.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 mt-4",children:"Loading plugins and schema..."})]});if(a)return s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"bg-red-900/20 border border-red-500/20 rounded-none p-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-red-400 mb-2",children:"Error Loading Schema"}),s.jsx("p",{className:"text-gray-300",children:a})]})});const j=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"flex items-center justify-between mb-1",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-6 h-6 text-white"}),s.jsx("h1",{className:"text-2xl font-light text-white",children:"Schema Visualizer"})]})}),s.jsx("p",{className:"text-gray-400",children:"Visualize your Better Auth database schema with interactive tables and relationships."})]}),s.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-6",children:[s.jsxs("div",{className:"col-span-1",children:[s.jsxs(_n,{className:"rounded-none bg-black h-fit shadow-sm",children:[s.jsx(Dn,{children:s.jsxs(Tn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[s.jsx(bi,{className:"w-5 h-5"}),s.jsx("span",{children:"Plugins"})]})}),s.jsx(Pn,{className:"space-y-3",children:c.length>0?c.map(k=>s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${k.color}`}),s.jsx("label",{htmlFor:k.name,className:"text-sm font-medium text-white cursor-pointer",children:k.displayName.slice(0,1).toUpperCase()+k.displayName.slice(1).replace("-"," ")})]},k.name)):s.jsx("div",{className:"text-sm text-white/70",children:"No plugins detected in configuration"})})]}),e&&s.jsxs(_n,{className:"rounded-none bg-black mt-4 shadow-sm",children:[s.jsx(Dn,{children:s.jsx(Tn,{className:"text-white text-sm",children:"Schema Info"})}),s.jsxs(Pn,{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-white/70",children:"Tables:"}),s.jsx("span",{className:"text-white",children:e.tables.length})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-white/70",children:"Relationships:"}),s.jsx("span",{className:"text-white",children:e.tables.reduce((k,S)=>k+S.relationships.length,0)})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-white/70",children:"Available Plugins:"}),s.jsx("span",{className:"text-white",children:c.length})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-white/70",children:"Selected Plugins:"}),s.jsx("span",{className:"text-white",children:o.length})]})]})]})]}),s.jsx("div",{className:"col-span-3",children:s.jsx("div",{className:"h-full bg-black border border-gray-700 rounded-lg overflow-hidden shadow-xl",children:s.jsxs(ZT,{nodes:h,edges:p,onNodesChange:f,onEdgesChange:v,onConnect:N,nodeTypes:NF,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:[s.jsx(hP,{className:"bg-gray-900 border-gray-700 [&>button]:bg-gray-800 [&>button]:border-gray-600 [&>button]:text-white [&>button:hover]:bg-gray-700"}),s.jsx(SP,{className:"bg-gray-900 border-gray-700",nodeColor:k=>{var S;return(S=k.data)!=null&&S.isForeign?"#374151":"#1f2937"},maskColor:"rgba(0, 0, 0, 0.9)"}),s.jsx(aP,{variant:Yr.Dots,gap:20,size:1,color:"#374151"})]})})})]})]});return s.jsxs("div",{className:"overflow-hidden p-6 h-[90vh] flex flex-col opacity-70 bg-black relative",children:[s.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center pointer-events-none",children:[s.jsx("div",{className:"absolute inset-0 backdrop-blur-sm",style:{WebkitBackdropFilter:"blur(8px)",backdropFilter:"blur(8px)"}}),s.jsxs("div",{className:"relative -mt-6 bg-black/50 border border-dashed border-white/20 rounded-none p-12 max-w-2xl mx-6 text-center pointer-events-auto",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsxs("div",{className:"relative",children:[s.jsx(mt,{className:"w-16 h-16 text-white opacity-50"}),s.jsx(WP,{className:"w-8 h-8 text-white opacity-80 absolute -top-2 -right-2 animate-pulse"})]})}),s.jsx("h2",{className:"text-3xl font-mono uppercase font-light text-white mb-3",children:"Coming Soon"}),s.jsx("p",{className:"text-lg text-gray-300 font-light mb-6 leading-relaxed",children:"We will be having this feature soon. This feature will allow you to explore your Better Auth database structure with beautiful, interactive graphs showing all tables, relationships, and data flow."}),s.jsxs("div",{className:"flex items-center justify-center space-x-6 text-sm text-gray-400",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),s.jsx("span",{children:"Interactive Tables"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),s.jsx("span",{children:"Relationship Mapping"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),s.jsx("span",{children:"Real-time Updates"})]})]})]})]}),s.jsx("div",{className:"blur-sm opacity-50 pointer-events-none",children:j})]})}const kF=c2("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 at({className:e,variant:t,...n}){return s.jsx("div",{className:De(kF({variant:t}),e),...n})}function SF(){const{orgId:e}=Xp(),t=Mr(),[n,r]=m.useState(null),[a,i]=m.useState([]),[o,l]=m.useState([]),[c,d]=m.useState([]),[h,u]=m.useState(!0),[f,p]=m.useState("details"),[w,v]=m.useState(!1),[b,g]=m.useState(!1),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(!1),[M,A]=m.useState(!1),[I,U]=m.useState(!1),[$,L]=m.useState(!1),[E,O]=m.useState(null),[D,T]=m.useState(""),[C,_]=m.useState(""),[z,H]=m.useState([]),[P,B]=m.useState({name:""}),[q,G]=m.useState(!1),[se,re]=m.useState([]),[Z,R]=m.useState(!1),[ee,J]=m.useState([]),[F,K]=m.useState(!1);m.useEffect(()=>{e&&(ce(),ve(),ge(),Te(),tt(),Ae())},[e]),m.useEffect(()=>{w&&e&&Ae()},[]),m.useEffect(()=>{f==="members"&&e&&tt()},[f,e]),m.useEffect(()=>{f==="invitations"&&e&&Te()},[f,e]);const ne=W=>{B({name:W})},ce=async()=>{try{const te=await(await fetch(`/api/organizations/${e}`)).json();te.success&&te.organization||te.organization?r(te.organization):V.error("Organization not found")}catch(W){console.error("Failed to fetch organization:",W),V.error("Failed to load organization")}finally{u(!1)}},ge=async()=>{try{const te=await(await fetch("/api/plugins/teams/status")).json();v(te.enabled)}catch(W){console.error("Failed to check teams status:",W),v(!1)}},ve=async()=>{try{const te=await(await fetch("/api/plugins/organization/status")).json();g(te.enabled)}catch(W){console.error("Failed to check organization status:",W),g(!1)}},Ae=async()=>{try{const te=await(await fetch(`/api/organizations/${e}/teams`)).json();te.success&&i(te.teams||[])}catch(W){console.error("Failed to fetch teams:",W),V.error("Failed to load teams")}},Te=async()=>{try{const te=await(await fetch(`/api/organizations/${e}/invitations`)).json();te.success&&l(te.invitations||[])}catch(W){console.error("Failed to fetch invitations:",W),V.error("Failed to load invitations")}},tt=async()=>{try{const te=await(await fetch(`/api/organizations/${e}/members`)).json();te.success&&d(te.members||[])}catch(W){console.error("Failed to fetch members:",W),V.error("Failed to load members")}},ut=async W=>{re([]),R(!0),re([{id:"start",type:"info",message:`Starting member seeding process for ${W} members...`,timestamp:new Date}]);try{const de=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(de.success){const Ne=de.results.map((ue,Pe)=>ue.success?{id:`member-${Pe}`,type:"progress",message:`Adding member: ${ue.member.user.name} (${ue.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${Pe}`,type:"error",message:`Failed to add member ${Pe+1}: ${ue.error}`,timestamp:new Date});re(ue=>[...ue,...Ne]);const Se=de.results.filter(ue=>ue.success).length;re(ue=>[...ue,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${Se}/${W} members successfully`,timestamp:new Date}]),await tt(),V.success(`Successfully added ${Se} members!`)}else re(Ne=>[...Ne,{id:"error",type:"error",message:`❌ Seeding failed: ${de.error||"Unknown error"}`,timestamp:new Date}]),V.error(de.error||"Failed to seed members")}catch(te){re(de=>[...de,{id:"error",type:"error",message:`❌ Network error: ${te}`,timestamp:new Date}]),V.error("Failed to seed members")}finally{R(!1)}},Le=async W=>{J([]),K(!0),J([{id:"start",type:"info",message:`Starting team seeding process for ${W} teams...`,timestamp:new Date}]);try{const de=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(de.success){const Ne=de.results.map((ue,Pe)=>ue.success?{id:`team-${Pe}`,type:"progress",message:`Creating team: ${ue.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${Pe}`,type:"error",message:`Failed to create team ${Pe+1}: ${ue.error}`,timestamp:new Date});J(ue=>[...ue,...Ne]);const Se=de.results.filter(ue=>ue.success).length;J(ue=>[...ue,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${Se}/${W} teams successfully`,timestamp:new Date}]),await Ae(),V.success(`Successfully created ${Se} teams!`)}else J(Ne=>[...Ne,{id:"error",type:"error",message:`❌ Seeding failed: ${de.error||"Unknown error"}`,timestamp:new Date}]),V.error(de.error||"Failed to seed teams")}catch(te){J(de=>[...de,{id:"error",type:"error",message:`❌ Network error: ${te}`,timestamp:new Date}]),V.error("Failed to seed teams")}finally{K(!1)}},Oe=async()=>{try{const te=await(await fetch("/api/users/all")).json();te.success&&H(te.users||[])}catch(W){console.error("Failed to fetch users:",W)}},Ge=()=>{Oe(),x(!0)},Je=async()=>{if(!D){V.error("Please enter an email address");return}if(!C){V.error("Please select an inviter");return}G(!0);const W=V.loading("Sending invitation...");try{const de=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:D,role:"member",inviterId:C})})).json();de.success?(await Te(),x(!1),T(""),_(""),V.success("Invitation sent successfully!",{id:W})):V.error(`Error sending invitation: ${de.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error sending invitation:",te),V.error("Error sending invitation",{id:W})}finally{G(!1)}},ot=async W=>{const te=V.loading("Cancelling invitation...");try{const Ne=await(await fetch(`/api/invitations/${W}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Ne.success?(await Te(),V.success("Invitation cancelled successfully!",{id:te})):V.error(`Error cancelling invitation: ${Ne.error||"Unknown error"}`,{id:te})}catch(de){console.error("Error cancelling invitation:",de),V.error("Error cancelling invitation",{id:te})}},Ot=async(W,te)=>{const de=V.loading("Resending invitation...");try{const Se=await(await fetch(`/api/invitations/${W}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();Se.success?(await Te(),V.success(`Invitation resent to ${te}!`,{id:de})):V.error(`Error resending invitation: ${Se.error||"Unknown error"}`,{id:de})}catch(Ne){console.error("Error resending invitation:",Ne),V.error("Error resending invitation",{id:de})}},zt=async(W,te)=>{const de=V.loading(`Removing ${te}...`);try{const Se=await(await fetch(`/api/members/${W}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Se.success?(await tt(),V.success(`${te} removed from organization!`,{id:de})):V.error(`Error removing member: ${Se.error||"Unknown error"}`,{id:de})}catch(Ne){console.error("Error removing member:",Ne),V.error("Error removing member",{id:de})}},ae=async()=>{if(!P.name){V.error("Please enter a team name");return}const W=V.loading("Creating team...");try{const de=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,organizationId:e})})).json();de.success?(await Ae(),A(!1),B({name:""}),V.success("Team created successfully!",{id:W})):V.error(`Error creating team: ${de.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error creating team:",te),V.error("Error creating team",{id:W})}},me=async()=>{if(!E||!P.name){V.error("Please enter a team name");return}const W=V.loading("Updating team...");try{const de=await(await fetch(`/api/teams/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name})})).json();de.success?(await Ae(),U(!1),O(null),B({name:""}),V.success("Team updated successfully!",{id:W})):V.error(`Error updating team: ${de.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error updating team:",te),V.error("Error updating team",{id:W})}},ze=async()=>{if(!E){V.error("No team selected");return}const W=V.loading("Deleting team...");try{const de=await(await fetch(`/api/teams/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();de.success?(await Ae(),L(!1),O(null),V.success("Team deleted successfully!",{id:W})):V.error(`Error deleting team: ${de.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error deleting team:",te),V.error("Error deleting team",{id:W})}},X=W=>{O(W),B({name:W.name}),U(!0)},le=W=>{O(W),L(!0)};return h?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(ca,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:s.jsxs("span",{className:"font-light",children:[s.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),s.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{onClick:()=>j(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[s.jsx(Ze,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),s.jsxs(Y,{onClick:Ge,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[s.jsx(Rr,{className:"w-4 h-4 mr-2"}),"Invite User"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Ca,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ln,{className:"w-6 h-6 text-white"})}),s.jsx("div",{children:s.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:n.slug}),s.jsx("span",{className:"ml-1",children:"]"})]})]})})]}),s.jsx("div",{className:"border-b border-white/10",children:s.jsxs("nav",{className:"flex space-x-8",children:[s.jsxs("button",{onClick:()=>p("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:[s.jsx(Ln,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Details",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(br,{value:0,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),s.jsxs("button",{onClick:()=>p("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:[s.jsx(Ze,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Members",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(br,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),s.jsxs("button",{onClick:()=>p("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:[s.jsx(Rr,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Invitations",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(br,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),s.jsxs("button",{onClick:()=>p("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:[s.jsx(Ze,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Teams",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(br,{value:a.length,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),f==="details"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[s.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Organization Information"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),s.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),s.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),s.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ze,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:c.length}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ze,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:a.length}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Rr,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:o.length}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Yn,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.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))}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-xs",children:a.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(Hr,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),s.jsxs(Y,{onClick:()=>A(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Vo,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),w?a.length>0?s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:a.map(W=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${W.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:W.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",W.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:W.memberCount||0}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(W.createdAt).toLocaleDateString()}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsxs(Y,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:te=>{te.stopPropagation(),X(W)},children:[s.jsx(Ca,{className:"w-4 h-4 mr-1"}),"Edit"]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:te=>{te.stopPropagation(),le(W)},children:[s.jsx(od,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},W.id))})]})})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Ze,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),s.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),s.jsxs(Y,{onClick:()=>A(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Vo,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx(Ze,{className:"w-12 h-12 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),s.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."}),s.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[s.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),s.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:s.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),s.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:s.jsxs("pre",{className:"text-sm text-gray-300",children:[s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"export const"})," ",s.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",s.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",s.jsx("br",{}),s.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",s.jsx("span",{className:"text-blue-400",children:"true"})," ",s.jsx("br",{}),s.jsx("span",{className:"pl-16",children:"}"})," ",s.jsx("br",{}),s.jsx("span",{className:"pl-12",children:"})"})," ",s.jsx("br",{}),s.jsx("span",{className:"pl-10",children:"]"})," ",s.jsx("br",{}),"}",") ",s.jsx("br",{})]})}),s.jsx("div",{className:"mt-4",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),s.jsx("div",{className:"mt-2",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),s.jsx(Y,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),s.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",s.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"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.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?s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:c.map(W=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.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"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:W.user.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",W.user.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:W.user.email}),s.jsx("td",{className:"py-4 px-4",children:s.jsx(at,{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})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(W.joinedAt).toLocaleDateString()}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.jsxs(Y,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>zt(W.id,W.user.name),children:[s.jsx(od,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},W.id))})]})})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Ze,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),s.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),s.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[s.jsxs(Y,{onClick:()=>j(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(Ze,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),s.jsxs(Y,{onClick:Ge,className:"bg-white text-white hover:bg-white/90 bg-transparent border border-white/20 rounded-none",children:[s.jsx(Rr,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.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?s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:o.map(W=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Rr,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:W.email}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(W.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white capitalize",children:W.role}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs(at,{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"&&s.jsx(Z2,{className:"w-3 h-3"}),W.status==="accepted"&&s.jsx(Ix,{className:"w-3 h-3"}),W.status==="expired"&&s.jsx(Kt,{className:"w-3 h-3"}),W.status]})}),s.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(W.expiresAt).toLocaleDateString(),s.jsx("br",{}),s.jsx("span",{className:"text-xs text-gray-400",children:new Date(W.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsxs(Y,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>Ot(W.id,W.email),children:[s.jsx(fw,{className:"w-4 h-4 mr-1"}),"Resend"]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>ot(W.id),children:[s.jsx(od,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},W.id))})]})})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Rr,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),s.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),s.jsxs(Y,{onClick:Ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Rr,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]}),y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{x(!1),T(""),_("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),s.jsx(Ie,{id:"invite-email",type:"email",value:D,onChange:W=>T(W.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),s.jsxs(pa,{value:C,onValueChange:_,children:[s.jsx(xa,{children:s.jsx(Wx,{placeholder:"Select an inviter..."})}),s.jsx(ga,{children:z.map(W=>s.jsx(sn,{value:W.id,children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.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"}),s.jsxs("span",{children:[W.name," (",W.email,")"]})]})},W.id))})]})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{x(!1),T(""),_("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsxs(Y,{onClick:Je,disabled:q,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[q?s.jsx(ca,{className:"w-3 h-3 mr-2 animate-spin"}):s.jsx(fw,{className:"w-4 h-4 mr-2"}),q?"Sending...":"Send Invitation"]})]})]})}),M&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{A(!1),B({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx(He,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Ie,{id:"team-name",value:P.name,onChange:W=>ne(W.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{A(!1),B({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ae,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),I&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{U(!1),B({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",E.id]})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Ie,{id:"edit-team-name",value:P.name,onChange:W=>ne(W.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{U(!1),B({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:me,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),$&&E&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",E.id]})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>L(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ze,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),N&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ze,{className:"w-5 h-5 text-white"}),s.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),s.jsx(Ie,{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"})]}),s.jsx(Y,{onClick:()=>{var te;const W=parseInt(((te=document.getElementById("member-count"))==null?void 0:te.value)||"5");ut(W)},disabled:Z,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:Z?s.jsxs(s.Fragment,{children:[s.jsx(ca,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ze,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),se.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Member Seeding Terminal",lines:se,isRunning:Z,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsx(Y,{variant:"outline",onClick:()=>j(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),k&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ln,{className:"w-5 h-5 text-white"}),s.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),s.jsx(Ie,{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"})]}),s.jsx(Y,{onClick:()=>{var te;const W=parseInt(((te=document.getElementById("team-count"))==null?void 0:te.value)||"3");Le(W)},disabled:F,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:F?s.jsxs(s.Fragment,{children:[s.jsx(ca,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ln,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),ee.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Team Seeding Terminal",lines:ee,isRunning:F,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsx(Y,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx(qp,{to:"/organizations",children:s.jsxs(Y,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[s.jsx(qL,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),s.jsx("br",{}),s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ln,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),s.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function CF(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[a,i]=m.useState(""),[o,l]=m.useState("all"),[c,d]=m.useState(!1),[h,u]=m.useState(!1),[f,p]=m.useState(!1),[w,v]=m.useState(!1),[b,g]=m.useState(!1),[y,x]=m.useState(null),[N,j]=m.useState([]),[k,S]=m.useState(!1),M=m.useCallback(async()=>{try{const _=await(await fetch("/api/sessions")).json();t(_.sessions||[])}catch{}finally{r(!1)}},[]);m.useEffect(()=>{M()},[M]);const A=async C=>{j([]),S(!0),j([{id:"start",type:"info",message:`Starting session seeding process for ${C} sessions...`,timestamp:new Date}]);try{const z=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:C})})).json();if(z.success){const H=z.results.map((B,q)=>B.success?{id:`session-${q}`,type:"progress",message:`Creating session: ${B.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${q}`,type:"error",message:`Failed to create session ${q+1}: ${B.error}`,timestamp:new Date});j(B=>[...B,...H]);const P=z.results.filter(B=>B.success).length;j(B=>[...B,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${P}/${C} sessions successfully`,timestamp:new Date}]),await M()}else j(H=>[...H,{id:"error",type:"error",message:`❌ Seeding failed: ${z.error||"Unknown error"}`,timestamp:new Date}])}catch(_){j(z=>[...z,{id:"error",type:"error",message:`❌ Network error: ${_}`,timestamp:new Date}])}finally{S(!1)}},I=async C=>{j([]),S(!0),j([{id:"start",type:"info",message:`Starting account seeding process for ${C} accounts...`,timestamp:new Date}]);try{const z=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:C})})).json();if(z.success){const H=z.results.map((B,q)=>B.success?{id:`account-${q}`,type:"progress",message:`Creating account: ${B.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${q}`,type:"error",message:`Failed to create account ${q+1}: ${B.error}`,timestamp:new Date});j(B=>[...B,...H]);const P=z.results.filter(B=>B.success).length;j(B=>[...B,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${P}/${C} accounts successfully`,timestamp:new Date}]),await M()}else j(H=>[...H,{id:"error",type:"error",message:`❌ Seeding failed: ${z.error||"Unknown error"}`,timestamp:new Date}])}catch(_){j(z=>[...z,{id:"error",type:"error",message:`❌ Network error: ${_}`,timestamp:new Date}])}finally{S(!1)}},U=C=>{x(C),v(!0)},$=C=>{x(C),u(!0)},L=C=>{x(C),p(!0)},E=async C=>{d(!1)},O=async C=>{u(!1)},D=async()=>{p(!1)},T=e.filter(C=>{const _=C.id.toLowerCase().includes(a.toLowerCase())||C.userId.toLowerCase().includes(a.toLowerCase()),z=o==="all"||o==="active"&&new Date(C.expiresAt)>new Date||o==="expired"&&new Date(C.expiresAt)<=new Date;return _&&z});return n?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(Xr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>d(!0),children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search sessions...",value:a,onChange:C=>i(C.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(fx,{className:"w-4 h-4 text-gray-400"}),s.jsxs(pa,{value:o,onValueChange:l,children:[s.jsx(xa,{children:s.jsx(Wx,{})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"all",children:"All"}),s.jsx(sn,{value:"active",children:"Active"}),s.jsx(sn,{value:"expired",children:"Expired"})]})]})]})]}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:T.map(C=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(mt,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",C.id.slice(0,8),"..."]}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",C.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:C.userId}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(C.expiresAt)>new Date?s.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):s.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),s.jsx("span",{className:"text-sm text-gray-400",children:new Date(C.expiresAt)>new Date?"Active":"Expired"})]})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(C.expiresAt).toLocaleDateString()}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>U(C),children:s.jsx(Il,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>$(C),children:s.jsx(Ca,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>L(C),children:s.jsx(mx,{className:"w-4 h-4"})})]})})]},C.id))})]})})}),b&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),s.jsx(Ie,{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"})]}),s.jsx(Y,{onClick:()=>{var _;const C=parseInt(((_=document.getElementById("session-count"))==null?void 0:_.value)||"5",10);A(C)},disabled:k,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:k?s.jsxs(s.Fragment,{children:[s.jsx(Xr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(xv,{className:"w-5 h-5 text-white"}),s.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),s.jsx(Ie,{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"})]}),s.jsx(Y,{onClick:()=>{var _;const C=parseInt(((_=document.getElementById("account-count"))==null?void 0:_.value)||"5",10);I(C)},disabled:k,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:k?s.jsxs(s.Fragment,{children:[s.jsx(Xr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(xv,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),N.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Session Seeding Terminal",lines:N,isRunning:k,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsx(Y,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),s.jsx(Ie,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),s.jsx(Ie,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:()=>E(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(mt,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),s.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),s.jsx(Ie,{id:"edit-user-id",defaultValue:y.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),s.jsx(Ie,{id:"edit-expires",type:"datetime-local",defaultValue:new Date(y.expiresAt).toISOString().slice(0,16),className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:()=>O(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(mt,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),s.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:D,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),w&&y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(mt,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),s.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:y.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"User ID:"}),s.jsx("span",{className:"text-white text-sm",children:y.userId})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Status:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt)>new Date?"Active":"Expired"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Expires:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(y.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(y.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(Y,{onClick:()=>v(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function EF(e){const t=m.useRef(null),n=m.useRef(null),r=m.useRef(0),a=5;m.useEffect(()=>{const i=()=>{try{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;t.current=new WebSocket(l),t.current.onopen=()=>{r.current=0,n.current&&(clearTimeout(n.current),n.current=null)},t.current.onmessage=c=>{try{const d=JSON.parse(c.data);e(d)}catch{}},t.current.onclose=c=>{if(!(c.code===1006||c.code===1001)&&r.current<a){r.current++;const d=Math.min(1e3*2**r.current,1e4);n.current=setTimeout(()=>{i()},d)}},t.current.onerror=c=>{}}catch{}};return i(),()=>{t.current&&t.current.close(),n.current&&clearTimeout(n.current)}},[e])}function MF(){var y,x,N,j,k,S,M,A,I,U,$,L,E,O,D,T,C,_,z,H,P,B,q,G,se,re,Z,R,ee;const[e,t]=m.useState(null),[n,r]=m.useState(null),[a,i]=m.useState(null),[o,l]=m.useState(null),[c,d]=m.useState(!0),[h,u]=m.useState(null);EF(J=>{J.type==="config_changed"?setTimeout(()=>{f(),p(),w(),v()},500):J.type});const f=m.useCallback(async()=>{var J;try{const K=await(await fetch("/api/config")).json();(J=K.studio)!=null&&J.version&&u(`v${K.studio.version}`),t(K)}catch{}finally{d(!1)}},[]),p=m.useCallback(async()=>{try{const F=await(await fetch("/api/health")).json();r(F.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform,uptime:"2h 15m"})}catch{r({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS",uptime:"2h 15m"})}},[h]),w=m.useCallback(async()=>{try{const F=await(await fetch("/api/plugins")).json();i(F)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),v=m.useCallback(async()=>{try{const F=await(await fetch("/api/db")).json();l(F)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),b=J=>{switch(J==null?void 0:J.toLowerCase()){case"postgresql":case"postgres":return s.jsxs(at,{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:[s.jsx(Et,{className:"w-3 h-3"}),"Connected"]});case"mysql":return s.jsxs(at,{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:[s.jsx(Et,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return s.jsxs(at,{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:[s.jsx(Mc,{className:"w-3 h-3"}),"Local"]});default:return s.jsxs(at,{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:[s.jsx(ur,{className:"w-3 h-3"}),"Unknown"]})}};m.useEffect(()=>{f(),p(),w(),v()},[f,v,w,p]);const g=J=>{switch(J.toLowerCase()){case"google":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"github":return s.jsx(Mn,{className:"w-5 h-5 text-white"});case"discord":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"twitter":return s.jsx(Ht,{className:"w-5 h-5 text-white"});default:return s.jsx(Ht,{className:"w-5 h-5 text-white"})}};return c?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):s.jsxs("div",{className:"space-y-8 animate-fade-in",children:[s.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),s.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),s.jsx("hr",{className:"w-full border-white/15 h-px"}),s.jsx("hr",{className:"w-full border-white/15 h-px"}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(bi,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Application"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(Pn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ht,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Vd,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(nd,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Mn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(mt,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Database"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(Pn,{className:"space-y-0 px-0 pb-0 border-b-none",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:(o==null?void 0:o.displayName)||((y=e==null?void 0:e.database)==null?void 0:y.type)&&((x=e==null?void 0:e.database)==null?void 0:x.type.charAt(0).toUpperCase())+((N=e==null?void 0:e.database)==null?void 0:N.type.slice(1))||"Unknown"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database Type"})]})]}),((o==null?void 0:o.name)||((j=e==null?void 0:e.database)==null?void 0:j.type))&&b((o==null?void 0:o.name)||((k=e==null?void 0:e.database)==null?void 0:k.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"&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:(o==null?void 0:o.dialect)||((M=e==null?void 0:e.database)==null?void 0:M.dialect)})})]}),((A=e==null?void 0:e.database)==null?void 0:A.url)&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Vd,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),s.jsxs(at,{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:[s.jsx(Et,{className:"w-3 h-3"}),"Configured"]})]}),((I=e==null?void 0:e.database)==null?void 0:I.casing)&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(bi,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mv,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),s.jsx(at,{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?s.jsxs(s.Fragment,{children:[s.jsx(ur,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Disabled"]})})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(ur,{className:"w-5 h-5 text-yellow-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),s.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"})]})]}),s.jsx(at,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(Mn,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Providers"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsx(Pn,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((J,F)=>s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[g(J.type),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:J.type}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:J.clientId?"Configured":"Not configured"})]})]}),s.jsx(at,{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:J.clientId?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Active"]}):s.jsxs(s.Fragment,{children:[s.jsx(ur,{className:"w-3 h-3"}),"Setup Required"]})})]},F)):s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Mn,{className:"w-8 h-8 text-white mx-auto mb-2"}),s.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(Yd,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Email & Password"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(Pn,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Yd,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),s.jsx(at,{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:(U=e==null?void 0:e.emailAndPassword)!=null&&U.enabled?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(ra,{className:"w-3 h-3"}),"Disabled"]})})]}),(($=e==null?void 0:e.emailAndPassword)==null?void 0:$.enabled)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ma,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),s.jsx(at,{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.emailAndPassword)!=null&&L.disableSignUp?s.jsxs(s.Fragment,{children:[s.jsx(ra,{className:"w-3 h-3"}),"Disabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Mn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),s.jsx(at,{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?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Required"]}):s.jsxs(s.Fragment,{children:[s.jsx(ur,{className:"w-3 h-3"}),"Optional"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(nd,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),s.jsx("div",{className:"text-right",children:s.jsxs("p",{className:"text-sm font-medium text-white",children:[((O=e==null?void 0:e.emailAndPassword)==null?void 0:O.minPasswordLength)||8," -"," ",((D=e==null?void 0:e.emailAndPassword)==null?void 0:D.maxPasswordLength)||128]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Xh,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),s.jsx(at,{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:(T=e==null?void 0:e.emailAndPassword)!=null&&T.autoSignIn?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(ur,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(Ec,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Session"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(Pn,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ec,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(C=e==null?void 0:e.session)!=null&&C.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mv,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:(_=e==null?void 0:e.session)!=null&&_.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Xh,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),s.jsx(at,{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:(z=e==null?void 0:e.session)!=null&&z.disableSessionRefresh?s.jsxs(s.Fragment,{children:[s.jsx(ra,{className:"w-3 h-3"}),"Disabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),s.jsx(at,{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:(H=e==null?void 0:e.session)!=null&&H.storeSessionInDatabase?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Mc,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(Mn,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Rate Limiting"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(Pn,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Mn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),s.jsx(at,{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:(P=e==null?void 0:e.rateLimit)!=null&&P.enabled?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(ur,{className:"w-3 h-3"}),"Disabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ec,{className:"w-5 h-5 text-red-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),s.jsxs("div",{className:"text-right",children:[s.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"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Mn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:((q=e==null?void 0:e.rateLimit)==null?void 0:q.max)||100}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((G=e==null?void 0:e.rateLimit)==null?void 0:G.storage)||"memory"})})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(bi,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Advanced"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(Pn,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(nd,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),s.jsx(at,{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=e==null?void 0:e.advanced)!=null&&se.useSecureCookies?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(ur,{className:"w-3 h-3"}),"Disabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Mn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),s.jsx(at,{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=e==null?void 0:e.advanced)!=null&&re.disableCSRFCheck?s.jsxs(s.Fragment,{children:[s.jsx(ra,{className:"w-3 h-3"}),"Disabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Il,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),s.jsx(at,{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:(R=(Z=e==null?void 0:e.advanced)==null?void 0:Z.ipAddress)!=null&&R.disableIpTracking?s.jsxs(s.Fragment,{children:[s.jsx(ra,{className:"w-3 h-3"}),"Disabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(AP,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),s.jsx(at,{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.telemetry)!=null&&ee.enabled?s.jsxs(s.Fragment,{children:[s.jsx(ur,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(Mc,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"System Info"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(Pn,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Xh,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Mc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ht,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ec,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Uptime"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Service uptime"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.uptime)||"2h 15m"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Running"})]})]})]})]}),s.jsxs(_n,{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:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs(Dn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(fv,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Plugins"})]}),s.jsxs(hr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsxs("div",{className:"pr-6",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(a==null?void 0:a.totalPlugins)||0}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsx(Pn,{className:"space-y-0 px-0 pb-0 border-b-none",children:a!=null&&a.plugins&&a.plugins.length>0?s.jsxs(s.Fragment,{children:[a.plugins.map((J,F)=>s.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${F<a.plugins.length-1?"border-b border-white/15":""}`,children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(fv,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:J.name.slice(0,1).toUpperCase()+J.name.slice(1).replace("-"," ")}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:J.description})]})]}),s.jsx("div",{className:"text-right flex items-center space-x-2",children:s.jsxs(at,{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:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]},J.id)),a.configPath&&s.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:s.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",s.jsx("span",{className:"text-white font-mono",children:a.configPath})]})})]}):s.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(ur,{className:"w-5 h-5 text-yellow-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),s.jsx("p",{className:"text-xs text-gray-400",children:(a==null?void 0:a.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),s.jsx(at,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function jw(){var D,T;const{orgId:e,teamId:t}=Xp(),n=Mr(),[r,a]=m.useState(null),[i,o]=m.useState([]),[l,c]=m.useState(!0),[d,h]=m.useState("details"),[u,f]=m.useState(!1),[p,w]=m.useState(!1),[v,b]=m.useState(""),[g,y]=m.useState([]),[x,N]=m.useState([]),[j,k]=m.useState({name:""}),S=m.useCallback(async()=>{if(t)try{const _=await(await fetch(`/api/teams/${t}`)).json();_.success&&_.team?(a(_.team),k({name:_.team.name})):_.team?(a(_.team),k({name:_.team.name})):V.error("Team not found")}catch{V.error("Failed to load team")}finally{c(!1)}},[t]),M=m.useCallback(async()=>{if(t)try{const _=await(await fetch(`/api/teams/${t}/members`)).json();_.success&&o(_.members||[])}catch{V.error("Failed to load team members")}},[t]),A=async()=>{try{const _=await(await fetch("/api/users?limit=10000")).json(),z=i.map(P=>P.userId),H=(_.users||[]).filter(P=>!z.includes(P.id));y(H)}catch{V.error("Failed to load users")}};m.useEffect(()=>{t&&(S(),M())},[t,S,M]);const I=async()=>{if(!j.name){V.error("Please enter a team name");return}const C=V.loading("Updating team...");try{const z=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j.name})})).json();z.success?(await S(),w(!1),V.success("Team updated successfully!",{id:C})):V.error(`Error updating team: ${z.error||"Unknown error"}`,{id:C})}catch{V.error("Error updating team",{id:C})}},U=async()=>{if(x.length===0){V.error("Please select at least one user");return}const C=V.loading(`Adding ${x.length} members...`);try{const z=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:x})})).json();z.success?(await M(),f(!1),N([]),b(""),V.success(`Successfully added ${x.length} members!`,{id:C})):V.error(`Error adding members: ${z.error||"Unknown error"}`,{id:C})}catch{V.error("Error adding members",{id:C})}},$=async(C,_)=>{const z=V.loading(`Removing ${_}...`);try{const P=await(await fetch(`/api/team-members/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();P.success?(await M(),V.success(`${_} removed from team!`,{id:z})):V.error(`Error removing member: ${P.error||"Unknown error"}`,{id:z})}catch{V.error("Error removing team member",{id:z})}},L=()=>{A(),f(!0)},E=C=>{N(_=>_.includes(C)?_.filter(z=>z!==C):[..._,C])},O=g.filter(C=>C.name.toLowerCase().includes(v.toLowerCase())||C.email.toLowerCase().includes(v.toLowerCase()));return l?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(ca,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):r?s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:s.jsxs("span",{className:"font-light",children:[s.jsxs("span",{onClick:()=>n(`/organizations/${r.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),s.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{onClick:L,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(Vo,{className:"w-4 h-4 mr-2"}),"Add Members"]}),s.jsxs(Y,{onClick:()=>w(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Ca,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[r.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:t}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("div",{className:"flex items-center space-x-2 mt-1",children:r.organization&&s.jsxs(qp,{to:`/organizations/${r.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[s.jsx(Ln,{className:"w-4 h-4 inline mr-1"}),r.organization.name]})})]})]}),s.jsx("div",{className:"border-b border-white/10",children:s.jsxs("nav",{className:"flex space-x-8",children:[s.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 ${d==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[s.jsx(Ze,{className:"w-4 h-4"}),s.jsx("span",{children:"Details"})]}),s.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 ${d==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[s.jsx(Ze,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Members",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(br,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),d==="details"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[s.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Team Information"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),s.jsx("p",{className:"text-white font-sans mt-1",children:r.name})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),s.jsx("p",{className:"text-white font-sans mt-1",children:((D=r.organization)==null?void 0:D.name)||"Unknown"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),s.jsx("p",{className:"text-white font-sans mt-1",children:new Date(r.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),s.jsx("p",{className:"text-white font-sans mt-1",children:new Date(r.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ze,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:i.length}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Yn,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((Date.now()-new Date(r.createdAt).getTime())/(1e3*60*60*24))}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ln,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:"1"}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),d==="members"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:i.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:i.map(C=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:C.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${C.user.id}`,alt:C.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.user.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",C.user.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:C.user.email}),s.jsx("td",{className:"py-4 px-4",children:s.jsx(at,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:C.role})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(C.joinedAt).toLocaleDateString()}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.jsxs(Y,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>$(C.id,C.user.name),children:[s.jsx(od,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},C.id))})]})})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Ze,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),s.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),s.jsxs(Y,{onClick:L,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Vo,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]}),u&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{f(!1),N([]),b("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Q2,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search users by name or email...",value:v,onChange:C=>b(C.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),x.length>0&&s.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:s.jsxs("p",{className:"text-blue-400 text-sm",children:[x.length," user",x.length!==1?"s":""," selected"]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:O.length>0?s.jsx("div",{className:"divide-y divide-white/5",children:O.map(C=>s.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${x.includes(C.id)?"bg-blue-900/20":""}`,onClick:()=>E(C.id),children:[s.jsx("input",{type:"checkbox",checked:x.includes(C.id),onChange:()=>E(C.id),className:"rounded border-gray-300"}),s.jsx("img",{src:C.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${C.id}`,alt:C.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.email})]})]},C.id))}):s.jsx("div",{className:"p-8 text-center",children:s.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>{f(!1),N([]),b("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsxs(Y,{onClick:U,disabled:x.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[s.jsx(Vo,{className:"w-4 h-4 mr-2"}),"Add ",x.length," Member",x.length!==1?"s":""]})]})]})}),p&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>w(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:r.name}),s.jsx("div",{className:"text-sm text-gray-400",children:(T=r.organization)==null?void 0:T.name})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Ie,{id:"edit-team-name",value:j.name,onChange:C=>k({name:C.target.value}),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>w(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:I,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:s.jsxs("span",{className:"font-light",children:[s.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),s.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ze,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),s.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function _F(){const e=Mr(),[t,n]=m.useState([]),[r,a]=m.useState(!0),[i,o]=m.useState(null),[l,c]=m.useState(""),[d,h]=m.useState("all"),[u,f]=m.useState(1),[p]=m.useState(20);m.useEffect(()=>{w()},[]);const w=async()=>{try{const k=await(await fetch("/api/plugins")).json(),S=(k==null?void 0:k.plugins).find(M=>M.id==="teams");o({enabled:!!S,availablePlugins:(k==null?void 0:k.plugins).map(M=>M.id),configPath:k.configPath,teamsPlugin:(k==null?void 0:k.plugins).find(M=>M.id==="teams")}),S?await v():a(!1)}catch(j){console.error("Failed to check teams plugin status:",j),o({enabled:!1,error:"Failed to check plugin status"}),a(!1)}},v=async()=>{try{const k=await(await fetch("/api/teams")).json();k.success&&n(k.teams||[])}catch(j){console.error("Failed to fetch teams:",j),V.error("Failed to load teams")}finally{a(!1)}},b=t.filter(j=>{var S;const k=j.name.toLowerCase().includes(l.toLowerCase())||((S=j.organization)==null?void 0:S.name.toLowerCase().includes(l.toLowerCase()));if(d==="all")return k;if(d==="recent"){const M=new Date;return M.setDate(M.getDate()-7),k&&new Date(j.createdAt)>M}return k}),g=u*p,y=g-p,x=b.slice(y,g),N=Math.ceil(b.length/p);return r?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx(Xr,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(br,{value:b.length,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),s.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[s.jsx(br,{value:b.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),s.jsxs("span",{children:["team",b.length!==1?"s":""," found"]})]})]}),s.jsx("div",{className:"flex items-center space-x-3",children:s.jsxs(Y,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"relative flex-1 max-w-md",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{type:"text",placeholder:"Search teams...",value:l,onChange:j=>c(j.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"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Y,{variant:d==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:d==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),s.jsx(Y,{variant:d==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:d==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),x.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ma,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),s.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&s.jsxs(Y,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):s.jsx("div",{className:"grid gap-4",children:x.map(j=>{var k;return s.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/${j.id}`),children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:s.jsx(Ma,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium",children:j.name}),s.jsxs("p",{className:"text-gray-400 text-sm",children:[(k=j.organization)==null?void 0:k.name," • ",j.memberCount||0," members"]})]})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(at,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},j.id)})}),N>1&&s.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,u-1)),disabled:u===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),s.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",u," of ",N]}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>f(Math.min(N,u+1)),disabled:u===N,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),s.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx(pr,{className:"w-12 h-12 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),s.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."}),s.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[s.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),s.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:s.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&s.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),s.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:s.jsxs("pre",{className:"text-sm text-gray-300",children:[s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"export const"})," ",s.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",s.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",s.jsx("br",{}),s.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),s.jsx("br",{}),s.jsx("span",{className:"pl-10",children:"]"})," ",s.jsx("br",{}),"}",") ",s.jsx("br",{})]})}),s.jsx("div",{className:"mt-4",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),s.jsx("div",{className:"mt-2",children:s.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&&s.jsx("div",{className:"mb-4",children:s.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),s.jsx(Y,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),s.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",s.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 wf=`// Example custom migration script
469
+ import { migrateUser } from '@better-auth/migration';
470
+
471
+ async function run() {
472
+ const legacyUsers = await fetchLegacyUsers();
473
+
474
+ for (const user of legacyUsers) {
475
+ await migrateUser({
476
+ email: user.email,
477
+ passwordHash: user.passwordHash,
478
+ metadata: user.metadata,
479
+ });
480
+ }
481
+
482
+ return {
483
+ migrated: legacyUsers.length,
484
+ timestamp: new Date().toISOString(),
485
+ };
486
+ }
487
+
488
+ run().then(console.log).catch(console.error);`,Co=[{id:"clerk",name:"Clerk",description:"Clerk Migration guide",docs:"https://better-auth.com/docs/migrations/clerk",logo:s.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:s.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';
489
+ import { generateRandomString, symmetricEncrypt } from "better-auth/crypto";
490
+ import { clerkClient } from '@clerk/clerk-sdk-node';
491
+ import { auth } from "@/lib/auth";
492
+ import * as fs from "node:fs/promises";
493
+
494
+ function getCSVData(csv: string) {
495
+ const lines = csv.split('\\n').filter(line => line.trim());
496
+ const headers = lines[0]?.split(',').map(header => header.trim()) || [];
497
+ const jsonData = lines.slice(1).map(line => {
498
+ const values = line.split(',').map(value => value.trim());
499
+ return headers.reduce((obj, header, index) => {
500
+ obj[header] = values[index] || '';
501
+ return obj;
502
+ }, {} as Record<string, string>);
503
+ });
504
+ return jsonData as Array<{
505
+ id: string;
506
+ first_name: string;
507
+ last_name: string;
508
+ username: string;
509
+ primary_email_address: string;
510
+ primary_phone_number: string;
511
+ verified_email_addresses: string;
512
+ unverified_email_addresses: string;
513
+ verified_phone_numbers: string;
514
+ unverified_phone_numbers: string;
515
+ totp_secret: string;
516
+ password_digest: string;
517
+ password_hasher: string;
518
+ }>;
519
+ }
520
+
521
+ async function getClerkUsers(totalUsers: number) {
522
+ const clerkUsers: any[] = [];
523
+ for (let i = 0; i < totalUsers; i += 500) {
524
+ const response = await fetch(\`https://api.clerk.com/v1/users?offset=\${i}&limit=500\`, {
525
+ headers: { Authorization: \`Bearer \${process.env.CLERK_SECRET_KEY}\` },
526
+ });
527
+ if (!response.ok) throw new Error(\`Failed to fetch users: \${response.statusText}\`);
528
+ clerkUsers.push(...((await response.json()) as any));
529
+ }
530
+ return clerkUsers;
531
+ }
532
+
533
+ export async function generateBackupCodes(secret: string) {
534
+ const backupCodes = Array.from({ length: 10 })
535
+ .map(() => generateRandomString(10, "a-z", "0-9", "A-Z"))
536
+ .map(code => \`\${code.slice(0,5)}-\${code.slice(5)}\`);
537
+ return symmetricEncrypt({ data: JSON.stringify(backupCodes), key: secret });
538
+ }
539
+
540
+ function safeDateConversion(timestamp?: number): Date {
541
+ if (!timestamp) return new Date();
542
+ const date = new Date(timestamp);
543
+ if (isNaN(date.getTime())) return new Date();
544
+ const year = date.getFullYear();
545
+ if (year < 2000 || year > 2100) return new Date();
546
+ return date;
547
+ }
548
+
549
+ async function migrateFromClerk() {
550
+ const exportedUserCSV = await fs.readFile("exported_users.csv", "utf-8");
551
+ const jsonData = getCSVData(exportedUserCSV);
552
+ const clerkUsers = await getClerkUsers(jsonData.length);
553
+
554
+ const ctx = await auth.$context;
555
+ const isAdminEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "admin");
556
+ const isTwoFactorEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "two-factor");
557
+ const isUsernameEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "username");
558
+ const isPhoneNumberEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "phone-number");
559
+
560
+ for (const user of jsonData) {
561
+ const {
562
+ id,
563
+ first_name,
564
+ last_name,
565
+ username,
566
+ primary_email_address,
567
+ primary_phone_number,
568
+ verified_email_addresses,
569
+ verified_phone_numbers,
570
+ totp_secret,
571
+ password_digest,
572
+ } = user;
573
+
574
+ const clerkUser = clerkUsers.find((item) => item?.id === id);
575
+
576
+ const createdUser = await ctx.adapter.create({
577
+ model: "user",
578
+ data: {
579
+ id,
580
+ email: primary_email_address,
581
+ emailVerified: verified_email_addresses.length > 0,
582
+ name: \`\${first_name} \${last_name}\`,
583
+ image: clerkUser?.image_url,
584
+ createdAt: safeDateConversion(clerkUser?.created_at),
585
+ updatedAt: safeDateConversion(clerkUser?.updated_at),
586
+ ...(isTwoFactorEnabled ? { twoFactorEnabled: clerkUser?.two_factor_enabled } : {}),
587
+ ...(isAdminEnabled ? {
588
+ banned: clerkUser?.banned,
589
+ banExpiresAt: clerkUser?.lockout_expires_in_seconds,
590
+ role: "user",
591
+ } : {}),
592
+ ...(isUsernameEnabled ? { username } : {}),
593
+ ...(isPhoneNumberEnabled ? {
594
+ phoneNumber: primary_phone_number,
595
+ phoneNumberVerified: verified_phone_numbers.length > 0,
596
+ } : {}),
597
+ },
598
+ forceAllowId: true,
599
+ }).catch(async () => {
600
+ return await ctx.adapter.findOne({
601
+ model: 'user',
602
+ where: [{ field: 'id', value: id }],
603
+ });
604
+ });
605
+
606
+ const externalAccounts = clerkUser?.external_accounts ?? [];
607
+ for (const externalAccount of externalAccounts) {
608
+ const {
609
+ id: externalId,
610
+ provider,
611
+ provider_user_id,
612
+ approved_scopes,
613
+ created_at,
614
+ updated_at,
615
+ } = externalAccount;
616
+
617
+ if (provider === 'credential') {
618
+ await ctx.adapter.create({
619
+ model: 'account',
620
+ data: {
621
+ id: externalId,
622
+ providerId: provider,
623
+ accountId: provider_user_id,
624
+ scope: approved_scopes,
625
+ userId: createdUser?.id,
626
+ createdAt: safeDateConversion(created_at),
627
+ updatedAt: safeDateConversion(updated_at),
628
+ password: password_digest,
629
+ },
630
+ });
631
+ } else {
632
+ await ctx.adapter.create({
633
+ model: 'account',
634
+ data: {
635
+ id: externalId,
636
+ providerId: provider.replace('oauth_', ''),
637
+ accountId: provider_user_id,
638
+ scope: approved_scopes,
639
+ userId: createdUser?.id,
640
+ createdAt: safeDateConversion(created_at),
641
+ updatedAt: safeDateConversion(updated_at),
642
+ },
643
+ forceAllowId: true,
644
+ });
645
+ }
646
+ }
647
+
648
+ if (isTwoFactorEnabled && totp_secret) {
649
+ await ctx.adapter.create({
650
+ model: 'twoFactor',
651
+ data: {
652
+ userId: createdUser?.id,
653
+ secret: totp_secret,
654
+ backupCodes: await generateBackupCodes(totp_secret),
655
+ },
656
+ });
657
+ }
658
+ }
659
+ }
660
+
661
+ migrateFromClerk()
662
+ .then(() => {
663
+ console.log('Migration completed');
664
+ process.exit(0);
665
+ })
666
+ .catch((error) => {
667
+ console.error('Migration failed:', error);
668
+ process.exit(1);
669
+ });`},{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 DF(){const[e,t]=$C(),[n,r]=m.useState(null),[a,i]=m.useState([]),[o,l]=m.useState(!1),[c,d]=m.useState(!1),[h,u]=m.useState([]),[f,p]=m.useState(""),[w,v]=m.useState(!1),[b,g]=m.useState(""),[y,x]=m.useState(wf),N=(R,ee,J,F)=>{i(K=>[...K,{id:F??`log-${Date.now()}-${Math.random()}`,type:R,message:ee,timestamp:new Date,status:J}])},j=m.useRef(new Set),k=m.useRef(new Set),S=m.useRef(new Map),M=m.useRef(null),A=()=>Co.find(R=>!R.disabled)??Co[0],I=Co.find(R=>R.id===b)??A();m.useEffect(()=>{g(w?R=>{var ee;return R||((ee=A())==null?void 0:ee.id)||""}:"")},[w,A]);const U=R=>{g(R),R!=="custom"&&x(wf)},$=async R=>{try{await navigator.clipboard.writeText(R),V.success("Copied to clipboard")}catch{V.error("Failed to copy to clipboard")}},L=R=>{switch(R.toLowerCase()){case"github":return s.jsx(IP,{className:"w-5 h-5 text-white"});case"google":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"discord":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"twitter":case"x":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"facebook":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"apple":return s.jsx(Ht,{className:"w-5 h-5 text-white"});default:return s.jsx(Ht,{className:"w-5 h-5 text-white"})}},E=()=>{M.current&&!M.current.closed&&M.current.close(),M.current=null},O=(R,ee,J,F,K)=>{let ne=S.current.get(R);ne||(ne=new Map,S.current.set(R,ne));const ce=ne.get(J);if(ce){i(ve=>ve.map(Ae=>Ae.id===ce?{...Ae,type:ee,message:F,status:K,timestamp:new Date}:Ae));return}const ge=`session-${R}-${J}-${Date.now()}`;ne.set(J,ge),N(ee,F,K,ge)},D=(R,ee,J=0)=>{j.current.has(R)||j.current.add(R),fetch(`/api/tools/oauth/status?testSessionId=${encodeURIComponent(R)}`).then(K=>K.json()).then(K=>{if(K.hasResult){j.current.delete(R),T(K.result);return}if(J+1>=15){j.current.delete(R),O(R,"error","timeout","⌛ Timed out waiting for account creation. Check Better Auth logs.","failed"),E(),r(null),V.error("OAuth test timed out waiting for account creation");return}setTimeout(()=>D(R,ee,J+1),2e3)}).catch(K=>{J+1<15?setTimeout(()=>D(R,ee,J+1),2e3):(j.current.delete(R),O(R,"error","poll-error",`⚠️ Failed to check OAuth status: ${K}`,"failed"),E(),r(null),V.error("Failed to check OAuth status"))})},T=R=>{l(!0);const ee=R.testSessionId;if(R.success){if(k.current.has(ee)&&R.userInfo)return;if(O(ee,"success","waiting","✅ Verified with Better Auth.","completed"),R.userInfo){k.current.add(ee);const J=[R.userInfo.name?`👤 ${R.userInfo.name}`:null,R.userInfo.email?`✉️ ${R.userInfo.email}`:null].filter(Boolean).join(" | "),F=J?`✅ ${R.provider} OAuth succeeded — ${J}`:`✅ ${R.provider} OAuth succeeded!`;O(ee,"success","completed",F,"completed"),O(ee,"info","timestamp",`⏰ Completed at ${new Date(R.timestamp).toLocaleTimeString()}`,"completed"),V.success(`OAuth test for ${R.provider} passed!`),E(),r(null),S.current.delete(ee)}else O(ee,"progress","await-finalize","⌛ OAuth flow finished. Waiting for Better Auth to finalize account...","running"),j.current.has(ee)||(j.current.add(ee),D(ee,R.provider))}else{if(k.current.has(ee))return;O(ee,"error","waiting","❌ Verification failed with Better Auth.","failed");const J=R.error?` — ${R.error}`:"";O(ee,"error","failed",`❌ ${R.provider} OAuth failed${J}`,"failed"),V.error(`OAuth test for ${R.provider} failed`),E(),r(null),S.current.delete(ee)}R.success||(k.current.add(ee),S.current.delete(ee)),sessionStorage.removeItem("oauth_test_session"),sessionStorage.removeItem(`oauth_test_result_${ee}`)};m.useEffect(()=>{const R=e.get("oauth_test_result");if(R)try{const ee=JSON.parse(decodeURIComponent(R));l(!0),T(ee),t({})}catch{}},[e,t,T]),m.useEffect(()=>{(async()=>{try{const J=await(await fetch("/api/tools/oauth/providers")).json();J.success&&J.providers&&u(J.providers.filter(F=>F.enabled))}catch{}})()},[]);const C=async()=>{if(h.length===0){V.error("No OAuth providers configured"),N("error","❌ No OAuth providers found in configuration","failed"),N("info","💡 Please configure at least one OAuth provider in your Better Auth config","failed");return}d(!0)},_=async R=>{d(!1),p(""),r("test-oauth"),l(!0),i([]),N("info",`🔍 Testing ${R} OAuth...`,"running");const ee=new Date().toISOString();try{N("progress","📡 Contacting Better Auth...","running");const F=await(await fetch("/api/tools/oauth/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:R})})).json();if(F.success&&F.startUrl){S.current.delete(F.testSessionId),O(F.testSessionId,"progress","popup-open",`🌐 Opening ${F.provider} OAuth popup...`,"running");const K={testSessionId:F.testSessionId,provider:F.provider,providerId:R,startTime:ee};k.current.delete(F.testSessionId),sessionStorage.setItem("oauth_test_session",JSON.stringify(K));const ne=600,ce=700,ge=(window.screen.width-ne)/2,ve=(window.screen.height-ce)/2,Ae=window.open(F.startUrl,"oauth-test",`width=${ne},height=${ce},left=${ge},top=${ve},scrollbars=yes,resizable=yes`);if(!Ae){N("error","❌ Failed to open OAuth window. Please allow popups for this site.","failed"),N("error","💡 Check your browser popup blocker settings","failed"),V.error("Failed to open OAuth window. Please allow popups."),r(null);return}M.current=Ae;let Te=!1;const tt=Oe=>{if(Oe.origin===window.location.origin){if(Oe.data&&Oe.data.type==="oauth_test_state"){if(Oe.data.status==="redirect")j.current.has(K.testSessionId)||D(K.testSessionId,K.provider);else if(Oe.data.status==="error"){Te=!0;const Ge=sessionStorage.getItem("oauth_test_session");let Je=F.provider;if(Ge)try{Je=JSON.parse(Ge).provider||Je}catch{}T({success:!1,provider:Je,testSessionId:Oe.data.testSessionId,error:Oe.data.error||"Failed to start OAuth test"}),window.removeEventListener("message",tt),clearInterval(ut),clearTimeout(Le),E()}return}if(Oe.data&&Oe.data.type==="oauth_test_result"){window.removeEventListener("message",tt),clearInterval(ut),clearTimeout(Le),Te=!0;const Ge=Oe.data.result;T(Ge),j.current.has(Ge.testSessionId)||D(Ge.testSessionId,Ge.provider),E()}}};window.addEventListener("message",tt);const ut=setInterval(()=>{Ae.closed&&(clearInterval(ut),clearTimeout(Le),window.removeEventListener("message",tt),!sessionStorage.getItem(`oauth_test_result_${K.testSessionId}`)&&!Te&&(Te=!0,D(K.testSessionId,K.provider)))},500),Le=setTimeout(()=>{Ae.closed||(clearInterval(ut),window.removeEventListener("message",tt),E(),Te||(Te=!0),N("error","❌ OAuth test timed out after 5 minutes","failed"),N("error","💡 Possible reasons:","failed"),N("error"," • Authentication took too long","failed"),N("error"," • Provider is not responding","failed"),N("error"," • Network connectivity issues","failed"),V.error("OAuth test timed out"),r(null))},5*60*1e3)}else N("error",`❌ Failed to initiate OAuth test: ${F.error||"Unknown error"}`,"failed"),F.details&&N("error",`💡 Details: ${JSON.stringify(F.details)}`,"failed"),F.cause&&N("error",`💡 Cause: ${F.cause}`,"failed"),V.error(F.error||"Failed to start OAuth test"),r(null)}catch(J){N("error",`❌ Network error: ${J}`,"failed"),V.error("Failed to start OAuth test"),r(null)}},z=()=>{v(!0)},H=async(R,ee)=>{const J=Co.find(K=>K.id===R);if(!J){V.error("Unknown migration provider");return}if(J.disabled){V.info(`${J.name} migration is coming soon`);return}v(!1),r("run-migration"),l(!0),i([]);const F=K=>new Promise(ne=>setTimeout(ne,K));try{if(N("info",`🚀 Preparing ${J.name} migration...`,"running"),J.highlights)for(const ce of J.highlights)await F(350),N("progress",ce,"running");N("progress","📡 Sending migration payload to server...","running");const ne=await(await fetch("/api/tools/migrations/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:J.id,script:J.custom?ee:J.script})})).json();if(ne.success)N("progress","🚀 Migration job acknowledged. Follow server logs for live progress.","running"),N("success",`✅ ${J.name} migration request accepted.`,"completed"),ne.message&&N("info",ne.message,"completed"),V.success(`${J.name} migration flow completed`);else throw new Error(ne.error||"Migration request failed")}catch(K){N("error",`❌ Migration failed: ${K}`,"failed"),V.error("Migration failed")}finally{r(null)}},se=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:Ht,action:C,category:"oauth"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:Hr,action:z,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:Hr,action:async()=>{r("test-db"),l(!0),i([]),N("info","Testing database connection...","running");try{const ee=await(await fetch("/api/database/test")).json();await new Promise(J=>setTimeout(J,1e3)),N("progress","Checking on database con!","running"),ee.success?(N("success","✅ Database connection successful!","completed"),ee.result&&Array.isArray(ee.result)&&ee.result.length>0&&(N("info","📄 Sample user record (first row):","completed"),N("info",JSON.stringify(ee.result[0],null,2),"completed")),V.success("Database connection test successful")):(N("error",`❌ Database connection failed: ${ee.error||"Unknown error"}`,"failed"),V.error("Database connection test failed"))}catch(R){N("error",`❌ Network error: ${R}`,"failed"),V.error("Failed to test database connection")}finally{r(null)}},category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:Ix,action:async()=>{r("validate-config"),l(!0),i([]),N("info","Validating Better Auth configuration...","running");try{await new Promise(R=>setTimeout(R,500)),N("progress","Checking database connection...","running"),await new Promise(R=>setTimeout(R,500)),N("progress","Validating plugins configuration...","running"),await new Promise(R=>setTimeout(R,500)),N("success","✅ Configuration is valid!","completed"),V.success("Configuration validated successfully")}catch(R){N("error",`❌ Configuration validation failed: ${R}`,"failed"),V.error("Configuration validation failed")}finally{r(null)}},category:"utilities"},{id:"generate-api-key",name:"Generate API Key",description:"Generate a new API key",icon:Vd,action:async()=>{r("generate-api-key"),l(!0),i([]),N("info","Generating new API key...","running");try{const ee=await(await fetch("/api/tools/generate-api-key",{method:"POST",headers:{"Content-Type":"application/json"}})).json();ee.success&&ee.apiKey?(N("success","✅ API key generated successfully!","completed"),N("info",`API Key: ${ee.apiKey}`,"completed"),V.success("API key generated successfully")):(N("error",`❌ Failed to generate API key: ${ee.error||"Unknown error"}`,"failed"),V.error("Failed to generate API key"))}catch(R){N("error",`❌ Network error: ${R}`,"failed"),V.error("Failed to generate API key")}finally{r(null)}},category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:pv,action:async()=>{r("health-check"),l(!0),i([]),N("info","Running system health check...","running");try{await new Promise(R=>setTimeout(R,500)),N("progress","Checking API endpoints...","running"),await new Promise(R=>setTimeout(R,500)),N("progress","Checking database health...","running"),await new Promise(R=>setTimeout(R,500)),N("progress","Checking plugins status...","running"),await new Promise(R=>setTimeout(R,500)),N("success","✅ System health check passed!","completed"),V.success("System health check passed")}catch(R){N("error",`❌ Health check failed: ${R}`,"failed"),V.error("Health check failed")}finally{r(null)}},category:"testing"}],Z=[{id:"oauth",name:"OAuth",icon:Ht},{id:"database",name:"Database",icon:Hr},{id:"testing",name:"Testing",icon:pv},{id:"utilities",name:"Utilities",icon:J2}].map(R=>({...R,tools:se.filter(ee=>ee.category===R.id)}));return s.jsxs("div",{className:"space-y-6 p-6 bg-black w-full min-h-screen",children:[s.jsxs("div",{className:"w-full flex flex-col",children:[s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[s.jsx(BN,{className:"w-8 h-8 text-white"}),s.jsx("h1",{className:"text-3xl font-light text-white",children:"Tools"})]}),s.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"Utility tools for managing and testing your Better Auth setup"})]}),o&&a.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 tracking-wider",children:"Tool Output"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsx(Oa,{title:"Tool Execution Logs",lines:a,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),s.jsx("div",{className:"space-y-8",children:Z.map(R=>s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(R.icon,{className:"w-5 h-5 text-white"}),s.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider",children:R.name})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:R.tools.map(ee=>{const J=ee.icon,F=n===ee.id;return s.jsxs("button",{onClick:()=>ee.action(),disabled:ee.id!=="test-oauth"&&ee.id!=="test-db"||F||n!==null,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 ${ee.id!=="test-oauth"&&ee.id!=="test-db"?"opacity-60 cursor-not-allowed":"hover:bg-black/50 disabled:opacity-50 disabled:cursor-not-allowed"}`,children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:F?s.jsx(ca,{className:"w-6 h-6 text-white animate-spin"}):s.jsx(J,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:ee.name}),s.jsxs("p",{className:"text-xs uppercase font-mono flex items-center text-gray-400",children:[s.jsx(YL,{className:"w-4 h-4 mr-2"}),ee.description]})]}),ee.id!=="test-oauth"&&ee.id!=="test-db"&&s.jsx("span",{className:"absolute top-2 right-3 text-[10px] font-mono uppercase tracking-[0.2em] text-white/60",children:"Coming Soon"}),s.jsx(ws,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]},ee.id)})})]},R.id))})]}),c&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-8 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ht,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{d(!1),p("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"space-y-4",children:h.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ht,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("p",{className:"text-gray-400 mb-2 text-lg",children:"No OAuth providers configured"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Please configure OAuth providers in your Better Auth configuration"})]}):s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-4 uppercase font-mono",children:["Available Providers (",h.length,")"]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-h-96 overflow-y-auto",children:h.map(R=>s.jsxs("button",{onClick:()=>{p(R.id),setTimeout(()=>{_(R.id)},100)},className:`w-full flex items-center space-x-4 p-4 border rounded-none transition-all text-left group ${f===R.id?"border-white/50 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/30"}`,children:[s.jsx("div",{className:"flex-shrink-0",children:L(R.id)}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-white uppercase font-mono font-light text-base",children:R.name||R.id})}),s.jsx(ws,{className:`w-5 h-5 transition-colors flex-shrink-0 ${f===R.id?"text-white":"text-gray-400 group-hover:text-white"}`})]},R.id))}),s.jsx("p",{className:"text-xs text-gray-500 mt-4 font-mono uppercase",children:"Click on a provider to start the OAuth test"})]})}),s.jsx("div",{className:"flex justify-end space-x-3 mt-8 pt-6 border-t border-dashed border-white/10",children:s.jsx(Y,{variant:"outline",onClick:()=>{d(!1),p("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"})})]})}),w&&s.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/95 border border-dashed border-white/20 p-8 w-full max-w-5xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Hr,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Select Migration"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[s.jsx("div",{className:"space-y-3",children:Co.map(R=>{const ee=(I==null?void 0:I.id)===R.id;return s.jsxs("button",{onClick:()=>U(R.id),disabled:R.disabled,className:`w-full flex items-center space-x-3 p-4 border transition-colors rounded-none text-left ${R.disabled?"border-dashed border-white/10 bg-black/30 cursor-not-allowed opacity-60":ee?"border-white/60 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/40"}`,children:[s.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/10 flex items-center justify-center",children:R.logo?R.logo:s.jsx(hv,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-white uppercase font-mono text-sm",children:R.name}),s.jsx("p",{className:"text-xs uppercase text-gray-400 font-mono mt-1 truncate",children:R.description})]}),R.disabled&&s.jsx("span",{className:"text-[10px] font-mono text-gray-400 uppercase",children:"Coming Soon"})]},R.id)})}),s.jsxs("div",{className:"md:col-span-2 space-y-4",children:[s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx("div",{className:"w-12 h-12 bg-white/10 flex items-center justify-center",children:I.logo?I.logo:s.jsx(hv,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-white -mb-2 text-lg font-light uppercase tracking-wider",children:I.name}),s.jsx("p",{className:"text-sm mt-0 text-gray-400 uppercase font-mono leading-relaxed",children:I.description}),s.jsx("div",{className:"flex items-center space-x-2",children:I.docs&&s.jsx(Y,{variant:"ghost",size:"sm",asChild:!0,className:"rounded-none border border-dashed",children:s.jsx("a",{href:I.docs,target:"_blank",rel:"noreferrer",children:"View Docs"})})})]})]}),I.highlights&&s.jsx("ul",{className:"space-y-2 text-xs text-gray-300 font-mono bg-black/40 border border-white/10 p-4",children:I.highlights.map(R=>s.jsxs("li",{className:"flex items-start space-x-2",children:[s.jsx("span",{className:"text-white/60 mt-0.5",children:"•"}),s.jsx("span",{children:R})]},R))}),I.disabled?s.jsxs("div",{className:"space-y-4 text-gray-400 font-mono text-xs",children:[s.jsx("p",{children:"This migration provider is coming soon."}),s.jsxs("p",{children:["Subscribe to updates at"," ",s.jsx("a",{href:"https://better-auth.com",target:"_blank",rel:"noreferrer",className:"text-white underline",children:"better-auth.com"}),"."]})]}):I.custom?s.jsxs("div",{className:"space-y-3",children:[s.jsx("label",{className:"text-xs uppercase font-mono text-gray-400",children:"Custom Migration Script"}),s.jsx("textarea",{value:y,onChange:R=>x(R.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"}),s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>x(wf),children:"Reset"}),s.jsxs(Y,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>$(y),children:[s.jsx(Ym,{className:"w-4 h-4"}),"Copy Script"]}),s.jsx(Y,{className:"rounded-none",onClick:()=>H("custom",y),children:"Run Custom Script"})]})]}):s.jsxs("div",{className:"space-y-3",children:[I.script&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-mono text-gray-400",children:[s.jsx("span",{children:"Migration Script Preview"}),s.jsxs(Y,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>$(I.script),children:[s.jsx(Ym,{className:"w-4 h-4"}),"Copy Script"]})]}),s.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:s.jsx("code",{children:I.script})})]}),s.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.jsxs(Y,{className:"rounded-none",onClick:()=>H(I.id),children:["Run ",I.name," Migration"]})})]})]})]})]})})]})}function TF(){const{userId:e}=Xp(),t=Mr(),[n,r]=m.useState(null),[a,i]=m.useState([]),[o,l]=m.useState([]),[c,d]=m.useState([]),[h,u]=m.useState(!0),[f,p]=m.useState("details"),[w,v]=m.useState(!1),[b,g]=m.useState(!1),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(""),[M,A]=m.useState(),[I,U]=m.useState(!1),[$,L]=m.useState([]),[E,O]=m.useState(!1),[D,T]=m.useState({}),C=m.useRef({}),_=m.useCallback(async()=>{try{const K=await(await fetch("/api/admin/status")).json();U(K.enabled)}catch{U(!1)}},[]),z=m.useCallback(async F=>{try{const K=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:F})});if(K.ok){const ne=await K.json();if(ne.success&&ne.location)return ne.location}return null}catch{return null}},[]),H=m.useCallback(async F=>{const K=F.filter(ge=>!C.current[ge.id]);if(K.length===0)return;const ne=await Promise.all(K.map(async ge=>{const ve=await z(ge.ipAddress);return ve?{sessionId:ge.id,location:ve}:null})),ce={};ne.forEach(ge=>{ge&&(ce[ge.sessionId]=ge.location)}),Object.keys(ce).length>0&&(C.current={...C.current,...ce},T(C.current))},[z]),P=F=>{if(!F)return"🌍";const K=F.toUpperCase().split("").map(ne=>127397+ne.charCodeAt(0));return String.fromCodePoint(...K)},B=m.useCallback(async()=>{try{const F=await fetch(`/api/users/${e}`);if(F.ok){const K=await F.json();r(K.user)}else V.error("Failed to fetch user details"),t("/users")}catch{V.error("Failed to fetch user details"),t("/users")}finally{u(!1)}},[e,t]),q=m.useCallback(async()=>{try{const[F,K,ne]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(F.ok){const ce=await F.json();i(ce.memberships||[])}if(K.ok){const ce=await K.json();l(ce.memberships||[])}if(ne.ok){const ge=(await ne.json()).sessions||[];d(ge),H(ge)}}catch{}},[e,H]),G=async()=>{var ce,ge;if(!n)return;const F=(ce=document.getElementById("edit-name"))==null?void 0:ce.value,K=(ge=document.getElementById("edit-email"))==null?void 0:ge.value;if(!F||!K){V.error("Please fill in all fields");return}const ne=V.loading("Updating user...");try{const Ae=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:F,email:K})})).json();Ae.success?(r({...n,name:F,email:K}),v(!1),V.success("User updated successfully!",{id:ne})):V.error(`Error updating user: ${Ae.error||"Unknown error"}`,{id:ne})}catch{V.error("Error updating user",{id:ne})}},se=async()=>{if(!n)return;if(!I){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const F=V.loading("Banning user...");try{const K=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:k||"No reason provided",banExpiresIn:M})}),ne=await K.json();K.ok?(V.success("User banned successfully!",{id:F}),g(!1),S(""),A(void 0),B()):K.status===403?V.error("You do not have permission to ban users. Admin role required.",{id:F}):ne.adminPluginEnabled&&ne.instructions?V.error(`${ne.error}`,{id:F,duration:6e3,description:`Use: ${ne.instructions.example}`}):V.error(`Error banning user: ${ne.error||ne.message||"Unknown error"}`,{id:F})}catch{V.error("Error banning user",{id:F})}},re=async()=>{if(!n)return;if(!I){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const F=V.loading("Unbanning user...");try{const K=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),ne=await K.json();K.ok?(V.success("User unbanned successfully!",{id:F}),x(!1),B()):K.status===403?V.error("You do not have permission to unban users. Admin role required.",{id:F}):ne.adminPluginEnabled&&ne.instructions?V.error(`${ne.error}`,{id:F,duration:6e3,description:`Use: ${ne.instructions.example}`}):V.error(`Error unbanning user: ${ne.error||ne.message||"Unknown error"}`,{id:F})}catch{V.error("Error unbanning user",{id:F})}},Z=async F=>{const K=V.loading("Removing user from organization...");try{const ce=await(await fetch(`/api/organizations/members/${F}`,{method:"DELETE"})).json();ce.success?(i(ge=>ge.filter(ve=>ve.id!==F)),V.success("User removed from organization!",{id:K})):V.error(`Error removing user: ${ce.error||"Unknown error"}`,{id:K})}catch{V.error("Error removing user from organization",{id:K})}},R=async F=>{const K=V.loading("Removing user from team...");try{const ce=await(await fetch(`/api/teams/members/${F}`,{method:"DELETE"})).json();ce.success?(l(ge=>ge.filter(ve=>ve.id!==F)),V.success("User removed from team!",{id:K})):V.error(`Error removing user: ${ce.error||"Unknown error"}`,{id:K})}catch{V.error("Error removing user from team",{id:K})}},ee=async F=>{const K=V.loading("Deleting session...");try{const ce=await(await fetch(`/api/sessions/${F}`,{method:"DELETE"})).json();ce.success?(d(ge=>ge.filter(ve=>ve.id!==F)),V.success("Session deleted successfully!",{id:K})):V.error(`Error deleting session: ${ce.error||"Unknown error"}`,{id:K})}catch{V.error("Error deleting session",{id:K})}};m.useEffect(()=>{e&&(B(),q(),_())},[e,_,B,q]);const J=async(F=3)=>{if(e){L([]),O(!0),L([{id:"start",type:"info",message:`Starting session seeding process for ${F} sessions...`,timestamp:new Date}]);try{const ne=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:F})})).json();if(ne.success){const ce=ne.results.map((ve,Ae)=>ve.success?{id:`session-${Ae}`,type:"progress",message:`Creating session ${Ae+1}: ${ve.session.token.substring(0,20)}... from ${ve.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${Ae}`,type:"error",message:`Failed to create session ${Ae+1}: ${ve.error}`,timestamp:new Date});L(ve=>[...ve,...ce]);const ge=ne.results.filter(ve=>ve.success).length;L(ve=>[...ve,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${ge}/${F} sessions successfully`,timestamp:new Date}]),q()}else L(ce=>[...ce,{id:"error",type:"error",message:`❌ Session seeding failed: ${ne.error||"Unknown error"}`,timestamp:new Date}])}catch(K){L(ne=>[...ne,{id:"error",type:"error",message:`❌ Network error: ${K}`,timestamp:new Date}])}finally{O(!1)}}};return h?s.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:s.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?s.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[s.jsxs("div",{className:"w-full flex flex-col",children:[s.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:s.jsxs("span",{className:"font-light",children:[s.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),s.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),s.jsx("div",{className:"mb-8 mt-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?s.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):s.jsx($c,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2 cursor-pointer hover:text-white transition-colors",onClick:()=>{navigator.clipboard.writeText(n.id),V.success("User ID copied to clipboard")},title:"Click to copy User ID",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsxs("span",{className:"text-white/80 font-mono text-xs",children:[n.id.slice(0,8),"..."]}),s.jsx("span",{className:"ml-1",children:"]"})]}),n.banned&&s.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"})]}),s.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email}),s.jsx("div",{className:"flex items-center space-x-2 mt-2",children:n.role&&s.jsxs("div",{className:"flex items-center space-x-1 px-2 py-1 rounded-sm text-xs font-mono bg-purple-500/20 text-purple-400",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-purple-500"}),s.jsx("span",{children:n.role})]})})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs(Y,{variant:"outline",onClick:()=>v(!0),className:"border border-white/20 text-white hover:bg-white/10 rounded-none",children:[s.jsx(Ca,{className:"w-4 h-4 mr-2"}),"Edit User"]}),n.banned?s.jsxs(Y,{variant:"outline",onClick:()=>x(!0),className:"border border-green-400/20 text-green-400 hover:bg-green-400/10 rounded-none",disabled:!I,children:[s.jsx(gf,{className:"w-4 h-4 mr-2"}),"Unban User"]}):s.jsxs(Y,{variant:"outline",onClick:()=>g(!0),className:"border border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",disabled:!I,children:[s.jsx(gf,{className:"w-4 h-4 mr-2"}),"Ban User"]})]})]})}),s.jsxs("div",{className:"border border-dashed border-white/10 rounded-none",children:[s.jsx("div",{className:"border-b border-dashed border-white/10",children:s.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:$c},{id:"organizations",name:"Organizations",icon:Ln,count:a.length},{id:"teams",name:"Teams",icon:Ze,count:o.length},{id:"sessions",name:"Sessions",icon:uv,count:c.length}].map(F=>s.jsxs("button",{onClick:()=>p(F.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f===F.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[s.jsx(F.icon,{className:"w-4 h-4 text-white/90"}),s.jsxs("span",{className:"inline-flex items-start",children:[s.jsx("span",{className:"",children:F.name}),F.count!==void 0&&s.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(br,{value:F.count,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},F.id))})}),s.jsxs("div",{className:"p-6",children:[f==="details"&&s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[s.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx($c,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),s.jsx("div",{className:"text-white font-sans text-sm",children:n.name.toLowerCase().replace(/\s+/g,"")})]})]}),s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(Rr,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),s.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(ZL,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),s.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(QL,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),s.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(Yn,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),s.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"})})]})]})]})]}),s.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[s.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Rr,{className:"w-4 h-4 text-gray-400"}),s.jsx("div",{children:s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),s.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"})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Hr,{className:"w-4 h-4 text-gray-400"}),s.jsx("div",{children:s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),s.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"})]})]})]})]}),f==="organizations"&&s.jsx("div",{className:"space-y-4",children:a.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ln,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),s.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):s.jsx("div",{className:"grid gap-4",children:a.map(F=>s.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[s.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:F.organization.image?s.jsx("img",{src:F.organization.image,alt:F.organization.name,className:"w-12 h-12 object-cover"}):s.jsx(Ln,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[F.organization.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:F.organization.slug}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",F.organization.slug]})]})]}),s.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),s.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(F.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(F.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>Z(F.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[s.jsx(uw,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},F.id))})}),f==="teams"&&s.jsx("div",{className:"space-y-4",children:o.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ze,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),s.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):s.jsx("div",{className:"grid gap-4",children:o.map(F=>s.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[s.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:s.jsx(Ze,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[F.team.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:F.team.organizationSlug||F.team.organizationName}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",F.team.organizationSlug||F.team.organizationName]})]})]}),s.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),s.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(F.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(F.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>R(F.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[s.jsx(uw,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},F.id))})}),f==="sessions"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),s.jsxs(Y,{variant:"outline",onClick:()=>{L([]),O(!1),j(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[s.jsx(Hr,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(uv,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),s.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):s.jsx("div",{className:"grid gap-4",children:c.map(F=>{var K,ne,ce,ge;return s.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[s.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:s.jsx(dw,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",F.id.substring(0,8),"...",s.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:F.ipAddress}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[s.jsx(KL,{className:"w-3.5 h-3.5 text-gray-400"}),s.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((K=D[F.id])==null?void 0:K.city)||"...",","," ",((ne=D[F.id])==null?void 0:ne.country)||"..."]}),((ce=D[F.id])==null?void 0:ce.countryCode)&&s.jsx("span",{className:"text-xs ml-1",children:P((ge=D[F.id])==null?void 0:ge.countryCode)})]})]})]}),s.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),s.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(F.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(F.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>ee(F.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[s.jsx(gf,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},F.id)})})]})]})]})]}),w&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.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?s.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):s.jsx($c,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),s.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),s.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"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),s.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"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[s.jsx(Y,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:G,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),b&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),s.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",s.jsx("strong",{children:n.name})," from accessing the system."]}),s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),s.jsx(Ie,{id:"banReason",value:k,onChange:F=>S(F.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),s.jsx(Ie,{id:"banExpires",type:"number",value:M||"",onChange:F=>A(F.target.value?Number(F.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{g(!1),S(""),A(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:se,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),s.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",s.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:re,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),N&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.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:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(dw,{className:"inline mr-2 w-3 h-3 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(He,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),s.jsx(Ie,{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"})]}),s.jsx(Y,{onClick:()=>{var K;const F=parseInt(((K=document.getElementById("session-count"))==null?void 0:K.value)||"3",10);J(F)},disabled:E,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?s.jsxs(s.Fragment,{children:[s.jsx(ca,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Hr,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),$.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Session Seeding Terminal",lines:$,isRunning:E,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(Y,{variant:"outline",onClick:()=>j(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):s.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:s.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function PF(){return s.jsx(W6,{children:s.jsxs(PC,{children:[s.jsx(k$,{children:s.jsxs(kC,{children:[s.jsx(nn,{path:"/",element:s.jsx(yF,{})}),s.jsx(nn,{path:"/users",element:s.jsx(ok,{})}),s.jsx(nn,{path:"/users/:userId",element:s.jsx(TF,{})}),s.jsx(nn,{path:"/organizations",element:s.jsx(ik,{})}),s.jsx(nn,{path:"/organizations/:orgId",element:s.jsx(SF,{})}),s.jsx(nn,{path:"/teams",element:s.jsx(_F,{})}),s.jsx(nn,{path:"/teams/:teamId",element:s.jsx(jw,{})}),s.jsx(nn,{path:"/organizations/:orgId/teams/:teamId",element:s.jsx(jw,{})}),s.jsx(nn,{path:"/sessions",element:s.jsx(CF,{})}),s.jsx(nn,{path:"/database",element:s.jsx(jF,{})}),s.jsx(nn,{path:"/database/demo",element:s.jsx(B6,{})}),s.jsx(nn,{path:"/tools",element:s.jsx(DF,{})}),s.jsx(nn,{path:"/settings",element:s.jsx(MF,{})})]})}),s.jsx(cE,{theme:"dark",position:"top-right",richColors:!0,closeButton:!0})]})})}yf.createRoot(document.getElementById("root")).render(s.jsx(Q.StrictMode,{children:s.jsx(PF,{})}));