181 lines
824 KiB
JavaScript
181 lines
824 KiB
JavaScript
var w3=Object.defineProperty;var xy=t=>{throw TypeError(t)};var j3=(t,n,a)=>n in t?w3(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a;var by=(t,n,a)=>j3(t,typeof n!="symbol"?n+"":n,a),vy=(t,n,a)=>n.has(t)||xy("Cannot "+a);var pn=(t,n,a)=>(vy(t,n,"read from private field"),a?a.call(t):n.get(t)),yy=(t,n,a)=>n.has(t)?xy("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,a),dp=(t,n,a,o)=>(vy(t,n,"write to private field"),o?o.call(t,a):n.set(t,a),a);function C3(t,n){for(var a=0;a<n.length;a++){const o=n[a];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in t)){const l=Object.getOwnPropertyDescriptor(o,c);l&&Object.defineProperty(t,c,l.get?l:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function s2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fp={exports:{}},Sl={};/**
|
||
* @license React
|
||
* react-jsx-runtime.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var wy;function S3(){if(wy)return Sl;wy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,c,l){var d=null;if(l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),"key"in c){l={};for(var m in c)m!=="key"&&(l[m]=c[m])}else l=c;return c=l.ref,{$$typeof:t,type:o,key:d,ref:c!==void 0?c:null,props:l}}return Sl.Fragment=n,Sl.jsx=a,Sl.jsxs=a,Sl}var jy;function N3(){return jy||(jy=1,fp.exports=S3()),fp.exports}var s=N3(),mp={exports:{}},ze={};/**
|
||
* @license React
|
||
* react.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Cy;function E3(){if(Cy)return ze;Cy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),w=Symbol.iterator;function y(O){return O===null||typeof O!="object"?null:(O=w&&O[w]||O["@@iterator"],typeof O=="function"?O:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function E(O,D,B){this.props=O,this.context=D,this.refs=N,this.updater=B||C}E.prototype.isReactComponent={},E.prototype.setState=function(O,D){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,D,"setState")},E.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function T(){}T.prototype=E.prototype;function M(O,D,B){this.props=O,this.context=D,this.refs=N,this.updater=B||C}var k=M.prototype=new T;k.constructor=M,S(k,E.prototype),k.isPureReactComponent=!0;var _=Array.isArray;function R(){}var L={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function X(O,D,B){var V=B.ref;return{$$typeof:t,type:O,key:D,ref:V!==void 0?V:null,props:B}}function I(O,D){return X(O.type,D,O.props)}function H(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function q(O){var D={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(B){return D[B]})}var ce=/\/+/g;function de(O,D){return typeof O=="object"&&O!==null&&O.key!=null?q(""+O.key):D.toString(36)}function se(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(R,R):(O.status="pending",O.then(function(D){O.status==="pending"&&(O.status="fulfilled",O.value=D)},function(D){O.status==="pending"&&(O.status="rejected",O.reason=D)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function P(O,D,B,V,Z){var be=typeof O;(be==="undefined"||be==="boolean")&&(O=null);var K=!1;if(O===null)K=!0;else switch(be){case"bigint":case"string":case"number":K=!0;break;case"object":switch(O.$$typeof){case t:case n:K=!0;break;case b:return K=O._init,P(K(O._payload),D,B,V,Z)}}if(K)return Z=Z(O),K=V===""?"."+de(O,0):V,_(Z)?(B="",K!=null&&(B=K.replace(ce,"$&/")+"/"),P(Z,D,B,"",function($){return $})):Z!=null&&(H(Z)&&(Z=I(Z,B+(Z.key==null||O&&O.key===Z.key?"":(""+Z.key).replace(ce,"$&/")+"/")+K)),D.push(Z)),1;K=0;var ge=V===""?".":V+":";if(_(O))for(var me=0;me<O.length;me++)V=O[me],be=ge+de(V,me),K+=P(V,D,B,be,Z);else if(me=y(O),typeof me=="function")for(O=me.call(O),me=0;!(V=O.next()).done;)V=V.value,be=ge+de(V,me++),K+=P(V,D,B,be,Z);else if(be==="object"){if(typeof O.then=="function")return P(se(O),D,B,V,Z);throw D=String(O),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return K}function W(O,D,B){if(O==null)return O;var V=[],Z=0;return P(O,V,"","",function(be){return D.call(B,be,Z++)}),V}function oe(O){if(O._status===-1){var D=O._result;D=D(),D.then(function(B){(O._status===0||O._status===-1)&&(O._status=1,O._result=B)},function(B){(O._status===0||O._status===-1)&&(O._status=2,O._result=B)}),O._status===-1&&(O._status=0,O._result=D)}if(O._status===1)return O._result.default;throw O._result}var ae=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},G={map:W,forEach:function(O,D,B){W(O,function(){D.apply(this,arguments)},B)},count:function(O){var D=0;return W(O,function(){D++}),D},toArray:function(O){return W(O,function(D){return D})||[]},only:function(O){if(!H(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return ze.Activity=v,ze.Children=G,ze.Component=E,ze.Fragment=a,ze.Profiler=c,ze.PureComponent=M,ze.StrictMode=o,ze.Suspense=p,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ze.__COMPILER_RUNTIME={__proto__:null,c:function(O){return L.H.useMemoCache(O)}},ze.cache=function(O){return function(){return O.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(O,D,B){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var V=S({},O.props),Z=O.key;if(D!=null)for(be in D.key!==void 0&&(Z=""+D.key),D)!ne.call(D,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&D.ref===void 0||(V[be]=D[be]);var be=arguments.length-2;if(be===1)V.children=B;else if(1<be){for(var K=Array(be),ge=0;ge<be;ge++)K[ge]=arguments[ge+2];V.children=K}return X(O.type,Z,V)},ze.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},ze.createElement=function(O,D,B){var V,Z={},be=null;if(D!=null)for(V in D.key!==void 0&&(be=""+D.key),D)ne.call(D,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(Z[V]=D[V]);var K=arguments.length-2;if(K===1)Z.children=B;else if(1<K){for(var ge=Array(K),me=0;me<K;me++)ge[me]=arguments[me+2];Z.children=ge}if(O&&O.defaultProps)for(V in K=O.defaultProps,K)Z[V]===void 0&&(Z[V]=K[V]);return X(O,be,Z)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(O){return{$$typeof:m,render:O}},ze.isValidElement=H,ze.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:oe}},ze.memo=function(O,D){return{$$typeof:g,type:O,compare:D===void 0?null:D}},ze.startTransition=function(O){var D=L.T,B={};L.T=B;try{var V=O(),Z=L.S;Z!==null&&Z(B,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(R,ae)}catch(be){ae(be)}finally{D!==null&&B.types!==null&&(D.types=B.types),L.T=D}},ze.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},ze.use=function(O){return L.H.use(O)},ze.useActionState=function(O,D,B){return L.H.useActionState(O,D,B)},ze.useCallback=function(O,D){return L.H.useCallback(O,D)},ze.useContext=function(O){return L.H.useContext(O)},ze.useDebugValue=function(){},ze.useDeferredValue=function(O,D){return L.H.useDeferredValue(O,D)},ze.useEffect=function(O,D){return L.H.useEffect(O,D)},ze.useEffectEvent=function(O){return L.H.useEffectEvent(O)},ze.useId=function(){return L.H.useId()},ze.useImperativeHandle=function(O,D,B){return L.H.useImperativeHandle(O,D,B)},ze.useInsertionEffect=function(O,D){return L.H.useInsertionEffect(O,D)},ze.useLayoutEffect=function(O,D){return L.H.useLayoutEffect(O,D)},ze.useMemo=function(O,D){return L.H.useMemo(O,D)},ze.useOptimistic=function(O,D){return L.H.useOptimistic(O,D)},ze.useReducer=function(O,D,B){return L.H.useReducer(O,D,B)},ze.useRef=function(O){return L.H.useRef(O)},ze.useState=function(O){return L.H.useState(O)},ze.useSyncExternalStore=function(O,D,B){return L.H.useSyncExternalStore(O,D,B)},ze.useTransition=function(){return L.H.useTransition()},ze.version="19.2.8",ze}var Sy;function Xh(){return Sy||(Sy=1,mp.exports=E3()),mp.exports}var f=Xh();const ve=s2(f),pi=C3({__proto__:null,default:ve},[f]);var pp={exports:{}},Nl={},hp={exports:{}},gp={};/**
|
||
* @license React
|
||
* scheduler.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Ny;function k3(){return Ny||(Ny=1,(function(t){function n(P,W){var oe=P.length;P.push(W);e:for(;0<oe;){var ae=oe-1>>>1,G=P[ae];if(0<c(G,W))P[ae]=W,P[oe]=G,oe=ae;else break e}}function a(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var W=P[0],oe=P.pop();if(oe!==W){P[0]=oe;e:for(var ae=0,G=P.length,O=G>>>1;ae<O;){var D=2*(ae+1)-1,B=P[D],V=D+1,Z=P[V];if(0>c(B,oe))V<G&&0>c(Z,B)?(P[ae]=Z,P[V]=oe,ae=V):(P[ae]=B,P[D]=oe,ae=D);else if(V<G&&0>c(Z,oe))P[ae]=Z,P[V]=oe,ae=V;else break e}}return W}function c(P,W){var oe=P.sortIndex-W.sortIndex;return oe!==0?oe:P.id-W.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var d=Date,m=d.now();t.unstable_now=function(){return d.now()-m}}var p=[],g=[],b=1,v=null,w=3,y=!1,C=!1,S=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function k(P){for(var W=a(g);W!==null;){if(W.callback===null)o(g);else if(W.startTime<=P)o(g),W.sortIndex=W.expirationTime,n(p,W);else break;W=a(g)}}function _(P){if(S=!1,k(P),!C)if(a(p)!==null)C=!0,R||(R=!0,q());else{var W=a(g);W!==null&&se(_,W.startTime-P)}}var R=!1,L=-1,ne=5,X=-1;function I(){return N?!0:!(t.unstable_now()-X<ne)}function H(){if(N=!1,R){var P=t.unstable_now();X=P;var W=!0;try{e:{C=!1,S&&(S=!1,T(L),L=-1),y=!0;var oe=w;try{t:{for(k(P),v=a(p);v!==null&&!(v.expirationTime>P&&I());){var ae=v.callback;if(typeof ae=="function"){v.callback=null,w=v.priorityLevel;var G=ae(v.expirationTime<=P);if(P=t.unstable_now(),typeof G=="function"){v.callback=G,k(P),W=!0;break t}v===a(p)&&o(p),k(P)}else o(p);v=a(p)}if(v!==null)W=!0;else{var O=a(g);O!==null&&se(_,O.startTime-P),W=!1}}break e}finally{v=null,w=oe,y=!1}W=void 0}}finally{W?q():R=!1}}}var q;if(typeof M=="function")q=function(){M(H)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,de=ce.port2;ce.port1.onmessage=H,q=function(){de.postMessage(null)}}else q=function(){E(H,0)};function se(P,W){L=E(function(){P(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(P){switch(w){case 1:case 2:case 3:var W=3;break;default:W=w}var oe=w;w=W;try{return P()}finally{w=oe}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(P,W){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var oe=w;w=P;try{return W()}finally{w=oe}},t.unstable_scheduleCallback=function(P,W,oe){var ae=t.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ae+oe:ae):oe=ae,P){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=oe+G,P={id:b++,callback:W,priorityLevel:P,startTime:oe,expirationTime:G,sortIndex:-1},oe>ae?(P.sortIndex=oe,n(g,P),a(p)===null&&P===a(g)&&(S?(T(L),L=-1):S=!0,se(_,oe-ae))):(P.sortIndex=G,n(p,P),C||y||(C=!0,R||(R=!0,q()))),P},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(P){var W=w;return function(){var oe=w;w=W;try{return P.apply(this,arguments)}finally{w=oe}}}})(gp)),gp}var Ey;function T3(){return Ey||(Ey=1,hp.exports=k3()),hp.exports}var xp={exports:{}},hn={};/**
|
||
* @license React
|
||
* react-dom.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var ky;function M3(){if(ky)return hn;ky=1;var t=Xh();function n(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},c=Symbol.for("react.portal");function l(p,g,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:v==null?null:""+v,children:p,containerInfo:g,implementation:b}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,hn.createPortal=function(p,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(n(299));return l(p,g,null,b)},hn.flushSync=function(p){var g=d.T,b=o.p;try{if(d.T=null,o.p=2,p)return p()}finally{d.T=g,o.p=b,o.d.f()}},hn.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(p,g))},hn.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},hn.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var b=g.as,v=m(b,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,y=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?o.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:w,fetchPriority:y}):b==="script"&&o.d.X(p,{crossOrigin:v,integrity:w,fetchPriority:y,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},hn.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=m(g.as,g.crossOrigin);o.d.M(p,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(p)},hn.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,v=m(b,g.crossOrigin);o.d.L(p,b,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},hn.preloadModule=function(p,g){if(typeof p=="string")if(g){var b=m(g.as,g.crossOrigin);o.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(p)},hn.requestFormReset=function(p){o.d.r(p)},hn.unstable_batchedUpdates=function(p,g){return p(g)},hn.useFormState=function(p,g,b){return d.H.useFormState(p,g,b)},hn.useFormStatus=function(){return d.H.useHostTransitionStatus()},hn.version="19.2.8",hn}var Ty;function o2(){if(Ty)return xp.exports;Ty=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),xp.exports=M3(),xp.exports}/**
|
||
* @license React
|
||
* react-dom-client.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var My;function R3(){if(My)return Nl;My=1;var t=T3(),n=Xh(),a=o2();function o(e){var r="https://react.dev/errors/"+e;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var r=e,i=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(i=r.return),e=r.return;while(e)}return r.tag===3?i:null}function d(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function m(e){if(e.tag===31){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function p(e){if(l(e)!==e)throw Error(o(188))}function g(e){var r=e.alternate;if(!r){if(r=l(e),r===null)throw Error(o(188));return r!==e?null:e}for(var i=e,u=r;;){var h=i.return;if(h===null)break;var x=h.alternate;if(x===null){if(u=h.return,u!==null){i=u;continue}break}if(h.child===x.child){for(x=h.child;x;){if(x===i)return p(h),e;if(x===u)return p(h),r;x=x.sibling}throw Error(o(188))}if(i.return!==u.return)i=h,u=x;else{for(var j=!1,A=h.child;A;){if(A===i){j=!0,i=h,u=x;break}if(A===u){j=!0,u=h,i=x;break}A=A.sibling}if(!j){for(A=x.child;A;){if(A===i){j=!0,i=x,u=h;break}if(A===u){j=!0,u=x,i=h;break}A=A.sibling}if(!j)throw Error(o(189))}}if(i.alternate!==u)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:r}function b(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e;for(e=e.child;e!==null;){if(r=b(e),r!==null)return r;e=e.sibling}return null}var v=Object.assign,w=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),M=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case _:return"Suspense";case R:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case M:return e.displayName||"Context";case T:return(e._context.displayName||"Context")+".Consumer";case k:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return r=e.displayName||null,r!==null?r:de(e.type)||"Memo";case ne:r=e._payload,e=e._init;try{return de(e(r))}catch{}}return null}var se=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},ae=[],G=-1;function O(e){return{current:e}}function D(e){0>G||(e.current=ae[G],ae[G]=null,G--)}function B(e,r){G++,ae[G]=e.current,e.current=r}var V=O(null),Z=O(null),be=O(null),K=O(null);function ge(e,r){switch(B(be,r),B(Z,e),B(V,null),r.nodeType){case 9:case 11:e=(e=r.documentElement)&&(e=e.namespaceURI)?Bv(e):0;break;default:if(e=r.tagName,r=r.namespaceURI)r=Bv(r),e=$v(r,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(V),B(V,e)}function me(){D(V),D(Z),D(be)}function $(e){e.memoizedState!==null&&B(K,e);var r=V.current,i=$v(r,e.type);r!==i&&(B(Z,e),B(V,i))}function ie(e){Z.current===e&&(D(V),D(Z)),K.current===e&&(D(K),yl._currentValue=oe)}var ye,Se;function Be(e){if(ye===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);ye=r&&r[1]||"",Se=-1<i.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+ye+e+Se}var Ke=!1;function We(e,r){if(!e||Ke)return"";Ke=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(re){var ee=re}Reflect.construct(e,[],he)}else{try{he.call()}catch(re){ee=re}e.call(he.prototype)}}else{try{throw Error()}catch(re){ee=re}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(re){if(re&&ee&&typeof re.stack=="string")return[re.stack,ee.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),j=x[0],A=x[1];if(j&&A){var z=j.split(`
|
||
`),J=A.split(`
|
||
`);for(h=u=0;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;for(;h<J.length&&!J[h].includes("DetermineComponentFrameRoot");)h++;if(u===z.length||h===J.length)for(u=z.length-1,h=J.length-1;1<=u&&0<=h&&z[u]!==J[h];)h--;for(;1<=u&&0<=h;u--,h--)if(z[u]!==J[h]){if(u!==1||h!==1)do if(u--,h--,0>h||z[u]!==J[h]){var le=`
|
||
`+z[u].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=u&&0<=h);break}}}finally{Ke=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Be(i):""}function qt(e,r){switch(e.tag){case 26:case 27:case 5:return Be(e.type);case 16:return Be("Lazy");case 13:return e.child!==r&&r!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return We(e.type,!1);case 11:return We(e.type.render,!1);case 1:return We(e.type,!0);case 31:return Be("Activity");default:return""}}function vn(e){try{var r="",i=null;do r+=qt(e,i),i=e,e=e.return;while(e);return r}catch(u){return`
|
||
Error generating stack: `+u.message+`
|
||
`+u.stack}}var Xn=Object.prototype.hasOwnProperty,br=t.unstable_scheduleCallback,yn=t.unstable_cancelCallback,wn=t.unstable_shouldYield,Zn=t.unstable_requestPaint,Kt=t.unstable_now,po=t.unstable_getCurrentPriorityLevel,Pt=t.unstable_ImmediatePriority,Qn=t.unstable_UserBlockingPriority,Da=t.unstable_NormalPriority,Es=t.unstable_LowPriority,qr=t.unstable_IdlePriority,ho=t.log,Kr=t.unstable_setDisableYieldValue,Dn=null,yt=null;function On(e){if(typeof ho=="function"&&Kr(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Dn,e)}catch{}}var Rt=Math.clz32?Math.clz32:go,Ai=Math.log,_i=Math.LN2;function go(e){return e>>>=0,e===0?32:31-(Ai(e)/_i|0)|0}var Wr=256,Oa=262144,Ar=4194304;function Wt(e){var r=e&42;if(r!==0)return r;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function La(e,r,i){var u=e.pendingLanes;if(u===0)return 0;var h=0,x=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var A=u&134217727;return A!==0?(u=A&~x,u!==0?h=Wt(u):(j&=A,j!==0?h=Wt(j):i||(i=A&~e,i!==0&&(h=Wt(i))))):(A=u&~x,A!==0?h=Wt(A):j!==0?h=Wt(j):i||(i=u&~e,i!==0&&(h=Wt(i)))),h===0?0:r!==0&&r!==h&&(r&x)===0&&(x=h&-h,i=r&-r,x>=i||x===32&&(i&4194048)!==0)?r:h}function De(e,r){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&r)===0}function rt(e,r){switch(e){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lt(){var e=Ar;return Ar<<=1,(Ar&62914560)===0&&(Ar=4194304),e}function rn(e){for(var r=[],i=0;31>i;i++)r.push(e);return r}function It(e,r){e.pendingLanes|=r,r!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Jn(e,r,i,u,h,x){var j=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var A=e.entanglements,z=e.expirationTimes,J=e.hiddenUpdates;for(i=j&~i;0<i;){var le=31-Rt(i),he=1<<le;A[le]=0,z[le]=-1;var ee=J[le];if(ee!==null)for(J[le]=null,le=0;le<ee.length;le++){var re=ee[le];re!==null&&(re.lane&=-536870913)}i&=~he}u!==0&&er(e,u,0),x!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=x&~(j&~r))}function er(e,r,i){e.pendingLanes|=r,e.suspendedLanes&=~r;var u=31-Rt(r);e.entangledLanes|=r,e.entanglements[u]=e.entanglements[u]|1073741824|i&261930}function bt(e,r){var i=e.entangledLanes|=r;for(e=e.entanglements;i;){var u=31-Rt(i),h=1<<u;h&r|e[u]&r&&(e[u]|=r),i&=~h}}function Ln(e,r){var i=r&-r;return i=(i&42)!==0?1:Di(i),(i&(e.suspendedLanes|r))!==0?0:i}function Di(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Oi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Li(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:uy(e.type))}function zi(e,r){var i=W.p;try{return W.p=e,r()}finally{W.p=i}}var Y=Math.random().toString(36).slice(2),te="__reactFiber$"+Y,je="__reactProps$"+Y,we="__reactContainer$"+Y,Le="__reactEvents$"+Y,Xe="__reactListeners$"+Y,vt="__reactHandles$"+Y,gt="__reactResources$"+Y,jn="__reactMarker$"+Y;function mn(e){delete e[te],delete e[je],delete e[Le],delete e[Xe],delete e[vt]}function an(e){var r=e[te];if(r)return r;for(var i=e.parentNode;i;){if(r=i[we]||i[te]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(e=Kv(e);e!==null;){if(i=e[te])return i;e=Kv(e)}return r}e=i,i=e.parentNode}return null}function tr(e){if(e=e[te]||e[we]){var r=e.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return e}return null}function _r(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e.stateNode;throw Error(o(33))}function Xr(e){var r=e[gt];return r||(r=e[gt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Xt(e){e[jn]=!0}var Tx=new Set,Mx={};function ks(e,r){xo(e,r),xo(e+"Capture",r)}function xo(e,r){for(Mx[e]=r,e=0;e<r.length;e++)Tx.add(r[e])}var f5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Rx={},Ax={};function m5(e){return Xn.call(Ax,e)?!0:Xn.call(Rx,e)?!1:f5.test(e)?Ax[e]=!0:(Rx[e]=!0,!1)}function hc(e,r,i){if(m5(r))if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){e.removeAttribute(r);return}}e.setAttribute(r,""+i)}}function gc(e,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttribute(r,""+i)}}function Zr(e,r,i,u){if(u===null)e.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(r,i,""+u)}}function nr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _x(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function p5(e,r,i){var u=Object.getOwnPropertyDescriptor(e.constructor.prototype,r);if(!e.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,x=u.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return h.call(this)},set:function(j){i=""+j,x.call(this,j)}}),Object.defineProperty(e,r,{enumerable:u.enumerable}),{getValue:function(){return i},setValue:function(j){i=""+j},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function rf(e){if(!e._valueTracker){var r=_x(e)?"checked":"value";e._valueTracker=p5(e,r,""+e[r])}}function Dx(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var i=r.getValue(),u="";return e&&(u=_x(e)?e.checked?"true":"false":e.value),e=u,e!==i?(r.setValue(e),!0):!1}function xc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var h5=/[\n"\\]/g;function rr(e){return e.replace(h5,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function af(e,r,i,u,h,x,j,A){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),r!=null?j==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+nr(r)):e.value!==""+nr(r)&&(e.value=""+nr(r)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),r!=null?sf(e,j,nr(r)):i!=null?sf(e,j,nr(i)):u!=null&&e.removeAttribute("value"),h==null&&x!=null&&(e.defaultChecked=!!x),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.name=""+nr(A):e.removeAttribute("name")}function Ox(e,r,i,u,h,x,j,A){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.type=x),r!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||r!=null)){rf(e);return}i=i!=null?""+nr(i):"",r=r!=null?""+nr(r):i,A||r===e.value||(e.value=r),e.defaultValue=r}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,e.checked=A?e.checked:!!u,e.defaultChecked=!!u,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j),rf(e)}function sf(e,r,i){r==="number"&&xc(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function bo(e,r,i,u){if(e=e.options,r){r={};for(var h=0;h<i.length;h++)r["$"+i[h]]=!0;for(i=0;i<e.length;i++)h=r.hasOwnProperty("$"+e[i].value),e[i].selected!==h&&(e[i].selected=h),h&&u&&(e[i].defaultSelected=!0)}else{for(i=""+nr(i),r=null,h=0;h<e.length;h++){if(e[h].value===i){e[h].selected=!0,u&&(e[h].defaultSelected=!0);return}r!==null||e[h].disabled||(r=e[h])}r!==null&&(r.selected=!0)}}function Lx(e,r,i){if(r!=null&&(r=""+nr(r),r!==e.value&&(e.value=r),i==null)){e.defaultValue!==r&&(e.defaultValue=r);return}e.defaultValue=i!=null?""+nr(i):""}function zx(e,r,i,u){if(r==null){if(u!=null){if(i!=null)throw Error(o(92));if(se(u)){if(1<u.length)throw Error(o(93));u=u[0]}i=u}i==null&&(i=""),r=i}i=nr(r),e.defaultValue=i,u=e.textContent,u===i&&u!==""&&u!==null&&(e.value=u),rf(e)}function vo(e,r){if(r){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=r;return}}e.textContent=r}var g5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Px(e,r,i){var u=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?u?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="":u?e.setProperty(r,i):typeof i!="number"||i===0||g5.has(r)?r==="float"?e.cssFloat=i:e[r]=(""+i).trim():e[r]=i+"px"}function Ix(e,r,i){if(r!=null&&typeof r!="object")throw Error(o(62));if(e=e.style,i!=null){for(var u in i)!i.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?e.setProperty(u,""):u==="float"?e.cssFloat="":e[u]="");for(var h in r)u=r[h],r.hasOwnProperty(h)&&i[h]!==u&&Px(e,h,u)}else for(var x in r)r.hasOwnProperty(x)&&Px(e,x,r[x])}function of(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var x5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),b5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bc(e){return b5.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qr(){}var lf=null;function cf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yo=null,wo=null;function Ux(e){var r=tr(e);if(r&&(e=r.stateNode)){var i=e[je]||null;e:switch(e=r.stateNode,r.type){case"input":if(af(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+rr(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var u=i[r];if(u!==e&&u.form===e.form){var h=u[je]||null;if(!h)throw Error(o(90));af(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<i.length;r++)u=i[r],u.form===e.form&&Dx(u)}break e;case"textarea":Lx(e,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&bo(e,!!i.multiple,r,!1)}}}var uf=!1;function Bx(e,r,i){if(uf)return e(r,i);uf=!0;try{var u=e(r);return u}finally{if(uf=!1,(yo!==null||wo!==null)&&(su(),yo&&(r=yo,e=wo,wo=yo=null,Ux(r),e)))for(r=0;r<e.length;r++)Ux(e[r])}}function Pi(e,r){var i=e.stateNode;if(i===null)return null;var u=i[je]||null;if(u===null)return null;i=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,r,typeof i));return i}var Jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),df=!1;if(Jr)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){df=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{df=!1}var za=null,ff=null,vc=null;function $x(){if(vc)return vc;var e,r=ff,i=r.length,u,h="value"in za?za.value:za.textContent,x=h.length;for(e=0;e<i&&r[e]===h[e];e++);var j=i-e;for(u=1;u<=j&&r[i-u]===h[x-u];u++);return vc=h.slice(e,1<u?1-u:void 0)}function yc(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function wc(){return!0}function Hx(){return!1}function Cn(e){function r(i,u,h,x,j){this._reactName=i,this._targetInst=h,this.type=u,this.nativeEvent=x,this.target=j,this.currentTarget=null;for(var A in e)e.hasOwnProperty(A)&&(i=e[A],this[A]=i?i(x):x[A]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?wc:Hx,this.isPropagationStopped=Hx,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=wc)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=wc)},persist:function(){},isPersistent:wc}),r}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jc=Cn(Ts),Ui=v({},Ts,{view:0,detail:0}),v5=Cn(Ui),mf,pf,Bi,Cc=v({},Ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gf,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!==Bi&&(Bi&&e.type==="mousemove"?(mf=e.screenX-Bi.screenX,pf=e.screenY-Bi.screenY):pf=mf=0,Bi=e),mf)},movementY:function(e){return"movementY"in e?e.movementY:pf}}),Gx=Cn(Cc),y5=v({},Cc,{dataTransfer:0}),w5=Cn(y5),j5=v({},Ui,{relatedTarget:0}),hf=Cn(j5),C5=v({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),S5=Cn(C5),N5=v({},Ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),E5=Cn(N5),k5=v({},Ts,{data:0}),Vx=Cn(k5),T5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M5={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"},R5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function A5(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=R5[e])?!!r[e]:!1}function gf(){return A5}var _5=v({},Ui,{key:function(e){if(e.key){var r=T5[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=yc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?M5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gf,charCode:function(e){return e.type==="keypress"?yc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),D5=Cn(_5),O5=v({},Cc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fx=Cn(O5),L5=v({},Ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gf}),z5=Cn(L5),P5=v({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),I5=Cn(P5),U5=v({},Cc,{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}),B5=Cn(U5),$5=v({},Ts,{newState:0,oldState:0}),H5=Cn($5),G5=[9,13,27,32],xf=Jr&&"CompositionEvent"in window,$i=null;Jr&&"documentMode"in document&&($i=document.documentMode);var V5=Jr&&"TextEvent"in window&&!$i,Yx=Jr&&(!xf||$i&&8<$i&&11>=$i),qx=" ",Kx=!1;function Wx(e,r){switch(e){case"keyup":return G5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jo=!1;function F5(e,r){switch(e){case"compositionend":return Xx(r);case"keypress":return r.which!==32?null:(Kx=!0,qx);case"textInput":return e=r.data,e===qx&&Kx?null:e;default:return null}}function Y5(e,r){if(jo)return e==="compositionend"||!xf&&Wx(e,r)?(e=$x(),vc=ff=za=null,jo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Yx&&r.locale!=="ko"?null:r.data;default:return null}}var q5={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 Zx(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!q5[e.type]:r==="textarea"}function Qx(e,r,i,u){yo?wo?wo.push(u):wo=[u]:yo=u,r=fu(r,"onChange"),0<r.length&&(i=new jc("onChange","change",null,i,u),e.push({event:i,listeners:r}))}var Hi=null,Gi=null;function K5(e){Ov(e,0)}function Sc(e){var r=_r(e);if(Dx(r))return e}function Jx(e,r){if(e==="change")return r}var e1=!1;if(Jr){var bf;if(Jr){var vf="oninput"in document;if(!vf){var t1=document.createElement("div");t1.setAttribute("oninput","return;"),vf=typeof t1.oninput=="function"}bf=vf}else bf=!1;e1=bf&&(!document.documentMode||9<document.documentMode)}function n1(){Hi&&(Hi.detachEvent("onpropertychange",r1),Gi=Hi=null)}function r1(e){if(e.propertyName==="value"&&Sc(Gi)){var r=[];Qx(r,Gi,e,cf(e)),Bx(K5,r)}}function W5(e,r,i){e==="focusin"?(n1(),Hi=r,Gi=i,Hi.attachEvent("onpropertychange",r1)):e==="focusout"&&n1()}function X5(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sc(Gi)}function Z5(e,r){if(e==="click")return Sc(r)}function Q5(e,r){if(e==="input"||e==="change")return Sc(r)}function J5(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var zn=typeof Object.is=="function"?Object.is:J5;function Vi(e,r){if(zn(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var i=Object.keys(e),u=Object.keys(r);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var h=i[u];if(!Xn.call(r,h)||!zn(e[h],r[h]))return!1}return!0}function a1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function s1(e,r){var i=a1(e);e=0;for(var u;i;){if(i.nodeType===3){if(u=e+i.textContent.length,e<=r&&u>=r)return{node:i,offset:r-e};e=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=a1(i)}}function o1(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?o1(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function i1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var r=xc(e.document);r instanceof e.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)e=r.contentWindow;else break;r=xc(e.document)}return r}function yf(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}var e4=Jr&&"documentMode"in document&&11>=document.documentMode,Co=null,wf=null,Fi=null,jf=!1;function l1(e,r,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;jf||Co==null||Co!==xc(u)||(u=Co,"selectionStart"in u&&yf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Fi&&Vi(Fi,u)||(Fi=u,u=fu(wf,"onSelect"),0<u.length&&(r=new jc("onSelect","select",null,r,i),e.push({event:r,listeners:u}),r.target=Co)))}function Ms(e,r){var i={};return i[e.toLowerCase()]=r.toLowerCase(),i["Webkit"+e]="webkit"+r,i["Moz"+e]="moz"+r,i}var So={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},Cf={},c1={};Jr&&(c1=document.createElement("div").style,"AnimationEvent"in window||(delete So.animationend.animation,delete So.animationiteration.animation,delete So.animationstart.animation),"TransitionEvent"in window||delete So.transitionend.transition);function Rs(e){if(Cf[e])return Cf[e];if(!So[e])return e;var r=So[e],i;for(i in r)if(r.hasOwnProperty(i)&&i in c1)return Cf[e]=r[i];return e}var u1=Rs("animationend"),d1=Rs("animationiteration"),f1=Rs("animationstart"),t4=Rs("transitionrun"),n4=Rs("transitionstart"),r4=Rs("transitioncancel"),m1=Rs("transitionend"),p1=new Map,Sf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Sf.push("scrollEnd");function vr(e,r){p1.set(e,r),ks(r,[e])}var Nc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ar=[],No=0,Nf=0;function Ec(){for(var e=No,r=Nf=No=0;r<e;){var i=ar[r];ar[r++]=null;var u=ar[r];ar[r++]=null;var h=ar[r];ar[r++]=null;var x=ar[r];if(ar[r++]=null,u!==null&&h!==null){var j=u.pending;j===null?h.next=h:(h.next=j.next,j.next=h),u.pending=h}x!==0&&h1(i,h,x)}}function kc(e,r,i,u){ar[No++]=e,ar[No++]=r,ar[No++]=i,ar[No++]=u,Nf|=u,e.lanes|=u,e=e.alternate,e!==null&&(e.lanes|=u)}function Ef(e,r,i,u){return kc(e,r,i,u),Tc(e)}function As(e,r){return kc(e,null,null,r),Tc(e)}function h1(e,r,i){e.lanes|=i;var u=e.alternate;u!==null&&(u.lanes|=i);for(var h=!1,x=e.return;x!==null;)x.childLanes|=i,u=x.alternate,u!==null&&(u.childLanes|=i),x.tag===22&&(e=x.stateNode,e===null||e._visibility&1||(h=!0)),e=x,x=x.return;return e.tag===3?(x=e.stateNode,h&&r!==null&&(h=31-Rt(i),e=x.hiddenUpdates,u=e[h],u===null?e[h]=[r]:u.push(r),r.lane=i|536870912),x):null}function Tc(e){if(50<ml)throw ml=0,Lm=null,Error(o(185));for(var r=e.return;r!==null;)e=r,r=e.return;return e.tag===3?e.stateNode:null}var Eo={};function a4(e,r,i,u){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pn(e,r,i,u){return new a4(e,r,i,u)}function kf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ea(e,r){var i=e.alternate;return i===null?(i=Pn(e.tag,r,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=r,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,r=e.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function g1(e,r){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=r,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,r=i.dependencies,e.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),e}function Mc(e,r,i,u,h,x){var j=0;if(u=e,typeof e=="function")kf(e)&&(j=1);else if(typeof e=="string")j=c3(e,i,V.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case X:return e=Pn(31,i,r,h),e.elementType=X,e.lanes=x,e;case S:return _s(i.children,h,x,r);case N:j=8,h|=24;break;case E:return e=Pn(12,i,r,h|2),e.elementType=E,e.lanes=x,e;case _:return e=Pn(13,i,r,h),e.elementType=_,e.lanes=x,e;case R:return e=Pn(19,i,r,h),e.elementType=R,e.lanes=x,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case M:j=10;break e;case T:j=9;break e;case k:j=11;break e;case L:j=14;break e;case ne:j=16,u=null;break e}j=29,i=Error(o(130,e===null?"null":typeof e,"")),u=null}return r=Pn(j,i,r,h),r.elementType=e,r.type=u,r.lanes=x,r}function _s(e,r,i,u){return e=Pn(7,e,u,r),e.lanes=i,e}function Tf(e,r,i){return e=Pn(6,e,null,r),e.lanes=i,e}function x1(e){var r=Pn(18,null,null,0);return r.stateNode=e,r}function Mf(e,r,i){return r=Pn(4,e.children!==null?e.children:[],e.key,r),r.lanes=i,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}var b1=new WeakMap;function sr(e,r){if(typeof e=="object"&&e!==null){var i=b1.get(e);return i!==void 0?i:(r={value:e,source:r,stack:vn(r)},b1.set(e,r),r)}return{value:e,source:r,stack:vn(r)}}var ko=[],To=0,Rc=null,Yi=0,or=[],ir=0,Pa=null,Dr=1,Or="";function ta(e,r){ko[To++]=Yi,ko[To++]=Rc,Rc=e,Yi=r}function v1(e,r,i){or[ir++]=Dr,or[ir++]=Or,or[ir++]=Pa,Pa=e;var u=Dr;e=Or;var h=32-Rt(u)-1;u&=~(1<<h),i+=1;var x=32-Rt(r)+h;if(30<x){var j=h-h%5;x=(u&(1<<j)-1).toString(32),u>>=j,h-=j,Dr=1<<32-Rt(r)+h|i<<h|u,Or=x+e}else Dr=1<<x|i<<h|u,Or=e}function Rf(e){e.return!==null&&(ta(e,1),v1(e,1,0))}function Af(e){for(;e===Rc;)Rc=ko[--To],ko[To]=null,Yi=ko[--To],ko[To]=null;for(;e===Pa;)Pa=or[--ir],or[ir]=null,Or=or[--ir],or[ir]=null,Dr=or[--ir],or[ir]=null}function y1(e,r){or[ir++]=Dr,or[ir++]=Or,or[ir++]=Pa,Dr=r.id,Or=r.overflow,Pa=e}var sn=null,wt=null,tt=!1,Ia=null,lr=!1,_f=Error(o(519));function Ua(e){var r=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qi(sr(r,e)),_f}function w1(e){var r=e.stateNode,i=e.type,u=e.memoizedProps;switch(r[te]=e,r[je]=u,i){case"dialog":Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":case"embed":Ve("load",r);break;case"video":case"audio":for(i=0;i<hl.length;i++)Ve(hl[i],r);break;case"source":Ve("error",r);break;case"img":case"image":case"link":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"input":Ve("invalid",r),Ox(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ve("invalid",r);break;case"textarea":Ve("invalid",r),zx(r,u.value,u.defaultValue,u.children)}i=u.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||u.suppressHydrationWarning===!0||Iv(r.textContent,i)?(u.popover!=null&&(Ve("beforetoggle",r),Ve("toggle",r)),u.onScroll!=null&&Ve("scroll",r),u.onScrollEnd!=null&&Ve("scrollend",r),u.onClick!=null&&(r.onclick=Qr),r=!0):r=!1,r||Ua(e,!0)}function j1(e){for(sn=e.return;sn;)switch(sn.tag){case 5:case 31:case 13:lr=!1;return;case 27:case 3:lr=!0;return;default:sn=sn.return}}function Mo(e){if(e!==sn)return!1;if(!tt)return j1(e),tt=!0,!1;var r=e.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Xm(e.type,e.memoizedProps)),i=!i),i&&wt&&Ua(e),j1(e),r===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));wt=qv(e)}else if(r===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));wt=qv(e)}else r===27?(r=wt,Ja(e.type)?(e=tp,tp=null,wt=e):wt=r):wt=sn?ur(e.stateNode.nextSibling):null;return!0}function Ds(){wt=sn=null,tt=!1}function Df(){var e=Ia;return e!==null&&(kn===null?kn=e:kn.push.apply(kn,e),Ia=null),e}function qi(e){Ia===null?Ia=[e]:Ia.push(e)}var Of=O(null),Os=null,na=null;function Ba(e,r,i){B(Of,r._currentValue),r._currentValue=i}function ra(e){e._currentValue=Of.current,D(Of)}function Lf(e,r,i){for(;e!==null;){var u=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),e===i)break;e=e.return}}function zf(e,r,i,u){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var x=h.dependencies;if(x!==null){var j=h.child;x=x.firstContext;e:for(;x!==null;){var A=x;x=h;for(var z=0;z<r.length;z++)if(A.context===r[z]){x.lanes|=i,A=x.alternate,A!==null&&(A.lanes|=i),Lf(x.return,i,e),u||(j=null);break e}x=A.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(o(341));j.lanes|=i,x=j.alternate,x!==null&&(x.lanes|=i),Lf(j,i,e),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===e){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function Ro(e,r,i,u){e=null;for(var h=r,x=!1;h!==null;){if(!x){if((h.flags&524288)!==0)x=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(o(387));if(j=j.memoizedProps,j!==null){var A=h.type;zn(h.pendingProps.value,j.value)||(e!==null?e.push(A):e=[A])}}else if(h===K.current){if(j=h.alternate,j===null)throw Error(o(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(yl):e=[yl])}h=h.return}e!==null&&zf(r,e,i,u),r.flags|=262144}function Ac(e){for(e=e.firstContext;e!==null;){if(!zn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ls(e){Os=e,na=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return C1(Os,e)}function _c(e,r){return Os===null&&Ls(e),C1(e,r)}function C1(e,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},na===null){if(e===null)throw Error(o(308));na=r,e.dependencies={lanes:0,firstContext:r},e.flags|=524288}else na=na.next=r;return i}var s4=typeof AbortController<"u"?AbortController:function(){var e=[],r=this.signal={aborted:!1,addEventListener:function(i,u){e.push(u)}};this.abort=function(){r.aborted=!0,e.forEach(function(i){return i()})}},o4=t.unstable_scheduleCallback,i4=t.unstable_NormalPriority,Ut={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pf(){return{controller:new s4,data:new Map,refCount:0}}function Ki(e){e.refCount--,e.refCount===0&&o4(i4,function(){e.controller.abort()})}var Wi=null,If=0,Ao=0,_o=null;function l4(e,r){if(Wi===null){var i=Wi=[];If=0,Ao=$m(),_o={status:"pending",value:void 0,then:function(u){i.push(u)}}}return If++,r.then(S1,S1),r}function S1(){if(--If===0&&Wi!==null){_o!==null&&(_o.status="fulfilled");var e=Wi;Wi=null,Ao=0,_o=null;for(var r=0;r<e.length;r++)(0,e[r])()}}function c4(e,r){var i=[],u={status:"pending",value:null,reason:null,then:function(h){i.push(h)}};return e.then(function(){u.status="fulfilled",u.value=r;for(var h=0;h<i.length;h++)(0,i[h])(r)},function(h){for(u.status="rejected",u.reason=h,h=0;h<i.length;h++)(0,i[h])(void 0)}),u}var N1=P.S;P.S=function(e,r){lv=Kt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&l4(e,r),N1!==null&&N1(e,r)};var zs=O(null);function Uf(){var e=zs.current;return e!==null?e:xt.pooledCache}function Dc(e,r){r===null?B(zs,zs.current):B(zs,r.pool)}function E1(){var e=Uf();return e===null?null:{parent:Ut._currentValue,pool:e}}var Do=Error(o(460)),Bf=Error(o(474)),Oc=Error(o(542)),Lc={then:function(){}};function k1(e){return e=e.status,e==="fulfilled"||e==="rejected"}function T1(e,r,i){switch(i=e[i],i===void 0?e.push(r):i!==r&&(r.then(Qr,Qr),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,R1(e),e;default:if(typeof r.status=="string")r.then(Qr,Qr);else{if(e=xt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=r,e.status="pending",e.then(function(u){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=u}},function(u){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,R1(e),e}throw Is=r,Do}}function Ps(e){try{var r=e._init;return r(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Is=i,Do):i}}var Is=null;function M1(){if(Is===null)throw Error(o(459));var e=Is;return Is=null,e}function R1(e){if(e===Do||e===Oc)throw Error(o(483))}var Oo=null,Xi=0;function zc(e){var r=Xi;return Xi+=1,Oo===null&&(Oo=[]),T1(Oo,e,r)}function Zi(e,r){r=r.props.ref,e.ref=r!==void 0?r:null}function Pc(e,r){throw r.$$typeof===w?Error(o(525)):(e=Object.prototype.toString.call(r),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e)))}function A1(e){function r(F,U){if(e){var Q=F.deletions;Q===null?(F.deletions=[U],F.flags|=16):Q.push(U)}}function i(F,U){if(!e)return null;for(;U!==null;)r(F,U),U=U.sibling;return null}function u(F){for(var U=new Map;F!==null;)F.key!==null?U.set(F.key,F):U.set(F.index,F),F=F.sibling;return U}function h(F,U){return F=ea(F,U),F.index=0,F.sibling=null,F}function x(F,U,Q){return F.index=Q,e?(Q=F.alternate,Q!==null?(Q=Q.index,Q<U?(F.flags|=67108866,U):Q):(F.flags|=67108866,U)):(F.flags|=1048576,U)}function j(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function A(F,U,Q,fe){return U===null||U.tag!==6?(U=Tf(Q,F.mode,fe),U.return=F,U):(U=h(U,Q),U.return=F,U)}function z(F,U,Q,fe){var Re=Q.type;return Re===S?le(F,U,Q.props.children,fe,Q.key):U!==null&&(U.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===ne&&Ps(Re)===U.type)?(U=h(U,Q.props),Zi(U,Q),U.return=F,U):(U=Mc(Q.type,Q.key,Q.props,null,F.mode,fe),Zi(U,Q),U.return=F,U)}function J(F,U,Q,fe){return U===null||U.tag!==4||U.stateNode.containerInfo!==Q.containerInfo||U.stateNode.implementation!==Q.implementation?(U=Mf(Q,F.mode,fe),U.return=F,U):(U=h(U,Q.children||[]),U.return=F,U)}function le(F,U,Q,fe,Re){return U===null||U.tag!==7?(U=_s(Q,F.mode,fe,Re),U.return=F,U):(U=h(U,Q),U.return=F,U)}function he(F,U,Q){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Tf(""+U,F.mode,Q),U.return=F,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case y:return Q=Mc(U.type,U.key,U.props,null,F.mode,Q),Zi(Q,U),Q.return=F,Q;case C:return U=Mf(U,F.mode,Q),U.return=F,U;case ne:return U=Ps(U),he(F,U,Q)}if(se(U)||q(U))return U=_s(U,F.mode,Q,null),U.return=F,U;if(typeof U.then=="function")return he(F,zc(U),Q);if(U.$$typeof===M)return he(F,_c(F,U),Q);Pc(F,U)}return null}function ee(F,U,Q,fe){var Re=U!==null?U.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Re!==null?null:A(F,U,""+Q,fe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return Q.key===Re?z(F,U,Q,fe):null;case C:return Q.key===Re?J(F,U,Q,fe):null;case ne:return Q=Ps(Q),ee(F,U,Q,fe)}if(se(Q)||q(Q))return Re!==null?null:le(F,U,Q,fe,null);if(typeof Q.then=="function")return ee(F,U,zc(Q),fe);if(Q.$$typeof===M)return ee(F,U,_c(F,Q),fe);Pc(F,Q)}return null}function re(F,U,Q,fe,Re){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return F=F.get(Q)||null,A(U,F,""+fe,Re);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case y:return F=F.get(fe.key===null?Q:fe.key)||null,z(U,F,fe,Re);case C:return F=F.get(fe.key===null?Q:fe.key)||null,J(U,F,fe,Re);case ne:return fe=Ps(fe),re(F,U,Q,fe,Re)}if(se(fe)||q(fe))return F=F.get(Q)||null,le(U,F,fe,Re,null);if(typeof fe.then=="function")return re(F,U,Q,zc(fe),Re);if(fe.$$typeof===M)return re(F,U,Q,_c(U,fe),Re);Pc(U,fe)}return null}function Ee(F,U,Q,fe){for(var Re=null,at=null,ke=U,$e=U=0,Qe=null;ke!==null&&$e<Q.length;$e++){ke.index>$e?(Qe=ke,ke=null):Qe=ke.sibling;var st=ee(F,ke,Q[$e],fe);if(st===null){ke===null&&(ke=Qe);break}e&&ke&&st.alternate===null&&r(F,ke),U=x(st,U,$e),at===null?Re=st:at.sibling=st,at=st,ke=Qe}if($e===Q.length)return i(F,ke),tt&&ta(F,$e),Re;if(ke===null){for(;$e<Q.length;$e++)ke=he(F,Q[$e],fe),ke!==null&&(U=x(ke,U,$e),at===null?Re=ke:at.sibling=ke,at=ke);return tt&&ta(F,$e),Re}for(ke=u(ke);$e<Q.length;$e++)Qe=re(ke,F,$e,Q[$e],fe),Qe!==null&&(e&&Qe.alternate!==null&&ke.delete(Qe.key===null?$e:Qe.key),U=x(Qe,U,$e),at===null?Re=Qe:at.sibling=Qe,at=Qe);return e&&ke.forEach(function(as){return r(F,as)}),tt&&ta(F,$e),Re}function Oe(F,U,Q,fe){if(Q==null)throw Error(o(151));for(var Re=null,at=null,ke=U,$e=U=0,Qe=null,st=Q.next();ke!==null&&!st.done;$e++,st=Q.next()){ke.index>$e?(Qe=ke,ke=null):Qe=ke.sibling;var as=ee(F,ke,st.value,fe);if(as===null){ke===null&&(ke=Qe);break}e&&ke&&as.alternate===null&&r(F,ke),U=x(as,U,$e),at===null?Re=as:at.sibling=as,at=as,ke=Qe}if(st.done)return i(F,ke),tt&&ta(F,$e),Re;if(ke===null){for(;!st.done;$e++,st=Q.next())st=he(F,st.value,fe),st!==null&&(U=x(st,U,$e),at===null?Re=st:at.sibling=st,at=st);return tt&&ta(F,$e),Re}for(ke=u(ke);!st.done;$e++,st=Q.next())st=re(ke,F,$e,st.value,fe),st!==null&&(e&&st.alternate!==null&&ke.delete(st.key===null?$e:st.key),U=x(st,U,$e),at===null?Re=st:at.sibling=st,at=st);return e&&ke.forEach(function(y3){return r(F,y3)}),tt&&ta(F,$e),Re}function ht(F,U,Q,fe){if(typeof Q=="object"&&Q!==null&&Q.type===S&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:e:{for(var Re=Q.key;U!==null;){if(U.key===Re){if(Re=Q.type,Re===S){if(U.tag===7){i(F,U.sibling),fe=h(U,Q.props.children),fe.return=F,F=fe;break e}}else if(U.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===ne&&Ps(Re)===U.type){i(F,U.sibling),fe=h(U,Q.props),Zi(fe,Q),fe.return=F,F=fe;break e}i(F,U);break}else r(F,U);U=U.sibling}Q.type===S?(fe=_s(Q.props.children,F.mode,fe,Q.key),fe.return=F,F=fe):(fe=Mc(Q.type,Q.key,Q.props,null,F.mode,fe),Zi(fe,Q),fe.return=F,F=fe)}return j(F);case C:e:{for(Re=Q.key;U!==null;){if(U.key===Re)if(U.tag===4&&U.stateNode.containerInfo===Q.containerInfo&&U.stateNode.implementation===Q.implementation){i(F,U.sibling),fe=h(U,Q.children||[]),fe.return=F,F=fe;break e}else{i(F,U);break}else r(F,U);U=U.sibling}fe=Mf(Q,F.mode,fe),fe.return=F,F=fe}return j(F);case ne:return Q=Ps(Q),ht(F,U,Q,fe)}if(se(Q))return Ee(F,U,Q,fe);if(q(Q)){if(Re=q(Q),typeof Re!="function")throw Error(o(150));return Q=Re.call(Q),Oe(F,U,Q,fe)}if(typeof Q.then=="function")return ht(F,U,zc(Q),fe);if(Q.$$typeof===M)return ht(F,U,_c(F,Q),fe);Pc(F,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,U!==null&&U.tag===6?(i(F,U.sibling),fe=h(U,Q),fe.return=F,F=fe):(i(F,U),fe=Tf(Q,F.mode,fe),fe.return=F,F=fe),j(F)):i(F,U)}return function(F,U,Q,fe){try{Xi=0;var Re=ht(F,U,Q,fe);return Oo=null,Re}catch(ke){if(ke===Do||ke===Oc)throw ke;var at=Pn(29,ke,null,F.mode);return at.lanes=fe,at.return=F,at}finally{}}}var Us=A1(!0),_1=A1(!1),$a=!1;function $f(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hf(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,r,i){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(it&2)!==0){var h=u.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),u.pending=r,r=Tc(e),h1(e,null,i),r}return kc(e,u,r,i),Tc(e)}function Qi(e,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var u=r.lanes;u&=e.pendingLanes,i|=u,r.lanes=i,bt(e,i)}}function Gf(e,r){var i=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var h=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var j={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?h=x=j:x=x.next=j,i=i.next}while(i!==null);x===null?h=x=r:x=x.next=r}else h=x=r;i={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:x,shared:u.shared,callbacks:u.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=r:e.next=r,i.lastBaseUpdate=r}var Vf=!1;function Ji(){if(Vf){var e=_o;if(e!==null)throw e}}function el(e,r,i,u){Vf=!1;var h=e.updateQueue;$a=!1;var x=h.firstBaseUpdate,j=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var z=A,J=z.next;z.next=null,j===null?x=J:j.next=J,j=z;var le=e.alternate;le!==null&&(le=le.updateQueue,A=le.lastBaseUpdate,A!==j&&(A===null?le.firstBaseUpdate=J:A.next=J,le.lastBaseUpdate=z))}if(x!==null){var he=h.baseState;j=0,le=J=z=null,A=x;do{var ee=A.lane&-536870913,re=ee!==A.lane;if(re?(Ze&ee)===ee:(u&ee)===ee){ee!==0&&ee===Ao&&(Vf=!0),le!==null&&(le=le.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Ee=e,Oe=A;ee=r;var ht=i;switch(Oe.tag){case 1:if(Ee=Oe.payload,typeof Ee=="function"){he=Ee.call(ht,he,ee);break e}he=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Oe.payload,ee=typeof Ee=="function"?Ee.call(ht,he,ee):Ee,ee==null)break e;he=v({},he,ee);break e;case 2:$a=!0}}ee=A.callback,ee!==null&&(e.flags|=64,re&&(e.flags|=8192),re=h.callbacks,re===null?h.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:A.tag,payload:A.payload,callback:A.callback,next:null},le===null?(J=le=re,z=he):le=le.next=re,j|=ee;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;re=A,A=re.next,re.next=null,h.lastBaseUpdate=re,h.shared.pending=null}}while(!0);le===null&&(z=he),h.baseState=z,h.firstBaseUpdate=J,h.lastBaseUpdate=le,x===null&&(h.shared.lanes=0),Ka|=j,e.lanes=j,e.memoizedState=he}}function D1(e,r){if(typeof e!="function")throw Error(o(191,e));e.call(r)}function O1(e,r){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)D1(i[e],r)}var Lo=O(null),Ic=O(0);function L1(e,r){e=fa,B(Ic,e),B(Lo,r),fa=e|r.baseLanes}function Ff(){B(Ic,fa),B(Lo,Lo.current)}function Yf(){fa=Ic.current,D(Lo),D(Ic)}var In=O(null),cr=null;function Va(e){var r=e.alternate;B(Lt,Lt.current&1),B(In,e),cr===null&&(r===null||Lo.current!==null||r.memoizedState!==null)&&(cr=e)}function qf(e){B(Lt,Lt.current),B(In,e),cr===null&&(cr=e)}function z1(e){e.tag===22?(B(Lt,Lt.current),B(In,e),cr===null&&(cr=e)):Fa()}function Fa(){B(Lt,Lt.current),B(In,In.current)}function Un(e){D(In),cr===e&&(cr=null),D(Lt)}var Lt=O(0);function Uc(e){for(var r=e;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Jm(i)||ep(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var aa=0,Ie=null,mt=null,Bt=null,Bc=!1,zo=!1,Bs=!1,$c=0,tl=0,Po=null,u4=0;function At(){throw Error(o(321))}function Kf(e,r){if(r===null)return!1;for(var i=0;i<r.length&&i<e.length;i++)if(!zn(e[i],r[i]))return!1;return!0}function Wf(e,r,i,u,h,x){return aa=x,Ie=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,P.H=e===null||e.memoizedState===null?vb:um,Bs=!1,x=i(u,h),Bs=!1,zo&&(x=I1(r,i,u,h)),P1(e),x}function P1(e){P.H=al;var r=mt!==null&&mt.next!==null;if(aa=0,Bt=mt=Ie=null,Bc=!1,tl=0,Po=null,r)throw Error(o(300));e===null||$t||(e=e.dependencies,e!==null&&Ac(e)&&($t=!0))}function I1(e,r,i,u){Ie=e;var h=0;do{if(zo&&(Po=null),tl=0,zo=!1,25<=h)throw Error(o(301));if(h+=1,Bt=mt=null,e.updateQueue!=null){var x=e.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}P.H=yb,x=r(i,u)}while(zo);return x}function d4(){var e=P.H,r=e.useState()[0];return r=typeof r.then=="function"?nl(r):r,e=e.useState()[0],(mt!==null?mt.memoizedState:null)!==e&&(Ie.flags|=1024),r}function Xf(){var e=$c!==0;return $c=0,e}function Zf(e,r,i){r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~i}function Qf(e){if(Bc){for(e=e.memoizedState;e!==null;){var r=e.queue;r!==null&&(r.pending=null),e=e.next}Bc=!1}aa=0,Bt=mt=Ie=null,zo=!1,tl=$c=0,Po=null}function gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ie.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function zt(){if(mt===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var r=Bt===null?Ie.memoizedState:Bt.next;if(r!==null)Bt=r,mt=e;else{if(e===null)throw Ie.alternate===null?Error(o(467)):Error(o(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Bt===null?Ie.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function Hc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function nl(e){var r=tl;return tl+=1,Po===null&&(Po=[]),e=T1(Po,e,r),r=Ie,(Bt===null?r.memoizedState:Bt.next)===null&&(r=r.alternate,P.H=r===null||r.memoizedState===null?vb:um),e}function Gc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return nl(e);if(e.$$typeof===M)return on(e)}throw Error(o(438,String(e)))}function Jf(e){var r=null,i=Ie.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var u=Ie.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(h){return h.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=Hc(),Ie.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(e),u=0;u<e;u++)i[u]=I;return r.index++,i}function sa(e,r){return typeof r=="function"?r(e):r}function Vc(e){var r=zt();return em(r,mt,e)}function em(e,r,i){var u=e.queue;if(u===null)throw Error(o(311));u.lastRenderedReducer=i;var h=e.baseQueue,x=u.pending;if(x!==null){if(h!==null){var j=h.next;h.next=x.next,x.next=j}r.baseQueue=h=x,u.pending=null}if(x=e.baseState,h===null)e.memoizedState=x;else{r=h.next;var A=j=null,z=null,J=r,le=!1;do{var he=J.lane&-536870913;if(he!==J.lane?(Ze&he)===he:(aa&he)===he){var ee=J.revertLane;if(ee===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),he===Ao&&(le=!0);else if((aa&ee)===ee){J=J.next,ee===Ao&&(le=!0);continue}else he={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(A=z=he,j=x):z=z.next=he,Ie.lanes|=ee,Ka|=ee;he=J.action,Bs&&i(x,he),x=J.hasEagerState?J.eagerState:i(x,he)}else ee={lane:he,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(A=z=ee,j=x):z=z.next=ee,Ie.lanes|=he,Ka|=he;J=J.next}while(J!==null&&J!==r);if(z===null?j=x:z.next=A,!zn(x,e.memoizedState)&&($t=!0,le&&(i=_o,i!==null)))throw i;e.memoizedState=x,e.baseState=j,e.baseQueue=z,u.lastRenderedState=x}return h===null&&(u.lanes=0),[e.memoizedState,u.dispatch]}function tm(e){var r=zt(),i=r.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var u=i.dispatch,h=i.pending,x=r.memoizedState;if(h!==null){i.pending=null;var j=h=h.next;do x=e(x,j.action),j=j.next;while(j!==h);zn(x,r.memoizedState)||($t=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),i.lastRenderedState=x}return[x,u]}function U1(e,r,i){var u=Ie,h=zt(),x=tt;if(x){if(i===void 0)throw Error(o(407));i=i()}else i=r();var j=!zn((mt||h).memoizedState,i);if(j&&(h.memoizedState=i,$t=!0),h=h.queue,am(H1.bind(null,u,h,e),[e]),h.getSnapshot!==r||j||Bt!==null&&Bt.memoizedState.tag&1){if(u.flags|=2048,Io(9,{destroy:void 0},$1.bind(null,u,h,i,r),null),xt===null)throw Error(o(349));x||(aa&127)!==0||B1(u,r,i)}return i}function B1(e,r,i){e.flags|=16384,e={getSnapshot:r,value:i},r=Ie.updateQueue,r===null?(r=Hc(),Ie.updateQueue=r,r.stores=[e]):(i=r.stores,i===null?r.stores=[e]:i.push(e))}function $1(e,r,i,u){r.value=i,r.getSnapshot=u,G1(r)&&V1(e)}function H1(e,r,i){return i(function(){G1(r)&&V1(e)})}function G1(e){var r=e.getSnapshot;e=e.value;try{var i=r();return!zn(e,i)}catch{return!0}}function V1(e){var r=As(e,2);r!==null&&Tn(r,e,2)}function nm(e){var r=gn();if(typeof e=="function"){var i=e;if(e=i(),Bs){On(!0);try{i()}finally{On(!1)}}}return r.memoizedState=r.baseState=e,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e},r}function F1(e,r,i,u){return e.baseState=i,em(e,mt,typeof u=="function"?u:sa)}function f4(e,r,i,u,h){if(qc(e))throw Error(o(485));if(e=r.action,e!==null){var x={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){x.listeners.push(j)}};P.T!==null?i(!0):x.isTransition=!1,u(x),i=r.pending,i===null?(x.next=r.pending=x,Y1(r,x)):(x.next=i.next,r.pending=i.next=x)}}function Y1(e,r){var i=r.action,u=r.payload,h=e.state;if(r.isTransition){var x=P.T,j={};P.T=j;try{var A=i(h,u),z=P.S;z!==null&&z(j,A),q1(e,r,A)}catch(J){rm(e,r,J)}finally{x!==null&&j.types!==null&&(x.types=j.types),P.T=x}}else try{x=i(h,u),q1(e,r,x)}catch(J){rm(e,r,J)}}function q1(e,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(u){K1(e,r,u)},function(u){return rm(e,r,u)}):K1(e,r,i)}function K1(e,r,i){r.status="fulfilled",r.value=i,W1(r),e.state=i,r=e.pending,r!==null&&(i=r.next,i===r?e.pending=null:(i=i.next,r.next=i,Y1(e,i)))}function rm(e,r,i){var u=e.pending;if(e.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=i,W1(r),r=r.next;while(r!==u)}e.action=null}function W1(e){e=e.listeners;for(var r=0;r<e.length;r++)(0,e[r])()}function X1(e,r){return r}function Z1(e,r){if(tt){var i=xt.formState;if(i!==null){e:{var u=Ie;if(tt){if(wt){t:{for(var h=wt,x=lr;h.nodeType!==8;){if(!x){h=null;break t}if(h=ur(h.nextSibling),h===null){h=null;break t}}x=h.data,h=x==="F!"||x==="F"?h:null}if(h){wt=ur(h.nextSibling),u=h.data==="F!";break e}}Ua(u)}u=!1}u&&(r=i[0])}}return i=gn(),i.memoizedState=i.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:X1,lastRenderedState:r},i.queue=u,i=gb.bind(null,Ie,u),u.dispatch=i,u=nm(!1),x=cm.bind(null,Ie,!1,u.queue),u=gn(),h={state:r,dispatch:null,action:e,pending:null},u.queue=h,i=f4.bind(null,Ie,h,x,i),h.dispatch=i,u.memoizedState=e,[r,i,!1]}function Q1(e){var r=zt();return J1(r,mt,e)}function J1(e,r,i){if(r=em(e,r,X1)[0],e=Vc(sa)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=nl(r)}catch(j){throw j===Do?Oc:j}else u=r;r=zt();var h=r.queue,x=h.dispatch;return i!==r.memoizedState&&(Ie.flags|=2048,Io(9,{destroy:void 0},m4.bind(null,h,i),null)),[u,x,e]}function m4(e,r){e.action=r}function eb(e){var r=zt(),i=mt;if(i!==null)return J1(r,i,e);zt(),r=r.memoizedState,i=zt();var u=i.queue.dispatch;return i.memoizedState=e,[r,u,!1]}function Io(e,r,i,u){return e={tag:e,create:i,deps:u,inst:r,next:null},r=Ie.updateQueue,r===null&&(r=Hc(),Ie.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=e.next=e:(u=i.next,i.next=e,e.next=u,r.lastEffect=e),e}function tb(){return zt().memoizedState}function Fc(e,r,i,u){var h=gn();Ie.flags|=e,h.memoizedState=Io(1|r,{destroy:void 0},i,u===void 0?null:u)}function Yc(e,r,i,u){var h=zt();u=u===void 0?null:u;var x=h.memoizedState.inst;mt!==null&&u!==null&&Kf(u,mt.memoizedState.deps)?h.memoizedState=Io(r,x,i,u):(Ie.flags|=e,h.memoizedState=Io(1|r,x,i,u))}function nb(e,r){Fc(8390656,8,e,r)}function am(e,r){Yc(2048,8,e,r)}function p4(e){Ie.flags|=4;var r=Ie.updateQueue;if(r===null)r=Hc(),Ie.updateQueue=r,r.events=[e];else{var i=r.events;i===null?r.events=[e]:i.push(e)}}function rb(e){var r=zt().memoizedState;return p4({ref:r,nextImpl:e}),function(){if((it&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}function ab(e,r){return Yc(4,2,e,r)}function sb(e,r){return Yc(4,4,e,r)}function ob(e,r){if(typeof r=="function"){e=e();var i=r(e);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function ib(e,r,i){i=i!=null?i.concat([e]):null,Yc(4,4,ob.bind(null,r,e),i)}function sm(){}function lb(e,r){var i=zt();r=r===void 0?null:r;var u=i.memoizedState;return r!==null&&Kf(r,u[1])?u[0]:(i.memoizedState=[e,r],e)}function cb(e,r){var i=zt();r=r===void 0?null:r;var u=i.memoizedState;if(r!==null&&Kf(r,u[1]))return u[0];if(u=e(),Bs){On(!0);try{e()}finally{On(!1)}}return i.memoizedState=[u,r],u}function om(e,r,i){return i===void 0||(aa&1073741824)!==0&&(Ze&261930)===0?e.memoizedState=r:(e.memoizedState=i,e=uv(),Ie.lanes|=e,Ka|=e,i)}function ub(e,r,i,u){return zn(i,r)?i:Lo.current!==null?(e=om(e,i,u),zn(e,r)||($t=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(Ze&261930)===0?($t=!0,e.memoizedState=i):(e=uv(),Ie.lanes|=e,Ka|=e,r)}function db(e,r,i,u,h){var x=W.p;W.p=x!==0&&8>x?x:8;var j=P.T,A={};P.T=A,cm(e,!1,r,i);try{var z=h(),J=P.S;if(J!==null&&J(A,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var le=c4(z,u);rl(e,r,le,Hn(e))}else rl(e,r,u,Hn(e))}catch(he){rl(e,r,{then:function(){},status:"rejected",reason:he},Hn())}finally{W.p=x,j!==null&&A.types!==null&&(j.types=A.types),P.T=j}}function h4(){}function im(e,r,i,u){if(e.tag!==5)throw Error(o(476));var h=fb(e).queue;db(e,h,r,oe,i===null?h4:function(){return mb(e),i(u)})}function fb(e){var r=e.memoizedState;if(r!==null)return r;r={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:oe},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:i},next:null},e.memoizedState=r,e=e.alternate,e!==null&&(e.memoizedState=r),r}function mb(e){var r=fb(e);r.next===null&&(r=e.alternate.memoizedState),rl(e,r.next.queue,{},Hn())}function lm(){return on(yl)}function pb(){return zt().memoizedState}function hb(){return zt().memoizedState}function g4(e){for(var r=e.return;r!==null;){switch(r.tag){case 24:case 3:var i=Hn();e=Ha(i);var u=Ga(r,e,i);u!==null&&(Tn(u,r,i),Qi(u,r,i)),r={cache:Pf()},e.payload=r;return}r=r.return}}function x4(e,r,i){var u=Hn();i={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},qc(e)?xb(r,i):(i=Ef(e,r,i,u),i!==null&&(Tn(i,e,u),bb(i,r,u)))}function gb(e,r,i){var u=Hn();rl(e,r,i,u)}function rl(e,r,i,u){var h={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(qc(e))xb(r,h);else{var x=e.alternate;if(e.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var j=r.lastRenderedState,A=x(j,i);if(h.hasEagerState=!0,h.eagerState=A,zn(A,j))return kc(e,r,h,0),xt===null&&Ec(),!1}catch{}finally{}if(i=Ef(e,r,h,u),i!==null)return Tn(i,e,u),bb(i,r,u),!0}return!1}function cm(e,r,i,u){if(u={lane:2,revertLane:$m(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},qc(e)){if(r)throw Error(o(479))}else r=Ef(e,i,u,2),r!==null&&Tn(r,e,2)}function qc(e){var r=e.alternate;return e===Ie||r!==null&&r===Ie}function xb(e,r){zo=Bc=!0;var i=e.pending;i===null?r.next=r:(r.next=i.next,i.next=r),e.pending=r}function bb(e,r,i){if((i&4194048)!==0){var u=r.lanes;u&=e.pendingLanes,i|=u,r.lanes=i,bt(e,i)}}var al={readContext:on,use:Gc,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};al.useEffectEvent=At;var vb={readContext:on,use:Gc,useCallback:function(e,r){return gn().memoizedState=[e,r===void 0?null:r],e},useContext:on,useEffect:nb,useImperativeHandle:function(e,r,i){i=i!=null?i.concat([e]):null,Fc(4194308,4,ob.bind(null,r,e),i)},useLayoutEffect:function(e,r){return Fc(4194308,4,e,r)},useInsertionEffect:function(e,r){Fc(4,2,e,r)},useMemo:function(e,r){var i=gn();r=r===void 0?null:r;var u=e();if(Bs){On(!0);try{e()}finally{On(!1)}}return i.memoizedState=[u,r],u},useReducer:function(e,r,i){var u=gn();if(i!==void 0){var h=i(r);if(Bs){On(!0);try{i(r)}finally{On(!1)}}}else h=r;return u.memoizedState=u.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},u.queue=e,e=e.dispatch=x4.bind(null,Ie,e),[u.memoizedState,e]},useRef:function(e){var r=gn();return e={current:e},r.memoizedState=e},useState:function(e){e=nm(e);var r=e.queue,i=gb.bind(null,Ie,r);return r.dispatch=i,[e.memoizedState,i]},useDebugValue:sm,useDeferredValue:function(e,r){var i=gn();return om(i,e,r)},useTransition:function(){var e=nm(!1);return e=db.bind(null,Ie,e.queue,!0,!1),gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,r,i){var u=Ie,h=gn();if(tt){if(i===void 0)throw Error(o(407));i=i()}else{if(i=r(),xt===null)throw Error(o(349));(Ze&127)!==0||B1(u,r,i)}h.memoizedState=i;var x={value:i,getSnapshot:r};return h.queue=x,nb(H1.bind(null,u,x,e),[e]),u.flags|=2048,Io(9,{destroy:void 0},$1.bind(null,u,x,i,r),null),i},useId:function(){var e=gn(),r=xt.identifierPrefix;if(tt){var i=Or,u=Dr;i=(u&~(1<<32-Rt(u)-1)).toString(32)+i,r="_"+r+"R_"+i,i=$c++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=u4++,r="_"+r+"r_"+i.toString(32)+"_";return e.memoizedState=r},useHostTransitionStatus:lm,useFormState:Z1,useActionState:Z1,useOptimistic:function(e){var r=gn();r.memoizedState=r.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=cm.bind(null,Ie,!0,i),i.dispatch=r,[e,r]},useMemoCache:Jf,useCacheRefresh:function(){return gn().memoizedState=g4.bind(null,Ie)},useEffectEvent:function(e){var r=gn(),i={impl:e};return r.memoizedState=i,function(){if((it&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},um={readContext:on,use:Gc,useCallback:lb,useContext:on,useEffect:am,useImperativeHandle:ib,useInsertionEffect:ab,useLayoutEffect:sb,useMemo:cb,useReducer:Vc,useRef:tb,useState:function(){return Vc(sa)},useDebugValue:sm,useDeferredValue:function(e,r){var i=zt();return ub(i,mt.memoizedState,e,r)},useTransition:function(){var e=Vc(sa)[0],r=zt().memoizedState;return[typeof e=="boolean"?e:nl(e),r]},useSyncExternalStore:U1,useId:pb,useHostTransitionStatus:lm,useFormState:Q1,useActionState:Q1,useOptimistic:function(e,r){var i=zt();return F1(i,mt,e,r)},useMemoCache:Jf,useCacheRefresh:hb};um.useEffectEvent=rb;var yb={readContext:on,use:Gc,useCallback:lb,useContext:on,useEffect:am,useImperativeHandle:ib,useInsertionEffect:ab,useLayoutEffect:sb,useMemo:cb,useReducer:tm,useRef:tb,useState:function(){return tm(sa)},useDebugValue:sm,useDeferredValue:function(e,r){var i=zt();return mt===null?om(i,e,r):ub(i,mt.memoizedState,e,r)},useTransition:function(){var e=tm(sa)[0],r=zt().memoizedState;return[typeof e=="boolean"?e:nl(e),r]},useSyncExternalStore:U1,useId:pb,useHostTransitionStatus:lm,useFormState:eb,useActionState:eb,useOptimistic:function(e,r){var i=zt();return mt!==null?F1(i,mt,e,r):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Jf,useCacheRefresh:hb};yb.useEffectEvent=rb;function dm(e,r,i,u){r=e.memoizedState,i=i(u,r),i=i==null?r:v({},r,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var fm={enqueueSetState:function(e,r,i){e=e._reactInternals;var u=Hn(),h=Ha(u);h.payload=r,i!=null&&(h.callback=i),r=Ga(e,h,u),r!==null&&(Tn(r,e,u),Qi(r,e,u))},enqueueReplaceState:function(e,r,i){e=e._reactInternals;var u=Hn(),h=Ha(u);h.tag=1,h.payload=r,i!=null&&(h.callback=i),r=Ga(e,h,u),r!==null&&(Tn(r,e,u),Qi(r,e,u))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var i=Hn(),u=Ha(i);u.tag=2,r!=null&&(u.callback=r),r=Ga(e,u,i),r!==null&&(Tn(r,e,i),Qi(r,e,i))}};function wb(e,r,i,u,h,x,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,x,j):r.prototype&&r.prototype.isPureReactComponent?!Vi(i,u)||!Vi(h,x):!0}function jb(e,r,i,u){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,u),r.state!==e&&fm.enqueueReplaceState(r,r.state,null)}function $s(e,r){var i=r;if("ref"in r){i={};for(var u in r)u!=="ref"&&(i[u]=r[u])}if(e=e.defaultProps){i===r&&(i=v({},i));for(var h in e)i[h]===void 0&&(i[h]=e[h])}return i}function Cb(e){Nc(e)}function Sb(e){console.error(e)}function Nb(e){Nc(e)}function Kc(e,r){try{var i=e.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function Eb(e,r,i){try{var u=e.onCaughtError;u(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function mm(e,r,i){return i=Ha(i),i.tag=3,i.payload={element:null},i.callback=function(){Kc(e,r)},i}function kb(e){return e=Ha(e),e.tag=3,e}function Tb(e,r,i,u){var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var x=u.value;e.payload=function(){return h(x)},e.callback=function(){Eb(r,i,u)}}var j=i.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){Eb(r,i,u),typeof h!="function"&&(Wa===null?Wa=new Set([this]):Wa.add(this));var A=u.stack;this.componentDidCatch(u.value,{componentStack:A!==null?A:""})})}function b4(e,r,i,u,h){if(i.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=i.alternate,r!==null&&Ro(r,i,h,!0),i=In.current,i!==null){switch(i.tag){case 31:case 13:return cr===null?ou():i.alternate===null&&_t===0&&(_t=3),i.flags&=-257,i.flags|=65536,i.lanes=h,u===Lc?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([u]):r.add(u),Im(e,u,h)),!1;case 22:return i.flags|=65536,u===Lc?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([u]):i.add(u)),Im(e,u,h)),!1}throw Error(o(435,i.tag))}return Im(e,u,h),ou(),!1}if(tt)return r=In.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=h,u!==_f&&(e=Error(o(422),{cause:u}),qi(sr(e,i)))):(u!==_f&&(r=Error(o(423),{cause:u}),qi(sr(r,i))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,u=sr(u,i),h=mm(e.stateNode,u,h),Gf(e,h),_t!==4&&(_t=2)),!1;var x=Error(o(520),{cause:u});if(x=sr(x,i),fl===null?fl=[x]:fl.push(x),_t!==4&&(_t=2),r===null)return!0;u=sr(u,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,e=h&-h,i.lanes|=e,e=mm(i.stateNode,u,e),Gf(i,e),!1;case 1:if(r=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Wa===null||!Wa.has(x))))return i.flags|=65536,h&=-h,i.lanes|=h,h=kb(h),Tb(h,e,i,u),Gf(i,h),!1}i=i.return}while(i!==null);return!1}var pm=Error(o(461)),$t=!1;function ln(e,r,i,u){r.child=e===null?_1(r,null,i,u):Us(r,e.child,i,u)}function Mb(e,r,i,u,h){i=i.render;var x=r.ref;if("ref"in u){var j={};for(var A in u)A!=="ref"&&(j[A]=u[A])}else j=u;return Ls(r),u=Wf(e,r,i,j,x,h),A=Xf(),e!==null&&!$t?(Zf(e,r,h),oa(e,r,h)):(tt&&A&&Rf(r),r.flags|=1,ln(e,r,u,h),r.child)}function Rb(e,r,i,u,h){if(e===null){var x=i.type;return typeof x=="function"&&!kf(x)&&x.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=x,Ab(e,r,x,u,h)):(e=Mc(i.type,null,u,r,r.mode,h),e.ref=r.ref,e.return=r,r.child=e)}if(x=e.child,!jm(e,h)){var j=x.memoizedProps;if(i=i.compare,i=i!==null?i:Vi,i(j,u)&&e.ref===r.ref)return oa(e,r,h)}return r.flags|=1,e=ea(x,u),e.ref=r.ref,e.return=r,r.child=e}function Ab(e,r,i,u,h){if(e!==null){var x=e.memoizedProps;if(Vi(x,u)&&e.ref===r.ref)if($t=!1,r.pendingProps=u=x,jm(e,h))(e.flags&131072)!==0&&($t=!0);else return r.lanes=e.lanes,oa(e,r,h)}return hm(e,r,i,u,h)}function _b(e,r,i,u){var h=u.children,x=e!==null?e.memoizedState:null;if(e===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(x=x!==null?x.baseLanes|i:i,e!==null){for(u=r.child=e.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~x}else u=0,r.child=null;return Db(e,r,x,i,u)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},e!==null&&Dc(r,x!==null?x.cachePool:null),x!==null?L1(r,x):Ff(),z1(r);else return u=r.lanes=536870912,Db(e,r,x!==null?x.baseLanes|i:i,i,u)}else x!==null?(Dc(r,x.cachePool),L1(r,x),Fa(),r.memoizedState=null):(e!==null&&Dc(r,null),Ff(),Fa());return ln(e,r,h,i),r.child}function sl(e,r){return e!==null&&e.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Db(e,r,i,u,h){var x=Uf();return x=x===null?null:{parent:Ut._currentValue,pool:x},r.memoizedState={baseLanes:i,cachePool:x},e!==null&&Dc(r,null),Ff(),z1(r),e!==null&&Ro(e,r,u,!0),r.childLanes=h,null}function Wc(e,r){return r=Zc({mode:r.mode,children:r.children},e.mode),r.ref=e.ref,e.child=r,r.return=e,r}function Ob(e,r,i){return Us(r,e.child,null,i),e=Wc(r,r.pendingProps),e.flags|=2,Un(r),r.memoizedState=null,e}function v4(e,r,i){var u=r.pendingProps,h=(r.flags&128)!==0;if(r.flags&=-129,e===null){if(tt){if(u.mode==="hidden")return e=Wc(r,u),r.lanes=536870912,sl(null,e);if(qf(r),(e=wt)?(e=Yv(e,lr),e=e!==null&&e.data==="&"?e:null,e!==null&&(r.memoizedState={dehydrated:e,treeContext:Pa!==null?{id:Dr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},i=x1(e),i.return=r,r.child=i,sn=r,wt=null)):e=null,e===null)throw Ua(r);return r.lanes=536870912,null}return Wc(r,u)}var x=e.memoizedState;if(x!==null){var j=x.dehydrated;if(qf(r),h)if(r.flags&256)r.flags&=-257,r=Ob(e,r,i);else if(r.memoizedState!==null)r.child=e.child,r.flags|=128,r=null;else throw Error(o(558));else if($t||Ro(e,r,i,!1),h=(i&e.childLanes)!==0,$t||h){if(u=xt,u!==null&&(j=Ln(u,i),j!==0&&j!==x.retryLane))throw x.retryLane=j,As(e,j),Tn(u,e,j),pm;ou(),r=Ob(e,r,i)}else e=x.treeContext,wt=ur(j.nextSibling),sn=r,tt=!0,Ia=null,lr=!1,e!==null&&y1(r,e),r=Wc(r,u),r.flags|=4096;return r}return e=ea(e.child,{mode:u.mode,children:u.children}),e.ref=r.ref,r.child=e,e.return=r,e}function Xc(e,r){var i=r.ref;if(i===null)e!==null&&e.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(r.flags|=4194816)}}function hm(e,r,i,u,h){return Ls(r),i=Wf(e,r,i,u,void 0,h),u=Xf(),e!==null&&!$t?(Zf(e,r,h),oa(e,r,h)):(tt&&u&&Rf(r),r.flags|=1,ln(e,r,i,h),r.child)}function Lb(e,r,i,u,h,x){return Ls(r),r.updateQueue=null,i=I1(r,u,i,h),P1(e),u=Xf(),e!==null&&!$t?(Zf(e,r,x),oa(e,r,x)):(tt&&u&&Rf(r),r.flags|=1,ln(e,r,i,x),r.child)}function zb(e,r,i,u,h){if(Ls(r),r.stateNode===null){var x=Eo,j=i.contextType;typeof j=="object"&&j!==null&&(x=on(j)),x=new i(u,x),r.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=fm,r.stateNode=x,x._reactInternals=r,x=r.stateNode,x.props=u,x.state=r.memoizedState,x.refs={},$f(r),j=i.contextType,x.context=typeof j=="object"&&j!==null?on(j):Eo,x.state=r.memoizedState,j=i.getDerivedStateFromProps,typeof j=="function"&&(dm(r,i,j,u),x.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(j=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),j!==x.state&&fm.enqueueReplaceState(x,x.state,null),el(r,u,x,h),Ji(),x.state=r.memoizedState),typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(e===null){x=r.stateNode;var A=r.memoizedProps,z=$s(i,A);x.props=z;var J=x.context,le=i.contextType;j=Eo,typeof le=="object"&&le!==null&&(j=on(le));var he=i.getDerivedStateFromProps;le=typeof he=="function"||typeof x.getSnapshotBeforeUpdate=="function",A=r.pendingProps!==A,le||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A||J!==j)&&jb(r,x,u,j),$a=!1;var ee=r.memoizedState;x.state=ee,el(r,u,x,h),Ji(),J=r.memoizedState,A||ee!==J||$a?(typeof he=="function"&&(dm(r,i,he,u),J=r.memoizedState),(z=$a||wb(r,i,z,u,ee,J,j))?(le||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(r.flags|=4194308)):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=J),x.props=u,x.state=J,x.context=j,u=z):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{x=r.stateNode,Hf(e,r),j=r.memoizedProps,le=$s(i,j),x.props=le,he=r.pendingProps,ee=x.context,J=i.contextType,z=Eo,typeof J=="object"&&J!==null&&(z=on(J)),A=i.getDerivedStateFromProps,(J=typeof A=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(j!==he||ee!==z)&&jb(r,x,u,z),$a=!1,ee=r.memoizedState,x.state=ee,el(r,u,x,h),Ji();var re=r.memoizedState;j!==he||ee!==re||$a||e!==null&&e.dependencies!==null&&Ac(e.dependencies)?(typeof A=="function"&&(dm(r,i,A,u),re=r.memoizedState),(le=$a||wb(r,i,le,u,ee,re,z)||e!==null&&e.dependencies!==null&&Ac(e.dependencies))?(J||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,re,z),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,re,z)),typeof x.componentDidUpdate=="function"&&(r.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof x.componentDidUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=re),x.props=u,x.state=re,x.context=z,u=le):(typeof x.componentDidUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(r.flags|=1024),u=!1)}return x=u,Xc(e,r),u=(r.flags&128)!==0,x||u?(x=r.stateNode,i=u&&typeof i.getDerivedStateFromError!="function"?null:x.render(),r.flags|=1,e!==null&&u?(r.child=Us(r,e.child,null,h),r.child=Us(r,null,i,h)):ln(e,r,i,h),r.memoizedState=x.state,e=r.child):e=oa(e,r,h),e}function Pb(e,r,i,u){return Ds(),r.flags|=256,ln(e,r,i,u),r.child}var gm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xm(e){return{baseLanes:e,cachePool:E1()}}function bm(e,r,i){return e=e!==null?e.childLanes&~i:0,r&&(e|=$n),e}function Ib(e,r,i){var u=r.pendingProps,h=!1,x=(r.flags&128)!==0,j;if((j=x)||(j=e!==null&&e.memoizedState===null?!1:(Lt.current&2)!==0),j&&(h=!0,r.flags&=-129),j=(r.flags&32)!==0,r.flags&=-33,e===null){if(tt){if(h?Va(r):Fa(),(e=wt)?(e=Yv(e,lr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(r.memoizedState={dehydrated:e,treeContext:Pa!==null?{id:Dr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},i=x1(e),i.return=r,r.child=i,sn=r,wt=null)):e=null,e===null)throw Ua(r);return ep(e)?r.lanes=32:r.lanes=536870912,null}var A=u.children;return u=u.fallback,h?(Fa(),h=r.mode,A=Zc({mode:"hidden",children:A},h),u=_s(u,h,i,null),A.return=r,u.return=r,A.sibling=u,r.child=A,u=r.child,u.memoizedState=xm(i),u.childLanes=bm(e,j,i),r.memoizedState=gm,sl(null,u)):(Va(r),vm(r,A))}var z=e.memoizedState;if(z!==null&&(A=z.dehydrated,A!==null)){if(x)r.flags&256?(Va(r),r.flags&=-257,r=ym(e,r,i)):r.memoizedState!==null?(Fa(),r.child=e.child,r.flags|=128,r=null):(Fa(),A=u.fallback,h=r.mode,u=Zc({mode:"visible",children:u.children},h),A=_s(A,h,i,null),A.flags|=2,u.return=r,A.return=r,u.sibling=A,r.child=u,Us(r,e.child,null,i),u=r.child,u.memoizedState=xm(i),u.childLanes=bm(e,j,i),r.memoizedState=gm,r=sl(null,u));else if(Va(r),ep(A)){if(j=A.nextSibling&&A.nextSibling.dataset,j)var J=j.dgst;j=J,u=Error(o(419)),u.stack="",u.digest=j,qi({value:u,source:null,stack:null}),r=ym(e,r,i)}else if($t||Ro(e,r,i,!1),j=(i&e.childLanes)!==0,$t||j){if(j=xt,j!==null&&(u=Ln(j,i),u!==0&&u!==z.retryLane))throw z.retryLane=u,As(e,u),Tn(j,e,u),pm;Jm(A)||ou(),r=ym(e,r,i)}else Jm(A)?(r.flags|=192,r.child=e.child,r=null):(e=z.treeContext,wt=ur(A.nextSibling),sn=r,tt=!0,Ia=null,lr=!1,e!==null&&y1(r,e),r=vm(r,u.children),r.flags|=4096);return r}return h?(Fa(),A=u.fallback,h=r.mode,z=e.child,J=z.sibling,u=ea(z,{mode:"hidden",children:u.children}),u.subtreeFlags=z.subtreeFlags&65011712,J!==null?A=ea(J,A):(A=_s(A,h,i,null),A.flags|=2),A.return=r,u.return=r,u.sibling=A,r.child=u,sl(null,u),u=r.child,A=e.child.memoizedState,A===null?A=xm(i):(h=A.cachePool,h!==null?(z=Ut._currentValue,h=h.parent!==z?{parent:z,pool:z}:h):h=E1(),A={baseLanes:A.baseLanes|i,cachePool:h}),u.memoizedState=A,u.childLanes=bm(e,j,i),r.memoizedState=gm,sl(e.child,u)):(Va(r),i=e.child,e=i.sibling,i=ea(i,{mode:"visible",children:u.children}),i.return=r,i.sibling=null,e!==null&&(j=r.deletions,j===null?(r.deletions=[e],r.flags|=16):j.push(e)),r.child=i,r.memoizedState=null,i)}function vm(e,r){return r=Zc({mode:"visible",children:r},e.mode),r.return=e,e.child=r}function Zc(e,r){return e=Pn(22,e,null,r),e.lanes=0,e}function ym(e,r,i){return Us(r,e.child,null,i),e=vm(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function Ub(e,r,i){e.lanes|=r;var u=e.alternate;u!==null&&(u.lanes|=r),Lf(e.return,r,i)}function wm(e,r,i,u,h,x){var j=e.memoizedState;j===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:h,treeForkCount:x}:(j.isBackwards=r,j.rendering=null,j.renderingStartTime=0,j.last=u,j.tail=i,j.tailMode=h,j.treeForkCount=x)}function Bb(e,r,i){var u=r.pendingProps,h=u.revealOrder,x=u.tail;u=u.children;var j=Lt.current,A=(j&2)!==0;if(A?(j=j&1|2,r.flags|=128):j&=1,B(Lt,j),ln(e,r,u,i),u=tt?Yi:0,!A&&e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ub(e,i,r);else if(e.tag===19)Ub(e,i,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(h){case"forwards":for(i=r.child,h=null;i!==null;)e=i.alternate,e!==null&&Uc(e)===null&&(h=i),i=i.sibling;i=h,i===null?(h=r.child,r.child=null):(h=i.sibling,i.sibling=null),wm(r,!1,h,i,x,u);break;case"backwards":case"unstable_legacy-backwards":for(i=null,h=r.child,r.child=null;h!==null;){if(e=h.alternate,e!==null&&Uc(e)===null){r.child=h;break}e=h.sibling,h.sibling=i,i=h,h=e}wm(r,!0,i,null,x,u);break;case"together":wm(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function oa(e,r,i){if(e!==null&&(r.dependencies=e.dependencies),Ka|=r.lanes,(i&r.childLanes)===0)if(e!==null){if(Ro(e,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(e!==null&&r.child!==e.child)throw Error(o(153));if(r.child!==null){for(e=r.child,i=ea(e,e.pendingProps),r.child=i,i.return=r;e.sibling!==null;)e=e.sibling,i=i.sibling=ea(e,e.pendingProps),i.return=r;i.sibling=null}return r.child}function jm(e,r){return(e.lanes&r)!==0?!0:(e=e.dependencies,!!(e!==null&&Ac(e)))}function y4(e,r,i){switch(r.tag){case 3:ge(r,r.stateNode.containerInfo),Ba(r,Ut,e.memoizedState.cache),Ds();break;case 27:case 5:$(r);break;case 4:ge(r,r.stateNode.containerInfo);break;case 10:Ba(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,qf(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Va(r),r.flags|=128,null):(i&r.child.childLanes)!==0?Ib(e,r,i):(Va(r),e=oa(e,r,i),e!==null?e.sibling:null);Va(r);break;case 19:var h=(e.flags&128)!==0;if(u=(i&r.childLanes)!==0,u||(Ro(e,r,i,!1),u=(i&r.childLanes)!==0),h){if(u)return Bb(e,r,i);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),B(Lt,Lt.current),u)break;return null;case 22:return r.lanes=0,_b(e,r,i,r.pendingProps);case 24:Ba(r,Ut,e.memoizedState.cache)}return oa(e,r,i)}function $b(e,r,i){if(e!==null)if(e.memoizedProps!==r.pendingProps)$t=!0;else{if(!jm(e,i)&&(r.flags&128)===0)return $t=!1,y4(e,r,i);$t=(e.flags&131072)!==0}else $t=!1,tt&&(r.flags&1048576)!==0&&v1(r,Yi,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(e=Ps(r.elementType),r.type=e,typeof e=="function")kf(e)?(u=$s(e,u),r.tag=1,r=zb(null,r,e,u,i)):(r.tag=0,r=hm(null,r,e,u,i));else{if(e!=null){var h=e.$$typeof;if(h===k){r.tag=11,r=Mb(null,r,e,u,i);break e}else if(h===L){r.tag=14,r=Rb(null,r,e,u,i);break e}}throw r=de(e)||e,Error(o(306,r,""))}}return r;case 0:return hm(e,r,r.type,r.pendingProps,i);case 1:return u=r.type,h=$s(u,r.pendingProps),zb(e,r,u,h,i);case 3:e:{if(ge(r,r.stateNode.containerInfo),e===null)throw Error(o(387));u=r.pendingProps;var x=r.memoizedState;h=x.element,Hf(e,r),el(r,u,null,i);var j=r.memoizedState;if(u=j.cache,Ba(r,Ut,u),u!==x.cache&&zf(r,[Ut],i,!0),Ji(),u=j.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:j.cache},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){r=Pb(e,r,u,i);break e}else if(u!==h){h=sr(Error(o(424)),r),qi(h),r=Pb(e,r,u,i);break e}else{switch(e=r.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(wt=ur(e.firstChild),sn=r,tt=!0,Ia=null,lr=!0,i=_1(r,null,u,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Ds(),u===h){r=oa(e,r,i);break e}ln(e,r,u,i)}r=r.child}return r;case 26:return Xc(e,r),e===null?(i=Qv(r.type,null,r.pendingProps,null))?r.memoizedState=i:tt||(i=r.type,e=r.pendingProps,u=mu(be.current).createElement(i),u[te]=r,u[je]=e,cn(u,i,e),Xt(u),r.stateNode=u):r.memoizedState=Qv(r.type,e.memoizedProps,r.pendingProps,e.memoizedState),null;case 27:return $(r),e===null&&tt&&(u=r.stateNode=Wv(r.type,r.pendingProps,be.current),sn=r,lr=!0,h=wt,Ja(r.type)?(tp=h,wt=ur(u.firstChild)):wt=h),ln(e,r,r.pendingProps.children,i),Xc(e,r),e===null&&(r.flags|=4194304),r.child;case 5:return e===null&&tt&&((h=u=wt)&&(u=X4(u,r.type,r.pendingProps,lr),u!==null?(r.stateNode=u,sn=r,wt=ur(u.firstChild),lr=!1,h=!0):h=!1),h||Ua(r)),$(r),h=r.type,x=r.pendingProps,j=e!==null?e.memoizedProps:null,u=x.children,Xm(h,x)?u=null:j!==null&&Xm(h,j)&&(r.flags|=32),r.memoizedState!==null&&(h=Wf(e,r,d4,null,null,i),yl._currentValue=h),Xc(e,r),ln(e,r,u,i),r.child;case 6:return e===null&&tt&&((e=i=wt)&&(i=Z4(i,r.pendingProps,lr),i!==null?(r.stateNode=i,sn=r,wt=null,e=!0):e=!1),e||Ua(r)),null;case 13:return Ib(e,r,i);case 4:return ge(r,r.stateNode.containerInfo),u=r.pendingProps,e===null?r.child=Us(r,null,u,i):ln(e,r,u,i),r.child;case 11:return Mb(e,r,r.type,r.pendingProps,i);case 7:return ln(e,r,r.pendingProps,i),r.child;case 8:return ln(e,r,r.pendingProps.children,i),r.child;case 12:return ln(e,r,r.pendingProps.children,i),r.child;case 10:return u=r.pendingProps,Ba(r,r.type,u.value),ln(e,r,u.children,i),r.child;case 9:return h=r.type._context,u=r.pendingProps.children,Ls(r),h=on(h),u=u(h),r.flags|=1,ln(e,r,u,i),r.child;case 14:return Rb(e,r,r.type,r.pendingProps,i);case 15:return Ab(e,r,r.type,r.pendingProps,i);case 19:return Bb(e,r,i);case 31:return v4(e,r,i);case 22:return _b(e,r,i,r.pendingProps);case 24:return Ls(r),u=on(Ut),e===null?(h=Uf(),h===null&&(h=xt,x=Pf(),h.pooledCache=x,x.refCount++,x!==null&&(h.pooledCacheLanes|=i),h=x),r.memoizedState={parent:u,cache:h},$f(r),Ba(r,Ut,h)):((e.lanes&i)!==0&&(Hf(e,r),el(r,null,null,i),Ji()),h=e.memoizedState,x=r.memoizedState,h.parent!==u?(h={parent:u,cache:u},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),Ba(r,Ut,u)):(u=x.cache,Ba(r,Ut,u),u!==h.cache&&zf(r,[Ut],i,!0))),ln(e,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function ia(e){e.flags|=4}function Cm(e,r,i,u,h){if((r=(e.mode&32)!==0)&&(r=!1),r){if(e.flags|=16777216,(h&335544128)===h)if(e.stateNode.complete)e.flags|=8192;else if(pv())e.flags|=8192;else throw Is=Lc,Bf}else e.flags&=-16777217}function Hb(e,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ry(r))if(pv())e.flags|=8192;else throw Is=Lc,Bf}function Qc(e,r){r!==null&&(e.flags|=4),e.flags&16384&&(r=e.tag!==22?lt():536870912,e.lanes|=r,Ho|=r)}function ol(e,r){if(!tt)switch(e.tailMode){case"hidden":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function jt(e){var r=e.alternate!==null&&e.alternate.child===e.child,i=0,u=0;if(r)for(var h=e.child;h!==null;)i|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)i|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=u,e.childLanes=i,r}function w4(e,r,i){var u=r.pendingProps;switch(Af(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(r),null;case 1:return jt(r),null;case 3:return i=r.stateNode,u=null,e!==null&&(u=e.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),ra(Ut),me(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Mo(r)?ia(r):e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Df())),jt(r),null;case 26:var h=r.type,x=r.memoizedState;return e===null?(ia(r),x!==null?(jt(r),Hb(r,x)):(jt(r),Cm(r,h,null,u,i))):x?x!==e.memoizedState?(ia(r),jt(r),Hb(r,x)):(jt(r),r.flags&=-16777217):(e=e.memoizedProps,e!==u&&ia(r),jt(r),Cm(r,h,e,u,i)),null;case 27:if(ie(r),i=be.current,h=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==u&&ia(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return jt(r),null}e=V.current,Mo(r)?w1(r):(e=Wv(h,u,i),r.stateNode=e,ia(r))}return jt(r),null;case 5:if(ie(r),h=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==u&&ia(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return jt(r),null}if(x=V.current,Mo(r))w1(r);else{var j=mu(be.current);switch(x){case 1:x=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:x=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":x=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":x=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":x=j.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof u.is=="string"?j.createElement("select",{is:u.is}):j.createElement("select"),u.multiple?x.multiple=!0:u.size&&(x.size=u.size);break;default:x=typeof u.is=="string"?j.createElement(h,{is:u.is}):j.createElement(h)}}x[te]=r,x[je]=u;e:for(j=r.child;j!==null;){if(j.tag===5||j.tag===6)x.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===r)break e;for(;j.sibling===null;){if(j.return===null||j.return===r)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}r.stateNode=x;e:switch(cn(x,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ia(r)}}return jt(r),Cm(r,r.type,e===null?null:e.memoizedProps,r.pendingProps,i),null;case 6:if(e&&r.stateNode!=null)e.memoizedProps!==u&&ia(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(e=be.current,Mo(r)){if(e=r.stateNode,i=r.memoizedProps,u=null,h=sn,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}e[te]=r,e=!!(e.nodeValue===i||u!==null&&u.suppressHydrationWarning===!0||Iv(e.nodeValue,i)),e||Ua(r,!0)}else e=mu(e).createTextNode(u),e[te]=r,r.stateNode=e}return jt(r),null;case 31:if(i=r.memoizedState,e===null||e.memoizedState!==null){if(u=Mo(r),i!==null){if(e===null){if(!u)throw Error(o(318));if(e=r.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[te]=r}else Ds(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;jt(r),e=!1}else i=Df(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return r.flags&256?(Un(r),r):(Un(r),null);if((r.flags&128)!==0)throw Error(o(558))}return jt(r),null;case 13:if(u=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=Mo(r),u!==null&&u.dehydrated!==null){if(e===null){if(!h)throw Error(o(318));if(h=r.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(o(317));h[te]=r}else Ds(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;jt(r),h=!1}else h=Df(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(Un(r),r):(Un(r),null)}return Un(r),(r.flags&128)!==0?(r.lanes=i,r):(i=u!==null,e=e!==null&&e.memoizedState!==null,i&&(u=r.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==h&&(u.flags|=2048)),i!==e&&i&&(r.child.flags|=8192),Qc(r,r.updateQueue),jt(r),null);case 4:return me(),e===null&&Fm(r.stateNode.containerInfo),jt(r),null;case 10:return ra(r.type),jt(r),null;case 19:if(D(Lt),u=r.memoizedState,u===null)return jt(r),null;if(h=(r.flags&128)!==0,x=u.rendering,x===null)if(h)ol(u,!1);else{if(_t!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(x=Uc(e),x!==null){for(r.flags|=128,ol(u,!1),e=x.updateQueue,r.updateQueue=e,Qc(r,e),r.subtreeFlags=0,e=i,i=r.child;i!==null;)g1(i,e),i=i.sibling;return B(Lt,Lt.current&1|2),tt&&ta(r,u.treeForkCount),r.child}e=e.sibling}u.tail!==null&&Kt()>ru&&(r.flags|=128,h=!0,ol(u,!1),r.lanes=4194304)}else{if(!h)if(e=Uc(x),e!==null){if(r.flags|=128,h=!0,e=e.updateQueue,r.updateQueue=e,Qc(r,e),ol(u,!0),u.tail===null&&u.tailMode==="hidden"&&!x.alternate&&!tt)return jt(r),null}else 2*Kt()-u.renderingStartTime>ru&&i!==536870912&&(r.flags|=128,h=!0,ol(u,!1),r.lanes=4194304);u.isBackwards?(x.sibling=r.child,r.child=x):(e=u.last,e!==null?e.sibling=x:r.child=x,u.last=x)}return u.tail!==null?(e=u.tail,u.rendering=e,u.tail=e.sibling,u.renderingStartTime=Kt(),e.sibling=null,i=Lt.current,B(Lt,h?i&1|2:i&1),tt&&ta(r,u.treeForkCount),e):(jt(r),null);case 22:case 23:return Un(r),Yf(),u=r.memoizedState!==null,e!==null?e.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(i&536870912)!==0&&(r.flags&128)===0&&(jt(r),r.subtreeFlags&6&&(r.flags|=8192)):jt(r),i=r.updateQueue,i!==null&&Qc(r,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==i&&(r.flags|=2048),e!==null&&D(zs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),ra(Ut),jt(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function j4(e,r){switch(Af(r),r.tag){case 1:return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return ra(Ut),me(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 26:case 27:case 5:return ie(r),null;case 31:if(r.memoizedState!==null){if(Un(r),r.alternate===null)throw Error(o(340));Ds()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 13:if(Un(r),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(o(340));Ds()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return D(Lt),null;case 4:return me(),null;case 10:return ra(r.type),null;case 22:case 23:return Un(r),Yf(),e!==null&&D(zs),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 24:return ra(Ut),null;case 25:return null;default:return null}}function Gb(e,r){switch(Af(r),r.tag){case 3:ra(Ut),me();break;case 26:case 27:case 5:ie(r);break;case 4:me();break;case 31:r.memoizedState!==null&&Un(r);break;case 13:Un(r);break;case 19:D(Lt);break;case 10:ra(r.type);break;case 22:case 23:Un(r),Yf(),e!==null&&D(zs);break;case 24:ra(Ut)}}function il(e,r){try{var i=r.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var h=u.next;i=h;do{if((i.tag&e)===e){u=void 0;var x=i.create,j=i.inst;u=x(),j.destroy=u}i=i.next}while(i!==h)}}catch(A){ut(r,r.return,A)}}function Ya(e,r,i){try{var u=r.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var x=h.next;u=x;do{if((u.tag&e)===e){var j=u.inst,A=j.destroy;if(A!==void 0){j.destroy=void 0,h=r;var z=i,J=A;try{J()}catch(le){ut(h,z,le)}}}u=u.next}while(u!==x)}}catch(le){ut(r,r.return,le)}}function Vb(e){var r=e.updateQueue;if(r!==null){var i=e.stateNode;try{O1(r,i)}catch(u){ut(e,e.return,u)}}}function Fb(e,r,i){i.props=$s(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(u){ut(e,r,u)}}function ll(e,r){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var u=e.stateNode;break;case 30:u=e.stateNode;break;default:u=e.stateNode}typeof i=="function"?e.refCleanup=i(u):i.current=u}}catch(h){ut(e,r,h)}}function Lr(e,r){var i=e.ref,u=e.refCleanup;if(i!==null)if(typeof u=="function")try{u()}catch(h){ut(e,r,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(h){ut(e,r,h)}else i.current=null}function Yb(e){var r=e.type,i=e.memoizedProps,u=e.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&u.focus();break e;case"img":i.src?u.src=i.src:i.srcSet&&(u.srcset=i.srcSet)}}catch(h){ut(e,e.return,h)}}function Sm(e,r,i){try{var u=e.stateNode;V4(u,e.type,i,r),u[je]=r}catch(h){ut(e,e.return,h)}}function qb(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ja(e.type)||e.tag===4}function Nm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ja(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Em(e,r,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(e),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Qr));else if(u!==4&&(u===27&&Ja(e.type)&&(i=e.stateNode,r=null),e=e.child,e!==null))for(Em(e,r,i),e=e.sibling;e!==null;)Em(e,r,i),e=e.sibling}function Jc(e,r,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?i.insertBefore(e,r):i.appendChild(e);else if(u!==4&&(u===27&&Ja(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Jc(e,r,i),e=e.sibling;e!==null;)Jc(e,r,i),e=e.sibling}function Kb(e){var r=e.stateNode,i=e.memoizedProps;try{for(var u=e.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);cn(r,u,i),r[te]=e,r[je]=i}catch(x){ut(e,e.return,x)}}var la=!1,Ht=!1,km=!1,Wb=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function C4(e,r){if(e=e.containerInfo,Km=yu,e=i1(e),yf(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var h=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var j=0,A=-1,z=-1,J=0,le=0,he=e,ee=null;t:for(;;){for(var re;he!==i||h!==0&&he.nodeType!==3||(A=j+h),he!==x||u!==0&&he.nodeType!==3||(z=j+u),he.nodeType===3&&(j+=he.nodeValue.length),(re=he.firstChild)!==null;)ee=he,he=re;for(;;){if(he===e)break t;if(ee===i&&++J===h&&(A=j),ee===x&&++le===u&&(z=j),(re=he.nextSibling)!==null)break;he=ee,ee=he.parentNode}he=re}i=A===-1||z===-1?null:{start:A,end:z}}else i=null}i=i||{start:0,end:0}}else i=null;for(Wm={focusedElem:e,selectionRange:i},yu=!1,Zt=r;Zt!==null;)if(r=Zt,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,Zt=e;else for(;Zt!==null;){switch(r=Zt,x=r.alternate,e=r.flags,r.tag){case 0:if((e&4)!==0&&(e=r.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)h=e[i],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&x!==null){e=void 0,i=r,h=x.memoizedProps,x=x.memoizedState,u=i.stateNode;try{var Ee=$s(i.type,h);e=u.getSnapshotBeforeUpdate(Ee,x),u.__reactInternalSnapshotBeforeUpdate=e}catch(Oe){ut(i,i.return,Oe)}}break;case 3:if((e&1024)!==0){if(e=r.stateNode.containerInfo,i=e.nodeType,i===9)Qm(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Qm(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=r.sibling,e!==null){e.return=r.return,Zt=e;break}Zt=r.return}}function Xb(e,r,i){var u=i.flags;switch(i.tag){case 0:case 11:case 15:ua(e,i),u&4&&il(5,i);break;case 1:if(ua(e,i),u&4)if(e=i.stateNode,r===null)try{e.componentDidMount()}catch(j){ut(i,i.return,j)}else{var h=$s(i.type,r.memoizedProps);r=r.memoizedState;try{e.componentDidUpdate(h,r,e.__reactInternalSnapshotBeforeUpdate)}catch(j){ut(i,i.return,j)}}u&64&&Vb(i),u&512&&ll(i,i.return);break;case 3:if(ua(e,i),u&64&&(e=i.updateQueue,e!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{O1(e,r)}catch(j){ut(i,i.return,j)}}break;case 27:r===null&&u&4&&Kb(i);case 26:case 5:ua(e,i),r===null&&u&4&&Yb(i),u&512&&ll(i,i.return);break;case 12:ua(e,i);break;case 31:ua(e,i),u&4&&Jb(e,i);break;case 13:ua(e,i),u&4&&ev(e,i),u&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=_4.bind(null,i),Q4(e,i))));break;case 22:if(u=i.memoizedState!==null||la,!u){r=r!==null&&r.memoizedState!==null||Ht,h=la;var x=Ht;la=u,(Ht=r)&&!x?da(e,i,(i.subtreeFlags&8772)!==0):ua(e,i),la=h,Ht=x}break;case 30:break;default:ua(e,i)}}function Zb(e){var r=e.alternate;r!==null&&(e.alternate=null,Zb(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&mn(r)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Nt=null,Sn=!1;function ca(e,r,i){for(i=i.child;i!==null;)Qb(e,r,i),i=i.sibling}function Qb(e,r,i){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Dn,i)}catch{}switch(i.tag){case 26:Ht||Lr(i,r),ca(e,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ht||Lr(i,r);var u=Nt,h=Sn;Ja(i.type)&&(Nt=i.stateNode,Sn=!1),ca(e,r,i),xl(i.stateNode),Nt=u,Sn=h;break;case 5:Ht||Lr(i,r);case 6:if(u=Nt,h=Sn,Nt=null,ca(e,r,i),Nt=u,Sn=h,Nt!==null)if(Sn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(i.stateNode)}catch(x){ut(i,r,x)}else try{Nt.removeChild(i.stateNode)}catch(x){ut(i,r,x)}break;case 18:Nt!==null&&(Sn?(e=Nt,Vv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Xo(e)):Vv(Nt,i.stateNode));break;case 4:u=Nt,h=Sn,Nt=i.stateNode.containerInfo,Sn=!0,ca(e,r,i),Nt=u,Sn=h;break;case 0:case 11:case 14:case 15:Ya(2,i,r),Ht||Ya(4,i,r),ca(e,r,i);break;case 1:Ht||(Lr(i,r),u=i.stateNode,typeof u.componentWillUnmount=="function"&&Fb(i,r,u)),ca(e,r,i);break;case 21:ca(e,r,i);break;case 22:Ht=(u=Ht)||i.memoizedState!==null,ca(e,r,i),Ht=u;break;default:ca(e,r,i)}}function Jb(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xo(e)}catch(i){ut(r,r.return,i)}}}function ev(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xo(e)}catch(i){ut(r,r.return,i)}}function S4(e){switch(e.tag){case 31:case 13:case 19:var r=e.stateNode;return r===null&&(r=e.stateNode=new Wb),r;case 22:return e=e.stateNode,r=e._retryCache,r===null&&(r=e._retryCache=new Wb),r;default:throw Error(o(435,e.tag))}}function eu(e,r){var i=S4(e);r.forEach(function(u){if(!i.has(u)){i.add(u);var h=D4.bind(null,e,u);u.then(h,h)}})}function Nn(e,r){var i=r.deletions;if(i!==null)for(var u=0;u<i.length;u++){var h=i[u],x=e,j=r,A=j;e:for(;A!==null;){switch(A.tag){case 27:if(Ja(A.type)){Nt=A.stateNode,Sn=!1;break e}break;case 5:Nt=A.stateNode,Sn=!1;break e;case 3:case 4:Nt=A.stateNode.containerInfo,Sn=!0;break e}A=A.return}if(Nt===null)throw Error(o(160));Qb(x,j,h),Nt=null,Sn=!1,x=h.alternate,x!==null&&(x.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)tv(r,e),r=r.sibling}var yr=null;function tv(e,r){var i=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Nn(r,e),En(e),u&4&&(Ya(3,e,e.return),il(3,e),Ya(5,e,e.return));break;case 1:Nn(r,e),En(e),u&512&&(Ht||i===null||Lr(i,i.return)),u&64&&la&&(e=e.updateQueue,e!==null&&(u=e.callbacks,u!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?u:i.concat(u))));break;case 26:var h=yr;if(Nn(r,e),En(e),u&512&&(Ht||i===null||Lr(i,i.return)),u&4){var x=i!==null?i.memoizedState:null;if(u=e.memoizedState,i===null)if(u===null)if(e.stateNode===null){e:{u=e.type,i=e.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":x=h.getElementsByTagName("title")[0],(!x||x[jn]||x[te]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=h.createElement(u),h.head.insertBefore(x,h.querySelector("head > title"))),cn(x,u,i),x[te]=e,Xt(x),u=x;break e;case"link":var j=ty("link","href",h).get(u+(i.href||""));if(j){for(var A=0;A<j.length;A++)if(x=j[A],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){j.splice(A,1);break t}}x=h.createElement(u),cn(x,u,i),h.head.appendChild(x);break;case"meta":if(j=ty("meta","content",h).get(u+(i.content||""))){for(A=0;A<j.length;A++)if(x=j[A],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){j.splice(A,1);break t}}x=h.createElement(u),cn(x,u,i),h.head.appendChild(x);break;default:throw Error(o(468,u))}x[te]=e,Xt(x),u=x}e.stateNode=u}else ny(h,e.type,e.stateNode);else e.stateNode=ey(h,u,e.memoizedProps);else x!==u?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,u===null?ny(h,e.type,e.stateNode):ey(h,u,e.memoizedProps)):u===null&&e.stateNode!==null&&Sm(e,e.memoizedProps,i.memoizedProps)}break;case 27:Nn(r,e),En(e),u&512&&(Ht||i===null||Lr(i,i.return)),i!==null&&u&4&&Sm(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Nn(r,e),En(e),u&512&&(Ht||i===null||Lr(i,i.return)),e.flags&32){h=e.stateNode;try{vo(h,"")}catch(Ee){ut(e,e.return,Ee)}}u&4&&e.stateNode!=null&&(h=e.memoizedProps,Sm(e,h,i!==null?i.memoizedProps:h)),u&1024&&(km=!0);break;case 6:if(Nn(r,e),En(e),u&4){if(e.stateNode===null)throw Error(o(162));u=e.memoizedProps,i=e.stateNode;try{i.nodeValue=u}catch(Ee){ut(e,e.return,Ee)}}break;case 3:if(gu=null,h=yr,yr=pu(r.containerInfo),Nn(r,e),yr=h,En(e),u&4&&i!==null&&i.memoizedState.isDehydrated)try{Xo(r.containerInfo)}catch(Ee){ut(e,e.return,Ee)}km&&(km=!1,nv(e));break;case 4:u=yr,yr=pu(e.stateNode.containerInfo),Nn(r,e),En(e),yr=u;break;case 12:Nn(r,e),En(e);break;case 31:Nn(r,e),En(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,eu(e,u)));break;case 13:Nn(r,e),En(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(nu=Kt()),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,eu(e,u)));break;case 22:h=e.memoizedState!==null;var z=i!==null&&i.memoizedState!==null,J=la,le=Ht;if(la=J||h,Ht=le||z,Nn(r,e),Ht=le,la=J,En(e),u&8192)e:for(r=e.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(i===null||z||la||Ht||Hs(e)),i=null,r=e;;){if(r.tag===5||r.tag===26){if(i===null){z=i=r;try{if(x=z.stateNode,h)j=x.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{A=z.stateNode;var he=z.memoizedProps.style,ee=he!=null&&he.hasOwnProperty("display")?he.display:null;A.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(Ee){ut(z,z.return,Ee)}}}else if(r.tag===6){if(i===null){z=r;try{z.stateNode.nodeValue=h?"":z.memoizedProps}catch(Ee){ut(z,z.return,Ee)}}}else if(r.tag===18){if(i===null){z=r;try{var re=z.stateNode;h?Fv(re,!0):Fv(z.stateNode,!1)}catch(Ee){ut(z,z.return,Ee)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=e.updateQueue,u!==null&&(i=u.retryQueue,i!==null&&(u.retryQueue=null,eu(e,i))));break;case 19:Nn(r,e),En(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,eu(e,u)));break;case 30:break;case 21:break;default:Nn(r,e),En(e)}}function En(e){var r=e.flags;if(r&2){try{for(var i,u=e.return;u!==null;){if(qb(u)){i=u;break}u=u.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var h=i.stateNode,x=Nm(e);Jc(e,x,h);break;case 5:var j=i.stateNode;i.flags&32&&(vo(j,""),i.flags&=-33);var A=Nm(e);Jc(e,A,j);break;case 3:case 4:var z=i.stateNode.containerInfo,J=Nm(e);Em(e,J,z);break;default:throw Error(o(161))}}catch(le){ut(e,e.return,le)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function nv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var r=e;nv(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),e=e.sibling}}function ua(e,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Xb(e,r.alternate,r),r=r.sibling}function Hs(e){for(e=e.child;e!==null;){var r=e;switch(r.tag){case 0:case 11:case 14:case 15:Ya(4,r,r.return),Hs(r);break;case 1:Lr(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&Fb(r,r.return,i),Hs(r);break;case 27:xl(r.stateNode);case 26:case 5:Lr(r,r.return),Hs(r);break;case 22:r.memoizedState===null&&Hs(r);break;case 30:Hs(r);break;default:Hs(r)}e=e.sibling}}function da(e,r,i){for(i=i&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,h=e,x=r,j=x.flags;switch(x.tag){case 0:case 11:case 15:da(h,x,i),il(4,x);break;case 1:if(da(h,x,i),u=x,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(J){ut(u,u.return,J)}if(u=x,h=u.updateQueue,h!==null){var A=u.stateNode;try{var z=h.shared.hiddenCallbacks;if(z!==null)for(h.shared.hiddenCallbacks=null,h=0;h<z.length;h++)D1(z[h],A)}catch(J){ut(u,u.return,J)}}i&&j&64&&Vb(x),ll(x,x.return);break;case 27:Kb(x);case 26:case 5:da(h,x,i),i&&u===null&&j&4&&Yb(x),ll(x,x.return);break;case 12:da(h,x,i);break;case 31:da(h,x,i),i&&j&4&&Jb(h,x);break;case 13:da(h,x,i),i&&j&4&&ev(h,x);break;case 22:x.memoizedState===null&&da(h,x,i),ll(x,x.return);break;case 30:break;default:da(h,x,i)}r=r.sibling}}function Tm(e,r){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(e=r.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Ki(i))}function Mm(e,r){e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&Ki(e))}function wr(e,r,i,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)rv(e,r,i,u),r=r.sibling}function rv(e,r,i,u){var h=r.flags;switch(r.tag){case 0:case 11:case 15:wr(e,r,i,u),h&2048&&il(9,r);break;case 1:wr(e,r,i,u);break;case 3:wr(e,r,i,u),h&2048&&(e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&Ki(e)));break;case 12:if(h&2048){wr(e,r,i,u),e=r.stateNode;try{var x=r.memoizedProps,j=x.id,A=x.onPostCommit;typeof A=="function"&&A(j,r.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){ut(r,r.return,z)}}else wr(e,r,i,u);break;case 31:wr(e,r,i,u);break;case 13:wr(e,r,i,u);break;case 23:break;case 22:x=r.stateNode,j=r.alternate,r.memoizedState!==null?x._visibility&2?wr(e,r,i,u):cl(e,r):x._visibility&2?wr(e,r,i,u):(x._visibility|=2,Uo(e,r,i,u,(r.subtreeFlags&10256)!==0||!1)),h&2048&&Tm(j,r);break;case 24:wr(e,r,i,u),h&2048&&Mm(r.alternate,r);break;default:wr(e,r,i,u)}}function Uo(e,r,i,u,h){for(h=h&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var x=e,j=r,A=i,z=u,J=j.flags;switch(j.tag){case 0:case 11:case 15:Uo(x,j,A,z,h),il(8,j);break;case 23:break;case 22:var le=j.stateNode;j.memoizedState!==null?le._visibility&2?Uo(x,j,A,z,h):cl(x,j):(le._visibility|=2,Uo(x,j,A,z,h)),h&&J&2048&&Tm(j.alternate,j);break;case 24:Uo(x,j,A,z,h),h&&J&2048&&Mm(j.alternate,j);break;default:Uo(x,j,A,z,h)}r=r.sibling}}function cl(e,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=e,u=r,h=u.flags;switch(u.tag){case 22:cl(i,u),h&2048&&Tm(u.alternate,u);break;case 24:cl(i,u),h&2048&&Mm(u.alternate,u);break;default:cl(i,u)}r=r.sibling}}var ul=8192;function Bo(e,r,i){if(e.subtreeFlags&ul)for(e=e.child;e!==null;)av(e,r,i),e=e.sibling}function av(e,r,i){switch(e.tag){case 26:Bo(e,r,i),e.flags&ul&&e.memoizedState!==null&&u3(i,yr,e.memoizedState,e.memoizedProps);break;case 5:Bo(e,r,i);break;case 3:case 4:var u=yr;yr=pu(e.stateNode.containerInfo),Bo(e,r,i),yr=u;break;case 22:e.memoizedState===null&&(u=e.alternate,u!==null&&u.memoizedState!==null?(u=ul,ul=16777216,Bo(e,r,i),ul=u):Bo(e,r,i));break;default:Bo(e,r,i)}}function sv(e){var r=e.alternate;if(r!==null&&(e=r.child,e!==null)){r.child=null;do r=e.sibling,e.sibling=null,e=r;while(e!==null)}}function dl(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var u=r[i];Zt=u,iv(u,e)}sv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ov(e),e=e.sibling}function ov(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&Ya(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var r=e.stateNode;e.memoizedState!==null&&r._visibility&2&&(e.return===null||e.return.tag!==13)?(r._visibility&=-3,tu(e)):dl(e);break;default:dl(e)}}function tu(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var u=r[i];Zt=u,iv(u,e)}sv(e)}for(e=e.child;e!==null;){switch(r=e,r.tag){case 0:case 11:case 15:Ya(8,r,r.return),tu(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,tu(r));break;default:tu(r)}e=e.sibling}}function iv(e,r){for(;Zt!==null;){var i=Zt;switch(i.tag){case 0:case 11:case 15:Ya(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var u=i.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Ki(i.memoizedState.cache)}if(u=i.child,u!==null)u.return=i,Zt=u;else e:for(i=e;Zt!==null;){u=Zt;var h=u.sibling,x=u.return;if(Zb(u),u===i){Zt=null;break e}if(h!==null){h.return=x,Zt=h;break e}Zt=x}}}var N4={getCacheForType:function(e){var r=on(Ut),i=r.data.get(e);return i===void 0&&(i=e(),r.data.set(e,i)),i},cacheSignal:function(){return on(Ut).controller.signal}},E4=typeof WeakMap=="function"?WeakMap:Map,it=0,xt=null,Ge=null,Ze=0,ct=0,Bn=null,qa=!1,$o=!1,Rm=!1,fa=0,_t=0,Ka=0,Gs=0,Am=0,$n=0,Ho=0,fl=null,kn=null,_m=!1,nu=0,lv=0,ru=1/0,au=null,Wa=null,Ft=0,Xa=null,Go=null,ma=0,Dm=0,Om=null,cv=null,ml=0,Lm=null;function Hn(){return(it&2)!==0&&Ze!==0?Ze&-Ze:P.T!==null?$m():Li()}function uv(){if($n===0)if((Ze&536870912)===0||tt){var e=Oa;Oa<<=1,(Oa&3932160)===0&&(Oa=262144),$n=e}else $n=536870912;return e=In.current,e!==null&&(e.flags|=32),$n}function Tn(e,r,i){(e===xt&&(ct===2||ct===9)||e.cancelPendingCommit!==null)&&(Vo(e,0),Za(e,Ze,$n,!1)),It(e,i),((it&2)===0||e!==xt)&&(e===xt&&((it&2)===0&&(Gs|=i),_t===4&&Za(e,Ze,$n,!1)),zr(e))}function dv(e,r,i){if((it&6)!==0)throw Error(o(327));var u=!i&&(r&127)===0&&(r&e.expiredLanes)===0||De(e,r),h=u?M4(e,r):Pm(e,r,!0),x=u;do{if(h===0){$o&&!u&&Za(e,r,0,!1);break}else{if(i=e.current.alternate,x&&!k4(i)){h=Pm(e,r,!1),x=!1;continue}if(h===2){if(x=r,e.errorRecoveryDisabledLanes&x)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){r=j;e:{var A=e;h=fl;var z=A.current.memoizedState.isDehydrated;if(z&&(Vo(A,j).flags|=256),j=Pm(A,j,!1),j!==2){if(Rm&&!z){A.errorRecoveryDisabledLanes|=x,Gs|=x,h=4;break e}x=kn,kn=h,x!==null&&(kn===null?kn=x:kn.push.apply(kn,x))}h=j}if(x=!1,h!==2)continue}}if(h===1){Vo(e,0),Za(e,r,0,!0);break}e:{switch(u=e,x=h,x){case 0:case 1:throw Error(o(345));case 4:if((r&4194048)!==r)break;case 6:Za(u,r,$n,!qa);break e;case 2:kn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((r&62914560)===r&&(h=nu+300-Kt(),10<h)){if(Za(u,r,$n,!qa),La(u,0,!0)!==0)break e;ma=r,u.timeoutHandle=Hv(fv.bind(null,u,i,kn,au,_m,r,$n,Gs,Ho,qa,x,"Throttled",-0,0),h);break e}fv(u,i,kn,au,_m,r,$n,Gs,Ho,qa,x,null,-0,0)}}break}while(!0);zr(e)}function fv(e,r,i,u,h,x,j,A,z,J,le,he,ee,re){if(e.timeoutHandle=-1,he=r.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qr},av(r,x,he);var Ee=(x&62914560)===x?nu-Kt():(x&4194048)===x?lv-Kt():0;if(Ee=d3(he,Ee),Ee!==null){ma=x,e.cancelPendingCommit=Ee(yv.bind(null,e,r,x,i,u,h,j,A,z,le,he,null,ee,re)),Za(e,x,j,!J);return}}yv(e,r,x,i,u,h,j,A,z)}function k4(e){for(var r=e;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var u=0;u<i.length;u++){var h=i[u],x=h.getSnapshot;h=h.value;try{if(!zn(x(),h))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Za(e,r,i,u){r&=~Am,r&=~Gs,e.suspendedLanes|=r,e.pingedLanes&=~r,u&&(e.warmLanes|=r),u=e.expirationTimes;for(var h=r;0<h;){var x=31-Rt(h),j=1<<x;u[x]=-1,h&=~j}i!==0&&er(e,i,r)}function su(){return(it&6)===0?(pl(0),!1):!0}function zm(){if(Ge!==null){if(ct===0)var e=Ge.return;else e=Ge,na=Os=null,Qf(e),Oo=null,Xi=0,e=Ge;for(;e!==null;)Gb(e.alternate,e),e=e.return;Ge=null}}function Vo(e,r){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,q4(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ma=0,zm(),xt=e,Ge=i=ea(e.current,null),Ze=r,ct=0,Bn=null,qa=!1,$o=De(e,r),Rm=!1,Ho=$n=Am=Gs=Ka=_t=0,kn=fl=null,_m=!1,(r&8)!==0&&(r|=r&32);var u=e.entangledLanes;if(u!==0)for(e=e.entanglements,u&=r;0<u;){var h=31-Rt(u),x=1<<h;r|=e[h],u&=~x}return fa=r,Ec(),i}function mv(e,r){Ie=null,P.H=al,r===Do||r===Oc?(r=M1(),ct=3):r===Bf?(r=M1(),ct=4):ct=r===pm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Bn=r,Ge===null&&(_t=1,Kc(e,sr(r,e.current)))}function pv(){var e=In.current;return e===null?!0:(Ze&4194048)===Ze?cr===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?e===cr:!1}function hv(){var e=P.H;return P.H=al,e===null?al:e}function gv(){var e=P.A;return P.A=N4,e}function ou(){_t=4,qa||(Ze&4194048)!==Ze&&In.current!==null||($o=!0),(Ka&134217727)===0&&(Gs&134217727)===0||xt===null||Za(xt,Ze,$n,!1)}function Pm(e,r,i){var u=it;it|=2;var h=hv(),x=gv();(xt!==e||Ze!==r)&&(au=null,Vo(e,r)),r=!1;var j=_t;e:do try{if(ct!==0&&Ge!==null){var A=Ge,z=Bn;switch(ct){case 8:zm(),j=6;break e;case 3:case 2:case 9:case 6:In.current===null&&(r=!0);var J=ct;if(ct=0,Bn=null,Fo(e,A,z,J),i&&$o){j=0;break e}break;default:J=ct,ct=0,Bn=null,Fo(e,A,z,J)}}T4(),j=_t;break}catch(le){mv(e,le)}while(!0);return r&&e.shellSuspendCounter++,na=Os=null,it=u,P.H=h,P.A=x,Ge===null&&(xt=null,Ze=0,Ec()),j}function T4(){for(;Ge!==null;)xv(Ge)}function M4(e,r){var i=it;it|=2;var u=hv(),h=gv();xt!==e||Ze!==r?(au=null,ru=Kt()+500,Vo(e,r)):$o=De(e,r);e:do try{if(ct!==0&&Ge!==null){r=Ge;var x=Bn;t:switch(ct){case 1:ct=0,Bn=null,Fo(e,r,x,1);break;case 2:case 9:if(k1(x)){ct=0,Bn=null,bv(r);break}r=function(){ct!==2&&ct!==9||xt!==e||(ct=7),zr(e)},x.then(r,r);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:k1(x)?(ct=0,Bn=null,bv(r)):(ct=0,Bn=null,Fo(e,r,x,7));break;case 5:var j=null;switch(Ge.tag){case 26:j=Ge.memoizedState;case 5:case 27:var A=Ge;if(j?ry(j):A.stateNode.complete){ct=0,Bn=null;var z=A.sibling;if(z!==null)Ge=z;else{var J=A.return;J!==null?(Ge=J,iu(J)):Ge=null}break t}}ct=0,Bn=null,Fo(e,r,x,5);break;case 6:ct=0,Bn=null,Fo(e,r,x,6);break;case 8:zm(),_t=6;break e;default:throw Error(o(462))}}R4();break}catch(le){mv(e,le)}while(!0);return na=Os=null,P.H=u,P.A=h,it=i,Ge!==null?0:(xt=null,Ze=0,Ec(),_t)}function R4(){for(;Ge!==null&&!wn();)xv(Ge)}function xv(e){var r=$b(e.alternate,e,fa);e.memoizedProps=e.pendingProps,r===null?iu(e):Ge=r}function bv(e){var r=e,i=r.alternate;switch(r.tag){case 15:case 0:r=Lb(i,r,r.pendingProps,r.type,void 0,Ze);break;case 11:r=Lb(i,r,r.pendingProps,r.type.render,r.ref,Ze);break;case 5:Qf(r);default:Gb(i,r),r=Ge=g1(r,fa),r=$b(i,r,fa)}e.memoizedProps=e.pendingProps,r===null?iu(e):Ge=r}function Fo(e,r,i,u){na=Os=null,Qf(r),Oo=null,Xi=0;var h=r.return;try{if(b4(e,h,r,i,Ze)){_t=1,Kc(e,sr(i,e.current)),Ge=null;return}}catch(x){if(h!==null)throw Ge=h,x;_t=1,Kc(e,sr(i,e.current)),Ge=null;return}r.flags&32768?(tt||u===1?e=!0:$o||(Ze&536870912)!==0?e=!1:(qa=e=!0,(u===2||u===9||u===3||u===6)&&(u=In.current,u!==null&&u.tag===13&&(u.flags|=16384))),vv(r,e)):iu(r)}function iu(e){var r=e;do{if((r.flags&32768)!==0){vv(r,qa);return}e=r.return;var i=w4(r.alternate,r,fa);if(i!==null){Ge=i;return}if(r=r.sibling,r!==null){Ge=r;return}Ge=r=e}while(r!==null);_t===0&&(_t=5)}function vv(e,r){do{var i=j4(e.alternate,e);if(i!==null){i.flags&=32767,Ge=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=i}while(e!==null);_t=6,Ge=null}function yv(e,r,i,u,h,x,j,A,z){e.cancelPendingCommit=null;do lu();while(Ft!==0);if((it&6)!==0)throw Error(o(327));if(r!==null){if(r===e.current)throw Error(o(177));if(x=r.lanes|r.childLanes,x|=Nf,Jn(e,i,x,j,A,z),e===xt&&(Ge=xt=null,Ze=0),Go=r,Xa=e,ma=i,Dm=x,Om=h,cv=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,O4(Da,function(){return Nv(),null})):(e.callbackNode=null,e.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=P.T,P.T=null,h=W.p,W.p=2,j=it,it|=4;try{C4(e,r,i)}finally{it=j,W.p=h,P.T=u}}Ft=1,wv(),jv(),Cv()}}function wv(){if(Ft===1){Ft=0;var e=Xa,r=Go,i=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||i){i=P.T,P.T=null;var u=W.p;W.p=2;var h=it;it|=4;try{tv(r,e);var x=Wm,j=i1(e.containerInfo),A=x.focusedElem,z=x.selectionRange;if(j!==A&&A&&A.ownerDocument&&o1(A.ownerDocument.documentElement,A)){if(z!==null&&yf(A)){var J=z.start,le=z.end;if(le===void 0&&(le=J),"selectionStart"in A)A.selectionStart=J,A.selectionEnd=Math.min(le,A.value.length);else{var he=A.ownerDocument||document,ee=he&&he.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),Ee=A.textContent.length,Oe=Math.min(z.start,Ee),ht=z.end===void 0?Oe:Math.min(z.end,Ee);!re.extend&&Oe>ht&&(j=ht,ht=Oe,Oe=j);var F=s1(A,Oe),U=s1(A,ht);if(F&&U&&(re.rangeCount!==1||re.anchorNode!==F.node||re.anchorOffset!==F.offset||re.focusNode!==U.node||re.focusOffset!==U.offset)){var Q=he.createRange();Q.setStart(F.node,F.offset),re.removeAllRanges(),Oe>ht?(re.addRange(Q),re.extend(U.node,U.offset)):(Q.setEnd(U.node,U.offset),re.addRange(Q))}}}}for(he=[],re=A;re=re.parentNode;)re.nodeType===1&&he.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<he.length;A++){var fe=he[A];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}yu=!!Km,Wm=Km=null}finally{it=h,W.p=u,P.T=i}}e.current=r,Ft=2}}function jv(){if(Ft===2){Ft=0;var e=Xa,r=Go,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=P.T,P.T=null;var u=W.p;W.p=2;var h=it;it|=4;try{Xb(e,r.alternate,r)}finally{it=h,W.p=u,P.T=i}}Ft=3}}function Cv(){if(Ft===4||Ft===3){Ft=0,Zn();var e=Xa,r=Go,i=ma,u=cv;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ft=5:(Ft=0,Go=Xa=null,Sv(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(Wa=null),Oi(i),r=r.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Dn,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=P.T,h=W.p,W.p=2,P.T=null;try{for(var x=e.onRecoverableError,j=0;j<u.length;j++){var A=u[j];x(A.value,{componentStack:A.stack})}}finally{P.T=r,W.p=h}}(ma&3)!==0&&lu(),zr(e),h=e.pendingLanes,(i&261930)!==0&&(h&42)!==0?e===Lm?ml++:(ml=0,Lm=e):ml=0,pl(0)}}function Sv(e,r){(e.pooledCacheLanes&=r)===0&&(r=e.pooledCache,r!=null&&(e.pooledCache=null,Ki(r)))}function lu(){return wv(),jv(),Cv(),Nv()}function Nv(){if(Ft!==5)return!1;var e=Xa,r=Dm;Dm=0;var i=Oi(ma),u=P.T,h=W.p;try{W.p=32>i?32:i,P.T=null,i=Om,Om=null;var x=Xa,j=ma;if(Ft=0,Go=Xa=null,ma=0,(it&6)!==0)throw Error(o(331));var A=it;if(it|=4,ov(x.current),rv(x,x.current,j,i),it=A,pl(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Dn,x)}catch{}return!0}finally{W.p=h,P.T=u,Sv(e,r)}}function Ev(e,r,i){r=sr(i,r),r=mm(e.stateNode,r,2),e=Ga(e,r,2),e!==null&&(It(e,2),zr(e))}function ut(e,r,i){if(e.tag===3)Ev(e,e,i);else for(;r!==null;){if(r.tag===3){Ev(r,e,i);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Wa===null||!Wa.has(u))){e=sr(i,e),i=kb(2),u=Ga(r,i,2),u!==null&&(Tb(i,u,r,e),It(u,2),zr(u));break}}r=r.return}}function Im(e,r,i){var u=e.pingCache;if(u===null){u=e.pingCache=new E4;var h=new Set;u.set(r,h)}else h=u.get(r),h===void 0&&(h=new Set,u.set(r,h));h.has(i)||(Rm=!0,h.add(i),e=A4.bind(null,e,r,i),r.then(e,e))}function A4(e,r,i){var u=e.pingCache;u!==null&&u.delete(r),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,xt===e&&(Ze&i)===i&&(_t===4||_t===3&&(Ze&62914560)===Ze&&300>Kt()-nu?(it&2)===0&&Vo(e,0):Am|=i,Ho===Ze&&(Ho=0)),zr(e)}function kv(e,r){r===0&&(r=lt()),e=As(e,r),e!==null&&(It(e,r),zr(e))}function _4(e){var r=e.memoizedState,i=0;r!==null&&(i=r.retryLane),kv(e,i)}function D4(e,r){var i=0;switch(e.tag){case 31:case 13:var u=e.stateNode,h=e.memoizedState;h!==null&&(i=h.retryLane);break;case 19:u=e.stateNode;break;case 22:u=e.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(r),kv(e,i)}function O4(e,r){return br(e,r)}var cu=null,Yo=null,Um=!1,uu=!1,Bm=!1,Qa=0;function zr(e){e!==Yo&&e.next===null&&(Yo===null?cu=Yo=e:Yo=Yo.next=e),uu=!0,Um||(Um=!0,z4())}function pl(e,r){if(!Bm&&uu){Bm=!0;do for(var i=!1,u=cu;u!==null;){if(e!==0){var h=u.pendingLanes;if(h===0)var x=0;else{var j=u.suspendedLanes,A=u.pingedLanes;x=(1<<31-Rt(42|e)+1)-1,x&=h&~(j&~A),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,Av(u,x))}else x=Ze,x=La(u,u===xt?x:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(x&3)===0||De(u,x)||(i=!0,Av(u,x));u=u.next}while(i);Bm=!1}}function L4(){Tv()}function Tv(){uu=Um=!1;var e=0;Qa!==0&&Y4()&&(e=Qa);for(var r=Kt(),i=null,u=cu;u!==null;){var h=u.next,x=Mv(u,r);x===0?(u.next=null,i===null?cu=h:i.next=h,h===null&&(Yo=i)):(i=u,(e!==0||(x&3)!==0)&&(uu=!0)),u=h}Ft!==0&&Ft!==5||pl(e),Qa!==0&&(Qa=0)}function Mv(e,r){for(var i=e.suspendedLanes,u=e.pingedLanes,h=e.expirationTimes,x=e.pendingLanes&-62914561;0<x;){var j=31-Rt(x),A=1<<j,z=h[j];z===-1?((A&i)===0||(A&u)!==0)&&(h[j]=rt(A,r)):z<=r&&(e.expiredLanes|=A),x&=~A}if(r=xt,i=Ze,i=La(e,e===r?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),u=e.callbackNode,i===0||e===r&&(ct===2||ct===9)||e.cancelPendingCommit!==null)return u!==null&&u!==null&&yn(u),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||De(e,i)){if(r=i&-i,r===e.callbackPriority)return r;switch(u!==null&&yn(u),Oi(i)){case 2:case 8:i=Qn;break;case 32:i=Da;break;case 268435456:i=qr;break;default:i=Da}return u=Rv.bind(null,e),i=br(i,u),e.callbackPriority=r,e.callbackNode=i,r}return u!==null&&u!==null&&yn(u),e.callbackPriority=2,e.callbackNode=null,2}function Rv(e,r){if(Ft!==0&&Ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(lu()&&e.callbackNode!==i)return null;var u=Ze;return u=La(e,e===xt?u:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),u===0?null:(dv(e,u,r),Mv(e,Kt()),e.callbackNode!=null&&e.callbackNode===i?Rv.bind(null,e):null)}function Av(e,r){if(lu())return null;dv(e,r,!0)}function z4(){K4(function(){(it&6)!==0?br(Pt,L4):Tv()})}function $m(){if(Qa===0){var e=Ao;e===0&&(e=Wr,Wr<<=1,(Wr&261888)===0&&(Wr=256)),Qa=e}return Qa}function _v(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:bc(""+e)}function Dv(e,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,e.id&&i.setAttribute("form",e.id),r.parentNode.insertBefore(i,r),e=new FormData(e),i.parentNode.removeChild(i),e}function P4(e,r,i,u,h){if(r==="submit"&&i&&i.stateNode===h){var x=_v((h[je]||null).action),j=u.submitter;j&&(r=(r=j[je]||null)?_v(r.formAction):j.getAttribute("formAction"),r!==null&&(x=r,j=null));var A=new jc("action","action",null,u,h);e.push({event:A,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Qa!==0){var z=j?Dv(h,j):new FormData(h);im(i,{pending:!0,data:z,method:h.method,action:x},null,z)}}else typeof x=="function"&&(A.preventDefault(),z=j?Dv(h,j):new FormData(h),im(i,{pending:!0,data:z,method:h.method,action:x},x,z))},currentTarget:h}]})}}for(var Hm=0;Hm<Sf.length;Hm++){var Gm=Sf[Hm],I4=Gm.toLowerCase(),U4=Gm[0].toUpperCase()+Gm.slice(1);vr(I4,"on"+U4)}vr(u1,"onAnimationEnd"),vr(d1,"onAnimationIteration"),vr(f1,"onAnimationStart"),vr("dblclick","onDoubleClick"),vr("focusin","onFocus"),vr("focusout","onBlur"),vr(t4,"onTransitionRun"),vr(n4,"onTransitionStart"),vr(r4,"onTransitionCancel"),vr(m1,"onTransitionEnd"),xo("onMouseEnter",["mouseout","mouseover"]),xo("onMouseLeave",["mouseout","mouseover"]),xo("onPointerEnter",["pointerout","pointerover"]),xo("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="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(" "),B4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hl));function Ov(e,r){r=(r&4)!==0;for(var i=0;i<e.length;i++){var u=e[i],h=u.event;u=u.listeners;e:{var x=void 0;if(r)for(var j=u.length-1;0<=j;j--){var A=u[j],z=A.instance,J=A.currentTarget;if(A=A.listener,z!==x&&h.isPropagationStopped())break e;x=A,h.currentTarget=J;try{x(h)}catch(le){Nc(le)}h.currentTarget=null,x=z}else for(j=0;j<u.length;j++){if(A=u[j],z=A.instance,J=A.currentTarget,A=A.listener,z!==x&&h.isPropagationStopped())break e;x=A,h.currentTarget=J;try{x(h)}catch(le){Nc(le)}h.currentTarget=null,x=z}}}}function Ve(e,r){var i=r[Le];i===void 0&&(i=r[Le]=new Set);var u=e+"__bubble";i.has(u)||(Lv(r,e,2,!1),i.add(u))}function Vm(e,r,i){var u=0;r&&(u|=4),Lv(i,e,u,r)}var du="_reactListening"+Math.random().toString(36).slice(2);function Fm(e){if(!e[du]){e[du]=!0,Tx.forEach(function(i){i!=="selectionchange"&&(B4.has(i)||Vm(i,!1,e),Vm(i,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[du]||(r[du]=!0,Vm("selectionchange",!1,r))}}function Lv(e,r,i,u){switch(uy(r)){case 2:var h=p3;break;case 8:h=h3;break;default:h=op}i=h.bind(null,r,i,e),h=void 0,!df||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),u?h!==void 0?e.addEventListener(r,i,{capture:!0,passive:h}):e.addEventListener(r,i,!0):h!==void 0?e.addEventListener(r,i,{passive:h}):e.addEventListener(r,i,!1)}function Ym(e,r,i,u,h){var x=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var j=u.tag;if(j===3||j===4){var A=u.stateNode.containerInfo;if(A===h)break;if(j===4)for(j=u.return;j!==null;){var z=j.tag;if((z===3||z===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;A!==null;){if(j=an(A),j===null)return;if(z=j.tag,z===5||z===6||z===26||z===27){u=x=j;continue e}A=A.parentNode}}u=u.return}Bx(function(){var J=x,le=cf(i),he=[];e:{var ee=p1.get(e);if(ee!==void 0){var re=jc,Ee=e;switch(e){case"keypress":if(yc(i)===0)break e;case"keydown":case"keyup":re=D5;break;case"focusin":Ee="focus",re=hf;break;case"focusout":Ee="blur",re=hf;break;case"beforeblur":case"afterblur":re=hf;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Gx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=w5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=z5;break;case u1:case d1:case f1:re=S5;break;case m1:re=I5;break;case"scroll":case"scrollend":re=v5;break;case"wheel":re=B5;break;case"copy":case"cut":case"paste":re=E5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Fx;break;case"toggle":case"beforetoggle":re=H5}var Oe=(r&4)!==0,ht=!Oe&&(e==="scroll"||e==="scrollend"),F=Oe?ee!==null?ee+"Capture":null:ee;Oe=[];for(var U=J,Q;U!==null;){var fe=U;if(Q=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||Q===null||F===null||(fe=Pi(U,F),fe!=null&&Oe.push(gl(U,fe,Q))),ht)break;U=U.return}0<Oe.length&&(ee=new re(ee,Ee,null,i,le),he.push({event:ee,listeners:Oe}))}}if((r&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",re=e==="mouseout"||e==="pointerout",ee&&i!==lf&&(Ee=i.relatedTarget||i.fromElement)&&(an(Ee)||Ee[we]))break e;if((re||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(Ee=i.relatedTarget||i.toElement,re=J,Ee=Ee?an(Ee):null,Ee!==null&&(ht=l(Ee),Oe=Ee.tag,Ee!==ht||Oe!==5&&Oe!==27&&Oe!==6)&&(Ee=null)):(re=null,Ee=J),re!==Ee)){if(Oe=Gx,fe="onMouseLeave",F="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=Fx,fe="onPointerLeave",F="onPointerEnter",U="pointer"),ht=re==null?ee:_r(re),Q=Ee==null?ee:_r(Ee),ee=new Oe(fe,U+"leave",re,i,le),ee.target=ht,ee.relatedTarget=Q,fe=null,an(le)===J&&(Oe=new Oe(F,U+"enter",Ee,i,le),Oe.target=Q,Oe.relatedTarget=ht,fe=Oe),ht=fe,re&&Ee)t:{for(Oe=$4,F=re,U=Ee,Q=0,fe=F;fe;fe=Oe(fe))Q++;fe=0;for(var Re=U;Re;Re=Oe(Re))fe++;for(;0<Q-fe;)F=Oe(F),Q--;for(;0<fe-Q;)U=Oe(U),fe--;for(;Q--;){if(F===U||U!==null&&F===U.alternate){Oe=F;break t}F=Oe(F),U=Oe(U)}Oe=null}else Oe=null;re!==null&&zv(he,ee,re,Oe,!1),Ee!==null&&ht!==null&&zv(he,ht,Ee,Oe,!0)}}e:{if(ee=J?_r(J):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var at=Jx;else if(Zx(ee))if(e1)at=Q5;else{at=X5;var ke=W5}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?J&&of(J.elementType)&&(at=Jx):at=Z5;if(at&&(at=at(e,J))){Qx(he,at,i,le);break e}ke&&ke(e,ee,J),e==="focusout"&&J&&ee.type==="number"&&J.memoizedProps.value!=null&&sf(ee,"number",ee.value)}switch(ke=J?_r(J):window,e){case"focusin":(Zx(ke)||ke.contentEditable==="true")&&(Co=ke,wf=J,Fi=null);break;case"focusout":Fi=wf=Co=null;break;case"mousedown":jf=!0;break;case"contextmenu":case"mouseup":case"dragend":jf=!1,l1(he,i,le);break;case"selectionchange":if(e4)break;case"keydown":case"keyup":l1(he,i,le)}var $e;if(xf)e:{switch(e){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else jo?Wx(e,i)&&(Qe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Qe="onCompositionStart");Qe&&(Yx&&i.locale!=="ko"&&(jo||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&jo&&($e=$x()):(za=le,ff="value"in za?za.value:za.textContent,jo=!0)),ke=fu(J,Qe),0<ke.length&&(Qe=new Vx(Qe,e,null,i,le),he.push({event:Qe,listeners:ke}),$e?Qe.data=$e:($e=Xx(i),$e!==null&&(Qe.data=$e)))),($e=V5?F5(e,i):Y5(e,i))&&(Qe=fu(J,"onBeforeInput"),0<Qe.length&&(ke=new Vx("onBeforeInput","beforeinput",null,i,le),he.push({event:ke,listeners:Qe}),ke.data=$e)),P4(he,e,J,i,le)}Ov(he,r)})}function gl(e,r,i){return{instance:e,listener:r,currentTarget:i}}function fu(e,r){for(var i=r+"Capture",u=[];e!==null;){var h=e,x=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||x===null||(h=Pi(e,i),h!=null&&u.unshift(gl(e,h,x)),h=Pi(e,r),h!=null&&u.push(gl(e,h,x))),e.tag===3)return u;e=e.return}return[]}function $4(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zv(e,r,i,u,h){for(var x=r._reactName,j=[];i!==null&&i!==u;){var A=i,z=A.alternate,J=A.stateNode;if(A=A.tag,z!==null&&z===u)break;A!==5&&A!==26&&A!==27||J===null||(z=J,h?(J=Pi(i,x),J!=null&&j.unshift(gl(i,J,z))):h||(J=Pi(i,x),J!=null&&j.push(gl(i,J,z)))),i=i.return}j.length!==0&&e.push({event:r,listeners:j})}var H4=/\r\n?/g,G4=/\u0000|\uFFFD/g;function Pv(e){return(typeof e=="string"?e:""+e).replace(H4,`
|
||
`).replace(G4,"")}function Iv(e,r){return r=Pv(r),Pv(e)===r}function pt(e,r,i,u,h,x){switch(i){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||vo(e,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&vo(e,""+u);break;case"className":gc(e,"class",u);break;case"tabIndex":gc(e,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":gc(e,i,u);break;case"style":Ix(e,u,x);break;case"data":if(r!=="object"){gc(e,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||i!=="href")){e.removeAttribute(i);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(i);break}u=bc(""+u),e.setAttribute(i,u);break;case"action":case"formAction":if(typeof u=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(i==="formAction"?(r!=="input"&&pt(e,r,"name",h.name,h,null),pt(e,r,"formEncType",h.formEncType,h,null),pt(e,r,"formMethod",h.formMethod,h,null),pt(e,r,"formTarget",h.formTarget,h,null)):(pt(e,r,"encType",h.encType,h,null),pt(e,r,"method",h.method,h,null),pt(e,r,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(i);break}u=bc(""+u),e.setAttribute(i,u);break;case"onClick":u!=null&&(e.onclick=Qr);break;case"onScroll":u!=null&&Ve("scroll",e);break;case"onScrollEnd":u!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(h.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":e.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){e.removeAttribute("xlink:href");break}i=bc(""+u),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(i,""+u):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":u===!0?e.setAttribute(i,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(i,u):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?e.setAttribute(i,u):e.removeAttribute(i);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?e.removeAttribute(i):e.setAttribute(i,u);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),hc(e,"popover",u);break;case"xlinkActuate":Zr(e,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Zr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Zr(e,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Zr(e,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Zr(e,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Zr(e,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":hc(e,"is",u);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=x5.get(i)||i,hc(e,i,u))}}function qm(e,r,i,u,h,x){switch(i){case"style":Ix(e,u,x);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(h.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof u=="string"?vo(e,u):(typeof u=="number"||typeof u=="bigint")&&vo(e,""+u);break;case"onScroll":u!=null&&Ve("scroll",e);break;case"onScrollEnd":u!=null&&Ve("scrollend",e);break;case"onClick":u!=null&&(e.onclick=Qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mx.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(h=i.endsWith("Capture"),r=i.slice(2,h?i.length-7:void 0),x=e[je]||null,x=x!=null?x[i]:null,typeof x=="function"&&e.removeEventListener(r,x,h),typeof u=="function")){typeof x!="function"&&x!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(r,u,h);break e}i in e?e[i]=u:u===!0?e.setAttribute(i,""):hc(e,i,u)}}}function cn(e,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var u=!1,h=!1,x;for(x in i)if(i.hasOwnProperty(x)){var j=i[x];if(j!=null)switch(x){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:pt(e,r,x,j,i,null)}}h&&pt(e,r,"srcSet",i.srcSet,i,null),u&&pt(e,r,"src",i.src,i,null);return;case"input":Ve("invalid",e);var A=x=j=h=null,z=null,J=null;for(u in i)if(i.hasOwnProperty(u)){var le=i[u];if(le!=null)switch(u){case"name":h=le;break;case"type":j=le;break;case"checked":z=le;break;case"defaultChecked":J=le;break;case"value":x=le;break;case"defaultValue":A=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,r));break;default:pt(e,r,u,le,i,null)}}Ox(e,x,A,z,J,j,h,!1);return;case"select":Ve("invalid",e),u=j=x=null;for(h in i)if(i.hasOwnProperty(h)&&(A=i[h],A!=null))switch(h){case"value":x=A;break;case"defaultValue":j=A;break;case"multiple":u=A;default:pt(e,r,h,A,i,null)}r=x,i=j,e.multiple=!!u,r!=null?bo(e,!!u,r,!1):i!=null&&bo(e,!!u,i,!0);return;case"textarea":Ve("invalid",e),x=h=u=null;for(j in i)if(i.hasOwnProperty(j)&&(A=i[j],A!=null))switch(j){case"value":u=A;break;case"defaultValue":h=A;break;case"children":x=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(o(91));break;default:pt(e,r,j,A,i,null)}zx(e,u,h,x);return;case"option":for(z in i)if(i.hasOwnProperty(z)&&(u=i[z],u!=null))switch(z){case"selected":e.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:pt(e,r,z,u,i,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(u=0;u<hl.length;u++)Ve(hl[u],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in i)if(i.hasOwnProperty(J)&&(u=i[J],u!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:pt(e,r,J,u,i,null)}return;default:if(of(r)){for(le in i)i.hasOwnProperty(le)&&(u=i[le],u!==void 0&&qm(e,r,le,u,i,void 0));return}}for(A in i)i.hasOwnProperty(A)&&(u=i[A],u!=null&&pt(e,r,A,u,i,null))}function V4(e,r,i,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,x=null,j=null,A=null,z=null,J=null,le=null;for(re in i){var he=i[re];if(i.hasOwnProperty(re)&&he!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":z=he;default:u.hasOwnProperty(re)||pt(e,r,re,null,u,he)}}for(var ee in u){var re=u[ee];if(he=i[ee],u.hasOwnProperty(ee)&&(re!=null||he!=null))switch(ee){case"type":x=re;break;case"name":h=re;break;case"checked":J=re;break;case"defaultChecked":le=re;break;case"value":j=re;break;case"defaultValue":A=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(o(137,r));break;default:re!==he&&pt(e,r,ee,re,u,he)}}af(e,j,A,z,J,le,x,h);return;case"select":re=j=A=ee=null;for(x in i)if(z=i[x],i.hasOwnProperty(x)&&z!=null)switch(x){case"value":break;case"multiple":re=z;default:u.hasOwnProperty(x)||pt(e,r,x,null,u,z)}for(h in u)if(x=u[h],z=i[h],u.hasOwnProperty(h)&&(x!=null||z!=null))switch(h){case"value":ee=x;break;case"defaultValue":A=x;break;case"multiple":j=x;default:x!==z&&pt(e,r,h,x,u,z)}r=A,i=j,u=re,ee!=null?bo(e,!!i,ee,!1):!!u!=!!i&&(r!=null?bo(e,!!i,r,!0):bo(e,!!i,i?[]:"",!1));return;case"textarea":re=ee=null;for(A in i)if(h=i[A],i.hasOwnProperty(A)&&h!=null&&!u.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:pt(e,r,A,null,u,h)}for(j in u)if(h=u[j],x=i[j],u.hasOwnProperty(j)&&(h!=null||x!=null))switch(j){case"value":ee=h;break;case"defaultValue":re=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(o(91));break;default:h!==x&&pt(e,r,j,h,u,x)}Lx(e,ee,re);return;case"option":for(var Ee in i)if(ee=i[Ee],i.hasOwnProperty(Ee)&&ee!=null&&!u.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:pt(e,r,Ee,null,u,ee)}for(z in u)if(ee=u[z],re=i[z],u.hasOwnProperty(z)&&ee!==re&&(ee!=null||re!=null))switch(z){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:pt(e,r,z,ee,u,re)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in i)ee=i[Oe],i.hasOwnProperty(Oe)&&ee!=null&&!u.hasOwnProperty(Oe)&&pt(e,r,Oe,null,u,ee);for(J in u)if(ee=u[J],re=i[J],u.hasOwnProperty(J)&&ee!==re&&(ee!=null||re!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,r));break;default:pt(e,r,J,ee,u,re)}return;default:if(of(r)){for(var ht in i)ee=i[ht],i.hasOwnProperty(ht)&&ee!==void 0&&!u.hasOwnProperty(ht)&&qm(e,r,ht,void 0,u,ee);for(le in u)ee=u[le],re=i[le],!u.hasOwnProperty(le)||ee===re||ee===void 0&&re===void 0||qm(e,r,le,ee,u,re);return}}for(var F in i)ee=i[F],i.hasOwnProperty(F)&&ee!=null&&!u.hasOwnProperty(F)&&pt(e,r,F,null,u,ee);for(he in u)ee=u[he],re=i[he],!u.hasOwnProperty(he)||ee===re||ee==null&&re==null||pt(e,r,he,ee,u,re)}function Uv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function F4(){if(typeof performance.getEntriesByType=="function"){for(var e=0,r=0,i=performance.getEntriesByType("resource"),u=0;u<i.length;u++){var h=i[u],x=h.transferSize,j=h.initiatorType,A=h.duration;if(x&&A&&Uv(j)){for(j=0,A=h.responseEnd,u+=1;u<i.length;u++){var z=i[u],J=z.startTime;if(J>A)break;var le=z.transferSize,he=z.initiatorType;le&&Uv(he)&&(z=z.responseEnd,j+=le*(z<A?1:(A-J)/(z-J)))}if(--u,r+=8*(x+j)/(h.duration/1e3),e++,10<e)break}}if(0<e)return r/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Km=null,Wm=null;function mu(e){return e.nodeType===9?e:e.ownerDocument}function Bv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $v(e,r){if(e===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&r==="foreignObject"?0:e}function Xm(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Zm=null;function Y4(){var e=window.event;return e&&e.type==="popstate"?e===Zm?!1:(Zm=e,!0):(Zm=null,!1)}var Hv=typeof setTimeout=="function"?setTimeout:void 0,q4=typeof clearTimeout=="function"?clearTimeout:void 0,Gv=typeof Promise=="function"?Promise:void 0,K4=typeof queueMicrotask=="function"?queueMicrotask:typeof Gv<"u"?function(e){return Gv.resolve(null).then(e).catch(W4)}:Hv;function W4(e){setTimeout(function(){throw e})}function Ja(e){return e==="head"}function Vv(e,r){var i=r,u=0;do{var h=i.nextSibling;if(e.removeChild(i),h&&h.nodeType===8)if(i=h.data,i==="/$"||i==="/&"){if(u===0){e.removeChild(h),Xo(r);return}u--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")u++;else if(i==="html")xl(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,xl(i);for(var x=i.firstChild;x;){var j=x.nextSibling,A=x.nodeName;x[jn]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=j}}else i==="body"&&xl(e.ownerDocument.body);i=h}while(i);Xo(r)}function Fv(e,r){var i=e;e=0;do{var u=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),u&&u.nodeType===8)if(i=u.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=u}while(i)}function Qm(e){var r=e.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Qm(i),mn(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function X4(e,r,i,u){for(;e.nodeType===1;){var h=i;if(e.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(u){if(!e[jn])switch(r){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(x=e.getAttribute("rel"),x==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(x!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(x=e.getAttribute("src"),(x!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&x&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(r==="input"&&e.type==="hidden"){var x=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===x)return e}else return e;if(e=ur(e.nextSibling),e===null)break}return null}function Z4(e,r,i){if(r==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=ur(e.nextSibling),e===null))return null;return e}function Yv(e,r){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=ur(e.nextSibling),e===null))return null;return e}function Jm(e){return e.data==="$?"||e.data==="$~"}function ep(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Q4(e,r){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=r;else if(e.data!=="$?"||i.readyState!=="loading")r();else{var u=function(){r(),i.removeEventListener("DOMContentLoaded",u)};i.addEventListener("DOMContentLoaded",u),e._reactRetry=u}}function ur(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return e}var tp=null;function qv(e){e=e.nextSibling;for(var r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(r===0)return ur(e.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}e=e.nextSibling}return null}function Kv(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return e;r--}else i!=="/$"&&i!=="/&"||r++}e=e.previousSibling}return null}function Wv(e,r,i){switch(r=mu(i),e){case"html":if(e=r.documentElement,!e)throw Error(o(452));return e;case"head":if(e=r.head,!e)throw Error(o(453));return e;case"body":if(e=r.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function xl(e){for(var r=e.attributes;r.length;)e.removeAttributeNode(r[0]);mn(e)}var dr=new Map,Xv=new Set;function pu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pa=W.d;W.d={f:J4,r:e3,D:t3,C:n3,L:r3,m:a3,X:o3,S:s3,M:i3};function J4(){var e=pa.f(),r=su();return e||r}function e3(e){var r=tr(e);r!==null&&r.tag===5&&r.type==="form"?mb(r):pa.r(e)}var qo=typeof document>"u"?null:document;function Zv(e,r,i){var u=qo;if(u&&typeof r=="string"&&r){var h=rr(r);h='link[rel="'+e+'"][href="'+h+'"]',typeof i=="string"&&(h+='[crossorigin="'+i+'"]'),Xv.has(h)||(Xv.add(h),e={rel:e,crossOrigin:i,href:r},u.querySelector(h)===null&&(r=u.createElement("link"),cn(r,"link",e),Xt(r),u.head.appendChild(r)))}}function t3(e){pa.D(e),Zv("dns-prefetch",e,null)}function n3(e,r){pa.C(e,r),Zv("preconnect",e,r)}function r3(e,r,i){pa.L(e,r,i);var u=qo;if(u&&e&&r){var h='link[rel="preload"][as="'+rr(r)+'"]';r==="image"&&i&&i.imageSrcSet?(h+='[imagesrcset="'+rr(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(h+='[imagesizes="'+rr(i.imageSizes)+'"]')):h+='[href="'+rr(e)+'"]';var x=h;switch(r){case"style":x=Ko(e);break;case"script":x=Wo(e)}dr.has(x)||(e=v({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:e,as:r},i),dr.set(x,e),u.querySelector(h)!==null||r==="style"&&u.querySelector(bl(x))||r==="script"&&u.querySelector(vl(x))||(r=u.createElement("link"),cn(r,"link",e),Xt(r),u.head.appendChild(r)))}}function a3(e,r){pa.m(e,r);var i=qo;if(i&&e){var u=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+rr(u)+'"][href="'+rr(e)+'"]',x=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Wo(e)}if(!dr.has(x)&&(e=v({rel:"modulepreload",href:e},r),dr.set(x,e),i.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(vl(x)))return}u=i.createElement("link"),cn(u,"link",e),Xt(u),i.head.appendChild(u)}}}function s3(e,r,i){pa.S(e,r,i);var u=qo;if(u&&e){var h=Xr(u).hoistableStyles,x=Ko(e);r=r||"default";var j=h.get(x);if(!j){var A={loading:0,preload:null};if(j=u.querySelector(bl(x)))A.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":r},i),(i=dr.get(x))&&np(e,i);var z=j=u.createElement("link");Xt(z),cn(z,"link",e),z._p=new Promise(function(J,le){z.onload=J,z.onerror=le}),z.addEventListener("load",function(){A.loading|=1}),z.addEventListener("error",function(){A.loading|=2}),A.loading|=4,hu(j,r,u)}j={type:"stylesheet",instance:j,count:1,state:A},h.set(x,j)}}}function o3(e,r){pa.X(e,r);var i=qo;if(i&&e){var u=Xr(i).hoistableScripts,h=Wo(e),x=u.get(h);x||(x=i.querySelector(vl(h)),x||(e=v({src:e,async:!0},r),(r=dr.get(h))&&rp(e,r),x=i.createElement("script"),Xt(x),cn(x,"link",e),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(h,x))}}function i3(e,r){pa.M(e,r);var i=qo;if(i&&e){var u=Xr(i).hoistableScripts,h=Wo(e),x=u.get(h);x||(x=i.querySelector(vl(h)),x||(e=v({src:e,async:!0,type:"module"},r),(r=dr.get(h))&&rp(e,r),x=i.createElement("script"),Xt(x),cn(x,"link",e),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(h,x))}}function Qv(e,r,i,u){var h=(h=be.current)?pu(h):null;if(!h)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=Ko(i.href),i=Xr(h).hoistableStyles,u=i.get(r),u||(u={type:"style",instance:null,count:0,state:null},i.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Ko(i.href);var x=Xr(h).hoistableStyles,j=x.get(e);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(e,j),(x=h.querySelector(bl(e)))&&!x._p&&(j.instance=x,j.state.loading=5),dr.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},dr.set(e,i),x||l3(h,e,i,j.state))),r&&u===null)throw Error(o(528,""));return j}if(r&&u!==null)throw Error(o(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Wo(i),i=Xr(h).hoistableScripts,u=i.get(r),u||(u={type:"script",instance:null,count:0,state:null},i.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ko(e){return'href="'+rr(e)+'"'}function bl(e){return'link[rel="stylesheet"]['+e+"]"}function Jv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function l3(e,r,i,u){e.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=e.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),cn(r,"link",i),Xt(r),e.head.appendChild(r))}function Wo(e){return'[src="'+rr(e)+'"]'}function vl(e){return"script[async]"+e}function ey(e,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var u=e.querySelector('style[data-href~="'+rr(i.href)+'"]');if(u)return r.instance=u,Xt(u),u;var h=v({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return u=(e.ownerDocument||e).createElement("style"),Xt(u),cn(u,"style",h),hu(u,i.precedence,e),r.instance=u;case"stylesheet":h=Ko(i.href);var x=e.querySelector(bl(h));if(x)return r.state.loading|=4,r.instance=x,Xt(x),x;u=Jv(i),(h=dr.get(h))&&np(u,h),x=(e.ownerDocument||e).createElement("link"),Xt(x);var j=x;return j._p=new Promise(function(A,z){j.onload=A,j.onerror=z}),cn(x,"link",u),r.state.loading|=4,hu(x,i.precedence,e),r.instance=x;case"script":return x=Wo(i.src),(h=e.querySelector(vl(x)))?(r.instance=h,Xt(h),h):(u=i,(h=dr.get(x))&&(u=v({},i),rp(u,h)),e=e.ownerDocument||e,h=e.createElement("script"),Xt(h),cn(h,"link",u),e.head.appendChild(h),r.instance=h);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,hu(u,i.precedence,e));return r.instance}function hu(e,r,i){for(var u=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,x=h,j=0;j<u.length;j++){var A=u[j];if(A.dataset.precedence===r)x=A;else if(x!==h)break}x?x.parentNode.insertBefore(e,x.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(e,r.firstChild))}function np(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.title==null&&(e.title=r.title)}function rp(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.integrity==null&&(e.integrity=r.integrity)}var gu=null;function ty(e,r,i){if(gu===null){var u=new Map,h=gu=new Map;h.set(i,u)}else h=gu,u=h.get(i),u||(u=new Map,h.set(i,u));if(u.has(e))return u;for(u.set(e,null),i=i.getElementsByTagName(e),h=0;h<i.length;h++){var x=i[h];if(!(x[jn]||x[te]||e==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var j=x.getAttribute(r)||"";j=e+j;var A=u.get(j);A?A.push(x):u.set(j,[x])}}return u}function ny(e,r,i){e=e.ownerDocument||e,e.head.insertBefore(i,r==="title"?e.querySelector("head > title"):null)}function c3(e,r,i){if(i===1||r.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return e=r.disabled,typeof r.precedence=="string"&&e==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ry(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function u3(e,r,i,u){if(i.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var h=Ko(u.href),x=r.querySelector(bl(h));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(e.count++,e=xu.bind(e),r.then(e,e)),i.state.loading|=4,i.instance=x,Xt(x);return}x=r.ownerDocument||r,u=Jv(u),(h=dr.get(h))&&np(u,h),x=x.createElement("link"),Xt(x);var j=x;j._p=new Promise(function(A,z){j.onload=A,j.onerror=z}),cn(x,"link",u),i.instance=x}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=xu.bind(e),r.addEventListener("load",i),r.addEventListener("error",i))}}var ap=0;function d3(e,r){return e.stylesheets&&e.count===0&&vu(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var u=setTimeout(function(){if(e.stylesheets&&vu(e,e.stylesheets),e.unsuspend){var x=e.unsuspend;e.unsuspend=null,x()}},6e4+r);0<e.imgBytes&&ap===0&&(ap=62500*F4());var h=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vu(e,e.stylesheets),e.unsuspend)){var x=e.unsuspend;e.unsuspend=null,x()}},(e.imgBytes>ap?50:800)+r);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bu=null;function vu(e,r){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bu=new Map,r.forEach(f3,e),bu=null,xu.call(e))}function f3(e,r){if(!(r.state.loading&4)){var i=bu.get(e);if(i)var u=i.get(null);else{i=new Map,bu.set(e,i);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<h.length;x++){var j=h[x];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(i.set(j.dataset.precedence,j),u=j)}u&&i.set(null,u)}h=r.instance,j=h.getAttribute("data-precedence"),x=i.get(j)||u,x===u&&i.set(null,h),i.set(j,h),this.count++,u=xu.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),x?x.parentNode.insertBefore(h,x.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),r.state.loading|=4}}var yl={$$typeof:M,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function m3(e,r,i,u,h,x,j,A,z){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=x,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function ay(e,r,i,u,h,x,j,A,z,J,le,he){return e=new m3(e,r,i,j,z,J,le,he,A),r=1,x===!0&&(r|=24),x=Pn(3,null,null,r),e.current=x,x.stateNode=e,r=Pf(),r.refCount++,e.pooledCache=r,r.refCount++,x.memoizedState={element:u,isDehydrated:i,cache:r},$f(x),e}function sy(e){return e?(e=Eo,e):Eo}function oy(e,r,i,u,h,x){h=sy(h),u.context===null?u.context=h:u.pendingContext=h,u=Ha(r),u.payload={element:i},x=x===void 0?null:x,x!==null&&(u.callback=x),i=Ga(e,u,r),i!==null&&(Tn(i,e,r),Qi(i,e,r))}function iy(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<r?i:r}}function sp(e,r){iy(e,r),(e=e.alternate)&&iy(e,r)}function ly(e){if(e.tag===13||e.tag===31){var r=As(e,67108864);r!==null&&Tn(r,e,67108864),sp(e,67108864)}}function cy(e){if(e.tag===13||e.tag===31){var r=Hn();r=Di(r);var i=As(e,r);i!==null&&Tn(i,e,r),sp(e,r)}}var yu=!0;function p3(e,r,i,u){var h=P.T;P.T=null;var x=W.p;try{W.p=2,op(e,r,i,u)}finally{W.p=x,P.T=h}}function h3(e,r,i,u){var h=P.T;P.T=null;var x=W.p;try{W.p=8,op(e,r,i,u)}finally{W.p=x,P.T=h}}function op(e,r,i,u){if(yu){var h=ip(u);if(h===null)Ym(e,r,u,wu,i),dy(e,u);else if(x3(h,e,r,i,u))u.stopPropagation();else if(dy(e,u),r&4&&-1<g3.indexOf(e)){for(;h!==null;){var x=tr(h);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var j=Wt(x.pendingLanes);if(j!==0){var A=x;for(A.pendingLanes|=2,A.entangledLanes|=2;j;){var z=1<<31-Rt(j);A.entanglements[1]|=z,j&=~z}zr(x),(it&6)===0&&(ru=Kt()+500,pl(0))}}break;case 31:case 13:A=As(x,2),A!==null&&Tn(A,x,2),su(),sp(x,2)}if(x=ip(u),x===null&&Ym(e,r,u,wu,i),x===h)break;h=x}h!==null&&u.stopPropagation()}else Ym(e,r,u,null,i)}}function ip(e){return e=cf(e),lp(e)}var wu=null;function lp(e){if(wu=null,e=an(e),e!==null){var r=l(e);if(r===null)e=null;else{var i=r.tag;if(i===13){if(e=d(r),e!==null)return e;e=null}else if(i===31){if(e=m(r),e!==null)return e;e=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null)}}return wu=e,null}function uy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(po()){case Pt:return 2;case Qn:return 8;case Da:case Es:return 32;case qr:return 268435456;default:return 32}default:return 32}}var cp=!1,es=null,ts=null,ns=null,wl=new Map,jl=new Map,rs=[],g3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function dy(e,r){switch(e){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":wl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.delete(r.pointerId)}}function Cl(e,r,i,u,h,x){return e===null||e.nativeEvent!==x?(e={blockedOn:r,domEventName:i,eventSystemFlags:u,nativeEvent:x,targetContainers:[h]},r!==null&&(r=tr(r),r!==null&&ly(r)),e):(e.eventSystemFlags|=u,r=e.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),e)}function x3(e,r,i,u,h){switch(r){case"focusin":return es=Cl(es,e,r,i,u,h),!0;case"dragenter":return ts=Cl(ts,e,r,i,u,h),!0;case"mouseover":return ns=Cl(ns,e,r,i,u,h),!0;case"pointerover":var x=h.pointerId;return wl.set(x,Cl(wl.get(x)||null,e,r,i,u,h)),!0;case"gotpointercapture":return x=h.pointerId,jl.set(x,Cl(jl.get(x)||null,e,r,i,u,h)),!0}return!1}function fy(e){var r=an(e.target);if(r!==null){var i=l(r);if(i!==null){if(r=i.tag,r===13){if(r=d(i),r!==null){e.blockedOn=r,zi(e.priority,function(){cy(i)});return}}else if(r===31){if(r=m(i),r!==null){e.blockedOn=r,zi(e.priority,function(){cy(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ju(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var i=ip(e.nativeEvent);if(i===null){i=e.nativeEvent;var u=new i.constructor(i.type,i);lf=u,i.target.dispatchEvent(u),lf=null}else return r=tr(i),r!==null&&ly(r),e.blockedOn=i,!1;r.shift()}return!0}function my(e,r,i){ju(e)&&i.delete(r)}function b3(){cp=!1,es!==null&&ju(es)&&(es=null),ts!==null&&ju(ts)&&(ts=null),ns!==null&&ju(ns)&&(ns=null),wl.forEach(my),jl.forEach(my)}function Cu(e,r){e.blockedOn===r&&(e.blockedOn=null,cp||(cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,b3)))}var Su=null;function py(e){Su!==e&&(Su=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Su===e&&(Su=null);for(var r=0;r<e.length;r+=3){var i=e[r],u=e[r+1],h=e[r+2];if(typeof u!="function"){if(lp(u||i)===null)continue;break}var x=tr(i);x!==null&&(e.splice(r,3),r-=3,im(x,{pending:!0,data:h,method:i.method,action:u},u,h))}}))}function Xo(e){function r(z){return Cu(z,e)}es!==null&&Cu(es,e),ts!==null&&Cu(ts,e),ns!==null&&Cu(ns,e),wl.forEach(r),jl.forEach(r);for(var i=0;i<rs.length;i++){var u=rs[i];u.blockedOn===e&&(u.blockedOn=null)}for(;0<rs.length&&(i=rs[0],i.blockedOn===null);)fy(i),i.blockedOn===null&&rs.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(u=0;u<i.length;u+=3){var h=i[u],x=i[u+1],j=h[je]||null;if(typeof x=="function")j||py(i);else if(j){var A=null;if(x&&x.hasAttribute("formAction")){if(h=x,j=x[je]||null)A=j.formAction;else if(lp(h)!==null)continue}else A=j.action;typeof A=="function"?i[u+1]=A:(i.splice(u,3),u-=3),py(i)}}}function hy(){function e(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(j){return h=j})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),u||setTimeout(i,20)}function i(){if(!u&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){u=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function up(e){this._internalRoot=e}Nu.prototype.render=up.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(o(409));var i=r.current,u=Hn();oy(i,u,e,r,null,null)},Nu.prototype.unmount=up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;oy(e.current,2,null,e,null,null),su(),r[we]=null}};function Nu(e){this._internalRoot=e}Nu.prototype.unstable_scheduleHydration=function(e){if(e){var r=Li();e={blockedOn:null,target:e,priority:r};for(var i=0;i<rs.length&&r!==0&&r<rs[i].priority;i++);rs.splice(i,0,e),i===0&&fy(e)}};var gy=n.version;if(gy!=="19.2.8")throw Error(o(527,gy,"19.2.8"));W.findDOMNode=function(e){var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(r),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var v3={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eu.isDisabled&&Eu.supportsFiber)try{Dn=Eu.inject(v3),yt=Eu}catch{}}return Nl.createRoot=function(e,r){if(!c(e))throw Error(o(299));var i=!1,u="",h=Cb,x=Sb,j=Nb;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(j=r.onRecoverableError)),r=ay(e,1,!1,null,null,i,u,null,h,x,j,hy),e[we]=r.current,Fm(e),new up(r)},Nl.hydrateRoot=function(e,r,i){if(!c(e))throw Error(o(299));var u=!1,h="",x=Cb,j=Sb,A=Nb,z=null;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(j=i.onCaughtError),i.onRecoverableError!==void 0&&(A=i.onRecoverableError),i.formState!==void 0&&(z=i.formState)),r=ay(e,1,!0,r,i??null,u,h,z,x,j,A,hy),r.context=sy(null),i=r.current,u=Hn(),u=Di(u),h=Ha(u),h.callback=null,Ga(i,h,u),i=u,r.current.lanes=i,It(r,i),zr(r),e[we]=r.current,Fm(e),new Nu(r)},Nl.version="19.2.8",Nl}var Ry;function A3(){if(Ry)return pp.exports;Ry=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),pp.exports=R3(),pp.exports}var _3=A3();/**
|
||
* react-router v7.18.2
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/var Zh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,i2=/^[\\/]{2}/;function D3(t,n){return n+t.replace(/\\/g,"/")}var Ay="popstate";function _y(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function O3(t={}){function n(o,c){var g;let l=(g=c.state)==null?void 0:g.masked,{pathname:d,search:m,hash:p}=l||o.location;return Qp("",{pathname:d,search:m,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default",l?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,c){return typeof c=="string"?c:Il(c)}return z3(n,a,null,t)}function kt(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function pr(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function L3(){return Math.random().toString(36).substring(2,10)}function Dy(t,n){return{usr:t.state,key:t.key,idx:n,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Qp(t,n,a=null,o,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof n=="string"?hi(n):n,state:a,key:n&&n.key||o||L3(),mask:c}}function Il({pathname:t="/",search:n="",hash:a=""}){return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(t+=a.charAt(0)==="#"?a:"#"+a),t}function hi(t){let n={};if(t){let a=t.indexOf("#");a>=0&&(n.hash=t.substring(a),t=t.substring(0,a));let o=t.indexOf("?");o>=0&&(n.search=t.substring(o),t=t.substring(0,o)),t&&(n.pathname=t)}return n}function z3(t,n,a,o={}){let{window:c=document.defaultView,v5Compat:l=!1}=o,d=c.history,m="POP",p=null,g=b();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function b(){return(d.state||{idx:null}).idx}function v(){m="POP";let N=b(),E=N==null?null:N-g;g=N,p&&p({action:m,location:S.location,delta:E})}function w(N,E){m="PUSH";let T=_y(N)?N:Qp(S.location,N,E);g=b()+1;let M=Dy(T,g),k=S.createHref(T.mask||T);try{d.pushState(M,"",k)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;c.location.assign(k)}l&&p&&p({action:m,location:S.location,delta:1})}function y(N,E){m="REPLACE";let T=_y(N)?N:Qp(S.location,N,E);g=b();let M=Dy(T,g),k=S.createHref(T.mask||T);d.replaceState(M,"",k),l&&p&&p({action:m,location:S.location,delta:0})}function C(N){return P3(c,N)}let S={get action(){return m},get location(){return t(c,d)},listen(N){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Ay,v),p=N,()=>{c.removeEventListener(Ay,v),p=null}},createHref(N){return n(c,N)},createURL:C,encodeLocation(N){let E=C(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:w,replace:y,go(N){return d.go(N)}};return S}function P3(t,n,a=!1){let o="http://localhost";t&&(o=t.location.origin!=="null"?t.location.origin:t.location.href),kt(o,"No window.location.(origin|href) available to create URL");let c=typeof n=="string"?n:Il(n);return c=c.replace(/ $/,"%20"),!a&&i2.test(c)&&(c=o+c),new URL(c,o)}function l2(t,n,a="/"){return I3(t,n,a,!1)}function I3(t,n,a,o,c){let l=typeof n=="string"?hi(n):n,d=Na(l.pathname||"/",a);if(d==null)return null;let m=U3(t),p=null,g=X3(d);for(let b=0;p==null&&b<m.length;++b)p=W3(m[b],g,o);return p}function U3(t){let n=c2(t);return B3(n),n}function c2(t,n=[],a=[],o="",c=!1){let l=(d,m,p=c,g)=>{let b={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(o)&&p)return;kt(b.relativePath.startsWith(o),`Absolute route path "${b.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(o.length)}let v=Sr([o,b.relativePath]),w=a.concat(b);d.children&&d.children.length>0&&(kt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),c2(d.children,n,w,v,p)),!(d.path==null&&!d.index)&&n.push({path:v,score:q3(v,d.index),routesMeta:w.map((y,C)=>{let[S,N]=f2(y.relativePath,y.caseSensitive,C===w.length-1);return{...y,matcher:S,compiledParams:N}})})};return t.forEach((d,m)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))l(d,m);else for(let g of u2(d.path))l(d,m,!0,g)}),n}function u2(t){let n=t.split("/");if(n.length===0)return[];let[a,...o]=n,c=a.endsWith("?"),l=a.replace(/\?$/,"");if(o.length===0)return c?[l,""]:[l];let d=u2(o.join("/")),m=[];return m.push(...d.map(p=>p===""?l:[l,p].join("/"))),c&&m.push(...d),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function B3(t){t.sort((n,a)=>n.score!==a.score?a.score-n.score:K3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var $3=/^:[\w-]+$/,H3=3,G3=2,V3=1,F3=10,Y3=-2,Oy=t=>t==="*";function q3(t,n){let a=t.split("/"),o=a.length;return a.some(Oy)&&(o+=Y3),n&&(o+=G3),a.filter(c=>!Oy(c)).reduce((c,l)=>c+($3.test(l)?H3:l===""?V3:F3),o)}function K3(t,n){return t.length===n.length&&t.slice(0,-1).every((o,c)=>o===n[c])?t[t.length-1]-n[n.length-1]:0}function W3(t,n,a=!1){let{routesMeta:o}=t,c={},l="/",d=[];for(let m=0;m<o.length;++m){let p=o[m],g=m===o.length-1,b=l==="/"?n:n.slice(l.length)||"/",v={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},w=p.matcher&&p.compiledParams?d2(v,b,p.matcher,p.compiledParams):rd(v,b),y=p.route;if(!w&&g&&a&&!o[o.length-1].route.index&&(w=rd({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},b)),!w)return null;Object.assign(c,w.params),d.push({params:c,pathname:Sr([l,w.pathname]),pathnameBase:J3(Sr([l,w.pathnameBase])),route:y}),w.pathnameBase!=="/"&&(l=Sr([l,w.pathnameBase]))}return d}function rd(t,n){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[a,o]=f2(t.path,t.caseSensitive,t.end);return d2(t,n,a,o)}function d2(t,n,a,o){let c=n.match(a);if(!c)return null;let l=c[0],d=l.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:o.reduce((g,{paramName:b,isOptional:v},w)=>{if(b==="*"){let C=m[w]||"";d=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const y=m[w];return v&&!y?g[b]=void 0:g[b]=(y||"").replace(/%2F/g,"/"),g},{}),pathname:l,pathnameBase:d,pattern:t}}function f2(t,n=!1,a=!0){pr(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],c="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,p,g,b)=>{if(o.push({paramName:m,isOptional:p!=null}),p){let v=b.charAt(g+d.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),c+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?c+="\\/*$":t!==""&&t!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,n?void 0:"i"),o]}function X3(t){try{return t.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return pr(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),t}}function Na(t,n){if(n==="/")return t;if(!t.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,o=t.charAt(a);return o&&o!=="/"?null:t.slice(a)||"/"}function Z3(t,n="/"){let{pathname:a,search:o="",hash:c=""}=typeof t=="string"?hi(t):t,l;return a?(a=m2(a),a.startsWith("/")?l=Ly(a.substring(1),"/"):l=Ly(a,n)):l=n,{pathname:l,search:eN(o),hash:tN(c)}}function Ly(t,n){let a=ad(n).split("/");return t.split("/").forEach(c=>{c===".."?a.length>1&&a.pop():c!=="."&&a.push(c)}),a.length>1?a.join("/"):"/"}function bp(t,n,a,o){return`Cannot include a '${t}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Q3(t){return t.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function Qh(t){let n=Q3(t);return n.map((a,o)=>o===n.length-1?a.pathname:a.pathnameBase)}function xd(t,n,a,o=!1){let c;typeof t=="string"?c=hi(t):(c={...t},kt(!c.pathname||!c.pathname.includes("?"),bp("?","pathname","search",c)),kt(!c.pathname||!c.pathname.includes("#"),bp("#","pathname","hash",c)),kt(!c.search||!c.search.includes("#"),bp("#","search","hash",c)));let l=t===""||c.pathname==="",d=l?"/":c.pathname,m;if(d==null)m=a;else{let v=n.length-1;if(!o&&d.startsWith("..")){let w=d.split("/");for(;w[0]==="..";)w.shift(),v-=1;c.pathname=w.join("/")}m=v>=0?n[v]:"/"}let p=Z3(c,m),g=d&&d!=="/"&&d.endsWith("/"),b=(l||d===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(g||b)&&(p.pathname+="/"),p}var m2=t=>t.replace(/[\\/]{2,}/g,"/"),Sr=t=>m2(t.join("/")),ad=t=>t.replace(/\/+$/,""),J3=t=>ad(t).replace(/^\/*/,"/"),eN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,tN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,nN=class{constructor(t,n,a,o=!1){this.status=t,this.statusText=n||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function rN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function aN(t){let n=t.map(a=>a.route.path).filter(Boolean);return Sr(n)||"/"}var p2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function h2(t,n){let a=t;if(typeof a!="string"||!Zh.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,c=!1;if(p2)try{let l=new URL(window.location.href),d=i2.test(a)?new URL(D3(a,l.protocol)):new URL(a),m=Na(d.pathname,n);d.origin===l.origin&&m!=null?a=m+d.search+d.hash:c=!0}catch{pr(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var g2=["POST","PUT","PATCH","DELETE"];new Set(g2);var sN=["GET",...g2];new Set(sN);var oN=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function iN(t){try{return oN.includes(new URL(t).protocol)}catch{return!1}}var gi=f.createContext(null);gi.displayName="DataRouter";var bd=f.createContext(null);bd.displayName="DataRouterState";var x2=f.createContext(!1);function lN(){return f.useContext(x2)}var b2=f.createContext({isTransitioning:!1});b2.displayName="ViewTransition";var cN=f.createContext(new Map);cN.displayName="Fetchers";var uN=f.createContext(null);uN.displayName="Await";var qn=f.createContext(null);qn.displayName="Navigation";var Jl=f.createContext(null);Jl.displayName="Location";var Tr=f.createContext({outlet:null,matches:[],isDataRoute:!1});Tr.displayName="Route";var Jh=f.createContext(null);Jh.displayName="RouteError";var v2="REACT_ROUTER_ERROR",dN="REDIRECT",fN="ROUTE_ERROR_RESPONSE";function mN(t){if(t.startsWith(`${v2}:${dN}:{`))try{let n=JSON.parse(t.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function pN(t){if(t.startsWith(`${v2}:${fN}:{`))try{let n=JSON.parse(t.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new nN(n.status,n.statusText,n.data)}catch{}}function hN(t,{relative:n}={}){kt(xi(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=f.useContext(qn),{hash:c,pathname:l,search:d}=ec(t,{relative:n}),m=l;return a!=="/"&&(m=l==="/"?a:Sr([a,l])),o.createHref({pathname:m,search:d,hash:c})}function xi(){return f.useContext(Jl)!=null}function Kn(){return kt(xi(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(Jl).location}var y2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function w2(t){f.useContext(qn).static||f.useLayoutEffect(t)}function ao(){let{isDataRoute:t}=f.useContext(Tr);return t?RN():gN()}function gN(){kt(xi(),"useNavigate() may be used only in the context of a <Router> component.");let t=f.useContext(gi),{basename:n,navigator:a}=f.useContext(qn),{matches:o}=f.useContext(Tr),{pathname:c}=Kn(),l=JSON.stringify(Qh(o)),d=f.useRef(!1);return w2(()=>{d.current=!0}),f.useCallback((p,g={})=>{if(pr(d.current,y2),!d.current)return;if(typeof p=="number"){a.go(p);return}let b=xd(p,JSON.parse(l),c,g.relative==="path");t==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Sr([n,b.pathname])),(g.replace?a.replace:a.push)(b,g.state,g)},[n,a,l,c,t])}var xN=f.createContext(null);function bN(t){let n=f.useContext(Tr).outlet;return f.useMemo(()=>n&&f.createElement(xN.Provider,{value:t},n),[n,t])}function ec(t,{relative:n}={}){let{matches:a}=f.useContext(Tr),{pathname:o}=Kn(),c=JSON.stringify(Qh(a));return f.useMemo(()=>xd(t,JSON.parse(c),o,n==="path"),[t,c,o,n])}function vN(t,n){return j2(t,n)}function j2(t,n,a){var N;kt(xi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=f.useContext(qn),{matches:c}=f.useContext(Tr),l=c[c.length-1],d=l?l.params:{},m=l?l.pathname:"/",p=l?l.pathnameBase:"/",g=l&&l.route;{let E=g&&g.path||"";S2(m,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
||
|
||
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let b=Kn(),v;if(n){let E=typeof n=="string"?hi(n):n;kt(p==="/"||((N=E.pathname)==null?void 0:N.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=b;let w=v.pathname||"/",y=w;if(p!=="/"){let E=p.replace(/^\//,"").split("/");y="/"+w.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=a&&a.state.matches.length?a.state.matches.map(E=>Object.assign(E,{route:a.manifest[E.route.id]||E.route})):l2(t,{pathname:y});pr(g||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),pr(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=SN(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:Sr([p,o.encodeLocation?o.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?p:Sr([p,o.encodeLocation?o.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),c,a);return n&&S?f.createElement(Jl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...v},navigationType:"POP"}},S):S}function yN(){let t=MN(),n=rN(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:l},"ErrorBoundary")," or"," ",f.createElement("code",{style:l},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},n),a?f.createElement("pre",{style:c},a):null,d)}var wN=f.createElement(yN,null),C2=class extends f.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){this.props.onError?this.props.onError(t,n):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const a=pN(t.digest);a&&(t=a)}let n=t!==void 0?f.createElement(Tr.Provider,{value:this.props.routeContext},f.createElement(Jh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?f.createElement(jN,{error:t},n):n}};C2.contextType=x2;var vp=new WeakMap;function jN({children:t,error:n}){let{basename:a}=f.useContext(qn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=mN(n.digest);if(o){let c=vp.get(n);if(c)throw c;let l=h2(o.location,a),d=l.absoluteURL||l.to;if(iN(d))throw new Error("Invalid redirect location");if(p2&&!vp.get(n))if(l.isExternal||o.reloadDocument)window.location.href=d;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:o.replace}));throw vp.set(n,m),m}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return t}function CN({routeContext:t,match:n,children:a}){let o=f.useContext(gi);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(Tr.Provider,{value:t},a)}function SN(t,n=[],a){let o=a==null?void 0:a.state;if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let c=t,l=o==null?void 0:o.errors;if(l!=null){let b=c.findIndex(v=>v.route.id&&(l==null?void 0:l[v.route.id])!==void 0);kt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),c=c.slice(0,Math.min(c.length,b+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let b=0;b<c.length;b++){let v=c[b];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(m=b),v.route.id){let{loaderData:w,errors:y}=o,C=v.route.loader&&!w.hasOwnProperty(v.route.id)&&(!y||y[v.route.id]===void 0);if(v.route.lazy||C){a.isStatic&&(d=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let p=a==null?void 0:a.onError,g=o&&p?(b,v)=>{var w,y;p(b,{location:o.location,params:((y=(w=o.matches)==null?void 0:w[0])==null?void 0:y.params)??{},pattern:aN(o.matches),errorInfo:v})}:void 0;return c.reduceRight((b,v,w)=>{let y,C=!1,S=null,N=null;o&&(y=l&&v.route.id?l[v.route.id]:void 0,S=v.route.errorElement||wN,d&&(m<0&&w===0?(S2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,N=null):m===w&&(C=!0,N=v.route.hydrateFallbackElement||null)));let E=n.concat(c.slice(0,w+1)),T=()=>{let M;return y?M=S:C?M=N:v.route.Component?M=f.createElement(v.route.Component,null):v.route.element?M=v.route.element:M=b,f.createElement(CN,{match:v,routeContext:{outlet:b,matches:E,isDataRoute:o!=null},children:M})};return o&&(v.route.ErrorBoundary||v.route.errorElement||w===0)?f.createElement(C2,{location:o.location,revalidation:o.revalidation,component:S,error:y,children:T(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:g}):T()},null)}function eg(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NN(t){let n=f.useContext(gi);return kt(n,eg(t)),n}function EN(t){let n=f.useContext(bd);return kt(n,eg(t)),n}function kN(t){let n=f.useContext(Tr);return kt(n,eg(t)),n}function tg(t){let n=kN(t),a=n.matches[n.matches.length-1];return kt(a.route.id,`${t} can only be used on routes that contain a unique "id"`),a.route.id}function TN(){return tg("useRouteId")}function MN(){var o;let t=f.useContext(Jh),n=EN("useRouteError"),a=tg("useRouteError");return t!==void 0?t:(o=n.errors)==null?void 0:o[a]}function RN(){let{router:t}=NN("useNavigate"),n=tg("useNavigate"),a=f.useRef(!1);return w2(()=>{a.current=!0}),f.useCallback(async(c,l={})=>{pr(a.current,y2),a.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:n,...l}))},[t,n])}var zy={};function S2(t,n,a){!n&&!zy[t]&&(zy[t]=!0,pr(!1,a))}f.memo(AN);function AN({routes:t,manifest:n,future:a,state:o,isStatic:c,onError:l}){return j2(t,void 0,{manifest:n,state:o,isStatic:c,onError:l})}function ya({to:t,replace:n,state:a,relative:o}){kt(xi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=f.useContext(qn);pr(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=f.useContext(Tr),{pathname:d}=Kn(),m=ao(),p=xd(t,Qh(l),d,o==="path"),g=JSON.stringify(p);return f.useEffect(()=>{m(JSON.parse(g),{replace:n,state:a,relative:o})},[m,g,o,n,a]),null}function _N(t){return bN(t.context)}function un(t){kt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function DN({basename:t="/",children:n=null,location:a,navigationType:o="POP",navigator:c,static:l=!1,useTransitions:d}){kt(!xi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=t.replace(/^\/*/,"/"),p=f.useMemo(()=>({basename:m,navigator:c,static:l,useTransitions:d,future:{}}),[m,c,l,d]);typeof a=="string"&&(a=hi(a));let{pathname:g="/",search:b="",hash:v="",state:w=null,key:y="default",mask:C}=a,S=f.useMemo(()=>{let N=Na(g,m);return N==null?null:{location:{pathname:N,search:b,hash:v,state:w,key:y,mask:C},navigationType:o}},[m,g,b,v,w,y,o,C]);return pr(S!=null,`<Router basename="${m}"> is not able to match the URL "${g}${b}${v}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:f.createElement(qn.Provider,{value:p},f.createElement(Jl.Provider,{children:n,value:S}))}function Py({children:t,location:n}){return vN(Jp(t),n)}function Jp(t,n=[]){let a=[];return f.Children.forEach(t,(o,c)=>{if(!f.isValidElement(o))return;let l=[...n,c];if(o.type===f.Fragment){a.push.apply(a,Jp(o.props.children,l));return}kt(o.type===un,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),kt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||l.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Jp(o.props.children,l)),a.push(d)}),a}var Fu="get",Yu="application/x-www-form-urlencoded";function vd(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function ON(t){return vd(t)&&t.tagName.toLowerCase()==="button"}function LN(t){return vd(t)&&t.tagName.toLowerCase()==="form"}function zN(t){return vd(t)&&t.tagName.toLowerCase()==="input"}function PN(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function IN(t,n){return t.button===0&&(!n||n==="_self")&&!PN(t)}function eh(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((n,a)=>{let o=t[a];return n.concat(Array.isArray(o)?o.map(c=>[a,c]):[[a,o]])},[]))}function UN(t,n){let a=eh(t);return n&&n.forEach((o,c)=>{a.has(c)||n.getAll(c).forEach(l=>{a.append(c,l)})}),a}var ku=null;function BN(){if(ku===null)try{new FormData(document.createElement("form"),0),ku=!1}catch{ku=!0}return ku}var $N=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function yp(t){return t!=null&&!$N.has(t)?(pr(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yu}"`),null):t}function HN(t,n){let a,o,c,l,d;if(LN(t)){let m=t.getAttribute("action");o=m?Na(m,n):null,a=t.getAttribute("method")||Fu,c=yp(t.getAttribute("enctype"))||Yu,l=new FormData(t)}else if(ON(t)||zN(t)&&(t.type==="submit"||t.type==="image")){let m=t.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=t.getAttribute("formaction")||m.getAttribute("action");if(o=p?Na(p,n):null,a=t.getAttribute("formmethod")||m.getAttribute("method")||Fu,c=yp(t.getAttribute("formenctype"))||yp(m.getAttribute("enctype"))||Yu,l=new FormData(m,t),!BN()){let{name:g,type:b,value:v}=t;if(b==="image"){let w=g?`${g}.`:"";l.append(`${w}x`,"0"),l.append(`${w}y`,"0")}else g&&l.append(g,v)}}else{if(vd(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Fu,o=null,c=Yu,d=t}return l&&c==="text/plain"&&(d=l,l=void 0),{action:o,method:a.toLowerCase(),encType:c,formData:l,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ng(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function N2(t,n,a,o){let c=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return a?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:n&&Na(c.pathname,n)==="/"?c.pathname=`${ad(n)}/_root.${o}`:c.pathname=`${ad(c.pathname)}.${o}`,c}async function GN(t,n){if(t.id in n)return n[t.id];try{let a=await import(t.module);return n[t.id]=a,a}catch(a){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function VN(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function FN(t,n,a){let o=await Promise.all(t.map(async c=>{let l=n.routes[c.route.id];if(l){let d=await GN(l,a);return d.links?d.links():[]}return[]}));return WN(o.flat(1).filter(VN).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Iy(t,n,a,o,c,l){let d=(p,g)=>a[g]?p.route.id!==a[g].route.id:!0,m=(p,g)=>{var b;return a[g].pathname!==p.pathname||((b=a[g].route.path)==null?void 0:b.endsWith("*"))&&a[g].params["*"]!==p.params["*"]};return l==="assets"?n.filter((p,g)=>d(p,g)||m(p,g)):l==="data"?n.filter((p,g)=>{var v;let b=o.routes[p.route.id];if(!b||!b.hasLoader)return!1;if(d(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let w=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((v=a[0])==null?void 0:v.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function YN(t,n,{includeHydrateFallback:a}={}){return qN(t.map(o=>{let c=n.routes[o.route.id];if(!c)return[];let l=[c.module];return c.clientActionModule&&(l=l.concat(c.clientActionModule)),c.clientLoaderModule&&(l=l.concat(c.clientLoaderModule)),a&&c.hydrateFallbackModule&&(l=l.concat(c.hydrateFallbackModule)),c.imports&&(l=l.concat(c.imports)),l}).flat(1))}function qN(t){return[...new Set(t)]}function KN(t){let n={},a=Object.keys(t).sort();for(let o of a)n[o]=t[o];return n}function WN(t,n){let a=new Set;return new Set(n),t.reduce((o,c)=>{let l=JSON.stringify(KN(c));return a.has(l)||(a.add(l),o.push({key:l,link:c})),o},[])}function rg(){let t=f.useContext(gi);return ng(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function XN(){let t=f.useContext(bd);return ng(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var ag=f.createContext(void 0);ag.displayName="FrameworkContext";function yd(){let t=f.useContext(ag);return ng(t,"You must render this element inside a <HydratedRouter> element"),t}function ZN(t,n){let a=f.useContext(ag),[o,c]=f.useState(!1),[l,d]=f.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:b,onTouchStart:v}=n,w=f.useRef(null);f.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let S=E=>{E.forEach(T=>{d(T.isIntersecting)})},N=new IntersectionObserver(S,{threshold:.5});return w.current&&N.observe(w.current),()=>{N.disconnect()}}},[t]),f.useEffect(()=>{if(o){let S=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(S)}}},[o]);let y=()=>{c(!0)},C=()=>{c(!1),d(!1)};return a?t!=="intent"?[l,w,{}]:[l,w,{onFocus:El(m,y),onBlur:El(p,C),onMouseEnter:El(g,y),onMouseLeave:El(b,C),onTouchStart:El(v,y)}]:[!1,w,{}]}function El(t,n){return a=>{t&&t(a),a.defaultPrevented||n(a)}}function QN({page:t,...n}){let a=lN(),{nonce:o}=yd(),{router:c}=rg(),l=f.useMemo(()=>l2(c.routes,t,c.basename),[c.routes,t,c.basename]);return l?(n.nonce==null&&o&&(n={...n,nonce:o}),a?f.createElement(e8,{page:t,matches:l,...n}):f.createElement(t8,{page:t,matches:l,...n})):null}function JN(t){let{manifest:n,routeModules:a}=yd(),[o,c]=f.useState([]);return f.useEffect(()=>{let l=!1;return FN(t,n,a).then(d=>{l||c(d)}),()=>{l=!0}},[t,n,a]),o}function e8({page:t,matches:n,...a}){let o=Kn(),{future:c}=yd(),{basename:l}=rg(),d=f.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let m=N2(t,l,c.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let b of n)typeof b.route.shouldRevalidate=="function"?p=!0:g.push(b.route.id);return p&&g.length>0&&m.searchParams.set("_routes",g.join(",")),[m.pathname+m.search]},[l,c.v8_trailingSlashAwareDataRequests,t,o,n]);return f.createElement(f.Fragment,null,d.map(m=>f.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...a})))}function t8({page:t,matches:n,...a}){let o=Kn(),{future:c,manifest:l,routeModules:d}=yd(),{basename:m}=rg(),{loaderData:p,matches:g}=XN(),b=f.useMemo(()=>Iy(t,n,g,l,o,"data"),[t,n,g,l,o]),v=f.useMemo(()=>Iy(t,n,g,l,o,"assets"),[t,n,g,l,o]),w=f.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let S=new Set,N=!1;if(n.forEach(T=>{var k;let M=l.routes[T.route.id];!M||!M.hasLoader||(!b.some(_=>_.route.id===T.route.id)&&T.route.id in p&&((k=d[T.route.id])!=null&&k.shouldRevalidate)||M.hasClientLoader?N=!0:S.add(T.route.id))}),S.size===0)return[];let E=N2(t,m,c.v8_trailingSlashAwareDataRequests,"data");return N&&S.size>0&&E.searchParams.set("_routes",n.filter(T=>S.has(T.route.id)).map(T=>T.route.id).join(",")),[E.pathname+E.search]},[m,c.v8_trailingSlashAwareDataRequests,p,o,l,b,n,t,d]),y=f.useMemo(()=>YN(v,l),[v,l]),C=JN(v);return f.createElement(f.Fragment,null,w.map(S=>f.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...a})),y.map(S=>f.createElement("link",{key:S,rel:"modulepreload",href:S,...a})),C.map(({key:S,link:N})=>f.createElement("link",{key:S,nonce:a.nonce,...N,crossOrigin:N.crossOrigin??a.crossOrigin})))}function n8(...t){return n=>{t.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var r8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{r8&&(window.__reactRouterVersion="7.18.2")}catch{}function a8({basename:t,children:n,useTransitions:a,window:o}){let c=f.useRef();c.current==null&&(c.current=O3({window:o,v5Compat:!0}));let l=c.current,[d,m]=f.useState({action:l.action,location:l.location}),p=f.useCallback(g=>{a===!1?m(g):f.startTransition(()=>m(g))},[a]);return f.useLayoutEffect(()=>l.listen(p),[l,p]),f.createElement(DN,{basename:t,children:n,location:d.location,navigationType:d.action,navigator:l,useTransitions:a})}var en=f.forwardRef(function({onClick:n,discover:a="render",prefetch:o="none",relative:c,reloadDocument:l,replace:d,mask:m,state:p,target:g,to:b,preventScrollReset:v,viewTransition:w,defaultShouldRevalidate:y,...C},S){let{basename:N,navigator:E,useTransitions:T}=f.useContext(qn),M=typeof b=="string"&&Zh.test(b),k=h2(b,N);b=k.to;let _=hN(b,{relative:c}),R=Kn(),L=null;if(m){let se=xd(m,[],R.mask?R.mask.pathname:"/",!0);N!=="/"&&(se.pathname=se.pathname==="/"?N:Sr([N,se.pathname])),L=E.createHref(se)}let[ne,X,I]=ZN(o,C),H=i8(b,{replace:d,mask:m,state:p,target:g,preventScrollReset:v,relative:c,viewTransition:w,defaultShouldRevalidate:y,useTransitions:T});function q(se){n&&n(se),se.defaultPrevented||H(se)}let ce=!(k.isExternal||l),de=f.createElement("a",{...C,...I,href:(ce?L:void 0)||k.absoluteURL||_,onClick:ce?q:n,ref:n8(S,X),target:g,"data-discover":!M&&a==="render"?"true":void 0});return ne&&!M?f.createElement(f.Fragment,null,de,f.createElement(QN,{page:_})):de});en.displayName="Link";var th=f.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:o="",end:c=!1,style:l,to:d,viewTransition:m,children:p,...g},b){let v=ec(d,{relative:g.relative}),w=Kn(),y=f.useContext(bd),{navigator:C,basename:S}=f.useContext(qn),N=y!=null&&f8(v)&&m===!0,E=C.encodeLocation?C.encodeLocation(v).pathname:v.pathname,T=w.pathname,M=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;a||(T=T.toLowerCase(),M=M?M.toLowerCase():null,E=E.toLowerCase()),M&&S&&(M=Na(M,S)||M);const k=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let _=T===E||!c&&T.startsWith(E)&&T.charAt(k)==="/",R=M!=null&&(M===E||!c&&M.startsWith(E)&&M.charAt(E.length)==="/"),L={isActive:_,isPending:R,isTransitioning:N},ne=_?n:void 0,X;typeof o=="function"?X=o(L):X=[o,_?"active":null,R?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let I=typeof l=="function"?l(L):l;return f.createElement(en,{...g,"aria-current":ne,className:X,ref:b,style:I,to:d,viewTransition:m},typeof p=="function"?p(L):p)});th.displayName="NavLink";var s8=f.forwardRef(({discover:t="render",fetcherKey:n,navigate:a,reloadDocument:o,replace:c,state:l,method:d=Fu,action:m,onSubmit:p,relative:g,preventScrollReset:b,viewTransition:v,defaultShouldRevalidate:w,...y},C)=>{let{useTransitions:S}=f.useContext(qn),N=u8(),E=d8(m,{relative:g}),T=d.toLowerCase()==="get"?"get":"post",M=typeof m=="string"&&Zh.test(m),k=_=>{if(p&&p(_),_.defaultPrevented)return;_.preventDefault();let R=_.nativeEvent.submitter,L=(R==null?void 0:R.getAttribute("formmethod"))||d,ne=()=>N(R||_.currentTarget,{fetcherKey:n,method:L,navigate:a,replace:c,state:l,relative:g,preventScrollReset:b,viewTransition:v,defaultShouldRevalidate:w});S&&a!==!1?f.startTransition(()=>ne()):ne()};return f.createElement("form",{ref:C,method:T,action:E,onSubmit:o?p:k,...y,"data-discover":!M&&t==="render"?"true":void 0})});s8.displayName="Form";function o8(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function E2(t){let n=f.useContext(gi);return kt(n,o8(t)),n}function i8(t,{target:n,replace:a,mask:o,state:c,preventScrollReset:l,relative:d,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let b=ao(),v=Kn(),w=ec(t,{relative:d});return f.useCallback(y=>{if(IN(y,n)){y.preventDefault();let C=a!==void 0?a:Il(v)===Il(w),S=()=>b(t,{replace:C,mask:o,state:c,preventScrollReset:l,relative:d,viewTransition:m,defaultShouldRevalidate:p});g?f.startTransition(()=>S()):S()}},[v,b,w,a,o,c,n,t,l,d,m,p,g])}function wd(t){pr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=f.useRef(eh(t)),a=f.useRef(!1),o=Kn(),c=f.useMemo(()=>UN(o.search,a.current?null:n.current),[o.search]),l=ao(),d=f.useCallback((m,p)=>{const g=eh(typeof m=="function"?m(new URLSearchParams(c)):m);a.current=!0,l("?"+g,p)},[l,c]);return[c,d]}var l8=0,c8=()=>`__${String(++l8)}__`;function u8(){let{router:t}=E2("useSubmit"),{basename:n}=f.useContext(qn),a=TN(),o=t.fetch,c=t.navigate;return f.useCallback(async(l,d={})=>{let{action:m,method:p,encType:g,formData:b,body:v}=HN(l,n);if(d.navigate===!1){let w=d.fetcherKey||c8();await o(w,a,d.action||m,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:b,body:v,formMethod:d.method||p,formEncType:d.encType||g,flushSync:d.flushSync})}else await c(d.action||m,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:b,body:v,formMethod:d.method||p,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:a,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,c,n,a])}function d8(t,{relative:n}={}){let{basename:a}=f.useContext(qn),o=f.useContext(Tr);kt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),l={...ec(t||".",{relative:n})},d=Kn();if(t==null){l.search=d.search;let m=new URLSearchParams(l.search),p=m.getAll("index");if(p.some(b=>b==="")){m.delete("index"),p.filter(v=>v).forEach(v=>m.append("index",v));let b=m.toString();l.search=b?`?${b}`:""}}return(!t||t===".")&&c.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(l.pathname=l.pathname==="/"?a:Sr([a,l.pathname])),Il(l)}function f8(t,{relative:n}={}){let a=f.useContext(b2);kt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=E2("useViewTransitionState"),c=ec(t,{relative:n});if(!a.isTransitioning)return!1;let l=Na(a.currentLocation.pathname,o)||a.currentLocation.pathname,d=Na(a.nextLocation.pathname,o)||a.nextLocation.pathname;return rd(c.pathname,d)!=null||rd(c.pathname,l)!=null}var so=o2();const m8=s2(so),sg=[["path",{d:"M12.001 5.00003V19.002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19.002 12.002L4.99998 12.002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],og=[["path",{d:"M7 4.5C5.34315 4.5 4 5.84315 4 7.5C4 8.06866 4.15822 8.60037 4.43304 9.0535C3.04727 9.31855 2 10.537 2 12C2 13.463 3.04727 14.6814 4.43304 14.9465M7 4.5C7 3.11929 8.11929 2 9.5 2C10.8807 2 12 3.11929 12 4.5V19.5C12 20.8807 10.8807 22 9.5 22C8.11929 22 7 20.8807 7 19.5C5.34315 19.5 4 18.1569 4 16.5C4 15.9313 4.15822 15.3996 4.43304 14.9465M7 4.5C7 5.31791 7.39278 6.04408 8 6.50018M4.43304 14.9465C4.78948 14.3588 5.34207 13.9032 6 13.6707",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 19.4999C18.6569 19.4999 20 18.1567 20 16.4999C20 15.9312 19.8418 15.3995 19.567 14.9464C20.9527 14.6813 22 13.4629 22 11.9999C22 10.5369 20.9527 9.31843 19.567 9.05338M17 19.4999C17 20.8806 15.8807 21.9999 14.5 21.9999C13.1193 21.9999 12 20.8806 12 19.4999L12 4.49988C12 3.11917 13.1193 1.99988 14.5 1.99988C15.8807 1.99988 17 3.11917 17 4.49988C18.6569 4.49988 20 5.84302 20 7.49988C20 8.06854 19.8418 8.60024 19.567 9.05338M17 19.4999C17 18.682 16.6072 17.9558 16 17.4997M19.567 9.05338C19.2105 9.64109 18.6579 10.0966 18 10.3292",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],ig=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],k2=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],p8=[["path",{d:"M16.4999 3.26621C17.3443 3.25421 20.1408 2.67328 20.7337 3.26621C21.3266 3.85913 20.7457 6.65559 20.7337 7.5M20.5059 3.49097L13.5021 10.4961",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3.26636 16.5001C3.25436 17.3445 2.67343 20.141 3.26636 20.7339C3.85928 21.3268 6.65574 20.7459 7.50015 20.7339M10.502 13.4976L3.49824 20.5027",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],T2=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],lg=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Uy=[["path",{d:"M5.82338 12L4.27922 10.4558C2.57359 8.75022 2.57359 5.98485 4.27922 4.27922C5.98485 2.57359 8.75022 2.57359 10.4558 4.27922L19.7208 13.5442C21.4264 15.2498 21.4264 18.0152 19.7208 19.7208C18.0152 21.4264 15.2498 21.4264 13.5442 19.7208L10.0698 16.2464C9.00379 15.1804 9.00379 13.4521 10.0698 12.386C11.1358 11.32 12.8642 11.32 13.9302 12.386L15.8604 14.3162",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],cg=[["path",{d:"M13 7H11C8.19108 7 6.78661 7 5.77772 7.67412C5.34096 7.96596 4.96596 8.34096 4.67412 8.77772C4 9.78661 4 11.1911 4 14C4 16.8089 4 18.2134 4.67412 19.2223C4.96596 19.659 5.34096 20.034 5.77772 20.3259C6.78661 21 8.19108 21 11 21H13C15.8089 21 17.2134 21 18.2223 20.3259C18.659 20.034 19.034 19.659 19.3259 19.2223C20 18.2134 20 16.8089 20 14C20 11.1911 20 9.78661 19.3259 8.77772C19.034 8.34096 18.659 7.96596 18.2223 7.67412C17.2134 7 15.8089 7 13 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4 14H2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M10 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M22 14H20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M9 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M12 7C12 5.11438 12 4.17157 11.4142 3.58579C10.8284 3 9.88562 3 8 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],ba=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],jd=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],h8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V12L14 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],ds=[["path",{d:"M15 9V15H9V9H15Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15 15H18C19.6569 15 21 16.3431 21 18C21 19.6569 19.6569 21 18 21C16.3431 21 15 19.6569 15 18V15Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9 15.002H6C4.34315 15.002 3 16.3451 3 18.002C3 19.6588 4.34315 21.002 6 21.002C7.65685 21.002 9 19.6588 9 18.002V15.002Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M15 9L15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.65685 19.6569 9 18 9H15Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M9 9V6C9 4.34315 7.65685 3 6 3C4.34315 3 3 4.34315 3 6C3 7.65685 4.34315 9 6 9H9Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],g8=[["path",{d:"M8 13.5H16M8 8.5H12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M6.09881 19C4.7987 18.8721 3.82475 18.4816 3.17157 17.8284C2 16.6569 2 14.7712 2 11V10.5C2 6.72876 2 4.84315 3.17157 3.67157C4.34315 2.5 6.22876 2.5 10 2.5H14C17.7712 2.5 19.6569 2.5 20.8284 3.67157C22 4.84315 22 6.72876 22 10.5V11C22 14.7712 22 16.6569 20.8284 17.8284C19.6569 19 17.7712 19 14 19C13.4395 19.0125 12.9931 19.0551 12.5546 19.155C11.3562 19.4309 10.2465 20.0441 9.14987 20.5789C7.58729 21.3408 6.806 21.7218 6.31569 21.3651C5.37769 20.6665 6.29454 18.5019 6.5 17.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],M2=[["path",{d:"M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.5 12.5H15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],R2=[["path",{d:"M9 15C9 12.1716 9 10.7574 9.87868 9.87868C10.7574 9 12.1716 9 15 9L16 9C18.8284 9 20.2426 9 21.1213 9.87868C22 10.7574 22 12.1716 22 15V16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15C12.1716 22 10.7574 22 9.87868 21.1213C9 20.2426 9 18.8284 9 16L9 15Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.9999 9C16.9975 6.04291 16.9528 4.51121 16.092 3.46243C15.9258 3.25989 15.7401 3.07418 15.5376 2.90796C14.4312 2 12.7875 2 9.5 2C6.21252 2 4.56878 2 3.46243 2.90796C3.25989 3.07417 3.07418 3.25989 2.90796 3.46243C2 4.56878 2 6.21252 2 9.5C2 12.7875 2 14.4312 2.90796 15.5376C3.07417 15.7401 3.25989 15.9258 3.46243 16.092C4.51121 16.9528 6.04291 16.9975 9 16.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],A2=[["path",{d:"M10.5 8.75V6.75C10.5 5.10626 10.5 4.28439 10.046 3.73121C9.96291 3.62995 9.87005 3.53709 9.76879 3.45398C9.21561 3 8.39374 3 6.75 3C5.10626 3 4.28439 3 3.73121 3.45398C3.62995 3.53709 3.53709 3.62995 3.45398 3.73121C3 4.28439 3 5.10626 3 6.75V8.75C3 10.3937 3 11.2156 3.45398 11.7688C3.53709 11.8701 3.62995 11.9629 3.73121 12.046C4.28439 12.5 5.10626 12.5 6.75 12.5C8.39374 12.5 9.21561 12.5 9.76879 12.046C9.87005 11.9629 9.96291 11.8701 10.046 11.7688C10.5 11.2156 10.5 10.3937 10.5 8.75Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.75 15.5H5.75C5.05222 15.5 4.70333 15.5 4.41943 15.5861C3.78023 15.78 3.28002 16.2802 3.08612 16.9194C3 17.2033 3 17.5522 3 18.25C3 18.9478 3 19.2967 3.08612 19.5806C3.28002 20.2198 3.78023 20.72 4.41943 20.9139C4.70333 21 5.05222 21 5.75 21H7.75C8.44778 21 8.79667 21 9.08057 20.9139C9.71977 20.72 10.22 20.2198 10.4139 19.5806C10.5 19.2967 10.5 18.9478 10.5 18.25C10.5 17.5522 10.5 17.2033 10.4139 16.9194C10.22 16.2802 9.71977 15.78 9.08057 15.5861C8.79667 15.5 8.44778 15.5 7.75 15.5Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 17.25V15.25C21 13.6063 21 12.7844 20.546 12.2312C20.4629 12.1299 20.3701 12.0371 20.2688 11.954C19.7156 11.5 18.8937 11.5 17.25 11.5C15.6063 11.5 14.7844 11.5 14.2312 11.954C14.1299 12.0371 14.0371 12.1299 13.954 12.2312C13.5 12.7844 13.5 13.6063 13.5 15.25V17.25C13.5 18.8937 13.5 19.7156 13.954 20.2688C14.0371 20.3701 14.1299 20.4629 14.2312 20.546C14.7844 21 15.6063 21 17.25 21C18.8937 21 19.7156 21 20.2688 20.546C20.3701 20.4629 20.4629 20.3701 20.546 20.2688C21 19.7156 21 18.8937 21 17.25Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M18.25 3H16.25C15.5522 3 15.2033 3 14.9194 3.08612C14.2802 3.28002 13.78 3.78023 13.5861 4.41943C13.5 4.70333 13.5 5.05222 13.5 5.75C13.5 6.44778 13.5 6.79667 13.5861 7.08057C13.78 7.71977 14.2802 8.21998 14.9194 8.41388C15.2033 8.5 15.5522 8.5 16.25 8.5H18.25C18.9478 8.5 19.2967 8.5 19.5806 8.41388C20.2198 8.21998 20.72 7.71977 20.9139 7.08057C21 6.79667 21 6.44778 21 5.75C21 5.05222 21 4.70333 20.9139 4.41943C20.72 3.78023 20.2198 3.28002 19.5806 3.08612C19.2967 3 18.9478 3 18.25 3Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],x8=[["path",{d:"M3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682C3 18.364 3 16.2426 3 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 12H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 7.5L17 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M7.125 7.5H7M7.25 7.5C7.25 7.63807 7.13807 7.75 7 7.75C6.86193 7.75 6.75 7.63807 6.75 7.5C6.75 7.36193 6.86193 7.25 7 7.25C7.13807 7.25 7.25 7.36193 7.25 7.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M11 16.5L17 16.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.125 16.5H7M7.25 16.5C7.25 16.6381 7.13807 16.75 7 16.75C6.86193 16.75 6.75 16.6381 6.75 16.5C6.75 16.3619 6.86193 16.25 7 16.25C7.13807 16.25 7.25 16.3619 7.25 16.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],bi=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],Cd=[["path",{d:"M16.9504 12.1817C17.1981 12.814 16.5076 13.5726 15.1267 15.0899C13.6702 16.6902 12.9201 17.4904 12 17.5C11.0799 17.4904 10.3298 16.6902 8.87331 15.0899C7.49239 13.5726 6.80193 12.814 7.04964 12.1817C7.05868 12.1586 7.06851 12.1359 7.0791 12.1135C7.34928 11.542 8.24477 11.5029 10 11.5002V4.99998C10 4.53501 10 4.30253 10.0511 4.11179C10.1898 3.59414 10.5941 3.1898 11.1118 3.05111C11.3025 3 11.535 3 12 3C12.4649 3 12.6974 3 12.8882 3.05111C13.4058 3.1898 13.8102 3.59414 13.9489 4.11179C14 4.30253 14 4.53501 14 4.99998V11.5002C15.7552 11.5029 16.6507 11.542 16.9209 12.1135C16.9315 12.1359 16.9413 12.1586 16.9504 12.1817Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5.00006 21H19.0001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],b8=[["path",{d:"M14.0737 3.88545C14.8189 3.07808 15.1915 2.6744 15.5874 2.43893C16.5427 1.87076 17.7191 1.85309 18.6904 2.39232C19.0929 2.6158 19.4769 3.00812 20.245 3.79276C21.0131 4.5774 21.3972 4.96972 21.6159 5.38093C22.1438 6.37312 22.1265 7.57479 21.5703 8.5507C21.3398 8.95516 20.9446 9.33578 20.1543 10.097L10.7506 19.1543C9.25288 20.5969 8.504 21.3182 7.56806 21.6837C6.63212 22.0493 5.6032 22.0224 3.54536 21.9686L3.26538 21.9613C2.63891 21.9449 2.32567 21.9367 2.14359 21.73C1.9615 21.5234 1.98636 21.2043 2.03608 20.5662L2.06308 20.2197C2.20301 18.4235 2.27297 17.5255 2.62371 16.7182C2.97444 15.9109 3.57944 15.2555 4.78943 13.9445L14.0737 3.88545Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4L20 11",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14 22L22 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Ul=[["path",{d:"M8 17H16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 13H12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5M20 10.6569V14C20 17.7712 20 19.6569 18.8284 20.8284C17.6569 22 15.7712 22 12 22C8.22876 22 6.34315 22 5.17157 20.8284C4 19.6569 4 17.7712 4 14V9.45584C4 6.21082 4 4.58831 4.88607 3.48933C5.06508 3.26731 5.26731 3.06508 5.48933 2.88607C6.58831 2 8.21082 2 11.4558 2C12.1614 2 12.5141 2 12.8372 2.11401C12.9044 2.13772 12.9702 2.165 13.0345 2.19575C13.3436 2.34355 13.593 2.593 14.0919 3.09188L18.8284 7.82843C19.4065 8.40649 19.6955 8.69552 19.8478 9.06306C20 9.4306 20 9.83935 20 10.6569Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Sd=[["path",{d:"M8 22V19C8 17.1144 8 16.1716 8.58579 15.5858C9.17157 15 10.1144 15 12 15C13.8856 15 14.8284 15 15.4142 15.5858C16 16.1716 16 17.1144 16 19V22",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10 7H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 11.8584C3 7.28199 3 4.99376 4.38674 3.54394C4.43797 3.49038 4.49038 3.43797 4.54394 3.38674C5.99376 2 8.28199 2 12.8584 2C13.943 2 14.4655 2.00376 14.9628 2.18936C15.4417 2.3681 15.8429 2.70239 16.6452 3.37099L18.8411 5.20092C19.9027 6.08561 20.4335 6.52795 20.7168 7.13266C21 7.73737 21 8.42833 21 9.81025V13C21 16.7497 21 18.6246 20.0451 19.9389C19.7367 20.3634 19.3634 20.7367 18.9389 21.0451C17.6246 22 15.7497 22 12 22C8.25027 22 6.3754 22 5.06107 21.0451C4.6366 20.7367 4.26331 20.3634 3.95491 19.9389C3 18.6246 3 16.7497 3 13V11.8584Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],v8=[["circle",{cx:"7.5",cy:"7.5",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 21C9.37246 15.775 14.2741 8.88406 21.4975 13.5424",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],y8=[["path",{d:"M5 21C9.20998 16.2487 13.9412 9.9475 21 14.6734",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 4.50012C17.4915 3.99442 18.7998 2.00012 19.5 2.00012M22 4.50012C21.5085 3.99442 20.2002 2.00012 19.5 2.00012M19.5 2.00012V10.0001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20.9999 13C20.998 17.147 20.9472 19.2703 19.6088 20.6088C18.2175 22 15.9783 22 11.5 22C7.02166 22 4.78249 22 3.39124 20.6088C2 19.2175 2 16.9783 2 12.5C2 8.02166 2 5.78249 3.39124 4.39124C4.78249 3 7.02166 3 11.5 3C11.6699 3 14 3.00008 14 3.00008",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}]],w8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 8.25H12M12.25 8.25C12.25 8.11193 12.1381 8 12 8C11.8619 8 11.75 8.11193 11.75 8.25C11.75 8.38807 11.8619 8.5 12 8.5C12.1381 8.5 12.25 8.38807 12.25 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],By=[["path",{d:"M15.5 14.5C18.8137 14.5 21.5 11.8137 21.5 8.5C21.5 5.18629 18.8137 2.5 15.5 2.5C12.1863 2.5 9.5 5.18629 9.5 8.5C9.5 9.38041 9.68962 10.2165 10.0303 10.9697L2.5 18.5V21.5H5.5V19.5H7.5V17.5H9.5L13.0303 13.9697C13.7835 14.3104 14.6196 14.5 15.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.5 6.5L16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Nd=[["path",{d:"M9.14339 10.691L9.35031 10.4841C11.329 8.50532 14.5372 8.50532 16.5159 10.4841C18.4947 12.4628 18.4947 15.671 16.5159 17.6497L13.6497 20.5159C11.671 22.4947 8.46279 22.4947 6.48405 20.5159C4.50532 18.5372 4.50532 15.329 6.48405 13.3503L6.9484 12.886",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.0516 11.114L17.5159 10.6497C19.4947 8.67095 19.4947 5.46279 17.5159 3.48405C15.5372 1.50532 12.329 1.50532 10.3503 3.48405L7.48405 6.35031C5.50532 8.32904 5.50532 11.5372 7.48405 13.5159C9.46279 15.4947 12.671 15.4947 14.6497 13.5159L14.8566 13.309",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],_2=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]],j8=[["path",{d:"M18 18C18 18.4644 18 18.6965 17.978 18.8918C17.7952 20.5145 16.5145 21.7952 14.8919 21.978C14.6965 22 14.4644 22 14 22H11C7.70017 22 6.05025 22 5.02513 20.9749C4 19.9498 4 18.2998 4 15L4.00001 8.99998C4.00001 5.70016 4.00003 4.05024 5.02514 3.02512C6.05027 2 7.70018 2 11 2H14C14.4644 2 14.6965 2 14.8919 2.02201C16.5145 2.20483 17.7952 3.48547 17.978 5.10816C18 5.30347 18 5.53565 18 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.07612 11.1183C8 11.3021 8 11.535 8 12.001C8 12.4669 8 12.6999 8.07612 12.8837C8.17761 13.1287 8.37229 13.3234 8.61732 13.4249C8.80109 13.501 9.03406 13.501 9.5 13.501H14.5C14.5002 15.2503 14.511 16.1299 15.0623 16.3858C15.0829 16.3954 15.1037 16.4042 15.1249 16.4124C15.7045 16.6353 16.3999 16.0139 17.7907 14.7711C19.2576 13.4602 19.9912 12.7851 20 11.957C19.9912 11.1289 19.2576 10.4538 17.7907 9.14301C16.3999 7.90018 15.7045 7.27876 15.1249 7.50171C15.1037 7.50985 15.0829 7.51869 15.0623 7.52822C14.5018 7.78844 14.5 8.69318 14.5 10.501H9.5C9.03406 10.501 8.80109 10.501 8.61732 10.5771C8.37229 10.6786 8.17761 10.8733 8.07612 11.1183Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],C8=[["path",{d:"M19.9264 22.2516V20.691C19.9264 20.288 20.0525 19.8966 20.2639 19.5531C21.7583 17.1245 22.2279 14.5196 21.9002 13.505C20.857 11.3418 17.3758 10.4907 15.76 10.2878L16.7966 5.12292C16.9705 4.30387 16.3513 3.47938 15.4135 3.28136C14.4758 3.08334 13.5746 3.58679 13.4007 4.40583L11.3462 14.0815L8.77462 12.4424C8.77462 12.4424 7.47969 11.406 6.44041 12.4424C5.40114 13.4788 6.44041 14.7701 6.44041 14.7701L10.3488 19.7776C10.6003 20.0997 10.7468 20.4908 10.7688 20.8984L10.8401 22.2177",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.32936 1.85194C7.32936 1.85194 9.54861 1.58797 9.867 1.90156C10.1124 2.14335 9.867 4.36134 9.867 4.36134M9.867 1.90156L6.89808 4.84002M4.6477 9.59694C4.6477 9.59694 2.42845 9.86092 2.11005 9.54732C1.86463 9.30553 2.11005 7.08754 2.11005 7.08754M2.11005 9.54732L5.07898 6.60886",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],ug=[["path",{d:"M8.5 14.5H15.5M8.5 9.5H12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.1706 20.8905C18.3536 20.6125 21.6856 17.2332 21.9598 12.9909C22.0134 12.1607 22.0134 11.3009 21.9598 10.4707C21.6856 6.22838 18.3536 2.84913 14.1706 2.57107C12.7435 2.47621 11.2536 2.47641 9.8294 2.57107C5.64639 2.84913 2.31441 6.22838 2.04024 10.4707C1.98659 11.3009 1.98659 12.1607 2.04024 12.9909C2.1401 14.536 2.82343 15.9666 3.62791 17.1746C4.09501 18.0203 3.78674 19.0758 3.30021 19.9978C2.94941 20.6626 2.77401 20.995 2.91484 21.2351C3.05568 21.4752 3.37026 21.4829 3.99943 21.4982C5.24367 21.5285 6.08268 21.1757 6.74868 20.6846C7.1264 20.4061 7.31527 20.2668 7.44544 20.2508C7.5756 20.2348 7.83177 20.3403 8.34401 20.5513C8.8044 20.7409 9.33896 20.8579 9.8294 20.8905C11.2536 20.9852 12.7435 20.9854 14.1706 20.8905Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],S8=[["path",{d:"M19.9264 22.2502V20.6912C19.9264 20.2886 20.0525 19.8976 20.2639 19.5545C21.7583 17.1282 22.2279 14.5259 21.9002 13.5123C20.857 11.3512 17.3758 10.5009 15.76 10.2983L16.7966 5.13851C16.9705 4.32028 16.3513 3.4966 15.4135 3.29877C14.4758 3.10095 13.5746 3.6039 13.4007 4.42213L11.3462 14.0882L8.77462 12.4508C8.77462 12.4508 7.47969 11.4154 6.44041 12.4508C5.40114 13.4861 6.44041 14.7762 6.44041 14.7762L10.3488 19.7787C10.6003 20.1005 10.7468 20.4912 10.7688 20.8984L10.8401 22.2164",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M6.95693 2.2382C6.95693 2.2382 6.7053 4.50936 6.95693 4.75695M6.95693 4.75695C7.28338 5.07806 9.55878 4.80775 9.55878 4.80775M6.95693 4.75695L10.001 1.74805M5.04502 9.24998C5.04502 9.24998 5.29665 6.97882 5.04502 6.73124M5.04502 6.73124C4.71857 6.41012 2.44317 6.68043 2.44317 6.68043M5.04502 6.73124L2.00098 9.74014",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],N8=[["path",{d:"M15.5 18C15.5 19.933 13.933 21.5 12 21.5C10.067 21.5 8.5 19.933 8.5 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19.2311 18H4.76887C3.79195 18 3 17.208 3 16.2311C3 15.762 3.18636 15.3121 3.51809 14.9803L4.12132 14.3771C4.68393 13.8145 5 13.0514 5 12.2558V9.5C5 5.63401 8.13401 2.5 12 2.5C15.866 2.5 19 5.634 19 9.5V12.2558C19 13.0514 19.3161 13.8145 19.8787 14.3771L20.4819 14.9803C20.8136 15.3121 21 15.762 21 16.2311C21 17.208 20.208 18 19.2311 18Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],dg=[["path",{d:"M12 22C11.1818 22 10.4002 21.6698 8.83693 21.0095C4.94564 19.3657 3 18.5438 3 17.1613C3 16.7742 3 10.0645 3 7M12 22C12.8182 22 13.5998 21.6698 15.1631 21.0095C19.0544 19.3657 21 18.5438 21 17.1613V7M12 22L12 11.3548",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.32592 9.69138L5.40472 8.27785C3.80157 7.5021 3 7.11423 3 6.5C3 5.88577 3.80157 5.4979 5.40472 4.72215L8.32592 3.30862C10.1288 2.43621 11.0303 2 12 2C12.9697 2 13.8712 2.4362 15.6741 3.30862L18.5953 4.72215C20.1984 5.4979 21 5.88577 21 6.5C21 7.11423 20.1984 7.5021 18.5953 8.27785L15.6741 9.69138C13.8712 10.5638 12.9697 11 12 11C11.0303 11 10.1288 10.5638 8.32592 9.69138Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6 12L8 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M17 4L7 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],E8=[["path",{d:"M4 7C4 5.58579 4 4.87868 4.43934 4.43934C4.87868 4 5.58579 4 7 4C8.41421 4 9.12132 4 9.56066 4.43934C10 4.87868 10 5.58579 10 7V17C10 18.4142 10 19.1213 9.56066 19.5607C9.12132 20 8.41421 20 7 20C5.58579 20 4.87868 20 4.43934 19.5607C4 19.1213 4 18.4142 4 17V7Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 7C14 5.58579 14 4.87868 14.4393 4.43934C14.8787 4 15.5858 4 17 4C18.4142 4 19.1213 4 19.5607 4.43934C20 4.87868 20 5.58579 20 7V17C20 18.4142 20 19.1213 19.5607 19.5607C19.1213 20 18.4142 20 17 20C15.5858 20 14.8787 20 14.4393 19.5607C14 19.1213 14 18.4142 14 17V7Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],D2=[["path",{d:"M15.2141 5.98239L16.6158 4.58063C17.39 3.80646 18.6452 3.80646 19.4194 4.58063C20.1935 5.3548 20.1935 6.60998 19.4194 7.38415L18.0176 8.78591M15.2141 5.98239L6.98023 14.2163C5.93493 15.2616 5.41226 15.7842 5.05637 16.4211C4.70047 17.058 4.3424 18.5619 4 20C5.43809 19.6576 6.94199 19.2995 7.57889 18.9436C8.21579 18.5877 8.73844 18.0651 9.78375 17.0198L18.0176 8.78591M15.2141 5.98239L18.0176 8.78591",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 20H17",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],k8=[["path",{d:"M18.8906 12.846C18.5371 14.189 16.8667 15.138 13.5257 17.0361C10.296 18.8709 8.6812 19.7884 7.37983 19.4196C6.8418 19.2671 6.35159 18.9776 5.95624 18.5787C5 17.6139 5 15.7426 5 12C5 8.2574 5 6.3861 5.95624 5.42132C6.35159 5.02245 6.8418 4.73288 7.37983 4.58042C8.6812 4.21165 10.296 5.12907 13.5257 6.96393C16.8667 8.86197 18.5371 9.811 18.8906 11.154C19.0365 11.7084 19.0365 12.2916 18.8906 12.846Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],nh=[["path",{d:"M12 4V20M20 12H4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],fr=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],T8=[["path",{d:"M11.8013 6.48949L13.2869 5.00392C14.9596 3.3312 17.1495 2.63737 19.4671 2.52399C20.3686 2.47989 20.8193 2.45784 21.1807 2.81928C21.5422 3.18071 21.5201 3.63143 21.476 4.53289C21.3626 6.8505 20.6688 9.04042 18.9961 10.7131L17.5105 12.1987C16.2871 13.4221 15.9393 13.77 16.1961 15.097C16.4496 16.1107 16.6949 17.0923 15.9578 17.8294C15.0637 18.7235 14.2481 18.7235 13.354 17.8294L6.17058 10.646C5.27649 9.75188 5.27646 8.9363 6.17058 8.04219C6.90767 7.30509 7.88929 7.55044 8.90297 7.80389C10.23 8.06073 10.5779 7.71289 11.8013 6.48949Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 21.5L7.5 16.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M8.5 21.5L10.5 19.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M2.5 15.5L4.5 13.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M17.125 7H17M17.25 7C17.25 7.13807 17.1381 7.25 17 7.25C16.8619 7.25 16.75 7.13807 16.75 7C16.75 6.86193 16.8619 6.75 17 6.75C17.1381 6.75 17.25 6.86193 17.25 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],vi=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],M8=[["path",{d:"M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10 10V8.5C10 7.39543 10.8954 6.5 12 6.5C13.1046 6.5 14 7.39543 14 8.5V10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14 10H10C9.17157 10 8.5 10.6716 8.5 11.5V13C8.5 13.8284 9.17157 14.5 10 14.5H14C14.8284 14.5 15.5 13.8284 15.5 13V11.5C15.5 10.6716 14.8284 10 14 10Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],R8=[["path",{d:"M21.0477 3.05293C18.8697 0.707363 2.48648 6.4532 2.50001 8.551C2.51535 10.9299 8.89809 11.6617 10.6672 12.1581C11.7311 12.4565 12.016 12.7625 12.2613 13.8781C13.3723 18.9305 13.9301 21.4435 15.2014 21.4996C17.2278 21.5892 23.1733 5.342 21.0477 3.05293Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.4999 12.5L14.9999 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],qs=[["path",{d:"M15.5 12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12C8.5 10.067 10.067 8.5 12 8.5C13.933 8.5 15.5 10.067 15.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M21.011 14.0965C21.5329 13.9558 21.7939 13.8854 21.8969 13.7508C22 13.6163 22 13.3998 22 12.9669V11.0332C22 10.6003 22 10.3838 21.8969 10.2493C21.7938 10.1147 21.5329 10.0443 21.011 9.90358C19.0606 9.37759 17.8399 7.33851 18.3433 5.40087C18.4817 4.86799 18.5509 4.60156 18.4848 4.44529C18.4187 4.28902 18.2291 4.18134 17.8497 3.96596L16.125 2.98673C15.7528 2.77539 15.5667 2.66972 15.3997 2.69222C15.2326 2.71472 15.0442 2.90273 14.6672 3.27873C13.208 4.73448 10.7936 4.73442 9.33434 3.27864C8.95743 2.90263 8.76898 2.71463 8.60193 2.69212C8.43489 2.66962 8.24877 2.77529 7.87653 2.98663L6.15184 3.96587C5.77253 4.18123 5.58287 4.28891 5.51678 4.44515C5.45068 4.6014 5.51987 4.86787 5.65825 5.4008C6.16137 7.3385 4.93972 9.37763 2.98902 9.9036C2.46712 10.0443 2.20617 10.1147 2.10308 10.2492C2 10.3838 2 10.6003 2 11.0332V12.9669C2 13.3998 2 13.6163 2.10308 13.7508C2.20615 13.8854 2.46711 13.9558 2.98902 14.0965C4.9394 14.6225 6.16008 16.6616 5.65672 18.5992C5.51829 19.1321 5.44907 19.3985 5.51516 19.5548C5.58126 19.7111 5.77092 19.8188 6.15025 20.0341L7.87495 21.0134C8.24721 21.2247 8.43334 21.3304 8.6004 21.3079C8.76746 21.2854 8.95588 21.0973 9.33271 20.7213C10.7927 19.2644 13.2088 19.2643 14.6689 20.7212C15.0457 21.0973 15.2341 21.2853 15.4012 21.3078C15.5682 21.3303 15.7544 21.2246 16.1266 21.0133L17.8513 20.034C18.2307 19.8187 18.4204 19.711 18.4864 19.5547C18.5525 19.3984 18.4833 19.132 18.3448 18.5991C17.8412 16.6616 19.0609 14.6226 21.011 14.0965Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],qu=[["path",{d:"M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],A8=[["path",{d:"M15 2L15.5387 4.39157C15.9957 6.42015 17.5798 8.00431 19.6084 8.46127L22 9L19.6084 9.53873C17.5798 9.99569 15.9957 11.5798 15.5387 13.6084L15 16L14.4613 13.6084C14.0043 11.5798 12.4202 9.99569 10.3916 9.53873L8 9L10.3916 8.46127C12.4201 8.00431 14.0043 6.42015 14.4613 4.39158L15 2Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 12L7.38481 13.7083C7.71121 15.1572 8.84275 16.2888 10.2917 16.6152L12 17L10.2917 17.3848C8.84275 17.7112 7.71121 18.8427 7.38481 20.2917L7 22L6.61519 20.2917C6.28879 18.8427 5.15725 17.7112 3.70827 17.3848L2 17L3.70827 16.6152C5.15725 16.2888 6.28879 15.1573 6.61519 13.7083L7 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],_8=[["path",{d:"M5 14.5C5 14.5 6.5 14.5 8.5 18C8.5 18 14.0588 8.83333 19 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],D8=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],is=[["path",{d:"M2.46433 9.34375C2.21579 9.34375 1.98899 9.14229 2.00041 8.87895C2.06733 7.33687 2.25481 6.33298 2.78008 5.53884C3.08228 5.08196 3.45765 4.68459 3.88923 4.36468C5.05575 3.5 6.70139 3.5 9.99266 3.5H14.0074C17.2986 3.5 18.9443 3.5 20.1108 4.36468C20.5424 4.68459 20.9177 5.08196 21.2199 5.53884C21.7452 6.33289 21.9327 7.33665 21.9996 8.87843C22.011 9.14208 21.7839 9.34375 21.5351 9.34375C20.1493 9.34375 19.0259 10.533 19.0259 12C19.0259 13.467 20.1493 14.6562 21.5351 14.6562C21.7839 14.6562 22.011 14.8579 21.9996 15.1216C21.9327 16.6634 21.7452 17.6671 21.2199 18.4612C20.9177 18.918 20.5424 19.3154 20.1108 19.6353C18.9443 20.5 17.2986 20.5 14.0074 20.5H9.99266C6.70139 20.5 5.05575 20.5 3.88923 19.6353C3.45765 19.3154 3.08228 18.918 2.78008 18.4612C2.25481 17.667 2.06733 16.6631 2.00041 15.1211C1.98899 14.8577 2.21579 14.6562 2.46433 14.6562C3.85012 14.6562 4.97352 13.467 4.97352 12C4.97352 10.533 3.85012 9.34375 2.46433 9.34375Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 3.5L9 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],O8=[["path",{d:"M18 14C18 14 13.5811 19 12 19C10.4188 19 6 14 6 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 9.99996C18 9.99996 13.5811 5.00001 12 5C10.4188 4.99999 6 10 6 10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],rh=[["path",{d:"M13 7C13 9.20914 11.2091 11 9 11C6.79086 11 5 9.20914 5 7C5 4.79086 6.79086 3 9 3C11.2091 3 13 4.79086 13 7Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M15 11C17.2091 11 19 9.20914 19 7C19 4.79086 17.2091 3 15 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 14H7C4.23858 14 2 16.2386 2 19C2 20.1046 2.89543 21 4 21H14C15.1046 21 16 20.1046 16 19C16 16.2386 13.7614 14 11 14Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M17 14C19.7614 14 22 16.2386 22 19C22 20.1046 21.1046 21 20 21H18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],L8=[["path",{d:"M17 8.5C17 5.73858 14.7614 3.5 12 3.5C9.23858 3.5 7 5.73858 7 8.5C7 11.2614 9.23858 13.5 12 13.5C14.7614 13.5 17 11.2614 17 8.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 20.5C19 16.634 15.866 13.5 12 13.5C8.13401 13.5 5 16.634 5 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],O2=25e3;async function Te(t,n={}){const a=new Headers(n.headers);!a.has("Content-Type")&&n.body&&a.set("Content-Type","application/json");const o=typeof window<"u"?sessionStorage.getItem("nexus_impersonate_group"):null;o&&!a.has("X-Impersonate-Group")&&a.set("X-Impersonate-Group",o);const c=new AbortController,l=window.setTimeout(()=>c.abort(),O2);let d;try{d=await fetch(t,{...n,headers:a,credentials:"include",signal:c.signal})}catch(p){throw p instanceof Error&&p.name==="AbortError"?new Error("Request timed out. The API may still be starting or the bot is restarting — try again."):new Error(p instanceof Error?p.message:"Could not reach the API. Is the bot process running?")}finally{window.clearTimeout(l)}const m=await d.json().catch(()=>({}));if(!d.ok)throw new Error(m.error||`Request failed (${d.status})`);return m}function z8(t,n){return n!=="supportbot"?t:t.replace(/^(\s*Token:\s*)["'][^"']*["']/m,'$1"BOT_TOKEN"')}const Ne={me:()=>Te("/api/auth/me"),logout:()=>Te("/api/auth/logout",{method:"POST"}),health:()=>Te("/api/health"),stats:()=>Te("/api/stats"),getAlerts:()=>Te("/api/alerts"),getGuildStatus:()=>Te("/api/guild/status"),getGuildResources:(t=!1)=>Te(`/api/guild/resources${t?"?refresh=1":""}`),leaveGuild:t=>Te(`/api/guild/${t}/leave`,{method:"POST"}),listConfigs:()=>["supportbot","ticket-panel","commands","messages","supportbot-ai"],getConfigRaw:t=>Te(`/api/configs/${t}`),saveConfigRaw:(t,n)=>Te("/api/configs/raw",{method:"PUT",body:JSON.stringify({filename:t,content:n})}),getConfigJson:t=>Te(`/api/configs/json/${t}`),updateConfigFields:t=>Te("/api/configs/update-fields/multi",{method:"POST",body:JSON.stringify(t)}),checkForUpdates:()=>Te("/api/system/update-check"),runUpdate:(t,n,a)=>Te("/api/system/update",{method:"POST",body:JSON.stringify({repoId:t,version:n,url:a})}),reloadConfigs:t=>Te("/api/system/reload-configs",{method:"POST",body:JSON.stringify(t?{file:t}:{})}),getLogsMeta:()=>Te("/api/system/logs/meta"),getLogs:t=>{var o;const n=new URLSearchParams;(o=t.types)!=null&&o.length&&n.set("types",t.types.join(",")),t.cursor&&Object.keys(t.cursor).length>0&&n.set("cursor",JSON.stringify(t.cursor)),t.tail!=null&&n.set("tail",String(t.tail));const a=n.toString();return Te(`/api/system/logs${a?`?${a}`:""}`)},listTranscripts:()=>Te("/api/system/transcripts"),listOpenTickets:()=>Te("/api/system/tickets/open"),createTicket:t=>Te("/api/system/tickets/create",{method:"POST",body:JSON.stringify(t)}),getTicketMessages:t=>Te(`/api/system/tickets/${encodeURIComponent(t)}/messages`),sendTicketReply:(t,n,a,o)=>Te(`/api/system/tickets/${encodeURIComponent(t)}/reply`,{method:"POST",body:JSON.stringify({message:n,staffName:a,attachments:o})}),deleteTicketMessage:(t,n)=>Te(`/api/system/tickets/${encodeURIComponent(t)}/messages/${encodeURIComponent(n)}`,{method:"DELETE"}),editTicketMessage:(t,n,a)=>Te(`/api/system/tickets/${encodeURIComponent(t)}/messages/${encodeURIComponent(n)}`,{method:"PATCH",body:JSON.stringify({content:a})}),closeTicket:(t,n)=>Te(`/api/system/tickets/${encodeURIComponent(t)}/close`,{method:"POST",body:JSON.stringify({reason:n})}),getTranscript:t=>Te(`/api/system/transcripts/${t}`),getTranscriptSettings:()=>Te("/api/system/transcript-settings"),updateTranscriptSettings:t=>Te("/api/system/transcript-settings",{method:"PUT",body:JSON.stringify(t)}),deleteTranscript:t=>Te(`/api/system/transcripts/${encodeURIComponent(t)}`,{method:"DELETE"}),purgeTranscripts:()=>Te("/api/system/transcripts/purge",{method:"POST"}),getBranding:()=>Te("/api/branding"),updateBranding:t=>Te("/api/branding",{method:"PUT",body:JSON.stringify(t)}),uploadBrandingFavicon:t=>Te("/api/branding/favicon",{method:"POST",body:JSON.stringify({dataUrl:t})}),removeBrandingFavicon:()=>Te("/api/branding/favicon",{method:"DELETE"}),resetBranding:()=>Te("/api/branding/reset",{method:"POST"}),getTranscriptTemplate:()=>Te("/api/system/transcript-template"),saveTranscriptTemplate:t=>Te("/api/system/transcript-template",{method:"PUT",body:JSON.stringify(t)}),previewTranscriptTemplate:async t=>{const n=new AbortController,a=window.setTimeout(()=>n.abort(),O2);try{const o=await fetch("/api/system/transcript-template/preview",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t),signal:n.signal});if(!o.ok)throw new Error(`Preview failed (${o.status})`);return await o.text()}finally{window.clearTimeout(a)}},getNotifications:()=>Te("/api/notifications"),markNotificationsRead:t=>Te("/api/notifications/read",{method:"POST",body:JSON.stringify({ids:t})}),dismissNotification:t=>Te(`/api/notifications/${t}`,{method:"DELETE"}),listDashboardUsers:()=>Te("/api/dashboard-users"),addDashboardUser:t=>Te("/api/dashboard-users",{method:"POST",body:JSON.stringify(t)}),updateDashboardUser:(t,n)=>Te(`/api/dashboard-users/${t}`,{method:"PATCH",body:JSON.stringify(n)}),removeDashboardUser:t=>Te(`/api/dashboard-users/${t}`,{method:"DELETE"}),listGroups:()=>Te("/api/dashboard-groups"),createGroup:t=>Te("/api/dashboard-groups",{method:"POST",body:JSON.stringify(t)}),updateGroup:(t,n)=>Te(`/api/dashboard-groups/${t}`,{method:"PUT",body:JSON.stringify(n)}),deleteGroup:t=>Te(`/api/dashboard-groups/${t}`,{method:"DELETE"}),getAddonsCatalog:()=>Te("/api/addons/catalog"),getAddonsInstalled:()=>Te("/api/addons/installed"),listAddonConfigs:()=>Te("/api/addons/configs"),installAddon:t=>Te("/api/addons/install",{method:"POST",body:JSON.stringify({name:t})}),getAddonConfigJson:t=>Te(`/api/addons/configs/json/${encodeURIComponent(t)}`),saveAddonConfig:(t,n)=>Te("/api/addons/configs",{method:"PUT",body:JSON.stringify({filename:t,data:n})}),buildAddon:t=>Te("/api/addons/build",{method:"POST",body:JSON.stringify(t)}),getSetupStatus:()=>Te("/api/setup/status"),validateSetup:t=>Te("/api/setup/validate",{method:"POST",body:JSON.stringify(t)}),resetDashboard:()=>Te("/api/setup/reset",{method:"POST"}),completeSetup:t=>Te("/api/setup/complete",{method:"POST",body:JSON.stringify(t)})};function fg(t){const n=Math.floor(t/86400),a=Math.floor(t%86400/3600),o=Math.floor(t%3600/60);return n>0?`${n}d ${a}h`:a>0?`${a}h ${o}m`:`${o}m`}const L2=["supportbot","ticket-panel","commands","messages","supportbot-ai"],$y={owner:"Owner",admin:"Admin",moderator:"Moderator",editor:"Editor",viewer:"Viewer",custom:"Custom"},P8={owner:"Full access to everything",admin:"Full access including user management",moderator:"View dashboard, logs, transcripts, and configs",editor:"Edit configuration files",viewer:"View-only access",custom:"Permissions you configure below"};function Rn(t,n){var c,l,d;if(!t)return!1;if(n==="overview")return t.overview;if(n==="tickets")return t.tickets??t.overview;if(n==="logs")return t.logs;if(n==="transcripts")return t.transcripts;if(n==="rawYaml"||n==="configs.raw_yaml"||n==="configs.rawYaml")return!!(t.rawYaml??((c=t.configs)==null?void 0:c.rawYaml)??!1);if(n==="settings.view")return t.settings.view;if(n==="settings.update")return t.settings.update;if(n==="users.view")return t.users.view;if(n==="users.manage")return t.users.manage;const a=n.match(/^configs\.([a-z0-9-]+)\.view$/);if(a){const m=a[1];return!!((l=t.configs[m])!=null&&l.view)}const o=n.match(/^configs\.([a-z0-9-]+)\.edit$/);if(o){const m=o[1];return!!((d=t.configs[m])!=null&&d.edit)}return!1}function sd(t,n){return Rn(t,`configs.${n}.view`)}function z2(t,n){return Rn(t,`configs.${n}.edit`)}function I8(t){return L2.some(n=>sd(t,n))}function Ku(t,n){return L2.reduce((a,o)=>(a[o]={view:t,edit:n},a),{})}function Hy(t=!0,n=!0){return{overview:!0,tickets:!0,logs:!0,transcripts:!0,rawYaml:t,settings:{view:!0,update:!0},configs:Ku(!0,!0),users:{view:!0,manage:n}}}function ls(t,n){switch(t){case"owner":return Hy(!0,!0);case"admin":return Hy(!1,!1);case"moderator":return{overview:!0,tickets:!0,logs:!0,transcripts:!0,rawYaml:!1,settings:{view:!0,update:!1},configs:Ku(!0,!1),users:{view:!1,manage:!1}};case"editor":return{overview:!0,tickets:!0,logs:!0,transcripts:!1,rawYaml:!1,settings:{view:!0,update:!1},configs:Ku(!0,!0),users:{view:!1,manage:!1}};case"viewer":return{overview:!0,tickets:!0,logs:!0,transcripts:!0,rawYaml:!1,settings:{view:!0,update:!1},configs:Ku(!0,!1),users:{view:!1,manage:!1}};case"custom":return n??ls("viewer");default:return ls("viewer")}}function P2(t){return t.globalName||t.username}function mg(t){return Rn(t,"overview")?"/":Rn(t,"logs")?"/logs":I8(t)?"/configs?file=supportbot":Rn(t,"transcripts")?"/transcripts":Rn(t,"settings.view")?"/settings":Rn(t,"users.view")?"/users":"/login"}const I2=f.createContext(null),Tu="nexus_impersonate_group";function U8({children:t}){const[n,a]=f.useState(null),[o,c]=f.useState([]),[l,d]=f.useState(!0),[m,p]=f.useState(()=>typeof window<"u"?sessionStorage.getItem(Tu):null),g=f.useCallback(async()=>{var _;try{const[R,L]=await Promise.all([Ne.me(),Ne.listGroups().catch(()=>({data:{groups:[]}}))]);return R.data?(a(R.data),(_=L.data)!=null&&_.groups&&c(L.data.groups),!0):(a(null),!1)}catch{return a(null),!1}},[]);f.useEffect(()=>{g().finally(()=>d(!1))},[g]);const b=f.useCallback(()=>{window.location.href="/api/auth/discord"},[]),v=f.useCallback(async()=>{try{typeof window<"u"&&sessionStorage.removeItem(Tu),p(null),await Ne.logout()}finally{a(null)}},[]),w=f.useCallback(_=>{typeof window<"u"&&sessionStorage.setItem(Tu,_),p(_)},[]),y=f.useCallback(()=>{typeof window<"u"&&sessionStorage.removeItem(Tu),p(null)},[]),C=f.useMemo(()=>o.find(_=>_.id===m)||null,[o,m]),S=!!(m&&C),N=f.useMemo(()=>S&&C?C.permissions:(n==null?void 0:n.permissions)??null,[S,C,n]),E=f.useCallback(_=>Rn(N,_),[N]),T=f.useCallback(_=>sd(N,_),[N]),M=f.useCallback(_=>z2(N,_),[N]),k=f.useMemo(()=>({user:n,permissions:N,isAuthenticated:!!n,loading:l,availableGroups:o,isImpersonating:S,impersonatedGroup:C,impersonateGroup:w,stopImpersonation:y,loginWithDiscord:b,logout:v,refreshSession:g,hasPermission:E,canViewConfig:T,canEditConfig:M}),[n,N,l,o,S,C,w,y,b,v,g,E,T,M]);return s.jsx(I2.Provider,{value:k,children:t})}function Yt(){const t=f.useContext(I2);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}const Gy="supportbot-dashboard-favicon";function wp(t){t.pageTitle&&(document.title=t.pageTitle);let n=document.getElementById(Gy);if(t.faviconUrl){const a=`${t.faviconUrl}${t.updatedAt?`?v=${t.updatedAt}`:""}`;n||(n=document.createElement("link"),n.id=Gy,n.rel="icon",document.head.appendChild(n)),n.href=a}else n&&n.remove()}const jp={title:"SupportBot",pageTitle:"SupportBot Dashboard",hasFavicon:!1,faviconUrl:null,updatedAt:null},U2=f.createContext(null);function B8({children:t}){const[n,a]=f.useState(jp),[o,c]=f.useState(!0),l=f.useCallback(async()=>{try{const p=await Ne.getBranding();p.data&&(a(p.data),wp(p.data))}catch{a(jp),wp(jp)}finally{c(!1)}},[]);f.useEffect(()=>{l()},[l]);const d=f.useCallback(p=>{a(p),wp(p)},[]),m=f.useMemo(()=>({branding:n,loading:o,refreshBranding:l,setBrandingLocal:d}),[n,o,l,d]);return s.jsx(U2.Provider,{value:m,children:t})}function Ed(){const t=f.useContext(U2);if(!t)throw new Error("useBranding must be used within BrandingProvider");return t}const B2=f.createContext(null);function $8({children:t}){const[n,a]=f.useState(null),[o,c]=f.useState(!0),[l,d]=f.useState(""),m=f.useCallback(async()=>{try{const g=await Ne.stats();g.data?(a(g.data),d("")):g.error&&d(g.error)}catch(g){d(g instanceof Error?g.message:"Failed to load stats")}finally{c(!1)}},[]);f.useEffect(()=>{m();const g=setInterval(m,3e4);return()=>clearInterval(g)},[m]);const p=f.useMemo(()=>({stats:n,loading:o,error:l,refresh:m}),[n,o,l,m]);return s.jsx(B2.Provider,{value:p,children:t})}function kd(){const t=f.useContext(B2);if(!t)throw new Error("useBotStats must be used within BotStatsProvider");return t}function $2(){const t=Kn(),[n,a]=f.useState([]),[o,c]=f.useState(!0),l=f.useCallback(async()=>{try{const d=await Ne.listAddonConfigs();a(d.data??[])}catch{a([])}finally{c(!1)}},[]);return f.useEffect(()=>{l()},[l,t.pathname]),{files:n,loading:o,refresh:l}}const ah="addon:";function _l(t){return`${ah}${t}`}function H8(t){return t?t.startsWith(ah)?{type:"addon",file:t.slice(ah.length)}:{type:"main",file:t}:null}function H2(t){return t.replace(/\.(yml|yaml|json)$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,n=>n.toUpperCase())}const G8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},G2=f.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:a,absoluteStrokeWidth:o=!1,className:c="",altIcon:l,showAlt:d=!1,icon:m,primaryColor:p,secondaryColor:g,disableSecondaryOpacity:b=!1,...v},w)=>{const y=a!==void 0?o?Number(a)*24/Number(n):a:void 0,C=y!==void 0?{strokeWidth:y,stroke:"currentColor"}:{},S={ref:w,...G8,width:n,height:n,color:p||t,className:c,...C,...v},E=[...d&&l?l:m].sort(([,T],[,M])=>{const k=T.opacity!==void 0;return M.opacity!==void 0?1:k?-1:0}).map(([T,M])=>{const k=M.opacity!==void 0,_=k&&!b?M.opacity:void 0,R=g?{...M.stroke!==void 0?{stroke:k?g:p||t}:{fill:k?g:p||t}}:{};return f.createElement(T,{...M,...C,...R,opacity:_,key:M.key})});return f.createElement("svg",S,E)});G2.displayName="HugeiconsIcon";function V2(t){var n,a,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var c=t.length;for(n=0;n<c;n++)t[n]&&(a=V2(t[n]))&&(o&&(o+=" "),o+=a)}else for(a in t)t[a]&&(o&&(o+=" "),o+=a);return o}function F2(){for(var t,n,a=0,o="",c=arguments.length;a<c;a++)(t=arguments[a])&&(n=V2(t))&&(o&&(o+=" "),o+=n);return o}const pg="-",V8=t=>{const n=Y8(t),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:d=>{const m=d.split(pg);return m[0]===""&&m.length!==1&&m.shift(),Y2(m,n)||F8(d)},getConflictingClassGroupIds:(d,m)=>{const p=a[d]||[];return m&&o[d]?[...p,...o[d]]:p}}},Y2=(t,n)=>{var d;if(t.length===0)return n.classGroupId;const a=t[0],o=n.nextPart.get(a),c=o?Y2(t.slice(1),o):void 0;if(c)return c;if(n.validators.length===0)return;const l=t.join(pg);return(d=n.validators.find(({validator:m})=>m(l)))==null?void 0:d.classGroupId},Vy=/^\[(.+)\]$/,F8=t=>{if(Vy.test(t)){const n=Vy.exec(t)[1],a=n==null?void 0:n.substring(0,n.indexOf(":"));if(a)return"arbitrary.."+a}},Y8=t=>{const{theme:n,prefix:a}=t,o={nextPart:new Map,validators:[]};return K8(Object.entries(t.classGroups),a).forEach(([l,d])=>{sh(d,o,l,n)}),o},sh=(t,n,a,o)=>{t.forEach(c=>{if(typeof c=="string"){const l=c===""?n:Fy(n,c);l.classGroupId=a;return}if(typeof c=="function"){if(q8(c)){sh(c(o),n,a,o);return}n.validators.push({validator:c,classGroupId:a});return}Object.entries(c).forEach(([l,d])=>{sh(d,Fy(n,l),a,o)})})},Fy=(t,n)=>{let a=t;return n.split(pg).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},q8=t=>t.isThemeGetter,K8=(t,n)=>n?t.map(([a,o])=>{const c=o.map(l=>typeof l=="string"?n+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([d,m])=>[n+d,m])):l);return[a,c]}):t,W8=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,a=new Map,o=new Map;const c=(l,d)=>{a.set(l,d),n++,n>t&&(n=0,o=a,a=new Map)};return{get(l){let d=a.get(l);if(d!==void 0)return d;if((d=o.get(l))!==void 0)return c(l,d),d},set(l,d){a.has(l)?a.set(l,d):c(l,d)}}},q2="!",X8=t=>{const{separator:n,experimentalParseClassName:a}=t,o=n.length===1,c=n[0],l=n.length,d=m=>{const p=[];let g=0,b=0,v;for(let N=0;N<m.length;N++){let E=m[N];if(g===0){if(E===c&&(o||m.slice(N,N+l)===n)){p.push(m.slice(b,N)),b=N+l;continue}if(E==="/"){v=N;continue}}E==="["?g++:E==="]"&&g--}const w=p.length===0?m:m.substring(b),y=w.startsWith(q2),C=y?w.substring(1):w,S=v&&v>b?v-b:void 0;return{modifiers:p,hasImportantModifier:y,baseClassName:C,maybePostfixModifierPosition:S}};return a?m=>a({className:m,parseClassName:d}):d},Z8=t=>{if(t.length<=1)return t;const n=[];let a=[];return t.forEach(o=>{o[0]==="["?(n.push(...a.sort(),o),a=[]):a.push(o)}),n.push(...a.sort()),n},Q8=t=>({cache:W8(t.cacheSize),parseClassName:X8(t),...V8(t)}),J8=/\s+/,eE=(t,n)=>{const{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:c}=n,l=[],d=t.trim().split(J8);let m="";for(let p=d.length-1;p>=0;p-=1){const g=d[p],{modifiers:b,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:y}=a(g);let C=!!y,S=o(C?w.substring(0,y):w);if(!S){if(!C){m=g+(m.length>0?" "+m:m);continue}if(S=o(w),!S){m=g+(m.length>0?" "+m:m);continue}C=!1}const N=Z8(b).join(":"),E=v?N+q2:N,T=E+S;if(l.includes(T))continue;l.push(T);const M=c(S,C);for(let k=0;k<M.length;++k){const _=M[k];l.push(E+_)}m=g+(m.length>0?" "+m:m)}return m};function tE(){let t=0,n,a,o="";for(;t<arguments.length;)(n=arguments[t++])&&(a=K2(n))&&(o&&(o+=" "),o+=a);return o}const K2=t=>{if(typeof t=="string")return t;let n,a="";for(let o=0;o<t.length;o++)t[o]&&(n=K2(t[o]))&&(a&&(a+=" "),a+=n);return a};function nE(t,...n){let a,o,c,l=d;function d(p){const g=n.reduce((b,v)=>v(b),t());return a=Q8(g),o=a.cache.get,c=a.cache.set,l=m,m(p)}function m(p){const g=o(p);if(g)return g;const b=eE(p,a);return c(p,b),b}return function(){return l(tE.apply(null,arguments))}}const Ct=t=>{const n=a=>a[t]||[];return n.isThemeGetter=!0,n},W2=/^\[(?:([a-z-]+):)?(.+)\]$/i,rE=/^\d+\/\d+$/,aE=new Set(["px","full","screen"]),sE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oE=/\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$/,iE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ha=t=>oi(t)||aE.has(t)||rE.test(t),ss=t=>yi(t,"length",xE),oi=t=>!!t&&!Number.isNaN(Number(t)),Cp=t=>yi(t,"number",oi),kl=t=>!!t&&Number.isInteger(Number(t)),uE=t=>t.endsWith("%")&&oi(t.slice(0,-1)),He=t=>W2.test(t),os=t=>sE.test(t),dE=new Set(["length","size","percentage"]),fE=t=>yi(t,dE,X2),mE=t=>yi(t,"position",X2),pE=new Set(["image","url"]),hE=t=>yi(t,pE,vE),gE=t=>yi(t,"",bE),Tl=()=>!0,yi=(t,n,a)=>{const o=W2.exec(t);return o?o[1]?typeof n=="string"?o[1]===n:n.has(o[1]):a(o[2]):!1},xE=t=>oE.test(t)&&!iE.test(t),X2=()=>!1,bE=t=>lE.test(t),vE=t=>cE.test(t),yE=()=>{const t=Ct("colors"),n=Ct("spacing"),a=Ct("blur"),o=Ct("brightness"),c=Ct("borderColor"),l=Ct("borderRadius"),d=Ct("borderSpacing"),m=Ct("borderWidth"),p=Ct("contrast"),g=Ct("grayscale"),b=Ct("hueRotate"),v=Ct("invert"),w=Ct("gap"),y=Ct("gradientColorStops"),C=Ct("gradientColorStopPositions"),S=Ct("inset"),N=Ct("margin"),E=Ct("opacity"),T=Ct("padding"),M=Ct("saturate"),k=Ct("scale"),_=Ct("sepia"),R=Ct("skew"),L=Ct("space"),ne=Ct("translate"),X=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",He,n],q=()=>[He,n],ce=()=>["",ha,ss],de=()=>["auto",oi,He],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",He],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[oi,He];return{cacheSize:500,separator:":",theme:{colors:[Tl],spacing:[ha,ss],blur:["none","",os,He],brightness:O(),borderColor:[t],borderRadius:["none","","full",os,He],borderSpacing:q(),borderWidth:ce(),contrast:O(),grayscale:ae(),hueRotate:O(),invert:ae(),gap:q(),gradientColorStops:[t],gradientColorStopPositions:[uE,ss],inset:H(),margin:H(),opacity:O(),padding:q(),saturate:O(),scale:O(),sepia:ae(),skew:O(),space:q(),translate:q()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[os]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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:[...se(),He]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",kl,He]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",kl,He]}],"grid-cols":[{"grid-cols":[Tl]}],"col-start-end":[{col:["auto",{span:["full",kl,He]},He]}],"col-start":[{"col-start":de()}],"col-end":[{"col-end":de()}],"grid-rows":[{"grid-rows":[Tl]}],"row-start-end":[{row:["auto",{span:[kl,He]},He]}],"row-start":[{"row-start":de()}],"row-end":[{"row-end":de()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[w]}],"gap-x":[{"gap-x":[w]}],"gap-y":[{"gap-y":[w]}],"justify-content":[{justify:["normal",...oe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...oe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...oe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,n]}],"min-w":[{"min-w":[He,n,"min","max","fit"]}],"max-w":[{"max-w":[He,n,"none","full","min","max","fit","prose",{screen:[os]},os]}],h:[{h:[He,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,n,"auto","min","max","fit"]}],"font-size":[{text:["base",os,ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Cp]}],"font-family":[{font:[Tl]}],"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",He]}],"line-clamp":[{"line-clamp":["none",oi,Cp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ha,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ha,ss]}],"underline-offset":[{"underline-offset":["auto",ha,He]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],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",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...se(),mE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hE]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[m]}],"border-w-x":[{"border-x":[m]}],"border-w-y":[{"border-y":[m]}],"border-w-s":[{"border-s":[m]}],"border-w-e":[{"border-e":[m]}],"border-w-t":[{"border-t":[m]}],"border-w-r":[{"border-r":[m]}],"border-w-b":[{"border-b":[m]}],"border-w-l":[{"border-l":[m]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[m]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[m]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:P()}],"border-color":[{border:[c]}],"border-color-x":[{"border-x":[c]}],"border-color-y":[{"border-y":[c]}],"border-color-s":[{"border-s":[c]}],"border-color-e":[{"border-e":[c]}],"border-color-t":[{"border-t":[c]}],"border-color-r":[{"border-r":[c]}],"border-color-b":[{"border-b":[c]}],"border-color-l":[{"border-l":[c]}],"divide-color":[{divide:[c]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[ha,He]}],"outline-w":[{outline:[ha,ss]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[ha,ss]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",os,gE]}],"shadow-color":[{shadow:[Tl]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",os,He]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[v]}],saturate:[{saturate:[M]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",He]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[kl,He]}],"translate-x":[{"translate-x":[ne]}],"translate-y":[{"translate-y":[ne]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],accent:[{accent:["auto",t]}],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",He]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-mt":[{"scroll-mt":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-ps":[{"scroll-ps":q()}],"scroll-pe":[{"scroll-pe":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"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",He]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ha,ss,Cp]}],stroke:[{stroke:[t,"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"]}}},wE=nE(yE);function pe(...t){return wE(F2(t))}function xe({icon:t,className:n,size:a=18,strokeWidth:o=1.75}){return s.jsx(G2,{icon:t,size:a,className:pe("shrink-0",n),strokeWidth:o})}var jE=Object.defineProperty,hg=(t,n)=>jE(t,"name",{value:n,configurable:!0});function oh(t,n){if(typeof t=="function")return t(n);t!=null&&(t.current=n)}hg(oh,"setRef");function Ks(...t){return n=>{let a=!1;const o=t.map(c=>{const l=oh(c,n);return!a&&typeof l=="function"&&(a=!0),l});if(a)return()=>{for(let c=0;c<o.length;c++){const l=o[c];typeof l=="function"?l():oh(t[c],null)}}}}hg(Ks,"composeRefs");function Pe(...t){return f.useCallback(Ks(...t),t)}hg(Pe,"useComposedRefs");var CE=Object.defineProperty,Mr=(t,n)=>CE(t,"name",{value:n,configurable:!0});function Er(t){const n=f.forwardRef((a,o)=>{let{children:c,...l}=a,d=null,m=!1;const p=[];ih(c)&&typeof Mu=="function"&&(c=Mu(c._payload)),f.Children.forEach(c,w=>{var y;if(tw(w)){m=!0;const C=w;let S="child"in C.props?C.props.child:C.props.children;ih(S)&&typeof Mu=="function"&&(S=Mu(S._payload)),d=SE(C,S),p.push((y=d==null?void 0:d.props)==null?void 0:y.children)}else p.push(w)}),d?d=f.cloneElement(d,void 0,p):!m&&f.Children.count(c)===1&&f.isValidElement(c)&&(d=c);const g=d?ew(d):void 0,b=Pe(o,g);if(!d){if(c||c===0)throw new Error(m?kE(t):EE(t));return c}const v=J2(l,d.props??{});return d.type!==f.Fragment&&(v.ref=o?b:g),f.cloneElement(d,v)});return n.displayName=`${t}.Slot`,n}Mr(Er,"createSlot");var wi=Er("Slot"),Z2=Symbol.for("radix.slottable");function Q2(t){const n=Mr(a=>"child"in a?a.children(a.child):a.children,"Slottable");return n.displayName=`${t}.Slottable`,n.__radixId=Z2,n}Mr(Q2,"createSlottable");var SE=Mr((t,n)=>{if("child"in t.props){const a=t.props.child;return f.isValidElement(a)?f.cloneElement(a,void 0,t.props.children(a.props.children)):null}return f.isValidElement(n)?n:null},"getSlottableElementFromSlottable");function J2(t,n){const a={...n};for(const o in n){const c=t[o],l=n[o];/^on[A-Z]/.test(o)?c&&l?a[o]=(...m)=>{const p=l(...m);return c(...m),p}:c&&(a[o]=c):o==="style"?a[o]={...c,...l}:o==="className"&&(a[o]=[c,l].filter(Boolean).join(" "))}return{...t,...a}}Mr(J2,"mergeProps");function ew(t){var o,c;let n=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?t.ref:(n=(c=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:c.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}Mr(ew,"getElementRef");function tw(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Z2}Mr(tw,"isSlottable");var NE=Symbol.for("react.lazy");function ih(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===NE&&"_payload"in t&&nw(t._payload)}Mr(ih,"isLazyComponent");function nw(t){return typeof t=="object"&&t!==null&&"then"in t}Mr(nw,"isPromiseLike");var EE=Mr(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),kE=Mr(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Mu=pi[" use ".trim().toString()];const Yy=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,qy=F2,ji=(t,n)=>a=>{var o;if((n==null?void 0:n.variants)==null)return qy(t,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:c,defaultVariants:l}=n,d=Object.keys(c).map(g=>{const b=a==null?void 0:a[g],v=l==null?void 0:l[g];if(b===null)return null;const w=Yy(b)||Yy(v);return c[g][w]}),m=a&&Object.entries(a).reduce((g,b)=>{let[v,w]=b;return w===void 0||(g[v]=w),g},{}),p=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((g,b)=>{let{class:v,className:w,...y}=b;return Object.entries(y).every(C=>{let[S,N]=C;return Array.isArray(N)?N.includes({...l,...m}[S]):{...l,...m}[S]===N})?[...g,v,w]:g},[]);return qy(t,d,p,a==null?void 0:a.class,a==null?void 0:a.className)},TE=ji("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"}}),ue=f.forwardRef(({className:t,variant:n,size:a,asChild:o=!1,...c},l)=>{const d=o?wi:"button";return s.jsx(d,{className:pe(TE({variant:n,size:a,className:t})),ref:l,...c})});ue.displayName="Button";var ME=Object.defineProperty,Ci=(t,n)=>ME(t,"name",{value:n,configurable:!0}),rw=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ce(t,n,{checkForDefaultPrevented:a=!0}={}){return Ci(function(c){if(t==null||t(c),a===!1||!c||!c.defaultPrevented)return n==null?void 0:n(c)},"handleEvent")}Ci(Ce,"composeEventHandlers");function RE(t){var n;if(!rw)throw new Error("Cannot access window outside of the DOM");return((n=t==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)??window}Ci(RE,"getOwnerWindow");function lh(t){if(!rw)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Ci(lh,"getOwnerDocument");function aw(t,n=!1){const{activeElement:a}=lh(t);if(!(a!=null&&a.nodeName))return null;if(sw(a)&&a.contentDocument)return aw(a.contentDocument.body,n);if(n){const o=a.getAttribute("aria-activedescendant");if(o){const c=lh(a).getElementById(o);if(c)return c}}return a}Ci(aw,"getActiveElement");function sw(t){return t.tagName==="IFRAME"}Ci(sw,"isFrame");var AE=Object.defineProperty,mr=(t,n)=>AE(t,"name",{value:n,configurable:!0});function _E(t,n){const a=f.createContext(n);a.displayName=t+"Context";const o=mr(l=>{const{children:d,...m}=l,p=f.useMemo(()=>m,Object.values(m));return s.jsx(a.Provider,{value:p,children:d})},"Provider");o.displayName=t+"Provider";function c(l,d={}){const{optional:m=!1}=d,p=f.useContext(a);if(p)return p;if(n!==void 0)return n;if(!m)throw new Error(`\`${l}\` must be used within \`${t}\``)}return mr(c,"useContext"),[o,c]}mr(_E,"createContext");function bn(t,n=[]){let a=[];function o(l,d){const m=f.createContext(d);m.displayName=l+"Context";const p=a.length;a=[...a,d];const g=mr(v=>{var E;const{scope:w,children:y,...C}=v,S=((E=w==null?void 0:w[t])==null?void 0:E[p])||m,N=f.useMemo(()=>C,Object.values(C));return s.jsx(S.Provider,{value:N,children:y})},"Provider");g.displayName=l+"Provider";function b(v,w,y={}){var E;const{optional:C=!1}=y,S=((E=w==null?void 0:w[t])==null?void 0:E[p])||m,N=f.useContext(S);if(N)return N;if(d!==void 0)return d;if(!C)throw new Error(`\`${v}\` must be used within \`${l}\``)}return mr(b,"useContext"),[g,b]}mr(o,"createContext");const c=mr(()=>{const l=a.map(d=>f.createContext(d));return mr(function(m){const p=(m==null?void 0:m[t])||l;return f.useMemo(()=>({[`__scope${t}`]:{...m,[t]:p}}),[m,p])},"useScope")},"createScope");return c.scopeName=t,[o,ow(c,...n)]}mr(bn,"createContextScope");function ow(...t){const n=t[0];if(t.length===1)return n;const a=mr(()=>{const o=t.map(c=>({useScope:c(),scopeName:c.scopeName}));return mr(function(l){const d=o.reduce((m,{useScope:p,scopeName:g})=>{const v=p(l)[`__scope${g}`];return{...m,...v}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])},"useComposedScopes")},"createScope");return a.scopeName=n.scopeName,a}mr(ow,"composeContextScopes");var St=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},DE=Object.defineProperty,OE=(t,n)=>DE(t,"name",{value:n,configurable:!0}),Ky=pi[" useEffectEvent ".trim().toString()],Wy=pi[" useInsertionEffect ".trim().toString()];function iw(t){if(typeof Ky=="function")return Ky(t);const n=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Wy=="function"?Wy(()=>{n.current=t}):St(()=>{n.current=t}),f.useMemo(()=>((...a)=>{var o;return(o=n.current)==null?void 0:o.call(n,...a)}),[])}OE(iw,"useEffectEvent");var LE=Object.defineProperty,tc=(t,n)=>LE(t,"name",{value:n,configurable:!0}),zE=pi[" useInsertionEffect ".trim().toString()]||St;function Vr({prop:t,defaultProp:n,onChange:a=tc(()=>{},"onChange"),caller:o}){const[c,l,d]=lw({defaultProp:n,onChange:a}),m=t!==void 0,p=m?t:c,g=f.useCallback(b=>{var v;if(m){const w=cw(b)?b(t):b;w!==t&&((v=d.current)==null||v.call(d,w))}else l(b)},[m,t,l,d]);return[p,g]}tc(Vr,"useControllableState");function lw({defaultProp:t,onChange:n}){const[a,o]=f.useState(t),c=f.useRef(a),l=f.useRef(n);return zE(()=>{l.current=n},[n]),f.useEffect(()=>{var d;c.current!==a&&((d=l.current)==null||d.call(l,a),c.current=a)},[a,c]),[a,o,l]}tc(lw,"useUncontrolledState");function cw(t){return typeof t=="function"}tc(cw,"isFunction");var Xy=Symbol("RADIX:SYNC_STATE");function PE(t,n,a,o){const{prop:c,defaultProp:l,onChange:d,caller:m}=n,p=c!==void 0,g=iw(d),b=[{...a,state:l}];o&&b.push(o);const[v,w]=f.useReducer((N,E)=>{if(E.type===Xy)return{...N,state:E.state};const T=t(N,E);return p&&!Object.is(T.state,N.state)&&g(T.state),T},...b),y=v.state,C=f.useRef(y);f.useEffect(()=>{C.current!==y&&(C.current=y,p||g(y))},[y,C,p]);const S=f.useMemo(()=>c!==void 0?{...v,state:c}:v,[v,c]);return f.useEffect(()=>{p&&!Object.is(c,v.state)&&w({type:Xy,state:c})},[c,v.state,p]),[S,w]}tc(PE,"useControllableStateReducer");var IE=Object.defineProperty,UE=(t,n)=>IE(t,"name",{value:n,configurable:!0}),BE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Me=BE.reduce((t,n)=>{const a=Er(`Primitive.${n}`),o=f.forwardRef((c,l)=>{const{asChild:d,...m}=c,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:l})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function gg(t,n){t&&so.flushSync(()=>t.dispatchEvent(n))}UE(gg,"dispatchDiscreteCustomEvent");var $E=Object.defineProperty,Jt=(t,n)=>$E(t,"name",{value:n,configurable:!0});function Td(t){const n=t+"CollectionProvider",[a,o]=bn(n),[c,l]=a(n,{collectionRef:{current:null},itemMap:new Map}),d=Jt(S=>{const{scope:N,children:E}=S,T=f.useRef(null),M=f.useRef(new Map).current;return s.jsx(c,{scope:N,itemMap:M,collectionRef:T,children:E})},"CollectionProvider");d.displayName=n;const m=t+"CollectionSlot",p=Er(m),g=f.forwardRef((S,N)=>{const{scope:E,children:T}=S,M=l(m,E),k=Pe(N,M.collectionRef);return s.jsx(p,{ref:k,children:T})});g.displayName=m;const b=t+"CollectionItemSlot",v="data-radix-collection-item",w=Er(b),y=f.forwardRef((S,N)=>{const{scope:E,children:T,...M}=S,k=f.useRef(null),_=Pe(N,k),R=l(b,E);return f.useEffect(()=>(R.itemMap.set(k,{ref:k,...M}),()=>void R.itemMap.delete(k))),s.jsx(w,{[v]:"",ref:_,children:T})});y.displayName=b;function C(S){const N=l(t+"CollectionConsumer",S);return f.useCallback(()=>{const T=N.collectionRef.current;if(!T)return[];const M=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((R,L)=>M.indexOf(R.ref.current)-M.indexOf(L.ref.current))},[N.collectionRef,N.itemMap])}return Jt(C,"useCollection"),[{Provider:d,Slot:g,ItemSlot:y},C,o]}Jt(Td,"createCollection");var Zy=new WeakMap,Gt,Vn,Sp=(Vn=class extends Map{constructor(a){super(a);yy(this,Gt);dp(this,Gt,[...super.keys()]),Zy.set(this,!0)}set(a,o){return Zy.get(this)&&(this.has(a)?pn(this,Gt)[pn(this,Gt).indexOf(a)]=a:pn(this,Gt).push(a)),super.set(a,o),this}insert(a,o,c){const l=this.has(o),d=pn(this,Gt).length,m=xg(a);let p=m>=0?m:d+m;const g=p<0||p>=d?-1:p;if(g===this.size||l&&g===this.size-1||g===-1)return this.set(o,c),this;const b=this.size+(l?0:1);m<0&&p++;const v=[...pn(this,Gt)];let w,y=!1;for(let C=p;C<b;C++)if(p===C){let S=v[C];v[C]===o&&(S=v[C+1]),l&&this.delete(o),w=this.get(S),this.set(o,c)}else{!y&&v[C-1]===o&&(y=!0);const S=v[y?C:C-1],N=w;w=this.get(S),this.delete(S),this.set(S,N)}return this}with(a,o,c){const l=new Vn(this);return l.insert(a,o,c),l}before(a){const o=pn(this,Gt).indexOf(a)-1;if(!(o<0))return this.entryAt(o)}setBefore(a,o,c){const l=pn(this,Gt).indexOf(a);return l===-1?this:this.insert(l,o,c)}after(a){let o=pn(this,Gt).indexOf(a);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(a,o,c){const l=pn(this,Gt).indexOf(a);return l===-1?this:this.insert(l+1,o,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return dp(this,Gt,[]),super.clear()}delete(a){const o=super.delete(a);return o&&pn(this,Gt).splice(pn(this,Gt).indexOf(a),1),o}deleteAt(a){const o=this.keyAt(a);return o!==void 0?this.delete(o):!1}at(a){const o=Wu(pn(this,Gt),a);if(o!==void 0)return this.get(o)}entryAt(a){const o=Wu(pn(this,Gt),a);if(o!==void 0)return[o,this.get(o)]}indexOf(a){return pn(this,Gt).indexOf(a)}keyAt(a){return Wu(pn(this,Gt),a)}from(a,o){const c=this.indexOf(a);if(c===-1)return;let l=c+o;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(a,o){const c=this.indexOf(a);if(c===-1)return;let l=c+o;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(a,o){let c=0;for(const l of this){if(Reflect.apply(a,o,[l,c,this]))return l;c++}}findIndex(a,o){let c=0;for(const l of this){if(Reflect.apply(a,o,[l,c,this]))return c;c++}return-1}filter(a,o){const c=[];let l=0;for(const d of this)Reflect.apply(a,o,[d,l,this])&&c.push(d),l++;return new Vn(c)}map(a,o){const c=[];let l=0;for(const d of this)c.push([d[0],Reflect.apply(a,o,[d,l,this])]),l++;return new Vn(c)}reduce(...a){const[o,c]=a;let l=0,d=c??this.at(0);for(const m of this)l===0&&a.length===1?d=m:d=Reflect.apply(o,this,[d,m,l,this]),l++;return d}reduceRight(...a){const[o,c]=a;let l=c??this.at(-1);for(let d=this.size-1;d>=0;d--){const m=this.at(d);d===this.size-1&&a.length===1?l=m:l=Reflect.apply(o,this,[l,m,d,this])}return l}toSorted(a){const o=[...this.entries()].sort(a);return new Vn(o)}toReversed(){const a=new Vn;for(let o=this.size-1;o>=0;o--){const c=this.keyAt(o),l=this.get(c);a.set(c,l)}return a}toSpliced(...a){const o=[...this.entries()];return o.splice(...a),new Vn(o)}slice(a,o){const c=new Vn;let l=this.size-1;if(a===void 0)return c;a<0&&(a=a+this.size),o!==void 0&&o>0&&(l=o-1);for(let d=a;d<=l;d++){const m=this.keyAt(d),p=this.get(m);c.set(m,p)}return c}every(a,o){let c=0;for(const l of this){if(!Reflect.apply(a,o,[l,c,this]))return!1;c++}return!0}some(a,o){let c=0;for(const l of this){if(Reflect.apply(a,o,[l,c,this]))return!0;c++}return!1}},Gt=new WeakMap,Jt(Vn,"OrderedDict"),Vn);function Wu(t,n){if("at"in Array.prototype)return Array.prototype.at.call(t,n);const a=uw(t,n);return a===-1?void 0:t[a]}Jt(Wu,"at");function uw(t,n){const a=t.length,o=xg(n),c=o>=0?o:a+o;return c<0||c>=a?-1:c}Jt(uw,"toSafeIndex");function xg(t){return t!==t||t===0?0:Math.trunc(t)}Jt(xg,"toSafeInteger");function HE(t){const n=t+"CollectionProvider",[a,o]=bn(n),[c,l]=a(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Sp,setItemMap:Jt(()=>{},"setItemMap")}),d=Jt(({state:M,...k})=>M?s.jsx(p,{...k,state:M}):s.jsx(m,{...k}),"CollectionProvider");d.displayName=n;const m=Jt(M=>{const k=N();return s.jsx(p,{...M,state:k})},"CollectionInit");m.displayName=n+"Init";const p=Jt(M=>{const{scope:k,children:_,state:R}=M,L=f.useRef(null),[ne,X]=f.useState(null),I=Pe(L,X),[H,q]=R;return f.useEffect(()=>{if(!ne)return;const ce=mw(()=>{});return ce.observe(ne,{childList:!0,subtree:!0}),()=>{ce.disconnect()}},[ne]),s.jsx(c,{scope:k,itemMap:H,setItemMap:q,collectionRef:I,collectionRefObject:L,collectionElement:ne,children:_})},"CollectionProviderImpl");p.displayName=n+"Impl";const g=t+"CollectionSlot",b=Er(g),v=f.forwardRef((M,k)=>{const{scope:_,children:R}=M,L=l(g,_),ne=Pe(k,L.collectionRef);return s.jsx(b,{ref:ne,children:R})});v.displayName=g;const w=t+"CollectionItemSlot",y="data-radix-collection-item",C=Er(w),S=f.forwardRef((M,k)=>{const{scope:_,children:R,...L}=M,ne=f.useRef(null),[X,I]=f.useState(null),H=Pe(k,ne,I),q=l(w,_),{setItemMap:ce}=q,de=f.useRef(L);dw(de.current,L)||(de.current=L);const se=de.current;return f.useEffect(()=>{const P=se;return ce(W=>X?W.has(X)?W.set(X,{...P,element:X}).toSorted(ch):(W.set(X,{...P,element:X}),W.toSorted(ch)):W),()=>{ce(W=>!X||!W.has(X)?W:(W.delete(X),new Sp(W)))}},[X,se,ce]),s.jsx(C,{[y]:"",ref:H,children:R})});S.displayName=w;function N(){return f.useState(new Sp)}Jt(N,"useInitCollection");function E(M){const{itemMap:k}=l(t+"CollectionConsumer",M);return k}return Jt(E,"useCollection"),[{Provider:d,Slot:v,ItemSlot:S},{createCollectionScope:o,useCollection:E,useInitCollection:N}]}Jt(HE,"createCollection");function dw(t,n){if(t===n)return!0;if(typeof t!="object"||typeof n!="object"||t==null||n==null)return!1;const a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(const c of a)if(!Object.prototype.hasOwnProperty.call(n,c)||t[c]!==n[c])return!1;return!0}Jt(dw,"shallowEqual");function fw(t,n){return!!(n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Jt(fw,"isElementPreceding");function ch(t,n){return!t[1].element||!n[1].element?0:fw(t[1].element,n[1].element)?-1:1}Jt(ch,"sortByDocumentPosition");function mw(t){return new MutationObserver(a=>{for(const o of a)if(o.type==="childList"){t();return}})}Jt(mw,"getChildListObserver");var GE=Object.defineProperty,VE=(t,n)=>GE(t,"name",{value:n,configurable:!0}),FE=f.createContext(void 0);function Si(t){const n=f.useContext(FE);return t||n||"ltr"}VE(Si,"useDirection");var YE=Object.defineProperty,qE=(t,n)=>YE(t,"name",{value:n,configurable:!0});function Vt(t){const n=f.useRef(t);return f.useEffect(()=>{n.current=t}),f.useMemo(()=>((...a)=>{var o;return(o=n.current)==null?void 0:o.call(n,...a)}),[])}qE(Vt,"useCallbackRef");var KE=Object.defineProperty,Qt=(t,n)=>KE(t,"name",{value:n,configurable:!0}),uh="dismissableLayer.update",WE="dismissableLayer.pointerDownOutside",XE="dismissableLayer.focusOutside",Qy,pw=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nc=f.forwardRef(Qt(function(n,a){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:m,onInteractOutside:p,onDismiss:g,...b}=n,v=f.useContext(pw),[w,y]=f.useState(null),C=(w==null?void 0:w.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=f.useState({}),N=Pe(a,y),E=Array.from(v.layers),[T]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),M=T?E.indexOf(T):-1,k=w?E.indexOf(w):-1,_=v.layersWithOutsidePointerEventsDisabled.size>0,R=k>=M,L=f.useRef(!1),ne=gw(q=>{d==null||d(q),p==null||p(q),q.defaultPrevented||g==null||g()},{ownerDocument:C,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:v.dismissableSurfaces,shouldHandlePointerDownOutside:f.useCallback(q=>{if(!(q instanceof Node))return!1;const ce=[...v.branches].some(de=>de.contains(q));return R&&!ce},[v.branches,R])}),X=xw(q=>{if(c&&L.current)return;const ce=q.target;[...v.branches].some(se=>se.contains(ce))||(m==null||m(q),p==null||p(q),q.defaultPrevented||g==null||g())},C),I=w?k===E.length-1:!1,H=Vt(q=>{q.key==="Escape"&&(l==null||l(q),!q.defaultPrevented&&g&&(q.preventDefault(),g()))});return f.useEffect(()=>{if(I)return C.addEventListener("keydown",H,{capture:!0}),()=>C.removeEventListener("keydown",H,{capture:!0})},[C,I,H]),f.useEffect(()=>{if(w)return o&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(Qy=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(w)),v.layers.add(w),dh(),()=>{o&&(v.layersWithOutsidePointerEventsDisabled.delete(w),v.layersWithOutsidePointerEventsDisabled.size===0&&(C.body.style.pointerEvents=Qy))}},[w,C,o,v]),f.useEffect(()=>()=>{w&&(v.layers.delete(w),v.layersWithOutsidePointerEventsDisabled.delete(w),dh())},[w,v]),f.useEffect(()=>{const q=Qt(()=>S({}),"handleUpdate");return document.addEventListener(uh,q),()=>document.removeEventListener(uh,q)},[]),s.jsx(Me.div,{...b,ref:N,style:{pointerEvents:_?R?"auto":"none":void 0,...n.style},onFocusCapture:Ce(n.onFocusCapture,X.onFocusCapture),onBlurCapture:Ce(n.onBlurCapture,X.onBlurCapture),onPointerDownCapture:Ce(n.onPointerDownCapture,ne.onPointerDownCapture)})},"DismissableLayer"));function hw(){const t=f.useContext(pw),[n,a]=f.useState(null);return f.useEffect(()=>{if(n)return t.dismissableSurfaces.add(n),()=>{t.dismissableSurfaces.delete(n)}},[n,t.dismissableSurfaces]),a}Qt(hw,"useDismissableLayerSurface");var ZE=Qt(()=>!0,"IS_TRUE");function gw(t,n){const{ownerDocument:a=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:l,shouldHandlePointerDownOutside:d=ZE}=n,m=Vt(t),p=f.useRef(!1),g=f.useRef(!1),b=f.useRef(new Map),v=f.useRef(()=>{});return f.useEffect(()=>{function w(){g.current=!1,c.current=!1,b.current.clear()}Qt(w,"resetOutsideInteraction");function y(){return Array.from(b.current.values()).some(Boolean)}Qt(y,"isOutsideInteractionIntercepted");function C(M){if(!g.current)return;const k=M.target;k instanceof Node&&[...l].some(R=>R.contains(k))||b.current.set(M.type,!0),M.type==="click"&&window.setTimeout(()=>{g.current&&v.current()},0)}Qt(C,"handleInteractionCapture");function S(M){g.current&&b.current.set(M.type,!1)}Qt(S,"handleInteractionBubble");const N=Qt(M=>{if(M.target&&!p.current){let k=function(){a.removeEventListener("click",v.current);const R=y();w(),R||bg(WE,m,_,{discrete:!0})};if(Qt(k,"handleAndDispatchPointerDownOutsideEvent"),!d(M.target)){a.removeEventListener("click",v.current),w(),p.current=!1;return}const _={originalEvent:M};g.current=!0,c.current=o&&M.button===0,b.current.clear(),!o||M.button!==0?k():(a.removeEventListener("click",v.current),v.current=k,a.addEventListener("click",v.current,{once:!0}))}else a.removeEventListener("click",v.current),w();p.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const M of E)a.addEventListener(M,C,!0),a.addEventListener(M,S);const T=window.setTimeout(()=>{a.addEventListener("pointerdown",N)},0);return()=>{window.clearTimeout(T),a.removeEventListener("pointerdown",N),a.removeEventListener("click",v.current);for(const M of E)a.removeEventListener(M,C,!0),a.removeEventListener(M,S)}},[a,m,o,c,l,d]),{onPointerDownCapture:Qt(()=>p.current=!0,"onPointerDownCapture")}}Qt(gw,"usePointerDownOutside");function xw(t,n=globalThis==null?void 0:globalThis.document){const a=Vt(t),o=f.useRef(!1);return f.useEffect(()=>{const c=Qt(l=>{l.target&&!o.current&&bg(XE,a,{originalEvent:l},{discrete:!1})},"handleFocus");return n.addEventListener("focusin",c),()=>n.removeEventListener("focusin",c)},[n,a]),{onFocusCapture:Qt(()=>o.current=!0,"onFocusCapture"),onBlurCapture:Qt(()=>o.current=!1,"onBlurCapture")}}Qt(xw,"useFocusOutside");function dh(){const t=new CustomEvent(uh);document.dispatchEvent(t)}Qt(dh,"dispatchUpdate");function bg(t,n,a,{discrete:o}){const c=a.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:a});n&&c.addEventListener(t,n,{once:!0}),o?gg(c,l):c.dispatchEvent(l)}Qt(bg,"handleAndDispatchCustomEvent");var QE=Object.defineProperty,vg=(t,n)=>QE(t,"name",{value:n,configurable:!0}),Ru=0,Pr=null;function JE(t){return Ni(),t.children}vg(JE,"FocusGuards");function Ni(){f.useEffect(()=>{Pr||(Pr={start:fh(),end:fh()});const{start:t,end:n}=Pr;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==n&&document.body.insertAdjacentElement("beforeend",n),Ru++,()=>{Ru===1&&(Pr==null||Pr.start.remove(),Pr==null||Pr.end.remove(),Pr=null),Ru=Math.max(0,Ru-1)}},[])}vg(Ni,"useFocusGuards");function fh(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}vg(fh,"createFocusGuard");var e6=Object.defineProperty,xn=(t,n)=>e6(t,"name",{value:n,configurable:!0}),Np="focusScope.autoFocusOnMount",Ep="focusScope.autoFocusOnUnmount",Jy={bubbles:!1,cancelable:!0},Md=f.forwardRef(xn(function(n,a){const{loop:o=!1,trapped:c=!1,onMountAutoFocus:l,onUnmountAutoFocus:d,...m}=n,[p,g]=f.useState(null),b=Vt(l),v=Vt(d),w=f.useRef(null),y=Pe(a,g),C=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(c){let N=function(k){if(C.paused||!p)return;const _=k.target;p.contains(_)?w.current=_:va(w.current,{select:!0})},E=function(k){if(C.paused||!p)return;const _=k.relatedTarget;_!==null&&(p.contains(_)||va(w.current,{select:!0}))},T=function(k){if(document.activeElement===document.body)for(const R of k)R.removedNodes.length>0&&va(p)};xn(N,"handleFocusIn"),xn(E,"handleFocusOut"),xn(T,"handleMutations"),document.addEventListener("focusin",N),document.addEventListener("focusout",E);const M=new MutationObserver(T);return p&&M.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",E),M.disconnect()}}},[c,p,C.paused]),f.useEffect(()=>{if(p){e0.add(C);const N=document.activeElement;if(!p.contains(N)){const T=new CustomEvent(Np,Jy);p.addEventListener(Np,b),p.dispatchEvent(T),T.defaultPrevented||(bw(Cw(yg(p)),{select:!0}),document.activeElement===N&&va(p))}return()=>{p.removeEventListener(Np,b),setTimeout(()=>{const T=new CustomEvent(Ep,Jy);p.addEventListener(Ep,v),p.dispatchEvent(T),T.defaultPrevented||va(N??document.body,{select:!0}),p.removeEventListener(Ep,v),e0.remove(C)},0)}}},[p,b,v,C]);const S=f.useCallback(N=>{if(!o&&!c||C.paused)return;const E=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,T=document.activeElement;if(E&&T){const M=N.currentTarget,[k,_]=vw(M);k&&_?!N.shiftKey&&T===_?(N.preventDefault(),o&&va(k,{select:!0})):N.shiftKey&&T===k&&(N.preventDefault(),o&&va(_,{select:!0})):T===M&&N.preventDefault()}},[o,c,C.paused]);return s.jsx(Me.div,{tabIndex:-1,...m,ref:y,onKeyDown:S})},"FocusScope"));function bw(t,{select:n=!1}={}){const a=document.activeElement;for(const o of t)if(va(o,{select:n}),document.activeElement!==a)return}xn(bw,"focusFirst");function vw(t){const n=yg(t),a=mh(n,t),o=mh(n.reverse(),t);return[a,o]}xn(vw,"getTabbableEdges");function yg(t){const n=[],a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:xn(o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)n.push(a.currentNode);return n}xn(yg,"getTabbableCandidates");function mh(t,n){const a=typeof n.checkVisibility=="function"&&n.checkVisibility({checkVisibilityCSS:!0});for(const o of t)if(!(a?!o.checkVisibility({checkVisibilityCSS:!0}):yw(o,{upTo:n})))return o}xn(mh,"findVisible");function yw(t,{upTo:n}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(n!==void 0&&t===n)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}xn(yw,"isHidden");function ww(t){return t instanceof HTMLInputElement&&"select"in t}xn(ww,"isSelectableInput");function va(t,{select:n=!1}={}){if(t&&t.focus){const a=document.activeElement;t.focus({preventScroll:!0}),t!==a&&ww(t)&&n&&t.select()}}xn(va,"focus");var e0=jw();function jw(){let t=[];return{add(n){const a=t[0];n!==a&&(a==null||a.pause()),t=ph(t,n),t.unshift(n)},remove(n){var a;t=ph(t,n),(a=t[0])==null||a.resume()}}}xn(jw,"createFocusScopesStack");function ph(t,n){const a=[...t],o=a.indexOf(n);return o!==-1&&a.splice(o,1),a}xn(ph,"arrayRemove");function Cw(t){return t.filter(n=>n.tagName!=="A")}xn(Cw,"removeLinks");var t6=Object.defineProperty,n6=(t,n)=>t6(t,"name",{value:n,configurable:!0}),r6=pi[" useId ".trim().toString()]||(()=>{}),a6=0;function nn(t){const[n,a]=f.useState(r6());return St(()=>{t||a(o=>o??String(a6++))},[t]),t||(n?`radix-${n}`:"")}n6(nn,"useId");const s6=["top","right","bottom","left"],fs=Math.min,wa=Math.max,od=Math.round,Au=Math.floor,ja=t=>({x:t,y:t}),o6={left:"right",right:"left",bottom:"top",top:"bottom"};function Sw(t,n,a){return wa(t,fs(n,a))}function Ea(t,n){return typeof t=="function"?t(n):t}function ms(t){return t.split("-")[0]}function Ei(t){return t.split("-")[1]}function wg(t){return t==="x"?"y":"x"}function jg(t){return t==="y"?"height":"width"}function Br(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function Cg(t){return wg(Br(t))}function i6(t,n,a){a===void 0&&(a=!1);const o=Ei(t),c=Cg(t),l=jg(c);let d=c==="x"?o===(a?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(d=id(d)),[d,id(d)]}function l6(t){const n=id(t);return[hh(t),n,hh(n)]}function hh(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const t0=["left","right"],n0=["right","left"],c6=["top","bottom"],u6=["bottom","top"];function d6(t,n,a){switch(t){case"top":case"bottom":return a?n?n0:t0:n?t0:n0;case"left":case"right":return n?c6:u6;default:return[]}}function f6(t,n,a,o){const c=Ei(t);let l=d6(ms(t),a==="start",o);return c&&(l=l.map(d=>d+"-"+c),n&&(l=l.concat(l.map(hh)))),l}function id(t){const n=ms(t);return o6[n]+t.slice(n.length)}function m6(t){var n,a,o,c;return{top:(n=t.top)!=null?n:0,right:(a=t.right)!=null?a:0,bottom:(o=t.bottom)!=null?o:0,left:(c=t.left)!=null?c:0}}function Nw(t){return typeof t!="number"?m6(t):{top:t,right:t,bottom:t,left:t}}function ld(t){const{x:n,y:a,width:o,height:c}=t;return{width:o,height:c,top:a,left:n,right:n+o,bottom:a+c,x:n,y:a}}function r0(t,n,a){let{reference:o,floating:c}=t;const l=Br(n),d=Cg(n),m=jg(d),p=ms(n),g=l==="y",b=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,w=o[m]/2-c[m]/2;let y;switch(p){case"top":y={x:b,y:o.y-c.height};break;case"bottom":y={x:b,y:o.y+o.height};break;case"right":y={x:o.x+o.width,y:v};break;case"left":y={x:o.x-c.width,y:v};break;default:y={x:o.x,y:o.y}}const C=Ei(n);return C&&(y[d]+=w*(C==="end"?1:-1)*(a&&g?-1:1)),y}async function p6(t,n){var a;n===void 0&&(n={});const{x:o,y:c,platform:l,rects:d,elements:m,strategy:p}=t,{boundary:g="clippingAncestors",rootBoundary:b="viewport",elementContext:v="floating",altBoundary:w=!1,padding:y=0}=Ea(n,t),C=Nw(y),N=m[w?v==="floating"?"reference":"floating":v],E=ld(await l.getClippingRect({element:(a=await(l.isElement==null?void 0:l.isElement(N)))==null||a?N:N.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(m.floating)),boundary:g,rootBoundary:b,strategy:p})),T=v==="floating"?{x:o,y:c,width:d.floating.width,height:d.floating.height}:d.reference,M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(m.floating)),k=await(l.isElement==null?void 0:l.isElement(M))&&await(l.getScale==null?void 0:l.getScale(M))||{x:1,y:1},_=ld(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:T,offsetParent:M,strategy:p}):T);return{top:(E.top-_.top+C.top)/k.y,bottom:(_.bottom-E.bottom+C.bottom)/k.y,left:(E.left-_.left+C.left)/k.x,right:(_.right-E.right+C.right)/k.x}}const h6=50,g6=async(t,n,a)=>{const{placement:o="bottom",strategy:c="absolute",middleware:l=[],platform:d}=a,m=d.detectOverflow?d:{...d,detectOverflow:p6},p=await(d.isRTL==null?void 0:d.isRTL(n));let g=await d.getElementRects({reference:t,floating:n,strategy:c}),{x:b,y:v}=r0(g,o,p),w=o,y=0;const C={};for(let S=0;S<l.length;S++){const N=l[S];if(!N)continue;const{name:E,fn:T}=N,{x:M,y:k,data:_,reset:R}=await T({x:b,y:v,initialPlacement:o,placement:w,strategy:c,middlewareData:C,rects:g,platform:m,elements:{reference:t,floating:n}});b=M??b,v=k??v,C[E]={...C[E],..._},R&&y<h6&&(y++,typeof R=="object"&&(R.placement&&(w=R.placement),R.rects&&(g=R.rects===!0?await d.getElementRects({reference:t,floating:n,strategy:c}):R.rects),{x:b,y:v}=r0(g,w,p)),S=-1)}return{x:b,y:v,placement:w,strategy:c,middlewareData:C}},x6=t=>({name:"arrow",options:t,async fn(n){const{x:a,y:o,placement:c,rects:l,platform:d,elements:m,middlewareData:p}=n,{element:g,padding:b=0}=Ea(t,n)||{};if(g==null)return{};const v=Nw(b),w={x:a,y:o},y=Cg(c),C=jg(y),S=await d.getDimensions(g),N=y==="y",E=N?"top":"left",T=N?"bottom":"right",M=N?"clientHeight":"clientWidth",k=l.reference[C]+l.reference[y]-w[y]-l.floating[C],_=w[y]-l.reference[y],R=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g));let L=R?R[M]:0;(!L||!await(d.isElement==null?void 0:d.isElement(R)))&&(L=m.floating[M]||l.floating[C]);const ne=k/2-_/2,X=L/2-S[C]/2-1,I=fs(v[E],X),H=fs(v[T],X),q=L-S[C]-H,ce=L/2-S[C]/2+ne,de=Sw(I,ce,q),se=!p.arrow&&Ei(c)!=null&&ce!==de&&l.reference[C]/2-(ce<I?I:H)-S[C]/2<0,P=se?ce<I?ce-I:ce-q:0;return{[y]:w[y]+P,data:{[y]:de,centerOffset:ce-de-P,...se&&{alignmentOffset:P}},reset:se}}}),b6=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var a,o;const{placement:c,middlewareData:l,rects:d,initialPlacement:m,platform:p,elements:g}=n,{mainAxis:b=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...N}=Ea(t,n);if((a=l.arrow)!=null&&a.alignmentOffset)return{};const E=ms(c),T=Br(m),M=ms(m)===m,k=await(p.isRTL==null?void 0:p.isRTL(g.floating)),_=w||(M||!S?[id(m)]:l6(m)),R=C!=="none";!w&&R&&_.push(...f6(m,S,C,k));const L=[m,..._],ne=await p.detectOverflow(n,N),X=[];let I=((o=l.flip)==null?void 0:o.overflows)||[];if(b&&X.push(ne[E]),v){const de=i6(c,d,k);X.push(ne[de[0]],ne[de[1]])}if(I=[...I,{placement:c,overflows:X}],!X.every(de=>de<=0)){var H,q;const de=(((H=l.flip)==null?void 0:H.index)||0)+1,se=L[de];if(se&&(!(v==="alignment"?T!==Br(se):!1)||I.every(oe=>Br(oe.placement)===T?oe.overflows[0]>0:!0)))return{data:{index:de,overflows:I},reset:{placement:se}};let P=(q=I.filter(W=>W.overflows[0]<=0).sort((W,oe)=>W.overflows[1]-oe.overflows[1])[0])==null?void 0:q.placement;if(!P)switch(y){case"bestFit":{var ce;const W=(ce=I.filter(oe=>{if(R){const ae=Br(oe.placement);return ae===T||ae==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(ae=>ae>0).reduce((ae,G)=>ae+G,0)]).sort((oe,ae)=>oe[1]-ae[1])[0])==null?void 0:ce[0];W&&(P=W);break}case"initialPlacement":P=m;break}if(c!==P)return{reset:{placement:P}}}return{}}}};function a0(t,n){return{top:t.top-n.height,right:t.right-n.width,bottom:t.bottom-n.height,left:t.left-n.width}}function s0(t){return s6.some(n=>t[n]>=0)}const v6=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(n){const{rects:a,platform:o}=n,{strategy:c="referenceHidden",...l}=Ea(t,n);switch(c){case"referenceHidden":{const d=await o.detectOverflow(n,{...l,elementContext:"reference"}),m=a0(d,a.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:s0(m)}}}case"escaped":{const d=await o.detectOverflow(n,{...l,altBoundary:!0}),m=a0(d,a.floating);return{data:{escapedOffsets:m,escaped:s0(m)}}}default:return{}}}}},Ew=new Set(["left","top"]);async function y6(t,n){const{placement:a,platform:o,elements:c}=t,l=await(o.isRTL==null?void 0:o.isRTL(c.floating)),d=ms(a),m=Ei(a),p=Br(a)==="y",g=Ew.has(d)?-1:1,b=l&&p?-1:1,v=Ea(n,t);let{mainAxis:w,crossAxis:y,alignmentAxis:C}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof C=="number"&&(y=m==="end"?C*-1:C),p?{x:y*b,y:w*g}:{x:w*g,y:y*b}}const w6=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var a,o;const{x:c,y:l,placement:d,middlewareData:m}=n,p=await y6(n,t);return d===((a=m.offset)==null?void 0:a.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:c+p.x,y:l+p.y,data:{...p,placement:d}}}}},j6=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:a,y:o,placement:c,platform:l}=n,{mainAxis:d=!0,crossAxis:m=!1,limiter:p={fn:T=>{let{x:M,y:k}=T;return{x:M,y:k}}},...g}=Ea(t,n),b={x:a,y:o},v=await l.detectOverflow(n,g),w=Br(c),y=wg(w);let C=b[y],S=b[w];const N=(T,M)=>Sw(M+v[T==="y"?"top":"left"],M,M-v[T==="y"?"bottom":"right"]);d&&(C=N(y,C)),m&&(S=N(w,S));const E=p.fn({...n,[y]:C,[w]:S});return{...E,data:{x:E.x-a,y:E.y-o,enabled:{[y]:d,[w]:m}}}}}},C6=function(t){return t===void 0&&(t={}),{options:t,fn(n){var a,o;const{x:c,y:l,placement:d,rects:m,middlewareData:p}=n,{offset:g=0,mainAxis:b=!0,crossAxis:v=!0}=Ea(t,n),w={x:c,y:l},y=Br(d),C=wg(y);let S=w[C],N=w[y];const E=Ea(g,n),T=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(a=E.mainAxis)!=null?a:0,crossAxis:(o=E.crossAxis)!=null?o:0};if(b){const _=C==="y"?"height":"width",R=m.reference[C]-m.floating[_]+T.mainAxis,L=m.reference[C]+m.reference[_]-T.mainAxis;S<R?S=R:S>L&&(S=L)}if(v){var M,k;const _=C==="y"?"width":"height",R=Ew.has(ms(d)),L=m.reference[y]-m.floating[_]+(R&&((M=p.offset)==null?void 0:M[y])||0)+(R?0:T.crossAxis),ne=m.reference[y]+m.reference[_]+(R?0:((k=p.offset)==null?void 0:k[y])||0)-(R?T.crossAxis:0);N<L?N=L:N>ne&&(N=ne)}return{[C]:S,[y]:N}}}},S6=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){const{placement:a,rects:o,platform:c,elements:l}=n,{apply:d=()=>{},...m}=Ea(t,n),p=await c.detectOverflow(n,m),g=ms(a),b=Ei(a),v=Br(a)==="y",{width:w,height:y}=o.floating;let C,S;g==="top"||g==="bottom"?(C=g,S=b===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(S=g,C=b==="end"?"top":"bottom");const N=y-p.top-p.bottom,E=w-p.left-p.right,T=fs(y-p[C],N),M=fs(w-p[S],E),k=n.middlewareData.shift,_=!k;let R=T,L=M;k!=null&&k.enabled.x&&(L=E),k!=null&&k.enabled.y&&(R=N),_&&!b&&(v?L=w-2*wa(p.left,p.right):R=y-2*wa(p.top,p.bottom)),await d({...n,availableWidth:L,availableHeight:R});const ne=await c.getDimensions(l.floating);return w!==ne.width||y!==ne.height?{reset:{rects:!0}}:{}}}};function Rd(){return typeof window<"u"}function ki(t){return kw(t)?(t.nodeName||"").toLowerCase():"#document"}function An(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Ma(t){var n;return(n=(kw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function kw(t){return Rd()?t instanceof Node||t instanceof An(t).Node:!1}function Fr(t){return Rd()?t instanceof Element||t instanceof An(t).Element:!1}function js(t){return Rd()?t instanceof HTMLElement||t instanceof An(t).HTMLElement:!1}function o0(t){return!Rd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof An(t).ShadowRoot}function Ad(t){const{overflow:n,overflowX:a,overflowY:o,display:c}=Yr(t);return/auto|scroll|overlay|hidden|clip/.test(n+o+a)&&c!=="inline"&&c!=="contents"}function N6(t){return/^(table|td|th)$/.test(ki(t))}function _d(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const E6=/transform|translate|scale|rotate|perspective|filter/,k6=/paint|layout|strict|content/,Vs=t=>!!t&&t!=="none";let kp;function Sg(t){const n=Fr(t)?Yr(t):t;return Vs(n.transform)||Vs(n.translate)||Vs(n.scale)||Vs(n.rotate)||Vs(n.perspective)||!Ng()&&(Vs(n.backdropFilter)||Vs(n.filter))||E6.test(n.willChange||"")||k6.test(n.contain||"")}function T6(t){let n=Ws(t);for(;js(n)&&!Bl(n);){if(Sg(n))return n;if(_d(n))return null;n=Ws(n)}return null}function Ng(){return kp==null&&(kp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),kp}function Bl(t){return/^(html|body|#document)$/.test(ki(t))}function Yr(t){return An(t).getComputedStyle(t)}function Dd(t){return Fr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ws(t){if(ki(t)==="html")return t;const n=t.assignedSlot||t.parentNode||o0(t)&&t.host||Ma(t);return o0(n)?n.host:n}function Tw(t){const n=Ws(t);return Bl(n)?(t.ownerDocument||t).body:js(n)&&Ad(n)?n:Tw(n)}function $l(t,n,a){var o;n===void 0&&(n=[]),a===void 0&&(a=!0);const c=Tw(t),l=c===((o=t.ownerDocument)==null?void 0:o.body),d=An(c);if(l){const m=gh(d);return n.concat(d,d.visualViewport||[],Ad(c)?c:[],m&&a?$l(m):[])}else return n.concat(c,$l(c,[],a))}function gh(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Mw(t){const n=Yr(t);let a=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const c=js(t),l=c?t.offsetWidth:a,d=c?t.offsetHeight:o,m=od(a)!==l||od(o)!==d;return m&&(a=l,o=d),{width:a,height:o,$:m}}function Eg(t){return Fr(t)?t:t.contextElement}function ii(t){const n=Eg(t);if(!js(n))return ja(1);const a=n.getBoundingClientRect(),{width:o,height:c,$:l}=Mw(n);let d=(l?od(a.width):a.width)/o,m=(l?od(a.height):a.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const M6=ja(0);function Rw(t){const n=An(t);return!Ng()||!n.visualViewport?M6:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function R6(t,n,a){return n===void 0&&(n=!1),!!a&&n&&a===An(t)}function Xs(t,n,a,o){n===void 0&&(n=!1),a===void 0&&(a=!1);const c=t.getBoundingClientRect(),l=Eg(t);let d=ja(1);n&&(o?Fr(o)&&(d=ii(o)):d=ii(t));const m=R6(l,a,o)?Rw(l):ja(0);let p=(c.left+m.x)/d.x,g=(c.top+m.y)/d.y,b=c.width/d.x,v=c.height/d.y;if(l&&o){const w=An(l),y=Fr(o)?An(o):o;let C=w,S=gh(C);for(;S&&y!==C;){const N=ii(S),E=S.getBoundingClientRect(),T=Yr(S),M=E.left+(S.clientLeft+parseFloat(T.paddingLeft))*N.x,k=E.top+(S.clientTop+parseFloat(T.paddingTop))*N.y;p*=N.x,g*=N.y,b*=N.x,v*=N.y,p+=M,g+=k,C=An(S),S=gh(C)}}return ld({width:b,height:v,x:p,y:g})}function Od(t,n){const a=Dd(t).scrollLeft;return n?n.left+a:Xs(Ma(t)).left+a}function Aw(t,n){const a=t.getBoundingClientRect(),o=a.left+n.scrollLeft-Od(t,a),c=a.top+n.scrollTop;return{x:o,y:c}}function A6(t){let{elements:n,rect:a,offsetParent:o,strategy:c}=t;const l=c==="fixed",d=Ma(o),m=n?_d(n.floating):!1;if(o===d||m&&l)return a;let p={scrollLeft:0,scrollTop:0},g=ja(1);const b=ja(0),v=js(o);if((v||!l)&&((ki(o)!=="body"||Ad(d))&&(p=Dd(o)),v)){const y=Xs(o);g=ii(o),b.x=y.x+o.clientLeft,b.y=y.y+o.clientTop}const w=d&&!v&&!l?Aw(d,p):ja(0);return{width:a.width*g.x,height:a.height*g.y,x:a.x*g.x-p.scrollLeft*g.x+b.x+w.x,y:a.y*g.y-p.scrollTop*g.y+b.y+w.y}}function _6(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function D6(t){const n=Dd(t),a=t.ownerDocument.body,o=wa(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),c=wa(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let l=-n.scrollLeft+Od(t);const d=-n.scrollTop;return Yr(a).direction==="rtl"&&(l+=wa(t.clientWidth,a.clientWidth)-o),{width:o,height:c,x:l,y:d}}const O6=25;function L6(t,n,a){a===void 0&&(a="viewport");const o=a==="layoutViewport",c=An(t),l=Ma(t),d=c.visualViewport;let m=l.clientWidth,p=l.clientHeight,g=0,b=0;if(d){const w=!Ng()||n==="fixed";o?w||(g=-d.offsetLeft,b=-d.offsetTop):(m=d.width,p=d.height,w&&(g=d.offsetLeft,b=d.offsetTop))}if(Od(l)<=0){const w=l.ownerDocument,y=w.body,C=getComputedStyle(y),S=w.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,N=Math.abs(l.clientWidth-y.clientWidth-S),E=getComputedStyle(l).scrollbarGutter==="stable both-edges"?N/2:N;E<=O6&&(m-=E)}return{width:m,height:p,x:g,y:b}}function z6(t,n){const a=Xs(t,!0,n==="fixed"),o=a.top+t.clientTop,c=a.left+t.clientLeft,l=ii(t),d=t.clientWidth*l.x,m=t.clientHeight*l.y,p=c*l.x,g=o*l.y;return{width:d,height:m,x:p,y:g}}function i0(t,n,a){let o;if(n==="viewport"||n==="layoutViewport")o=L6(t,a,n);else if(n==="document")o=D6(Ma(t));else if(Fr(n))o=z6(n,a);else{const c=Rw(t);o={x:n.x-c.x,y:n.y-c.y,width:n.width,height:n.height}}return ld(o)}function P6(t,n){const a=n.get(t);if(a)return a;let o=$l(t,[],!1).filter(m=>Fr(m)&&ki(m)!=="body"),c=null;const l=Yr(t).position==="fixed";let d=l?Ws(t):t;for(;Fr(d)&&!Bl(d);){const m=Yr(d),p=Sg(d),g=c?c.position:l?"fixed":"";!p&&(g==="fixed"||g==="absolute"&&m.position==="static")?o=o.filter(v=>v!==d):c=m,d=Ws(d)}return n.set(t,o),o}function I6(t){let{element:n,boundary:a,rootBoundary:o,strategy:c}=t;const d=[...a==="clippingAncestors"?_d(n)?[]:P6(n,this._c):[].concat(a),o],m=i0(n,d[0],c);let p=m.top,g=m.right,b=m.bottom,v=m.left;for(let w=1;w<d.length;w++){const y=i0(n,d[w],c);p=wa(y.top,p),g=fs(y.right,g),b=fs(y.bottom,b),v=wa(y.left,v)}return{width:g-v,height:b-p,x:v,y:p}}function U6(t){const{width:n,height:a}=Mw(t);return{width:n,height:a}}function B6(t,n,a){const o=js(n),c=Ma(n),l=a==="fixed",d=Xs(t,!0,l,n);let m={scrollLeft:0,scrollTop:0};const p=ja(0);if((o||!l)&&((ki(n)!=="body"||Ad(c))&&(m=Dd(n)),o)){const w=Xs(n,!0,l,n);p.x=w.x+n.clientLeft,p.y=w.y+n.clientTop}!o&&c&&(p.x=Od(c));const g=c&&!o&&!l?Aw(c,m):ja(0),b=d.left+m.scrollLeft-p.x-g.x,v=d.top+m.scrollTop-p.y-g.y;return{x:b,y:v,width:d.width,height:d.height}}function Tp(t){return Yr(t).position==="static"}function l0(t,n){if(!js(t)||Yr(t).position==="fixed")return null;if(n)return n(t);let a=t.offsetParent;return Ma(t)===a&&(a=a.ownerDocument.body),a}function _w(t,n){const a=An(t);if(_d(t))return a;if(!js(t)){let c=Ws(t);for(;c&&!Bl(c);){if(Fr(c)&&!Tp(c))return c;c=Ws(c)}return a}let o=l0(t,n);for(;o&&N6(o)&&Tp(o);)o=l0(o,n);return o&&Bl(o)&&Tp(o)&&!Sg(o)?a:o||T6(t)||a}const $6=async function(t){const n=this.getOffsetParent||_w,a=this.getDimensions,o=await a(t.floating);return{reference:B6(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function H6(t){return Yr(t).direction==="rtl"}const G6={convertOffsetParentRelativeRectToViewportRelativeRect:A6,getDocumentElement:Ma,getClippingRect:I6,getOffsetParent:_w,getElementRects:$6,getClientRects:_6,getDimensions:U6,getScale:ii,isElement:Fr,isRTL:H6};function Dw(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function V6(t,n,a){let o=null,c;const l=Ma(t);function d(){var b;clearTimeout(c),(b=o)==null||b.disconnect(),o=null}function m(b,v){b===void 0&&(b=!1),v===void 0&&(v=1),d();const w=t.getBoundingClientRect(),{left:y,top:C,width:S,height:N}=w;if(b||n(),!S||!N)return;const E=Au(C),T=Au(l.clientWidth-(y+S)),M=Au(l.clientHeight-(C+N)),k=Au(y),R={rootMargin:-E+"px "+-T+"px "+-M+"px "+-k+"px",threshold:wa(0,fs(1,v))||1};let L=!0;function ne(X){const I=X[0].intersectionRatio;if(!Dw(w,t.getBoundingClientRect()))return m();if(I!==v){if(!L)return m();I?m(!1,I):c=setTimeout(()=>{m(!1,1e-7)},1e3)}L=!1}try{o=new IntersectionObserver(ne,{...R,root:l.ownerDocument})}catch{o=new IntersectionObserver(ne,R)}o.observe(t)}const p=An(t),g=()=>m(a);return p.addEventListener("resize",g),m(!0),()=>{p.removeEventListener("resize",g),d()}}function F6(t,n,a,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:l=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,g=Eg(t),b=c||l?[...g?$l(g):[],...n?$l(n):[]]:[];b.forEach(E=>{c&&E.addEventListener("scroll",a),l&&E.addEventListener("resize",a)});const v=g&&m?V6(g,a,l):null;let w=-1,y=null;d&&(y=new ResizeObserver(E=>{let[T]=E;T&&T.target===g&&y&&n&&(y.unobserve(n),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var M;(M=y)==null||M.observe(n)})),a()}),g&&!p&&y.observe(g),n&&y.observe(n));let C,S=p?Xs(t):null;p&&N();function N(){const E=Xs(t);S&&!Dw(S,E)&&a(),S=E,C=requestAnimationFrame(N)}return a(),()=>{var E;b.forEach(T=>{c&&T.removeEventListener("scroll",a),l&&T.removeEventListener("resize",a)}),v==null||v(),(E=y)==null||E.disconnect(),y=null,p&&cancelAnimationFrame(C)}}const Y6=w6,q6=j6,K6=b6,W6=S6,X6=v6,c0=x6,Z6=C6,Q6=(t,n,a)=>{const o=new Map,c=a??{},l={...G6,...c.platform,_c:o};return g6(t,n,{...c,platform:l})};var J6=typeof document<"u",ek=function(){},Xu=J6?f.useLayoutEffect:ek;function cd(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="function"&&t.toString()===n.toString())return!0;let a,o,c;if(t&&n&&typeof t=="object"){if(Array.isArray(t)){if(a=t.length,a!==n.length)return!1;for(o=a;o--!==0;)if(!cd(t[o],n[o]))return!1;return!0}if(c=Object.keys(t),a=c.length,a!==Object.keys(n).length)return!1;for(o=a;o--!==0;)if(!{}.hasOwnProperty.call(n,c[o]))return!1;for(o=a;o--!==0;){const l=c[o];if(!(l==="_owner"&&t.$$typeof)&&!cd(t[l],n[l]))return!1}return!0}return t!==t&&n!==n}function Ow(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function u0(t,n){const a=Ow(t);return Math.round(n*a)/a}function Mp(t){const n=f.useRef(t);return Xu(()=>{n.current=t}),n}function tk(t){t===void 0&&(t={});const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:c,elements:{reference:l,floating:d}={},transform:m=!0,whileElementsMounted:p,open:g}=t,[b,v]=f.useState({x:0,y:0,strategy:a,placement:n,middlewareData:{},isPositioned:!1}),[w,y]=f.useState(o);cd(w,o)||y(o);const[C,S]=f.useState(null),[N,E]=f.useState(null),T=f.useCallback(oe=>{oe!==R.current&&(R.current=oe,S(oe))},[]),M=f.useCallback(oe=>{oe!==L.current&&(L.current=oe,E(oe))},[]),k=l||C,_=d||N,R=f.useRef(null),L=f.useRef(null),ne=f.useRef(b),X=p!=null,I=Mp(p),H=Mp(c),q=Mp(g),ce=f.useCallback(()=>{if(!R.current||!L.current)return;const oe={placement:n,strategy:a,middleware:w};H.current&&(oe.platform=H.current),Q6(R.current,L.current,oe).then(ae=>{const G={...ae,isPositioned:q.current!==!1};de.current&&!cd(ne.current,G)&&(ne.current=G,so.flushSync(()=>{v(G)}))})},[w,n,a,H,q]);Xu(()=>{g===!1&&ne.current.isPositioned&&(ne.current.isPositioned=!1,v(oe=>({...oe,isPositioned:!1})))},[g]);const de=f.useRef(!1);Xu(()=>(de.current=!0,()=>{de.current=!1}),[]),Xu(()=>{if(k&&(R.current=k),_&&(L.current=_),k&&_){if(I.current)return I.current(k,_,ce);ce()}},[k,_,ce,I,X]);const se=f.useMemo(()=>({reference:R,floating:L,setReference:T,setFloating:M}),[T,M]),P=f.useMemo(()=>({reference:k,floating:_}),[k,_]),W=f.useMemo(()=>{const oe={position:a,left:0,top:0};if(!P.floating)return oe;const ae=u0(P.floating,b.x),G=u0(P.floating,b.y);return m?{...oe,transform:"translate("+ae+"px, "+G+"px)",...Ow(P.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:ae,top:G}},[a,m,P.floating,b.x,b.y]);return f.useMemo(()=>({...b,update:ce,refs:se,elements:P,floatingStyles:W}),[b,ce,se,P,W])}const nk=t=>{function n(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:t,fn(a){const{element:o,padding:c}=typeof t=="function"?t(a):t;return o&&n(o)?o.current!=null?c0({element:o.current,padding:c}).fn(a):{}:o?c0({element:o,padding:c}).fn(a):{}}}},rk=(t,n)=>{const a=Y6(t);return{name:a.name,fn:a.fn,options:[t,n]}},ak=(t,n)=>{const a=q6(t);return{name:a.name,fn:a.fn,options:[t,n]}},sk=(t,n)=>({fn:Z6(t).fn,options:[t,n]}),ok=(t,n)=>{const a=K6(t);return{name:a.name,fn:a.fn,options:[t,n]}},ik=(t,n)=>{const a=W6(t);return{name:a.name,fn:a.fn,options:[t,n]}},lk=(t,n)=>{const a=X6(t);return{name:a.name,fn:a.fn,options:[t,n]}},ck=(t,n)=>{const a=nk(t);return{name:a.name,fn:a.fn,options:[t,n]}};var uk=Object.defineProperty,dk=(t,n)=>uk(t,"name",{value:n,configurable:!0});function kg(t){const[n,a]=f.useState(void 0);return St(()=>{if(t){a({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const l=c[0];let d,m;if("borderBoxSize"in l){const p=l.borderBoxSize,g=Array.isArray(p)?p[0]:p;d=g.inlineSize,m=g.blockSize}else d=t.offsetWidth,m=t.offsetHeight;a({width:d,height:m})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else a(void 0)},[t]),n}dk(kg,"useSize");var fk=Object.defineProperty,cs=(t,n)=>fk(t,"name",{value:n,configurable:!0}),Lw="Popper",[zw,Cs]=bn(Lw),[mk,Pw]=zw(Lw),pk=cs(t=>{const{__scopePopper:n,children:a}=t,[o,c]=f.useState(null),[l,d]=f.useState(void 0);return s.jsx(mk,{scope:n,anchor:o,onAnchorChange:c,placementState:l,setPlacementState:d,children:a})},"Popper"),hk="PopperAnchor",gk=f.forwardRef(cs(function(n,a){const{__scopePopper:o,virtualRef:c,...l}=n,d=Pw(hk,o),m=f.useRef(null),p=d.onAnchorChange,g=f.useCallback(S=>{m.current=S,S&&p(S)},[p]),b=Pe(a,g),v=f.useRef(null);f.useEffect(()=>{if(!c)return;const S=v.current;v.current=c.current,S!==v.current&&p(v.current)});const w=d.placementState&&Ld(d.placementState),y=w==null?void 0:w[0],C=w==null?void 0:w[1];return c?null:s.jsx(Me.div,{"data-radix-popper-side":y,"data-radix-popper-align":C,...l,ref:b})},"PopperAnchor")),Iw="PopperContent",[xk,zP]=zw(Iw),bk=f.forwardRef(cs(function(n,a){var me,$,ie,ye,Se,Be,Ke;const{__scopePopper:o,side:c="bottom",sideOffset:l=0,align:d="center",alignOffset:m=0,arrowPadding:p=0,avoidCollisions:g=!0,collisionBoundary:b=[],collisionPadding:v=0,sticky:w="partial",hideWhenDetached:y=!1,updatePositionStrategy:C="optimized",onPlaced:S,...N}=n,E=Pw(Iw,o),[T,M]=f.useState(null),k=Pe(a,M),[_,R]=f.useState(null),L=kg(_),ne=(L==null?void 0:L.width)??0,X=(L==null?void 0:L.height)??0,I=c+(d!=="center"?"-"+d:""),H=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},q=Array.isArray(b)?b:[b],ce=q.length>0,de={padding:H,boundary:q.filter(Uw),altBoundary:ce},{refs:se,floatingStyles:P,placement:W,isPositioned:oe,middlewareData:ae}=tk({strategy:"fixed",placement:I,whileElementsMounted:cs((...We)=>F6(...We,{animationFrame:C==="always"}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[rk({mainAxis:l+X,alignmentAxis:m}),g&&ak({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?sk():void 0,...de}),g&&ok({...de}),ik({...de,apply:cs(({elements:We,rects:qt,availableWidth:vn,availableHeight:Xn})=>{const{width:br,height:yn}=qt.reference,wn=We.floating.style;wn.setProperty("--radix-popper-available-width",`${vn}px`),wn.setProperty("--radix-popper-available-height",`${Xn}px`),wn.setProperty("--radix-popper-anchor-width",`${br}px`),wn.setProperty("--radix-popper-anchor-height",`${yn}px`)},"apply")}),_&&ck({element:_,padding:p}),vk({arrowWidth:ne,arrowHeight:X}),y&&lk({strategy:"referenceHidden",...de,boundary:ce?de.boundary:void 0})]}),G=E.setPlacementState;St(()=>(G(W),()=>{G(void 0)}),[W,G]);const[O,D]=Ld(W),B=Vt(S);St(()=>{oe&&(B==null||B())},[oe,B]);const V=(me=ae.arrow)==null?void 0:me.x,Z=($=ae.arrow)==null?void 0:$.y,be=((ie=ae.arrow)==null?void 0:ie.centerOffset)!==0,[K,ge]=f.useState();return St(()=>{T&&ge(window.getComputedStyle(T).zIndex)},[T]),s.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:oe?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(ye=ae.transformOrigin)==null?void 0:ye.x,(Se=ae.transformOrigin)==null?void 0:Se.y].join(" "),...((Be=ae.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:s.jsx(xk,{scope:o,placedSide:O,placedAlign:D,onArrowChange:R,arrowX:V,arrowY:Z,shouldHideArrow:be,children:s.jsx(Me.div,{"data-side":O,"data-align":D,...N,ref:k,style:{...N.style,animation:oe?(Ke=N.style)==null?void 0:Ke.animation:"none"}})})})},"PopperContent"));function Uw(t){return t!==null}cs(Uw,"isNotNull");var vk=cs(t=>({name:"transformOrigin",options:t,fn(n){var N,E,T;const{placement:a,rects:o,middlewareData:c}=n,d=((N=c.arrow)==null?void 0:N.centerOffset)!==0,m=d?0:t.arrowWidth,p=d?0:t.arrowHeight,[g,b]=Ld(a),v={start:"0%",center:"50%",end:"100%"}[b],w=(((E=c.arrow)==null?void 0:E.x)??0)+m/2,y=(((T=c.arrow)==null?void 0:T.y)??0)+p/2;let C="",S="";return g==="bottom"?(C=d?v:`${w}px`,S=`${-p}px`):g==="top"?(C=d?v:`${w}px`,S=`${o.floating.height+p}px`):g==="right"?(C=`${-p}px`,S=d?v:`${y}px`):g==="left"&&(C=`${o.floating.width+p}px`,S=d?v:`${y}px`),{data:{x:C,y:S}}}}),"transformOrigin");function Ld(t){const[n,a="center"]=t.split("-");return[n,a]}cs(Ld,"getSideAndAlignFromPlacement");var zd=pk,Pd=gk,Id=bk,yk=Object.defineProperty,wk=(t,n)=>yk(t,"name",{value:n,configurable:!0}),rc=f.forwardRef(wk(function(n,a){var p;const{container:o,...c}=n,[l,d]=f.useState(!1);St(()=>d(!0),[]);const m=o||l&&((p=globalThis==null?void 0:globalThis.document)==null?void 0:p.body);return m?so.createPortal(s.jsx(Me.div,{...c,ref:a}),m):null},"Portal")),jk=Object.defineProperty,ka=(t,n)=>jk(t,"name",{value:n,configurable:!0});function Bw(t,n){return f.useReducer((a,o)=>n[a][o]??a,t)}ka(Bw,"useStateMachine");var fn=ka(t=>{const{present:n,children:a}=t,o=$w(n),c=typeof a=="function"?a({present:o.isPresent}):f.Children.only(a),l=Hw(o.ref,Gw(c));return typeof a=="function"||o.isPresent?f.cloneElement(c,{ref:l}):null},"Presence");function $w(t){const[n,a]=f.useState(),o=f.useRef(null),c=f.useRef(t),l=f.useRef("none"),d=f.useRef(void 0),m=t?"mounted":"unmounted",[p,g]=Bw(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{p==="mounted"?(l.current=d.current??ti(o.current),d.current=void 0):l.current="none"},[p]),St(()=>{const b=o.current,v=c.current;if(v!==t){const y=l.current,C=ti(b);t?(d.current=C,g("MOUNT")):C==="none"||(b==null?void 0:b.display)==="none"?g("UNMOUNT"):g(v&&y!==C?"ANIMATION_OUT":"UNMOUNT"),c.current=t}},[t,g]),St(()=>{if(n){let b;const v=n.ownerDocument.defaultView??window,w=ka(C=>{const N=ti(o.current).includes(CSS.escape(C.animationName));if(C.target===n&&N&&(g("ANIMATION_END"),!c.current)){const E=n.style.animationFillMode;n.style.animationFillMode="forwards",b=v.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=E)})}},"handleAnimationEnd"),y=ka(C=>{C.target===n&&(l.current=ti(o.current))},"handleAnimationStart");return n.addEventListener("animationstart",y),n.addEventListener("animationcancel",w),n.addEventListener("animationend",w),()=>{v.clearTimeout(b),n.removeEventListener("animationstart",y),n.removeEventListener("animationcancel",w),n.removeEventListener("animationend",w)}}else g("ANIMATION_END")},[n,g]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:f.useCallback(b=>{if(b){const v=getComputedStyle(b);o.current=v,d.current=ti(v)}else o.current=null;a(b)},[])}}ka($w,"usePresence");function xh(t,n){if(typeof t=="function")return t(n);t!=null&&(t.current=n)}ka(xh,"setRef");function Hw(...t){const n=f.useRef(t);return n.current=t,f.useCallback(a=>{const o=n.current;let c=!1;const l=o.map(d=>{const m=xh(d,a);return!c&&typeof m=="function"&&(c=!0),m});if(c)return()=>{for(let d=0;d<l.length;d++){const m=l[d];typeof m=="function"?m():xh(o[d],null)}}},[])}ka(Hw,"useStableComposedRefs");function ti(t){return(t==null?void 0:t.animationName)||"none"}ka(ti,"getAnimationName");function Gw(t){var o,c;let n=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?t.ref:(n=(c=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:c.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}ka(Gw,"getElementRef");var Ck=Object.defineProperty,Tg=(t,n)=>Ck(t,"name",{value:n,configurable:!0}),Rp=!1;function Vw(){const[t,n]=f.useState(Rp);return f.useEffect(()=>{Rp||(Rp=!0,n(!0))},[]),t}Tg(Vw,"useIsHydrated");var Fw=pi[" useSyncExternalStore ".trim().toString()];function Yw(){return()=>{}}Tg(Yw,"subscribe");function qw(){return Fw(Yw,()=>!0,()=>!1)}Tg(qw,"useIsHydratedModern");var Sk=typeof Fw=="function"?qw:Vw,Nk=Object.defineProperty,oo=(t,n)=>Nk(t,"name",{value:n,configurable:!0}),Ap="rovingFocusGroup.onEntryFocus",Ek={bubbles:!1,cancelable:!0},Ud="RovingFocusGroup",[bh,Kw,kk]=Td(Ud),[Tk,Bd]=bn(Ud,[kk]),[Mk,Rk]=Tk(Ud),Ak=f.forwardRef(oo(function(n,a){return s.jsx(bh.Provider,{scope:n.__scopeRovingFocusGroup,children:s.jsx(bh.Slot,{scope:n.__scopeRovingFocusGroup,children:s.jsx(_k,{...n,ref:a})})})},"RovingFocusGroup")),_k=f.forwardRef(oo(function(n,a){const{__scopeRovingFocusGroup:o,orientation:c,loop:l=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:g,onEntryFocus:b,preventScrollOnEntryFocus:v=!1,...w}=n,y=f.useRef(null),C=Pe(a,y),S=Si(d),[N,E]=Vr({prop:m,defaultProp:p??null,onChange:g,caller:Ud}),[T,M]=f.useState(!1),k=Vt(b),_=Kw(o),R=f.useRef(!1),[L,ne]=f.useState(0);return f.useEffect(()=>{const X=y.current;if(X)return X.addEventListener(Ap,k),()=>X.removeEventListener(Ap,k)},[k]),s.jsx(Mk,{scope:o,orientation:c,dir:S,loop:l,currentTabStopId:N,onItemFocus:f.useCallback(X=>E(X),[E]),onItemShiftTab:f.useCallback(()=>M(!0),[]),onFocusableItemAdd:f.useCallback(()=>ne(X=>X+1),[]),onFocusableItemRemove:f.useCallback(()=>ne(X=>X-1),[]),children:s.jsx(Me.div,{tabIndex:T||L===0?-1:0,"data-orientation":c,...w,ref:C,style:{outline:"none",...n.style},onMouseDown:Ce(n.onMouseDown,()=>{R.current=!0}),onFocus:Ce(n.onFocus,X=>{const I=!R.current;if(X.target===X.currentTarget&&I&&!T){const H=new CustomEvent(Ap,Ek);if(X.currentTarget.dispatchEvent(H),!H.defaultPrevented){const q=_().filter(W=>W.focusable),ce=q.find(W=>W.active),de=q.find(W=>W.id===N),P=[ce,de,...q].filter(Boolean).map(W=>W.ref.current);Mg(P,v)}}R.current=!1}),onBlur:Ce(n.onBlur,()=>M(!1))})})},"RovingFocusGroupImpl")),Dk="RovingFocusGroupItem",Ok=f.forwardRef(oo(function(n,a){const{__scopeRovingFocusGroup:o,focusable:c=!0,active:l=!1,tabStopId:d,children:m,...p}=n,g=nn(),b=d||g,v=Rk(Dk,o),w=v.currentTabStopId===b,y=Kw(o),{onFocusableItemAdd:C,onFocusableItemRemove:S,currentTabStopId:N}=v,E=Sk();return St(()=>{if(!(!E||!c))return C(),()=>S()},[E,c,C,S]),f.useEffect(()=>{if(!(E||!c))return C(),()=>S()},[E,c,C,S]),s.jsx(bh.ItemSlot,{scope:o,id:b,focusable:c,active:l,children:s.jsx(Me.span,{tabIndex:w?0:-1,"data-orientation":v.orientation,...p,ref:a,onMouseDown:Ce(n.onMouseDown,T=>{c?v.onItemFocus(b):T.preventDefault()}),onFocus:Ce(n.onFocus,()=>v.onItemFocus(b)),onKeyDown:Ce(n.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){v.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const M=Xw(T,v.orientation,v.dir);if(M!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let _=y().filter(R=>R.focusable).map(R=>R.ref.current);if(M==="last")_.reverse();else if(M==="prev"||M==="next"){M==="prev"&&_.reverse();const R=_.indexOf(T.currentTarget);_=v.loop?Zw(_,R+1):_.slice(R+1)}setTimeout(()=>Mg(_))}}),children:typeof m=="function"?m({isCurrentTabStop:w,hasTabStop:N!=null}):m})})},"RovingFocusGroupItem")),Lk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ww(t,n){return n!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}oo(Ww,"getDirectionAwareKey");function Xw(t,n,a){const o=Ww(t.key,a);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Lk[o]}oo(Xw,"getFocusIntent");function Mg(t,n=!1){const a=document.activeElement;for(const o of t)if(o===a||(o.focus({preventScroll:n}),document.activeElement!==a))return}oo(Mg,"focusFirst");function Zw(t,n){return t.map((a,o)=>t[(n+o)%t.length])}oo(Zw,"wrapArray");var Qw=Ak,Jw=Ok,zk=function(t){if(typeof document>"u")return null;var n=Array.isArray(t)?t[0]:t;return n.ownerDocument.body},Zo=new WeakMap,_u=new WeakMap,Du={},_p=0,ej=function(t){return t&&(t.host||ej(t.parentNode))},Pk=function(t,n){return n.map(function(a){if(t.contains(a))return a;var o=ej(a);return o&&t.contains(o)?o:(console.error("aria-hidden",a,"in not contained inside",t,". Doing nothing"),null)}).filter(function(a){return!!a})},Ik=function(t,n,a,o){var c=Pk(n,Array.isArray(t)?t:[t]);Du[a]||(Du[a]=new WeakMap);var l=Du[a],d=[],m=new Set,p=new Set(c),g=function(v){!v||m.has(v)||(m.add(v),g(v.parentNode))};c.forEach(g);var b=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(w){if(m.has(w))b(w);else try{var y=w.getAttribute(o),C=y!==null&&y!=="false",S=(Zo.get(w)||0)+1,N=(l.get(w)||0)+1;Zo.set(w,S),l.set(w,N),d.push(w),S===1&&C&&_u.set(w,!0),N===1&&w.setAttribute(a,"true"),C||w.setAttribute(o,"true")}catch(E){console.error("aria-hidden: cannot operate on ",w,E)}})};return b(n),m.clear(),_p++,function(){d.forEach(function(v){var w=Zo.get(v)-1,y=l.get(v)-1;Zo.set(v,w),l.set(v,y),w||(_u.has(v)||v.removeAttribute(o),_u.delete(v)),y||v.removeAttribute(a)}),_p--,_p||(Zo=new WeakMap,Zo=new WeakMap,_u=new WeakMap,Du={})}},$d=function(t,n,a){a===void 0&&(a="data-aria-hidden");var o=Array.from(Array.isArray(t)?t:[t]),c=zk(t);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),Ik(o,c,a,"aria-hidden")):function(){return null}},Ur=function(){return Ur=Object.assign||function(n){for(var a,o=1,c=arguments.length;o<c;o++){a=arguments[o];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(n[l]=a[l])}return n},Ur.apply(this,arguments)};function tj(t,n){var a={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(a[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(t);c<o.length;c++)n.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(t,o[c])&&(a[o[c]]=t[o[c]]);return a}function Uk(t,n,a){if(a||arguments.length===2)for(var o=0,c=n.length,l;o<c;o++)(l||!(o in n))&&(l||(l=Array.prototype.slice.call(n,0,o)),l[o]=n[o]);return t.concat(l||Array.prototype.slice.call(n))}var Zu="right-scroll-bar-position",Qu="width-before-scroll-bar",Bk="with-scroll-bars-hidden",$k="--removed-body-scroll-bar-size";function Dp(t,n){return typeof t=="function"?t(n):t&&(t.current=n),t}function Hk(t,n){var a=f.useState(function(){return{value:t,callback:n,facade:{get current(){return a.value},set current(o){var c=a.value;c!==o&&(a.value=o,a.callback(o,c))}}}})[0];return a.callback=n,a.facade}var Gk=typeof window<"u"?f.useLayoutEffect:f.useEffect,d0=new WeakMap;function Vk(t,n){var a=Hk(null,function(o){return t.forEach(function(c){return Dp(c,o)})});return Gk(function(){var o=d0.get(a);if(o){var c=new Set(o),l=new Set(t),d=a.current;c.forEach(function(m){l.has(m)||Dp(m,null)}),l.forEach(function(m){c.has(m)||Dp(m,d)})}d0.set(a,t)},[t]),a}function Fk(t){return t}function Yk(t,n){n===void 0&&(n=Fk);var a=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:t},useMedium:function(l){var d=n(l,o);return a.push(d),function(){a=a.filter(function(m){return m!==d})}},assignSyncMedium:function(l){for(o=!0;a.length;){var d=a;a=[],d.forEach(l)}a={push:function(m){return l(m)},filter:function(){return a}}},assignMedium:function(l){o=!0;var d=[];if(a.length){var m=a;a=[],m.forEach(l),d=a}var p=function(){var b=d;d=[],b.forEach(l)},g=function(){return Promise.resolve().then(p)};g(),a={push:function(b){d.push(b),g()},filter:function(b){return d=d.filter(b),a}}}};return c}function qk(t){t===void 0&&(t={});var n=Yk(null);return n.options=Ur({async:!0,ssr:!1},t),n}var nj=function(t){var n=t.sideCar,a=tj(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return f.createElement(o,Ur({},a))};nj.isSideCarExport=!0;function Kk(t,n){return t.useMedium(n),nj}var rj=qk(),Op=function(){},Hd=f.forwardRef(function(t,n){var a=f.useRef(null),o=f.useState({onScrollCapture:Op,onWheelCapture:Op,onTouchMoveCapture:Op}),c=o[0],l=o[1],d=t.forwardProps,m=t.children,p=t.className,g=t.removeScrollBar,b=t.enabled,v=t.shards,w=t.sideCar,y=t.noRelative,C=t.noIsolation,S=t.inert,N=t.allowPinchZoom,E=t.as,T=E===void 0?"div":E,M=t.gapMode,k=tj(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=w,R=Vk([a,n]),L=Ur(Ur({},k),c);return f.createElement(f.Fragment,null,b&&f.createElement(_,{sideCar:rj,removeScrollBar:g,shards:v,noRelative:y,noIsolation:C,inert:S,setCallbacks:l,allowPinchZoom:!!N,lockRef:a,gapMode:M}),d?f.cloneElement(f.Children.only(m),Ur(Ur({},L),{ref:R})):f.createElement(T,Ur({},L,{className:p,ref:R}),m))});Hd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hd.classNames={fullWidth:Qu,zeroRight:Zu};var Wk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xk(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var n=Wk();return n&&t.setAttribute("nonce",n),t}function Zk(t,n){t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n))}function Qk(t){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(t)}var Jk=function(){var t=0,n=null;return{add:function(a){t==0&&(n=Xk())&&(Zk(n,a),Qk(n)),t++},remove:function(){t--,!t&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},e9=function(){var t=Jk();return function(n,a){f.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&a])}},aj=function(){var t=e9(),n=function(a){var o=a.styles,c=a.dynamic;return t(o,c),null};return n},t9={left:0,top:0,right:0,gap:0},Lp=function(t){return parseInt(t||"",10)||0},n9=function(t){var n=window.getComputedStyle(document.body),a=n[t==="padding"?"paddingLeft":"marginLeft"],o=n[t==="padding"?"paddingTop":"marginTop"],c=n[t==="padding"?"paddingRight":"marginRight"];return[Lp(a),Lp(o),Lp(c)]},r9=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return t9;var n=n9(t),a=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-a+n[2]-n[0])}},a9=aj(),li="data-scroll-locked",s9=function(t,n,a,o){var c=t.left,l=t.top,d=t.right,m=t.gap;return a===void 0&&(a="margin"),`
|
||
.`.concat(Bk,` {
|
||
overflow: hidden `).concat(o,`;
|
||
padding-right: `).concat(m,"px ").concat(o,`;
|
||
}
|
||
body[`).concat(li,`] {
|
||
overflow: hidden `).concat(o,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([n&&"position: relative ".concat(o,";"),a==="margin"&&`
|
||
padding-left: `.concat(c,`px;
|
||
padding-top: `).concat(l,`px;
|
||
padding-right: `).concat(d,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(m,"px ").concat(o,`;
|
||
`),a==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Zu,` {
|
||
right: `).concat(m,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(Qu,` {
|
||
margin-right: `).concat(m,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(Zu," .").concat(Zu,` {
|
||
right: 0 `).concat(o,`;
|
||
}
|
||
|
||
.`).concat(Qu," .").concat(Qu,` {
|
||
margin-right: 0 `).concat(o,`;
|
||
}
|
||
|
||
body[`).concat(li,`] {
|
||
`).concat($k,": ").concat(m,`px;
|
||
}
|
||
`)},f0=function(){var t=parseInt(document.body.getAttribute(li)||"0",10);return isFinite(t)?t:0},o9=function(){f.useEffect(function(){return document.body.setAttribute(li,(f0()+1).toString()),function(){var t=f0()-1;t<=0?document.body.removeAttribute(li):document.body.setAttribute(li,t.toString())}},[])},i9=function(t){var n=t.noRelative,a=t.noImportant,o=t.gapMode,c=o===void 0?"margin":o;o9();var l=f.useMemo(function(){return r9(c)},[c]);return f.createElement(a9,{styles:s9(l,!n,c,a?"":"!important")})},vh=!1;if(typeof window<"u")try{var Ou=Object.defineProperty({},"passive",{get:function(){return vh=!0,!0}});window.addEventListener("test",Ou,Ou),window.removeEventListener("test",Ou,Ou)}catch{vh=!1}var Qo=vh?{passive:!1}:!1,l9=function(t){return t.tagName==="TEXTAREA"},sj=function(t,n){if(!(t instanceof Element))return!1;var a=window.getComputedStyle(t);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!l9(t)&&a[n]==="visible")},c9=function(t){return sj(t,"overflowY")},u9=function(t){return sj(t,"overflowX")},m0=function(t,n){var a=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=oj(t,o);if(c){var l=ij(t,o),d=l[1],m=l[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},d9=function(t){var n=t.scrollTop,a=t.scrollHeight,o=t.clientHeight;return[n,a,o]},f9=function(t){var n=t.scrollLeft,a=t.scrollWidth,o=t.clientWidth;return[n,a,o]},oj=function(t,n){return t==="v"?c9(n):u9(n)},ij=function(t,n){return t==="v"?d9(n):f9(n)},m9=function(t,n){return t==="h"&&n==="rtl"?-1:1},p9=function(t,n,a,o,c){var l=m9(t,window.getComputedStyle(n).direction),d=l*o,m=a.target,p=n.contains(m),g=!1,b=d>0,v=0,w=0;do{if(!m)break;var y=ij(t,m),C=y[0],S=y[1],N=y[2],E=S-N-l*C;(C||E)&&oj(t,m)&&(v+=E,w+=C);var T=m.parentNode;m=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!p&&m!==document.body||p&&(n.contains(m)||n===m));return(b&&Math.abs(v)<1||!b&&Math.abs(w)<1)&&(g=!0),g},Lu=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},p0=function(t){return[t.deltaX,t.deltaY]},h0=function(t){return t&&"current"in t?t.current:t},h9=function(t,n){return t[0]===n[0]&&t[1]===n[1]},g9=function(t){return`
|
||
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
||
`)},x9=0,Jo=[];function b9(t){var n=f.useRef([]),a=f.useRef([0,0]),o=f.useRef(),c=f.useState(x9++)[0],l=f.useState(aj)[0],d=f.useRef(t);f.useEffect(function(){d.current=t},[t]),f.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(c));var S=Uk([t.lockRef.current],(t.shards||[]).map(h0),!0).filter(Boolean);return S.forEach(function(N){return N.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(c))})}}},[t.inert,t.lockRef.current,t.shards]);var m=f.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var E=Lu(S),T=a.current,M="deltaX"in S?S.deltaX:T[0]-E[0],k="deltaY"in S?S.deltaY:T[1]-E[1],_,R=S.target,L=Math.abs(M)>Math.abs(k)?"h":"v";if("touches"in S&&L==="h"&&R.type==="range")return!1;var ne=window.getSelection(),X=ne&&ne.anchorNode,I=X?X===R||X.contains(R):!1;if(I)return!1;var H=m0(L,R);if(!H)return!0;if(H?_=L:(_=L==="v"?"h":"v",H=m0(L,R)),!H)return!1;if(!o.current&&"changedTouches"in S&&(M||k)&&(o.current=_),!_)return!0;var q=o.current||_;return p9(q,N,S,q==="h"?M:k)},[]),p=f.useCallback(function(S){var N=S;if(!(!Jo.length||Jo[Jo.length-1]!==l)){var E="deltaY"in N?p0(N):Lu(N),T=n.current.filter(function(_){return _.name===N.type&&(_.target===N.target||N.target===_.shadowParent)&&h9(_.delta,E)})[0];if(T&&T.should){N.cancelable&&N.preventDefault();return}if(!T){var M=(d.current.shards||[]).map(h0).filter(Boolean).filter(function(_){return _.contains(N.target)}),k=M.length>0?m(N,M[0]):!d.current.noIsolation;k&&N.cancelable&&N.preventDefault()}}},[]),g=f.useCallback(function(S,N,E,T){var M={name:S,delta:N,target:E,should:T,shadowParent:v9(E)};n.current.push(M),setTimeout(function(){n.current=n.current.filter(function(k){return k!==M})},1)},[]),b=f.useCallback(function(S){a.current=Lu(S),o.current=void 0},[]),v=f.useCallback(function(S){g(S.type,p0(S),S.target,m(S,t.lockRef.current))},[]),w=f.useCallback(function(S){g(S.type,Lu(S),S.target,m(S,t.lockRef.current))},[]);f.useEffect(function(){return Jo.push(l),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:w}),document.addEventListener("wheel",p,Qo),document.addEventListener("touchmove",p,Qo),document.addEventListener("touchstart",b,Qo),function(){Jo=Jo.filter(function(S){return S!==l}),document.removeEventListener("wheel",p,Qo),document.removeEventListener("touchmove",p,Qo),document.removeEventListener("touchstart",b,Qo)}},[]);var y=t.removeScrollBar,C=t.inert;return f.createElement(f.Fragment,null,C?f.createElement(l,{styles:g9(c)}):null,y?f.createElement(i9,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function v9(t){for(var n=null;t!==null;)t instanceof ShadowRoot&&(n=t.host,t=t.host),t=t.parentNode;return n}const y9=Kk(rj,b9);var ac=f.forwardRef(function(t,n){return f.createElement(Hd,Ur({},t,{ref:n,sideCar:y9}))});ac.classNames=Hd.classNames;var w9=Object.defineProperty,ot=(t,n)=>w9(t,"name",{value:n,configurable:!0}),yh=["Enter"," "],j9=["ArrowDown","PageUp","Home"],lj=["ArrowUp","PageDown","End"],C9=[...j9,...lj],S9={ltr:[...yh,"ArrowRight"],rtl:[...yh,"ArrowLeft"]},N9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gd="Menu",[Hl,E9,k9]=Td(Gd),[io,cj]=bn(Gd,[k9,Cs,Bd]),Rg=Cs(),uj=Bd(),[T9,lo]=io(Gd),[M9,sc]=io(Gd),R9=ot(t=>{const{__scopeMenu:n,open:a=!1,children:o,dir:c,onOpenChange:l,modal:d=!0}=t,m=Rg(n),[p,g]=f.useState(null),b=f.useRef(!1),v=Vt(l),w=Si(c);return f.useEffect(()=>{const y=ot(()=>{b.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},"handleKeyDown"),C=ot(()=>b.current=!1,"handlePointer");return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),f.useEffect(()=>{if(!a)return;const y=ot(()=>v(!1),"handleBlur");return window.addEventListener("blur",y),()=>window.removeEventListener("blur",y)},[a,v]),s.jsx(zd,{...m,children:s.jsx(T9,{scope:n,open:a,onOpenChange:v,content:p,onContentChange:g,children:s.jsx(M9,{scope:n,onClose:f.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:b,dir:w,modal:d,children:o})})})},"Menu"),dj=f.forwardRef(ot(function(n,a){const{__scopeMenu:o,...c}=n,l=Rg(o);return s.jsx(Pd,{...l,...c,ref:a})},"MenuAnchor")),fj="MenuPortal",[A9,mj]=io(fj,{forceMount:void 0}),_9=ot(t=>{const{__scopeMenu:n,forceMount:a,children:o,container:c}=t,l=lo(fj,n);return s.jsx(A9,{scope:n,forceMount:a,children:s.jsx(fn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:o})})})},"MenuPortal"),Nr="MenuContent",[D9,Ag]=io(Nr),O9=f.forwardRef(ot(function(n,a){const o=mj(Nr,n.__scopeMenu),{forceMount:c=o.forceMount,...l}=n,d=lo(Nr,n.__scopeMenu),m=sc(Nr,n.__scopeMenu);return s.jsx(Hl.Provider,{scope:n.__scopeMenu,children:s.jsx(fn,{present:c||d.open,children:s.jsx(Hl.Slot,{scope:n.__scopeMenu,children:m.modal?s.jsx(L9,{...l,ref:a}):s.jsx(z9,{...l,ref:a})})})})},"MenuContent")),L9=f.forwardRef(ot(function(n,a){const o=lo(Nr,n.__scopeMenu),c=f.useRef(null),l=Pe(a,c);return f.useEffect(()=>{const d=c.current;if(d)return $d(d)},[]),s.jsx(_g,{...n,ref:l,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Ce(n.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),z9=f.forwardRef(ot(function(n,a){const o=lo(Nr,n.__scopeMenu);return s.jsx(_g,{...n,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),P9=Er("MenuContent.ScrollLock"),_g=f.forwardRef(ot(function(n,a){const{__scopeMenu:o,loop:c=!1,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:m,disableOutsidePointerEvents:p,onEntryFocus:g,onEscapeKeyDown:b,onPointerDownOutside:v,onFocusOutside:w,onInteractOutside:y,onDismiss:C,disableOutsideScroll:S,...N}=n,E=lo(Nr,o),T=sc(Nr,o),M=Rg(o),k=uj(o),_=E9(o),[R,L]=f.useState(null),ne=f.useRef(null),X=Pe(a,ne,E.onContentChange),I=f.useRef(0),H=f.useRef(""),q=f.useRef(0),ce=f.useRef(null),de=f.useRef("right"),se=f.useRef(0),P=S?ac:f.Fragment,W=S?{as:P9,allowPinchZoom:!0}:void 0,oe=ot(G=>{var ge,me;const O=H.current+G,D=_().filter($=>!$.disabled),B=document.activeElement,V=(ge=D.find($=>$.ref.current===B))==null?void 0:ge.textValue,Z=D.map($=>$.textValue),be=yj(Z,O,V),K=(me=D.find($=>$.textValue===be))==null?void 0:me.ref.current;ot((function $(ie){H.current=ie,window.clearTimeout(I.current),ie!==""&&(I.current=window.setTimeout(()=>$(""),1e3))}),"updateSearch")(O),K&&setTimeout(()=>K.focus())},"handleTypeaheadSearch");f.useEffect(()=>()=>window.clearTimeout(I.current),[]),Ni();const ae=f.useCallback(G=>{var D,B;return de.current===((D=ce.current)==null?void 0:D.side)&&jj(G,(B=ce.current)==null?void 0:B.area)},[]);return s.jsx(D9,{scope:o,searchRef:H,onItemEnter:f.useCallback(G=>{ae(G)&&G.preventDefault()},[ae]),onItemLeave:f.useCallback(G=>{var O;ae(G)||((O=ne.current)==null||O.focus(),L(null))},[ae]),onTriggerLeave:f.useCallback(G=>{ae(G)&&G.preventDefault()},[ae]),pointerGraceTimerRef:q,onPointerGraceIntentChange:f.useCallback(G=>{ce.current=G},[]),children:s.jsx(P,{...W,children:s.jsx(Md,{asChild:!0,trapped:l,onMountAutoFocus:Ce(d,G=>{var O;G.preventDefault(),(O=ne.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:m,children:s.jsx(nc,{asChild:!0,disableOutsidePointerEvents:p,onEscapeKeyDown:b,onPointerDownOutside:v,onFocusOutside:w,onInteractOutside:y,onDismiss:C,children:s.jsx(Qw,{asChild:!0,...k,dir:T.dir,orientation:"vertical",loop:c,currentTabStopId:R,onCurrentTabStopIdChange:L,onEntryFocus:Ce(g,G=>{T.isUsingKeyboardRef.current||G.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Id,{role:"menu","aria-orientation":"vertical","data-state":Og(E.open),"data-radix-menu-content":"",dir:T.dir,...M,...N,ref:X,style:{outline:"none",...N.style},onKeyDown:Ce(N.onKeyDown,G=>{const D=G.target.closest("[data-radix-menu-content]")===G.currentTarget,B=G.ctrlKey||G.altKey||G.metaKey,V=G.key.length===1;D&&(G.key==="Tab"&&G.preventDefault(),!B&&V&&oe(G.key));const Z=ne.current;if(G.target!==Z||!C9.includes(G.key))return;G.preventDefault();const K=_().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);lj.includes(G.key)&&K.reverse(),bj(K)}),onBlur:Ce(n.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(I.current),H.current="")}),onPointerMove:Ce(n.onPointerMove,di(G=>{const O=G.target,D=se.current!==G.clientX;if(G.currentTarget.contains(O)&&D){const B=G.clientX>se.current?"right":"left";de.current=B,se.current=G.clientX}}))})})})})})})},"MenuContentImpl")),I9=f.forwardRef(ot(function(n,a){const{__scopeMenu:o,...c}=n;return s.jsx(Me.div,{...c,ref:a})},"MenuLabel")),wh="MenuItem",g0="menu.itemSelect",Dg=f.forwardRef(ot(function(n,a){const{disabled:o=!1,onSelect:c,...l}=n,d=f.useRef(null),m=sc(wh,n.__scopeMenu),p=Ag(wh,n.__scopeMenu),g=Pe(a,d),b=f.useRef(!1),v=ot(()=>{const w=d.current;if(!o&&w){const y=new CustomEvent(g0,{bubbles:!0,cancelable:!0});w.addEventListener(g0,C=>c==null?void 0:c(C),{once:!0}),gg(w,y),y.defaultPrevented?b.current=!1:m.onClose()}},"handleSelect");return s.jsx(pj,{...l,ref:g,disabled:o,onClick:Ce(n.onClick,v),onPointerDown:w=>{var y;(y=n.onPointerDown)==null||y.call(n,w),b.current=!0},onPointerUp:Ce(n.onPointerUp,w=>{var y;b.current||(y=w.currentTarget)==null||y.click()}),onKeyDown:Ce(n.onKeyDown,w=>{o||w.target!==w.currentTarget||p.searchRef.current!==""&&w.key===" "||yh.includes(w.key)&&(w.currentTarget.click(),w.preventDefault())})})},"MenuItem")),pj=f.forwardRef(ot(function(n,a){const{__scopeMenu:o,disabled:c=!1,textValue:l,...d}=n,m=Ag(wh,o),p=uj(o),g=f.useRef(null),b=Pe(a,g),[v,w]=f.useState(!1),[y,C]=f.useState("");return f.useEffect(()=>{const S=g.current;S&&C((S.textContent??"").trim())},[d.children]),s.jsx(Hl.ItemSlot,{scope:o,disabled:c,textValue:l??y,children:s.jsx(Jw,{asChild:!0,...p,focusable:!c,children:s.jsx(Me.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...d,ref:b,onPointerMove:Ce(n.onPointerMove,di(S=>{c?m.onItemLeave(S):(m.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(n.onPointerLeave,di(S=>m.onItemLeave(S))),onFocus:Ce(n.onFocus,()=>w(!0)),onBlur:Ce(n.onBlur,()=>w(!1))})})})},"MenuItemImpl")),U9=f.forwardRef(ot(function(n,a){const{checked:o=!1,onCheckedChange:c,...l}=n;return s.jsx(gj,{scope:n.__scopeMenu,checked:o,children:s.jsx(Dg,{role:"menuitemcheckbox","aria-checked":Gl(o)?"mixed":o,...l,ref:a,"data-state":Vd(o),onSelect:Ce(l.onSelect,()=>c==null?void 0:c(Gl(o)?!0:!o),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),B9="MenuRadioGroup",[PP,$9]=io(B9,{value:void 0,onValueChange:ot(()=>{},"onValueChange")}),H9="MenuRadioItem",G9=f.forwardRef(ot(function(n,a){const{value:o,...c}=n,l=$9(H9,n.__scopeMenu),d=o===l.value;return s.jsx(gj,{scope:n.__scopeMenu,checked:d,children:s.jsx(Dg,{role:"menuitemradio","aria-checked":d,...c,ref:a,"data-state":Vd(d),onSelect:Ce(c.onSelect,()=>{var m;return(m=l.onValueChange)==null?void 0:m.call(l,o)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),hj="MenuItemIndicator",[gj,V9]=io(hj,{checked:!1}),F9=f.forwardRef(ot(function(n,a){const{__scopeMenu:o,forceMount:c,...l}=n,d=V9(hj,o);return s.jsx(fn,{present:c||Gl(d.checked)||d.checked===!0,children:s.jsx(Me.span,{...l,ref:a,"data-state":Vd(d.checked)})})},"MenuItemIndicator")),Y9=f.forwardRef(ot(function(n,a){const{__scopeMenu:o,...c}=n;return s.jsx(Me.div,{role:"separator","aria-orientation":"horizontal",...c,ref:a})},"MenuSeparator")),q9="MenuSub",[IP,xj]=io(q9),zu="MenuSubTrigger",K9=f.forwardRef(ot(function(n,a){const o=lo(zu,n.__scopeMenu),c=sc(zu,n.__scopeMenu),l=xj(zu,n.__scopeMenu),d=Ag(zu,n.__scopeMenu),m=f.useRef(null),{pointerGraceTimerRef:p,onPointerGraceIntentChange:g}=d,b={__scopeMenu:n.__scopeMenu},v=f.useCallback(()=>{m.current&&window.clearTimeout(m.current),m.current=null},[]);f.useEffect(()=>v,[v]),f.useEffect(()=>{const y=p.current;return()=>{window.clearTimeout(y),g(null)}},[p,g]);const w=Pe(a,l.onTriggerChange);return s.jsx(dj,{asChild:!0,...b,children:s.jsx(pj,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?l.contentId:void 0,"data-state":Og(o.open),...n,ref:w,onClick:y=>{var C;(C=n.onClick)==null||C.call(n,y),!(n.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:Ce(n.onPointerMove,di(y=>{d.onItemEnter(y),!y.defaultPrevented&&!n.disabled&&!o.open&&!m.current&&(d.onPointerGraceIntentChange(null),m.current=window.setTimeout(()=>{o.onOpenChange(!0),v()},100))})),onPointerLeave:Ce(n.onPointerLeave,di(y=>{var S,N;v();const C=(S=o.content)==null?void 0:S.getBoundingClientRect();if(C){const E=(N=o.content)==null?void 0:N.dataset.side,T=E==="right",M=T?-5:5,k=C[T?"left":"right"],_=C[T?"right":"left"];d.onPointerGraceIntentChange({area:[{x:y.clientX+M,y:y.clientY},{x:k,y:C.top},{x:_,y:C.top},{x:_,y:C.bottom},{x:k,y:C.bottom}],side:E}),window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.onPointerGraceIntentChange(null),300)}else{if(d.onTriggerLeave(y),y.defaultPrevented)return;d.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(n.onKeyDown,y=>{var S;n.disabled||y.target!==y.currentTarget||d.searchRef.current!==""&&y.key===" "||S9[c.dir].includes(y.key)&&(o.onOpenChange(!0),(S=o.content)==null||S.focus(),y.preventDefault())})})})},"MenuSubTrigger")),W9="MenuSubContent",X9=f.forwardRef(ot(function(n,a){const o=mj(Nr,n.__scopeMenu),{forceMount:c=o.forceMount,align:l="start",...d}=n,m=lo(Nr,n.__scopeMenu),p=sc(Nr,n.__scopeMenu),g=xj(W9,n.__scopeMenu),b=f.useRef(null),v=Pe(a,b);return s.jsx(Hl.Provider,{scope:n.__scopeMenu,children:s.jsx(fn,{present:c||m.open,children:s.jsx(Hl.Slot,{scope:n.__scopeMenu,children:s.jsx(_g,{id:g.contentId,"aria-labelledby":g.triggerId,...d,ref:v,align:l,side:p.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:w=>{var y;p.isUsingKeyboardRef.current&&((y=b.current)==null||y.focus()),w.preventDefault()},onCloseAutoFocus:w=>w.preventDefault(),onFocusOutside:Ce(n.onFocusOutside,w=>{w.target!==g.trigger&&m.onOpenChange(!1)}),onEscapeKeyDown:Ce(n.onEscapeKeyDown,w=>{p.onClose(),w.preventDefault()}),onKeyDown:Ce(n.onKeyDown,w=>{var S;const y=w.currentTarget.contains(w.target),C=N9[p.dir].includes(w.key);y&&C&&(m.onOpenChange(!1),(S=g.trigger)==null||S.focus(),w.preventDefault())})})})})})},"MenuSubContent"));function Og(t){return t?"open":"closed"}ot(Og,"getOpenState");function Gl(t){return t==="indeterminate"}ot(Gl,"isIndeterminate");function Vd(t){return Gl(t)?"indeterminate":t?"checked":"unchecked"}ot(Vd,"getCheckedState");function bj(t){const n=document.activeElement;for(const a of t)if(a===n||(a.focus(),document.activeElement!==n))return}ot(bj,"focusFirst");function vj(t,n){return t.map((a,o)=>t[(n+o)%t.length])}ot(vj,"wrapArray");function yj(t,n,a){const c=n.length>1&&Array.from(n).every(g=>g===n[0])?n[0]:n,l=a?t.indexOf(a):-1;let d=vj(t,Math.max(l,0));c.length===1&&(d=d.filter(g=>g!==a));const p=d.find(g=>g.toLowerCase().startsWith(c.toLowerCase()));return p!==a?p:void 0}ot(yj,"getNextMatch");function wj(t,n){const{x:a,y:o}=t;let c=!1;for(let l=0,d=n.length-1;l<n.length;d=l++){const m=n[l],p=n[d],g=m.x,b=m.y,v=p.x,w=p.y;b>o!=w>o&&a<(v-g)*(o-b)/(w-b)+g&&(c=!c)}return c}ot(wj,"isPointInPolygon");function jj(t,n){if(!n)return!1;const a={x:t.clientX,y:t.clientY};return wj(a,n)}ot(jj,"isPointerInGraceArea");function di(t){return n=>n.pointerType==="mouse"?t(n):void 0}ot(di,"whenMouse");var Z9=R9,Q9=dj,J9=_9,eT=O9,tT=I9,nT=Dg,rT=U9,aT=G9,sT=F9,oT=Y9,iT=K9,lT=X9,cT=Object.defineProperty,hr=(t,n)=>cT(t,"name",{value:n,configurable:!0}),Lg="DropdownMenu",[uT,UP]=bn(Lg,[cj]),gr=cj(),[dT,Cj]=uT(Lg),fT=hr(t=>{const{__scopeDropdownMenu:n,children:a,dir:o,open:c,defaultOpen:l,onOpenChange:d,modal:m=!0}=t,p=gr(n),g=f.useRef(null),[b,v]=Vr({prop:c,defaultProp:l??!1,onChange:d,caller:Lg});return s.jsx(dT,{scope:n,triggerId:nn(),triggerRef:g,contentId:nn(),open:b,onOpenChange:v,onOpenToggle:f.useCallback(()=>v(w=>!w),[v]),modal:m,children:s.jsx(Z9,{...p,open:b,onOpenChange:v,dir:o,modal:m,children:a})})},"DropdownMenu"),mT="DropdownMenuTrigger",pT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,disabled:c=!1,...l}=n,d=Cj(mT,o),m=gr(o),p=Pe(a,d.triggerRef);return s.jsx(Q9,{asChild:!0,...m,children:s.jsx(Me.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...l,ref:p,onPointerDown:Ce(n.onPointerDown,g=>{!c&&g.button===0&&g.ctrlKey===!1&&(d.onOpenToggle(),d.open||g.preventDefault())}),onKeyDown:Ce(n.onKeyDown,g=>{c||(["Enter"," "].includes(g.key)&&d.onOpenToggle(),g.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})},"DropdownMenuTrigger")),hT=hr(t=>{const{__scopeDropdownMenu:n,...a}=t,o=gr(n);return s.jsx(J9,{...o,...a})},"DropdownMenuPortal"),gT="DropdownMenuContent",xT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=Cj(gT,o),d=gr(o),m=f.useRef(!1);return s.jsx(eT,{id:l.contentId,"aria-labelledby":l.triggerId,...d,...c,ref:a,onCloseAutoFocus:Ce(n.onCloseAutoFocus,p=>{var g;m.current||(g=l.triggerRef.current)==null||g.focus(),m.current=!1,p.preventDefault()}),onInteractOutside:Ce(n.onInteractOutside,p=>{const g=p.detail.originalEvent,b=g.button===0&&g.ctrlKey===!0,v=g.button===2||b;(!l.modal||v)&&(m.current=!0)}),style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),bT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=gr(o);return s.jsx(tT,{...l,...c,ref:a})},"DropdownMenuLabel")),vT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=gr(o);return s.jsx(nT,{...l,...c,ref:a})},"DropdownMenuItem")),yT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=gr(o);return s.jsx(rT,{...l,...c,ref:a})},"DropdownMenuCheckboxItem")),wT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=gr(o);return s.jsx(aT,{...l,...c,ref:a})},"DropdownMenuRadioItem")),jT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=gr(o);return s.jsx(sT,{...l,...c,ref:a})},"DropdownMenuItemIndicator")),CT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=gr(o);return s.jsx(oT,{...l,...c,ref:a})},"DropdownMenuSeparator")),ST=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=gr(o);return s.jsx(iT,{...l,...c,ref:a})},"DropdownMenuSubTrigger")),NT=f.forwardRef(hr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=gr(o);return s.jsx(lT,{...l,...c,ref:a,style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),ET=fT,kT=pT,TT=hT,Sj=xT,Nj=bT,Ej=vT,kj=yT,Tj=wT,Mj=jT,Rj=CT,Aj=ST,_j=NT;/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const MT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dj=(...t)=>t.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var RT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const AT=f.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:c="",children:l,iconNode:d,...m},p)=>f.createElement("svg",{ref:p,...RT,width:n,height:n,stroke:t,strokeWidth:o?Number(a)*24/Number(n):a,className:Dj("lucide",c),...m},[...d.map(([g,b])=>f.createElement(g,b)),...Array.isArray(l)?l:[l]]));/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ra=(t,n)=>{const a=f.forwardRef(({className:o,...c},l)=>f.createElement(AT,{ref:l,iconNode:n,className:Dj(`lucide-${MT(t)}`,o),...c}));return a.displayName=`${t}`,a};/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _T=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Oj=Ra("Check",_T);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const DT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Lj=Ra("ChevronDown",DT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const OT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],LT=Ra("ChevronRight",OT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],PT=Ra("ChevronUp",zT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const IT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],x0=Ra("CircleCheck",IT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const UT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],BT=Ra("Circle",UT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],HT=Ra("PanelLeft",$T);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const GT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],VT=Ra("Search",GT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const FT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zj=Ra("X",FT),zg=ET,Pg=kT,YT=f.forwardRef(({className:t,inset:n,children:a,...o},c)=>s.jsxs(Aj,{ref:c,className:pe("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",t),...o,children:[a,s.jsx(LT,{className:"ml-auto"})]}));YT.displayName=Aj.displayName;const qT=f.forwardRef(({className:t,...n},a)=>s.jsx(_j,{ref:a,className:pe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-[--radix-dropdown-menu-content-transform-origin]",t),...n}));qT.displayName=_j.displayName;const Fd=f.forwardRef(({className:t,sideOffset:n=4,...a},o)=>s.jsx(TT,{children:s.jsx(Sj,{ref:o,sideOffset:n,className:pe("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","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 origin-[--radix-dropdown-menu-content-transform-origin]",t),...a})}));Fd.displayName=Sj.displayName;const Vl=f.forwardRef(({className:t,inset:n,...a},o)=>s.jsx(Ej,{ref:o,className:pe("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",t),...a}));Vl.displayName=Ej.displayName;const KT=f.forwardRef(({className:t,children:n,checked:a,...o},c)=>s.jsxs(kj,{ref:c,className:pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:a,...o,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Mj,{children:s.jsx(Oj,{className:"h-4 w-4"})})}),n]}));KT.displayName=kj.displayName;const WT=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(Tj,{ref:o,className:pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Mj,{children:s.jsx(BT,{className:"h-2 w-2 fill-current"})})}),n]}));WT.displayName=Tj.displayName;const Ig=f.forwardRef(({className:t,inset:n,...a},o)=>s.jsx(Nj,{ref:o,className:pe("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",t),...a}));Ig.displayName=Nj.displayName;const Fl=f.forwardRef(({className:t,...n},a)=>s.jsx(Rj,{ref:a,className:pe("-mx-1 my-1 h-px bg-muted",t),...n}));Fl.displayName=Rj.displayName;const zp=768;function XT(){const[t,n]=f.useState(void 0);return f.useEffect(()=>{const a=window.matchMedia(`(max-width: ${zp-1}px)`),o=()=>{n(window.innerWidth<zp)};return a.addEventListener("change",o),n(window.innerWidth<zp),()=>a.removeEventListener("change",o)},[]),!!t}const _e=f.forwardRef(({className:t,type:n,...a},o)=>s.jsx("input",{type:n,className:pe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:o,...a}));_e.displayName="Input";var ZT=Object.defineProperty,Pj=(t,n)=>ZT(t,"name",{value:n,configurable:!0}),b0="horizontal",QT=["horizontal","vertical"],JT=f.forwardRef(Pj(function(n,a){const{decorative:o,orientation:c=b0,...l}=n,d=Ij(c)?c:b0,p=o?{role:"none"}:{"aria-orientation":d==="vertical"?d:void 0,role:"separator"};return s.jsx(Me.div,{"data-orientation":d,...p,...l,ref:a})},"Separator"));function Ij(t){return QT.includes(t)}Pj(Ij,"isValidOrientation");var Uj=JT;const Bj=f.forwardRef(({className:t,orientation:n="horizontal",decorative:a=!0,...o},c)=>s.jsx(Uj,{ref:c,decorative:a,orientation:n,className:pe("shrink-0 bg-border",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...o}));Bj.displayName=Uj.displayName;var e7=Object.defineProperty,Wn=(t,n)=>e7(t,"name",{value:n,configurable:!0}),Ug="Dialog",[$j,BP]=bn(Ug),[t7,Rr]=$j(Ug),Bg=Wn(t=>{const{__scopeDialog:n,children:a,open:o,defaultOpen:c,onOpenChange:l,modal:d=!0}=t,m=f.useRef(null),p=f.useRef(null),[g,b]=Vr({prop:o,defaultProp:c??!1,onChange:l,caller:Ug}),[v,w]=f.useState(0),[y,C]=f.useState(0);return s.jsx(t7,{scope:n,triggerRef:m,contentRef:p,contentId:nn(),titleId:nn(),descriptionId:nn(),titlePresent:v>0,descriptionPresent:y>0,setTitleCount:w,setDescriptionCount:C,open:g,onOpenChange:b,onOpenToggle:f.useCallback(()=>b(S=>!S),[b]),modal:d,children:a})},"Dialog"),n7="DialogTrigger",r7=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Rr(n7,o),d=Pe(a,l.triggerRef);return s.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":Kd(l.open),...c,ref:d,onClick:Ce(n.onClick,l.onOpenToggle)})},"DialogTrigger")),Hj="DialogPortal",[a7,Gj]=$j(Hj,{forceMount:void 0}),$g=Wn(t=>{const{__scopeDialog:n,forceMount:a,children:o,container:c}=t,l=Rr(Hj,n);return s.jsx(a7,{scope:n,forceMount:a,children:f.Children.map(o,d=>s.jsx(fn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:d})}))})},"DialogPortal"),jh="DialogOverlay",oc=f.forwardRef(Wn(function(n,a){const o=Gj(jh,n.__scopeDialog),{forceMount:c=o.forceMount,...l}=n,d=Rr(jh,n.__scopeDialog);return d.modal?s.jsx(fn,{present:c||d.open,children:s.jsx(o7,{...l,ref:a})}):null},"DialogOverlay")),s7=Er("DialogOverlay.RemoveScroll"),o7=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Rr(jh,o),d=hw(),m=Pe(a,d);return s.jsx(ac,{as:s7,allowPinchZoom:!0,shards:[l.contentRef],children:s.jsx(Me.div,{"data-state":Kd(l.open),...c,ref:m,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),Yl="DialogContent",ic=f.forwardRef(Wn(function(n,a){const o=Gj(Yl,n.__scopeDialog),{forceMount:c=o.forceMount,...l}=n,d=Rr(Yl,n.__scopeDialog);return s.jsx(fn,{present:c||d.open,children:d.modal?s.jsx(i7,{...l,ref:a}):s.jsx(l7,{...l,ref:a})})},"DialogContent")),i7=f.forwardRef(Wn(function(n,a){const o=Rr(Yl,n.__scopeDialog),c=f.useRef(null),l=Pe(a,o.contentRef,c);return f.useEffect(()=>{const d=c.current;if(d)return $d(d)},[]),s.jsx(Vj,{...n,ref:l,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Ce(n.onCloseAutoFocus,d=>{var m;d.preventDefault(),(m=o.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Ce(n.onPointerDownOutside,d=>{const m=d.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0;(m.button===2||p)&&d.preventDefault()}),onFocusOutside:Ce(n.onFocusOutside,d=>d.preventDefault())})},"DialogContentModal")),l7=f.forwardRef(Wn(function(n,a){const o=Rr(Yl,n.__scopeDialog),c=f.useRef(!1),l=f.useRef(!1);return s.jsx(Vj,{...n,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,p;(m=n.onCloseAutoFocus)==null||m.call(n,d),d.defaultPrevented||(c.current||(p=o.triggerRef.current)==null||p.focus(),d.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:d=>{var g,b;(g=n.onInteractOutside)==null||g.call(n,d),d.defaultPrevented||(c.current=!0,d.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const m=d.target;((b=o.triggerRef.current)==null?void 0:b.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.current&&d.preventDefault()}})},"DialogContentNonModal")),Vj=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:d,...m}=n,p=Rr(Yl,o);return Ni(),s.jsx(s.Fragment,{children:s.jsx(Md,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:l,onUnmountAutoFocus:d,children:s.jsx(nc,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionPresent?p.descriptionId:void 0,"aria-labelledby":p.titlePresent?p.titleId:void 0,"data-state":Kd(p.open),...m,ref:a,deferPointerDownOutside:!0,onDismiss:()=>p.onOpenChange(!1)})})})},"DialogContentImpl")),c7="DialogTitle",Yd=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Rr(c7,o),{setTitleCount:d}=l;return St(()=>(d(m=>m+1),()=>d(m=>m-1)),[d]),s.jsx(Me.h2,{id:l.titleId,...c,ref:a})},"DialogTitle")),u7="DialogDescription",qd=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Rr(u7,o),{setDescriptionCount:d}=l;return St(()=>(d(m=>m+1),()=>d(m=>m-1)),[d]),s.jsx(Me.p,{id:l.descriptionId,...c,ref:a})},"DialogDescription")),d7="DialogClose",Fj=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Rr(d7,o);return s.jsx(Me.button,{type:"button",...c,ref:a,onClick:Ce(n.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Kd(t){return t?"open":"closed"}Wn(Kd,"getState");const Yj=Bg,f7=$g,qj=f.forwardRef(({className:t,...n},a)=>s.jsx(oc,{className:pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n,ref:a}));qj.displayName=oc.displayName;const m7=ji("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Hg=f.forwardRef(({side:t="right",className:n,children:a,...o},c)=>s.jsxs(f7,{children:[s.jsx(qj,{}),s.jsxs(ic,{ref:c,className:pe(m7({side:t}),n),...o,children:[s.jsxs(Fj,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(zj,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));Hg.displayName=ic.displayName;const Gg=({className:t,...n})=>s.jsx("div",{className:pe("flex flex-col space-y-2 text-center sm:text-left",t),...n});Gg.displayName="SheetHeader";const Vg=f.forwardRef(({className:t,...n},a)=>s.jsx(Yd,{ref:a,className:pe("text-lg font-semibold text-foreground",t),...n}));Vg.displayName=Yd.displayName;const Fg=f.forwardRef(({className:t,...n},a)=>s.jsx(qd,{ref:a,className:pe("text-sm text-muted-foreground",t),...n}));Fg.displayName=qd.displayName;function Ue({className:t,...n}){return s.jsx("div",{className:pe("animate-pulse rounded-md bg-primary/10",t),...n})}var p7=Object.defineProperty,h7=(t,n)=>p7(t,"name",{value:n,configurable:!0}),Kj=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"}),g7=f.forwardRef(h7(function(n,a){return s.jsx(Me.span,{...n,ref:a,style:{...Kj,...n.style}})},"VisuallyHidden")),x7=g7,b7=Object.defineProperty,tn=(t,n)=>b7(t,"name",{value:n,configurable:!0}),[Yg,$P]=bn("Tooltip",[Cs]),qg=Cs(),v7="TooltipProvider",y7=700,Ch="tooltip.open",[w7,Kg]=Yg(v7),j7=tn(t=>{const{__scopeTooltip:n,delayDuration:a=y7,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:l}=t,d=f.useRef(!0),m=f.useRef(!1),p=f.useRef(0);return f.useEffect(()=>{const g=p.current;return()=>window.clearTimeout(g)},[]),s.jsx(w7,{scope:n,isOpenDelayedRef:d,delayDuration:a,onOpen:f.useCallback(()=>{o<=0||(window.clearTimeout(p.current),d.current=!1)},[o]),onClose:f.useCallback(()=>{o<=0||(window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.current=!0,o))},[o]),isPointerInTransitRef:m,onPointerInTransitChange:f.useCallback(g=>{m.current=g},[]),disableHoverableContent:c,children:l})},"TooltipProvider"),Sh="Tooltip",[C7,lc]=Yg(Sh),S7=tn(t=>{const{__scopeTooltip:n,children:a,open:o,defaultOpen:c,onOpenChange:l,disableHoverableContent:d,delayDuration:m}=t,p=Kg(Sh,t.__scopeTooltip),g=qg(n),[b,v]=f.useState(null),[w,y]=f.useState(void 0),C=nn(),S=f.useRef(0),N=d??p.disableHoverableContent,E=m??p.delayDuration,T=f.useRef(!1),[M,k]=Vr({prop:o,defaultProp:c??!1,onChange:tn(I=>{I?(p.onOpen(),document.dispatchEvent(new CustomEvent(Ch))):p.onClose(),l==null||l(I)},"onChange"),caller:Sh}),_=f.useMemo(()=>M?T.current?"delayed-open":"instant-open":"closed",[M]),R=f.useCallback(()=>{window.clearTimeout(S.current),S.current=0,T.current=!1,k(!0)},[k]),L=f.useCallback(()=>{window.clearTimeout(S.current),S.current=0,k(!1)},[k]),ne=f.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{T.current=!0,k(!0),S.current=0},E)},[E,k]);f.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const X=w??C;return s.jsx(zd,{...g,children:s.jsx(C7,{scope:n,contentId:X,setContentId:y,open:M,stateAttribute:_,trigger:b,onTriggerChange:v,onTriggerEnter:f.useCallback(()=>{p.isOpenDelayedRef.current?ne():R()},[p.isOpenDelayedRef,ne,R]),onTriggerLeave:f.useCallback(()=>{N?L():(window.clearTimeout(S.current),S.current=0)},[L,N]),onOpen:R,onClose:L,disableHoverableContent:N,children:a})})},"Tooltip"),v0="TooltipTrigger",N7=f.forwardRef(tn(function(n,a){const{__scopeTooltip:o,...c}=n,l=lc(v0,o),d=Kg(v0,o),m=qg(o),p=f.useRef(null),g=Pe(a,p,l.onTriggerChange),b=f.useRef(!1),v=f.useRef(!1),w=f.useCallback(()=>b.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",w),[w]),s.jsx(Pd,{asChild:!0,...m,children:s.jsx(Me.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...c,ref:g,onPointerMove:Ce(n.onPointerMove,y=>{y.pointerType!=="touch"&&!v.current&&!d.isPointerInTransitRef.current&&(l.onTriggerEnter(),v.current=!0)}),onPointerLeave:Ce(n.onPointerLeave,()=>{l.onTriggerLeave(),v.current=!1}),onPointerDown:Ce(n.onPointerDown,()=>{l.open&&l.onClose(),b.current=!0,document.addEventListener("pointerup",w,{once:!0})}),onFocus:Ce(n.onFocus,()=>{b.current||l.onOpen()}),onBlur:Ce(n.onBlur,l.onClose),onClick:Ce(n.onClick,l.onClose)})})},"TooltipTrigger")),Wj="TooltipPortal",[E7,k7]=Yg(Wj,{forceMount:void 0}),T7=tn(t=>{const{__scopeTooltip:n,forceMount:a,children:o,container:c}=t,l=lc(Wj,n);return s.jsx(E7,{scope:n,forceMount:a,children:s.jsx(fn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:o})})})},"TooltipPortal"),ql="TooltipContent",M7=f.forwardRef(tn(function(n,a){const o=k7(ql,n.__scopeTooltip),{forceMount:c=o.forceMount,side:l="top",...d}=n,m=lc(ql,n.__scopeTooltip);return s.jsx(fn,{present:c||m.open,children:m.disableHoverableContent?s.jsx(Xj,{side:l,...d,ref:a}):s.jsx(R7,{side:l,...d,ref:a})})},"TooltipContent")),R7=f.forwardRef(tn(function(n,a){const o=lc(ql,n.__scopeTooltip),c=Kg(ql,n.__scopeTooltip),l=f.useRef(null),d=Pe(a,l),[m,p]=f.useState(null),{trigger:g,onClose:b}=o,v=l.current,{onPointerInTransitChange:w}=c,y=f.useCallback(()=>{p(null),w(!1)},[w]),C=f.useCallback((S,N)=>{const E=S.currentTarget,T={x:S.clientX,y:S.clientY},M=Zj(T,E.getBoundingClientRect()),k=Qj(T,M),_=Jj(N.getBoundingClientRect()),R=tC([...k,..._]);p(R),w(!0)},[w]);return f.useEffect(()=>()=>y(),[y]),f.useEffect(()=>{if(g&&v){const S=tn(E=>C(E,v),"handleTriggerLeave"),N=tn(E=>C(E,g),"handleContentLeave");return g.addEventListener("pointerleave",S),v.addEventListener("pointerleave",N),()=>{g.removeEventListener("pointerleave",S),v.removeEventListener("pointerleave",N)}}},[g,v,C,y]),f.useEffect(()=>{if(m){const S=tn(N=>{const E=N.target,T={x:N.clientX,y:N.clientY},M=(g==null?void 0:g.contains(E))||(v==null?void 0:v.contains(E)),k=!eC(T,m);M?y():k&&(y(),b())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[g,v,m,b,y]),s.jsx(Xj,{...n,ref:d})},"TooltipContentHoverable")),A7=Q2("TooltipContent"),Xj=f.forwardRef(tn(function(n,a){const{__scopeTooltip:o,children:c,"aria-label":l,id:d,onEscapeKeyDown:m,onPointerDownOutside:p,...g}=n,b=lc(ql,o),v=qg(o),{onClose:w}=b;f.useEffect(()=>(document.addEventListener(Ch,w),()=>document.removeEventListener(Ch,w)),[w]),f.useEffect(()=>{if(b.trigger){const C=tn(S=>{S.target instanceof Node&&S.target.contains(b.trigger)&&w()},"handleScroll");return window.addEventListener("scroll",C,{capture:!0}),()=>window.removeEventListener("scroll",C,{capture:!0})}},[b.trigger,w]);const{setContentId:y}=b;return St(()=>(y(d),()=>{y(void 0)}),[d,y]),s.jsx(nc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:C=>C.preventDefault(),onDismiss:w,children:s.jsxs(Id,{"data-state":b.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:b.contentId,...v,...g,ref:a,style:{...g.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(A7,{children:c}),l?s.jsx(x7,{id:b.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl"));function Zj(t,n){const a=Math.abs(n.top-t.y),o=Math.abs(n.bottom-t.y),c=Math.abs(n.right-t.x),l=Math.abs(n.left-t.x);switch(Math.min(a,o,c,l)){case l:return"left";case c:return"right";case a:return"top";case o:return"bottom";default:throw new Error("unreachable")}}tn(Zj,"getExitSideFromRect");function Qj(t,n,a=5){const o=[];switch(n){case"top":o.push({x:t.x-a,y:t.y+a},{x:t.x+a,y:t.y+a});break;case"bottom":o.push({x:t.x-a,y:t.y-a},{x:t.x+a,y:t.y-a});break;case"left":o.push({x:t.x+a,y:t.y-a},{x:t.x+a,y:t.y+a});break;case"right":o.push({x:t.x-a,y:t.y-a},{x:t.x-a,y:t.y+a});break}return o}tn(Qj,"getPaddedExitPoints");function Jj(t){const{top:n,right:a,bottom:o,left:c}=t;return[{x:c,y:n},{x:a,y:n},{x:a,y:o},{x:c,y:o}]}tn(Jj,"getPointsFromRect");function eC(t,n){const{x:a,y:o}=t;let c=!1;for(let l=0,d=n.length-1;l<n.length;d=l++){const m=n[l],p=n[d],g=m.x,b=m.y,v=p.x,w=p.y;b>o!=w>o&&a<(v-g)*(o-b)/(w-b)+g&&(c=!c)}return c}tn(eC,"isPointInPolygon");function tC(t){const n=t.slice();return n.sort((a,o)=>a.x<o.x?-1:a.x>o.x?1:a.y<o.y?-1:a.y>o.y?1:0),nC(n)}tn(tC,"getHull");function nC(t){if(t.length<=1)return t.slice();const n=[];for(let o=0;o<t.length;o++){const c=t[o];for(;n.length>=2;){const l=n[n.length-1],d=n[n.length-2];if((l.x-d.x)*(c.y-d.y)>=(l.y-d.y)*(c.x-d.x))n.pop();else break}n.push(c)}n.pop();const a=[];for(let o=t.length-1;o>=0;o--){const c=t[o];for(;a.length>=2;){const l=a[a.length-1],d=a[a.length-2];if((l.x-d.x)*(c.y-d.y)>=(l.y-d.y)*(c.x-d.x))a.pop();else break}a.push(c)}return a.pop(),n.length===1&&a.length===1&&n[0].x===a[0].x&&n[0].y===a[0].y?n:n.concat(a)}tn(nC,"getHullPresorted");var _7=j7,D7=S7,O7=N7,L7=T7,rC=M7;const aC=_7,z7=D7,P7=O7,sC=f.forwardRef(({className:t,sideOffset:n=4,...a},o)=>s.jsx(L7,{children:s.jsx(rC,{ref:o,sideOffset:n,className:pe("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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 origin-[--radix-tooltip-content-transform-origin]",t),...a})}));sC.displayName=rC.displayName;const I7="sidebar_state",U7=3600*24*7,B7="16rem",$7="18rem",H7="3rem",G7="b",oC=f.createContext(null);function Wd(){const t=f.useContext(oC);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const iC=f.forwardRef(({defaultOpen:t=!0,open:n,onOpenChange:a,className:o,style:c,children:l,...d},m)=>{const p=XT(),[g,b]=f.useState(!1),[v,w]=f.useState(t),y=n??v,C=f.useCallback(T=>{const M=typeof T=="function"?T(y):T;a?a(M):w(M),document.cookie=`${I7}=${M}; path=/; max-age=${U7}`},[a,y]),S=f.useCallback(()=>p?b(T=>!T):C(T=>!T),[p,C,b]);f.useEffect(()=>{const T=M=>{M.key===G7&&(M.metaKey||M.ctrlKey)&&(M.preventDefault(),S())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[S]);const N=y?"expanded":"collapsed",E=f.useMemo(()=>({state:N,open:y,setOpen:C,isMobile:p,openMobile:g,setOpenMobile:b,toggleSidebar:S}),[N,y,C,p,g,b,S]);return s.jsx(oC.Provider,{value:E,children:s.jsx(aC,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":B7,"--sidebar-width-icon":H7,...c},className:pe("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:m,...d,children:l})})})});iC.displayName="SidebarProvider";const lC=f.forwardRef(({side:t="left",variant:n="sidebar",collapsible:a="offcanvas",className:o,children:c,...l},d)=>{const{isMobile:m,state:p,openMobile:g,setOpenMobile:b}=Wd();return a==="none"?s.jsx("div",{className:pe("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:d,...l,children:c}):m?s.jsx(Yj,{open:g,onOpenChange:b,...l,children:s.jsxs(Hg,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":$7},side:t,children:[s.jsxs(Gg,{className:"sr-only",children:[s.jsx(Vg,{children:"Sidebar"}),s.jsx(Fg,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):s.jsxs("div",{ref:d,className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":p==="collapsed"?a:"","data-variant":n,"data-side":t,children:[s.jsx("div",{className:pe("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:pe("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...l,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:c})})]})});lC.displayName="Sidebar";const cC=f.forwardRef(({className:t,onClick:n,...a},o)=>{const{toggleSidebar:c}=Wd();return s.jsxs(ue,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:pe("h-7 w-7",t),onClick:l=>{n==null||n(l),c()},...a,children:[s.jsx(HT,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});cC.displayName="SidebarTrigger";const uC=f.forwardRef(({className:t,...n},a)=>{const{toggleSidebar:o}=Wd();return s.jsx("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:pe("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...n})});uC.displayName="SidebarRail";const dC=f.forwardRef(({className:t,...n},a)=>s.jsx("main",{ref:a,className:pe("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...n}));dC.displayName="SidebarInset";const V7=f.forwardRef(({className:t,...n},a)=>s.jsx(_e,{ref:a,"data-sidebar":"input",className:pe("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...n}));V7.displayName="SidebarInput";const fC=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"header",className:pe("flex flex-col gap-2 p-2",t),...n}));fC.displayName="SidebarHeader";const F7=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"footer",className:pe("flex flex-col gap-2 p-2",t),...n}));F7.displayName="SidebarFooter";const Y7=f.forwardRef(({className:t,...n},a)=>s.jsx(Bj,{ref:a,"data-sidebar":"separator",className:pe("mx-2 w-auto bg-sidebar-border",t),...n}));Y7.displayName="SidebarSeparator";const mC=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"content",className:pe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...n}));mC.displayName="SidebarContent";const Nh=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"group",className:pe("relative flex w-full min-w-0 flex-col p-2",t),...n}));Nh.displayName="SidebarGroup";const pC=f.forwardRef(({className:t,asChild:n=!1,...a},o)=>{const c=n?wi:"div";return s.jsx(c,{ref:o,"data-sidebar":"group-label",className:pe("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...a})});pC.displayName="SidebarGroupLabel";const q7=f.forwardRef(({className:t,asChild:n=!1,...a},o)=>{const c=n?wi:"button";return s.jsx(c,{ref:o,"data-sidebar":"group-action",className:pe("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...a})});q7.displayName="SidebarGroupAction";const Eh=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"group-content",className:pe("w-full text-sm",t),...n}));Eh.displayName="SidebarGroupContent";const kh=f.forwardRef(({className:t,...n},a)=>s.jsx("ul",{ref:a,"data-sidebar":"menu",className:pe("flex w-full min-w-0 flex-col gap-1",t),...n}));kh.displayName="SidebarMenu";const Th=f.forwardRef(({className:t,...n},a)=>s.jsx("li",{ref:a,"data-sidebar":"menu-item",className:pe("group/menu-item relative",t),...n}));Th.displayName="SidebarMenuItem";const K7=ji("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Mh=f.forwardRef(({asChild:t=!1,isActive:n=!1,variant:a="default",size:o="default",tooltip:c,className:l,...d},m)=>{const p=t?wi:"button",{isMobile:g,state:b}=Wd(),v=s.jsx(p,{ref:m,"data-sidebar":"menu-button","data-size":o,"data-active":n,className:pe(K7({variant:a,size:o}),l),...d});return c?(typeof c=="string"&&(c={children:c}),s.jsxs(z7,{children:[s.jsx(P7,{asChild:!0,children:v}),s.jsx(sC,{side:"right",align:"center",hidden:b!=="collapsed"||g,...c})]})):v});Mh.displayName="SidebarMenuButton";const W7=f.forwardRef(({className:t,asChild:n=!1,showOnHover:a=!1,...o},c)=>{const l=n?wi:"button";return s.jsx(l,{ref:c,"data-sidebar":"menu-action",className:pe("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...o})});W7.displayName="SidebarMenuAction";const X7=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"menu-badge",className:pe("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...n}));X7.displayName="SidebarMenuBadge";const Z7=f.forwardRef(({className:t,showIcon:n=!1,...a},o)=>{const c=f.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:o,"data-sidebar":"menu-skeleton",className:pe("flex h-8 items-center gap-2 rounded-md px-2",t),...a,children:[n&&s.jsx(Ue,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(Ue,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":c}})]})});Z7.displayName="SidebarMenuSkeleton";const Q7=f.forwardRef(({className:t,...n},a)=>s.jsx("ul",{ref:a,"data-sidebar":"menu-sub",className:pe("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...n}));Q7.displayName="SidebarMenuSub";const J7=f.forwardRef(({...t},n)=>s.jsx("li",{ref:n,...t}));J7.displayName="SidebarMenuSubItem";const eM=f.forwardRef(({asChild:t=!1,size:n="md",isActive:a,className:o,...c},l)=>{const d=t?wi:"a";return s.jsx(d,{ref:l,"data-sidebar":"menu-sub-button","data-size":n,"data-active":a,className:pe("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...c})});eM.displayName="SidebarMenuSubButton";const tM=[],nM=[{label:"Overview",items:[{title:"Dashboard",url:"/",icon:A2,end:!0,permission:"overview"},{title:"Console",url:"/logs",icon:M2,permission:"logs"}]},{label:"Access & Logs",items:[{title:"Users",url:"/users",icon:rh,permission:"users.view"},{title:"Groups",url:"/groups",icon:qu,permission:"users.view"},{title:"Tickets",url:"/tickets",icon:is,permission:"overview"},{title:"Transcripts",url:"/transcripts",icon:Ul,permission:"transcripts"}]},{label:"Configuration",items:[{title:"Bot Settings",url:"/configs?file=supportbot",icon:cg},{title:"Ticket Panel",url:"/configs?file=ticket-panel",icon:is},{title:"AI Assistant",url:"/configs?file=supportbot-ai",icon:og},{title:"Messages",url:"/configs?file=messages",icon:ug},{title:"Staff Roles",url:"/configs?file=supportbot&tab=Roles",icon:rh},{title:"Commands",url:"/configs?file=commands",icon:ds}]},{label:"System",items:[{title:"Addons",url:"/addons",icon:dg,permission:"settings.view"},{title:"Addon Builder",url:"/addons/builder",icon:ds,permission:"settings.update"},{title:"Dashboard Settings",url:"/settings",icon:qs,permission:"settings.view"}]}];function y0(t){return new URL(t,"http://x").searchParams.get("file")}function rM(){const{branding:t}=Ed(),{permissions:n}=Yt(),{stats:a}=kd(),{files:o}=$2(),[c]=wd(),l=c.get("file"),d=sd(n,"supportbot")&&o.length>0?{label:"Addons",items:o.map(C=>({title:H2(C),url:`/configs?file=${_l(C)}`,icon:dg,end:!1}))}:null,m=tM.filter(C=>!C.permission||Rn(n,C.permission)),p=nM.map(C=>({...C,items:C.items.filter(S=>{if(S.permission)return Rn(n,S.permission);const N=y0(S.url);return N&&S.url.includes("/configs")?sd(n,N):!0})})).filter(C=>C.items.length>0),g=d?[...p,d]:p,[b,v]=f.useState(null);f.useEffect(()=>{let C=!1;return Ne.getGuildResources().then(S=>{!C&&S.data&&v(S.data)}).catch(()=>{}),()=>{C=!0}},[]);const w=(b==null?void 0:b.guildName)||(a?`${a.servers} Server${a.servers===1?"":"s"}`:"Connected Guild"),y=b==null?void 0:b.guildIcon;return s.jsxs(lC,{collapsible:"icon",className:"border-r border-sidebar-border",children:[s.jsxs(fC,{className:"gap-3 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 px-1",children:[t.hasFavicon&&t.faviconUrl?s.jsx("img",{src:`${t.faviconUrl}${t.updatedAt?`?v=${t.updatedAt}`:""}`,alt:"",className:"size-7 shrink-0 rounded-md object-contain"}):null,s.jsx("span",{className:"truncate text-lg font-bold tracking-tight",children:t.title})]}),s.jsxs(zg,{children:[s.jsx(Pg,{asChild:!0,children:s.jsxs(ue,{variant:"outline",className:"h-10 w-full justify-between border-border bg-secondary/40 px-3 font-normal hover:bg-secondary/60",children:[s.jsxs("span",{className:"flex items-center gap-2 truncate min-w-0",children:[y?s.jsx("img",{src:y,alt:"",className:"size-5 rounded-full object-cover shrink-0"}):s.jsx("div",{className:"size-5 rounded-full bg-primary/20 text-primary flex items-center justify-center text-[10px] font-bold shrink-0",children:w.charAt(0).toUpperCase()}),s.jsx("span",{className:"truncate text-xs font-semibold text-foreground",children:w})]}),s.jsx(xe,{icon:k2,size:14,className:"text-muted-foreground shrink-0 ml-1"})]})}),s.jsxs(Fd,{className:"w-[--radix-dropdown-menu-trigger-width]",children:[s.jsxs(Vl,{disabled:!0,className:"text-xs font-medium",children:["Connected Guild: ",w]}),a?s.jsxs(Vl,{disabled:!0,className:"text-xs text-muted-foreground",children:[a.users.toLocaleString()," members tracked"]}):null]})]})]}),s.jsxs(mC,{className:"px-2",children:[s.jsx(Nh,{children:s.jsx(Eh,{children:s.jsx(kh,{children:m.map(C=>s.jsx(Th,{children:s.jsx(Mh,{asChild:!0,tooltip:C.title,children:s.jsxs(th,{to:C.url,end:C.end,className:({isActive:S})=>pe(S&&"bg-sidebar-accent font-medium"),children:[s.jsx(xe,{icon:C.icon,size:18}),s.jsx("span",{children:C.title})]})})},C.title))})})}),g.map(C=>s.jsxs(Nh,{children:[s.jsx(pC,{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/80",children:C.label}),s.jsx(Eh,{children:s.jsx(kh,{children:C.items.map(S=>{const N=y0(S.url),E=!!N&&l===N&&S.url.includes("/configs");return s.jsx(Th,{children:s.jsx(Mh,{asChild:!0,tooltip:S.title,children:s.jsxs(th,{to:S.url,end:S.end,className:({isActive:T})=>pe((T||E)&&"bg-sidebar-accent font-medium"),children:[s.jsx(xe,{icon:S.icon,size:18}),s.jsx("span",{children:S.title})]})})},`${C.label}-${S.title}`)})})})]},C.label))]}),s.jsx(uC,{})]})}var w0=1,aM=.9,sM=.8,oM=.17,Pp=.1,Ip=.999,iM=.9999,lM=.99,cM=/[\\\/_+.#"@\[\(\{&]/,uM=/[\\\/_+.#"@\[\(\{&]/g,dM=/[\s-]/,hC=/[\s-]/g;function Rh(t,n,a,o,c,l,d){if(l===n.length)return c===t.length?w0:lM;var m=`${c},${l}`;if(d[m]!==void 0)return d[m];for(var p=o.charAt(l),g=a.indexOf(p,c),b=0,v,w,y,C;g>=0;)v=Rh(t,n,a,o,g+1,l+1,d),v>b&&(g===c?v*=w0:cM.test(t.charAt(g-1))?(v*=sM,y=t.slice(c,g-1).match(uM),y&&c>0&&(v*=Math.pow(Ip,y.length))):dM.test(t.charAt(g-1))?(v*=aM,C=t.slice(c,g-1).match(hC),C&&c>0&&(v*=Math.pow(Ip,C.length))):(v*=oM,c>0&&(v*=Math.pow(Ip,g-c))),t.charAt(g)!==n.charAt(l)&&(v*=iM)),(v<Pp&&a.charAt(g-1)===o.charAt(l+1)||o.charAt(l+1)===o.charAt(l)&&a.charAt(g-1)!==o.charAt(l))&&(w=Rh(t,n,a,o,g+1,l+2,d),w*Pp>v&&(v=w*Pp)),v>b&&(b=v),g=a.indexOf(p,g+1);return d[m]=b,b}function j0(t){return t.toLowerCase().replace(hC," ")}function fM(t,n,a){return t=a&&a.length>0?`${t+" "+a.join(" ")}`:t,Rh(t,n,j0(t),j0(n),0,0,{})}var Ml='[cmdk-group=""]',Up='[cmdk-group-items=""]',mM='[cmdk-group-heading=""]',gC='[cmdk-item=""]',C0=`${gC}:not([aria-disabled="true"])`,Ah="cmdk-item-select",ni="data-value",pM=(t,n,a)=>fM(t,n,a),xC=f.createContext(void 0),cc=()=>f.useContext(xC),bC=f.createContext(void 0),Wg=()=>f.useContext(bC),vC=f.createContext(void 0),yC=f.forwardRef((t,n)=>{let a=ri(()=>{var D,B;return{search:"",value:(B=(D=t.value)!=null?D:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=ri(()=>new Set),c=ri(()=>new Map),l=ri(()=>new Map),d=ri(()=>new Set),m=wC(t),{label:p,children:g,value:b,onValueChange:v,filter:w,shouldFilter:y,loop:C,disablePointerSelection:S=!1,vimBindings:N=!0,...E}=t,T=nn(),M=nn(),k=nn(),_=f.useRef(null),R=NM();Zs(()=>{if(b!==void 0){let D=b.trim();a.current.value=D,L.emit()}},[b]),Zs(()=>{R(6,ce)},[]);let L=f.useMemo(()=>({subscribe:D=>(d.current.add(D),()=>d.current.delete(D)),snapshot:()=>a.current,setState:(D,B,V)=>{var Z,be,K,ge;if(!Object.is(a.current[D],B)){if(a.current[D]=B,D==="search")q(),I(),R(1,H);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let me=document.getElementById(k);me?me.focus():(Z=document.getElementById(T))==null||Z.focus()}if(R(7,()=>{var me;a.current.selectedItemId=(me=de())==null?void 0:me.id,L.emit()}),V||R(5,ce),((be=m.current)==null?void 0:be.value)!==void 0){let me=B??"";(ge=(K=m.current).onValueChange)==null||ge.call(K,me);return}}L.emit()}},emit:()=>{d.current.forEach(D=>D())}}),[]),ne=f.useMemo(()=>({value:(D,B,V)=>{var Z;B!==((Z=l.current.get(D))==null?void 0:Z.value)&&(l.current.set(D,{value:B,keywords:V}),a.current.filtered.items.set(D,X(B,V)),R(2,()=>{I(),L.emit()}))},item:(D,B)=>(o.current.add(D),B&&(c.current.has(B)?c.current.get(B).add(D):c.current.set(B,new Set([D]))),R(3,()=>{q(),I(),a.current.value||H(),L.emit()}),()=>{l.current.delete(D),o.current.delete(D),a.current.filtered.items.delete(D);let V=de();R(4,()=>{q(),(V==null?void 0:V.getAttribute("id"))===D&&H(),L.emit()})}),group:D=>(c.current.has(D)||c.current.set(D,new Set),()=>{l.current.delete(D),c.current.delete(D)}),filter:()=>m.current.shouldFilter,label:p||t["aria-label"],getDisablePointerSelection:()=>m.current.disablePointerSelection,listId:T,inputId:k,labelId:M,listInnerRef:_}),[]);function X(D,B){var V,Z;let be=(Z=(V=m.current)==null?void 0:V.filter)!=null?Z:pM;return D?be(D,a.current.search,B):0}function I(){if(!a.current.search||m.current.shouldFilter===!1)return;let D=a.current.filtered.items,B=[];a.current.filtered.groups.forEach(Z=>{let be=c.current.get(Z),K=0;be.forEach(ge=>{let me=D.get(ge);K=Math.max(me,K)}),B.push([Z,K])});let V=_.current;se().sort((Z,be)=>{var K,ge;let me=Z.getAttribute("id"),$=be.getAttribute("id");return((K=D.get($))!=null?K:0)-((ge=D.get(me))!=null?ge:0)}).forEach(Z=>{let be=Z.closest(Up);be?be.appendChild(Z.parentElement===be?Z:Z.closest(`${Up} > *`)):V.appendChild(Z.parentElement===V?Z:Z.closest(`${Up} > *`))}),B.sort((Z,be)=>be[1]-Z[1]).forEach(Z=>{var be;let K=(be=_.current)==null?void 0:be.querySelector(`${Ml}[${ni}="${encodeURIComponent(Z[0])}"]`);K==null||K.parentElement.appendChild(K)})}function H(){let D=se().find(V=>V.getAttribute("aria-disabled")!=="true"),B=D==null?void 0:D.getAttribute(ni);L.setState("value",B||void 0)}function q(){var D,B,V,Z;if(!a.current.search||m.current.shouldFilter===!1){a.current.filtered.count=o.current.size;return}a.current.filtered.groups=new Set;let be=0;for(let K of o.current){let ge=(B=(D=l.current.get(K))==null?void 0:D.value)!=null?B:"",me=(Z=(V=l.current.get(K))==null?void 0:V.keywords)!=null?Z:[],$=X(ge,me);a.current.filtered.items.set(K,$),$>0&&be++}for(let[K,ge]of c.current)for(let me of ge)if(a.current.filtered.items.get(me)>0){a.current.filtered.groups.add(K);break}a.current.filtered.count=be}function ce(){var D,B,V;let Z=de();Z&&(((D=Z.parentElement)==null?void 0:D.firstChild)===Z&&((V=(B=Z.closest(Ml))==null?void 0:B.querySelector(mM))==null||V.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function de(){var D;return(D=_.current)==null?void 0:D.querySelector(`${gC}[aria-selected="true"]`)}function se(){var D;return Array.from(((D=_.current)==null?void 0:D.querySelectorAll(C0))||[])}function P(D){let B=se()[D];B&&L.setState("value",B.getAttribute(ni))}function W(D){var B;let V=de(),Z=se(),be=Z.findIndex(ge=>ge===V),K=Z[be+D];(B=m.current)!=null&&B.loop&&(K=be+D<0?Z[Z.length-1]:be+D===Z.length?Z[0]:Z[be+D]),K&&L.setState("value",K.getAttribute(ni))}function oe(D){let B=de(),V=B==null?void 0:B.closest(Ml),Z;for(;V&&!Z;)V=D>0?CM(V,Ml):SM(V,Ml),Z=V==null?void 0:V.querySelector(C0);Z?L.setState("value",Z.getAttribute(ni)):W(D)}let ae=()=>P(se().length-1),G=D=>{D.preventDefault(),D.metaKey?ae():D.altKey?oe(1):W(1)},O=D=>{D.preventDefault(),D.metaKey?P(0):D.altKey?oe(-1):W(-1)};return f.createElement(Me.div,{ref:n,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:D=>{var B;(B=E.onKeyDown)==null||B.call(E,D);let V=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||V))switch(D.key){case"n":case"j":{N&&D.ctrlKey&&G(D);break}case"ArrowDown":{G(D);break}case"p":case"k":{N&&D.ctrlKey&&O(D);break}case"ArrowUp":{O(D);break}case"Home":{D.preventDefault(),P(0);break}case"End":{D.preventDefault(),ae();break}case"Enter":{D.preventDefault();let Z=de();if(Z){let be=new Event(Ah);Z.dispatchEvent(be)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:ne.inputId,id:ne.labelId,style:kM},p),Xd(t,D=>f.createElement(bC.Provider,{value:L},f.createElement(xC.Provider,{value:ne},D))))}),hM=f.forwardRef((t,n)=>{var a,o;let c=nn(),l=f.useRef(null),d=f.useContext(vC),m=cc(),p=wC(t),g=(o=(a=p.current)==null?void 0:a.forceMount)!=null?o:d==null?void 0:d.forceMount;Zs(()=>{if(!g)return m.item(c,d==null?void 0:d.id)},[g]);let b=jC(c,l,[t.value,t.children,l],t.keywords),v=Wg(),w=ps(R=>R.value&&R.value===b.current),y=ps(R=>g||m.filter()===!1?!0:R.search?R.filtered.items.get(c)>0:!0);f.useEffect(()=>{let R=l.current;if(!(!R||t.disabled))return R.addEventListener(Ah,C),()=>R.removeEventListener(Ah,C)},[y,t.onSelect,t.disabled]);function C(){var R,L;S(),(L=(R=p.current).onSelect)==null||L.call(R,b.current)}function S(){v.setState("value",b.current,!0)}if(!y)return null;let{disabled:N,value:E,onSelect:T,forceMount:M,keywords:k,..._}=t;return f.createElement(Me.div,{ref:Ks(l,n),..._,id:c,"cmdk-item":"",role:"option","aria-disabled":!!N,"aria-selected":!!w,"data-disabled":!!N,"data-selected":!!w,onPointerMove:N||m.getDisablePointerSelection()?void 0:S,onClick:N?void 0:C},t.children)}),gM=f.forwardRef((t,n)=>{let{heading:a,children:o,forceMount:c,...l}=t,d=nn(),m=f.useRef(null),p=f.useRef(null),g=nn(),b=cc(),v=ps(y=>c||b.filter()===!1?!0:y.search?y.filtered.groups.has(d):!0);Zs(()=>b.group(d),[]),jC(d,m,[t.value,t.heading,p]);let w=f.useMemo(()=>({id:d,forceMount:c}),[c]);return f.createElement(Me.div,{ref:Ks(m,n),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},a&&f.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:g},a),Xd(t,y=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?g:void 0},f.createElement(vC.Provider,{value:w},y))))}),xM=f.forwardRef((t,n)=>{let{alwaysRender:a,...o}=t,c=f.useRef(null),l=ps(d=>!d.search);return!a&&!l?null:f.createElement(Me.div,{ref:Ks(c,n),...o,"cmdk-separator":"",role:"separator"})}),bM=f.forwardRef((t,n)=>{let{onValueChange:a,...o}=t,c=t.value!=null,l=Wg(),d=ps(g=>g.search),m=ps(g=>g.selectedItemId),p=cc();return f.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),f.createElement(Me.input,{ref:n,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":m,id:p.inputId,type:"text",value:c?t.value:d,onChange:g=>{c||l.setState("search",g.target.value),a==null||a(g.target.value)}})}),vM=f.forwardRef((t,n)=>{let{children:a,label:o="Suggestions",...c}=t,l=f.useRef(null),d=f.useRef(null),m=ps(g=>g.selectedItemId),p=cc();return f.useEffect(()=>{if(d.current&&l.current){let g=d.current,b=l.current,v,w=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let y=g.offsetHeight;b.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return w.observe(g),()=>{cancelAnimationFrame(v),w.unobserve(g)}}},[]),f.createElement(Me.div,{ref:Ks(l,n),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":m,"aria-label":o,id:p.listId},Xd(t,g=>f.createElement("div",{ref:Ks(d,p.listInnerRef),"cmdk-list-sizer":""},g)))}),yM=f.forwardRef((t,n)=>{let{open:a,onOpenChange:o,overlayClassName:c,contentClassName:l,container:d,...m}=t;return f.createElement(Bg,{open:a,onOpenChange:o},f.createElement($g,{container:d},f.createElement(oc,{"cmdk-overlay":"",className:c}),f.createElement(ic,{"aria-label":t.label,"cmdk-dialog":"",className:l},f.createElement(yC,{ref:n,...m}))))}),wM=f.forwardRef((t,n)=>ps(a=>a.filtered.count===0)?f.createElement(Me.div,{ref:n,...t,"cmdk-empty":"",role:"presentation"}):null),jM=f.forwardRef((t,n)=>{let{progress:a,children:o,label:c="Loading...",...l}=t;return f.createElement(Me.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},Xd(t,d=>f.createElement("div",{"aria-hidden":!0},d)))}),_n=Object.assign(yC,{List:vM,Item:hM,Input:bM,Group:gM,Separator:xM,Dialog:yM,Empty:wM,Loading:jM});function CM(t,n){let a=t.nextElementSibling;for(;a;){if(a.matches(n))return a;a=a.nextElementSibling}}function SM(t,n){let a=t.previousElementSibling;for(;a;){if(a.matches(n))return a;a=a.previousElementSibling}}function wC(t){let n=f.useRef(t);return Zs(()=>{n.current=t}),n}var Zs=typeof window>"u"?f.useEffect:f.useLayoutEffect;function ri(t){let n=f.useRef();return n.current===void 0&&(n.current=t()),n}function ps(t){let n=Wg(),a=()=>t(n.snapshot());return f.useSyncExternalStore(n.subscribe,a,a)}function jC(t,n,a,o=[]){let c=f.useRef(),l=cc();return Zs(()=>{var d;let m=(()=>{var g;for(let b of a){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(g=b.current.textContent)==null?void 0:g.trim():c.current}})(),p=o.map(g=>g.trim());l.value(t,m,p),(d=n.current)==null||d.setAttribute(ni,m),c.current=m}),c}var NM=()=>{let[t,n]=f.useState(),a=ri(()=>new Map);return Zs(()=>{a.current.forEach(o=>o()),a.current=new Map},[t]),(o,c)=>{a.current.set(o,c),n({})}};function EM(t){let n=t.type;return typeof n=="function"?n(t.props):"render"in n?n.render(t.props):t}function Xd({asChild:t,children:n},a){return t&&f.isValidElement(n)?f.cloneElement(EM(n),{ref:n.ref},a(n.props.children)):a(n)}var kM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Qs=Bg,TM=r7,MM=$g,CC=f.forwardRef(({className:t,...n},a)=>s.jsx(oc,{ref:a,className:pe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n}));CC.displayName=oc.displayName;const hs=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(MM,{children:[s.jsx(CC,{}),s.jsxs(ic,{ref:o,className:pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...a,children:[n,s.jsxs(Fj,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(zj,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hs.displayName=ic.displayName;const gs=({className:t,...n})=>s.jsx("div",{className:pe("flex flex-col space-y-1.5 text-center sm:text-left",t),...n});gs.displayName="DialogHeader";const Js=({className:t,...n})=>s.jsx("div",{className:pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...n});Js.displayName="DialogFooter";const xs=f.forwardRef(({className:t,...n},a)=>s.jsx(Yd,{ref:a,className:pe("text-lg font-semibold leading-none tracking-tight",t),...n}));xs.displayName=Yd.displayName;const bs=f.forwardRef(({className:t,...n},a)=>s.jsx(qd,{ref:a,className:pe("text-sm text-muted-foreground",t),...n}));bs.displayName=qd.displayName;const SC=f.forwardRef(({className:t,...n},a)=>s.jsx(_n,{ref:a,className:pe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n}));SC.displayName=_n.displayName;const RM=f.forwardRef(({className:t,...n},a)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(VT,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(_n.Input,{ref:a,className:pe("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...n})]}));RM.displayName=_n.Input.displayName;const NC=f.forwardRef(({className:t,...n},a)=>s.jsx(_n.List,{ref:a,className:pe("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...n}));NC.displayName=_n.List.displayName;const EC=f.forwardRef((t,n)=>s.jsx(_n.Empty,{ref:n,className:"py-6 text-center text-sm",...t}));EC.displayName=_n.Empty.displayName;const kC=f.forwardRef(({className:t,...n},a)=>s.jsx(_n.Group,{ref:a,className:pe("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...n}));kC.displayName=_n.Group.displayName;const AM=f.forwardRef(({className:t,...n},a)=>s.jsx(_n.Separator,{ref:a,className:pe("-mx-1 h-px bg-border",t),...n}));AM.displayName=_n.Separator.displayName;const TC=f.forwardRef(({className:t,...n},a)=>s.jsx(_n.Item,{ref:a,className:pe("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...n}));TC.displayName=_n.Item.displayName;const _M=[{title:"Info command",fields:[{path:"Info.Title",label:"Title",type:"text"},{path:"Info.Description",label:"Description",type:"textarea"},{path:"Info.Button",label:"Button label",type:"text"},{path:"Info.URL",label:"Button URL",type:"text"},{path:"Info.Colour",label:"Colour",type:"color"}]},{title:"Welcome message",fields:[{path:"Welcome.Enabled",label:"Enabled",type:"boolean"},{path:"Welcome.LayoutStyle",label:"Layout style",type:"select",options:[{value:"modern",label:"Modern (components)"},{value:"classic",label:"Classic embed"}]},{path:"Welcome.Embed.Colour",label:"Embed colour",type:"color"},{path:"Welcome.Embed.Title",label:"Embed title",type:"text"},{path:"Welcome.Embed.Message",label:"Embed message",type:"textarea"}]},{title:"Leave message",fields:[{path:"Leave.Enabled",label:"Enabled",type:"boolean"},{path:"Leave.Embed.Colour",label:"Embed colour",type:"color"},{path:"Leave.Embed.Title",label:"Embed title",type:"text"},{path:"Leave.Embed.Message",label:"Embed message",type:"textarea"}]}],DM=[{value:"Playing",label:"Playing"},{value:"Watching",label:"Watching"},{value:"Listening",label:"Listening"},{value:"Competing",label:"Competing"},{value:"Streaming",label:"Streaming"}],OM=[{value:"Channel",label:"Channel"},{value:"Forum",label:"Forum"}],LM=[{value:"channels",label:"Channels"},{value:"threads",label:"Threads"}],zM=[{value:"description",label:"Channel description"},{value:"embed",label:"Embed"}],ei=[{value:"1",label:"Blurple"},{value:"2",label:"Grey"},{value:"3",label:"Green"},{value:"4",label:"Red"}],PM=[{title:"General",fields:[{path:"General.Name",label:"Bot name",type:"text"},{path:"General.Token",label:"Bot token",type:"secret",description:"Masked in the dashboard. Your real token is preserved on save."},{path:"General.GuildId",label:"Server (guild) ID",type:"discordId",description:"Right-click your Discord server icon → Copy Server ID. The bot should only stay in this server.",placeholder:"Discord server snowflake ID"},{path:"General.Addons.Enabled",label:"Addons enabled",type:"boolean"}]},{title:"Database",fields:[{path:"Database.Driver",label:"Database Engine",type:"select",options:[{value:"sqlite",label:"SQLite (Local File)"},{value:"mysql",label:"MySQL / MariaDB"}],description:"Select SQLite for zero-config file storage, or MySQL for external host servers."},{path:"Database.MySQL.Host",label:"MySQL Host",type:"text",placeholder:"127.0.0.1 or localhost",description:"Hostname or IP address of your MySQL database server."},{path:"Database.MySQL.Port",label:"MySQL Port",type:"number",placeholder:"3306"},{path:"Database.MySQL.Database",label:"Database Name",type:"text",placeholder:"supportbot"},{path:"Database.MySQL.User",label:"Database User",type:"text",placeholder:"root"},{path:"Database.MySQL.Password",label:"Database Password",type:"secret",placeholder:"••••••••••••"},{path:"Database.MySQL.ConnectionLimit",label:"Connection Pool Limit",type:"number",placeholder:"10",description:"Maximum simultaneous connections in the MySQL pool (default 10)."},{path:"Database.SQLite.File",label:"SQLite Database File Path",type:"text",placeholder:"./Data/supportbot.db"}]},{title:"Activity",fields:[{path:"Activity.Status",label:"Status text",type:"text"},{path:"Activity.Type",label:"Activity type",type:"select",options:DM},{path:"Activity.StreamingURL",label:"Streaming URL",type:"text",description:"Required when type is Streaming."}]},{title:"Embeds",fields:[{path:"Embed.Colours.General",label:"General colour",type:"color"},{path:"Embed.Colours.Success",label:"Success colour",type:"color"},{path:"Embed.Colours.Error",label:"Error colour",type:"color"},{path:"Embed.Colours.Warn",label:"Warn colour",type:"color"},{path:"Embed.Footer",label:"Footer text",type:"text"}]},{title:"Roles",fields:[{path:"Roles.AutoRole.Enabled",label:"Auto role enabled",type:"boolean"},{path:"Roles.AutoRole.Role",label:"Auto role",type:"discordRole"},{path:"Roles.StaffMember.Staff",label:"Staff role",type:"discordRole"},{path:"Roles.StaffMember.Admin",label:"Admin role",type:"discordRole"},{path:"Roles.StaffMember.Moderator",label:"Moderator role",type:"discordRole"},{path:"Roles.Mod.AllowSupportStaff",label:"Allow support staff /mod",type:"boolean"}]},{title:"Welcome & leave",fields:[{path:"Welcome.Enabled",label:"Welcome enabled",type:"boolean"},{path:"Welcome.Channel",label:"Welcome channel",type:"discordChannel"},{path:"Leave.Enabled",label:"Leave enabled",type:"boolean"},{path:"Leave.Channel",label:"Leave channel",type:"discordChannel"}]},{title:"Suggestions",fields:[{path:"Suggestions.Mode",label:"Mode",type:"select",options:OM},{path:"Suggestions.Channel",label:"Suggestions channel",type:"discordChannel"},{path:"Suggestions.ForumChannel",label:"Forum channel",type:"discordChannel"},{path:"Suggestions.UpvoteEmoji",label:"Upvote emoji",type:"emoji"},{path:"Suggestions.DownvoteEmoji",label:"Downvote emoji",type:"emoji"},{path:"Suggestions.OwnSuggestion",label:"Own suggestion votes",type:"boolean"},{path:"Suggestions.ShowUsers",label:"Show users",type:"boolean"},{path:"Suggestions.UpvoteTitle",label:"Upvote button title",type:"text"},{path:"Suggestions.DownvoteTitle",label:"Downvote button title",type:"text"},{path:"Suggestions.Threads.Enabled",label:"Suggestion threads",type:"boolean"},{path:"Suggestions.Threads.Title",label:"Thread title",type:"text"},{path:"Suggestions.Threads.Reason",label:"Thread reason",type:"text"},{path:"Suggestions.Buttons.Upvote",label:"Upvote button style",type:"select",options:ei},{path:"Suggestions.Buttons.Downvote",label:"Downvote button style",type:"select",options:ei},{path:"Suggestions.Buttons.RemoveVote",label:"Remove vote button style",type:"select",options:ei},{path:"Suggestions.Buttons.RemoveVote_Title",label:"Remove vote title",type:"text"},{path:"Suggestions.Tags.Created",label:"Tag: created",type:"text"},{path:"Suggestions.Tags.Considering",label:"Tag: considering",type:"text"},{path:"Suggestions.Tags.Solved",label:"Tag: solved",type:"text"},{path:"Suggestions.Tags.Denied",label:"Tag: denied",type:"text"}]},{title:"Tickets",fields:[{path:"Ticket.TicketType",label:"Ticket type",type:"select",options:LM},{path:"Ticket.UserManagement.DMOnAdd",label:"DM when added to ticket",type:"boolean"},{path:"Ticket.UserManagement.DMOnRemove",label:"DM when removed from ticket",type:"boolean"},{path:"Ticket.UserManagement.DMTranscript",label:"DM transcript on close",type:"boolean"},{path:"Ticket.TicketHome",label:"Ticket home channel",type:"discordChannel"},{path:"Ticket.TicketChannelsCategory",label:"Ticket category",type:"discordCategory"},{path:"Ticket.TicketChannelsCategory2",label:"Overflow ticket category",type:"discordCategory",description:"Used when the first category is full."},{path:"Ticket.TicketArchiveCategory",label:"Archive category",type:"discordCategory"},{path:"Ticket.Channel",label:"Channel prefix",type:"text"},{path:"Ticket.TicketSubject",label:"Ticket subject display",type:"select",options:zM},{path:"Ticket.Timeout",label:"Close timeout (minutes)",type:"number"},{path:"Ticket.TicketsPerUser",label:"Tickets per user",type:"number"},{path:"Ticket.TicketReason",label:"Require reason",type:"boolean"},{path:"Ticket.Close.StaffOnly",label:"Close staff only",type:"boolean"},{path:"Ticket.Invites.StaffOnly",label:"Ticket invites staff only",type:"boolean"},{path:"Ticket.ClaimTickets.Enabled",label:"Claim tickets",type:"boolean"},{path:"Ticket.ClaimTickets.Channel",label:"Claim log channel",type:"discordChannel"},{path:"Ticket.ClaimTickets.ClaimAcceptTime",label:"Claim accept time (ms)",type:"number"},{path:"Ticket.ClaimTickets.ButtonTitle",label:"Claim button title",type:"text"},{path:"Ticket.ClaimTickets.ButtonEmoji",label:"Claim button emoji",type:"emoji"},{path:"Ticket.ClaimTickets.Button",label:"Claim button style",type:"select",options:ei},{path:"Ticket.ReviewSystem.Enabled",label:"Review system",type:"boolean"},{path:"Ticket.ReviewSystem.Channel",label:"Review channel",type:"discordChannel"},{path:"Ticket.ReviewSystem.UseModal",label:"Review uses modal",type:"boolean"},{path:"Ticket.Log.TicketDataLog",label:"Ticket data log channel",type:"discordChannel"},{path:"Ticket.Log.TickeDataTitle",label:"Ticket data log title",type:"text"},{path:"Ticket.Log.TicketBlacklistLog",label:"Blacklist log channel",type:"discordChannel"},{path:"Ticket.AIMode.Enabled",label:"AI mode in tickets",type:"boolean"},{path:"Ticket.AIMode.ThreadName",label:"AI thread name",type:"text"},{path:"Ticket.AIMode.WelcomeMessage",label:"AI welcome message",type:"textarea"},{path:"Ticket.Questions.Enabled",label:"Ticket questions",type:"boolean"},{path:"Ticket.Questions.List",label:"Default questions",type:"stringList"}]},{title:"Ticket Departments",description:"Configure ticket department channels, emojis, staff roles, and custom department questions.",fields:[{path:"Ticket.DepartmentSystem.Enabled",label:"Departments enabled",type:"boolean"},{path:"Ticket.DepartmentSystem.Placeholder",label:"Department placeholder",type:"text"},{path:"Ticket.DepartmentSystem.DefaultDepartment",label:"Default department key",type:"text"}]},{title:"Ticket Priorities",description:"Configure ticket priority levels and emojis.",fields:[{path:"Ticket.PrioritySystem.Enabled",label:"Priority system",type:"boolean"},{path:"Ticket.PrioritySystem.DefaultPriority",label:"Default priority",type:"text"},{path:"Ticket.PrioritySystem.AllowUsersToChooseOnOpen",label:"User picks priority on open",type:"boolean"}]},{title:"Voice tickets",fields:[{path:"VoiceTickets.Name",label:"VC name format",type:"text"},{path:"VoiceTickets.Category",label:"VC category",type:"discordCategory"}]},{title:"Logging",fields:[{path:"MessageDelete.Channel",label:"Message delete log channel",type:"discordChannel"},{path:"MessageDelete.Colour",label:"Message delete embed colour",type:"color"},{path:"MessageUpdate.Channel",label:"Message update log channel",type:"discordChannel"},{path:"MessageUpdate.Colour",label:"Message update embed colour",type:"color"},{path:"Translate.TranslateLog",label:"Translate log channel",type:"discordChannel"}]},{title:"Buttons & menus",description:"Ticket panel and control button labels and styles.",fields:[{path:"Buttons.General.Delete",label:"Delete emoji",type:"emoji"},{path:"Buttons.General.DeleteStyle",label:"Delete button style",type:"select",options:ei},{path:"Buttons.Voice.TicketDeleteText",label:"Voice delete label",type:"text"},{path:"Buttons.Tickets.ClaimEmoji",label:"Ticket claim emoji",type:"emoji"},{path:"Buttons.Tickets.ClaimStyle",label:"Ticket claim style",type:"select",options:ei},{path:"SelectMenus.Tickets.PanelEmoji",label:"Panel menu emoji",type:"emoji"},{path:"SelectMenus.Tickets.CloseEmoji",label:"Close menu emoji",type:"emoji"}]}],IM=[{value:"openai",label:"OpenAI"},{value:"groq",label:"Groq"},{value:"claude",label:"Claude"}],UM=[{value:"text",label:"Plain text"},{value:"embed",label:"Embed"},{value:"components_v2",label:"Components v2"}],BM=[{value:"channel",label:"Per channel"},{value:"guild",label:"Per server"}],$M=[{title:"General",fields:[{path:"Enabled",label:"AI enabled",type:"boolean"},{path:"General.Provider",label:"Provider",type:"select",options:IM},{path:"General.Model",label:"Model",type:"text"},{path:"General.Model_API_Key",label:"API key",type:"secret",placeholder:"MODEL_API_KEY"},{path:"General.Tokens",label:"Max tokens",type:"number"},{path:"General.Temperature",label:"Temperature",type:"number"},{path:"General.Name",label:"Display name",type:"text"},{path:"General.PastebinAPI_Key",label:"Pastebin API key",type:"secret",placeholder:"PASTEBIN_API_KEY"},{path:"General.PastebinAPI_URL",label:"Pastebin API URL",type:"text"}]},{title:"Style & channel",fields:[{path:"Style.MessageType",label:"Message type",type:"select",options:UM},{path:"Features.SuggestTickets",label:"Suggest tickets",type:"boolean"},{path:"Channels.AIChannel",label:"AI channel ID",type:"discordId"},{path:"Embed.Color",label:"Embed colour",type:"color"},{path:"Embed.Footer",label:"Embed footer",type:"text"}]},{title:"Memory",fields:[{path:"Memory.Enabled",label:"Memory enabled",type:"boolean"},{path:"Memory.StoreFacts",label:"Store facts",type:"boolean"},{path:"Memory.StoreSummaries",label:"Store summaries",type:"boolean"},{path:"Memory.MaxRecentMessages",label:"Max recent messages",type:"number"},{path:"Memory.Scope",label:"Memory scope",type:"select",options:BM}]},{title:"Custom instructions",fields:[{path:"CustomInstructions",label:"Instruction lines",type:"stringList",description:"One instruction per line sent to the AI."}]},{title:"Messages",fields:[{path:"Messages.ErrorResponse",label:"Error response",type:"text"},{path:"Messages.AIError",label:"AI error",type:"text"},{path:"Messages.AIDisabled",label:"AI disabled",type:"text"},{path:"Messages.MessageTooLong",label:"Message too long",type:"text"},{path:"Messages.SuggestTicketText",label:"Suggest ticket text",type:"text"},{path:"Messages.SuggestTicketReaction",label:"Suggest ticket emoji",type:"emoji"}]}],HM=[{value:"1",label:"Blurple"},{value:"2",label:"Grey"},{value:"3",label:"Green"},{value:"4",label:"Red"}],GM=[{value:"1",label:"Style 1"},{value:"2",label:"Style 2"},{value:"3",label:"Style 3"},{value:"4",label:"Style 4 (classic embed)"}],VM=[{title:"Panel",fields:[{path:"Panel",label:"Panel enabled",type:"boolean"}]},{title:"Embed style",fields:[{path:"Style.Title",label:"Title",type:"text"},{path:"Style.Description",label:"Description",type:"textarea"},{path:"Style.Image",label:"Image URL",type:"text"},{path:"Style.Color",label:"Embed colour",type:"color"},{path:"Style.Layout",label:"Layout",type:"select",options:GM}]},{title:"Create button",fields:[{path:"Button.Text",label:"Button text",type:"text"},{path:"Button.Emoji",label:"Button emoji",type:"emoji"},{path:"Button.Color",label:"Button style",type:"select",options:HM},{path:"Button.CustomId",label:"Custom ID",type:"text"}]},{title:"Department menu",fields:[{path:"DepartmentMenu.CustomId",label:"Custom ID",type:"text"},{path:"DepartmentMenu.Placeholder",label:"Placeholder",type:"text"},{path:"DepartmentMenu.DefaultDescription",label:"Default description",type:"text"},{path:"DepartmentMenu.DefaultEmoji",label:"Default emoji",type:"emoji"}]},{title:"Panel settings",fields:[{path:"Settings.Image",label:"Show image",type:"boolean"},{path:"Settings.TopTitle",label:"Top title",type:"boolean"},{path:"Settings.TopDivider",label:"Top divider",type:"boolean"},{path:"Settings.BottomTitle",label:"Bottom title",type:"boolean"},{path:"Settings.BottomDivider",label:"Bottom divider",type:"boolean"}]},{title:"Messages",description:"Bot messages when using the ticket panel command.",fields:[{path:"Messages.NotConfigured",label:"Not configured",type:"textarea"},{path:"Messages.InvalidChannel",label:"Invalid channel",type:"textarea"},{path:"Messages.PanelSent",label:"Panel sent",type:"text"},{path:"Messages.PanelSentWithDepartments",label:"Panel sent (departments)",type:"text"},{path:"Messages.SendError",label:"Send error",type:"text"}]}],_h={supportbot:PM,"ticket-panel":VM,commands:"commands",messages:_M,"supportbot-ai":$M};function FM(t){return t in _h?_h[t]:null}const ai=[{id:"tickets",title:"Ticket panel",description:"Create and manage support tickets with departments, priorities, and AI assistance.",icon:is,href:"/configs?file=ticket-panel",category:"tickets"},{id:"supportbot",title:"Core bot settings",description:"General bot options, activity status, embed colours, roles, and welcome messages.",icon:qs,href:"/configs?file=supportbot",category:"server"},{id:"transcripts",title:"Ticket transcripts",description:"Browse and preview HTML transcripts saved when tickets are closed.",icon:Ul,href:"/transcripts",category:"tickets"},{id:"suggestions",title:"Suggestions",description:"Configure suggestion channels, voting emojis, and forum thread behaviour.",icon:ug,href:"/configs?file=messages",category:"community"},{id:"ai",title:"AI assistant",description:"SupportBot AI mode settings for in-ticket conversational help.",icon:og,href:"/configs?file=supportbot-ai",category:"community"},{id:"commands",title:"Commands",description:"Enable or disable slash commands and customise command permissions.",icon:ds,href:"/configs?file=commands",category:"server"}],YM=[{id:"all",label:"All modules"},{id:"tickets",label:"Tickets"},{id:"community",label:"Community"},{id:"server",label:"Server"}],qM={supportbot:"Bot config","ticket-panel":"Ticket panel",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"},KM=[{key:"Help",label:"Help",description:"List all slash commands"},{key:"Info",label:"Info",description:"Server information"},{key:"TicketPanel",label:"Ticket panel",description:"Create ticket panel"},{key:"OpenTicket",label:"Open ticket",description:"Open a support ticket"},{key:"CloseTicket",label:"Close ticket",description:"Close a ticket"},{key:"TicketManage",label:"Manage ticket",description:"Manage an existing ticket"},{key:"Suggestion",label:"Suggestion",description:"Submit a suggestion"},{key:"Embed",label:"Embed",description:"Send an embed message"},{key:"Translate",label:"Translate",description:"Translate text"},{key:"Ping",label:"Ping",description:"Check bot latency"},{key:"AI",label:"AI",description:"AI assistant command"},{key:"Settings",label:"Settings command",description:"Bot settings via Discord"},{key:"Mod",label:"Moderation",description:"Moderation tools"}];function WM(t,n,a){const o=qM[t];for(const c of n)for(const l of c.fields)a.push({id:`setting:${t}:${l.path}`,title:l.label,subtitle:`${o} · ${c.title}`,href:`/configs?file=${t}`,category:"setting",icon:XM(t),keywords:[l.path,l.label,c.title,o,t,l.description??"",l.type].map(d=>d.toLowerCase())})}function XM(t){switch(t){case"supportbot":return qs;case"ticket-panel":return is;case"messages":return ug;case"supportbot-ai":return og;case"commands":return ds;default:return qs}}function ZM(){const t=[{id:"page:dashboard",title:"Dashboard",subtitle:"Overview and module status",href:"/",category:"page",icon:A2,keywords:["home","overview","stats"]},{id:"page:logs",title:"Logs",subtitle:"Live bot console output",href:"/logs",category:"page",icon:M2,keywords:["console","output","errors","warn"]},{id:"page:settings",title:"Settings",subtitle:"Updates and maintenance",href:"/settings",category:"page",icon:qs,keywords:["update","version","software"]},{id:"page:transcripts",title:"Transcripts",subtitle:"Closed ticket transcripts",href:"/transcripts",category:"page",icon:Ul,keywords:["tickets","archive","html"]}];for(const n of ai)t.push({id:`module:${n.id}`,title:n.title,subtitle:n.description,href:n.href,category:"module",icon:n.icon,keywords:[n.id,n.title,n.description,n.category].map(a=>a.toLowerCase())});for(const[n,a]of Object.entries(_h))a!=="commands"&&WM(n,a,t);for(const n of KM)t.push({id:`command:${n.key}`,title:n.label,subtitle:`Command · ${n.description}`,href:"/configs?file=commands",category:"command",icon:ds,keywords:[n.key,n.label,n.description,"slash","commands"].map(a=>a.toLowerCase())});return t.push({id:"setting:commands:all",title:"Slash commands",subtitle:"Commands · Enable and configure all commands",href:"/configs?file=commands",category:"setting",icon:ds,keywords:["commands","slash","enable","permissions"]}),t}const QM=ZM(),JM={page:"Pages",module:"Modules",setting:"Settings",command:"Commands"};function eR(t,n=12){const a=t.trim().toLowerCase();return a?QM.map(c=>{let l=0;const d=c.title.toLowerCase(),m=(c.subtitle??"").toLowerCase();d===a?l+=100:d.startsWith(a)?l+=40:d.includes(a)&&(l+=20),m.includes(a)&&(l+=10);for(const p of c.keywords)p===a?l+=15:p.startsWith(a)?l+=8:p.includes(a)&&(l+=4);return{item:c,score:l}}).filter(c=>c.score>0).sort((c,l)=>l.score-c.score).slice(0,n).map(c=>c.item):[]}function tR(t){const n=[],a=["page","module","setting","command"];for(const o of a){const c=t.filter(l=>l.category===o);c.length&&n.push({category:o,label:JM[o],items:c})}return n}function nR({className:t}){const n=ao(),[a,o]=f.useState(""),[c,l]=f.useState(!1),d=f.useRef(null),m=f.useRef(null),p=f.useRef(null),[g,b]=f.useState(null),v=f.useMemo(()=>eR(a,14),[a]),w=f.useMemo(()=>tR(v),[v]),y=c&&a.trim().length>0,C=()=>{const N=p.current;if(!N)return;const E=N.getBoundingClientRect();b({top:E.bottom+6,left:E.left,width:E.width})};f.useLayoutEffect(()=>{if(!y){b(null);return}return C(),window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[y,a]),f.useEffect(()=>{function N(E){var M,k;const T=E.target;(M=d.current)!=null&&M.contains(T)||(k=m.current)!=null&&k.contains(T)||l(!1)}return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),f.useEffect(()=>{function N(E){var T;E.key==="k"&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),(T=p.current)==null||T.focus(),l(!0))}return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[]);function S(N){var E;n(N.href),o(""),l(!1),(E=p.current)==null||E.blur()}return s.jsxs("div",{ref:d,className:pe("relative w-full max-w-sm",t),children:[s.jsx(xe,{icon:vi,size:16,className:"pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-muted-foreground"}),s.jsx(_e,{ref:p,value:a,onChange:N=>{o(N.target.value),l(!0)},onFocus:()=>l(!0),onKeyDown:N=>{var E;N.key==="Escape"&&(l(!1),o(""),(E=p.current)==null||E.blur())},placeholder:"Search modules, configs…",className:"h-9 border-border bg-secondary/50 pl-9",role:"combobox","aria-expanded":y,"aria-controls":"dashboard-search-results","aria-autocomplete":"list"}),s.jsxs("kbd",{className:"pointer-events-none absolute right-2 top-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100 sm:flex",children:[s.jsx("span",{className:"text-xs",children:"⌘"}),"K"]}),y&&g?so.createPortal(s.jsx("div",{ref:m,id:"dashboard-search-results",className:"overflow-hidden rounded-xl border border-border bg-popover shadow-lg shadow-black/20",style:{position:"fixed",top:g.top,left:g.left,width:g.width,zIndex:9999},role:"listbox",children:s.jsx(SC,{shouldFilter:!1,className:"bg-transparent",children:s.jsx(NC,{className:"max-h-[min(360px,50vh)]",children:v.length===0?s.jsxs(EC,{className:"py-8 text-muted-foreground",children:["No results for “",a.trim(),"”"]}):w.map(N=>s.jsx(kC,{heading:N.label,children:N.items.map(E=>s.jsxs(TC,{value:E.id,onSelect:()=>S(E),className:"cursor-pointer gap-3 rounded-lg py-2.5 aria-selected:bg-accent",children:[E.icon?s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(xe,{icon:E.icon,size:16})}):null,s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate font-medium",children:E.title}),E.subtitle?s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:E.subtitle}):null]})]},E.id))},N.category))})})}),document.body):null]})}var rR=Object.defineProperty,Ta=(t,n)=>rR(t,"name",{value:n,configurable:!0}),MC="Avatar",[aR,HP]=bn(MC),sR=[0,()=>{}],[oR,RC]=aR(MC),AC=f.forwardRef(Ta(function(n,a){const{__scopeAvatar:o,...c}=n,[l,d]=f.useState("idle"),[m,p]=LC();return s.jsx(oR,{scope:o,imageLoadingStatus:l,setImageLoadingStatus:d,imageCount:m,setImageCount:p,children:s.jsx(Me.span,{...c,ref:a})})},"Avatar")),iR="AvatarImage",_C=f.forwardRef(Ta(function(n,a){const{__scopeAvatar:o,src:c,onLoadingStatusChange:l,...d}=n,m=RC(iR,o);m.setImageCount;const p=OC(c,{referrerPolicy:d.referrerPolicy,crossOrigin:d.crossOrigin,loadingStatus:m.imageLoadingStatus,setLoadingStatus:m.setImageLoadingStatus}),g=Vt(v=>{l==null||l(v)}),b=f.useRef(p);return St(()=>{const v=b.current;b.current=p,p!==v&&g(p)},[p,g]),p==="loaded"?s.jsx(Me.img,{...d,ref:a,src:c}):null},"AvatarImage")),lR="AvatarFallback",DC=f.forwardRef(Ta(function(n,a){const{__scopeAvatar:o,delayMs:c,...l}=n,d=RC(lR,o),[m,p]=f.useState(c===void 0);return f.useEffect(()=>{if(c!==void 0){const g=window.setTimeout(()=>p(!0),c);return()=>window.clearTimeout(g)}},[c]),m&&d.imageLoadingStatus!=="loaded"?s.jsx(Me.span,{...l,ref:a}):null},"AvatarFallback"));function OC(t,{loadingStatus:n,setLoadingStatus:a,referrerPolicy:o,crossOrigin:c}){return St(()=>{if(!t){a("error");return}const l=new window.Image,d=Ta(p=>{const g=p.currentTarget;a(Dh(g))},"handleLoad"),m=Ta(()=>a("error"),"handleError");return l.addEventListener("load",d),l.addEventListener("error",m),o&&(l.referrerPolicy=o),l.crossOrigin=c??null,l.src=t,a(Dh(l)),()=>{l.removeEventListener("load",d),l.removeEventListener("error",m),a("idle")}},[t,c,o,a]),n}Ta(OC,"useImageLoadingStatus");function Dh(t){return t.complete?t.naturalWidth>0?"loaded":"error":"loading"}Ta(Dh,"getImageLoadingStatus");function LC(){return sR}Ta(LC,"useImageCount");function cR(t){}Ta(cR,"useUpdateImageCount");const vs=f.forwardRef(({className:t,...n},a)=>s.jsx(AC,{ref:a,className:pe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...n}));vs.displayName=AC.displayName;const eo=f.forwardRef(({className:t,...n},a)=>s.jsx(_C,{ref:a,className:pe("aspect-square h-full w-full",t),...n}));eo.displayName=_C.displayName;const ys=f.forwardRef(({className:t,...n},a)=>s.jsx(DC,{ref:a,className:pe("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...n}));ys.displayName=DC.displayName;const zC=f.createContext(null);function uR({children:t}){const[n,a]=f.useState([]),[o,c]=f.useState(0),[l,d]=f.useState(!0),m=f.useCallback(async()=>{try{const v=await Ne.getNotifications();v.data&&(a(v.data.items),c(v.data.unreadCount))}catch{}finally{d(!1)}},[]),p=f.useCallback(async()=>{var v;try{const w=await Ne.markNotificationsRead("all");a(y=>y.map(C=>({...C,read:!0}))),c(((v=w.data)==null?void 0:v.unreadCount)??0)}catch{}},[]),g=f.useCallback(async v=>{var w;try{const y=await Ne.dismissNotification(v);a(C=>C.filter(S=>S.id!==v)),c(((w=y.data)==null?void 0:w.unreadCount)??0)}catch{}},[]);f.useEffect(()=>{m();const v=setInterval(m,3e4);return()=>clearInterval(v)},[m]);const b=f.useMemo(()=>({items:n,unreadCount:o,loading:l,refresh:m,markAllRead:p,dismiss:g}),[n,o,l,m,p,g]);return s.jsx(zC.Provider,{value:b,children:t})}function dR(){const t=f.useContext(zC);if(!t)throw new Error("useNotifications must be used within NotificationsProvider");return t}const fR=ji("inline-flex items-center rounded-md 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-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Fn({className:t,variant:n,...a}){return s.jsx("div",{className:pe(fR({variant:n}),t),...a})}var mR=Object.defineProperty,pR=(t,n)=>mR(t,"name",{value:n,configurable:!0});function ud(t,[n,a]){return Math.min(a,Math.max(n,t))}pR(ud,"clamp");var hR=Object.defineProperty,Fe=(t,n)=>hR(t,"name",{value:n,configurable:!0});function PC(t,n){return f.useReducer((a,o)=>n[a][o]??a,t)}Fe(PC,"useStateMachine");var IC="ScrollArea",[UC,GP]=bn(IC),[gR,xr]=UC(IC),xR=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,type:c="hover",dir:l,scrollHideDelay:d=600,...m}=n,[p,g]=f.useState(null),[b,v]=f.useState(null),[w,y]=f.useState(null),[C,S]=f.useState(null),[N,E]=f.useState(null),[T,M]=f.useState(0),[k,_]=f.useState(0),[R,L]=f.useState(!1),[ne,X]=f.useState(!1),I=Pe(a,g),H=Si(l);return s.jsx(gR,{scope:o,type:c,dir:H,scrollHideDelay:d,scrollArea:p,viewport:b,onViewportChange:v,content:w,onContentChange:y,scrollbarX:C,onScrollbarXChange:S,scrollbarXEnabled:R,onScrollbarXEnabledChange:L,scrollbarY:N,onScrollbarYChange:E,scrollbarYEnabled:ne,onScrollbarYEnabledChange:X,onCornerWidthChange:M,onCornerHeightChange:_,children:s.jsx(Me.div,{dir:H,...m,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":k+"px",...n.style}})})},"ScrollArea")),bR="ScrollAreaViewport",vR=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,children:c,nonce:l,...d}=n,m=xr(bR,o),p=f.useRef(null),g=Pe(a,p,m.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx(yR,{nonce:l}),s.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...d,ref:g,style:{overflowX:m.scrollbarXEnabled?"scroll":"hidden",overflowY:m.scrollbarYEnabled?"scroll":"hidden",...n.style},children:s.jsx("div",{ref:m.onContentChange,style:{minWidth:"100%",display:"table"},children:c})})]})},"ScrollAreaViewport")),yR=f.memo(Fe(function({nonce:n}){return s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:n})},"ScrollAreaViewportStyle"),(t,n)=>t.nonce===n.nonce),Aa="ScrollAreaScrollbar",BC=f.forwardRef(Fe(function(n,a){const{forceMount:o,...c}=n,l=xr(Aa,n.__scopeScrollArea),{onScrollbarXEnabledChange:d,onScrollbarYEnabledChange:m}=l,p=n.orientation==="horizontal";return f.useEffect(()=>(p?d(!0):m(!0),()=>{p?d(!1):m(!1)}),[p,d,m]),l.type==="hover"?s.jsx(wR,{...c,ref:a,forceMount:o}):l.type==="scroll"?s.jsx(jR,{...c,ref:a,forceMount:o}):l.type==="auto"?s.jsx($C,{...c,ref:a,forceMount:o}):l.type==="always"?s.jsx(Xg,{...c,ref:a,"data-state":"visible"}):null},"ScrollAreaScrollbar")),wR=f.forwardRef(Fe(function(n,a){const{forceMount:o,...c}=n,l=xr(Aa,n.__scopeScrollArea),[d,m]=f.useState(!1);return f.useEffect(()=>{const p=l.scrollArea;let g=0;if(p){const b=Fe(()=>{window.clearTimeout(g),m(!0)},"handlePointerEnter"),v=Fe(()=>{g=window.setTimeout(()=>m(!1),l.scrollHideDelay)},"handlePointerLeave");return p.addEventListener("pointerenter",b),p.addEventListener("pointerleave",v),()=>{window.clearTimeout(g),p.removeEventListener("pointerenter",b),p.removeEventListener("pointerleave",v)}}},[l.scrollArea,l.scrollHideDelay]),s.jsx(fn,{present:o||d,children:s.jsx($C,{"data-state":d?"visible":"hidden",...c,ref:a})})},"ScrollAreaScrollbarHover")),jR=f.forwardRef(Fe(function(n,a){const{forceMount:o,...c}=n,l=xr(Aa,n.__scopeScrollArea),d=n.orientation==="horizontal",m=dc(()=>g("SCROLL_END"),100),[p,g]=PC("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(p==="idle"){const b=window.setTimeout(()=>g("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(b)}},[p,l.scrollHideDelay,g]),f.useEffect(()=>{const b=l.viewport,v=d?"scrollLeft":"scrollTop";if(b){let w=b[v];const y=Fe(()=>{const C=b[v];w!==C&&(g("SCROLL"),m()),w=C},"handleScroll");return b.addEventListener("scroll",y),()=>b.removeEventListener("scroll",y)}},[l.viewport,d,g,m]),s.jsx(fn,{present:o||p!=="hidden",children:s.jsx(Xg,{"data-state":p==="hidden"?"hidden":"visible",...c,ref:a,onPointerEnter:Ce(n.onPointerEnter,()=>g("POINTER_ENTER")),onPointerLeave:Ce(n.onPointerLeave,()=>g("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),$C=f.forwardRef(Fe(function(n,a){const o=xr(Aa,n.__scopeScrollArea),{forceMount:c,...l}=n,[d,m]=f.useState(!1),p=n.orientation==="horizontal",g=dc(()=>{if(o.viewport){const b=o.viewport.offsetWidth<o.viewport.scrollWidth,v=o.viewport.offsetHeight<o.viewport.scrollHeight;m(p?b:v)}},10);return to(o.viewport,g),to(o.content,g),s.jsx(fn,{present:c||d,children:s.jsx(Xg,{"data-state":d?"visible":"hidden",...l,ref:a})})},"ScrollAreaScrollbarAuto")),Xg=f.forwardRef(Fe(function(n,a){const{orientation:o="vertical",...c}=n,l=xr(Aa,n.__scopeScrollArea),d=f.useRef(null),m=f.useRef(0),[p,g]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),b=Zg(p.viewport,p.content),v={...c,sizes:p,onSizesChange:g,hasThumb:b>0&&b<1,onThumbChange:Fe(y=>d.current=y,"onThumbChange"),onThumbPointerUp:Fe(()=>m.current=0,"onThumbPointerUp"),onThumbPointerDown:Fe(y=>m.current=y,"onThumbPointerDown")};function w(y,C){return FC(y,m.current,p,C)}return Fe(w,"getScrollPosition"),o==="horizontal"?s.jsx(CR,{...v,ref:a,onThumbPositionChange:()=>{if(l.viewport&&d.current){const y=l.viewport.scrollLeft,C=Lh(y,p,l.dir);d.current.style.transform=`translate3d(${C}px, 0, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollLeft=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollLeft=w(y,l.dir))}}):o==="vertical"?s.jsx(SR,{...v,ref:a,onThumbPositionChange:()=>{if(l.viewport&&d.current){const y=l.viewport.scrollTop,C=Lh(y,p);d.current.style.transform=`translate3d(0, ${C}px, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollTop=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollTop=w(y))}}):null},"ScrollAreaScrollbarVisible")),CR=f.forwardRef(Fe(function(n,a){const{sizes:o,onSizesChange:c,...l}=n,d=xr(Aa,n.__scopeScrollArea),[m,p]=f.useState(),g=f.useRef(null),b=Pe(a,g,d.onScrollbarXChange);return f.useEffect(()=>{g.current&&p(getComputedStyle(g.current))},[g]),s.jsx(GC,{"data-orientation":"horizontal",...l,ref:b,sizes:o,style:{bottom:0,left:d.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:d.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":uc(o)+"px",...n.style},onThumbPointerDown:v=>n.onThumbPointerDown(v.x),onDragScroll:v=>n.onDragScroll(v.x),onWheelScroll:(v,w)=>{if(d.viewport){const y=d.viewport.scrollLeft+v.deltaX;n.onWheelScroll(y),Jg(y,w)&&v.preventDefault()}},onResize:()=>{g.current&&d.viewport&&m&&c({content:d.viewport.scrollWidth,viewport:d.viewport.offsetWidth,scrollbar:{size:g.current.clientWidth,paddingStart:Kl(m.paddingLeft),paddingEnd:Kl(m.paddingRight)}})}})},"ScrollAreaScrollbarX")),SR=f.forwardRef(Fe(function(n,a){const{sizes:o,onSizesChange:c,...l}=n,d=xr(Aa,n.__scopeScrollArea),[m,p]=f.useState(),g=f.useRef(null),b=Pe(a,g,d.onScrollbarYChange);return f.useEffect(()=>{g.current&&p(getComputedStyle(g.current))},[g]),s.jsx(GC,{"data-orientation":"vertical",...l,ref:b,sizes:o,style:{top:0,right:d.dir==="ltr"?0:void 0,left:d.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":uc(o)+"px",...n.style},onThumbPointerDown:v=>n.onThumbPointerDown(v.y),onDragScroll:v=>n.onDragScroll(v.y),onWheelScroll:(v,w)=>{if(d.viewport){const y=d.viewport.scrollTop+v.deltaY;n.onWheelScroll(y),Jg(y,w)&&v.preventDefault()}},onResize:()=>{g.current&&d.viewport&&m&&c({content:d.viewport.scrollHeight,viewport:d.viewport.offsetHeight,scrollbar:{size:g.current.clientHeight,paddingStart:Kl(m.paddingTop),paddingEnd:Kl(m.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[NR,HC]=UC(Aa),GC=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,sizes:c,hasThumb:l,onThumbChange:d,onThumbPointerUp:m,onThumbPointerDown:p,onThumbPositionChange:g,onDragScroll:b,onWheelScroll:v,onResize:w,...y}=n,C=xr(Aa,o),[S,N]=f.useState(null),E=Pe(a,N),T=f.useRef(null),M=f.useRef(""),k=C.viewport,_=c.content-c.viewport,R=Vt(v),L=Vt(g),ne=dc(w,10);function X(I){if(T.current){const H=I.clientX-T.current.left,q=I.clientY-T.current.top;b({x:H,y:q})}}return Fe(X,"handleDragScroll"),f.useEffect(()=>{const I=Fe(H=>{const q=H.target;(S==null?void 0:S.contains(q))&&R(H,_)},"handleWheel");return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[k,S,_,R]),f.useEffect(L,[c,L]),to(S,ne),to(C.content,ne),s.jsx(NR,{scope:o,scrollbar:S,hasThumb:l,onThumbChange:Vt(d),onThumbPointerUp:Vt(m),onThumbPositionChange:L,onThumbPointerDown:Vt(p),children:s.jsx(Me.div,{...y,ref:E,style:{position:"absolute",...y.style},onPointerDown:Ce(n.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),T.current=S.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C.viewport&&(C.viewport.style.scrollBehavior="auto"),X(I))}),onPointerMove:Ce(n.onPointerMove,X),onPointerUp:Ce(n.onPointerUp,I=>{const H=I.target;H.hasPointerCapture(I.pointerId)&&H.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=M.current,C.viewport&&(C.viewport.style.scrollBehavior=""),T.current=null})})})},"ScrollAreaScrollbarImpl")),Oh="ScrollAreaThumb",ER=f.forwardRef(Fe(function(n,a){const{forceMount:o,...c}=n,l=HC(Oh,n.__scopeScrollArea);return s.jsx(fn,{present:o||l.hasThumb,children:s.jsx(kR,{ref:a,...c})})},"ScrollAreaThumb")),kR=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,style:c,...l}=n,d=xr(Oh,o),m=HC(Oh,o),{onThumbPositionChange:p}=m,g=Pe(a,m.onThumbChange),b=f.useRef(void 0),v=dc(()=>{b.current&&(b.current(),b.current=void 0)},100);return f.useEffect(()=>{const w=d.viewport;if(w){const y=Fe(()=>{if(v(),!b.current){const C=RR(w,p);b.current=C,p()}},"handleScroll");return p(),w.addEventListener("scroll",y),()=>w.removeEventListener("scroll",y)}},[d.viewport,v,p]),s.jsx(Me.div,{"data-state":m.hasThumb?"visible":"hidden",...l,ref:g,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...c},onPointerDownCapture:Ce(n.onPointerDownCapture,w=>{const C=w.target.getBoundingClientRect(),S=w.clientX-C.left,N=w.clientY-C.top;m.onThumbPointerDown({x:S,y:N})}),onPointerUp:Ce(n.onPointerUp,m.onThumbPointerUp)})},"ScrollAreaThumbImpl")),VC="ScrollAreaCorner",TR=f.forwardRef(Fe(function(n,a){const o=xr(VC,n.__scopeScrollArea),c=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&c?s.jsx(MR,{...n,ref:a}):null},"ScrollAreaCorner")),MR=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,...c}=n,l=xr(VC,o),[d,m]=f.useState(0),[p,g]=f.useState(0),b=!!(d&&p),{onCornerWidthChange:v,onCornerHeightChange:w}=l;return to(l.scrollbarX,()=>{var C;const y=((C=l.scrollbarX)==null?void 0:C.offsetHeight)||0;l.onCornerHeightChange(y),g(y)}),to(l.scrollbarY,()=>{var C;const y=((C=l.scrollbarY)==null?void 0:C.offsetWidth)||0;l.onCornerWidthChange(y),m(y)}),f.useEffect(()=>()=>{v(0),w(0)},[v,w]),b?s.jsx(Me.div,{...c,ref:a,style:{width:d,height:p,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null},"ScrollAreaCornerImpl"));function Kl(t){return t?parseInt(t,10):0}Fe(Kl,"toInt");function Zg(t,n){const a=t/n;return isNaN(a)?0:a}Fe(Zg,"getThumbRatio");function uc(t){const n=Zg(t.viewport,t.content),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-a)*n;return Math.max(o,18)}Fe(uc,"getThumbSize");function FC(t,n,a,o="ltr"){const c=uc(a),l=c/2,d=n||l,m=c-d,p=a.scrollbar.paddingStart+d,g=a.scrollbar.size-a.scrollbar.paddingEnd-m,b=a.content-a.viewport,v=o==="ltr"?[0,b]:[b*-1,0];return Qg([p,g],v)(t)}Fe(FC,"getScrollPositionFromPointer");function Lh(t,n,a="ltr"){const o=uc(n),c=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,l=n.scrollbar.size-c,d=n.content-n.viewport,m=l-o,p=a==="ltr"?[0,d]:[d*-1,0],g=ud(t,p);return Qg([0,d],[0,m])(g)}Fe(Lh,"getThumbOffsetFromScroll");function Qg(t,n){return a=>{if(t[0]===t[1]||n[0]===n[1])return n[0];const o=(n[1]-n[0])/(t[1]-t[0]);return n[0]+o*(a-t[0])}}Fe(Qg,"linearScale");function Jg(t,n){return t>0&&t<n}Fe(Jg,"isScrollingWithinScrollbarBounds");var RR=Fe((t,n=()=>{})=>{let a={left:t.scrollLeft,top:t.scrollTop},o=0;return Fe((function c(){const l={left:t.scrollLeft,top:t.scrollTop},d=a.left!==l.left,m=a.top!==l.top;(d||m)&&n(),a=l,o=window.requestAnimationFrame(c)}),"loop")(),()=>window.cancelAnimationFrame(o)},"addUnlinkedScrollListener");function dc(t,n){const a=Vt(t),o=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(o.current),[]),f.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(a,n)},[a,n])}Fe(dc,"useDebounceCallback");function to(t,n){const a=Vt(n);St(()=>{let o=0;if(t){const c=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(a)});return c.observe(t),()=>{window.cancelAnimationFrame(o),c.unobserve(t)}}},[t,a])}Fe(to,"useResizeObserver");var YC=xR,AR=vR,_R=TR;const fc=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(YC,{ref:o,className:pe("relative overflow-hidden",t),...a,children:[s.jsx(AR,{className:"h-full w-full rounded-[inherit]",children:n}),s.jsx(qC,{}),s.jsx(_R,{})]}));fc.displayName=YC.displayName;const qC=f.forwardRef(({className:t,orientation:n="vertical",...a},o)=>s.jsx(BC,{ref:o,orientation:n,className:pe("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2 border-l border-l-transparent p-px",n==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-px",t),...a,children:s.jsx(ER,{className:"relative flex-1 rounded-full bg-[hsl(240_4%_32%)] transition-colors hover:bg-[hsl(240_4%_44%)]"})}));qC.displayName=BC.displayName;function DR(t){const n=Math.floor((Date.now()-t)/1e3);if(n<60)return"Just now";const a=Math.floor(n/60);if(a<60)return`${a}m ago`;const o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function OR(t){switch(t){case"error":return"bg-destructive";case"update":return"bg-amber-500";case"bot":return"bg-emerald-500";default:return"bg-primary"}}function LR(){const t=ao(),{items:n,unreadCount:a,loading:o,markAllRead:c,dismiss:l,refresh:d}=dR(),[m,p]=f.useState(!1),g=v=>{p(v),v&&(d(),a>0&&c())},b=v=>{p(!1),v.href&&t(v.href)};return s.jsxs(zg,{open:m,onOpenChange:g,children:[s.jsx(Pg,{asChild:!0,children:s.jsxs(ue,{variant:"ghost",size:"icon",className:"relative size-9 text-muted-foreground","aria-label":"Notifications",children:[s.jsx(xe,{icon:N8,size:18}),a>0&&s.jsx(Fn,{className:"absolute -right-0.5 -top-0.5 flex size-4 min-w-4 items-center justify-center rounded-full bg-destructive p-0 text-[10px] text-destructive-foreground",children:a>9?"9+":a})]})}),s.jsxs(Fd,{align:"end",className:"w-80 p-0",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[s.jsx(Ig,{className:"p-0 text-sm font-semibold",children:"Notifications"}),n.length>0&&s.jsx(ue,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:()=>void c(),children:"Mark all read"})]}),s.jsx(Fl,{className:"m-0"}),s.jsx(fc,{className:"max-h-[min(360px,50vh)]",children:o&&n.length===0?s.jsx("p",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Loading…"}):n.length===0?s.jsx("p",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No notifications yet. Bot restarts and update checks will appear here."}):s.jsx("ul",{className:"py-1",children:n.map(v=>s.jsxs("li",{className:pe("group flex gap-2 border-b border-border/40 px-3 py-2.5 last:border-0",!v.read&&"bg-primary/5"),children:[s.jsx("span",{className:pe("mt-1.5 size-2 shrink-0 rounded-full",OR(v.type))}),s.jsxs("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>b(v),children:[s.jsx("p",{className:"text-sm font-medium leading-tight",children:v.title}),s.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-2",children:v.message}),s.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground/80",children:DR(v.createdAt)})]}),s.jsx(ue,{variant:"ghost",size:"icon",className:"size-7 shrink-0 opacity-0 group-hover:opacity-100","aria-label":"Dismiss",onClick:w=>{w.stopPropagation(),l(v.id)},children:s.jsx(xe,{icon:ba,size:14})})]},v.id))})}),s.jsx(Fl,{className:"m-0"}),s.jsx("div",{className:"p-2",children:s.jsx(ue,{variant:"ghost",size:"sm",className:"w-full text-xs",asChild:!0,children:s.jsx(en,{to:"/settings",onClick:()=>p(!1),children:"Open settings (updates)"})})})]})]})}var zR=Object.defineProperty,PR=(t,n)=>zR(t,"name",{value:n,configurable:!0});function KC(t){const n=f.useRef({value:t,previous:t});return f.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}PR(KC,"usePrevious");var IR=Object.defineProperty,nt=(t,n)=>IR(t,"name",{value:n,configurable:!0}),UR=[" ","Enter","ArrowUp","ArrowDown"],BR=[" ","Enter"],fi="Select",[Zd,Qd,$R]=Td(fi),[co,VP]=bn(fi,[$R,Cs]),ex=Cs(),[HR,Ss]=co(fi),[GR,VR]=co(fi);function WC(t){const{__scopeSelect:n,children:a,open:o,defaultOpen:c,onOpenChange:l,value:d,defaultValue:m,onValueChange:p,dir:g,name:b,autoComplete:v,disabled:w,required:y,form:C,internal_do_not_use_render:S}=t,N=ex(n),[E,T]=f.useState(null),[M,k]=f.useState(null),[_,R]=f.useState(!1),L=Si(g),[ne,X]=Vr({prop:o,defaultProp:c??!1,onChange:l,caller:fi}),[I,H]=Vr({prop:d,defaultProp:m,onChange:p,caller:fi}),q=f.useRef(null),ce=f.useRef(I);f.useEffect(()=>{const D=C?E==null?void 0:E.ownerDocument.getElementById(C):E==null?void 0:E.form;if(D instanceof HTMLFormElement){const B=nt(()=>H(ce.current),"reset");return D.addEventListener("reset",B),()=>D.removeEventListener("reset",B)}},[C,E,H]);const de=E?!!C||!!E.closest("form"):!0,[se,P]=f.useState(new Set),W=nn(),oe=Array.from(se).map(D=>D.props.value).join(";"),ae=f.useCallback(D=>{P(B=>new Set(B).add(D))},[]),G=f.useCallback(D=>{P(B=>{const V=new Set(B);return V.delete(D),V})},[]),O={required:y,trigger:E,onTriggerChange:T,valueNode:M,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:R,contentId:W,value:I,onValueChange:H,open:ne,onOpenChange:X,dir:L,triggerPointerDownPosRef:q,disabled:w,name:b,autoComplete:v,form:C,nativeOptions:se,nativeSelectKey:oe,isFormControl:de};return s.jsx(zd,{...N,children:s.jsx(HR,{scope:n,...O,children:s.jsx(Zd.Provider,{scope:n,children:s.jsx(GR,{scope:n,onNativeOptionAdd:ae,onNativeOptionRemove:G,children:oS(S)?S(O):a})})})})}nt(WC,"SelectProvider");var FR=nt(t=>{const{__scopeSelect:n,children:a,...o}=t;return s.jsx(WC,{__scopeSelect:n,...o,internal_do_not_use_render:({isFormControl:c})=>s.jsxs(s.Fragment,{children:[a,c?s.jsx(pA,{__scopeSelect:n}):null]})})},"Select"),YR="SelectTrigger",XC=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,disabled:c=!1,...l}=n,d=ex(o),m=Ss(YR,o),p=m.disabled||c,g=Pe(a,m.onTriggerChange),b=Qd(o),v=f.useRef("touch"),[w,y,C]=nx(N=>{const E=b().filter(k=>!k.disabled),T=E.find(k=>k.value===m.value),M=rx(E,N,T);M!==void 0&&m.onValueChange(M.value)}),S=nt(N=>{p||(m.onOpenChange(!0),C()),N&&(m.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})},"handleOpen");return s.jsx(Pd,{asChild:!0,...d,children:s.jsx(Me.button,{type:"button",role:"combobox","aria-controls":m.open?m.contentId:void 0,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:p,"data-disabled":p?"":void 0,"data-placeholder":mc(m.value)?"":void 0,...l,ref:g,onClick:Ce(l.onClick,N=>{N.currentTarget.focus(),v.current!=="mouse"&&S(N)}),onPointerDown:Ce(l.onPointerDown,N=>{v.current=N.pointerType;const E=N.target;E.hasPointerCapture(N.pointerId)&&E.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(S(N),N.preventDefault())}),onKeyDown:Ce(l.onKeyDown,N=>{const E=w.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&y(N.key),!(E&&N.key===" ")&&UR.includes(N.key)&&(S(),N.preventDefault())})})})},"SelectTrigger")),qR="SelectValue",KR=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,className:c,style:l,children:d,placeholder:m="",...p}=n,g=Ss(qR,o),{onValueNodeHasChildrenChange:b}=g,v=d!==void 0,w=Pe(a,g.onValueNodeChange);St(()=>{b(v)},[b,v]);const y=mc(g.value);return s.jsx(Me.span,{...p,asChild:y?!1:p.asChild,ref:w,style:{pointerEvents:"none"},children:s.jsx(f.Fragment,{children:y?m:d},y?"placeholder":"value")})},"SelectValue")),WR=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,children:c,...l}=n;return s.jsx(Me.span,{"aria-hidden":!0,...l,ref:a,children:c||"▼"})},"SelectIcon")),XR="SelectPortal",[ZR,QR]=co(XR,{forceMount:void 0}),JR=nt(t=>{const{__scopeSelect:n,forceMount:a,...o}=t;return s.jsx(ZR,{scope:t.__scopeSelect,forceMount:a,children:s.jsx(rc,{asChild:!0,...o})})},"SelectPortal"),no="SelectContent",ZC=f.forwardRef(nt(function(n,a){const o=QR(no,n.__scopeSelect),{forceMount:c=o.forceMount,...l}=n,d=Ss(no,n.__scopeSelect),[m,p]=f.useState();return St(()=>{p(new DocumentFragment)},[]),s.jsx(fn,{present:c||d.open,children:({present:g})=>g?s.jsx(nA,{...l,ref:a}):s.jsx(eA,{...l,fragment:m})})},"SelectContent")),eA=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,children:c,fragment:l}=n;return l?so.createPortal(s.jsx(QC,{scope:o,children:s.jsx(Zd.Slot,{scope:o,children:s.jsx("div",{ref:a,children:c})})}),l):null},"SelectContentFragment")),Cr=10,[QC,uo]=co(no),tA=Er("SelectContent.RemoveScroll"),nA=f.forwardRef(nt(function(n,a){const{__scopeSelect:o}=n,{position:c="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:d,onPointerDownOutside:m,side:p,sideOffset:g,align:b,alignOffset:v,arrowPadding:w,collisionBoundary:y,collisionPadding:C,sticky:S,hideWhenDetached:N,avoidCollisions:E,...T}=n,M=Ss(no,o),[k,_]=f.useState(null),[R,L]=f.useState(null),ne=Pe(a,_),[X,I]=f.useState(null),[H,q]=f.useState(null),ce=Qd(o),[de,se]=f.useState(!1),P=f.useRef(!1);f.useEffect(()=>{if(k)return $d(k)},[k]),Ni();const W=f.useCallback(ge=>{const[me,...$]=ce().map(Se=>Se.ref.current),[ie]=$.slice(-1),ye=document.activeElement;for(const Se of ge)if(Se===ye||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===me&&R&&(R.scrollTop=0),Se===ie&&R&&(R.scrollTop=R.scrollHeight),Se==null||Se.focus(),document.activeElement!==ye))return},[ce,R]),oe=f.useCallback(()=>W([X,k]),[W,X,k]);f.useEffect(()=>{de&&oe()},[de,oe]);const{onOpenChange:ae,triggerPointerDownPosRef:G}=M;f.useEffect(()=>{if(k){let ge={x:0,y:0};const me=nt(ie=>{var ye,Se;ge={x:Math.abs(Math.round(ie.pageX)-(((ye=G.current)==null?void 0:ye.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((Se=G.current)==null?void 0:Se.y)??0))}},"handlePointerMove"),$=nt(ie=>{ge.x<=10&&ge.y<=10?ie.preventDefault():ie.composedPath().includes(k)||ae(!1),document.removeEventListener("pointermove",me),G.current=null},"handlePointerUp");return G.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",$,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",$,{capture:!0})}}},[k,ae,G]),f.useEffect(()=>{const ge=nt(()=>ae(!1),"close");return window.addEventListener("blur",ge),window.addEventListener("resize",ge),()=>{window.removeEventListener("blur",ge),window.removeEventListener("resize",ge)}},[ae]);const[O,D]=nx(ge=>{const me=ce().filter(ye=>!ye.disabled),$=me.find(ye=>ye.ref.current===document.activeElement),ie=rx(me,ge,$);ie&&setTimeout(()=>{var ye;return(ye=ie.ref.current)==null?void 0:ye.focus()})}),B=f.useCallback((ge,me,$)=>{const ie=!P.current&&!$;(M.value!==void 0&&M.value===me||ie)&&(I(ge),ie&&(P.current=!0))},[M.value]),V=f.useCallback(()=>k==null?void 0:k.focus(),[k]),Z=f.useCallback((ge,me,$)=>{const ie=!P.current&&!$;(M.value!==void 0&&M.value===me||ie)&&q(ge)},[M.value]),be=c==="popper"?S0:rA,K=be===S0?{side:p,sideOffset:g,align:b,alignOffset:v,arrowPadding:w,collisionBoundary:y,collisionPadding:C,sticky:S,hideWhenDetached:N,avoidCollisions:E}:{};return s.jsx(QC,{scope:o,content:k,viewport:R,onViewportChange:L,itemRefCallback:B,selectedItem:X,onItemLeave:V,itemTextRefCallback:Z,focusSelectedItem:oe,selectedItemText:H,position:c,isPositioned:de,searchRef:O,children:s.jsx(ac,{as:tA,allowPinchZoom:!0,children:s.jsx(Md,{asChild:!0,trapped:M.open,onMountAutoFocus:ge=>{ge.preventDefault()},onUnmountAutoFocus:Ce(l,ge=>{var me;(me=M.trigger)==null||me.focus({preventScroll:!0}),ge.preventDefault()}),children:s.jsx(nc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:ge=>ge.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:s.jsx(be,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:ge=>ge.preventDefault(),...T,...K,onPlaced:()=>se(!0),ref:ne,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Ce(T.onKeyDown,ge=>{const me=ge.ctrlKey||ge.altKey||ge.metaKey;if(ge.key==="Tab"&&ge.preventDefault(),!me&&ge.key.length===1&&D(ge.key),["ArrowUp","ArrowDown","Home","End"].includes(ge.key)){let ie=ce().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(ge.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(ge.key)){const ye=ge.target,Se=ie.indexOf(ye);ie=ie.slice(Se+1)}setTimeout(()=>W(ie)),ge.preventDefault()}})})})})})})},"SelectContentImpl")),rA=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,onPlaced:c,...l}=n,d=Ss(no,o),m=uo(no,o),[p,g]=f.useState(null),[b,v]=f.useState(null),w=Pe(a,v),y=Qd(o),C=f.useRef(!1),S=f.useRef(!0),{viewport:N,selectedItem:E,selectedItemText:T,focusSelectedItem:M}=m,k=f.useCallback(()=>{if(d.trigger&&d.valueNode&&p&&b&&N&&E&&T){const ne=d.trigger.getBoundingClientRect(),X=b.getBoundingClientRect(),I=d.valueNode.getBoundingClientRect(),H=T.getBoundingClientRect();if(d.dir!=="rtl"){const ye=H.left-X.left,Se=I.left-ye,Be=ne.left-Se,Ke=ne.width+Be,We=Math.max(Ke,X.width),qt=window.innerWidth-Cr,vn=ud(Se,[Cr,Math.max(Cr,qt-We)]);p.style.minWidth=Ke+"px",p.style.left=vn+"px"}else{const ye=X.right-H.right,Se=window.innerWidth-I.right-ye,Be=window.innerWidth-ne.right-Se,Ke=ne.width+Be,We=Math.max(Ke,X.width),qt=window.innerWidth-Cr,vn=ud(Se,[Cr,Math.max(Cr,qt-We)]);p.style.minWidth=Ke+"px",p.style.right=vn+"px"}const q=y(),ce=window.innerHeight-Cr*2,de=N.scrollHeight,se=window.getComputedStyle(b),P=parseInt(se.borderTopWidth,10),W=parseInt(se.paddingTop,10),oe=parseInt(se.borderBottomWidth,10),ae=parseInt(se.paddingBottom,10),G=P+W+de+ae+oe,O=Math.min(E.offsetHeight*5,G),D=window.getComputedStyle(N),B=parseInt(D.paddingTop,10),V=parseInt(D.paddingBottom,10),Z=ne.top+ne.height/2-Cr,be=ce-Z,K=E.offsetHeight/2,ge=E.offsetTop+K,me=P+W+ge,$=G-me;if(me<=Z){const ye=q.length>0&&E===q[q.length-1].ref.current;p.style.bottom="0px";const Se=b.clientHeight-N.offsetTop-N.offsetHeight,Be=Math.max(be,K+(ye?V:0)+Se+oe),Ke=me+Be;p.style.height=Ke+"px"}else{const ye=q.length>0&&E===q[0].ref.current;p.style.top="0px";const Be=Math.max(Z,P+N.offsetTop+(ye?B:0)+K)+$;p.style.height=Be+"px",N.scrollTop=me-Z+N.offsetTop}p.style.margin=`${Cr}px 0`,p.style.minHeight=O+"px",p.style.maxHeight=ce+"px",c==null||c(),requestAnimationFrame(()=>C.current=!0)}},[y,d.trigger,d.valueNode,p,b,N,E,T,d.dir,c]);St(()=>k(),[k]);const[_,R]=f.useState();St(()=>{b&&R(window.getComputedStyle(b).zIndex)},[b]);const L=f.useCallback(ne=>{ne&&S.current===!0&&(k(),M==null||M(),S.current=!1)},[k,M]);return s.jsx(aA,{scope:o,contentWrapper:p,shouldExpandOnScrollRef:C,onScrollButtonChange:L,children:s.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:s.jsx(Me.div,{...l,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),S0=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,align:c="start",collisionPadding:l=Cr,...d}=n,m=ex(o);return s.jsx(Id,{...m,...d,ref:a,align:c,collisionPadding:l,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[aA,tx]=co(no,{}),N0="SelectViewport",sA=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,nonce:c,...l}=n,d=uo(N0,o),m=tx(N0,o),p=Pe(a,d.onViewportChange),g=f.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),s.jsx(Zd.Slot,{scope:o,children:s.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:p,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ce(l.onScroll,b=>{const v=b.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:y}=m;if(y!=null&&y.current&&w){const C=Math.abs(g.current-v.scrollTop);if(C>0){const S=window.innerHeight-Cr*2,N=parseFloat(w.style.minHeight),E=parseFloat(w.style.height),T=Math.max(N,E);if(T<S){const M=T+C,k=Math.min(S,M),_=M-k;w.style.height=k+"px",w.style.bottom==="0px"&&(v.scrollTop=_>0?_:0,w.style.justifyContent="flex-end")}}}g.current=v.scrollTop})})})]})},"SelectViewport")),oA="SelectGroup",[FP,iA]=co(oA),lA="SelectLabel",JC=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,...c}=n,l=iA(lA,o);return s.jsx(Me.div,{id:l.id,...c,ref:a})},"SelectLabel")),zh="SelectItem",[cA,eS]=co(zh),tS=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,value:c,disabled:l=!1,textValue:d,...m}=n,p=Ss(zh,o),g=uo(zh,o),b=p.value===c,[v,w]=f.useState(d??""),[y,C]=f.useState(!1),S=Vt(k=>{var _;return(_=g.itemRefCallback)==null?void 0:_.call(g,k,c,l)}),N=Pe(a,S),E=nn(),T=f.useRef("touch"),M=nt(()=>{l||(p.onValueChange(c),p.onOpenChange(!1))},"handleSelect");return s.jsx(cA,{scope:o,value:c,disabled:l,textId:E,isSelected:b,onItemTextChange:f.useCallback(k=>{w(_=>_||((k==null?void 0:k.textContent)??"").trim())},[]),children:s.jsx(Zd.ItemSlot,{scope:o,value:c,disabled:l,textValue:v,children:s.jsx(Me.div,{role:"option","aria-labelledby":E,"data-highlighted":y?"":void 0,"aria-selected":b&&y,"data-state":b?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...m,ref:N,onFocus:Ce(m.onFocus,()=>C(!0)),onBlur:Ce(m.onBlur,()=>C(!1)),onClick:Ce(m.onClick,()=>{T.current!=="mouse"&&M()}),onPointerUp:Ce(m.onPointerUp,()=>{T.current==="mouse"&&M()}),onPointerDown:Ce(m.onPointerDown,k=>{T.current=k.pointerType}),onPointerMove:Ce(m.onPointerMove,k=>{var _;T.current=k.pointerType,l?(_=g.onItemLeave)==null||_.call(g):T.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(m.onPointerLeave,k=>{var _;k.currentTarget===document.activeElement&&((_=g.onItemLeave)==null||_.call(g))}),onKeyDown:Ce(m.onKeyDown,k=>{var R;l||k.target!==k.currentTarget||((R=g.searchRef)==null?void 0:R.current)!==""&&k.key===" "||(BR.includes(k.key)&&M(),k.key===" "&&k.preventDefault())})})})})},"SelectItem")),Pu="SelectItemText",uA=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,className:c,style:l,...d}=n,m=Ss(Pu,o),p=uo(Pu,o),g=eS(Pu,o),b=VR(Pu,o),[v,w]=f.useState(null),y=Vt(M=>{var k;return(k=p.itemTextRefCallback)==null?void 0:k.call(p,M,g.value,g.disabled)}),C=Pe(a,w,g.onItemTextChange,y),S=v==null?void 0:v.textContent,N=f.useMemo(()=>s.jsx("option",{value:g.value,disabled:g.disabled,children:S},g.value),[g.disabled,g.value,S]),{onNativeOptionAdd:E,onNativeOptionRemove:T}=b;return St(()=>(E(N),()=>T(N)),[E,T,N]),s.jsxs(s.Fragment,{children:[s.jsx(Me.span,{id:g.textId,...d,ref:C}),g.isSelected&&m.valueNode&&!m.valueNodeHasChildren&&!mc(m.value)?so.createPortal(d.children,m.valueNode):null]})},"SelectItemText")),dA="SelectItemIndicator",fA=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,...c}=n;return eS(dA,o).isSelected?s.jsx(Me.span,{"aria-hidden":!0,...c,ref:a}):null},"SelectItemIndicator")),E0="SelectScrollUpButton",nS=f.forwardRef(nt(function(n,a){const o=uo(E0,n.__scopeSelect),c=tx(E0,n.__scopeSelect),[l,d]=f.useState(!1),m=Pe(a,c.onScrollButtonChange);return St(()=>{if(o.viewport&&o.isPositioned){let p=function(){const b=g.scrollTop>0;d(b)};nt(p,"handleScroll");const g=o.viewport;return p(),g.addEventListener("scroll",p),()=>g.removeEventListener("scroll",p)}},[o.viewport,o.isPositioned]),l?s.jsx(aS,{...n,ref:m,onAutoScroll:()=>{const{viewport:p,selectedItem:g}=o;p&&g&&(p.scrollTop=p.scrollTop-g.offsetHeight)}}):null},"SelectScrollUpButton")),k0="SelectScrollDownButton",rS=f.forwardRef(nt(function(n,a){const o=uo(k0,n.__scopeSelect),c=tx(k0,n.__scopeSelect),[l,d]=f.useState(!1),m=Pe(a,c.onScrollButtonChange);return St(()=>{if(o.viewport&&o.isPositioned){let p=function(){const b=g.scrollHeight-g.clientHeight,v=Math.ceil(g.scrollTop)<b;d(v)};nt(p,"handleScroll");const g=o.viewport;return p(),g.addEventListener("scroll",p),()=>g.removeEventListener("scroll",p)}},[o.viewport,o.isPositioned]),l?s.jsx(aS,{...n,ref:m,onAutoScroll:()=>{const{viewport:p,selectedItem:g}=o;p&&g&&(p.scrollTop=p.scrollTop+g.offsetHeight)}}):null},"SelectScrollDownButton")),aS=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,onAutoScroll:c,...l}=n,d=uo("SelectScrollButton",o),m=f.useRef(null),p=Qd(o),g=f.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return f.useEffect(()=>()=>g(),[g]),St(()=>{var v;const b=p().find(w=>w.ref.current===document.activeElement);(v=b==null?void 0:b.ref.current)==null||v.scrollIntoView({block:"nearest"})},[p]),s.jsx(Me.div,{"aria-hidden":!0,...l,ref:a,style:{flexShrink:0,...l.style},onPointerDown:Ce(l.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(c,50))}),onPointerMove:Ce(l.onPointerMove,()=>{var b;(b=d.onItemLeave)==null||b.call(d),m.current===null&&(m.current=window.setInterval(c,50))}),onPointerLeave:Ce(l.onPointerLeave,()=>{g()})})},"SelectScrollButtonImpl")),sS=f.forwardRef(nt(function(n,a){const{__scopeSelect:o,...c}=n;return s.jsx(Me.div,{"aria-hidden":!0,...c,ref:a})},"SelectSeparator")),mA="SelectBubbleInput",pA=f.forwardRef(nt(function({__scopeSelect:n,...a},o){const c=Ss(mA,n),{value:l,onValueChange:d,required:m,disabled:p,name:g,autoComplete:b,form:v}=c,{nativeOptions:w,nativeSelectKey:y}=c,C=f.useRef(null),S=Pe(o,C),N=l??"",E=KC(N),T=Array.from(w).some(M=>(M.props.value??"")==="");return f.useEffect(()=>{const M=C.current;if(!M)return;const k=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(k,"value").set;if(E!==N&&R){const L=new Event("change",{bubbles:!0});R.call(M,N),M.dispatchEvent(L)}},[E,N]),s.jsxs(Me.select,{"aria-hidden":!0,required:m,tabIndex:-1,name:g,autoComplete:b,disabled:p,form:v,onChange:M=>d(M.target.value),...a,style:{...Kj,...a.style},ref:S,defaultValue:N,children:[mc(l)&&!T?s.jsx("option",{value:""}):null,Array.from(w)]},y)},"SelectBubbleInput"));function oS(t){return typeof t=="function"}nt(oS,"isFunction");function mc(t){return t===""||t===void 0}nt(mc,"shouldShowPlaceholder");function nx(t){const n=Vt(t),a=f.useRef(""),o=f.useRef(0),c=f.useCallback(d=>{const m=a.current+d;n(m),nt((function p(g){a.current=g,window.clearTimeout(o.current),g!==""&&(o.current=window.setTimeout(()=>p(""),1e3))}),"updateSearch")(m)},[n]),l=f.useCallback(()=>{a.current="",window.clearTimeout(o.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(o.current),[]),[a,c,l]}nt(nx,"useTypeaheadSearch");function rx(t,n,a){const c=n.length>1&&Array.from(n).every(g=>g===n[0])?n[0]:n,l=a?t.indexOf(a):-1;let d=iS(t,Math.max(l,0));c.length===1&&(d=d.filter(g=>g!==a));const p=d.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==a?p:void 0}nt(rx,"findNextItem");function iS(t,n){return t.map((a,o)=>t[(n+o)%t.length])}nt(iS,"wrapArray");const Ca=FR,Sa=KR,Hr=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(XC,{ref:o,className:pe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...a,children:[n,s.jsx(WR,{asChild:!0,children:s.jsx(Lj,{className:"h-4 w-4 opacity-50"})})]}));Hr.displayName=XC.displayName;const lS=f.forwardRef(({className:t,...n},a)=>s.jsx(nS,{ref:a,className:pe("flex cursor-default items-center justify-center py-1",t),...n,children:s.jsx(PT,{className:"h-4 w-4"})}));lS.displayName=nS.displayName;const cS=f.forwardRef(({className:t,...n},a)=>s.jsx(rS,{ref:a,className:pe("flex cursor-default items-center justify-center py-1",t),...n,children:s.jsx(Lj,{className:"h-4 w-4"})}));cS.displayName=rS.displayName;const Gr=f.forwardRef(({className:t,children:n,position:a="popper",...o},c)=>s.jsx(JR,{children:s.jsxs(ZC,{ref:c,className:pe("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 origin-[--radix-select-content-transform-origin]",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...o,children:[s.jsx(lS,{}),s.jsx(sA,{className:pe("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),s.jsx(cS,{})]})}));Gr.displayName=ZC.displayName;const hA=f.forwardRef(({className:t,...n},a)=>s.jsx(JC,{ref:a,className:pe("px-2 py-1.5 text-sm font-semibold",t),...n}));hA.displayName=JC.displayName;const Et=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(tS,{ref:o,className:pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(fA,{children:s.jsx(Oj,{className:"h-4 w-4"})})}),s.jsx(uA,{children:n})]}));Et.displayName=tS.displayName;const gA=f.forwardRef(({className:t,...n},a)=>s.jsx(sS,{ref:a,className:pe("-mx-1 my-1 h-px bg-muted",t),...n}));gA.displayName=sS.displayName;function xA(){const{stats:t}=kd(),{user:n,logout:a,availableGroups:o,isImpersonating:c,impersonatedGroup:l,impersonateGroup:d,stopImpersonation:m,hasPermission:p}=Yt();n!=null&&n.isOwner||p("users.manage");const g=(t==null?void 0:t.bot.username)??"SupportBot",b=n?P2(n):g,v=(n==null?void 0:n.avatar)??(t==null?void 0:t.bot.avatar),w=t==null?void 0:t.bot.inviteUrl,y=new Intl.DateTimeFormat("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"}).format(new Date);return s.jsxs(s.Fragment,{children:[c&&l&&s.jsxs("div",{className:"relative z-50 flex items-center justify-between gap-3 bg-gradient-to-r from-amber-500/10 via-amber-500/15 to-amber-500/10 border-b border-amber-500/30 px-4 py-2 text-xs backdrop-blur-md shadow-sm",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-amber-500/20 text-amber-300 text-[11px] font-bold tracking-wide uppercase border border-amber-500/30",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-amber-400 animate-pulse"}),"Preview Mode"]}),s.jsxs("div",{className:"flex items-center gap-2 text-foreground font-medium",children:[s.jsx("span",{className:"text-muted-foreground",children:"Viewing dashboard as:"}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-md bg-secondary/80 border border-border/80",children:[s.jsx("span",{className:"size-2 rounded-full shrink-0 shadow-sm",style:{backgroundColor:l.color||"#10B981"}}),s.jsx("span",{className:"font-semibold text-xs text-foreground",children:l.name})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[o.length>1&&s.jsxs(Ca,{value:l.id,onValueChange:C=>d(C),children:[s.jsx(Hr,{className:"h-7 text-xs bg-background/80 border-amber-500/30 text-amber-200 focus:ring-amber-500/40 w-[160px]",children:s.jsx(Sa,{})}),s.jsx(Gr,{className:"border-border bg-card",children:o.map(C=>s.jsx(Et,{value:C.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-2 rounded-full shrink-0",style:{backgroundColor:C.color||"#10B981"}}),s.jsx("span",{children:C.name})]})},C.id))})]}),s.jsx(ue,{size:"sm",variant:"outline",className:"h-7 px-3 text-xs bg-card border-amber-500/40 text-amber-300 hover:bg-amber-500/20 hover:text-white transition-all shadow-sm",onClick:m,children:"Exit Preview Mode"})]})]}),s.jsxs("header",{className:"relative z-40 flex h-14 shrink-0 items-center gap-3 border-b border-border bg-card px-4 md:px-6",children:[s.jsx(cC,{className:"-ml-1 text-muted-foreground hover:text-foreground md:hidden"}),s.jsx("p",{className:"hidden shrink-0 text-sm font-medium text-muted-foreground lg:block",children:y}),s.jsx(nR,{className:"min-w-0 flex-1"}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[w?s.jsx(ue,{variant:"ghost",size:"icon",className:"hidden size-9 text-muted-foreground sm:inline-flex",asChild:!0,children:s.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer","aria-label":"Invite bot to a server",title:"Invite bot to a server",children:s.jsx(xe,{icon:nh,size:18})})}):s.jsx(ue,{variant:"ghost",size:"icon",className:"hidden size-9 text-muted-foreground sm:inline-flex",disabled:!0,"aria-label":"Invite bot to a server",title:"Invite link available when the bot is online",children:s.jsx(xe,{icon:nh,size:18})}),s.jsx(LR,{}),s.jsxs(zg,{children:[s.jsx(Pg,{asChild:!0,children:s.jsxs(ue,{variant:"ghost",className:"h-9 gap-2 rounded-full px-2 hover:bg-secondary",children:[s.jsxs(vs,{className:"size-7",children:[s.jsx(eo,{src:v,alt:b}),s.jsx(ys,{className:"bg-primary/20 text-xs text-primary",children:b.slice(0,2).toUpperCase()})]}),s.jsx("span",{className:"hidden max-w-[100px] truncate text-sm font-medium sm:inline",children:b}),s.jsx(xe,{icon:k2,size:16,className:"text-muted-foreground"})]})}),s.jsxs(Fd,{align:"end",className:"w-56",children:[s.jsx(Ig,{children:"Account"}),s.jsx(Fl,{}),n?s.jsxs(Vl,{disabled:!0,className:"text-xs text-muted-foreground",children:[n.username,n.id?` · ${n.id}`:""]}):null,s.jsx(Fl,{}),s.jsx(Vl,{onClick:()=>{a()},children:"Sign out"})]})]})]})]})]})}const T0={error:0,warning:1,info:2};function bA(t){return[...t].sort((n,a)=>{const o=T0[n.severity]??9,c=T0[a.severity]??9;return o!==c?o-c:n.title.localeCompare(a.title)})}function vA(t){const n=new Set;return t.filter(a=>n.has(a.id)?!1:(n.add(a.id),!0))}class yA{constructor(){by(this,"clientProviders",new Map)}register(n){return this.clientProviders.set(n.id,n),this}unregister(n){this.clientProviders.delete(n)}async evaluateClientProviders(){const n=[];for(const a of this.clientProviders.values()){const o=await a.evaluate();Array.isArray(o)&&o.length&&n.push(...o)}return n}async loadAll(){const[n,a]=await Promise.all([Ne.getAlerts().catch(()=>({data:[]})),this.evaluateClientProviders()]),o=n.data??[];return bA(vA([...o,...a]))}}const wA=new yA,jA={error:{border:"border-destructive/40",bg:"bg-destructive/10",icon:"text-destructive",title:"text-destructive"},warning:{border:"border-amber-500/40",bg:"bg-amber-500/10",icon:"text-amber-500",title:"text-amber-200"},info:{border:"border-sky-500/40",bg:"bg-sky-500/10",icon:"text-sky-400",title:"text-sky-100"}},CA=ji("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ye=f.forwardRef(({className:t,variant:n,...a},o)=>s.jsx("div",{ref:o,role:"alert",className:pe(CA({variant:n}),t),...a}));Ye.displayName="Alert";const uS=f.forwardRef(({className:t,...n},a)=>s.jsx("h5",{ref:a,className:pe("mb-1 font-medium leading-none tracking-tight",t),...n}));uS.displayName="AlertTitle";const qe=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("text-sm [&_p]:leading-relaxed",t),...n}));qe.displayName="AlertDescription";function SA(t){return t==="info"?w8:ig}function NA({alert:t,context:n}){var d,m,p;const a=jA[t.severity],o=((d=t.meta)==null?void 0:d.extraGuilds)??[],c=(m=t.meta)==null?void 0:m.status,l=(p=t.meta)==null?void 0:p.progress;return s.jsxs(Ye,{variant:"destructive",className:`${a.border} ${a.bg} text-foreground`,children:[s.jsx(xe,{icon:SA(t.severity),size:18,className:a.icon}),s.jsx(uS,{className:a.title,children:t.title}),s.jsxs(qe,{className:"space-y-3 text-sm text-muted-foreground",children:[s.jsx("p",{children:t.message}),t.category==="guild"&&c==="missing_config"?s.jsxs("p",{children:["Open"," ",s.jsx(en,{to:"/configs?file=supportbot",className:"font-medium text-primary underline-offset-4 hover:underline",children:"Bot config"})," ","and set ",s.jsx("strong",{className:"text-foreground",children:"Server (guild) ID"})," ","(enable Developer Mode in Discord, then right-click your server → Copy Server ID)."]}):null,t.category==="modules"&&l?s.jsxs("p",{className:"text-xs",children:["Progress: ",s.jsx("span",{className:"text-foreground",children:l})]}):null,o.length>0?s.jsx("ul",{className:"space-y-2",children:o.map(g=>s.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border bg-background/40 px-3 py-2",children:[s.jsxs("span",{children:[s.jsx("span",{className:"font-medium text-foreground",children:g.name}),s.jsx("span",{className:"ml-2 font-mono text-xs",children:g.id})]}),n.canLeaveGuild?s.jsxs(ue,{type:"button",size:"sm",variant:"outline",disabled:n.leavingGuildId===g.id,onClick:()=>void n.onLeaveGuild(g.id),children:[s.jsx(xe,{icon:j8,size:14,className:"mr-1.5"}),n.leavingGuildId===g.id?"Leaving…":"Leave server"]}):null]},g.id))}):null,n.actionError?s.jsx("p",{className:"text-destructive",children:n.actionError}):null,s.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[t.action?s.jsx(ue,{asChild:!0,size:"sm",variant:"secondary",children:s.jsx(en,{to:t.action.href,children:t.action.label})}):null,t.category==="guild"?s.jsx("p",{className:"text-xs",children:"The dashboard stays online while you fix this. Some features may be limited until setup is complete."}):null]})]})]})}const EA=15e3;function kA(){const{hasPermission:t}=Yt(),n=t("settings.update"),[a,o]=f.useState([]),[c,l]=f.useState(null),[d,m]=f.useState(""),p=f.useCallback(async()=>{try{const v=await wA.loadAll();o(v),m("")}catch{}},[]);f.useEffect(()=>{p();const v=window.setInterval(()=>void p(),EA);return()=>window.clearInterval(v)},[p]);async function g(v){if(n){l(v),m("");try{await Ne.leaveGuild(v),await p()}catch(w){m(w instanceof Error?w.message:"Could not leave server")}finally{l(null)}}}if(a.length===0)return null;const b={canLeaveGuild:n,onLeaveGuild:g,leavingGuildId:c,actionError:d};return s.jsx("div",{className:"space-y-3",children:a.map(v=>s.jsx(NA,{alert:v,context:b},v.id))})}function TA(){return s.jsx($8,{children:s.jsx(uR,{children:s.jsxs(iC,{children:[s.jsx(rM,{}),s.jsxs(dC,{className:"min-h-svh bg-background",children:[s.jsx(xA,{}),s.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6 lg:p-8",children:[s.jsx(kA,{}),s.jsx(_N,{})]})]})]})})})}const dS=f.createContext(null);function MA({children:t}){const[n,a]=f.useState(null),[o,c]=f.useState(!0),[l,d]=f.useState(""),m=f.useCallback(async()=>{d("");try{const g=await Ne.getSetupStatus();a(g.data??null)}catch(g){d(g instanceof Error?g.message:"Could not load setup status"),a(null)}},[]);f.useEffect(()=>{m().finally(()=>c(!1))},[m]);const p=f.useMemo(()=>({status:n,loading:o,error:l,complete:!!(n!=null&&n.complete),refresh:m}),[n,o,l,m]);return s.jsx(dS.Provider,{value:p,children:t})}function fS(){const t=f.useContext(dS);if(!t)throw new Error("useSetup must be used within SetupProvider");return t}var RA=Object.defineProperty,AA=(t,n)=>RA(t,"name",{value:n,configurable:!0}),_A=f.forwardRef(AA(function(n,a){return s.jsx(Me.label,{...n,ref:a,onMouseDown:o=>{var l;o.target.closest("button, input, select, textarea")||((l=n.onMouseDown)==null||l.call(n,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}})},"Label")),mS=_A;const DA=ji("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ae=f.forwardRef(({className:t,...n},a)=>s.jsx(mS,{ref:a,className:pe(DA(),t),...n}));Ae.displayName=mS.displayName;var OA=Object.defineProperty,ws=(t,n)=>OA(t,"name",{value:n,configurable:!0}),ax="Switch",[LA,YP]=bn(ax),[zA,sx]=LA(ax);function pS(t){const{__scopeSwitch:n,checked:a,children:o,defaultChecked:c,disabled:l,form:d,name:m,onCheckedChange:p,required:g,value:b="on",internal_do_not_use_render:v}=t,[w,y]=Vr({prop:a,defaultProp:c??!1,onChange:p,caller:ax}),[C,S]=f.useState(null),[N,E]=f.useState(null),T=f.useRef(!1),[M,k]=f.useReducer(L=>L+1,0),_=C?!!d||!!C.closest("form"):!0,R={checked:w,setChecked:y,disabled:l,control:C,setControl:S,name:m,form:d,value:b,hasConsumerStoppedPropagationRef:T,userInteractionCount:M,onUserInteraction:k,required:g,defaultChecked:c,isFormControl:_,bubbleInput:N,setBubbleInput:E};return s.jsx(zA,{scope:n,...R,children:gS(v)?v(R):o})}ws(pS,"SwitchProvider");var PA="SwitchTrigger",IA=f.forwardRef(ws(function({__scopeSwitch:n,onClick:a,...o},c){const{control:l,form:d,value:m,disabled:p,checked:g,required:b,setControl:v,setChecked:w,hasConsumerStoppedPropagationRef:y,onUserInteraction:C,isFormControl:S,bubbleInput:N}=sx(PA,n),E=Pe(c,v),T=f.useRef(g);return f.useEffect(()=>{const M=d?l==null?void 0:l.ownerDocument.getElementById(d):l==null?void 0:l.form;if(M instanceof HTMLFormElement){const k=ws(()=>w(T.current),"reset");return M.addEventListener("reset",k),()=>M.removeEventListener("reset",k)}},[l,d,w]),s.jsx(Me.button,{type:"button",role:"switch","aria-checked":g,"aria-required":b,"data-state":ox(g),"data-disabled":p?"":void 0,disabled:p,value:m,...o,ref:E,onClick:Ce(a,M=>{C(),w(k=>!k),N&&S&&(y.current=M.isPropagationStopped(),y.current||M.stopPropagation())})})},"SwitchTrigger")),hS=f.forwardRef(ws(function(n,a){const{__scopeSwitch:o,name:c,checked:l,defaultChecked:d,required:m,disabled:p,value:g,onCheckedChange:b,form:v,...w}=n;return s.jsx(pS,{__scopeSwitch:o,checked:l,defaultChecked:d,disabled:p,required:m,onCheckedChange:b,name:c,form:v,value:g,internal_do_not_use_render:({isFormControl:y})=>s.jsxs(s.Fragment,{children:[s.jsx(IA,{...w,ref:a,__scopeSwitch:o}),y&&s.jsx(HA,{__scopeSwitch:o})]})})},"Switch")),UA="SwitchThumb",BA=f.forwardRef(ws(function(n,a){const{__scopeSwitch:o,...c}=n,l=sx(UA,o);return s.jsx(Me.span,{"data-state":ox(l.checked),"data-disabled":l.disabled?"":void 0,...c,ref:a})},"SwitchThumb")),$A="SwitchBubbleInput",HA=f.forwardRef(ws(function({__scopeSwitch:n,onClick:a,...o},c){const{control:l,hasConsumerStoppedPropagationRef:d,userInteractionCount:m,checked:p,defaultChecked:g,required:b,disabled:v,name:w,value:y,form:C,bubbleInput:S,setBubbleInput:N}=sx($A,n),E=Pe(c,N),T=kg(l),M=f.useRef(!1),k=f.useRef(p),_=f.useRef(m);f.useEffect(()=>{const L=S;if(!L)return;const ne=window.HTMLInputElement.prototype,I=Object.getOwnPropertyDescriptor(ne,"checked").set,H=m!==_.current;_.current=m;const q=k.current!==p;k.current=p;const ce=!(H&&d.current);if(q&&I){M.current=!H;const de=new Event("click",{bubbles:ce});I.call(L,p),L.dispatchEvent(de),M.current=!1}},[S,p,d,m]);const R=f.useRef(p);return s.jsx(Me.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??R.current,required:b,disabled:v,name:w,value:y,form:C,...o,tabIndex:-1,ref:E,onClick:Ce(a,L=>{M.current&&L.stopPropagation()}),style:{...o.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function gS(t){return typeof t=="function"}ws(gS,"isFunction");function ox(t){return t?"checked":"unchecked"}ws(ox,"getState");const Mt=f.forwardRef(({className:t,...n},a)=>s.jsx(hS,{className:pe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...n,ref:a,children:s.jsx(BA,{className:pe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Mt.displayName=hS.displayName;const Jd=f.forwardRef(({className:t,...n},a)=>s.jsx("textarea",{className:pe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:a,...n}));Jd.displayName="Textarea";function ef(){return(ef=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o])}return t}).apply(this,arguments)}function xS(t,n){if(t==null)return{};var a,o,c={},l=Object.keys(t);for(o=0;o<l.length;o++)n.indexOf(a=l[o])>=0||(c[a]=t[a]);return c}function Dl(t){var n=f.useRef(t),a=f.useRef(function(o){n.current&&n.current(o)});return n.current=t,a.current}var Wl=function(t,n,a){return n===void 0&&(n=0),a===void 0&&(a=1),t>a?a:t<n?n:t},Ol=function(t){return"touches"in t},Ph=function(t){return t&&t.ownerDocument.defaultView||self},M0=function(t,n,a){var o=t.getBoundingClientRect(),c=Ol(n)?(function(l,d){for(var m=0;m<l.length;m++)if(l[m].identifier===d)return l[m];return l[0]})(n.touches,a):n;return{left:Wl((c.pageX-(o.left+Ph(t).pageXOffset))/o.width),top:Wl((c.pageY-(o.top+Ph(t).pageYOffset))/o.height)}},R0=function(t){!Ol(t)&&t.preventDefault()},bS=ve.memo(function(t){var n=t.onMove,a=t.onKey,o=t.onEnd,c=xS(t,["onMove","onKey","onEnd"]),l=f.useRef(null),d=Dl(n),m=Dl(a),p=Dl(o),g=f.useRef(null),b=f.useRef(!1),v=f.useMemo(function(){var N=function(M){R0(M),(Ol(M)?M.touches.length>0:M.buttons>0)&&l.current?d(M0(l.current,M,g.current)):(T(!1),p())},E=function(){T(!1),p()};function T(M){var k=b.current,_=Ph(l.current),R=M?_.addEventListener:_.removeEventListener;R(k?"touchmove":"mousemove",N),R(k?"touchend":"mouseup",E)}return[function(M){var k=M.nativeEvent,_=l.current;if(_&&(R0(k),!(function(L,ne){return ne&&!Ol(L)})(k,b.current)&&_)){if(Ol(k)){b.current=!0;var R=k.changedTouches||[];R.length&&(g.current=R[0].identifier)}_.focus(),d(M0(_,k,g.current)),T(!0)}},function(M){var k=M.which||M.keyCode;k<37||k>40||(M.preventDefault(),m({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},function(M){var k=M.which||M.keyCode;k>=37&&k<=40&&p()},T]},[m,d,p]),w=v[0],y=v[1],C=v[2],S=v[3];return f.useEffect(function(){return S},[S]),ve.createElement("div",ef({},c,{onTouchStart:w,onMouseDown:w,className:"react-colorful__interactive",ref:l,onKeyDown:y,onKeyUp:C,tabIndex:0,role:"slider"}))}),ix=function(t){return t.filter(Boolean).join(" ")},vS=function(t){var n=t.color,a=t.left,o=t.top,c=o===void 0?.5:o,l=ix(["react-colorful__pointer",t.className]);return ve.createElement("div",{className:l,style:{top:100*c+"%",left:100*a+"%"}},ve.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:n}}))},dn=function(t,n,a){return n===void 0&&(n=0),a===void 0&&(a=Math.pow(10,n)),Math.round(a*t)/a},GA=function(t){return KA(Ih(t))},Ih=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?dn(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?dn(parseInt(t.substring(6,8),16)/255,2):1}},VA=function(t){return qA(YA(t))},FA=function(t){var n=t.s,a=t.v,o=t.a,c=(200-n)*a/100;return{h:dn(t.h),s:dn(c>0&&c<200?n*a/100/(c<=100?c:200-c)*100:0),l:dn(c/2),a:dn(o,2)}},Uh=function(t){var n=FA(t);return"hsl("+n.h+", "+n.s+"%, "+n.l+"%)"},YA=function(t){var n=t.h,a=t.s,o=t.v,c=t.a;n=n/360*6,a/=100,o/=100;var l=Math.floor(n),d=o*(1-a),m=o*(1-(n-l)*a),p=o*(1-(1-n+l)*a),g=l%6;return{r:dn(255*[o,m,d,d,p,o][g]),g:dn(255*[p,o,o,m,d,d][g]),b:dn(255*[d,d,p,o,o,m][g]),a:dn(c,2)}},Iu=function(t){var n=t.toString(16);return n.length<2?"0"+n:n},qA=function(t){var n=t.r,a=t.g,o=t.b,c=t.a,l=c<1?Iu(dn(255*c)):"";return"#"+Iu(n)+Iu(a)+Iu(o)+l},KA=function(t){var n=t.r,a=t.g,o=t.b,c=t.a,l=Math.max(n,a,o),d=l-Math.min(n,a,o),m=d?l===n?(a-o)/d:l===a?2+(o-n)/d:4+(n-a)/d:0;return{h:dn(60*(m<0?m+6:m)),s:dn(l?d/l*100:0),v:dn(l/255*100),a:c}},WA=ve.memo(function(t){var n=t.hue,a=t.onChange,o=t.onChangeEnd,c=ix(["react-colorful__hue",t.className]);return ve.createElement("div",{className:c},ve.createElement(bS,{onMove:function(l){a({h:360*l.left})},onKey:function(l){a({h:Wl(n+360*l.left,0,360)})},onEnd:o,"aria-label":"Hue","aria-valuenow":dn(n),"aria-valuemax":"360","aria-valuemin":"0"},ve.createElement(vS,{className:"react-colorful__hue-pointer",left:n/360,color:Uh({h:n,s:100,v:100,a:1})})))}),XA=ve.memo(function(t){var n=t.hsva,a=t.onChange,o=t.onChangeEnd,c={backgroundColor:Uh({h:n.h,s:100,v:100,a:1})};return ve.createElement("div",{className:"react-colorful__saturation",style:c},ve.createElement(bS,{onMove:function(l){a({s:100*l.left,v:100-100*l.top})},onKey:function(l){a({s:Wl(n.s+100*l.left,0,100),v:Wl(n.v-100*l.top,0,100)})},onEnd:o,"aria-label":"Color","aria-valuetext":"Saturation "+dn(n.s)+"%, Brightness "+dn(n.v)+"%"},ve.createElement(vS,{className:"react-colorful__saturation-pointer",top:1-n.v/100,left:n.s/100,color:Uh(n)})))}),yS=function(t,n){if(t===n)return!0;for(var a in t)if(t[a]!==n[a])return!1;return!0},ZA=function(t,n){return t.toLowerCase()===n.toLowerCase()||yS(Ih(t),Ih(n))};function QA(t,n,a,o){var c=Dl(a),l=Dl(o),d=f.useState(function(){return t.toHsva(n)}),m=d[0],p=d[1],g=f.useRef({color:n,hsva:m}),b=f.useRef(!1);f.useEffect(function(){if(!t.equal(n,g.current.color)){var y=t.toHsva(n);g.current={hsva:y,color:n},p(y),b.current=!1}},[n,t]),f.useEffect(function(){var y;yS(m,g.current.hsva)||t.equal(y=t.fromHsva(m),g.current.color)||(g.current={hsva:m,color:y},c(y),b.current=!0)},[m,t,c]);var v=f.useCallback(function(y){p(function(C){return Object.assign({},C,y)})},[]),w=f.useCallback(function(){b.current&&(b.current=!1,l(g.current.color))},[l]);return[m,v,w]}var JA=typeof window<"u"?f.useLayoutEffect:f.useEffect,e_=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},A0=new WeakMap,t_=function(t){JA(function(){var n=t.current;if(typeof document<"u"&&n){var a=n.getRootNode?n.getRootNode():n.ownerDocument,o=a&&("head"in a||"host"in a)?a:n.ownerDocument;if(!A0.has(o)){var c="head"in o?o.head:o,l=(c.ownerDocument||document).createElement("style");l.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var d=e_();d&&l.setAttribute("nonce",d),A0.set(o,l),c.appendChild(l)}}},[])},n_=function(t){var n=t.className,a=t.colorModel,o=t.color,c=o===void 0?a.defaultColor:o,l=t.onChange,d=t.onChangeEnd,m=xS(t,["className","colorModel","color","onChange","onChangeEnd"]),p=f.useRef(null);t_(p);var g=QA(a,c,l,d),b=g[0],v=g[1],w=g[2],y=ix(["react-colorful",n]);return ve.createElement("div",ef({},m,{ref:p,className:y}),ve.createElement(XA,{hsva:b,onChange:v,onChangeEnd:w}),ve.createElement(WA,{hue:b.h,onChange:v,onChangeEnd:w,className:"react-colorful__last-control"}))},r_={defaultColor:"000",toHsva:GA,fromHsva:function(t){return VA({h:t.h,s:t.s,v:t.v,a:1})},equal:ZA},a_=function(t){return ve.createElement(n_,ef({},t,{colorModel:r_}))};function $r(t,n="#000000"){let a=String(t??"").trim();if(!a)return n;a.startsWith("#")||(a=`#${a}`);const o=a.slice(1);return/^[0-9a-fA-F]{3}$/.test(o)?`#${o.split("").map(c=>c+c).join("").toLowerCase()}`:/^[0-9a-fA-F]{6}$/.test(o)?`#${o.toLowerCase()}`:n}function Bh(t){const n=String(t??"").trim();return/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(n)||/^[0-9a-fA-F]{6}$/.test(n)}function s_(t){const n=f.useRef(null);return f.useEffect(()=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)}),n}var o_=Object.defineProperty,Ns=(t,n)=>o_(t,"name",{value:n,configurable:!0}),lx="Popover",[wS,qP]=bn(lx,[Cs]),cx=Cs(),[i_,Ti]=wS(lx),l_=Ns(t=>{const{__scopePopover:n,children:a,open:o,defaultOpen:c,onOpenChange:l,modal:d=!1}=t,m=cx(n),p=f.useRef(null),[g,b]=f.useState(!1),[v,w]=Vr({prop:o,defaultProp:c??!1,onChange:l,caller:lx});return s.jsx(zd,{...m,children:s.jsx(i_,{scope:n,contentId:nn(),triggerRef:p,open:v,onOpenChange:w,onOpenToggle:f.useCallback(()=>w(y=>!y),[w]),hasCustomAnchor:g,onCustomAnchorAdd:f.useCallback(()=>b(!0),[]),onCustomAnchorRemove:f.useCallback(()=>b(!1),[]),modal:d,children:a})})},"Popover"),c_="PopoverTrigger",u_=f.forwardRef(Ns(function(n,a){const{__scopePopover:o,...c}=n,l=Ti(c_,o),d=cx(o),m=Pe(a,l.triggerRef),p=s.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":ux(l.open),...c,ref:m,onClick:Ce(n.onClick,l.onOpenToggle)});return l.hasCustomAnchor?p:s.jsx(Pd,{asChild:!0,...d,children:p})},"PopoverTrigger")),jS="PopoverPortal",[d_,f_]=wS(jS,{forceMount:void 0}),m_=Ns(t=>{const{__scopePopover:n,forceMount:a,children:o,container:c}=t,l=Ti(jS,n);return s.jsx(d_,{scope:n,forceMount:a,children:s.jsx(fn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:o})})})},"PopoverPortal"),Xl="PopoverContent",p_=f.forwardRef(Ns(function(n,a){const o=f_(Xl,n.__scopePopover),{forceMount:c=o.forceMount,...l}=n,d=Ti(Xl,n.__scopePopover);return s.jsx(fn,{present:c||d.open,children:d.modal?s.jsx(g_,{...l,ref:a}):s.jsx(x_,{...l,ref:a})})},"PopoverContent")),h_=Er("PopoverContent.RemoveScroll"),g_=f.forwardRef(Ns(function(n,a){const o=Ti(Xl,n.__scopePopover),c=f.useRef(null),l=Pe(a,c),d=f.useRef(!1);return f.useEffect(()=>{const m=c.current;if(m)return $d(m)},[]),s.jsx(ac,{as:h_,allowPinchZoom:!0,children:s.jsx(CS,{...n,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(n.onCloseAutoFocus,m=>{var p;m.preventDefault(),d.current||(p=o.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Ce(n.onPointerDownOutside,m=>{const p=m.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0,b=p.button===2||g;d.current=b},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(n.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),x_=f.forwardRef(Ns(function(n,a){const o=Ti(Xl,n.__scopePopover),c=f.useRef(!1),l=f.useRef(!1);return s.jsx(CS,{...n,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,p;(m=n.onCloseAutoFocus)==null||m.call(n,d),d.defaultPrevented||(c.current||(p=o.triggerRef.current)==null||p.focus(),d.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:d=>{var g,b;(g=n.onInteractOutside)==null||g.call(n,d),d.defaultPrevented||(c.current=!0,d.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const m=d.target;((b=o.triggerRef.current)==null?void 0:b.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.current&&d.preventDefault()}})},"PopoverContentNonModal")),CS=f.forwardRef(Ns(function(n,a){const{__scopePopover:o,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:d,disableOutsidePointerEvents:m,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:b,onInteractOutside:v,...w}=n,y=Ti(Xl,o),C=cx(o);return Ni(),s.jsx(Md,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:l,onUnmountAutoFocus:d,children:s.jsx(nc,{asChild:!0,disableOutsidePointerEvents:m,onInteractOutside:v,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:b,onDismiss:()=>y.onOpenChange(!1),deferPointerDownOutside:!0,children:s.jsx(Id,{"data-state":ux(y.open),role:"dialog",id:y.contentId,...C,...w,ref:a,style:{...w.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)"}})})})},"PopoverContentImpl"));function ux(t){return t?"open":"closed"}Ns(ux,"getState");var b_=l_,v_=u_,y_=m_,SS=p_;const NS=b_,ES=v_,dx=f.forwardRef(({className:t,align:n="center",sideOffset:a=4,...o},c)=>s.jsx(y_,{children:s.jsx(SS,{ref:c,align:n,sideOffset:a,className:pe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md 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 origin-[--radix-popover-content-transform-origin]",t),...o})}));dx.displayName=SS.displayName;const tf=f.forwardRef(({disabled:t,value:n,onChange:a,onBlur:o,name:c,className:l,size:d,...m},p)=>{const g=s_(p),[b,v]=f.useState(!1),[w,y]=f.useState(""),C=f.useMemo(()=>$r(n,"#ffffff"),[n]),S=b&&w?w:C;function N(E){Bh(E)&&a($r(E)),y("")}return s.jsxs(NS,{open:b,onOpenChange:E=>{E||N(w||C),v(E)},children:[s.jsx(ES,{asChild:!0,disabled:t,onBlur:o,children:s.jsx(ue,{...m,type:"button",className:pe("size-10 shrink-0 overflow-hidden rounded-md border border-border p-0 shadow-sm",l),name:c,onClick:()=>v(!0),size:d??"icon",style:{backgroundColor:C},variant:"outline","aria-label":"Pick colour",children:s.jsx("span",{className:"sr-only",children:C})})}),s.jsxs(dx,{className:"w-auto border-border bg-card p-3",align:"start",children:[s.jsx(a_,{className:"color-picker-swatch",color:C,onChange:E=>{y(""),a($r(E))}}),s.jsx(_e,{ref:g,maxLength:7,value:S,onChange:E=>{const T=E.currentTarget.value;y(T),Bh(T)&&a($r(T))},onBlur:()=>N(w||C),onKeyDown:E=>{E.key==="Enter"&&(N(w||C),v(!1))},className:"mt-3 border-border bg-secondary/30 font-mono text-sm uppercase",placeholder:"#000000"})]})]})});tf.displayName="ColorPicker";function w_({value:t,onChange:n,placeholder:a="Add item…"}){const o=Array.isArray(t)?t:[];return s.jsxs("div",{className:"space-y-2",children:[o.map((c,l)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(_e,{value:c,onChange:d=>{const m=[...o];m[l]=d.target.value,n(m)},placeholder:a,className:"border-border bg-secondary/30"}),s.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 text-destructive hover:bg-destructive/10",onClick:()=>n(o.filter((d,m)=>m!==l)),children:s.jsx(xe,{icon:bi,size:16})})]},l)),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",className:"w-full border-dashed border-border",onClick:()=>n([...o,""]),children:[s.jsx(xe,{icon:nh,size:16,className:"mr-2"}),"Add line"]})]})}const Zl="system",fx=[{id:"Inter",label:"Inter"},{id:"Roboto",label:"Roboto"},{id:"Open Sans",label:"Open Sans"},{id:"Lato",label:"Lato"},{id:"Montserrat",label:"Montserrat"},{id:"Poppins",label:"Poppins"},{id:"Nunito",label:"Nunito"},{id:"Raleway",label:"Raleway"},{id:"Work Sans",label:"Work Sans"},{id:"Source Sans 3",label:"Source Sans 3"},{id:"DM Sans",label:"DM Sans"},{id:"Manrope",label:"Manrope"},{id:"Outfit",label:"Outfit"},{id:"Rubik",label:"Rubik"},{id:"Ubuntu",label:"Ubuntu"},{id:"Fira Sans",label:"Fira Sans"},{id:"PT Sans",label:"PT Sans"},{id:"Noto Sans",label:"Noto Sans"},{id:"Oswald",label:"Oswald"},{id:"Merriweather",label:"Merriweather"},{id:"Playfair Display",label:"Playfair Display"},{id:"Libre Baskerville",label:"Libre Baskerville"},{id:"JetBrains Mono",label:"JetBrains Mono"},{id:"Fira Code",label:"Fira Code"}],_0=new Set(fx.map(t=>t.id));function j_(t){return`https://fonts.googleapis.com/css2?${t.map(a=>`family=${encodeURIComponent(a).replace(/%20/g,"+")}:wght@400;600;700;800`).join("&")}&display=swap`}function C_(){const t="supportbot-google-fonts";if(document.getElementById(t))return;const n=document.createElement("link");n.id=t,n.rel="stylesheet",n.href=j_(fx.map(a=>a.id)),document.head.appendChild(n)}function kS(t){var c;if(!t||typeof t!="string")return"Inter";const n=t.trim();if(n===Zl)return Zl;if(!n.includes(","))return _0.has(n)?n:"Inter";const a=n.match(/^["']?([^"',]+)["']?/),o=(c=a==null?void 0:a[1])==null?void 0:c.trim();return o&&_0.has(o)?o:"Inter"}function Bp(t){return t===Zl?'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif':`"${t}", ui-sans-serif, system-ui, sans-serif`}function S_({field:t,value:n,onChange:a,readOnly:o}){const c=t.path.replace(/\./g,"-"),l=kS(n);return f.useEffect(()=>{C_()},[]),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:c,children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsxs(Ca,{value:l,disabled:o,onValueChange:a,children:[s.jsx(Hr,{id:c,className:"border-border bg-secondary/30",style:{fontFamily:Bp(l)},children:s.jsx(Sa,{placeholder:"Choose a font…"})}),s.jsxs(Gr,{className:"max-h-[min(320px,50vh)]",children:[s.jsx(Et,{value:Zl,style:{fontFamily:Bp(Zl)},children:"System default"}),fx.map(d=>s.jsx(Et,{value:d.id,style:{fontFamily:Bp(d.id)},children:d.label},d.id))]})]})]})}function TS({id:t,label:n,description:a,kind:o,value:c,onChange:l,readOnly:d}){const[m,p]=f.useState(null),[g,b]=f.useState(""),[v,w]=f.useState(!0),[y,C]=f.useState(!1),[S,N]=f.useState("");f.useEffect(()=>{let _=!1;return w(!0),Ne.getGuildResources().then(R=>{_||R.data&&(p(R.data),b(""))}).catch(R=>{_||b(R instanceof Error?R.message:"Could not load server list")}).finally(()=>{_||w(!1)}),()=>{_=!0}},[]);const E=f.useMemo(()=>m?o==="role"?m.roles:o==="category"?m.categories:m.channels:[],[m,o]),T=String(c??""),M=E.find(_=>_.id===T),k=f.useMemo(()=>{if(!S.trim())return E;const _=S.toLowerCase().trim();return E.filter(R=>R.name.toLowerCase().includes(_)||R.id.includes(_))},[E,S]);return s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:t,children:n}),a?s.jsx("p",{className:"text-xs text-muted-foreground",children:a}):null,m?s.jsxs(NS,{open:y,onOpenChange:C,children:[s.jsx(ES,{asChild:!0,children:s.jsxs(ue,{id:t,type:"button",variant:"outline",role:"combobox","aria-expanded":y,disabled:d||v,className:"w-full justify-between border-border bg-secondary/30 text-left font-normal h-10 px-3 hover:bg-secondary/50",children:[s.jsx("span",{className:"truncate",children:M?s.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"font-medium text-foreground truncate",children:M.name}),s.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:M.id})]}):s.jsx("span",{className:"text-muted-foreground",children:v?"Loading server list…":`Select ${o} from ${m.guildName}…`})}),s.jsx(xe,{icon:O8,size:16,className:"shrink-0 opacity-50 ml-2"})]})}),s.jsxs(dx,{className:"w-[var(--radix-popover-trigger-width)] p-2 bg-popover border-border shadow-2xl rounded-xl flex flex-col gap-2 z-50",children:[s.jsxs("div",{className:"relative flex items-center",children:[s.jsx(xe,{icon:vi,size:14,className:"absolute left-2.5 text-muted-foreground"}),s.jsx(_e,{placeholder:`Search ${o}s by name or ID…`,value:S,onChange:_=>N(_.target.value),className:"h-8 pl-8 text-xs border-border bg-secondary/20 focus-visible:ring-1",autoFocus:!0})]}),s.jsx("div",{className:"overflow-y-auto max-h-56 space-y-1 pr-1",children:k.length===0?s.jsxs("div",{className:"p-3 text-center text-xs text-muted-foreground",children:["No ",o,'s found matching "',S,'"']}):k.map(_=>s.jsxs("button",{type:"button",onClick:()=>{l(_.id),C(!1),N("")},className:pe("w-full flex items-center justify-between px-2.5 py-1.5 rounded-lg text-xs transition-colors text-left",_.id===T?"bg-primary/15 text-primary font-semibold border border-primary/20":"hover:bg-secondary/60 text-foreground"),children:[s.jsx("span",{className:"truncate mr-2 font-medium",children:_.name}),s.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:_.id})]},_.id))})]})]}):null,s.jsx(_e,{value:T,disabled:d,onChange:_=>l(_.target.value),placeholder:o==="role"?"Role ID (ROLE_ID)":o==="category"?"Category ID":"Channel ID",className:"border-border bg-secondary/30 font-mono text-xs"}),g?s.jsx("p",{className:"text-xs text-amber-500",children:g}):null,!g&&!m&&!v?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Set General.GuildId and invite the bot to pick from a list."}):null]})}var N_=Object.defineProperty,Mi=(t,n)=>N_(t,"name",{value:n,configurable:!0}),mx="Tabs",[E_,KP]=bn(mx,[Bd]),MS=Bd(),[k_,px]=E_(mx),T_=f.forwardRef(Mi(function(n,a){const{__scopeTabs:o,value:c,onValueChange:l,defaultValue:d,orientation:m="horizontal",dir:p,activationMode:g="automatic",...b}=n,v=Si(p),[w,y]=Vr({prop:c,onChange:l,defaultProp:d??"",caller:mx});return s.jsx(k_,{scope:o,baseId:nn(),value:w,onValueChange:y,orientation:m,dir:v,activationMode:g,children:s.jsx(Me.div,{dir:v,"data-orientation":m,...b,ref:a})})},"Tabs")),M_="TabsList",R_=f.forwardRef(Mi(function(n,a){const{__scopeTabs:o,loop:c=!0,...l}=n,d=px(M_,o),m=MS(o);return s.jsx(Qw,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:c,children:s.jsx(Me.div,{role:"tablist","aria-orientation":d.orientation,...l,ref:a})})},"TabsList")),A_="TabsTrigger",__=f.forwardRef(Mi(function(n,a){const{__scopeTabs:o,value:c,disabled:l=!1,...d}=n,m=px(A_,o),p=MS(o),g=hx(m.baseId,c),b=gx(m.baseId,c),v=c===m.value;return s.jsx(Jw,{asChild:!0,...p,focusable:!l,active:v,children:s.jsx(Me.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":b,"data-state":v?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:g,...d,ref:a,onMouseDown:Ce(n.onMouseDown,w=>{!l&&w.button===0&&w.ctrlKey===!1?m.onValueChange(c):w.preventDefault()}),onKeyDown:Ce(n.onKeyDown,w=>{l||w.target!==w.currentTarget||[" ","Enter"].includes(w.key)&&m.onValueChange(c)}),onFocus:Ce(n.onFocus,()=>{const w=m.activationMode!=="manual";!v&&!l&&w&&m.onValueChange(c)})})})},"TabsTrigger")),D_="TabsContent",O_=f.forwardRef(Mi(function(n,a){const{__scopeTabs:o,value:c,forceMount:l,children:d,...m}=n,p=px(D_,o),g=hx(p.baseId,c),b=gx(p.baseId,c),v=c===p.value,w=f.useRef(v);return f.useEffect(()=>{const y=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(y)},[]),s.jsx(fn,{present:l||v,children:({present:y})=>s.jsx(Me.div,{"data-state":v?"active":"inactive","data-orientation":p.orientation,role:"tabpanel","aria-labelledby":g,hidden:!y,id:b,tabIndex:0,...m,ref:a,style:{...n.style,animationDuration:w.current?"0s":void 0},children:y&&d})})},"TabsContent"));function hx(t,n){return`${t}-trigger-${n}`}Mi(hx,"makeTriggerId");function gx(t,n){return`${t}-content-${n}`}Mi(gx,"makeContentId");var L_=T_,RS=R_,AS=__,_S=O_;const DS=L_,xx=f.forwardRef(({className:t,...n},a)=>s.jsx(RS,{ref:a,className:pe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...n}));xx.displayName=RS.displayName;const Ys=f.forwardRef(({className:t,...n},a)=>s.jsx(AS,{ref:a,className:pe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...n}));Ys.displayName=AS.displayName;const $h=f.forwardRef(({className:t,...n},a)=>s.jsx(_S,{ref:a,className:pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...n}));$h.displayName=_S.displayName;function Uu(t){if(typeof t!="string"||!t)throw new Error("expected a non-empty string, got: "+t)}function $p(t){if(typeof t!="number")throw new Error("expected a number, got: "+t)}const z_=1,P_=1,fo="emoji",mi="keyvalue",bx="favorites",I_="tokens",OS="tokens",U_="unicode",LS="count",B_="group",$_="order",zS="group-order",Hh="eTag",dd="url",D0="skinTone",Ri="readonly",vx="readwrite",PS="skinUnicodes",H_="skinUnicodes",G_="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",V_="en";function F_(t,n){const a=new Set,o=[];for(const c of t){const l=n(c);a.has(l)||(a.add(l),o.push(c))}return o}function O0(t){return F_(t,n=>n.unicode)}function Y_(t){function n(a,o,c){const l=o?t.createObjectStore(a,{keyPath:o}):t.createObjectStore(a);if(c)for(const[d,[m,p]]of Object.entries(c))l.createIndex(d,m,{multiEntry:p});return l}n(mi),n(fo,U_,{[OS]:[I_,!0],[zS]:[[B_,$_]],[PS]:[H_,!0]}),n(bx,void 0,{[LS]:[""]})}const Gh={},Ju={},fd={};function IS(t,n,a){a.onerror=()=>n(a.error),a.onblocked=()=>n(new Error("IDB blocked")),a.onsuccess=()=>t(a.result)}async function q_(t){const n=await new Promise((a,o)=>{const c=indexedDB.open(t,z_);Gh[t]=c,c.onupgradeneeded=l=>{l.oldVersion<P_&&Y_(c.result)},IS(a,o,c)});return n.onclose=()=>yx(t),n}function K_(t){return Ju[t]||(Ju[t]=q_(t)),Ju[t]}function _a(t,n,a,o){return new Promise((c,l)=>{const d=t.transaction(n,a,{durability:"relaxed"}),m=typeof n=="string"?d.objectStore(n):n.map(g=>d.objectStore(g));let p;o(m,d,g=>{p=g}),d.oncomplete=()=>c(p),d.onerror=()=>l(d.error)})}function yx(t){const n=Gh[t],a=n&&n.result;if(a){a.close();const o=fd[t];if(o)for(const c of o)c()}delete Gh[t],delete Ju[t],delete fd[t]}function W_(t){return new Promise((n,a)=>{yx(t);const o=indexedDB.deleteDatabase(t);IS(n,a,o)})}function X_(t,n){let a=fd[t];a||(a=fd[t]=[]),a.push(n)}const Z_=new Set([":D","XD",":'D","O:)",":X",":P",";P","XP",":L",":Z",":j","8D","XO","8)",":B",":O",":S",":'o","Dx","X(","D:",":C",">0)",":3","</3","<3","\\M/",":E","8#"]);function ci(t){return t.split(/[\s_]+/).map(n=>!n.match(/\w/)||Z_.has(n)?n.toLowerCase():n.replace(/[)(:,]/g,"").replace(/’/g,"'").toLowerCase()).filter(Boolean)}const Q_=2;function US(t){return t.filter(Boolean).map(n=>n.toLowerCase()).filter(n=>n.length>=Q_)}function J_(t){return t.map(({annotation:a,emoticon:o,group:c,order:l,shortcodes:d,skins:m,tags:p,emoji:g,version:b})=>{const v=[...new Set(US([...(d||[]).map(ci).flat(),...(p||[]).map(ci).flat(),...ci(a),o]))].sort(),w={annotation:a,group:c,order:l,tags:p,tokens:v,unicode:g,version:b};if(o&&(w.emoticon=o),d&&(w.shortcodes=d),m){w.skinTones=[],w.skinUnicodes=[],w.skinVersions=[];for(const{tone:y,emoji:C,version:S}of m)w.skinTones.push(y),w.skinUnicodes.push(C),w.skinVersions.push(S)}return w})}function BS(t,n,a,o){t[n](a).onsuccess=c=>o&&o(c.target.result)}function ro(t,n,a){BS(t,"get",n,a)}function $S(t,n,a){BS(t,"getAll",n,a)}function wx(t){t.commit&&t.commit()}function eD(t,n){let a=t[0];for(let o=1;o<t.length;o++){const c=t[o];n(a)>n(c)&&(a=c)}return a}function HS(t,n){const a=eD(t,c=>c.length),o=[];for(const c of a)t.some(l=>l.findIndex(d=>n(d)===n(c))===-1)||o.push(c);return o}async function tD(t){return!await jx(t,mi,dd)}async function nD(t,n,a){const[o,c]=await Promise.all([Hh,dd].map(l=>jx(t,mi,l)));return o===a&&c===n}async function rD(t,n){return _a(t,fo,Ri,(o,c,l)=>{let d;const m=()=>{o.getAll(d&&IDBKeyRange.lowerBound(d,!0),50).onsuccess=p=>{const g=p.target.result;for(const b of g)if(d=b.unicode,n(b))return l(b);if(g.length<50)return l();m()}};m()})}async function GS(t,n,a,o){try{const c=J_(n);await _a(t,[fo,mi],vx,([l,d],m)=>{let p,g,b=0;function v(){++b===2&&w()}function w(){if(!(p===o&&g===a)){l.clear();for(const y of c)l.put(y);d.put(o,Hh),d.put(a,dd),wx(m)}}ro(d,Hh,y=>{p=y,v()}),ro(d,dd,y=>{g=y,v()})})}finally{}}async function aD(t,n){return _a(t,fo,Ri,(a,o,c)=>{const l=IDBKeyRange.bound([n,0],[n+1,0],!1,!0);$S(a.index(zS),l,c)})}async function VS(t,n){const a=US(ci(n));return a.length?_a(t,fo,Ri,(o,c,l)=>{const d=[],m=()=>{d.length===a.length&&p()},p=()=>{const g=HS(d,b=>b.unicode);l(g.sort((b,v)=>b.order<v.order?-1:1))};for(let g=0;g<a.length;g++){const b=a[g],v=g===a.length-1?IDBKeyRange.bound(b,b+"",!1,!0):IDBKeyRange.only(b);$S(o.index(OS),v,w=>{d.push(w),m()})}}):[]}async function sD(t,n){const a=await VS(t,n);return a.length?a.filter(o=>(o.shortcodes||[]).map(l=>l.toLowerCase()).includes(n.toLowerCase()))[0]||null:await rD(t,c=>(c.shortcodes||[]).includes(n.toLowerCase()))||null}async function oD(t,n){return _a(t,fo,Ri,(a,o,c)=>ro(a,n,l=>{if(l)return c(l);ro(a.index(PS),n,d=>c(d||null))}))}function jx(t,n,a){return _a(t,n,Ri,(o,c,l)=>ro(o,a,l))}function iD(t,n,a,o){return _a(t,n,vx,(c,l)=>{c.put(o,a),wx(l)})}function lD(t,n){return _a(t,bx,vx,(a,o)=>ro(a,n,c=>{a.put((c||0)+1,n),wx(o)}))}function cD(t,n,a){return a===0?[]:_a(t,[bx,fo],Ri,([o,c],l,d)=>{const m=[];o.index(LS).openCursor(void 0,"prev").onsuccess=p=>{const g=p.target.result;if(!g)return d(m);function b(y){if(m.push(y),m.length===a)return d(m);g.continue()}const v=g.primaryKey,w=n.byName(v);if(w)return b(w);ro(c,v,y=>{if(y)return b(y);g.continue()})}})}const Bu="";function uD(t,n){const a=new Map;for(const c of t){const l=n(c);for(const d of l){let m=a;for(let g=0;g<d.length;g++){const b=d.charAt(g);let v=m.get(b);v||(v=new Map,m.set(b,v)),m=v}let p=m.get(Bu);p||(p=[],m.set(Bu,p)),p.push(c)}}return(c,l)=>{let d=a;for(let g=0;g<c.length;g++){const b=c.charAt(g),v=d.get(b);if(v)d=v;else return[]}if(l)return d.get(Bu)||[];const m=[],p=[d];for(;p.length;){const b=[...p.shift().entries()].sort((v,w)=>v[0]<w[0]?-1:1);for(const[v,w]of b)v===Bu?m.push(...w):p.push(w)}return m}}const dD=["name","url"];function fD(t){const n=t&&Array.isArray(t),a=n&&t.length&&(!t[0]||dD.some(o=>!(o in t[0])));if(!n||a)throw new Error("Custom emojis are in the wrong format")}function L0(t){fD(t);const n=(w,y)=>w.name.toLowerCase()<y.name.toLowerCase()?-1:1,a=t.sort(n),c=uD(t,w=>{const y=new Set;if(w.shortcodes)for(const C of w.shortcodes)for(const S of ci(C))y.add(S);return y}),l=w=>c(w,!0),d=w=>c(w,!1),m=w=>{const y=ci(w),C=y.map((S,N)=>(N<y.length-1?l:d)(S));return HS(C,S=>S.name).sort(n)},p=new Map,g=new Map;for(const w of t){g.set(w.name.toLowerCase(),w);for(const y of w.shortcodes||[])p.set(y.toLowerCase(),w)}return{all:a,search:m,byShortcode:w=>p.get(w.toLowerCase()),byName:w=>g.get(w.toLowerCase())}}const mD=typeof wrappedJSObject<"u";function Rl(t){if(!t)return t;if(mD&&(t=structuredClone(t)),delete t.tokens,t.skinTones){const n=t.skinTones.length;t.skins=Array(n);for(let a=0;a<n;a++)t.skins[a]={tone:t.skinTones[a],unicode:t.skinUnicodes[a],version:t.skinVersions[a]};delete t.skinTones,delete t.skinUnicodes,delete t.skinVersions}return t}function FS(t){t||console.warn("emoji-picker-element is more efficient if the dataSource server exposes an ETag header.")}const pD=["annotation","emoji","group","order","version"];function hD(t){if(!t||!Array.isArray(t)||!t[0]||typeof t[0]!="object"||pD.some(n=>!(n in t[0])))throw new Error("Emoji data is in the wrong format")}function YS(t,n){if(Math.floor(t.status/100)!==2)throw new Error("Failed to fetch: "+n+": "+t.status)}async function gD(t){const n=await fetch(t,{method:"HEAD"});YS(n,t);const a=n.headers.get("etag");return FS(a),a}async function Vh(t){const n=await fetch(t);YS(n,t);const a=n.headers.get("etag");FS(a);const o=await n.json();return hD(o),[a,o]}function xD(t){for(var n="",a=new Uint8Array(t),o=a.byteLength,c=-1;++c<o;)n+=String.fromCharCode(a[c]);return n}function bD(t){for(var n=t.length,a=new ArrayBuffer(n),o=new Uint8Array(a),c=-1;++c<n;)o[c]=t.charCodeAt(c);return a}async function qS(t){const n=JSON.stringify(t);let a=bD(n);const o=await crypto.subtle.digest("SHA-1",a),c=xD(o);return btoa(c)}async function vD(t,n){let a,o=await gD(n);if(!o){const c=await Vh(n);o=c[0],a=c[1],o||(o=await qS(a))}await nD(t,n,o)||(a||(a=(await Vh(n))[1]),await GS(t,a,n,o))}async function yD(t,n){let[a,o]=await Vh(n);a||(a=await qS(o)),await GS(t,o,n,a)}async function wD(t,n){try{await vD(t,n)}catch(a){if(a.name!=="InvalidStateError")throw a}}class jD{constructor({dataSource:n=G_,locale:a=V_,customEmoji:o=[]}={}){this.dataSource=n,this.locale=a,this._dbName=`emoji-picker-element-${this.locale}`,this._db=void 0,this._lazyUpdate=void 0,this._custom=L0(o),this._clear=this._clear.bind(this),this._ready=this._init()}async _init(){const n=this._db=await K_(this._dbName);X_(this._dbName,this._clear);const a=this.dataSource;await tD(n)?await yD(n,a):this._lazyUpdate=wD(n,a)}async ready(){const n=async()=>(this._ready||(this._ready=this._init()),this._ready);await n(),this._db||await n()}async getEmojiByGroup(n){return $p(n),await this.ready(),O0(await aD(this._db,n)).map(Rl)}async getEmojiBySearchQuery(n){Uu(n),await this.ready();const a=this._custom.search(n),o=O0(await VS(this._db,n)).map(Rl);return[...a,...o]}async getEmojiByShortcode(n){Uu(n),await this.ready();const a=this._custom.byShortcode(n);return a||Rl(await sD(this._db,n))}async getEmojiByUnicodeOrName(n){Uu(n),await this.ready();const a=this._custom.byName(n);return a||Rl(await oD(this._db,n))}async getPreferredSkinTone(){return await this.ready(),await jx(this._db,mi,D0)||0}async setPreferredSkinTone(n){return $p(n),await this.ready(),iD(this._db,mi,D0,n)}async incrementFavoriteEmojiCount(n){return Uu(n),await this.ready(),lD(this._db,n)}async getTopFavoriteEmoji(n){return $p(n),await this.ready(),(await cD(this._db,this._custom,n)).map(Rl)}set customEmoji(n){this._custom=L0(n)}get customEmoji(){return this._custom.all}async _shutdown(){await this.ready();try{await this._lazyUpdate}catch{}}_clear(){this._db=this._ready=this._lazyUpdate=void 0}async close(){await this._shutdown(),await yx(this._dbName)}async delete(){await this._shutdown(),await W_(this._dbName)}}const Fh=[[-1,"✨","custom"],[0,"😀","smileys-emotion"],[1,"👋","people-body"],[3,"🐱","animals-nature"],[4,"🍎","food-drink"],[5,"🏠️","travel-places"],[6,"⚽","activities"],[7,"📝","objects"],[8,"⛔️","symbols"],[9,"🏁","flags"]].map(([t,n,a])=>({id:t,emoji:n,name:a})),Hp=Fh.slice(1),CD=2,z0=6,KS=typeof requestIdleCallback=="function"?requestIdleCallback:setTimeout;function P0(t){return t.unicode.includes("")}const SD={"":17,"":16,"🫨":15.1,"🫠":14,"🥲":13.1,"🥻":12.1,"🥰":11,"🤩":5,"👱♀️":4,"🤣":3,"👁️🗨️":2,"😀":1,"😐️":.7,"😃":.6},ND=1e3,ED="🖐️",kD=8,TD=["😊","😒","❤️","👍️","😍","😂","😭","☺️","😔","😩","😏","💕","🙌","😘"],WS='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',MD=(t,n)=>t<n?-1:t>n?1:0,I0=(t,n)=>{const a=document.createElement("canvas");a.width=a.height=1;const o=a.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font=`100px ${WS}`,o.fillStyle=n,o.scale(.01,.01),o.fillText(t,0,0),o.getImageData(0,0,1,1).data},RD=(t,n)=>{const a=[...t].join(","),o=[...n].join(",");return a===o&&!a.startsWith("0,0,0,")};function AD(t){const n=I0(t,"#000"),a=I0(t,"#fff");return n&&a&&RD(n,a)}function _D(){const t=Object.entries(SD);try{for(const[n,a]of t)if(AD(n))return a}catch{}finally{}return t[0][1]}let Gp;const Vp=()=>(Gp||(Gp=new Promise(t=>KS(()=>t(_D())))),Gp),Yh=new Map,DD="️",OD="\uD83C",LD="",zD=127995,PD=57339;function ID(t,n){if(n===0)return t;const a=t.indexOf(LD);return a!==-1?t.substring(0,a)+String.fromCodePoint(zD+n-1)+t.substring(a):(t.endsWith(DD)&&(t=t.substring(0,t.length-1)),t+OD+String.fromCodePoint(PD+n-1))}function Ir(t){t.preventDefault(),t.stopPropagation()}function Fp(t,n,a){return n+=t?-1:1,n<0?n=a.length-1:n>=a.length&&(n=0),n}function XS(t,n){const a=new Set,o=[];for(const c of t){const l=n(c);a.has(l)||(a.add(l),o.push(c))}return o}function UD(t,n){const a=o=>{const c={};for(const l of o)typeof l.tone=="number"&&l.version<=n&&(c[l.tone]=l.unicode);return c};return t.map(({unicode:o,skins:c,shortcodes:l,url:d,name:m,category:p,annotation:g})=>({unicode:o,name:m,shortcodes:l,url:d,category:p,annotation:g,id:o||m,skins:c&&a(c)}))}const ed=requestAnimationFrame;let BD=typeof ResizeObserver=="function";function $D(t,n,a){let o;BD?(o=new ResizeObserver(a),o.observe(t)):ed(a),n.addEventListener("abort",()=>{o&&o.disconnect()})}function U0(t){{const n=document.createRange();return n.selectNode(t.firstChild),n.getBoundingClientRect().width}}const HD="😀";let Yp,Fs;function B0(t,n,a){const o=U0(n);if(!o){if(!Fs){Fs=a.cloneNode(!0);const c=getComputedStyle(a);for(const l of["font-family","line-height","width","height","font-size","display","align-items","justify-content"])Fs.style.setProperty(l,c.getPropertyValue(l),"important")}try{return document.body.appendChild(Fs),Fs.firstChild.nodeValue=t,U0(Fs)}finally{Fs.remove()}}return o}function GD(t,n,a){let o=!0;for(const c of t){const l=a(c);if(!l)continue;typeof Yp>"u"&&(Yp=B0(HD,n,n));const m=B0(c.unicode,l,n)/1.8<Yp;Yh.set(c.unicode,m),m||(o=!1)}return o}function VD(t){return XS(t,n=>n)}function FD(t){t&&(t.scrollTop=0)}function Ll(t,n,a){let o=t.get(n);return o||(o=a(),t.set(n,o)),o}function $0(t){return""+t}function YD(t){const n=document.createElement("template");return n.innerHTML=t,n}const qD=new WeakMap,KD=new WeakMap,WD=Symbol("un-keyed"),XD="replaceChildren"in Element.prototype;function ZD(t,n){XD?t.replaceChildren(...n):(t.innerHTML="",t.append(...n))}function QD(t,n){let a=t.firstChild,o=0;for(;a;){if(n[o]!==a)return!0;a=a.nextSibling,o++}return o!==n.length}function JD(t,n){const{targetNode:a}=n;let{targetParentNode:o}=n,c=!1;o?c=QD(o,t):(c=!0,n.targetNode=void 0,n.targetParentNode=o=a.parentNode),c&&ZD(o,t)}function eO(t,n){for(const a of n){const{targetNode:o,currentExpression:c,binding:{expressionIndex:l,attributeName:d,attributeValuePre:m,attributeValuePost:p}}=a,g=t[l];if(c!==g)if(a.currentExpression=g,d)if(g===null)o.removeAttribute(d);else{const b=m+$0(g)+p;o.setAttribute(d,b)}else{let b;Array.isArray(g)?JD(g,a):g instanceof Element?(b=g,o.replaceWith(b)):o.nodeValue=$0(g),b&&(a.targetNode=b)}}}function tO(t){let n="",a=!1,o=!1,c=-1;const l=new Map,d=[];let m=0;for(let g=0,b=t.length;g<b;g++){const v=t[g];if(n+=v.slice(m),g===b-1)break;for(let T=0;T<v.length;T++)switch(v.charAt(T)){case"<":{v.charAt(T+1)==="/"?d.pop():(a=!0,d.push(++c));break}case">":{a=!1,o=!1;break}case"=":{o=!0;break}}const w=d[d.length-1],y=Ll(l,w,()=>[]);let C,S,N;if(o){const T=/(\S+)="?([^"=]*)$/.exec(v);C=T[1],S=T[2];const M=/^([^">]*)("?)/.exec(t[g+1]);N=M[1],n=n.slice(0,-1*T[0].length),m=M[0].length}else m=0;const E={attributeName:C,attributeValuePre:S,attributeValuePost:N,expressionIndex:g};y.push(E),!a&&!o&&(n+=" ")}return{template:YD(n),elementsToBindings:l}}function H0(t,n,a){for(let o=0;o<t.length;o++){const c=t[o],l=c.attributeName?n:n.firstChild,d={binding:c,targetNode:l,targetParentNode:void 0,currentExpression:void 0};a.push(d)}}function nO(t,n){const a=[];let o;if(n.size===1&&(o=n.get(0)))H0(o,t,a);else{const c=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);let l=t,d=-1;do{const m=n.get(++d);m&&H0(m,l,a)}while(l=c.nextNode())}return a}function rO(t){const{template:n,elementsToBindings:a}=Ll(qD,t,()=>tO(t)),o=n.cloneNode(!0).content.firstElementChild,c=nO(o,a);return function(d){return eO(d,c),o}}function aO(t){const n=Ll(KD,t,()=>new Map);let a=WD;function o(l,...d){const m=Ll(n,l,()=>new Map);return Ll(m,a,()=>rO(l))(d)}function c(l,d,m){return l.map((p,g)=>{const b=a;a=m(p);try{return d(p,g)}finally{a=b}})}return{map:c,html:o}}function sO(t,n,a,o,c,l,d,m,p){const{labelWithSkin:g,titleForEmoji:b,unicodeWithSkin:v}=a,{html:w,map:y}=aO(n);function C(T,M,k){return y(T,(_,R)=>w`<button role="${M?"option":"menuitem"}" aria-selected="${M?R===n.activeSearchItem:null}" aria-label="${g(_,n.currentSkinTone)}" title="${b(_)}" class="${"emoji"+(M&&R===n.activeSearchItem?" active":"")+(_.unicode?"":" custom-emoji")}" id="${`${k}-${_.id}`}" style="${_.unicode?null:`--custom-emoji-background: url(${JSON.stringify(_.url)})`}">${_.unicode?v(_,n.currentSkinTone):""}</button>`,_=>`${k}-${_.id}`)}const N=w`<section data-ref="rootElement" class="picker" aria-label="${n.i18n.regionLabel}" style="${n.pickerStyle||""}"><div class="pad-top"></div><div class="search-row"><div class="search-wrapper"><input id="search" class="search" type="search" role="combobox" enterkeyhint="search" placeholder="${n.i18n.searchLabel}" autocapitalize="none" autocomplete="off" spellcheck="true" aria-expanded="${!!(n.searchMode&&n.currentEmojis.length)}" aria-controls="search-results" aria-describedby="search-description" aria-autocomplete="list" aria-activedescendant="${n.activeSearchItemId?`emo-${n.activeSearchItemId}`:null}" data-ref="searchElement" data-on-input="onSearchInput" data-on-keydown="onSearchKeydown"><label class="sr-only" for="search">${n.i18n.searchLabel}</label> <span id="search-description" class="sr-only">${n.i18n.searchDescription}</span></div><div class="skintone-button-wrapper ${n.skinTonePickerExpandedAfterAnimation?"expanded":""}"><button id="skintone-button" class="emoji ${n.skinTonePickerExpanded?"hide-focus":""}" aria-label="${n.skinToneButtonLabel}" title="${n.skinToneButtonLabel}" aria-describedby="skintone-description" aria-haspopup="listbox" aria-expanded="${n.skinTonePickerExpanded}" aria-controls="skintone-list" data-on-click="onClickSkinToneButton">${n.skinToneButtonText||""}</button></div><span id="skintone-description" class="sr-only">${n.i18n.skinToneDescription}</span><div data-ref="skinToneDropdown" id="skintone-list" class="skintone-list hide-focus ${n.skinTonePickerExpanded?"":"hidden no-animate"}" style="transform:translateY(${n.skinTonePickerExpanded?0:"calc(-1 * var(--num-skintones) * var(--total-emoji-size))"})" role="listbox" aria-label="${n.i18n.skinTonesLabel}" aria-activedescendant="skintone-${n.activeSkinTone}" aria-hidden="${!n.skinTonePickerExpanded}" tabIndex="-1" data-on-focusout="onSkinToneOptionsFocusOut" data-on-click="onSkinToneOptionsClick" data-on-keydown="onSkinToneOptionsKeydown" data-on-keyup="onSkinToneOptionsKeyup">${y(n.skinTones,(T,M)=>w`<div id="skintone-${M}" class="emoji ${M===n.activeSkinTone?"active":""}" aria-selected="${M===n.activeSkinTone}" role="option" title="${n.i18n.skinTones[M]}" aria-label="${n.i18n.skinTones[M]}">${T}</div>`,T=>T)}</div></div><div class="nav" role="tablist" style="grid-template-columns:repeat(${n.groups.length},1fr)" aria-label="${n.i18n.categoriesLabel}" data-on-keydown="onNavKeydown" data-on-click="onNavClick">${y(n.groups,T=>w`<button role="tab" class="nav-button" aria-controls="tab-${T.id}" aria-label="${n.i18n.categories[T.name]}" aria-selected="${!n.searchMode&&n.currentGroup.id===T.id}" title="${n.i18n.categories[T.name]}" data-group-id="${T.id}"><div class="nav-emoji emoji">${T.emoji}</div></button>`,T=>T.id)}</div><div class="indicator-wrapper"><div class="indicator" style="transform:translateX(${(n.isRtl?-1:1)*n.currentGroupIndex*100}%)"></div></div><div class="message ${n.message?"":"gone"}" role="alert" aria-live="polite">${n.message||""}</div><div data-ref="tabpanelElement" class="tabpanel ${!n.databaseLoaded||n.message?"gone":""}" role="${n.searchMode?"region":"tabpanel"}" aria-label="${n.searchMode?n.i18n.searchResultsLabel:n.i18n.categories[n.currentGroup.name]}" id="${n.searchMode?null:`tab-${n.currentGroup.id}`}" tabIndex="0" data-on-click="onEmojiClick"><div data-action="calculateEmojiGridStyle">${y(n.currentEmojisWithCategories,(T,M)=>w`<div><div id="menu-label-${M}" class="category ${n.currentEmojisWithCategories.length===1&&n.currentEmojisWithCategories[0].category===""?"gone":""}" aria-hidden="true">${n.searchMode?n.i18n.searchResultsLabel:T.category?T.category:n.currentEmojisWithCategories.length>1?n.i18n.categories.custom:n.i18n.categories[n.currentGroup.name]}</div><div class="emoji-menu ${M!==0&&!n.searchMode&&n.currentGroup.id===-1?"visibility-auto":""}" style="${`--num-rows: ${Math.ceil(T.emojis.length/n.numColumns)}`}" data-action="updateOnIntersection" role="${n.searchMode?"listbox":"menu"}" aria-labelledby="menu-label-${M}" id="${n.searchMode?"search-results":null}">${C(T.emojis,n.searchMode,"emo")}</div></div>`,T=>T.category)}</div></div><div class="favorites onscreen emoji-menu ${n.message?"gone":""}" role="menu" aria-label="${n.i18n.favoritesLabel}" data-on-click="onEmojiClick">${C(n.currentFavorites,!1,"fav")}</div><button data-ref="baselineEmoji" aria-hidden="true" tabindex="-1" class="abs-pos hidden emoji baseline-emoji">😀</button></section>`,E=(T,M)=>{for(const k of t.querySelectorAll(`[${T}]`))M(k,k.getAttribute(T))};if(p){t.appendChild(N);for(const T of["click","focusout","input","keydown","keyup"])E(`data-on-${T}`,(M,k)=>{M.addEventListener(T,o[k])});E("data-ref",(T,M)=>{l[M]=T}),d.addEventListener("abort",()=>{t.removeChild(N)})}E("data-action",(T,M)=>{let k=m.get(M);k||m.set(M,k=new WeakSet),k.has(T)||(k.add(T),c[M](T))})}const md=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t);function oO(t){let n=!1,a;const o=new Map,c=new Set;let l;const d=()=>{if(n)return;const g=[...c];c.clear();try{for(const b of g)b()}finally{l=!1,c.size&&(l=!0,md(d))}},m=new Proxy({},{get(g,b){if(a){let v=o.get(b);v||(v=new Set,o.set(b,v)),v.add(a)}return g[b]},set(g,b,v){if(g[b]!==v){g[b]=v;const w=o.get(b);if(w){for(const y of w)c.add(y);l||(l=!0,md(d))}}return!0}}),p=g=>{const b=()=>{const v=a;a=b;try{return g()}finally{a=v}};return b()};return t.addEventListener("abort",()=>{n=!0}),{state:m,createEffect:p}}function qp(t,n,a){if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(!a(t[o],n[o]))return!1;return!0}const G0=new WeakMap;function iO(t,n,a){{const o=t.closest(".tabpanel");let c=G0.get(o);c||(c=new IntersectionObserver(a,{root:o,rootMargin:"50% 0px 50% 0px",threshold:0}),G0.set(o,c),n.addEventListener("abort",()=>{c.disconnect()})),c.observe(t)}}const Kp=[],{assign:$u}=Object;function lO(t,n){const a={},o=new AbortController,c=o.signal,{state:l,createEffect:d}=oO(c),m=new Map;$u(l,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),$u(l,n),$u(l,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:kD,isRtl:!1,currentGroupIndex:0,groups:Hp,databaseLoaded:!1,activeSearchItemId:void 0}),d(()=>{l.currentGroup!==l.groups[l.currentGroupIndex]&&(l.currentGroup=l.groups[l.currentGroupIndex])});const p=$=>{t.getElementById($).focus()},g=$=>t.getElementById(`emo-${$.id}`),b=($,ie)=>{a.rootElement.dispatchEvent(new CustomEvent($,{detail:ie,bubbles:!0,composed:!0}))},v=($,ie)=>$.id===ie.id,w=($,ie)=>{const{category:ye,emojis:Se}=$,{category:Be,emojis:Ke}=ie;return ye!==Be?!1:qp(Se,Ke,v)},y=$=>{qp(l.currentEmojis,$,v)||(l.currentEmojis=$)},C=$=>{l.searchMode!==$&&(l.searchMode=$)},S=$=>{qp(l.currentEmojisWithCategories,$,w)||(l.currentEmojisWithCategories=$)},N=($,ie)=>ie&&$.skins&&$.skins[ie]||$.unicode,M={labelWithSkin:($,ie)=>VD([$.name||N($,ie),$.annotation,...$.shortcodes||Kp].filter(Boolean)).join(", "),titleForEmoji:$=>$.annotation||($.shortcodes||Kp).join(", "),unicodeWithSkin:N},k={onClickSkinToneButton:Z,onEmojiClick:D,onNavClick:oe,onNavKeydown:ae,onSearchKeydown:W,onSkinToneOptionsClick:V,onSkinToneOptionsFocusOut:ge,onSkinToneOptionsKeydown:be,onSkinToneOptionsKeyup:K,onSearchInput:me},_={calculateEmojiGridStyle:ne,updateOnIntersection:X};let R=!0;d(()=>{sO(t,l,M,k,_,a,c,m,R),R=!1}),l.emojiVersion||Vp().then($=>{$||(l.message=l.i18n.emojiUnsupportedMessage)}),d(()=>{async function $(){let ie=!1;const ye=setTimeout(()=>{ie=!0,l.message=l.i18n.loadingMessage},ND);try{await l.database.ready(),l.databaseLoaded=!0}catch(Se){console.error(Se),l.message=l.i18n.networkErrorMessage}finally{clearTimeout(ye),ie&&(ie=!1,l.message="")}}l.database&&$()}),d(()=>{l.pickerStyle=`
|
||
--num-groups: ${l.groups.length};
|
||
--indicator-opacity: ${l.searchMode?0:1};
|
||
--num-skintones: ${z0};`}),d(()=>{l.customEmoji&&l.database&&L()}),d(()=>{l.customEmoji&&l.customEmoji.length?l.groups!==Fh&&(l.groups=Fh):l.groups!==Hp&&(l.currentGroupIndex&&l.currentGroupIndex--,l.groups=Hp)}),d(()=>{async function $(){l.databaseLoaded&&(l.currentSkinTone=await l.database.getPreferredSkinTone())}$()}),d(()=>{l.skinTones=Array(z0).fill().map(($,ie)=>ID(l.skinToneEmoji,ie))}),d(()=>{l.skinToneButtonText=l.skinTones[l.currentSkinTone]}),d(()=>{l.skinToneButtonLabel=l.i18n.skinToneLabel.replace("{skinTone}",l.i18n.skinTones[l.currentSkinTone])}),d(()=>{async function $(){const{database:ie}=l,ye=(await Promise.all(TD.map(Se=>ie.getEmojiByUnicodeOrName(Se)))).filter(Boolean);l.defaultFavoriteEmojis=ye}l.databaseLoaded&&$()});function L(){const{customEmoji:$,database:ie}=l,ye=$||Kp;ie.customEmoji!==ye&&(ie.customEmoji=ye)}d(()=>{async function $(){L();const{database:ie,defaultFavoriteEmojis:ye,numColumns:Se}=l,Be=await ie.getTopFavoriteEmoji(Se),Ke=await de(XS([...Be,...ye],We=>We.unicode||We.name).slice(0,Se));l.currentFavorites=Ke}l.databaseLoaded&&l.defaultFavoriteEmojis&&$()});function ne($){$D($,c,()=>{{const ie=getComputedStyle(a.rootElement),ye=parseInt(ie.getPropertyValue("--num-columns"),10),Se=ie.getPropertyValue("direction")==="rtl";l.numColumns=ye,l.isRtl=Se}})}function X($){iO($,c,ie=>{for(const{target:ye,isIntersecting:Se}of ie)ye.classList.toggle("onscreen",Se)})}d(()=>{async function $(){const{searchText:ie,currentGroup:ye,databaseLoaded:Se,customEmoji:Be}=l;if(!Se)l.currentEmojis=[],l.searchMode=!1;else if(ie.length>=CD){const Ke=await P(ie);l.searchText===ie&&(y(Ke),C(!0))}else{const{id:Ke}=ye;if(Ke!==-1||Be&&Be.length){const We=await se(Ke);l.currentGroup.id===Ke&&(y(We),C(!1))}}}$()});const I=()=>{ed(()=>FD(a.tabpanelElement))};d(()=>{const{currentEmojis:$,emojiVersion:ie}=l,ye=$.filter(Se=>Se.unicode).filter(Se=>P0(Se)&&!Yh.has(Se.unicode));if(!ie&&ye.length)y($),ed(()=>H(ye));else{const Se=ie?$:$.filter(q);y(Se),I()}});function H($){GD($,a.baselineEmoji,g)?I():l.currentEmojis=[...l.currentEmojis]}function q($){return!$.unicode||!P0($)||Yh.get($.unicode)}async function ce($){const ie=l.emojiVersion||await Vp();return $.filter(({version:ye})=>!ye||ye<=ie)}async function de($){return UD($,l.emojiVersion||await Vp())}async function se($){const ie=$===-1?l.customEmoji:await l.database.getEmojiByGroup($);return de(await ce(ie))}async function P($){return de(await ce(await l.database.getEmojiBySearchQuery($)))}d(()=>{}),d(()=>{function $(){const{searchMode:ye,currentEmojis:Se}=l;if(ye)return[{category:"",emojis:Se}];const Be=new Map;for(const Ke of Se){const We=Ke.category||"";let qt=Be.get(We);qt||(qt=[],Be.set(We,qt)),qt.push(Ke)}return[...Be.entries()].map(([Ke,We])=>({category:Ke,emojis:We})).sort((Ke,We)=>l.customCategorySorting(Ke.category,We.category))}const ie=$();S(ie)}),d(()=>{l.activeSearchItemId=l.activeSearchItem!==-1&&l.currentEmojis[l.activeSearchItem].id}),d(()=>{const{rawSearchText:$}=l;KS(()=>{l.searchText=($||"").trim(),l.activeSearchItem=-1})});function W($){if(!l.searchMode||!l.currentEmojis.length)return;const ie=ye=>{Ir($),l.activeSearchItem=Fp(ye,l.activeSearchItem,l.currentEmojis)};switch($.key){case"ArrowDown":return ie(!1);case"ArrowUp":return ie(!0);case"Enter":if(l.activeSearchItem===-1)l.activeSearchItem=0;else return Ir($),O(l.currentEmojis[l.activeSearchItem].id)}}function oe($){const{target:ie}=$,ye=ie.closest(".nav-button");if(!ye)return;const Se=parseInt(ye.dataset.groupId,10);a.searchElement.value="",l.rawSearchText="",l.searchText="",l.activeSearchItem=-1,l.currentGroupIndex=l.groups.findIndex(Be=>Be.id===Se)}function ae($){const{target:ie,key:ye}=$,Se=Be=>{Be&&(Ir($),Be.focus())};switch(ye){case"ArrowLeft":return Se(ie.previousElementSibling);case"ArrowRight":return Se(ie.nextElementSibling);case"Home":return Se(ie.parentElement.firstElementChild);case"End":return Se(ie.parentElement.lastElementChild)}}async function G($){const ie=await l.database.getEmojiByUnicodeOrName($),ye=[...l.currentEmojis,...l.currentFavorites].find(Be=>Be.id===$),Se=ye.unicode&&N(ye,l.currentSkinTone);return await l.database.incrementFavoriteEmojiCount($),{emoji:ie,skinTone:l.currentSkinTone,...Se&&{unicode:Se},...ye.name&&{name:ye.name}}}async function O($){const ie=G($);b("emoji-click-sync",ie),b("emoji-click",await ie)}function D($){const{target:ie}=$;if(!ie.classList.contains("emoji"))return;Ir($);const ye=ie.id.substring(4);O(ye)}function B($){l.currentSkinTone=$,l.skinTonePickerExpanded=!1,p("skintone-button"),b("skin-tone-change",{skinTone:$}),l.database.setPreferredSkinTone($)}function V($){const{target:{id:ie}}=$,ye=ie&&ie.match(/^skintone-(\d)/);if(!ye)return;Ir($);const Se=parseInt(ye[1],10);B(Se)}function Z($){l.skinTonePickerExpanded=!l.skinTonePickerExpanded,l.activeSkinTone=l.currentSkinTone,l.skinTonePickerExpanded&&(Ir($),ed(()=>p("skintone-list")))}d(()=>{l.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{l.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):l.skinTonePickerExpandedAfterAnimation=!1});function be($){if(!l.skinTonePickerExpanded)return;const ie=async ye=>{Ir($),l.activeSkinTone=ye};switch($.key){case"ArrowUp":return ie(Fp(!0,l.activeSkinTone,l.skinTones));case"ArrowDown":return ie(Fp(!1,l.activeSkinTone,l.skinTones));case"Home":return ie(0);case"End":return ie(l.skinTones.length-1);case"Enter":return Ir($),B(l.activeSkinTone);case"Escape":return Ir($),l.skinTonePickerExpanded=!1,p("skintone-button")}}function K($){if(l.skinTonePickerExpanded)switch($.key){case" ":return Ir($),B(l.activeSkinTone)}}async function ge($){const{relatedTarget:ie}=$;(!ie||ie.id!=="skintone-list")&&(l.skinTonePickerExpanded=!1)}function me($){l.rawSearchText=$.target.value}return{$set($){$u(l,$)},$destroy(){o.abort()}}}const cO="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",uO="en";var dO={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading…",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}},fO=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}';const ZS=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],mO=`:host{--emoji-font-family:${WS}}`;class Cx extends HTMLElement{constructor(n){super(),this.attachShadow({mode:"open"});const a=document.createElement("style");a.textContent=fO+mO,this.shadowRoot.appendChild(a),this._ctx={locale:uO,dataSource:cO,skinToneEmoji:ED,customCategorySorting:MD,customEmoji:null,i18n:dO,emojiVersion:null,...n};for(const o of ZS)o!=="database"&&Object.prototype.hasOwnProperty.call(this,o)&&(this._ctx[o]=this[o],delete this[o]);this._dbFlush()}connectedCallback(){V0(this),this._cmp||(this._cmp=lO(this.shadowRoot,this._ctx))}disconnectedCallback(){V0(this),md(()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;const{database:n}=this._ctx;n.close().catch(a=>console.error(a))}})}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(n,a,o){this._set(n.replace(/-([a-z])/g,(c,l)=>l.toUpperCase()),n==="emoji-version"?parseFloat(o):o)}_set(n,a){this._ctx[n]=a,this._cmp&&this._cmp.$set({[n]:a}),["locale","dataSource"].includes(n)&&this._dbFlush()}_dbCreate(){const{locale:n,dataSource:a,database:o}=this._ctx;(!o||o.locale!==n||o.dataSource!==a)&&this._set("database",new jD({locale:n,dataSource:a}))}_dbFlush(){md(()=>this._dbCreate())}}const QS={};for(const t of ZS)QS[t]={get(){return t==="database"&&this._dbCreate(),this._ctx[t]},set(n){if(t==="database")throw new Error("database is read-only");this._set(t,n)}};Object.defineProperties(Cx.prototype,QS);function V0(t){t instanceof Cx||Object.setPrototypeOf(t,customElements.get(t.tagName.toLowerCase()).prototype)}customElements.get("emoji-picker")||customElements.define("emoji-picker",Cx);function pO({onPick:t}){const n=f.useRef(null);return f.useEffect(()=>{const a=n.current;if(!a)return;const o=document.createElement("emoji-picker");o.className="unicode-emoji-picker-el",o.setAttribute("data-theme","dark");const c=l=>{var p;const d=l.detail,m=(d==null?void 0:d.unicode)??((p=d==null?void 0:d.emoji)==null?void 0:p.unicode);m&&t(m)};return o.addEventListener("emoji-click",c),a.appendChild(o),()=>{o.removeEventListener("emoji-click",c),o.remove()}},[t]),s.jsx("div",{ref:n,className:"unicode-emoji-panel-host overflow-hidden rounded-lg border border-border/50"})}const hO=/^<(a?):([^:>]+):(\d{17,20})>$/;function td(t,n,a=!1){return`${a?"<a":"<"}:${t}:${n}>`}function JS(t){const n=String(t??"").trim();if(!n)return{kind:"empty",value:""};const a=n.match(hO);return a?{kind:"custom",value:n,animated:a[1]==="a",name:a[2],id:a[3]}:{kind:"unicode",value:n}}function e5(t,n=!1){return`https://cdn.discordapp.com/emojis/${t}.${n?"gif":"png"}?size=64`}function gO(t,n=[]){const a=JS(t);if(a.kind==="custom"&&a.id&&!a.name){const o=n.find(c=>c.id===a.id);if(o)return{kind:"custom",value:td(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}if(a.kind==="custom"&&a.id){const o=n.find(c=>c.id===a.id);if(o&&a.value!==td(o.name,o.id,o.animated))return{kind:"custom",value:td(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}return a}function xO({value:t,guildEmojis:n,size:a="md"}){const o=gO(t,n),c=a==="lg"?"size-10":"size-7",l=a==="lg"?"text-3xl":"text-2xl";return o.kind==="empty"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"No emoji selected"}):o.kind==="custom"&&o.id?s.jsxs("span",{className:"inline-flex items-center gap-3",children:[s.jsx("img",{src:e5(o.id,o.animated),alt:o.name??"custom emoji",className:pe(c,"shrink-0 rounded-md"),loading:"lazy"}),s.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[s.jsxs("span",{className:"text-sm font-medium",children:[":",o.name,":"]}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:o.value})]})]}):s.jsx("span",{className:pe(l,"leading-none"),title:o.value,children:o.value})}function bO({id:t,label:n,description:a,value:o,onChange:c,readOnly:l}){const[d,m]=f.useState(!1),[p,g]=f.useState("server"),[b,v]=f.useState(null),[w,y]=f.useState(""),[C,S]=f.useState(!1),[N,E]=f.useState(""),T=f.useCallback(async(I=!1)=>{S(!0),y("");try{const H=await Ne.getGuildResources(I);H.data?(v(H.data),Array.isArray(H.data.emojis)||y("Server response is missing emojis. Restart the bot after updating.")):y("No guild data returned.")}catch(H){y(H instanceof Error?H.message:"Could not load server emojis")}finally{S(!1)}},[]);f.useEffect(()=>{d&&T(!0)},[d,T]);const M=f.useMemo(()=>Array.isArray(b==null?void 0:b.emojis)?b.emojis:[],[b]),k=f.useMemo(()=>{const I=N.trim().toLowerCase();return I?M.filter(H=>H.name.toLowerCase().includes(I)):M},[M,N]),_=String(o??""),R=JS(_);function L(I){c(I),m(!1)}function ne(I){c(td(I.name,I.id,I.animated)),m(!1)}function X(){c("")}return s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:t,children:n}),a?s.jsx("p",{className:"text-xs text-muted-foreground",children:a}):null,s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(xO,{value:o,guildEmojis:M,size:"lg"})}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(ue,{type:"button",variant:"secondary",size:"sm",disabled:l,onClick:()=>m(!0),children:"Choose emoji"}),_?s.jsx(ue,{type:"button",variant:"ghost",size:"sm",disabled:l,onClick:X,children:"Clear"}):null]})]}),s.jsx(Qs,{open:d,onOpenChange:m,children:s.jsxs(hs,{className:"max-h-[min(90vh,720px)] max-w-lg gap-0 overflow-hidden p-0 sm:max-w-xl",children:[s.jsxs(gs,{className:"space-y-1 border-b border-border px-5 py-4",children:[s.jsx(xs,{children:"Choose emoji"}),s.jsxs(bs,{children:["Server emojis save as"," ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"<:name:id>"}),". Standard emojis save as Unicode characters."]})]}),s.jsxs(DS,{value:p,onValueChange:I=>g(I),className:"flex min-h-0 flex-1 flex-col",children:[s.jsxs(xx,{className:"mx-5 mt-3 grid h-9 w-auto grid-cols-2",children:[s.jsx(Ys,{value:"server",children:"Server"}),s.jsx(Ys,{value:"unicode",children:"All emojis"})]}),s.jsxs($h,{value:"server",className:"mt-0 flex-1 px-5 pb-4 pt-3",children:[s.jsxs("div",{className:"relative mb-3",children:[s.jsx(xe,{icon:vi,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(_e,{placeholder:"Search by name…",value:N,onChange:I=>E(I.target.value),className:"h-9 border-border bg-secondary/30 pl-9"})]}),b?s.jsxs("p",{className:"mb-2 text-xs text-muted-foreground",children:[b.guildName," · ",M.length," custom emoji",M.length===1?"":"s"]}):null,s.jsx(fc,{className:"h-[min(50vh,320px)] rounded-lg border border-border/50 bg-secondary/20",children:C?s.jsx("div",{className:"grid grid-cols-6 gap-2 p-3 sm:grid-cols-8",children:Array.from({length:24}).map((I,H)=>s.jsx(Ue,{className:"aspect-square rounded-lg"},H))}):w?s.jsxs("div",{className:"space-y-3 p-4 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:w}),s.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>void T(!0),children:"Retry"})]}):k.length===0?s.jsx("p",{className:"p-6 text-center text-sm text-muted-foreground",children:M.length===0?"No custom emojis in this server, or the bot needs the Guild Emojis intent (restart after update).":"No emojis match your search."}):s.jsx("div",{className:"grid grid-cols-6 gap-1.5 p-2 sm:grid-cols-8",children:k.map(I=>{const H=R.kind==="custom"&&R.id===I.id;return s.jsx("button",{type:"button",title:`:${I.name}:`,className:pe("flex aspect-square items-center justify-center rounded-lg border border-transparent bg-background/50 transition-colors hover:border-primary/30 hover:bg-accent",H&&"border-primary/50 bg-primary/15 ring-2 ring-primary/30"),onClick:()=>ne(I),children:s.jsx("img",{src:I.url??e5(I.id,I.animated),alt:I.name,className:"size-8 object-contain",loading:"lazy"})},I.id)})})})]}),s.jsx($h,{value:"unicode",className:"mt-0 px-5 pb-4 pt-3",children:s.jsx(pO,{onPick:L})})]})]})}),s.jsx(_e,{value:_,disabled:l,onChange:I=>c(I.target.value),placeholder:"Unicode or <:name:id>",className:"border-border bg-secondary/30 font-mono text-xs"})]})}const F0="BOT_TOKEN",vO="MODEL_API_KEY";function pd({field:t,value:n,onChange:a,readOnly:o}){const c=t.path.replace(/\./g,"-");if(t.type==="googleFont")return s.jsx(S_,{field:t,value:n,onChange:a,readOnly:o});if(t.type==="boolean")return s.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-secondary/20 px-3 py-2.5",children:[s.jsxs("div",{children:[s.jsx(Ae,{htmlFor:c,className:"font-medium",children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null]}),s.jsx(Mt,{id:c,checked:!!n,disabled:o,onCheckedChange:a})]});if(t.type==="stringList")return s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsx(w_,{value:Array.isArray(n)?n:[],onChange:a})]});if(t.type==="select"&&t.options)return s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:c,children:t.label}),s.jsxs(Ca,{value:String(n??""),disabled:o,onValueChange:a,children:[s.jsx(Hr,{id:c,className:"border-border bg-secondary/30",children:s.jsx(Sa,{placeholder:"Select…"})}),s.jsx(Gr,{children:t.options.map(d=>s.jsx(Et,{value:d.value,children:d.label},d.value))})]})]});if(t.type==="color"){const d=$r(String(n??"#000000"));return s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:c,children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsxs("div",{className:"flex gap-2",children:[s.jsx(tf,{value:d,onChange:a}),s.jsx(_e,{id:c,value:d,disabled:o,onChange:m=>a(m.target.value),onBlur:m=>a($r(m.target.value,d)),className:"border-border bg-secondary/30 font-mono uppercase",placeholder:"#000000",maxLength:7})]})]})}if(t.type==="emoji")return s.jsx(bO,{id:c,label:t.label,description:t.description,value:n,onChange:a,readOnly:o});if(t.type==="discordChannel"||t.type==="discordRole"||t.type==="discordCategory"){const d=t.type==="discordRole"?"role":t.type==="discordCategory"?"category":"channel";return s.jsx(TS,{id:c,label:t.label,description:t.description,kind:d,value:n,onChange:a,readOnly:o})}if(t.type==="secret"){const d=n===F0||n===vO||!n?"":"••••••••••••";return s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:c,children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsx(_e,{id:c,type:"password",value:d,disabled:o,placeholder:t.placeholder??"Unchanged if empty",onChange:m=>{const p=m.target.value;a(p||(t.placeholder??F0))},className:"border-border bg-secondary/30"})]})}const l="border-border bg-secondary/30";return t.type==="textarea"?s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:c,children:t.label}),s.jsx(Jd,{id:c,value:String(n??""),disabled:o,onChange:d=>a(d.target.value),className:`min-h-[88px] ${l}`})]}):s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:c,children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsx(_e,{id:c,type:t.type==="number"?"number":"text",value:n==null?"":String(n),disabled:o,onChange:d=>a(t.type==="number"?Number(d.target.value):d.target.value),placeholder:t.placeholder??(t.type==="discordId"?"Discord snowflake ID":void 0),className:l})]})}const Je=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("rounded-xl border border-border bg-card text-card-foreground shadow-none",t),...n}));Je.displayName="Card";const dt=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("flex flex-col space-y-1.5 p-6",t),...n}));dt.displayName="CardHeader";const ft=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("font-semibold leading-none tracking-tight",t),...n}));ft.displayName="CardTitle";const Ot=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("text-sm text-muted-foreground",t),...n}));Ot.displayName="CardDescription";const et=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("p-6 pt-0",t),...n}));et.displayName="CardContent";const Sx=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("flex items-center p-6 pt-0",t),...n}));Sx.displayName="CardFooter";function Y0(t){return t.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function yO(t,n){if(typeof n=="boolean")return"boolean";if(typeof n=="number")return"number";if(Array.isArray(n))return"stringList";if(typeof n=="string"){const a=t.toLowerCase();return/prefix/.test(a)?"text":/emoji/.test(a)?"emoji":/guild.?id|guild_id/.test(a)?"discordId":/category/.test(a)?"discordCategory":/channel|forum/.test(a)?"discordChannel":/role|staff|admin|moderator/.test(a)?"discordRole":n.length>100?"textarea":"text"}return"text"}function Nx(t,n=""){const a=[];for(const[o,c]of Object.entries(t)){const l=n?`${n}.${o}`:o;if(Array.isArray(c)){if(c.length>0&&typeof c[0]=="object"&&c[0]!==null&&!Array.isArray(c[0]))continue;a.push({path:l,label:Y0(o),type:"stringList"});continue}if(c&&typeof c=="object"&&Object.keys(c).length>0){a.push(...Nx(c,l));continue}a.push({path:l,label:Y0(o),type:yO(o,c)})}return a}function wO(t){const n=Nx(t);return n.length===0?[{title:"Configuration",fields:[]}]:[{title:"Settings",description:"Values from this addon’s config file.",fields:n}]}function kr(t,n){const a=n.split(".");let o=t;for(const c of a){if(o==null||typeof o!="object")return;o=o[c]}return o}function Gn(t,n,a){const o=n.split("."),c=structuredClone(t);let l=c;for(let d=0;d<o.length-1;d++){const m=o[d];(l[m]==null||typeof l[m]!="object")&&(l[m]={}),l=l[m]}return l[o[o.length-1]]=a,c}var jO=t=>{switch(t){case"success":return NO;case"info":return kO;case"warning":return EO;case"error":return TO;default:return null}},CO=Array(12).fill(0),SO=({visible:t,className:n})=>ve.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":t},ve.createElement("div",{className:"sonner-spinner"},CO.map((a,o)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),NO=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),EO=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.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"})),kO=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),TO=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),MO=ve.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"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),RO=()=>{let[t,n]=ve.useState(document.hidden);return ve.useEffect(()=>{let a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),t},qh=1,AO=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let 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;let{message:a,...o}=t,c=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:qh++,l=this.toasts.find(m=>m.id===c),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),l?this.toasts=this.toasts.map(m=>m.id===c?(this.publish({...m,...t,id:c,title:a}),{...m,...t,id:c,dismissible:d,title:a}):m):this.addToast({title:a,...o,dismissible:d,id:c}),c},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,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 a;n.loading!==void 0&&(a=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let o=t instanceof Promise?t:t(),c=a!==void 0,l,d=o.then(async p=>{if(l=["resolve",p],ve.isValidElement(p))c=!1,this.create({id:a,type:"default",message:p});else if(DO(p)&&!p.ok){c=!1;let g=typeof n.error=="function"?await n.error(`HTTP error! status: ${p.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${p.status}`):n.description;this.create({id:a,type:"error",message:g,description:b})}else if(n.success!==void 0){c=!1;let g=typeof n.success=="function"?await n.success(p):n.success,b=typeof n.description=="function"?await n.description(p):n.description;this.create({id:a,type:"success",message:g,description:b})}}).catch(async p=>{if(l=["reject",p],n.error!==void 0){c=!1;let g=typeof n.error=="function"?await n.error(p):n.error,b=typeof n.description=="function"?await n.description(p):n.description;this.create({id:a,type:"error",message:g,description:b})}}).finally(()=>{var p;c&&(this.dismiss(a),a=void 0),(p=n.finally)==null||p.call(n)}),m=()=>new Promise((p,g)=>d.then(()=>l[0]==="reject"?g(l[1]):p(l[1])).catch(g));return typeof a!="string"&&typeof a!="number"?{unwrap:m}:Object.assign(a,{unwrap:m})},this.custom=(t,n)=>{let a=(n==null?void 0:n.id)||qh++;return this.create({jsx:t(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Mn=new AO,_O=(t,n)=>{let a=(n==null?void 0:n.id)||qh++;return Mn.addToast({title:t,...n,id:a}),a},DO=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",OO=_O,LO=()=>Mn.toasts,zO=()=>Mn.getActiveToasts(),Dt=Object.assign(OO,{success:Mn.success,info:Mn.info,warning:Mn.warning,error:Mn.error,custom:Mn.custom,message:Mn.message,promise:Mn.promise,dismiss:Mn.dismiss,loading:Mn.loading},{getHistory:LO,getToasts:zO});function PO(t,{insertAt:n}={}){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}PO(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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 Hu(t){return t.label!==void 0}var IO=3,UO="32px",BO="16px",q0=4e3,$O=356,HO=14,GO=20,VO=200;function jr(...t){return t.filter(Boolean).join(" ")}function FO(t){let[n,a]=t.split("-"),o=[];return n&&o.push(n),a&&o.push(a),o}var YO=t=>{var n,a,o,c,l,d,m,p,g,b,v;let{invert:w,toast:y,unstyled:C,interacting:S,setHeights:N,visibleToasts:E,heights:T,index:M,toasts:k,expanded:_,removeToast:R,defaultRichColors:L,closeButton:ne,style:X,cancelButtonStyle:I,actionButtonStyle:H,className:q="",descriptionClassName:ce="",duration:de,position:se,gap:P,loadingIcon:W,expandByDefault:oe,classNames:ae,icons:G,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:D}=t,[B,V]=ve.useState(null),[Z,be]=ve.useState(null),[K,ge]=ve.useState(!1),[me,$]=ve.useState(!1),[ie,ye]=ve.useState(!1),[Se,Be]=ve.useState(!1),[Ke,We]=ve.useState(!1),[qt,vn]=ve.useState(0),[Xn,br]=ve.useState(0),yn=ve.useRef(y.duration||de||q0),wn=ve.useRef(null),Zn=ve.useRef(null),Kt=M===0,po=M+1<=E,Pt=y.type,Qn=y.dismissible!==!1,Da=y.className||"",Es=y.descriptionClassName||"",qr=ve.useMemo(()=>T.findIndex(De=>De.toastId===y.id)||0,[T,y.id]),ho=ve.useMemo(()=>{var De;return(De=y.closeButton)!=null?De:ne},[y.closeButton,ne]),Kr=ve.useMemo(()=>y.duration||de||q0,[y.duration,de]),Dn=ve.useRef(0),yt=ve.useRef(0),On=ve.useRef(0),Rt=ve.useRef(null),[Ai,_i]=se.split("-"),go=ve.useMemo(()=>T.reduce((De,rt,lt)=>lt>=qr?De:De+rt.height,0),[T,qr]),Wr=RO(),Oa=y.invert||w,Ar=Pt==="loading";yt.current=ve.useMemo(()=>qr*P+go,[qr,go]),ve.useEffect(()=>{yn.current=Kr},[Kr]),ve.useEffect(()=>{ge(!0)},[]),ve.useEffect(()=>{let De=Zn.current;if(De){let rt=De.getBoundingClientRect().height;return br(rt),N(lt=>[{toastId:y.id,height:rt,position:y.position},...lt]),()=>N(lt=>lt.filter(rn=>rn.toastId!==y.id))}},[N,y.id]),ve.useLayoutEffect(()=>{if(!K)return;let De=Zn.current,rt=De.style.height;De.style.height="auto";let lt=De.getBoundingClientRect().height;De.style.height=rt,br(lt),N(rn=>rn.find(It=>It.toastId===y.id)?rn.map(It=>It.toastId===y.id?{...It,height:lt}:It):[{toastId:y.id,height:lt,position:y.position},...rn])},[K,y.title,y.description,N,y.id]);let Wt=ve.useCallback(()=>{$(!0),vn(yt.current),N(De=>De.filter(rt=>rt.toastId!==y.id)),setTimeout(()=>{R(y)},VO)},[y,R,N,yt]);ve.useEffect(()=>{if(y.promise&&Pt==="loading"||y.duration===1/0||y.type==="loading")return;let De;return _||S||D&&Wr?(()=>{if(On.current<Dn.current){let rt=new Date().getTime()-Dn.current;yn.current=yn.current-rt}On.current=new Date().getTime()})():yn.current!==1/0&&(Dn.current=new Date().getTime(),De=setTimeout(()=>{var rt;(rt=y.onAutoClose)==null||rt.call(y,y),Wt()},yn.current)),()=>clearTimeout(De)},[_,S,y,Pt,D,Wr,Wt]),ve.useEffect(()=>{y.delete&&Wt()},[Wt,y.delete]);function La(){var De,rt,lt;return G!=null&&G.loading?ve.createElement("div",{className:jr(ae==null?void 0:ae.loader,(De=y==null?void 0:y.classNames)==null?void 0:De.loader,"sonner-loader"),"data-visible":Pt==="loading"},G.loading):W?ve.createElement("div",{className:jr(ae==null?void 0:ae.loader,(rt=y==null?void 0:y.classNames)==null?void 0:rt.loader,"sonner-loader"),"data-visible":Pt==="loading"},W):ve.createElement(SO,{className:jr(ae==null?void 0:ae.loader,(lt=y==null?void 0:y.classNames)==null?void 0:lt.loader),visible:Pt==="loading"})}return ve.createElement("li",{tabIndex:0,ref:Zn,className:jr(q,Da,ae==null?void 0:ae.toast,(n=y==null?void 0:y.classNames)==null?void 0:n.toast,ae==null?void 0:ae.default,ae==null?void 0:ae[Pt],(a=y==null?void 0:y.classNames)==null?void 0:a[Pt]),"data-sonner-toast":"","data-rich-colors":(o=y.richColors)!=null?o:L,"data-styled":!(y.jsx||y.unstyled||C),"data-mounted":K,"data-promise":!!y.promise,"data-swiped":Ke,"data-removed":me,"data-visible":po,"data-y-position":Ai,"data-x-position":_i,"data-index":M,"data-front":Kt,"data-swiping":ie,"data-dismissible":Qn,"data-type":Pt,"data-invert":Oa,"data-swipe-out":Se,"data-swipe-direction":Z,"data-expanded":!!(_||oe&&K),style:{"--index":M,"--toasts-before":M,"--z-index":k.length-M,"--offset":`${me?qt:yt.current}px`,"--initial-height":oe?"auto":`${Xn}px`,...X,...y.style},onDragEnd:()=>{ye(!1),V(null),Rt.current=null},onPointerDown:De=>{Ar||!Qn||(wn.current=new Date,vn(yt.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(ye(!0),Rt.current={x:De.clientX,y:De.clientY}))},onPointerUp:()=>{var De,rt,lt,rn;if(Se||!Qn)return;Rt.current=null;let It=Number(((De=Zn.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jn=Number(((rt=Zn.current)==null?void 0:rt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),er=new Date().getTime()-((lt=wn.current)==null?void 0:lt.getTime()),bt=B==="x"?It:Jn,Ln=Math.abs(bt)/er;if(Math.abs(bt)>=GO||Ln>.11){vn(yt.current),(rn=y.onDismiss)==null||rn.call(y,y),be(B==="x"?It>0?"right":"left":Jn>0?"down":"up"),Wt(),Be(!0),We(!1);return}ye(!1),V(null)},onPointerMove:De=>{var rt,lt,rn,It;if(!Rt.current||!Qn||((rt=window.getSelection())==null?void 0:rt.toString().length)>0)return;let Jn=De.clientY-Rt.current.y,er=De.clientX-Rt.current.x,bt=(lt=t.swipeDirections)!=null?lt:FO(se);!B&&(Math.abs(er)>1||Math.abs(Jn)>1)&&V(Math.abs(er)>Math.abs(Jn)?"x":"y");let Ln={x:0,y:0};B==="y"?(bt.includes("top")||bt.includes("bottom"))&&(bt.includes("top")&&Jn<0||bt.includes("bottom")&&Jn>0)&&(Ln.y=Jn):B==="x"&&(bt.includes("left")||bt.includes("right"))&&(bt.includes("left")&&er<0||bt.includes("right")&&er>0)&&(Ln.x=er),(Math.abs(Ln.x)>0||Math.abs(Ln.y)>0)&&We(!0),(rn=Zn.current)==null||rn.style.setProperty("--swipe-amount-x",`${Ln.x}px`),(It=Zn.current)==null||It.style.setProperty("--swipe-amount-y",`${Ln.y}px`)}},ho&&!y.jsx?ve.createElement("button",{"aria-label":O,"data-disabled":Ar,"data-close-button":!0,onClick:Ar||!Qn?()=>{}:()=>{var De;Wt(),(De=y.onDismiss)==null||De.call(y,y)},className:jr(ae==null?void 0:ae.closeButton,(c=y==null?void 0:y.classNames)==null?void 0:c.closeButton)},(l=G==null?void 0:G.close)!=null?l:MO):null,y.jsx||f.isValidElement(y.title)?y.jsx?y.jsx:typeof y.title=="function"?y.title():y.title:ve.createElement(ve.Fragment,null,Pt||y.icon||y.promise?ve.createElement("div",{"data-icon":"",className:jr(ae==null?void 0:ae.icon,(d=y==null?void 0:y.classNames)==null?void 0:d.icon)},y.promise||y.type==="loading"&&!y.icon?y.icon||La():null,y.type!=="loading"?y.icon||(G==null?void 0:G[Pt])||jO(Pt):null):null,ve.createElement("div",{"data-content":"",className:jr(ae==null?void 0:ae.content,(m=y==null?void 0:y.classNames)==null?void 0:m.content)},ve.createElement("div",{"data-title":"",className:jr(ae==null?void 0:ae.title,(p=y==null?void 0:y.classNames)==null?void 0:p.title)},typeof y.title=="function"?y.title():y.title),y.description?ve.createElement("div",{"data-description":"",className:jr(ce,Es,ae==null?void 0:ae.description,(g=y==null?void 0:y.classNames)==null?void 0:g.description)},typeof y.description=="function"?y.description():y.description):null),f.isValidElement(y.cancel)?y.cancel:y.cancel&&Hu(y.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:y.cancelButtonStyle||I,onClick:De=>{var rt,lt;Hu(y.cancel)&&Qn&&((lt=(rt=y.cancel).onClick)==null||lt.call(rt,De),Wt())},className:jr(ae==null?void 0:ae.cancelButton,(b=y==null?void 0:y.classNames)==null?void 0:b.cancelButton)},y.cancel.label):null,f.isValidElement(y.action)?y.action:y.action&&Hu(y.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:y.actionButtonStyle||H,onClick:De=>{var rt,lt;Hu(y.action)&&((lt=(rt=y.action).onClick)==null||lt.call(rt,De),!De.defaultPrevented&&Wt())},className:jr(ae==null?void 0:ae.actionButton,(v=y==null?void 0:y.classNames)==null?void 0:v.actionButton)},y.action.label):null))};function K0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function qO(t,n){let a={};return[t,n].forEach((o,c)=>{let l=c===1,d=l?"--mobile-offset":"--offset",m=l?BO:UO;function p(g){["top","right","bottom","left"].forEach(b=>{a[`${d}-${b}`]=typeof g=="number"?`${g}px`:g})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(g=>{o[g]===void 0?a[`${d}-${g}`]=m:a[`${d}-${g}`]=typeof o[g]=="number"?`${o[g]}px`:o[g]}):p(m)}),a}var KO=f.forwardRef(function(t,n){let{invert:a,position:o="bottom-right",hotkey:c=["altKey","KeyT"],expand:l,closeButton:d,className:m,offset:p,mobileOffset:g,theme:b="light",richColors:v,duration:w,style:y,visibleToasts:C=IO,toastOptions:S,dir:N=K0(),gap:E=HO,loadingIcon:T,icons:M,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:_}=t,[R,L]=ve.useState([]),ne=ve.useMemo(()=>Array.from(new Set([o].concat(R.filter(D=>D.position).map(D=>D.position)))),[R,o]),[X,I]=ve.useState([]),[H,q]=ve.useState(!1),[ce,de]=ve.useState(!1),[se,P]=ve.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=ve.useRef(null),oe=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ae=ve.useRef(null),G=ve.useRef(!1),O=ve.useCallback(D=>{L(B=>{var V;return(V=B.find(Z=>Z.id===D.id))!=null&&V.delete||Mn.dismiss(D.id),B.filter(({id:Z})=>Z!==D.id)})},[]);return ve.useEffect(()=>Mn.subscribe(D=>{if(D.dismiss){L(B=>B.map(V=>V.id===D.id?{...V,delete:!0}:V));return}setTimeout(()=>{m8.flushSync(()=>{L(B=>{let V=B.findIndex(Z=>Z.id===D.id);return V!==-1?[...B.slice(0,V),{...B[V],...D},...B.slice(V+1)]:[D,...B]})})})}),[]),ve.useEffect(()=>{if(b!=="system"){P(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;let D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:B})=>{P(B?"dark":"light")})}catch{D.addListener(({matches:V})=>{try{P(V?"dark":"light")}catch(Z){console.error(Z)}})}},[b]),ve.useEffect(()=>{R.length<=1&&q(!1)},[R]),ve.useEffect(()=>{let D=B=>{var V,Z;c.every(be=>B[be]||B.code===be)&&(q(!0),(V=W.current)==null||V.focus()),B.code==="Escape"&&(document.activeElement===W.current||(Z=W.current)!=null&&Z.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[c]),ve.useEffect(()=>{if(W.current)return()=>{ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null,G.current=!1)}},[W.current]),ve.createElement("section",{ref:n,"aria-label":`${k} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ne.map((D,B)=>{var V;let[Z,be]=D.split("-");return R.length?ve.createElement("ol",{key:D,dir:N==="auto"?K0():N,tabIndex:-1,ref:W,className:m,"data-sonner-toaster":!0,"data-theme":se,"data-y-position":Z,"data-lifted":H&&R.length>1&&!l,"data-x-position":be,style:{"--front-toast-height":`${((V=X[0])==null?void 0:V.height)||0}px`,"--width":`${$O}px`,"--gap":`${E}px`,...y,...qO(p,g)},onBlur:K=>{G.current&&!K.currentTarget.contains(K.relatedTarget)&&(G.current=!1,ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||G.current||(G.current=!0,ae.current=K.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{ce||q(!1)},onDragEnd:()=>q(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||de(!0)},onPointerUp:()=>de(!1)},R.filter(K=>!K.position&&B===0||K.position===D).map((K,ge)=>{var me,$;return ve.createElement(YO,{key:K.id,icons:M,index:ge,toast:K,defaultRichColors:v,duration:(me=S==null?void 0:S.duration)!=null?me:w,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:a,visibleToasts:C,closeButton:($=S==null?void 0:S.closeButton)!=null?$:d,interacting:ce,position:D,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,removeToast:O,toasts:R.filter(ie=>ie.position==K.position),heights:X.filter(ie=>ie.position==K.position),setHeights:I,expandByDefault:l,gap:E,loadingIcon:T,expanded:H,pauseWhenPageIsHidden:_,swipeDirections:t.swipeDirections})})):null}))});async function nd(t){const n=Dt.loading("Saving changes…");try{const a=await t();if(Dt.success("Changes saved",{id:n}),a.botRestart){const o=Dt.loading("Restarting bot…");a.botRestart.success?Dt.success("Bot started",{id:o}):Dt.error(a.botRestart.error??"Could not start bot",{id:o})}return a}catch(a){throw Dt.error(a instanceof Error?a.message:"Save failed",{id:n}),a}}function WO({filename:t}){const{canEditConfig:n}=Yt(),a=!n("supportbot"),[o,c]=f.useState(null),[l,d]=f.useState(null),[m,p]=f.useState(!0),[g,b]=f.useState(!1),[v,w]=f.useState(""),[y,C]=f.useState(""),S=f.useCallback(async()=>{p(!0),w(""),C("");try{const _=(await Ne.getAddonConfigJson(t)).data??{};c(_),d(structuredClone(_))}catch(k){w(k instanceof Error?k.message:"Failed to load config")}finally{p(!1)}},[t]);f.useEffect(()=>{S()},[S]);const N=o?wO(o):null;function E(k,_){c(R=>R&&Gn(R,k,_))}async function T(){if(!(a||!o)){b(!0),w(""),C("");try{const k=await nd(()=>Ne.saveAddonConfig(t,o));C(k.message||"Saved."),await S()}catch(k){w(k instanceof Error?k.message:"Save failed")}finally{b(!1)}}}if(m)return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Ue,{className:"h-24 w-full rounded-xl"}),s.jsx(Ue,{className:"h-48 w-full rounded-xl"})]});if(!o||!N)return s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:v||"Failed to load"})});const M=l&&JSON.stringify(o)!==JSON.stringify(l);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[M?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,s.jsx(ue,{variant:"outline",size:"sm",onClick:S,disabled:m||g,children:"Reload"}),a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(ue,{size:"sm",onClick:T,disabled:g||!M,children:[s.jsx(xe,{icon:Sd,size:16,className:"mr-1.5"}),g?"Saving…":"Save"]})]}),v?s.jsxs(Ye,{variant:"destructive",children:[s.jsx(xe,{icon:ig,size:18}),s.jsx(qe,{children:v})]}):null,y?s.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(qe,{children:y})}):null,N.map(k=>s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"pb-3",children:[s.jsx(ft,{className:"text-base",children:k.title}),k.description?s.jsx(Ot,{children:k.description}):null]}),s.jsx(et,{className:"grid gap-4 sm:grid-cols-2",children:k.fields.map(_=>s.jsx("div",{className:_.type==="textarea"||_.type==="stringList"?"sm:col-span-2":"",children:s.jsx(pd,{field:_,value:kr(o,_.path),readOnly:a,onChange:R=>E(_.path,R)})},_.path))})]},k.title))]})}function XO(t){return t.startsWith("Ticket.DepartmentSystem.")?"Ticket Departments":t.startsWith("Ticket.PrioritySystem.")?"Ticket Priorities":t.startsWith("Ticket.")?"Tickets":(t.split(".")[0]??"Other").replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,a=>a.toUpperCase())}function ZO(t,n){const a=new Set(t.flatMap(d=>d.fields.map(m=>m.path))),o=Nx(n).filter(d=>!a.has(d.path));if(o.length===0)return t;const c=t.map(d=>({...d,fields:[...d.fields]})),l=new Map;for(const d of o){const m=XO(d.path),p=l.get(m)??[];p.push(d),l.set(m,p)}for(const[d,m]of l.entries()){const p=c.find(g=>g.title.toLowerCase()===d.toLowerCase());p?p.fields.push(...m):c.push({title:d,description:"These options exist in your config file but are not in the main editor sections.",fields:m.sort((g,b)=>g.path.localeCompare(b.path))})}return c}function W0(t,n){(n==null||n>t.length)&&(n=t.length);for(var a=0,o=Array(n);a<n;a++)o[a]=t[a];return o}function QO(t){if(Array.isArray(t))return t}function JO(t,n,a){return(n=oL(n))in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function eL(t,n){var a=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a!=null){var o,c,l,d,m=[],p=!0,g=!1;try{if(l=(a=a.call(t)).next,n!==0)for(;!(p=(o=l.call(a)).done)&&(m.push(o.value),m.length!==n);p=!0);}catch(b){g=!0,c=b}finally{try{if(!p&&a.return!=null&&(d=a.return(),Object(d)!==d))return}finally{if(g)throw c}}return m}}function tL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X0(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),a.push.apply(a,o)}return a}function Z0(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?X0(Object(a),!0).forEach(function(o){JO(t,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):X0(Object(a)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(a,o))})}return t}function nL(t,n){if(t==null)return{};var a,o,c=rL(t,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(o=0;o<l.length;o++)a=l[o],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(c[a]=t[a])}return c}function rL(t,n){if(t==null)return{};var a={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(n.indexOf(o)!==-1)continue;a[o]=t[o]}return a}function aL(t,n){return QO(t)||eL(t,n)||iL(t,n)||tL()}function sL(t,n){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var o=a.call(t,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}function oL(t){var n=sL(t,"string");return typeof n=="symbol"?n:n+""}function iL(t,n){if(t){if(typeof t=="string")return W0(t,n);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?W0(t,n):void 0}}function lL(t,n,a){return n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function Q0(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),a.push.apply(a,o)}return a}function J0(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Q0(Object(a),!0).forEach(function(o){lL(t,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Q0(Object(a)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(a,o))})}return t}function cL(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return function(o){return n.reduceRight(function(c,l){return l(c)},o)}}function Al(t){return function n(){for(var a=this,o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];return c.length>=t.length?t.apply(this,c):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(c,m))}}}function hd(t){return{}.toString.call(t).includes("Object")}function uL(t){return!Object.keys(t).length}function Ql(t){return typeof t=="function"}function dL(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function fL(t,n){return hd(n)||us("changeType"),Object.keys(n).some(function(a){return!dL(t,a)})&&us("changeField"),n}function mL(t){Ql(t)||us("selectorType")}function pL(t){Ql(t)||hd(t)||us("handlerType"),hd(t)&&Object.values(t).some(function(n){return!Ql(n)})&&us("handlersType")}function hL(t){t||us("initialIsRequired"),hd(t)||us("initialType"),uL(t)&&us("initialContent")}function gL(t,n){throw new Error(t[n]||t.default)}var xL={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},us=Al(gL)(xL),Gu={changes:fL,selector:mL,handler:pL,initial:hL};function bL(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Gu.initial(t),Gu.handler(n);var a={current:t},o=Al(wL)(a,n),c=Al(yL)(a),l=Al(Gu.changes)(t),d=Al(vL)(a);function m(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(b){return b};return Gu.selector(g),g(a.current)}function p(g){cL(o,c,l,d)(g)}return[m,p]}function vL(t,n){return Ql(n)?n(t.current):n}function yL(t,n){return t.current=J0(J0({},t.current),n),n}function wL(t,n,a){return Ql(n)?n(t.current):Object.keys(a).forEach(function(o){var c;return(c=n[o])===null||c===void 0?void 0:c.call(n,t.current[o])}),a}var jL={create:bL},CL={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function SL(t){return function n(){for(var a=this,o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];return c.length>=t.length?t.apply(this,c):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(c,m))}}}function NL(t){return{}.toString.call(t).includes("Object")}function EL(t){return t||e2("configIsRequired"),NL(t)||e2("configType"),t.urls?(kL(),{paths:{vs:t.urls.monacoBase}}):t}function kL(){console.warn(t5.deprecation)}function TL(t,n){throw new Error(t[n]||t.default)}var t5={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
||
You are using deprecated way of configuration.
|
||
|
||
Instead of using
|
||
monaco.config({ urls: { monacoBase: '...' } })
|
||
use
|
||
monaco.config({ paths: { vs: '...' } })
|
||
|
||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||
`},e2=SL(TL)(t5),ML={config:EL},RL=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return function(c){return a.reduceRight(function(l,d){return d(l)},c)}};function n5(t,n){return Object.keys(n).forEach(function(a){n[a]instanceof Object&&t[a]&&Object.assign(n[a],n5(t[a],n[a]))}),Z0(Z0({},t),n)}var AL={type:"cancelation",msg:"operation is manually canceled"};function Wp(t){var n=!1,a=new Promise(function(o,c){t.then(function(l){return n?c(AL):o(l)}),t.catch(c)});return a.cancel=function(){return n=!0},a}var _L=["monaco"],DL=jL.create({config:CL,isInitialized:!1,resolve:null,reject:null,monaco:null}),r5=aL(DL,2),pc=r5[0],nf=r5[1];function OL(t){var n=ML.config(t),a=n.monaco,o=nL(n,_L);nf(function(c){return{config:n5(c.config,o),monaco:a}})}function LL(){var t=pc(function(n){var a=n.monaco,o=n.isInitialized,c=n.resolve;return{monaco:a,isInitialized:o,resolve:c}});if(!t.isInitialized){if(nf({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Wp(Xp);if(window.monaco&&window.monaco.editor)return a5(window.monaco),t.resolve(window.monaco),Wp(Xp);RL(zL,IL)(UL)}return Wp(Xp)}function zL(t){return document.body.appendChild(t)}function PL(t){var n=document.createElement("script");return t&&(n.src=t),n}function IL(t){var n=pc(function(o){var c=o.config,l=o.reject;return{config:c,reject:l}}),a=PL("".concat(n.config.paths.vs,"/loader.js"));return a.onload=function(){return t()},a.onerror=n.reject,a}function UL(){var t=pc(function(a){var o=a.config,c=a.resolve,l=a.reject;return{config:o,resolve:c,reject:l}}),n=window.require;n.config(t.config),n(["vs/editor/editor.main"],function(a){var o=a.m||a;a5(o),t.resolve(o)},function(a){t.reject(a)})}function a5(t){pc().monaco||nf({monaco:t})}function BL(){return pc(function(t){var n=t.monaco;return n})}var Xp=new Promise(function(t,n){return nf({resolve:t,reject:n})}),s5={config:OL,init:LL,__getMonacoInstance:BL},$L={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Zp=$L,HL={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},GL=HL;function VL({children:t}){return ve.createElement("div",{style:GL.container},t)}var FL=VL,YL=FL;function qL({width:t,height:n,isEditorReady:a,loading:o,_ref:c,className:l,wrapperProps:d}){return ve.createElement("section",{style:{...Zp.wrapper,width:t,height:n},...d},!a&&ve.createElement(YL,null,o),ve.createElement("div",{ref:c,style:{...Zp.fullWidth,...!a&&Zp.hide},className:l}))}var KL=qL,o5=f.memo(KL);function WL(t){f.useEffect(t,[])}var i5=WL;function XL(t,n,a=!0){let o=f.useRef(!0);f.useEffect(o.current||!a?()=>{o.current=!1}:t,n)}var Yn=XL;function zl(){}function si(t,n,a,o){return ZL(t,o)||QL(t,n,a,o)}function ZL(t,n){return t.editor.getModel(l5(t,n))}function QL(t,n,a,o){return t.editor.createModel(n,a,o?l5(t,o):void 0)}function l5(t,n){return t.Uri.parse(n)}function JL({original:t,modified:n,language:a,originalLanguage:o,modifiedLanguage:c,originalModelPath:l,modifiedModelPath:d,keepCurrentOriginalModel:m=!1,keepCurrentModifiedModel:p=!1,theme:g="light",loading:b="Loading...",options:v={},height:w="100%",width:y="100%",className:C,wrapperProps:S={},beforeMount:N=zl,onMount:E=zl}){let[T,M]=f.useState(!1),[k,_]=f.useState(!0),R=f.useRef(null),L=f.useRef(null),ne=f.useRef(null),X=f.useRef(E),I=f.useRef(N),H=f.useRef(!1);i5(()=>{let se=s5.init();return se.then(P=>(L.current=P)&&_(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>R.current?de():se.cancel()}),Yn(()=>{if(R.current&&L.current){let se=R.current.getOriginalEditor(),P=si(L.current,t||"",o||a||"text",l||"");P!==se.getModel()&&se.setModel(P)}},[l],T),Yn(()=>{if(R.current&&L.current){let se=R.current.getModifiedEditor(),P=si(L.current,n||"",c||a||"text",d||"");P!==se.getModel()&&se.setModel(P)}},[d],T),Yn(()=>{let se=R.current.getModifiedEditor();se.getOption(L.current.editor.EditorOption.readOnly)?se.setValue(n||""):n!==se.getValue()&&(se.executeEdits("",[{range:se.getModel().getFullModelRange(),text:n||"",forceMoveMarkers:!0}]),se.pushUndoStop())},[n],T),Yn(()=>{var se,P;(P=(se=R.current)==null?void 0:se.getModel())==null||P.original.setValue(t||"")},[t],T),Yn(()=>{let{original:se,modified:P}=R.current.getModel();L.current.editor.setModelLanguage(se,o||a||"text"),L.current.editor.setModelLanguage(P,c||a||"text")},[a,o,c],T),Yn(()=>{var se;(se=L.current)==null||se.editor.setTheme(g)},[g],T),Yn(()=>{var se;(se=R.current)==null||se.updateOptions(v)},[v],T);let q=f.useCallback(()=>{var W;if(!L.current)return;I.current(L.current);let se=si(L.current,t||"",o||a||"text",l||""),P=si(L.current,n||"",c||a||"text",d||"");(W=R.current)==null||W.setModel({original:se,modified:P})},[a,n,c,t,o,l,d]),ce=f.useCallback(()=>{var se;!H.current&&ne.current&&(R.current=L.current.editor.createDiffEditor(ne.current,{automaticLayout:!0,...v}),q(),(se=L.current)==null||se.editor.setTheme(g),M(!0),H.current=!0)},[v,g,q]);f.useEffect(()=>{T&&X.current(R.current,L.current)},[T]),f.useEffect(()=>{!k&&!T&&ce()},[k,T,ce]);function de(){var P,W,oe,ae;let se=(P=R.current)==null?void 0:P.getModel();m||((W=se==null?void 0:se.original)==null||W.dispose()),p||((oe=se==null?void 0:se.modified)==null||oe.dispose()),(ae=R.current)==null||ae.dispose()}return ve.createElement(o5,{width:y,height:w,isEditorReady:T,loading:b,_ref:ne,className:C,wrapperProps:S})}var ez=JL;f.memo(ez);function tz(t){let n=f.useRef();return f.useEffect(()=>{n.current=t},[t]),n.current}var nz=tz,Vu=new Map;function rz({defaultValue:t,defaultLanguage:n,defaultPath:a,value:o,language:c,path:l,theme:d="light",line:m,loading:p="Loading...",options:g={},overrideServices:b={},saveViewState:v=!0,keepCurrentModel:w=!1,width:y="100%",height:C="100%",className:S,wrapperProps:N={},beforeMount:E=zl,onMount:T=zl,onChange:M,onValidate:k=zl}){let[_,R]=f.useState(!1),[L,ne]=f.useState(!0),X=f.useRef(null),I=f.useRef(null),H=f.useRef(null),q=f.useRef(T),ce=f.useRef(E),de=f.useRef(),se=f.useRef(o),P=nz(l),W=f.useRef(!1),oe=f.useRef(!1);i5(()=>{let O=s5.init();return O.then(D=>(X.current=D)&&ne(!1)).catch(D=>(D==null?void 0:D.type)!=="cancelation"&&console.error("Monaco initialization: error:",D)),()=>I.current?G():O.cancel()}),Yn(()=>{var D,B,V,Z;let O=si(X.current,t||o||"",n||c||"",l||a||"");O!==((D=I.current)==null?void 0:D.getModel())&&(v&&Vu.set(P,(B=I.current)==null?void 0:B.saveViewState()),(V=I.current)==null||V.setModel(O),v&&((Z=I.current)==null||Z.restoreViewState(Vu.get(l))))},[l],_),Yn(()=>{var O;(O=I.current)==null||O.updateOptions(g)},[g],_),Yn(()=>{!I.current||o===void 0||(I.current.getOption(X.current.editor.EditorOption.readOnly)?I.current.setValue(o):o!==I.current.getValue()&&(oe.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),I.current.pushUndoStop(),oe.current=!1))},[o],_),Yn(()=>{var D,B;let O=(D=I.current)==null?void 0:D.getModel();O&&c&&((B=X.current)==null||B.editor.setModelLanguage(O,c))},[c],_),Yn(()=>{var O;m!==void 0&&((O=I.current)==null||O.revealLine(m))},[m],_),Yn(()=>{var O;(O=X.current)==null||O.editor.setTheme(d)},[d],_);let ae=f.useCallback(()=>{var O;if(!(!H.current||!X.current)&&!W.current){ce.current(X.current);let D=l||a,B=si(X.current,o||t||"",n||c||"",D||"");I.current=(O=X.current)==null?void 0:O.editor.create(H.current,{model:B,automaticLayout:!0,...g},b),v&&I.current.restoreViewState(Vu.get(D)),X.current.editor.setTheme(d),m!==void 0&&I.current.revealLine(m),R(!0),W.current=!0}},[t,n,a,o,c,l,g,b,v,d,m]);f.useEffect(()=>{_&&q.current(I.current,X.current)},[_]),f.useEffect(()=>{!L&&!_&&ae()},[L,_,ae]),se.current=o,f.useEffect(()=>{var O,D;_&&M&&((O=de.current)==null||O.dispose(),de.current=(D=I.current)==null?void 0:D.onDidChangeModelContent(B=>{oe.current||M(I.current.getValue(),B)}))},[_,M]),f.useEffect(()=>{if(_){let O=X.current.editor.onDidChangeMarkers(D=>{var V;let B=(V=I.current.getModel())==null?void 0:V.uri;if(B&&D.find(Z=>Z.path===B.path)){let Z=X.current.editor.getModelMarkers({resource:B});k==null||k(Z)}});return()=>{O==null||O.dispose()}}return()=>{}},[_,k]);function G(){var O,D;(O=de.current)==null||O.dispose(),w?v&&Vu.set(l,I.current.saveViewState()):(D=I.current.getModel())==null||D.dispose(),I.current.dispose()}return ve.createElement(o5,{width:y,height:C,isEditorReady:_,loading:p,_ref:H,className:S,wrapperProps:N})}var az=rz,sz=f.memo(az),oz=sz;function iz(t){return t!==null&&typeof t=="object"&&"Command"in t}function lz(t){return Object.entries(t).filter(([,n])=>iz(n)).map(([n,a])=>({key:n,...a}))}function cz({data:t,onChange:n}){const a=lz(t);function o(c,l){const d=t[c];n({...t,[c]:{...d,...l}})}return a.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands found in this config."}):s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.map(c=>s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"flex flex-row items-center gap-2 space-y-0 pb-2",children:[s.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(xe,{icon:ds,size:18})}),s.jsx(ft,{className:"text-base",children:c.key})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ae,{htmlFor:`${c.key}-enabled`,children:"Enabled"}),s.jsx(Mt,{id:`${c.key}-enabled`,checked:c.Enabled!==!1,onCheckedChange:l=>o(c.key,{Enabled:l})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ae,{children:"Slash command"}),s.jsx(_e,{value:c.Command??"",onChange:l=>o(c.key,{Command:l.target.value}),className:"border-border bg-secondary/30 font-mono"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ae,{children:"Description"}),s.jsx(_e,{value:c.Description??"",onChange:l=>o(c.key,{Description:l.target.value}),className:"border-border bg-secondary/30"})]})]})]},c.key))})}function uz(t,n){let a=structuredClone(n);if(t==="supportbot"){const o=kr(a,"General.Token");o&&o!=="BOT_TOKEN"&&(a=Gn(a,"General.Token","BOT_TOKEN"))}if(t==="supportbot-ai"){const o=kr(a,"General.Model_API_Key");o&&o!=="MODEL_API_KEY"&&(a=Gn(a,"General.Model_API_Key","MODEL_API_KEY"))}return a}function dz(t,n,a,o){const c={};for(const l of n)for(const d of l.fields){const m=kr(a,d.path),p=kr(o,d.path);d.type==="secret"&&(m==="BOT_TOKEN"||m==="MODEL_API_KEY"||m===""||m===void 0)||JSON.stringify(m)!==JSON.stringify(p)&&(c[`${t}:${d.path}`]=m)}return c}function fz(t,n){const a=new Map,o=[];for(const l of t){const d=l.path.split(".");if(d.length>=5&&d[1]==="DepartmentSystem"&&d[2]==="Departments"){const m=d[3],p=a.get(m)??[];p.push(l),a.set(m,p)}else if(d.length>=3){const m=d[1],p=a.get(m)??[];p.push(l),a.set(m,p)}else o.push(l)}if(a.size===0)return{standalone:t,groups:[]};const c=[...a.entries()].map(([l,d])=>{const m=["enabled","name","description","emoji","category","role","channelprefix","defaultpriority","questions"];d.sort((b,v)=>{var N,E;const w=((N=b.path.split(".").pop())==null?void 0:N.toLowerCase())||"",y=((E=v.path.split(".").pop())==null?void 0:E.toLowerCase())||"",C=m.indexOf(w),S=m.indexOf(y);return C!==-1&&S!==-1?C-S:C!==-1?-1:S!==-1?1:w.localeCompare(y)});const p=d.find(b=>b.path.toLowerCase().endsWith(".name")||b.path.toLowerCase().endsWith(".title"));let g="";if(p&&n){const b=kr(n,p.path);typeof b=="string"&&b.trim()&&(g=b.trim())}return g||(g=l.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())),{key:l,name:g,fields:d}});return{standalone:o,groups:c}}function mz({configFile:t}){const{permissions:n,canEditConfig:a}=Yt(),o=Rn(n,"configs.raw_yaml"),c=!a(t),[l,d]=f.useState(null),[m,p]=f.useState(null),[g,b]=f.useState(!0),[v,w]=f.useState(!1),[y,C]=f.useState(""),[S,N]=f.useState(""),[E,T]=f.useState("visual");f.useEffect(()=>{!o&&E==="yaml"&&T("visual")},[o,E]);const[M,k]=f.useState(""),[_,R]=f.useState(""),[L]=wd(),[ne,X]=f.useState(()=>L.get("tab")||null),[I,H]=f.useState(!1),[q,ce]=f.useState(""),[de,se]=f.useState(""),P=()=>{const K=q.trim().toLowerCase().replace(/[^a-z0-9_-]/g,"");if(!K||!l)return;const ge=de.trim()||K,me=`Ticket.DepartmentSystem.Departments.${K}`,$={...l};Gn($,`${me}.Name`,ge),Gn($,`${me}.Description`,`Open a ${ge} ticket`),Gn($,`${me}.Emoji`,"🎫"),Gn($,`${me}.Category`,"CATEGORY_ID"),Gn($,`${me}.Role`,"ROLE_ID"),Gn($,`${me}.ChannelPrefix`,`${K}-`),Gn($,`${me}.DefaultPriority`,"normal"),Gn($,`${me}.Questions`,["What do you need assistance with?"]),d($),H(!1),ce(""),se("")},W=K=>{if(!l)return;const ge=`Ticket.DepartmentSystem.Departments.${K}`,me=JSON.parse(JSON.stringify(l));if(Object.keys(me).forEach($=>{($.startsWith(ge)||$===ge)&&delete me[$]}),me.Ticket&&typeof me.Ticket=="object"){const $=me.Ticket.DepartmentSystem;$&&typeof $=="object"&&$.Departments&&typeof $.Departments=="object"&&delete $.Departments[K]}d(me)},oe=FM(t),ae=f.useMemo(()=>!oe||oe==="commands"||!l?oe:ZO(oe,l),[oe,l]);f.useEffect(()=>{var K;if(ae&&ae!=="commands"){const ge=L.get("tab");if(ge&&ae.find(me=>me.title.toLowerCase()===ge.toLowerCase())){const me=ae.find($=>$.title.toLowerCase()===ge.toLowerCase());me&&me.title!==ne&&X(me.title)}else(!ne||!ae.find(me=>me.title===ne))&&X(((K=ae[0])==null?void 0:K.title)||null)}},[ae,ne,L]);const G=f.useCallback(async()=>{b(!0),C(""),N("");try{const ge=(await Ne.getConfigJson(t)).data??{},me=uz(t,ge);d(me),p(me);const ie=(await Ne.getConfigRaw(t)).data??"",ye=z8(ie,t);k(ye),R(ye)}catch(K){C(K instanceof Error?K.message:"Failed to load config")}finally{b(!1)}},[t]);f.useEffect(()=>{G()},[G]);function O(K,ge){d(me=>me&&Gn(me,K,ge))}async function D(){if(!(c||M===_)){w(!0),C(""),N("");try{const K=await nd(()=>Ne.saveConfigRaw(t,M));N(K.message||"Config saved."),await G()}catch(K){C(K instanceof Error?K.message:"Save failed")}finally{w(!1)}}}async function B(){if(!(c||!l||!m)){if(E==="yaml"){await D();return}w(!0),C(""),N("");try{if(oe==="commands"){const K={};for(const me of Object.keys(l))JSON.stringify(l[me])!==JSON.stringify(m[me])&&(K[`${t}:${me}`]=l[me]);if(Object.keys(K).length===0){N("No changes to save.");return}const ge=await nd(()=>Ne.updateConfigFields(K));N(ge.message||"")}else if(ae&&ae!=="commands"){const K=dz(t,ae,l,m);if(Object.keys(K).length===0){N("No changes to save.");return}const ge=await nd(()=>Ne.updateConfigFields(K));N(ge.message||"")}await G()}catch(K){C(K instanceof Error?K.message:"Save failed")}finally{w(!1)}}}if(oe===null)return s.jsx(Ye,{children:s.jsx(qe,{children:"No visual editor available for this file."})});if(g)return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Ue,{className:"h-24 w-full rounded-xl"}),s.jsx(Ue,{className:"h-48 w-full rounded-xl"})]});if(!l)return s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:y||"Failed to load"})});const V=m&&JSON.stringify(l)!==JSON.stringify(m),be=E==="yaml"?M!==_:V;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[o?s.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[s.jsx(ue,{type:"button",variant:E==="visual"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>T("visual"),children:"Visual"}),s.jsx(ue,{type:"button",variant:E==="yaml"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>T("yaml"),children:"YAML"})]}):null,s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[be?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,s.jsx(ue,{variant:"outline",size:"sm",onClick:G,disabled:g||v,children:"Reload"}),c?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(ue,{size:"sm",onClick:B,disabled:v||!be,children:[s.jsx(xe,{icon:Sd,size:16,className:"mr-1.5"}),v?"Saving…":"Save"]})]})]}),y?s.jsxs(Ye,{variant:"destructive",children:[s.jsx(xe,{icon:ig,size:18}),s.jsx(qe,{children:y})]}):null,S?s.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(qe,{children:S})}):null,E==="yaml"?s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"pb-3",children:[s.jsx(ft,{className:"text-base",children:"Raw YAML"}),s.jsx(Ot,{children:"Edit the full file. Use this for nested lists (e.g. welcome buttons) or any option not in Visual mode."})]}),s.jsx(et,{className:"h-[min(520px,60vh)] overflow-hidden rounded-b-xl border-t border-border p-0",children:s.jsx(oz,{height:"100%",language:"yaml",theme:"vs-dark",value:M,onChange:K=>k(K||""),options:{readOnly:c,minimap:{enabled:!1},fontSize:13,wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:16},tabSize:2}})})]}):oe==="commands"?s.jsx(cz,{data:l,onChange:K=>d(K)}):ae&&ae!=="commands"?s.jsxs("div",{className:"grid gap-6 lg:grid-cols-[200px_1fr]",children:[s.jsx("nav",{className:"flex flex-col gap-1",children:ae.map(K=>s.jsx("button",{onClick:()=>X(K.title),className:pe("text-left px-3 py-2 text-sm rounded-md transition-colors",ne===K.title?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:K.title},K.title))}),s.jsx("div",{className:"min-w-0",children:ae.filter(K=>K.title===ne).map(K=>s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"pb-3 flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(ft,{className:"text-base",children:K.title}),K.description?s.jsx(Ot,{children:K.description}):null]}),K.title==="Ticket Departments"&&!c&&s.jsxs(ue,{type:"button",size:"sm",variant:"outline",onClick:()=>H(!0),className:"gap-1.5 text-xs h-8 shrink-0",children:[s.jsx(xe,{icon:sg,size:14})," Add Department"]})]}),s.jsx(et,{className:"space-y-6",children:(()=>{const{standalone:ge,groups:me}=fz(K.fields,l);return s.jsxs(s.Fragment,{children:[ge.length>0&&s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:ge.map($=>s.jsx("div",{className:$.type==="textarea"||$.type==="stringList"?"sm:col-span-2":"",children:s.jsx(pd,{field:$,value:kr(l,$.path),readOnly:c,onChange:ie=>O($.path,ie)})},$.path))}),me.map($=>s.jsxs("div",{className:"rounded-xl border border-border bg-card/60 p-4 space-y-4 shadow-sm transition-all hover:border-primary/40",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-border/60 pb-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-semibold text-base text-foreground",children:$.name}),s.jsx("span",{className:"text-xs font-mono px-2.5 py-0.5 rounded-full bg-primary/10 text-primary border border-primary/20 font-medium",children:K.title==="Ticket Departments"?`Ticket.${$.key}`:$.key})]}),K.title==="Ticket Departments"&&$.key!=="DepartmentSystem"&&!c&&s.jsx(ue,{type:"button",size:"sm",variant:"ghost",onClick:()=>W($.key),className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",title:"Delete Department",children:s.jsx(xe,{icon:bi,size:14})})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:$.fields.map(ie=>s.jsx("div",{className:ie.type==="textarea"||ie.type==="stringList"?"sm:col-span-2":"",children:s.jsx(pd,{field:ie,value:kr(l,ie.path),readOnly:c,onChange:ye=>O(ie.path,ye)})},ie.path))})]},$.key))]})})()})]},K.title))})]}):null,s.jsx(Qs,{open:I,onOpenChange:H,children:s.jsxs(hs,{className:"sm:max-w-[400px]",children:[s.jsxs(gs,{children:[s.jsx(xs,{className:"text-base",children:"Add Ticket Department"}),s.jsx(bs,{className:"text-xs",children:"Create a new support department for ticket creation."})]}),s.jsxs("div",{className:"space-y-3 py-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ae,{className:"text-xs font-semibold",children:"Department Key (Internal ID)"}),s.jsx(_e,{placeholder:"billing",value:q,onChange:K=>ce(K.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"")),className:"text-xs font-mono border-border bg-secondary/30"}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["e.g. ",s.jsx("code",{children:"billing"}),", ",s.jsx("code",{children:"technical"}),", ",s.jsx("code",{children:"sales"})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ae,{className:"text-xs font-semibold",children:"Department Display Name"}),s.jsx(_e,{placeholder:"Billing & Sales Support",value:de,onChange:K=>se(K.target.value),className:"text-xs border-border bg-secondary/30"})]})]}),s.jsxs(Js,{className:"gap-2 sm:gap-0",children:[s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>H(!1),className:"text-xs",children:"Cancel"}),s.jsx(ue,{size:"sm",onClick:P,disabled:!q.trim(),className:"text-xs bg-primary font-semibold",children:"Create Department"})]})]})})]})}const pz=Ne.listConfigs(),hz={supportbot:"Bot config","ticket-panel":"Ticket panel",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"};function gz(){var M,k;const{permissions:t,canViewConfig:n}=Yt(),{files:a}=$2(),[o,c]=wd(),l=o.get("file"),d=n("supportbot"),m=f.useMemo(()=>pz.filter(_=>n(_)),[n]),p=f.useMemo(()=>d?a:[],[d,a]),g=f.useMemo(()=>[...m,...p.map(_=>_l(_))],[m,p]),b=g[0]??"",[v,w]=f.useState(()=>l&&g.includes(l)?l:b);if(f.useEffect(()=>{l&&g.includes(l)?w(l):g.includes(v)||(w(b),b&&c({file:b}))},[l,g,v,b,c]),g.length===0)return s.jsx(ya,{to:mg(t),replace:!0});const y=H8(v),C=(y==null?void 0:y.type)==="addon",S=C?y.file:null,N=C?H2(S):hz[v]??"Configuration",E=C?!!((M=t==null?void 0:t.configs.supportbot)!=null&&M.edit):t?!!((k=t.configs[v])!=null&&k.edit):!1,T=C?S:`${v}.yml`;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:N}),s.jsx("p",{className:"text-muted-foreground",children:E?`Edit ${T} — changes apply to the running bot without restarting the dashboard.`:`Viewing ${T} — you do not have permission to save changes.`})]}),s.jsx("div",{className:"mt-6",children:C&&S?s.jsx(WO,{filename:S},S):s.jsx(mz,{configFile:v},v)})]})}const xz={oauth_not_configured:"Discord OAuth is not configured. Complete setup at /setup first.",not_allowed:"Your Discord account is not allowed. Ask an owner to add you under Users, or add your ID to OwnerUserIds in Configs/api.yml.",invalid_state:"Login session expired. Please try again.",missing_code:"Discord did not return an authorization code. Please try again.",oauth_failed:"Could not complete Discord sign-in. Check your OAuth settings.",access_denied:"You cancelled Discord sign-in."};function bz(t){return t?xz[t]||"Sign-in failed. Please try again.":""}function vz(){const{branding:t}=Ed(),{isAuthenticated:n,loading:a,loginWithDiscord:o}=Yt(),[c]=wd(),l=f.useMemo(()=>bz(c.get("error")),[c]);return!a&&n?s.jsx(ya,{to:"/",replace:!0}):s.jsx("div",{className:"relative flex min-h-svh items-center justify-center bg-[#0c0c10] p-4 overflow-hidden",children:s.jsxs(Je,{className:"relative z-10 w-full max-w-md overflow-hidden rounded-3xl border border-white/10 bg-card/30 p-2 shadow-2xl backdrop-blur-2xl",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent pointer-events-none"}),s.jsxs(dt,{className:"space-y-6 pt-10 pb-4 text-center",children:[s.jsx("div",{className:"mx-auto flex size-28 items-center justify-center overflow-hidden rounded-3xl bg-white/5 p-4 shadow-inner ring-1 ring-white/10 transition-transform duration-500 hover:scale-105",children:s.jsx("img",{src:"/logo.png",alt:"SupportBot Logo",className:"h-full w-full object-contain drop-shadow-xl"})}),s.jsxs("div",{children:[s.jsx(ft,{className:"bg-gradient-to-br from-white to-white/50 bg-clip-text text-3xl font-extrabold tracking-tight text-transparent",children:t.title||"SupportBot"}),s.jsx(Ot,{className:"mt-2 text-base font-medium text-white/50",children:"Sign in to your dashboard"})]})]}),s.jsxs(et,{className:"space-y-6 pb-10",children:[s.jsxs("div",{className:"text-center space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-white/50",children:"Securely authenticate using your Discord account."}),s.jsxs("p",{className:"text-xs text-white/30",children:["Credentials are configured in ",s.jsx("code",{className:"rounded bg-white/5 px-1 py-0.5 text-white/40",children:"Configs/api.yml"})]})]}),l?s.jsx(Ye,{variant:"destructive",className:"border-red-500/50 bg-red-500/10 text-red-200 backdrop-blur-md",children:s.jsx(qe,{className:"font-medium",children:l})}):null,s.jsxs(ue,{type:"button",className:"group relative w-full overflow-hidden rounded-2xl bg-primary px-8 py-6 text-base font-bold text-primary-foreground shadow-[0_0_20px_rgba(var(--primary),0.3)] transition-all duration-300 hover:scale-[1.02] hover:shadow-[0_0_30px_rgba(var(--primary),0.5)] active:scale-95",disabled:a,onClick:o,children:[s.jsx("div",{className:"absolute inset-0 translate-x-[-100%] bg-gradient-to-r from-transparent via-white/20 to-transparent transition-transform duration-1000 group-hover:translate-x-[100%]"}),s.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 127.14 96.36",fill:"currentColor",children:s.jsx("path",{d:"M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1,105.25,105.25,0,0,0,32.19-16.14c2.64-27.38-4.51-51.11-19.32-72.15ZM42.68,68.22c-5.28,0-9.66-4.9-9.66-10.89s4.29-10.89,9.66-10.89c5.41,0,9.75,4.9,9.66,10.89C52.34,63.32,48.09,68.22,42.68,68.22Zm41.76,0c-5.28,0-9.66-4.9-9.66-10.89s4.29-10.89,9.66-10.89c5.41,0,9.75,4.9,9.66,10.89C84.44,63.32,80.19,68.22,84.44,68.22Z"})}),a?"Authenticating...":"Continue with Discord"]})]})]})]})})}const ui=[{id:"botToken",title:"Bot token",subtitle:"Connect your Discord bot",icon:cg},{id:"database",title:"Database",subtitle:"SQLite or MySQL engine",icon:x8},{id:"secretKey",title:"Session secret",subtitle:"Secure dashboard logins",icon:M8},{id:"oauth",title:"Discord OAuth",subtitle:"Sign in with Discord",icon:By},{id:"redirectUri",title:"Redirect URL",subtitle:"OAuth callback address",icon:Nd},{id:"owners",title:"Dashboard owners",subtitle:"Who can access this panel",icon:rh},{id:"emeraldApi",title:"Emerald API",subtitle:"One-click addons",icon:By}];function yz(t){return t==="oauth"?"oauth":t==="owners"?"owners":t}function wz({brandingTitle:t,faviconUrl:n,faviconVersion:a,hasFavicon:o,children:c}){return s.jsx("div",{className:"min-h-svh bg-background",children:s.jsxs("div",{className:"mx-auto flex min-h-svh max-w-6xl flex-col px-4 py-6 md:px-8 md:py-10",children:[s.jsxs("header",{className:"mb-8 flex items-center gap-4",children:[o&&n?s.jsx("img",{src:`${n}${a?`?v=${a}`:""}`,alt:"",className:"size-12 rounded-2xl border border-border object-contain"}):s.jsx("div",{className:"flex size-12 items-center justify-center rounded-2xl border border-border bg-primary text-primary-foreground",children:s.jsx(xe,{icon:cg,size:24})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"First-time setup"}),s.jsx("h1",{className:"text-2xl font-semibold tracking-tight md:text-3xl",children:t})]})]}),c]})})}function jz({currentIndex:t,validation:n}){const a=(t+1)/ui.length*100;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Step ",t+1," of ",ui.length]}),s.jsxs("span",{children:[Math.round(a),"%"]})]}),s.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-secondary",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-300 ease-out",style:{width:`${a}%`}})})]}),s.jsx("nav",{className:"hidden space-y-1 md:block","aria-label":"Setup steps",children:ui.map((o,c)=>{var g;const l=yz(o.id),d=(g=n[l])==null?void 0:g.ok,m=c===t,p=c<t;return s.jsxs("div",{className:pe("flex items-start gap-3 rounded-xl border px-3 py-3 transition-colors",m&&"border-primary bg-secondary",!m&&"border-transparent",p&&!m&&"opacity-80"),children:[s.jsx("div",{className:pe("flex size-9 shrink-0 items-center justify-center rounded-lg",d?"bg-emerald-500/15 text-emerald-500":m?"bg-primary text-primary-foreground":"bg-secondary text-muted-foreground"),children:d?s.jsx(xe,{icon:jd,size:18}):s.jsx(xe,{icon:o.icon,size:18})}),s.jsxs("div",{className:"min-w-0 pt-0.5",children:[s.jsx("p",{className:pe("text-sm font-medium leading-none",m&&"text-foreground",!m&&"text-muted-foreground"),children:o.title}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:o.subtitle})]})]},o.id)})}),s.jsx("p",{className:"hidden text-xs leading-relaxed text-muted-foreground md:block",children:"Each step can be tested with Discord before you continue. You can move back anytime to change a value."})]})}function Cz({step:t,children:n,footer:a}){return s.jsxs("div",{className:"flex min-h-[min(520px,70vh)] flex-col rounded-2xl border border-border bg-card",children:[s.jsxs("div",{className:"border-b border-border px-6 py-5 md:px-8",children:[s.jsxs("div",{className:"flex items-center gap-3 md:hidden",children:[s.jsx("div",{className:"flex size-10 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:s.jsx(xe,{icon:t.icon,size:20})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold",children:t.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.subtitle})]})]}),s.jsxs("div",{className:"hidden md:block",children:[s.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:t.title}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t.subtitle})]})]}),s.jsx("div",{className:"flex flex-1 flex-col px-6 py-6 md:px-8",children:n}),a?s.jsx("div",{className:"border-t border-border px-6 py-4 md:px-8",children:a}):null]})}function mo({result:t}){var n,a;return t?t.ok?s.jsx(Ye,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:s.jsxs(qe,{className:"space-y-2",children:[t.bot?s.jsxs("p",{children:["Connected as ",s.jsxs("strong",{children:["@",t.bot.username]}),t.applicationId?s.jsxs("span",{className:"text-emerald-600/80 dark:text-emerald-400/80",children:[" ","· App ID ",t.applicationId]}):null]}):null,(n=t.users)!=null&&n.length?s.jsx("ul",{className:"space-y-1",children:t.users.map(o=>s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(xe,{icon:jd,size:14}),o.globalName||o.username,s.jsx("span",{className:"font-mono text-xs opacity-80",children:o.id})]},o.id))}):null,!t.bot&&!((a=t.users)!=null&&a.length)?s.jsx("p",{children:t.warning||"Verified successfully."}):null]})}):s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:t.error})}):null}function Sz({values:t,setValues:n,validation:a,validating:o,onValidate:c}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Open the"," ",s.jsx("a",{href:"https://discord.com/developers/applications",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Discord Developer Portal"}),", select your application, go to ",s.jsx("strong",{children:"Bot"}),", and reset or copy the token."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"botToken",children:"Bot token"}),s.jsx(_e,{id:"botToken",type:"password",autoComplete:"off",value:t.botToken,onChange:l=>n({...t,botToken:l.target.value}),placeholder:"MTI…",className:"h-11 font-mono text-sm"})]}),s.jsx(mo,{result:a.botToken}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.botToken,onClick:c,children:o?"Checking with Discord…":"Verify bot token"})})]})}function Nz({values:t,setValues:n,validation:a,validating:o,onValidate:c,onGenerate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"This random string signs your login cookies. Store it like a password — do not commit it to public repos."}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"secretKey",children:"Session secret"}),s.jsx(_e,{id:"secretKey",type:"password",autoComplete:"off",value:t.secretKey,onChange:d=>n({...t,secretKey:d.target.value}),className:"h-11 font-mono text-sm"})]}),s.jsx(mo,{result:a.secretKey}),s.jsxs("div",{className:"mt-auto flex flex-wrap gap-2",children:[s.jsx(ue,{type:"button",variant:"outline",onClick:l,children:"Generate secure secret"}),s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.secretKey,onClick:c,children:o?"Checking…":"Validate"})]})]})}function Ez({values:t,setValues:n,validation:a,validating:o,onValidate:c}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Use the ",s.jsx("strong",{children:"same application"})," as your bot. Under OAuth2, copy the Client ID and Client Secret."]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(Ae,{htmlFor:"clientId",children:"Client ID"}),s.jsx(_e,{id:"clientId",value:t.clientId,onChange:l=>n({...t,clientId:l.target.value}),className:"h-11 font-mono text-sm"})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(Ae,{htmlFor:"clientSecret",children:"Client Secret"}),s.jsx(_e,{id:"clientSecret",type:"password",autoComplete:"off",value:t.clientSecret,onChange:l=>n({...t,clientSecret:l.target.value}),className:"h-11 font-mono text-sm"})]})]}),s.jsx(mo,{result:a.oauth}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.clientId||!t.clientSecret,onClick:c,children:o?"Checking with Discord…":"Verify OAuth credentials"})})]})}function kz({values:t,setValues:n,validation:a}){async function o(){if(t.redirectUri)try{await navigator.clipboard.writeText(t.redirectUri)}catch{}}return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Add this exact URL under ",s.jsx("strong",{children:"OAuth2 → Redirects"})," in the Developer Portal. It must match character-for-character."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"redirectUri",children:"Redirect URI"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(_e,{id:"redirectUri",value:t.redirectUri,onChange:c=>n({...t,redirectUri:c.target.value}),className:"h-11 flex-1 font-mono text-xs"}),s.jsx(ue,{type:"button",variant:"outline",size:"icon",className:"size-11 shrink-0",onClick:()=>void o(),title:"Copy URL",children:s.jsx(xe,{icon:R2,size:18})})]})]}),a.redirectUri&&!a.redirectUri.ok?s.jsx(mo,{result:a.redirectUri}):s.jsx(Ye,{className:"border-border bg-secondary",children:s.jsx(qe,{className:"text-sm text-muted-foreground",children:"We pre-filled this from your current dashboard URL. If you access the panel from a different domain later, update this and add the new URL in Discord too."})})]})}function Tz({values:t,setValues:n,validation:a,validating:o,onValidate:c}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Enable ",s.jsx("strong",{children:"Developer Mode"})," in Discord (Settings → Advanced), then right-click your profile and ",s.jsx("strong",{children:"Copy User ID"}),". Add one ID per line."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"owners",children:"Owner user IDs"}),s.jsx(Jd,{id:"owners",value:t.ownerUserIds,onChange:l=>n({...t,ownerUserIds:l.target.value}),placeholder:`829112572816130058
|
||
987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),s.jsx(mo,{result:a.owners}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.ownerUserIds.trim(),onClick:c,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function Mz({onContinue:t}){return s.jsx("div",{className:"mx-auto flex w-full max-w-lg flex-1 flex-col justify-center py-8",children:s.jsxs("div",{className:"rounded-2xl border border-border bg-card px-6 py-10 text-center md:px-10",children:[s.jsx("div",{className:"mx-auto mb-6 flex size-16 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:s.jsx(xe,{icon:jd,size:40})}),s.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Setup complete"}),s.jsxs("p",{className:"mx-auto mt-3 max-w-sm text-sm leading-relaxed text-muted-foreground",children:["Your configuration has been saved. Restart the server for changes to take effect — stop the running process, then start it again (for example"," ",s.jsx("code",{className:"rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm start"}),")."]}),s.jsx(Ye,{className:"mt-6 text-left",children:s.jsx(qe,{children:"After restarting, sign in with Discord to open the dashboard."})}),s.jsx(ue,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:t,children:"Continue to sign in"})]})})}function Rz({currentIndex:t,validating:n,saving:a,onBack:o,onNext:c,onFinish:l}){const d=t===ui.length-1;return s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs(ue,{type:"button",variant:"ghost",disabled:t===0||a,onClick:o,children:[s.jsx(xe,{icon:T2,size:18,className:"mr-1"}),"Back"]}),s.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?s.jsx(ue,{type:"button",size:"lg",disabled:a||n,onClick:l,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):s.jsxs(ue,{type:"button",size:"lg",disabled:n||a,onClick:c,children:["Continue",s.jsx(xe,{icon:lg,size:18,className:"ml-1"})]})})]})}function Az({values:t,setValues:n,validation:a,validating:o,onValidate:c}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["An Emerald Services API key is optional, but required to use the one-click addon installer in the dashboard. You can get yours from the"," ",s.jsx("a",{href:"https://emeraldsrv.dev",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Emerald Services Marketplace"}),"."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"emeraldApiKey",children:"Emerald API key (Optional)"}),s.jsx(_e,{id:"emeraldApiKey",type:"password",autoComplete:"off",value:t.emeraldApiKey,onChange:l=>n({...t,emeraldApiKey:l.target.value}),placeholder:"em_...",className:"h-11 font-mono text-sm"})]}),s.jsx(mo,{result:a.emeraldApi}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o,onClick:c,children:o?"Checking…":t.emeraldApiKey?"Verify key":"Skip step"})})]})}function _z({values:t,setValues:n,validation:a,validating:o,onValidate:c}){const l=a.database,d=t.dbDriver==="mysql";return s.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Choose your database storage engine. Select ",s.jsx("strong",{children:"SQLite"})," for instant zero-config local storage, or ",s.jsx("strong",{children:"MySQL / MariaDB"})," for external host databases."]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{onClick:()=>n(m=>({...m,dbDriver:"sqlite"})),className:pe("cursor-pointer rounded-xl border p-4 transition-all hover:border-primary",t.dbDriver==="sqlite"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border bg-card"),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"font-semibold text-foreground",children:"SQLite"}),s.jsx("span",{className:"rounded-full bg-emerald-500/10 px-2.5 py-0.5 text-xs font-medium text-emerald-500",children:"Zero Config"})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Single-file SQL database stored locally at ",s.jsx("code",{className:"font-mono",children:"./Data/supportbot.db"}),". Zero extra setup required."]})]}),s.jsxs("div",{onClick:()=>n(m=>({...m,dbDriver:"mysql"})),className:pe("cursor-pointer rounded-xl border p-4 transition-all hover:border-primary",t.dbDriver==="mysql"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border bg-card"),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"font-semibold text-foreground",children:"MySQL / MariaDB"}),s.jsx("span",{className:"rounded-full bg-blue-500/10 px-2.5 py-0.5 text-xs font-medium text-blue-500",children:"External Database"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect to a remote or local MySQL database server."})]})]}),d&&s.jsxs("div",{className:"space-y-4 rounded-xl border border-border bg-card/50 p-4",children:[s.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"MySQL Connection Settings"}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(Ae,{htmlFor:"dbHost",children:"Database Host"}),s.jsx(_e,{id:"dbHost",placeholder:"127.0.0.1 or localhost",value:t.dbHost,onChange:m=>n(p=>({...p,dbHost:m.target.value})),className:"h-11 text-sm"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"dbPort",children:"Port"}),s.jsx(_e,{id:"dbPort",placeholder:"3306",value:t.dbPort,onChange:m=>n(p=>({...p,dbPort:m.target.value})),className:"h-11 text-sm font-mono"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"dbDatabase",children:"Database Name"}),s.jsx(_e,{id:"dbDatabase",placeholder:"supportbot",value:t.dbDatabase,onChange:m=>n(p=>({...p,dbDatabase:m.target.value})),className:"h-11 text-sm"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"dbUser",children:"Database User"}),s.jsx(_e,{id:"dbUser",placeholder:"root",value:t.dbUser,onChange:m=>n(p=>({...p,dbUser:m.target.value})),className:"h-11 text-sm font-mono"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"dbPassword",children:"Password"}),s.jsx(_e,{id:"dbPassword",type:"password",placeholder:"••••••••••••",value:t.dbPassword,onChange:m=>n(p=>({...p,dbPassword:m.target.value})),className:"h-11 text-sm font-mono"})]})]})]}),s.jsx(mo,{result:l}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o,onClick:c,children:o?"Testing Connection...":"Test Connection & Validate"})})]})}function Dz(){const t=crypto.randomUUID().replace(/-/g,""),n=crypto.randomUUID().replace(/-/g,"");return t+n}function Oz(t){return t.split(/[\s,]+/).map(n=>n.trim()).filter(Boolean)}function t2(t){return t==="oauth"?"oauth":t==="owners"?"owners":t==="database"?"database":t==="emeraldApi"?"emeraldApi":t}function Lz(){const t=ao(),{branding:n}=Ed(),{loading:a,error:o,refresh:c,status:l}=fS(),[d,m]=f.useState(0),[p,g]=f.useState({botToken:"",dbDriver:"sqlite",dbHost:"127.0.0.1",dbPort:"3306",dbUser:"",dbPassword:"",dbDatabase:"supportbot",secretKey:"",clientId:"",clientSecret:"",redirectUri:"",ownerUserIds:"",emeraldApiKey:""}),[b,v]=f.useState({}),[w,y]=f.useState(!1),[C,S]=f.useState(!1),[N,E]=f.useState(""),[T,M]=f.useState(!1),k=ui[d];f.useEffect(()=>{l!=null&&l.suggestedRedirectUri&&!p.redirectUri&&g(H=>({...H,redirectUri:l.suggestedRedirectUri}))},[l==null?void 0:l.suggestedRedirectUri,p.redirectUri]);const _=f.useMemo(()=>({botToken:p.botToken,dbDriver:p.dbDriver,dbHost:p.dbHost,dbPort:p.dbPort,dbUser:p.dbUser,dbPassword:p.dbPassword,dbDatabase:p.dbDatabase,secretKey:p.secretKey,clientId:p.clientId,clientSecret:p.clientSecret,redirectUri:p.redirectUri,ownerUserIds:Oz(p.ownerUserIds),emeraldApiKey:p.emeraldApiKey}),[p]);async function R(){y(!0),E("");try{const H=await Ne.validateSetup(_);return v(q=>{var ce;return{...q,...(ce=H.data)==null?void 0:ce.results}}),H.data}catch(H){return E(H instanceof Error?H.message:"Validation failed"),null}finally{y(!1)}}async function L(){var ce,de;const H=t2(k.id),q=await R();return!!((de=(ce=q==null?void 0:q.results)==null?void 0:ce[H])!=null&&de.ok)}async function ne(){const H=t2(k.id),q=b[H];!(q!=null&&q.ok)&&!await L()||m(ce=>Math.min(ce+1,ui.length-1))}async function X(){S(!0),E("");try{const H=await R();if(!(H!=null&&H.ok)){E("Fix the steps marked with errors before finishing.");return}await Ne.completeSetup(_),M(!0)}catch(H){E(H instanceof Error?H.message:"Could not save setup")}finally{S(!1)}}function I(){const H={values:p,setValues:g,validation:b,validating:w};switch(k.id){case"botToken":return s.jsx(Sz,{...H,onValidate:()=>void L()});case"database":return s.jsx(_z,{...H,onValidate:()=>void L()});case"secretKey":return s.jsx(Nz,{...H,onGenerate:()=>g(q=>({...q,secretKey:Dz()})),onValidate:()=>void L()});case"oauth":return s.jsx(Ez,{...H,onValidate:()=>void L()});case"redirectUri":return s.jsx(kz,{values:p,setValues:g,validation:b});case"owners":return s.jsx(Tz,{...H,onValidate:()=>void L()});case"emeraldApi":return s.jsx(Az,{...H,onValidate:()=>void L()})}}return a?s.jsx("div",{className:"min-h-svh bg-background px-4 py-10",children:s.jsxs("div",{className:"mx-auto max-w-6xl space-y-8",children:[s.jsx(Ue,{className:"h-14 w-64"}),s.jsxs("div",{className:"grid gap-8 lg:grid-cols-[280px_1fr]",children:[s.jsx(Ue,{className:"hidden h-80 lg:block"}),s.jsx(Ue,{className:"h-[520px] rounded-2xl"})]})]})}):s.jsxs(wz,{brandingTitle:n.title,faviconUrl:n.faviconUrl,faviconVersion:n.updatedAt??void 0,hasFavicon:n.hasFavicon,children:[o?s.jsx(Ye,{variant:"destructive",className:"mb-6",children:s.jsx(qe,{children:o})}):null,N?s.jsx(Ye,{variant:"destructive",className:"mb-6",children:s.jsx(qe,{children:N})}):null,T?s.jsx(Mz,{onContinue:async()=>{await c(),t("/login",{replace:!0})}}):s.jsxs("div",{className:"grid flex-1 gap-8 lg:grid-cols-[minmax(0,280px)_1fr]",children:[s.jsx(jz,{currentIndex:d,validation:b}),s.jsx(Cz,{step:k,footer:s.jsx(Rz,{currentIndex:d,validating:w,saving:C,onBack:()=>m(H=>Math.max(0,H-1)),onNext:()=>void ne(),onFinish:()=>void X()}),children:I()})]})]})}const zz={todo:"bg-rose-500/15 text-rose-400",progress:"bg-amber-500/15 text-amber-400",done:"bg-emerald-500/15 text-emerald-400"};function Pz({title:t,icon:n,href:a,badge:o="Configured",status:c="done"}){return s.jsxs(en,{to:a,className:pe("flex items-center gap-3 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary"),children:[s.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center rounded-full bg-secondary text-primary",children:s.jsx(xe,{icon:n,size:20})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate font-semibold",children:t}),s.jsx("span",{className:pe("mt-1 inline-flex rounded-md px-2 py-0.5 text-[10px] font-semibold",zz[c]),children:o})]})]})}function Iz({percent:t,size:n=128,className:a,trackClassName:o="stroke-white/20",strokeClassName:c="stroke-white"}){const d=2*Math.PI*42,m=Math.min(100,Math.max(0,t)),p=d-m/100*d;return s.jsxs("div",{className:pe("relative inline-flex",a),children:[s.jsxs("svg",{width:n,height:n,viewBox:"0 0 100 100",className:"-rotate-90","aria-hidden":!0,children:[s.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",className:o}),s.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:p,className:c})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[s.jsxs("span",{className:"text-2xl font-bold tabular-nums leading-none",children:[Math.round(m),"%"]}),s.jsx("span",{className:"mt-0.5 text-[10px] font-medium uppercase tracking-wide opacity-80",children:"Complete"})]})]})}const Uz={todo:{dot:"bg-rose-500",badge:"bg-rose-500/15 text-rose-400",label:"Needs setup"},progress:{dot:"bg-amber-400",badge:"bg-amber-500/15 text-amber-400",label:"In progress"},done:{dot:"bg-sky-400",badge:"bg-sky-500/15 text-sky-400",label:"Active"}};function Bz({title:t,subtitle:n,icon:a,href:o,status:c,meta:l="Open in dashboard"}){const d=Uz[c];return s.jsxs(en,{to:o,className:pe("group flex min-w-[280px] flex-1 flex-col gap-4 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary","sm:min-w-[300px] lg:min-w-0"),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("span",{className:pe("mt-1.5 size-2 shrink-0 rounded-full",d.dot)}),s.jsx("span",{className:"text-xs text-muted-foreground",children:n})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold leading-snug tracking-tight",children:t}),s.jsx("span",{className:pe("mt-2 inline-flex rounded-md px-2 py-0.5 text-[11px] font-semibold",d.badge),children:d.label})]}),s.jsxs("div",{className:"mt-auto flex items-center justify-between border-t border-border pt-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-secondary text-primary",children:s.jsx(xe,{icon:a,size:16})}),s.jsx("span",{className:"text-xs text-muted-foreground",children:l})]}),s.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[s.jsx(xe,{icon:Nd,size:14,className:"opacity-60"}),s.jsx(xe,{icon:qs,size:14,className:"opacity-60 group-hover:text-primary"}),s.jsx(xe,{icon:lg,size:14,className:"text-primary opacity-0 transition-opacity group-hover:opacity-100"})]})]})]})}function $z({stats:t}){const n=[{id:"ping",label:"Gateway latency",detail:`${t.bot.ping}ms`,badge:t.bot.ping<200?"Good":"High",badgeClass:t.bot.ping<200?"bg-emerald-500/15 text-emerald-400":"bg-amber-500/15 text-amber-400"},{id:"uptime",label:"Bot uptime",detail:fg(t.bot.uptime),badge:"Live",badgeClass:"bg-primary/20 text-primary"},{id:"ram",label:"Memory usage",detail:`${t.hosting.ram_used} / ${t.hosting.ram_total}`,badge:`${t.hosting.ram_percent}%`,badgeClass:"bg-sky-500/15 text-sky-400"}];return s.jsxs("aside",{className:"hidden w-[min(100%,320px)] shrink-0 space-y-4 xl:block",children:[s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[s.jsxs(ft,{className:"text-sm font-semibold",children:["Connected servers (",t.servers,")"]}),s.jsx(ue,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:s.jsx("span",{className:"text-lg leading-none",children:"+"})})]}),s.jsxs(et,{className:"pt-0",children:[s.jsxs("div",{className:"flex -space-x-2",children:[Array.from({length:Math.min(6,t.servers)}).map((a,o)=>s.jsxs(vs,{className:"size-9 border-2 border-card ring-0",children:[s.jsx(eo,{src:t.bot.avatar,alt:""}),s.jsx(ys,{className:"bg-primary/25 text-[10px] text-primary",children:String(o+1)})]},o)),t.servers>6?s.jsxs("div",{className:"flex size-9 items-center justify-center rounded-full border-2 border-card bg-secondary text-xs font-medium text-muted-foreground",children:["+",t.servers-6]}):null]}),s.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:[t.users.toLocaleString()," members across your guilds"]})]})]}),s.jsx(Je,{className:"overflow-hidden border-border bg-secondary",children:s.jsx(et,{className:"p-5",children:s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex size-10 items-center justify-center rounded-xl bg-primary text-primary-foreground",children:s.jsx(xe,{icon:T8,size:22})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:"Keep SupportBot up to date"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Check for releases and install updates from settings."})]}),s.jsx(ue,{asChild:!0,size:"sm",className:"w-full",children:s.jsxs(en,{to:"/settings",children:[s.jsx(xe,{icon:Cd,size:16,className:"mr-2"}),"Open settings"]})})]})})}),s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-semibold",children:"System activity"}),s.jsx(ue,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:s.jsx("span",{className:"text-base leading-none",children:"⋯"})})]}),s.jsxs(et,{className:"space-y-1 p-0 pb-2",children:[n.map(a=>s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-secondary/40",children:[s.jsxs(vs,{className:"size-9",children:[s.jsx(eo,{src:t.bot.avatar,alt:t.bot.username}),s.jsx(ys,{className:"bg-secondary text-xs",children:"SB"})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:a.label}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.detail})]}),s.jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${a.badgeClass}`,children:a.badge})]},a.id)),s.jsx(ue,{asChild:!0,variant:"ghost",className:"mx-2 mt-1 w-[calc(100%-1rem)] justify-between text-xs text-muted-foreground",children:s.jsxs(en,{to:"/system",children:["All system details",s.jsx(xe,{icon:lg,size:14})]})})]})]}),s.jsx(Je,{className:"border-border bg-card",children:s.jsxs(et,{className:"flex items-center gap-3 p-4",children:[s.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-secondary text-primary",children:s.jsx(xe,{icon:qs,size:18})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"text-sm font-medium",children:["v",t.bot.version]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["CPU ",t.hosting.cpu_load]})]})]})})]})}const c5={todo:"Needs setup",progress:"In progress",done:"Active"};function Kh(t,n,a="Configure module"){const o=n==null?void 0:n[t];return o||{status:"todo",subtitle:a}}function Hz(){return s.jsxs("div",{className:"flex gap-6",children:[s.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Ue,{className:"h-44 rounded-2xl"}),s.jsx(Ue,{className:"h-44 rounded-2xl"})]}),s.jsx(Ue,{className:"h-8 w-48"}),s.jsx("div",{className:"flex gap-4 overflow-hidden",children:Array.from({length:3}).map((t,n)=>s.jsx(Ue,{className:"h-40 min-w-[280px] rounded-2xl"},n))}),s.jsx(Ue,{className:"h-8 w-56"}),s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Array.from({length:4}).map((t,n)=>s.jsx(Ue,{className:"h-20 rounded-2xl"},n))})]}),s.jsx(Ue,{className:"hidden h-[520px] w-80 shrink-0 rounded-2xl xl:block"})]})}function Gz(){const{stats:t,loading:n,error:a}=kd(),[o,c]=f.useState("all"),l=f.useMemo(()=>{if(!t)return 0;const b=t.tickets.total||0;return b===0?100:Math.round(t.tickets.closed/b*100)},[t]),d=f.useMemo(()=>o==="open"||o==="closed"?ai.filter(b=>b.category==="tickets"):o==="all"?ai:ai.filter(b=>b.category===o),[o]);if(n)return s.jsx(Hz,{});if(a||!t)return s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:a||"No stats available"})});const m=t.tickets.open,p=t.tickets.closed,g=t.tickets.total;return s.jsxs("div",{className:"flex flex-col gap-6 xl:flex-row xl:items-start",children:[s.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Je,{className:"overflow-hidden border-border bg-card",children:s.jsxs(et,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"text-lg font-semibold leading-snug",children:["You have"," ",s.jsx("span",{className:"text-primary",children:m})," open ticket",m===1?"":"s"]}),s.jsx("p",{className:"max-w-xs text-sm text-muted-foreground",children:"Review transcripts or tune your ticket panel so new requests are handled smoothly."}),s.jsx(ue,{asChild:!0,size:"sm",className:"rounded-lg px-5",children:s.jsx(en,{to:"/transcripts",children:"Review"})})]}),s.jsxs("div",{className:"relative mx-auto flex size-28 shrink-0 items-end justify-center sm:mx-0 sm:size-32","aria-hidden":!0,children:[s.jsx("div",{className:"absolute inset-0 rounded-2xl bg-secondary"}),s.jsx("span",{className:"relative text-6xl",children:"🎫"})]})]})}),s.jsx(Je,{className:"overflow-hidden border-border bg-primary text-primary-foreground",children:s.jsxs(et,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-sm font-medium text-white/80",children:"Ticket summary"}),s.jsxs("ul",{className:"space-y-1.5 text-sm",children:[s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[g," total"]})]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[p," closed"]})]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[m," open"]})]})]})]}),s.jsx(Iz,{percent:l,size:120})]})})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Module overview"}),s.jsx(DS,{value:o,onValueChange:b=>c(b),children:s.jsxs(xx,{className:"h-auto flex-wrap rounded-xl bg-secondary/60 p-1",children:[s.jsx(Ys,{value:"all",className:"rounded-lg text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"All"}),s.jsx(Ys,{value:"open",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Open"}),s.jsx(Ys,{value:"closed",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Closed"}),YM.filter(b=>b.id!=="all").map(b=>s.jsx(Ys,{value:b.id,className:"rounded-lg text-xs data-[state=active]:bg-background",children:b.label},b.id))]})})]}),s.jsx("div",{className:"-mx-1 flex gap-4 overflow-x-auto px-1 pb-2 lg:grid lg:grid-cols-3 lg:overflow-visible",children:(o==="open"?[{id:"open-queue",title:"Open ticket queue",subtitle:`${m} waiting`,icon:is,href:"/tickets",status:"done",meta:"View live tickets"}]:o==="closed"?[{id:"closed-archive",title:"Closed tickets",subtitle:`${p} resolved`,icon:jd,href:"/transcripts",status:"done",meta:"Browse archive"}]:d.map(b=>{const v=Kh(b.id,t.modules,b.description);return{id:b.id,title:b.title,subtitle:v.subtitle,icon:b.icon,href:b.href,status:v.status,meta:v.status==="done"?"View settings":"Configure"}})).map(b=>s.jsx(Bz,{title:b.title,subtitle:b.subtitle,icon:b.icon,href:b.href,status:b.status,meta:b.meta},b.id))})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Active modules"}),s.jsx(en,{to:"/configs",className:"text-sm font-medium text-primary hover:underline",children:"See all"})]}),s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ai.slice(0,4).map(b=>{const v=Kh(b.id,t.modules);return s.jsx(Pz,{title:b.title,icon:b.icon,href:b.href,badge:c5[v.status],status:v.status},b.id)})})]})]}),s.jsx($z,{stats:t})]})}function Vz(){const{permissions:t}=Yt();return Rn(t,"overview")?s.jsx(Gz,{}):s.jsx(ya,{to:mg(t),replace:!0})}function ga({permission:t,children:n}){const{loading:a,isAuthenticated:o,permissions:c}=Yt();return a?s.jsx("div",{className:"flex flex-1 items-center justify-center py-16 text-sm text-muted-foreground",children:"Loading…"}):o?Rn(c,t)?s.jsx(s.Fragment,{children:n}):s.jsx(ya,{to:mg(c),replace:!0}):s.jsx(ya,{to:"/login",replace:!0})}function Fz(){const{hasPermission:t}=Yt(),n=t("settings.update"),a=ao(),[o,c]=f.useState([]),[l,d]=f.useState(""),[m,p]=f.useState(!0),[g,b]=f.useState(""),[v,w]=f.useState(""),[y,C]=f.useState(null),S=f.useCallback(async()=>{p(!0),b("");try{const E=await Ne.getAddonsCatalog();E.data&&(c(E.data.addons),d(E.data.repository))}catch(E){b(E instanceof Error?E.message:"Failed to load addons")}finally{p(!1)}},[]);f.useEffect(()=>{S()},[S]);async function N(E){if(n){C(E.id),w(""),b("");try{const T=await Ne.installAddon(E.id);w(T.message||`${E.name} installed.`),await S();const M=E.configFiles[0];M&&a(`/configs?file=${_l(M)}`)}catch(T){b(T instanceof Error?T.message:"Install failed")}finally{C(null)}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addons"}),s.jsxs("p",{className:"text-muted-foreground",children:["Requires an API key from"," ",s.jsx("a",{href:"https://emeraldsrv.dev",target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"emeraldsrv.dev"})," ","to browse and install addons. Configs will appear in the sidebar once installed."]})]}),s.jsxs(ue,{variant:"outline",size:"sm",onClick:S,disabled:m,children:[s.jsx(xe,{icon:_2,size:16,className:pe("mr-1.5",m&&"animate-spin")}),"Refresh"]})]}),g?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:g})}):null,v?s.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(qe,{children:v})}):null,s.jsxs("section",{className:"space-y-4",children:[s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-widest text-muted-foreground",children:"Marketplace"}),m?s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(Ue,{className:"h-40 rounded-xl"}),s.jsx(Ue,{className:"h-40 rounded-xl"}),s.jsx(Ue,{className:"h-40 rounded-xl"})]}):s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:o.map(E=>s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"pb-2",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs(ft,{className:"flex items-center gap-2 text-lg",children:[s.jsx(xe,{icon:dg,size:20,className:"text-primary"}),E.name]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Fn,{variant:"outline",className:"shrink-0 uppercase tracking-widest text-[10px]",children:E.price===0||!E.price?"Free":`$${E.price}`}),E.installed?s.jsxs(Fn,{variant:"secondary",className:"shrink-0 gap-1",children:[s.jsx(xe,{icon:D8,size:14}),"Installed"]}):null]})]}),s.jsx(Ot,{children:E.description})]}),s.jsxs(et,{className:"space-y-2 text-xs text-muted-foreground",children:[E.is_external?s.jsxs("p",{children:["Available on: ",s.jsx("span",{className:"font-medium text-foreground",children:E.external_store||"External Store"})]}):null,E.configFiles&&E.configFiles.length>0?s.jsxs("p",{children:["Config:"," ",E.configFiles.map((T,M)=>s.jsxs("span",{children:[M>0?", ":null,s.jsx(en,{to:`/configs?file=${_l(T)}`,className:"font-mono text-primary hover:underline",children:T})]},T))]}):null]}),s.jsxs(Sx,{className:"flex flex-wrap gap-2",children:[E.is_external?s.jsx(ue,{variant:"outline",size:"sm",asChild:!0,children:s.jsx("a",{href:E.repositoryUrl,target:"_blank",rel:"noreferrer",children:"View Store"})}):null,E.installed&&E.configFiles&&E.configFiles[0]?s.jsx(ue,{size:"sm",variant:"secondary",asChild:!0,children:s.jsx(en,{to:`/configs?file=${_l(E.configFiles[0])}`,children:"Edit config"})}):null,E.installed?s.jsx(ue,{size:"sm",disabled:!0,variant:"secondary",children:"Installed"}):E.is_external?null:s.jsxs(ue,{size:"sm",disabled:!n||y===E.id,onClick:()=>N(E),children:[s.jsx(xe,{icon:Cd,size:14,className:"mr-1"}),y===E.id?"Installing…":"Install"]})]})]},E.id))})]})]})}function Yz(){const{permissions:t}=Yt(),[n,a]=f.useState(!1),[o,c]=f.useState(!1),[l,d]=f.useState(""),[m,p]=f.useState(""),[g,b]=f.useState(""),[v,w]=f.useState("Administrator"),[y,C]=f.useState(""),[S,N]=f.useState(""),[E,T]=f.useState("General"),M=z2(t,"supportbot"),k=async()=>{if(!m.match(/^[a-z0-9_-]+$/i)){Dt.error("Command name can only contain letters, numbers, underscores and dashes.");return}a(!0),c(!1);try{const _=await Ne.buildAddon({name:m.toLowerCase(),description:g||"A custom command",permission:v,embed:{title:y,description:S||"Hello from your custom command!",color:E}});c(!0),d(_.message||"Restart required."),Dt.success(`Addon ${m}.js created successfully!`)}catch(_){Dt.error(_ instanceof Error?_.message:"Failed to build addon")}finally{a(!1)}};return M?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addon Builder"}),s.jsx("p",{className:"text-muted-foreground",children:"Visually scaffold a custom slash command addon for your bot."})]}),o?s.jsxs(Ye,{className:"border-green-500/20 bg-green-500/10 text-green-600 dark:text-green-400",children:[s.jsx(x0,{className:"h-4 w-4"}),s.jsxs(qe,{className:"ml-2",children:["Successfully built ",s.jsxs("strong",{children:[m,".js"]}),"! ",l]})]}):null,s.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Je,{children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Command Details"}),s.jsx(Ot,{children:"Configure how users trigger the command."})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Command Name"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"/"}),s.jsx(_e,{placeholder:"ping",value:m,onChange:_=>p(_.target.value.replace(/[^a-z0-9_-]/gi,"").toLowerCase())})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Description"}),s.jsx(_e,{placeholder:"Replies with a custom embed",value:g,onChange:_=>b(_.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Required Permission"}),s.jsxs(Ca,{value:v,onValueChange:w,children:[s.jsx(Hr,{children:s.jsx(Sa,{})}),s.jsxs(Gr,{children:[s.jsx(Et,{value:"none",children:"@everyone"}),s.jsx(Et,{value:"Administrator",children:"Administrator"}),s.jsx(Et,{value:"ManageMessages",children:"Manage Messages"}),s.jsx(Et,{value:"ManageGuild",children:"Manage Server"})]})]})]})]})]}),s.jsxs(Je,{children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Response Embed"}),s.jsx(Ot,{children:"What the bot will reply with."})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Embed Title (Optional)"}),s.jsx(_e,{placeholder:"Hello!",value:y,onChange:_=>C(_.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Embed Description"}),s.jsx(Jd,{placeholder:"Type your message here...",className:"resize-none",rows:4,value:S,onChange:_=>N(_.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Embed Color"}),s.jsxs(Ca,{value:E,onValueChange:T,children:[s.jsx(Hr,{children:s.jsx(Sa,{})}),s.jsxs(Gr,{children:[s.jsx(Et,{value:"General",children:"Theme General"}),s.jsx(Et,{value:"Success",children:"Theme Success"}),s.jsx(Et,{value:"Warning",children:"Theme Warning"}),s.jsx(Et,{value:"Error",children:"Theme Error"})]})]})]})]})]})]}),s.jsx("div",{className:"space-y-6",children:s.jsxs(Je,{className:"sticky top-6 border-primary/20",children:[s.jsx(dt,{children:s.jsxs(ft,{className:"text-sm font-medium flex items-center gap-2",children:[s.jsx(xe,{icon:A8,size:16,className:"text-primary"}),"Live Preview"]})}),s.jsx(et,{children:s.jsx("div",{className:"rounded-md border bg-[#313338] p-4 font-sans text-sm text-[#dbdee1]",children:s.jsxs("div",{className:"flex gap-4",children:[s.jsx("div",{className:"size-10 shrink-0 rounded-full bg-indigo-500 flex items-center justify-center font-bold text-white",children:"B"}),s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium text-white",children:"SupportBot"}),s.jsxs("span",{className:"text-[10px] text-white font-medium uppercase px-1.5 py-0.5 rounded bg-[#5865F2] flex items-center gap-1",children:[s.jsx(x0,{size:10})," BOT"]}),s.jsx("span",{className:"text-xs text-[#949ba4]",children:"Today at 12:00 PM"})]}),s.jsxs("div",{className:"mt-2 rounded bg-[#2b2d31] border-l-4 border-l-[#5865F2] px-4 py-3 max-w-[432px]",children:[y&&s.jsx("div",{className:"mb-1 font-semibold text-white",children:y}),s.jsx("div",{className:"whitespace-pre-wrap",children:S||"Hello from your custom command!"})]})]})]})})}),s.jsx(Sx,{children:s.jsxs(ue,{className:"w-full gap-2",size:"lg",disabled:!m||n,onClick:k,children:[s.jsx(xe,{icon:ds,size:18}),n?"Building...":"Generate Addon"]})})]})})]})]}):s.jsx("div",{className:"flex h-[50vh] items-center justify-center text-muted-foreground",children:"You don't have permission to build addons."})}const Ex="supportbot-dashboard-accent",Pl="#45b46c",qz=["--primary","--ring","--chart-1","--sidebar-primary","--sidebar-ring","--accent","--accent-foreground","--sidebar-accent","--sidebar-accent-foreground"];function Kz(t){const n=$r(t,Pl),a=parseInt(n.slice(1,3),16)/255,o=parseInt(n.slice(3,5),16)/255,c=parseInt(n.slice(5,7),16)/255,l=Math.max(a,o,c),d=Math.min(a,o,c),m=(l+d)/2;let p=0,g=0;if(l!==d){const b=l-d;switch(g=m>.5?b/(2-l-d):b/(l+d),l){case a:p=((o-c)/b+(o<c?6:0))/6;break;case o:p=((c-a)/b+2)/6;break;default:p=((a-o)/b+4)/6;break}}return{h:Math.round(p*360),s:Math.round(g*100),l:Math.round(m*100)}}function xa(t,n,a){return`${t} ${n}% ${a}%`}function u5(t){const n=$r(t,Pl),{h:a,s:o,l:c}=Kz(n),l=document.documentElement,d=Math.min(Math.max(o,45),85),m=Math.min(Math.max(c,42),62);return l.style.setProperty("--primary",xa(a,d,m)),l.style.setProperty("--ring",xa(a,d,m)),l.style.setProperty("--chart-1",xa(a,d,m)),l.style.setProperty("--sidebar-primary",xa(a,d,m)),l.style.setProperty("--sidebar-ring",xa(a,d,m)),l.style.setProperty("--primary-foreground","0 0% 100%"),l.style.setProperty("--sidebar-primary-foreground","0 0% 100%"),l.style.setProperty("--accent",xa(a,Math.round(d*.64),18)),l.style.setProperty("--accent-foreground",xa(a,Math.min(Math.round(d*1.15),90),78)),l.style.setProperty("--sidebar-accent",xa(a,Math.round(d*.57),14)),l.style.setProperty("--sidebar-accent-foreground",xa(a,Math.min(Math.round(d*1.07),88),82)),n}function Wz(){for(const t of qz)document.documentElement.style.removeProperty(t);document.documentElement.style.removeProperty("--primary-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground")}function d5(){try{const t=localStorage.getItem(Ex);return!t||!Bh(t)?null:$r(t)}catch{return null}}function n2(t){const n=u5(t);try{localStorage.setItem(Ex,n)}catch{}return n}function Xz(){try{localStorage.removeItem(Ex)}catch{}Wz()}function Zz(){const t=d5();t&&u5(t)}function Qz(t){return new Promise((n,a)=>{const o=new FileReader;o.onload=()=>n(String(o.result)),o.onerror=()=>a(new Error("Could not read file")),o.readAsDataURL(t)})}function Jz({canEdit:t}){const[n,a]=f.useState(!1),[o,c]=f.useState(""),[l,d]=f.useState(!1);async function m(){if(t){a(!0),c("");try{const p=await Ne.resetDashboard();c(p.message||"Dashboard reset successfully."),setTimeout(()=>{window.location.href="/setup"},1500)}catch(p){c(p instanceof Error?p.message:"Reset failed"),a(!1)}}}return t?s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reset the dashboard to factory settings. This clears the configuration and returns you to the initial setup screen."}),s.jsxs(Qs,{open:l,onOpenChange:d,children:[s.jsx(TM,{asChild:!0,children:s.jsx(ue,{type:"button",variant:"destructive",children:"Reset Dashboard"})}),s.jsxs(hs,{children:[s.jsxs(gs,{children:[s.jsx(xs,{children:"Are you absolutely sure?"}),s.jsx(bs,{children:"This action cannot be undone. This will reset the dashboard to setup mode. You will need to reconnect the Discord OAuth and reconfigure the dashboard owners."})]}),o&&s.jsx("p",{className:"text-sm font-medium text-destructive",children:o}),s.jsxs(Js,{children:[s.jsx(ue,{variant:"outline",onClick:()=>d(!1),disabled:n,children:"Cancel"}),s.jsx(ue,{variant:"destructive",onClick:()=>void m(),disabled:n,children:n?"Resetting...":"Yes, reset dashboard"})]})]})]})]}):null}function eP({canEdit:t}){const{branding:n,setBrandingLocal:a}=Ed(),o=f.useRef(null),[c,l]=f.useState(n.title),[d,m]=f.useState(n.pageTitle),[p,g]=f.useState(!1),[b,v]=f.useState(!1),[w,y]=f.useState("");f.useEffect(()=>{l(n.title),m(n.pageTitle)},[n.title,n.pageTitle]);const C=n.hasFavicon&&n.faviconUrl?`${n.faviconUrl}${n.updatedAt?`?v=${n.updatedAt}`:""}`:null;async function S(){if(t){g(!0),y("");try{const M=await Ne.updateBranding({title:c,pageTitle:d});M.data&&a(M.data),y(M.message||"Branding saved.")}catch(M){y(M instanceof Error?M.message:"Save failed")}finally{g(!1)}}}async function N(M){if(!(!t||!M)){v(!0),y("");try{const k=await Qz(M),_=await Ne.uploadBrandingFavicon(k);_.data&&a(_.data),y(_.message||"Favicon uploaded.")}catch(k){y(k instanceof Error?k.message:"Upload failed")}finally{v(!1),o.current&&(o.current.value="")}}}async function E(){if(t){v(!0),y("");try{const M=await Ne.removeBrandingFavicon();M.data&&a(M.data),y(M.message||"Favicon removed.")}catch(M){y(M instanceof Error?M.message:"Remove failed")}finally{v(!1)}}}const T=c.trim()!==n.title||d.trim()!==n.pageTitle;return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Branding Text"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Sidebar title and browser tab title — saved on the server for everyone using this dashboard."})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"brand-title",children:"Sidebar title"}),s.jsx(_e,{id:"brand-title",value:c,disabled:!t,maxLength:64,onChange:M=>l(M.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"brand-page-title",children:"Browser tab title"}),s.jsx(_e,{id:"brand-page-title",value:d,disabled:!t,maxLength:80,onChange:M=>m(M.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot Dashboard"})]})]}),t?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ue,{type:"button",disabled:p||!T,onClick:()=>void S(),children:p?"Saving…":"Save titles"}),w&&T?s.jsx("span",{className:"text-xs text-muted-foreground",children:w}):null]}):null]}),s.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Favicon"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, ICO, SVG, JPEG, or WebP — max 512 KB. Shown in the browser tab and beside the sidebar title."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsx("div",{className:"flex size-16 items-center justify-center overflow-hidden rounded-lg border border-border bg-secondary/30",children:C?s.jsx("img",{src:C,alt:"Favicon preview",className:"size-full object-contain p-2"}):s.jsx(xe,{icon:y8,size:24,className:"text-muted-foreground/50"})}),s.jsx("input",{ref:o,type:"file",accept:"image/png,image/jpeg,image/x-icon,image/vnd.microsoft.icon,image/svg+xml,image/webp,.ico",className:"hidden",disabled:!t||b,onChange:M=>{var k;return void N(((k=M.target.files)==null?void 0:k[0])??null)}}),s.jsxs("div",{className:"flex flex-col gap-2",children:[t?s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ue,{type:"button",variant:"secondary",disabled:b,onClick:()=>{var M;return(M=o.current)==null?void 0:M.click()},children:b?"Uploading…":"Upload Favicon"}),n.hasFavicon?s.jsx(ue,{type:"button",variant:"destructive",disabled:b,onClick:()=>void E(),children:"Remove"}):null]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}),!T&&w?s.jsx("span",{className:"text-xs text-muted-foreground",children:w}):null]})]})]})]})}function tP(){var v,w,y,C,S,N,E,T,M,k,_;const{hasPermission:t}=Yt(),n=t("settings.update"),[a,o]=f.useState(!0),[c,l]=f.useState(!1),[d,m]=f.useState(""),[p,g]=f.useState(null);f.useEffect(()=>{Ne.getConfigJson("api").then(R=>{R.data&&g(R.data)}).catch(()=>m("Failed to load API config")).finally(()=>o(!1))},[]);async function b(){var R,L,ne,X,I,H,q,ce,de,se,P;if(!(!n||!p)){l(!0),m("");try{const W={"api:API.Port":(R=p.API)==null?void 0:R.Port,"api:API.EmeraldAPIKey":(L=p.API)==null?void 0:L.EmeraldAPIKey,"api:API.TrustProxy":(ne=p.API)==null?void 0:ne.TrustProxy,"api:API.OAuth.Enabled":(I=(X=p.API)==null?void 0:X.OAuth)==null?void 0:I.Enabled,"api:API.OAuth.ClientId":(q=(H=p.API)==null?void 0:H.OAuth)==null?void 0:q.ClientId,"api:API.OAuth.ClientSecret":(de=(ce=p.API)==null?void 0:ce.OAuth)==null?void 0:de.ClientSecret,"api:API.OAuth.RedirectUri":(P=(se=p.API)==null?void 0:se.OAuth)==null?void 0:P.RedirectUri};await Ne.updateConfigFields(W),m("API settings saved and backend restarted.")}catch(W){m(W instanceof Error?W.message:"Save failed")}finally{l(!1)}}}return a?s.jsx("div",{className:"animate-pulse h-32 bg-secondary/20 rounded-md"}):p?s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Core API Settings"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure the internal API that powers this dashboard."})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"API Port"}),s.jsx(_e,{type:"number",value:((v=p.API)==null?void 0:v.Port)||"",disabled:!n,onChange:R=>g({...p,API:{...p.API,Port:parseInt(R.target.value)||3e3}}),className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Emerald API Key"}),s.jsx(_e,{type:"password",value:((w=p.API)==null?void 0:w.EmeraldAPIKey)||"",disabled:!n,onChange:R=>g({...p,API:{...p.API,EmeraldAPIKey:R.target.value}}),className:"border-border bg-secondary/30"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Mt,{checked:((y=p.API)==null?void 0:y.TrustProxy)||!1,disabled:!n,onCheckedChange:R=>g({...p,API:{...p.API,TrustProxy:R}})}),s.jsx(Ae,{className:"text-sm",children:"Trust Proxy (Enable if using Cloudflare/Nginx)"})]})]}),s.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"OAuth Authentication"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Discord application credentials for dashboard login."})]}),s.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[s.jsx(Mt,{checked:((S=(C=p.API)==null?void 0:C.OAuth)==null?void 0:S.Enabled)||!1,disabled:!n,onCheckedChange:R=>{var L;return g({...p,API:{...p.API,OAuth:{...(L=p.API)==null?void 0:L.OAuth,Enabled:R}}})}}),s.jsx(Ae,{className:"text-sm",children:"Enable OAuth"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Client ID"}),s.jsx(_e,{value:((E=(N=p.API)==null?void 0:N.OAuth)==null?void 0:E.ClientId)||"",disabled:!n,onChange:R=>{var L;return g({...p,API:{...p.API,OAuth:{...(L=p.API)==null?void 0:L.OAuth,ClientId:R.target.value}}})},className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Client Secret"}),s.jsx(_e,{type:"password",value:((M=(T=p.API)==null?void 0:T.OAuth)==null?void 0:M.ClientSecret)||"",disabled:!n,onChange:R=>{var L;return g({...p,API:{...p.API,OAuth:{...(L=p.API)==null?void 0:L.OAuth,ClientSecret:R.target.value}}})},className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(Ae,{children:"Redirect URI"}),s.jsx(_e,{value:((_=(k=p.API)==null?void 0:k.OAuth)==null?void 0:_.RedirectUri)||"",disabled:!n,onChange:R=>{var L;return g({...p,API:{...p.API,OAuth:{...(L=p.API)==null?void 0:L.OAuth,RedirectUri:R.target.value}}})},className:"border-border bg-secondary/30"}),s.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Must match the OAuth2 callback URL registered in the Discord Developer Portal exactly."})]})]})]}),n?s.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-6",children:[s.jsx(ue,{type:"button",disabled:c,onClick:()=>void b(),children:c?"Saving…":"Save API Config"}),d?s.jsx("span",{className:"text-xs text-muted-foreground",children:d}):null]}):null]}):null}function nP(){const{hasPermission:t}=Yt(),n=t("settings.update"),[a,o]=f.useState(null),[c,l]=f.useState(!0),[d,m]=f.useState(!1),[p,g]=f.useState(""),[b,v]=f.useState(""),[w,y]=f.useState(()=>d5()??Pl),[C,S]=f.useState(""),[N,E]=f.useState("appearance"),T=f.useCallback(async()=>{l(!0),g("");try{const k=await Ne.checkForUpdates();k.data&&o(k.data)}catch(k){g(k instanceof Error?k.message:"Could not check for updates")}finally{l(!1)}},[]);f.useEffect(()=>{T()},[T]);async function M(k){if(k.updateAvailable){m(!0),g(""),v("");try{const _=await Ne.runUpdate(k.id,k.latest,k.zipUrl);v(_.message||"Update installed. Restart your server (stop and run npm start again) to finish applying changes."),await T()}catch(_){g(_ instanceof Error?_.message:"Update failed")}finally{m(!1)}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),s.jsx("p",{className:"text-muted-foreground",children:"Application updates and maintenance — config files are edited under each module in the sidebar."})]}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-start",children:[s.jsx("aside",{className:"w-full md:w-56 shrink-0 sticky top-6",children:s.jsxs("nav",{className:"flex flex-row md:flex-col overflow-x-auto space-x-2 md:space-x-0 md:space-y-1 pb-2 md:pb-0",children:[s.jsx(ue,{variant:N==="appearance"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>E("appearance"),children:"Appearance"}),s.jsx(ue,{variant:N==="api"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>E("api"),children:"API Config"}),s.jsx(ue,{variant:N==="updates"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>E("updates"),children:"Update Checker"}),n&&s.jsx(ue,{variant:"ghost",className:`justify-start w-full text-destructive hover:bg-destructive/10 hover:text-destructive ${N==="danger"?"bg-destructive/10 border-l-2 border-destructive rounded-l-none":""}`,onClick:()=>E("danger"),children:"Danger Zone"})]})}),s.jsxs("main",{className:"flex-1 w-full max-w-4xl space-y-6",children:[N==="appearance"&&s.jsx("div",{className:"space-y-6",children:s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Dashboard appearance"}),s.jsx(Ot,{children:"Customise branding for all users, and pick an accent colour for this browser only."})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsx(eP,{canEdit:n}),s.jsxs("div",{className:"border-t border-border pt-4",children:[s.jsx("p",{className:"mb-1 text-sm font-medium",children:"Accent colour"}),s.jsx("p",{className:"mb-4 text-xs text-muted-foreground",children:"Buttons, links, and highlights — saved in this browser only."}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tf,{value:w,onChange:k=>{y(k),n2(k),S("Accent updated.")}}),s.jsx(_e,{id:"accent-colour",value:w,onChange:k=>y(k.target.value),onBlur:()=>{const k=$r(w,Pl);y(k),n2(k),S("Accent updated.")},className:"w-32 border-border bg-secondary/30 font-mono uppercase",maxLength:7})]}),s.jsx(ue,{type:"button",variant:"outline",onClick:()=>{Xz(),y(Pl),S("Reset to default purple.")},children:"Reset to default"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 text-sm mt-5",children:[s.jsx("span",{className:"rounded-md bg-primary px-3 py-1.5 font-medium text-primary-foreground",children:"Primary button"}),s.jsx("span",{className:"rounded-md bg-primary/15 px-3 py-1.5 text-primary",children:"Highlight"}),s.jsx("span",{className:"rounded-md bg-accent px-3 py-1.5 text-accent-foreground",children:"Accent surface"})]}),C?s.jsx("p",{className:"text-xs text-muted-foreground",children:C}):null]})]})]})}),N==="danger"&&n&&s.jsxs(Je,{className:"border-destructive/50 bg-destructive/5",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg text-destructive",children:"Danger Zone"}),s.jsx(Ot,{className:"text-destructive/80",children:"Destructive actions that reset or permanently alter your dashboard."})]}),s.jsx(et,{children:s.jsx(Jz,{canEdit:n})})]}),N==="api"&&s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"API Configuration"}),s.jsx(Ot,{children:"Configure the internal API settings, Emerald API key, and OAuth."})]}),s.jsx(et,{children:s.jsx(tP,{})})]}),N==="updates"&&s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Software updates"}),s.jsx(Ot,{children:"Manage updates for the bot and dashboard."})]}),s.jsxs(et,{className:"space-y-4",children:[c?s.jsx(Ue,{className:"h-24 w-full"}):a&&a.length>0?s.jsx("div",{className:"space-y-4",children:a.map(k=>s.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-secondary/20 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("p",{className:"font-medium text-sm",children:[s.jsx("a",{href:k.repository,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:k.name})," ","(",k.branch," branch)"]}),s.jsxs("div",{className:"flex gap-x-4 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Installed: "}),s.jsxs("span",{className:"font-mono font-medium",children:["v",k.current]})]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Latest: "}),s.jsxs("span",{className:"font-mono font-medium",children:["v",k.latest]})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[k.updateAvailable?s.jsx("p",{className:"text-sm text-amber-500",children:"A newer version is available. Update downloads files while keeping your Configs and Data."}):s.jsx("p",{className:"text-sm text-emerald-500",children:"You are on the latest release."}),k.updateAvailable&&n?s.jsxs(ue,{type:"button",size:"sm",onClick:()=>void M(k),disabled:d,children:[d?s.jsx(xe,{icon:_2,size:16,className:"mr-2 animate-spin"}):s.jsx(xe,{icon:Cd,size:16,className:"mr-2"}),d?"Installing…":"Update now"]}):null,k.updateAvailable&&!n?s.jsx("p",{className:"text-xs text-muted-foreground",children:"You cannot install updates with your role."}):null]})]},k.id))}):null,p?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:p})}):null,b?s.jsx(Ye,{children:s.jsx(qe,{children:b})}):null,s.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:s.jsxs(ue,{type:"button",variant:"outline",onClick:T,disabled:c||d,children:[s.jsx(xe,{icon:fr,size:16,className:"mr-2"}),"Check again"]})})]})]})]})]})]})}function kx(t){const[n,a]=f.useState(!1),o=f.useRef(t);return o.current=t,f.useEffect(()=>{let c=null,l=null;const d=()=>{c=new EventSource("/api/stream"),c.onopen=()=>{a(!0)},c.addEventListener("connected",()=>{a(!0)}),c.addEventListener("metrics",m=>{var p,g;try{const b=JSON.parse(m.data);(g=(p=o.current).onMetrics)==null||g.call(p,b)}catch{}}),c.addEventListener("log",m=>{var p,g;try{const b=JSON.parse(m.data);(g=(p=o.current).onLog)==null||g.call(p,b)}catch{}}),c.addEventListener("ticket_message",m=>{var p,g;try{const b=JSON.parse(m.data);(g=(p=o.current).onTicketMessage)==null||g.call(p,b)}catch{}}),c.addEventListener("ticket_message_deleted",m=>{var p,g;try{const b=JSON.parse(m.data);(g=(p=o.current).onTicketMessageDeleted)==null||g.call(p,b)}catch{}}),c.addEventListener("ticket_message_updated",m=>{var p,g;try{const b=JSON.parse(m.data);(g=(p=o.current).onTicketMessageUpdated)==null||g.call(p,b)}catch{}}),c.addEventListener("ticket_created",m=>{var p,g;try{const b=JSON.parse(m.data);(g=(p=o.current).onTicketCreated)==null||g.call(p,b)}catch{}}),c.addEventListener("ticket_closed",m=>{var p,g;try{const b=JSON.parse(m.data);(g=(p=o.current).onTicketClosed)==null||g.call(p,b)}catch{}}),c.onerror=()=>{a(!1),c==null||c.close(),l=window.setTimeout(d,4e3)}};return d(),()=>{l&&window.clearTimeout(l),c&&c.close()}},[]),{connected:n}}function Tt({label:t,value:n,mono:a=!1}){return s.jsxs("div",{className:"flex flex-col gap-1 border-b border-border py-3 last:border-0 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("dt",{className:"text-sm text-muted-foreground",children:t}),s.jsx("dd",{className:`text-sm font-medium text-foreground ${a?"font-mono text-xs sm:text-sm":""}`,children:n})]})}const rP={ok:"Healthy",missing_config:"Guild ID not set",not_in_guild:"Not in configured server",extra_guilds:"Extra servers joined",offline:"Bot offline"};function aP(t){return t==="ok"?"text-emerald-500":t==="offline"?"text-destructive":"text-amber-500"}function sP(){var N;const{stats:t,loading:n,error:a,refresh:o}=kd(),[c,l]=f.useState(null),[d,m]=f.useState(null),[p,g]=f.useState(!1),[b,v]=f.useState(null),{connected:w}=kx({onMetrics:E=>{v(E)}}),y=f.useCallback(async()=>{const[E,T]=await Promise.all([Ne.getGuildStatus().catch(()=>null),Ne.health().catch(()=>null)]);E!=null&&E.data&&l(E.data),T!=null&&T.success&&T.data&&m({dashboard:T.data.dashboard,botReady:T.data.botReady,oauthEnabled:T.data.oauthEnabled,setupComplete:T.data.setupComplete})},[]);f.useEffect(()=>{y()},[y]);async function C(){g(!0);try{await Promise.all([o(),y()])}finally{g(!1)}}if(n&&!t)return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ue,{className:"h-10 w-64"}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Ue,{className:"h-56 rounded-2xl"}),s.jsx(Ue,{className:"h-56 rounded-2xl"})]})]});if(a||!t)return s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:a||"Could not load system details."})});const S=t.bot.ping<200;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2 h-8 px-2 text-muted-foreground",children:s.jsxs(en,{to:"/",children:[s.jsx(xe,{icon:T2,size:16,className:"mr-1.5"}),"Back to dashboard"]})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"System details"}),s.jsx("p",{className:"text-muted-foreground",children:"Live bot, host, and dashboard status — refreshed every 30 seconds."})]})]}),s.jsxs(ue,{type:"button",variant:"outline",disabled:p,onClick:()=>void C(),children:[s.jsx(xe,{icon:fr,size:16,className:"mr-2"}),p?"Refreshing…":"Refresh now"]})]}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Discord bot"}),s.jsx(Ot,{children:"Connection and identity"})]}),s.jsxs(et,{children:[s.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s.jsxs(vs,{className:"size-12",children:[s.jsx(eo,{src:t.bot.avatar,alt:t.bot.username}),s.jsx(ys,{children:"SB"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:t.bot.username}),s.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:t.bot.id})]})]}),s.jsxs("dl",{children:[s.jsx(Tt,{label:"Version",value:`v${t.bot.version}`,mono:!0}),s.jsx(Tt,{label:"Gateway latency",value:s.jsxs("span",{className:S?"text-emerald-500":"text-amber-500",children:[t.bot.ping," ms"]})}),s.jsx(Tt,{label:"Process uptime",value:fg(t.bot.uptime)}),s.jsx(Tt,{label:"Connected servers",value:t.servers.toLocaleString()}),s.jsx(Tt,{label:"Members tracked",value:t.users.toLocaleString()}),t.bot.inviteUrl?s.jsx(Tt,{label:"Invite link",value:s.jsx("a",{href:t.bot.inviteUrl,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"Open in Discord"})}):null]})]})]}),s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(ft,{className:"text-lg",children:"Host machine"}),s.jsx(Ot,{children:"Server resources running this instance"})]}),s.jsxs(Fn,{variant:w?"default":"outline",className:"text-xs",children:[s.jsx("span",{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${w?"bg-emerald-500 animate-pulse":"bg-muted"}`}),w?"Live Stream":"Polling"]})]}),s.jsx(et,{children:s.jsxs("dl",{children:[s.jsx(Tt,{label:"Memory used",value:b?`${(b.ram_used_mb/1024).toFixed(2)} GB / ${(b.ram_total_mb/1024).toFixed(2)} GB`:`${t.hosting.ram_used} / ${t.hosting.ram_total}`}),s.jsx(Tt,{label:"Memory usage",value:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:(b?b.ram_percent:t.hosting.ram_percent)>85?"text-amber-500 font-bold":"text-foreground font-medium",children:[b?b.ram_percent:t.hosting.ram_percent,"%"]}),s.jsx("div",{className:"w-24 h-2 bg-secondary rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${b?b.ram_percent:t.hosting.ram_percent}%`}})})]})}),s.jsx(Tt,{label:"CPU load (1 min avg)",value:b?String(b.cpu_load):t.hosting.cpu_load,mono:!0}),s.jsx(Tt,{label:"Host uptime",value:t.hosting.uptime})]})})]}),s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Tickets"}),s.jsx(Ot,{children:"Database snapshot"})]}),s.jsx(et,{children:s.jsxs("dl",{children:[s.jsx(Tt,{label:"Total tickets",value:t.tickets.total}),s.jsx(Tt,{label:"Open",value:s.jsx("span",{className:"text-primary",children:t.tickets.open})}),s.jsx(Tt,{label:"Closed",value:t.tickets.closed}),s.jsx(Tt,{label:"Transcripts",value:s.jsx(en,{to:"/transcripts",className:"text-primary underline-offset-4 hover:underline",children:"Browse archive"})})]})})]}),s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Guild health"}),s.jsx(Ot,{children:"Configured server and membership"})]}),s.jsx(et,{children:c?s.jsxs("dl",{children:[s.jsx(Tt,{label:"Status",value:s.jsx("span",{className:aP(c.status),children:rP[c.status]})}),s.jsx(Tt,{label:"Configured guild ID",value:c.configuredGuildId||"Not set",mono:!0}),c.configuredGuild?s.jsx(Tt,{label:"Configured server",value:`${c.configuredGuild.name} (${((N=c.configuredGuild.memberCount)==null?void 0:N.toLocaleString())??"?"} members)`}):null,c.message?s.jsx("div",{className:"mt-3 rounded-lg border border-border bg-secondary/30 px-3 py-2 text-sm text-muted-foreground",children:c.message}):null,c.extraGuilds.length>0?s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Extra servers"}),s.jsx("ul",{className:"space-y-1 text-sm",children:c.extraGuilds.map(E=>s.jsxs("li",{className:"font-mono text-xs",children:[E.name," · ",E.id]},E.id))})]}):null]}):s.jsx(Ue,{className:"h-24 w-full"})})]})]}),s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Dashboard services"}),s.jsx(Ot,{children:"API and authentication"})]}),s.jsx(et,{children:d?s.jsxs("dl",{className:"max-w-xl",children:[s.jsx(Tt,{label:"Dashboard UI",value:d.dashboard?"Available":"Missing build"}),s.jsx(Tt,{label:"Bot connection",value:d.botReady?"Online":"Starting or offline"}),s.jsx(Tt,{label:"Discord OAuth",value:d.oauthEnabled?"Configured":"Not configured"}),s.jsx(Tt,{label:"Initial setup",value:d.setupComplete?"Complete":"Incomplete"}),s.jsx(Tt,{label:"Software updates",value:s.jsx(en,{to:"/settings",className:"text-primary underline-offset-4 hover:underline",children:"Open settings"})}),s.jsx(Tt,{label:"Logs",value:s.jsx(en,{to:"/logs",className:"text-primary underline-offset-4 hover:underline",children:"View log files"})})]}):s.jsx(Ue,{className:"h-32 w-full max-w-xl"})})]}),t.modules?s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-lg",children:"Module setup status"}),s.jsx(Ot,{children:"Which features are configured and active"})]}),s.jsx(et,{children:s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ai.map(E=>{const T=Kh(E.id,t.modules);return s.jsxs(en,{to:E.href,className:"flex items-start justify-between gap-3 rounded-xl border border-border bg-secondary/20 px-4 py-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium",children:E.title}),s.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:T.subtitle})]}),s.jsx("span",{className:"shrink-0 rounded-full bg-secondary px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:c5[T.status]})]},E.id)})})})]}):null]})}function oP(t){if(!t)return"—";const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}const iP=[{id:"all",label:"All"},{id:"Output",label:"Output"},{id:"Warn",label:"Warn"},{id:"Error",label:"Error"}],lP=["Output","Warn","Error"],cP={Output:"text-foreground/90",Warn:"text-amber-400",Error:"text-rose-400"},uP={Output:"bg-muted text-muted-foreground",Warn:"bg-amber-500/15 text-amber-400",Error:"bg-rose-500/15 text-rose-400"},gd=2e3,dP=2e3;function Wh(t,n){return`${t.type}-${t.timestamp??"na"}-${n}-${t.message.slice(0,32)}`}function fP(t,n,a){const o=a?[]:t,c=new Set(o.map((m,p)=>Wh(m,p))),l=[];for(let m=0;m<n.length;m++){const p=Wh(n[m],m);c.has(p)||(c.add(p),l.push(n[m]))}const d=[...o,...l];return d.length>gd?d.slice(d.length-gd):d}function mP(){const[t,n]=f.useState([]),[a,o]=f.useState(!0),[c,l]=f.useState(""),[d,m]=f.useState(!1),[p,g]=f.useState(!0),[b,v]=f.useState("all"),[w,y]=f.useState(""),[C,S]=f.useState(!0),[N,E]=f.useState(""),T=f.useRef(null),M=f.useRef(null),k=f.useRef(d);k.current=d;const _=f.useMemo(()=>b==="all"?lP:[b],[b]),R=f.useCallback(I=>{k.current||b!=="all"&&I.type!==b||(n(H=>{const q=[...H,I];return q.length>gd?q.slice(q.length-gd):q}),S(!0))},[b]);kx({onLog:R});const L=f.useCallback(async I=>{var ce,de;const H=await Ne.getLogs({types:_,cursor:I?void 0:T.current??void 0,tail:I?500:0}),q=((ce=H.data)==null?void 0:ce.entries)??[];return T.current=((de=H.data)==null?void 0:de.cursor)??{},n(se=>fP(se,q,I)),q.length},[_]),ne=f.useCallback(async()=>{var I;o(!0),l(""),T.current=null;try{const ce=(((I=(await Ne.getLogsMeta()).data)==null?void 0:I.files)??[]).filter(de=>de.file).map(de=>`${de.type}: ${de.file}`).join(" · ");E(ce||"No log files yet — output appears when the bot runs."),await L(!0),S(!0)}catch(H){l(H instanceof Error?H.message:"Failed to load logs"),S(!1)}finally{o(!1)}},[L]);f.useEffect(()=>{ne()},[ne]),f.useEffect(()=>{if(d||a)return;const I=window.setInterval(async()=>{if(!k.current)try{await L(!1),S(!0),l("")}catch(H){S(!1),l(H instanceof Error?H.message:"Live update failed")}},dP);return()=>window.clearInterval(I)},[d,a,L]),f.useEffect(()=>{if(!p||d)return;const I=M.current;I&&(I.scrollTop=I.scrollHeight)},[t,p,d]);const X=f.useMemo(()=>t.filter(I=>{var q;if(b!=="all"&&I.type!==b)return!1;if(!w.trim())return!0;const H=w.toLowerCase();return I.message.toLowerCase().includes(H)||(((q=I.timestamp)==null?void 0:q.toLowerCase().includes(H))??!1)}),[t,b,w]);return s.jsxs("div",{className:"flex h-[calc(100svh-8rem)] min-h-[480px] flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Logs"}),s.jsx("p",{className:"text-muted-foreground",children:"Live bot output — updates every 2 seconds"}),N?s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:N}):null]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:pe("size-2 rounded-full",C&&!d?"animate-pulse bg-emerald-500":"bg-muted-foreground")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:d?"Paused":C?"Live":"Disconnected"})]})]}),c?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:c})}):null,s.jsxs(Je,{className:"flex min-h-0 flex-1 flex-col border-border bg-card",children:[s.jsxs(dt,{className:"shrink-0 space-y-4 border-b border-border pb-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs(ft,{className:"text-base font-medium",children:["Console",a?null:s.jsxs("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:[X.length," line",X.length===1?"":"s"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border px-2 py-1",children:[s.jsx(Mt,{id:"auto-scroll",checked:p,onCheckedChange:g}),s.jsx(Ae,{htmlFor:"auto-scroll",className:"text-xs font-normal",children:"Auto-scroll"})]}),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>m(I=>!I),children:[s.jsx(xe,{icon:d?k8:E8,size:16,className:"mr-1.5"}),d?"Resume":"Pause"]}),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{n([]),ne()},disabled:a,children:[s.jsx(xe,{icon:fr,size:16,className:"mr-1.5"}),"Refresh"]})]})]}),s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[s.jsx("div",{className:"flex flex-wrap gap-1 rounded-xl bg-secondary/50 p-1",children:iP.map(I=>s.jsx(ue,{type:"button",variant:b===I.id?"secondary":"ghost",size:"sm",className:"h-8 rounded-lg text-xs",onClick:()=>v(I.id),children:I.label},I.id))}),s.jsxs("div",{className:"relative flex-1 sm:max-w-xs",children:[s.jsx(xe,{icon:vi,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(_e,{placeholder:"Filter lines…",value:w,onChange:I=>y(I.target.value),className:"h-9 pl-9"})]})]})]}),s.jsx(et,{className:"min-h-0 flex-1 p-0",children:a?s.jsx("div",{className:"space-y-2 p-4",children:Array.from({length:8}).map((I,H)=>s.jsx(Ue,{className:"h-4 w-full"},H))}):s.jsx("div",{ref:M,className:"h-full max-h-[calc(100svh-18rem)] overflow-y-auto bg-[#0d0d12] p-4 font-mono text-[13px] leading-relaxed",children:X.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No log lines yet. Start the bot and activity will appear here (also written to the Logs folder on disk)."}):s.jsx("ul",{className:"space-y-1",children:X.map((I,H)=>s.jsxs("li",{className:"flex gap-2 rounded px-1 py-0.5 hover:bg-white/[0.03]",children:[s.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:oP(I.timestamp)}),s.jsx("span",{className:pe("shrink-0 rounded px-1.5 py-0 text-[10px] font-semibold uppercase",uP[I.type]),children:I.type}),s.jsx("span",{className:pe("min-w-0 flex-1 whitespace-pre-wrap break-words",cP[I.type]),children:I.message||" "})]},Wh(I,H)))})})})]})]})}const pP=[{title:"Colors",description:"Theme colors used across the transcript page.",fields:[{path:"Theme.Background",label:"Page background",type:"color"},{path:"Theme.Panel",label:"Panel background",type:"color"},{path:"Theme.PanelSecondary",label:"Secondary panel",type:"color"},{path:"Theme.Border",label:"Borders",type:"color"},{path:"Theme.Text",label:"Main text",type:"color"},{path:"Theme.Muted",label:"Muted text",type:"color"},{path:"Theme.Accent",label:"Accent",type:"color"},{path:"Theme.Link",label:"Links",type:"color"},{path:"Theme.AttachmentLink",label:"Attachment links",type:"color"},{path:"Theme.CodeBackground",label:"Code blocks",type:"color"}]},{title:"Typography",fields:[{path:"Typography.FontFamily",label:"Font family",type:"googleFont",description:"Google Fonts are loaded automatically in saved transcripts."}]},{title:"Header",fields:[{path:"Header.Title",label:"Title",type:"text"},{path:"Header.Subtitle",label:"Subtitle",type:"textarea",description:"Placeholders: {{ticketName}} {{ticketId}} {{messageCount}} {{reason}}. Use **text** for bold."},{path:"Header.Badge",label:"Badge label",type:"text"},{path:"Header.ShowMetaCards",label:"Show info cards",type:"boolean"}]},{title:"Info card labels",fields:[{path:"Meta.ChannelLabel",label:"Channel label",type:"text"},{path:"Meta.TicketIdLabel",label:"Ticket ID label",type:"text"},{path:"Meta.MessageCountLabel",label:"Message count label",type:"text"},{path:"Meta.CloseReasonLabel",label:"Close reason label",type:"text"},{path:"Meta.DefaultCloseReason",label:"Default close reason",type:"text"}]},{title:"Messages section",fields:[{path:"Messages.SectionTitle",label:"Section heading",type:"text"},{path:"Messages.EmptyState",label:"Empty state text",type:"text"}]},{title:"Advanced CSS",description:"Optional extra CSS appended to the transcript stylesheet.",fields:[{path:"Advanced.CustomCss",label:"Custom CSS",type:"textarea",description:"Example: .badge { font-size: 1rem; }"}]}],hP=450;function gP(t,n){return n&&t!=="viewer"}function xP(){const{user:t,hasPermission:n}=Yt(),a=!gP(t==null?void 0:t.role,n("transcripts")),[o,c]=f.useState(null),[l,d]=f.useState(null),[m,p]=f.useState(!0),[g,b]=f.useState(!1),[v,w]=f.useState(""),[y,C]=f.useState(""),[S,N]=f.useState(""),[E,T]=f.useState(!1),M=f.useRef(null),k=f.useCallback(async()=>{var X;p(!0),w(""),C("");try{const H=(await Ne.getTranscriptTemplate()).data??null;if(H){const q={...H,Typography:{...H.Typography,FontFamily:kS((X=H.Typography)==null?void 0:X.FontFamily)}};c(q),d(structuredClone(q))}}catch(I){w(I instanceof Error?I.message:"Failed to load template")}finally{p(!1)}},[]);f.useEffect(()=>{k()},[k]);const _=f.useCallback(async X=>{T(!0);try{const I=await Ne.previewTranscriptTemplate(X);N(I)}catch{N("<!DOCTYPE html><body style='padding:2rem;font-family:sans-serif'><p>Preview failed to load.</p></body>")}finally{T(!1)}},[]);f.useEffect(()=>{if(o)return M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{_(o)},hP),()=>{M.current&&clearTimeout(M.current)}},[o,_]);function R(X,I){c(H=>H&&Gn(H,X,I))}async function L(){if(!(a||!o)){b(!0),w(""),C("");try{const X=await Ne.saveTranscriptTemplate(o);C(X.message||"Saved."),d(structuredClone(o))}catch(X){w(X instanceof Error?X.message:"Save failed")}finally{b(!1)}}}const ne=o&&l&&JSON.stringify(o)!==JSON.stringify(l);return m?s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Ue,{className:"h-96 rounded-xl"}),s.jsx(Ue,{className:"h-96 rounded-xl"})]}):o?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize how new ticket transcripts look. Existing saved transcripts are not changed."}),s.jsxs("div",{className:"flex items-center gap-2",children:[ne?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(ue,{size:"sm",onClick:L,disabled:g||!ne,children:[s.jsx(xe,{icon:Sd,size:16,className:"mr-1.5"}),g?"Saving…":"Save appearance"]})]})]}),v?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:v})}):null,y?s.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(qe,{children:y})}):null,s.jsxs("div",{className:"grid min-h-0 gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]",children:[s.jsx(bP,{data:o,readOnly:a,onPatch:R}),s.jsxs(Je,{className:"flex min-h-[520px] flex-col overflow-hidden border-border bg-card",children:[s.jsxs(dt,{className:"pb-2",children:[s.jsx(ft,{className:"text-base",children:"Live preview"}),s.jsxs(Ot,{children:["Sample ticket with your current settings",E?" · updating…":""]})]}),s.jsx(et,{className:"min-h-0 flex-1 p-4 pt-0",children:s.jsx("iframe",{title:"Transcript template preview",srcDoc:S,className:pe("h-[min(640px,calc(100svh-14rem))] w-full rounded-lg border border-border bg-background",E&&"opacity-60"),sandbox:"allow-same-origin"})})]})]})]}):s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:v||"Failed to load template"})})}function bP({data:t,readOnly:n,onPatch:a}){return s.jsx("div",{className:"max-h-[min(720px,calc(100svh-12rem))] space-y-4 overflow-y-auto pr-1",children:pP.map(o=>s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{className:"pb-3",children:[s.jsx(ft,{className:"text-base",children:o.title}),o.description?s.jsx(Ot,{children:o.description}):null]}),s.jsx(et,{className:"grid gap-4 sm:grid-cols-2",children:o.fields.map(c=>s.jsx("div",{className:c.type==="textarea"?"sm:col-span-2":"",children:s.jsx(pd,{field:c,value:kr(t,c.path),readOnly:n,onChange:l=>a(c.path,l)})},c.path))})]},o.title))})}function vP(t,n){return n&&t!=="viewer"}function yP(){const{user:t,hasPermission:n}=Yt(),a=!vP(t==null?void 0:t.role,n("transcripts")),[o,c]=f.useState(null),[l,d]=f.useState(!0),[m,p]=f.useState(!1),[g,b]=f.useState(!1),[v,w]=f.useState(""),[y,C]=f.useState(""),S=f.useCallback(async()=>{var T,M,k;d(!0),w(""),C("");try{const R=(await Ne.getTranscriptSettings()).data;R&&c({autoDelete:{enabled:!!((T=R.autoDelete)!=null&&T.enabled),afterDays:((M=R.autoDelete)==null?void 0:M.afterDays)??30},publicAccess:{enabled:!!((k=R.publicAccess)!=null&&k.enabled)}})}catch(_){w(_ instanceof Error?_.message:"Failed to load settings")}finally{d(!1)}},[]);f.useEffect(()=>{S()},[S]);async function N(){if(!(!o||a)){p(!0),w(""),C("");try{const T=await Ne.updateTranscriptSettings(o);T.data&&c({autoDelete:{enabled:T.data.autoDelete.enabled,afterDays:T.data.autoDelete.afterDays},publicAccess:{enabled:T.data.publicAccess.enabled}}),C(T.message??"Settings saved.")}catch(T){w(T instanceof Error?T.message:"Failed to save settings")}finally{p(!1)}}}async function E(){var T,M;if(!a){b(!0),w(""),C("");try{const k=await Ne.purgeTranscripts();C(k.message??((T=k.data)!=null&&T.skipped?"Auto-delete is disabled.":`Removed ${((M=k.data)==null?void 0:M.deleted)??0} transcript(s).`))}catch(k){w(k instanceof Error?k.message:"Purge failed")}finally{b(!1)}}}return l?s.jsxs("div",{className:"space-y-4",children:[s.jsx(Ue,{className:"h-40 w-full rounded-xl"}),s.jsx(Ue,{className:"h-40 w-full rounded-xl"})]}):o?s.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[a?s.jsx(Ye,{children:s.jsx(qe,{children:"You have view-only access. An admin or editor can change these settings."})}):null,v?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:v})}):null,y?s.jsx(Ye,{children:s.jsx(qe,{children:y})}):null,s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-base",children:"Auto-delete"}),s.jsx(Ot,{children:"Remove transcript files automatically after they reach a certain age. The server checks hourly and whenever you open the library."})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.autoDelete.enabled,disabled:a,onChange:T=>c(M=>M&&{...M,autoDelete:{...M.autoDelete,enabled:T.target.checked}})}),s.jsxs("span",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"Enable auto-delete"}),s.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Deletes HTML files in Data/Transcripts based on last modified time."})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",htmlFor:"transcript-after-days",children:"Delete after (days)"}),s.jsx(_e,{id:"transcript-after-days",type:"number",min:1,max:3650,disabled:a||!o.autoDelete.enabled,value:o.autoDelete.afterDays,onChange:T=>c(M=>M&&{...M,autoDelete:{...M.autoDelete,afterDays:Math.min(3650,Math.max(1,parseInt(T.target.value,10)||1))}}),className:"max-w-[8rem]"})]}),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",disabled:a||g,onClick:()=>void E(),children:[s.jsx(xe,{icon:fr,size:16,className:pe(g&&"animate-spin")}),"Run cleanup now"]})]})]}),s.jsxs(Je,{className:"border-border bg-card",children:[s.jsxs(dt,{children:[s.jsx(ft,{className:"text-base",children:"Public transcripts"}),s.jsxs(Ot,{children:["When enabled, anyone with the link can view a transcript at"," ",s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:typeof window<"u"?`${window.location.origin}/transcripts/:id`:"/transcripts/:id"})," ","without signing in. Channel IDs are numeric but not secret—only enable if you are comfortable sharing links."]})]}),s.jsx(et,{children:s.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.publicAccess.enabled,disabled:a,onChange:T=>c(M=>M&&{...M,publicAccess:{enabled:T.target.checked}})}),s.jsxs("span",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"Allow public transcript URLs"}),s.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Dashboard preview and download still require login."})]})]})})]}),a?null:s.jsxs(ue,{type:"button",disabled:m,onClick:()=>void N(),children:[s.jsx(xe,{icon:Sd,size:16}),m?"Saving…":"Save settings"]})]}):s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:"Could not load transcript settings."})})}function wP(t,n){return n&&t!=="viewer"}function r2(t){return t==null?"":t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function a2(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function jP(){var B;const{user:t,hasPermission:n}=Yt(),a=wP(t==null?void 0:t.role,n("transcripts")),[o,c]=f.useState("browse"),[l,d]=f.useState([]),[m,p]=f.useState(null),[g,b]=f.useState(!0),[v,w]=f.useState(""),[y,C]=f.useState(""),[S,N]=f.useState(""),[E,T]=f.useState(0),[M,k]=f.useState(!1),[_,R]=f.useState(!1),[L,ne]=f.useState(!1),[X,I]=f.useState(!1),H=f.useCallback(async()=>{b(!0),C("");try{const Z=(await Ne.listTranscripts()).data??[];d(Z),p(be=>{var K;return be&&Z.some(ge=>ge.id===be)?be:((K=Z[0])==null?void 0:K.id)??null})}catch(V){C(V instanceof Error?V.message:"Failed to load transcripts")}finally{b(!1)}},[]);f.useEffect(()=>{H()},[H]),f.useEffect(()=>{o==="browse"&&Ne.getTranscriptSettings().then(V=>{var Z,be;ne(!!((be=(Z=V.data)==null?void 0:Z.publicAccess)!=null&&be.enabled))}).catch(()=>ne(!1))},[o]);const q=f.useMemo(()=>{if(!S.trim())return l;const V=S.toLowerCase();return l.filter(Z=>Z.id.includes(V)||Z.filename.toLowerCase().includes(V)||Z.ticketName&&Z.ticketName.toLowerCase().includes(V))},[l,S]),ce=f.useMemo(()=>l.find(V=>V.id===m)??null,[l,m]),de=m?`/api/system/transcripts/${encodeURIComponent(m)}/view`:null,se=m?`/api/system/transcripts/${encodeURIComponent(m)}/download`:null,P=m&&L?`${window.location.origin}/transcripts/${encodeURIComponent(m)}`:null;function W(V){w(""),p(V),T(Z=>Z+1)}function oe(){de&&window.open(de,"_blank","noopener,noreferrer")}function ae(){P&&window.open(P,"_blank","noopener,noreferrer")}async function G(){if(P)try{await navigator.clipboard.writeText(P),I(!0),window.setTimeout(()=>I(!1),2e3)}catch{w("Could not copy link to clipboard.")}}async function O(){var Z;if(!m||!a)return;const V=((Z=ce==null?void 0:ce.ticketName)==null?void 0:Z.trim())||`channel ${m}`;if(window.confirm(`Delete the transcript for ${V}? This cannot be undone.`)){R(!0),w("");try{await Ne.deleteTranscript(m),await H()}catch(be){w(be instanceof Error?be.message:"Failed to delete transcript")}finally{R(!1)}}}async function D(){if(!(!se||!ce)){k(!0),w("");try{const V=await fetch(se,{credentials:"include"});if(!V.ok){const ge=await V.json().catch(()=>({}));throw new Error(ge.error||`Download failed (${V.status})`)}const Z=await V.blob(),be=URL.createObjectURL(Z),K=document.createElement("a");K.href=be,K.download=ce.filename,K.click(),URL.revokeObjectURL(be)}catch(V){w(V instanceof Error?V.message:"Failed to download transcript")}finally{k(!1)}}}return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Transcripts"}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Browse saved transcripts or customize how new ones look when tickets close."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[s.jsx(ue,{type:"button",variant:o==="browse"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>c("browse"),children:"Library"}),s.jsx(ue,{type:"button",variant:o==="appearance"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>c("appearance"),children:"Appearance"}),s.jsx(ue,{type:"button",variant:o==="settings"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>c("settings"),children:"Settings"})]}),o==="browse"?s.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>H(),disabled:g,children:[s.jsx(xe,{icon:fr,size:16,className:pe(g&&"animate-spin")}),"Refresh"]}):null]})]}),o==="appearance"?s.jsx(xP,{}):o==="settings"?s.jsx(yP,{}):s.jsxs(s.Fragment,{children:[y?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:y})}):null,s.jsxs("div",{className:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(240px,320px)_1fr]",children:[s.jsxs(Je,{className:"flex min-h-[420px] flex-col border-border bg-card",children:[s.jsxs(dt,{className:"space-y-3 pb-3",children:[s.jsxs(ft,{className:"text-base font-medium",children:["Saved transcripts",!g&&l.length>0?s.jsxs("span",{className:"ml-2 font-normal text-muted-foreground",children:["(",l.length,")"]}):null]}),s.jsxs("div",{className:"relative",children:[s.jsx(xe,{icon:vi,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(_e,{placeholder:"Search by ticket name or channel ID…",value:S,onChange:V=>N(V.target.value),className:"pl-9"})]})]}),s.jsx(et,{className:"min-h-0 flex-1 p-0 pb-4",children:s.jsx(fc,{className:"h-[min(520px,calc(100svh-16rem))] px-4",children:g?s.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((V,Z)=>s.jsx(Ue,{className:"h-16 w-full rounded-lg"},Z))}):q.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-sm text-muted-foreground",children:[s.jsx(xe,{icon:Ul,size:32,className:"opacity-40"}),s.jsx("p",{children:l.length===0?"No transcripts yet. They appear when tickets are closed.":"No transcripts match your search."})]}):s.jsx("ul",{className:"space-y-1.5",children:q.map(V=>{var K;const Z=V.id===m,be=((K=V.ticketName)==null?void 0:K.trim())||`Channel ${V.id}`;return s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>W(V.id),className:pe("w-full rounded-lg border px-3 py-2.5 text-left transition-colors",Z?"border-primary/50 bg-primary/10":"border-transparent bg-secondary/30 hover:bg-secondary/50"),children:[s.jsx("p",{className:"truncate text-sm font-medium",children:be}),s.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[a2(V.createdAt),V.size!=null?` · ${r2(V.size)}`:""]})]})},V.id)})})})})]}),s.jsxs(Je,{className:"flex min-h-[420px] flex-col overflow-hidden border-border bg-card",children:[s.jsxs(dt,{className:"flex flex-row flex-wrap items-center justify-between gap-2 space-y-0 pb-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(ft,{className:"truncate text-base font-medium",children:ce?((B=ce.ticketName)==null?void 0:B.trim())||`Channel ${ce.id}`:"Preview"}),ce?s.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[a2(ce.createdAt),ce.size!=null?` · ${r2(ce.size)}`:""]}):null]}),s.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[P?s.jsxs(s.Fragment,{children:[s.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>void G(),children:[s.jsx(xe,{icon:R2,size:16}),X?"Copied":"Copy link"]}),s.jsxs(ue,{variant:"outline",size:"sm",onClick:ae,children:[s.jsx(xe,{icon:Nd,size:16}),"Public page"]})]}):null,s.jsxs(ue,{variant:"outline",size:"sm",disabled:!de,onClick:oe,children:[s.jsx(xe,{icon:p8,size:16}),"Open tab"]}),s.jsxs(ue,{variant:"outline",size:"sm",disabled:!se||M,onClick:()=>void D(),children:[s.jsx(xe,{icon:Cd,size:16}),M?"Saving…":"Download"]}),a?s.jsxs(ue,{variant:"outline",size:"sm",disabled:!m||_,className:"text-destructive hover:text-destructive",onClick:()=>void O(),children:[s.jsx(xe,{icon:bi,size:16}),_?"Deleting…":"Delete"]}):null]})]}),s.jsxs(et,{className:"flex min-h-0 flex-1 flex-col gap-2 p-4 pt-0",children:[v?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:v})}):null,ce&&de?s.jsx("iframe",{title:`Transcript ${ce.id}`,src:de,className:"min-h-[min(560px,calc(100svh-18rem))] w-full flex-1 rounded-lg border border-border bg-background",sandbox:"allow-same-origin"},E):s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border py-16 text-center text-sm text-muted-foreground",children:[s.jsx(xe,{icon:Ul,size:40,className:"opacity-30"}),s.jsx("p",{children:"Select a transcript from the list to preview it here."})]})]})]})]})]})]})}function CP(){const[t,n]=f.useState([]),[a,o]=f.useState(""),[c,l]=f.useState(!0),[d,m]=f.useState(""),[p,g]=f.useState(!0),[b,v]=f.useState([]);f.useEffect(()=>{try{Ne.getConfigJson("supportbot").then(Y=>{if(Y&&Y.data&&typeof Y.data=="object"){const te=kr(Y.data,"Ticket.DepartmentSystem.Enabled");typeof te=="boolean"&&g(te);const je=kr(Y.data,"Ticket.DepartmentSystem.Departments");if(je&&typeof je=="object"){const we=Object.entries(je).map(([Le,Xe])=>({id:Le,name:Xe&&typeof Xe=="object"&&Xe.Name?Xe.Name:Le,emoji:Xe&&typeof Xe=="object"&&Xe.Emoji?Xe.Emoji:"🎫"}));we.length>0&&(v(we),yn(we[0].id))}}}).catch(()=>{})}catch{}},[]);const[w,y]=f.useState("all"),[C,S]=f.useState("all"),[N,E]=f.useState(""),T=f.useMemo(()=>{const Y=new Set;return Array.isArray(t)&&t.forEach(te=>{if(te&&te.department&&typeof te.department=="string"){const je=te.department.trim().toLowerCase();je&&Y.add(je)}}),Array.from(Y).sort()},[t]),M=f.useMemo(()=>Array.isArray(t)?t.filter(Y=>{var te,je,we,Le,Xe,vt;if(!Y||p&&w!=="all"&&((te=Y.department)==null?void 0:te.toLowerCase())!==w.toLowerCase()||C!=="all"&&((je=Y.priority)==null?void 0:je.toLowerCase())!==C.toLowerCase())return!1;if(N.trim()){const gt=N.toLowerCase().trim(),jn=(we=Y.subject)==null?void 0:we.toLowerCase().includes(gt),mn=(Le=Y.ticket_id)==null?void 0:Le.toLowerCase().includes(gt),an=(Xe=Y.user_id)==null?void 0:Xe.toLowerCase().includes(gt),tr=p&&((vt=Y.department)==null?void 0:vt.toLowerCase().includes(gt));if(!jn&&!mn&&!an&&!tr)return!1}return!0}):[],[t,p,w,C,N]),[k,_]=f.useState(null),[R,L]=f.useState(!1),[ne,X]=f.useState(!1),[I,H]=f.useState([]),[q,ce]=f.useState(!1),[de,se]=f.useState(""),[P,W]=f.useState([]),[oe,ae]=f.useState(!1),[G,O]=f.useState(null),[D,B]=f.useState(!1),[V,Z]=f.useState(""),[be,K]=f.useState(null),[ge,me]=f.useState(""),[$,ie]=f.useState(!1),[ye,Se]=f.useState(null),[Be,Ke]=f.useState(""),[We,qt]=f.useState(null),[vn,Xn]=f.useState(!1),[br,yn]=f.useState("general"),[wn,Zn]=f.useState(""),[Kt,po]=f.useState(""),[Pt,Qn]=f.useState(!1),Da=async()=>{if(!wn.trim()){Dt.error("Please enter a subject or reason for the ticket.");return}Qn(!0);try{const Y=await Ne.createTicket({department:p?br:"general",subject:wn.trim(),userId:Kt.trim()||void 0});Dt.success(Y.message||"Ticket opened successfully!"),Xn(!1),Zn(""),po(""),yt()}catch(Y){Dt.error(Y instanceof Error?Y.message:"Failed to open ticket.")}finally{Qn(!1)}},Es=Y=>{Se(Y),Ke("Closed via Web Dashboard"),ie(!0)},qr=async()=>{if(!ye)return;const Y=ye.ticket_id;qt(Y);try{await Ne.closeTicket(Y,Be||"Closed via Web Dashboard"),Dt.success("Ticket closed and transcript saved."),n(te=>te.filter(je=>je.ticket_id!==Y)),(k==null?void 0:k.ticket_id)===Y&&(L(!1),X(!1),_(null)),ie(!1),Se(null)}catch(te){Dt.error(te instanceof Error?te.message:"Failed to close ticket.")}finally{qt(null)}},ho=f.useRef(null),Kr=f.useRef(null),Dn=()=>{var Y;(Y=ho.current)==null||Y.scrollIntoView({behavior:"smooth"})},yt=f.useCallback(async()=>{l(!0),m("");try{const Y=await Ne.listOpenTickets();Y.data&&(o(Y.data.guildId),n(Y.data.tickets.sort((te,je)=>je.created_at-te.created_at)))}catch(Y){m(Y instanceof Error?Y.message:"Failed to load open tickets")}finally{l(!1)}},[]);f.useEffect(()=>{yt()},[yt]),f.useEffect(()=>{Ne.getGuildResources().then(Y=>{Y.data&&O(Y.data)}).catch(()=>{})},[]);const On=f.useCallback(Y=>{k&&Y.ticketId===k.ticket_id&&(H(te=>te.some(je=>je.id===Y.message.id)?te:[...te,Y.message]),setTimeout(Dn,100))},[k]),Rt=f.useCallback(Y=>{k&&Y.ticketId===k.ticket_id&&H(te=>te.filter(je=>je.id!==Y.messageId))},[k]),Ai=f.useCallback(Y=>{k&&Y.ticketId===k.ticket_id&&H(te=>te.map(je=>je.id===Y.messageId?{...je,content:Y.content}:je))},[k]),_i=f.useCallback(Y=>{n(te=>te.some(je=>je.ticket_id===Y.ticket_id)?te:[Y,...te]),Dt.info("New Ticket Created",{description:`#${Y.ticket_id} - ${Y.subject||"No Subject"}`})},[]),go=f.useCallback(Y=>{n(te=>te.filter(je=>je.ticket_id!==Y.ticket_id)),(k==null?void 0:k.ticket_id)===Y.ticket_id&&Dt.warning("Active ticket was closed in Discord.")},[k]);kx({onTicketMessage:On,onTicketMessageDeleted:Rt,onTicketMessageUpdated:Ai,onTicketCreated:_i,onTicketClosed:go});const Wr=async Y=>{var te;_(Y),L(!0),ce(!0),H([]),W([]),K(null);try{const je=await Ne.getTicketMessages(Y.ticket_id);(te=je.data)!=null&&te.messages&&(H(je.data.messages),setTimeout(Dn,150))}catch(je){Dt.error(je instanceof Error?je.message:"Failed to fetch messages")}finally{ce(!1)}},Oa=Y=>{const te=Array.from(Y.target.files||[]);te.length&&(te.forEach(je=>{const we=new FileReader;we.onload=Le=>{var vt;const Xe=(vt=Le.target)==null?void 0:vt.result;W(gt=>[...gt,{filename:je.name,data:Xe,previewUrl:je.type.startsWith("image/")?Xe:void 0,sizeMb:(je.size/1024/1024).toFixed(2)}])},we.readAsDataURL(je)}),Kr.current&&(Kr.current.value=""))},Ar=Y=>{W(te=>te.filter((je,we)=>we!==Y))},Wt=async Y=>{var we;if(Y.preventDefault(),!de.trim()&&!P.length||!k||oe)return;const te=de.trim(),je=[...P];ae(!0),se(""),W([]),B(!1);try{const Le=await Ne.me().catch(()=>null),Xe=((we=Le==null?void 0:Le.data)==null?void 0:we.username)||"Staff",vt=await Ne.sendTicketReply(k.ticket_id,te,Xe,je.map(gt=>({filename:gt.filename,data:gt.data})));vt.data&&(H(gt=>gt.some(jn=>jn.id===vt.data.id)?gt:[...gt,{id:vt.data.id,author:vt.data.author,content:vt.data.content,attachments:vt.data.attachments||[],createdAt:vt.data.createdAt}]),setTimeout(Dn,100))}catch(Le){Dt.error(Le instanceof Error?Le.message:"Failed to send reply to Discord."),se(te),W(je)}finally{ae(!1)}},La=async Y=>{if(k)try{await Ne.deleteTicketMessage(k.ticket_id,Y),H(te=>te.filter(je=>je.id!==Y)),Dt.success("Message deleted in Discord.")}catch(te){Dt.error(te instanceof Error?te.message:"Failed to delete message.")}},De=Y=>{K(Y.id),me(Y.content)},rt=()=>{K(null),me("")},lt=async Y=>{if(!(!k||!ge.trim()))try{await Ne.editTicketMessage(k.ticket_id,Y,ge.trim()),H(te=>te.map(je=>je.id===Y?{...je,content:ge.trim()}:je)),K(null),Dt.success("Message updated in Discord.")}catch(te){Dt.error(te instanceof Error?te.message:"Failed to edit message.")}},rn=Y=>{const te=Y.target.value;se(te);const je=Y.target.selectionStart||te.length,we=te.slice(0,je),Le=we.lastIndexOf("@");if(Le!==-1&&!we.slice(Le).includes(" ")){const Xe=we.slice(Le+1).toLowerCase();Z(Xe),B(!0)}else B(!1)},It=(Y,te,je)=>{const we=de.lastIndexOf("@"),Le=de.slice(0,we),Xe=je?`<@&${te}>`:`<@${te}>`;se(`${Le}${Xe} `),B(!1)},Jn=Y=>{const te=Math.floor((Date.now()-Y)/1e3);return fg(te)},er=Y=>new Date(Y).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),bt=Y=>{if(!Y)return null;const te=/(```[\s\S]*?```|`[^`]+`|\*\*\*[\s\S]+?\*\*\*|\*\*[\s\S]+?\*\*|__[\s\S]+?__|~~[\s\S]+?~~|\|\|[\s\S]+?\|\||<@!?&?\d+>|^###\s[^\n]+|^##\s[^\n]+|^-#\s[^\n]+|\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+)/gm;return Y.split(te).map((we,Le)=>{var jn;if(!we)return null;if(we.startsWith("-# "))return s.jsx("span",{className:"text-xs text-muted-foreground font-medium block my-0.5 opacity-80",children:bt(we.slice(3))},Le);if(we.startsWith("## "))return s.jsx("span",{className:"text-base font-bold text-foreground block my-1 tracking-tight",children:bt(we.slice(3))},Le);if(we.startsWith("### "))return s.jsx("span",{className:"text-sm font-bold text-foreground block my-0.5",children:bt(we.slice(4))},Le);if(we.startsWith("```")&&we.endsWith("```")&&we.length>=6){const mn=we.slice(3,-3).replace(/^[a-z0-9_-]+\n/i,"");return s.jsx("pre",{className:"bg-black/60 p-2.5 rounded-lg text-xs font-mono my-1.5 border border-border overflow-x-auto text-emerald-400 font-mono",children:s.jsx("code",{children:mn})},Le)}if(we.startsWith("`")&&we.endsWith("`")&&we.length>2)return s.jsx("code",{className:"bg-black/50 px-1.5 py-0.5 rounded text-xs font-mono text-emerald-300 border border-border/40",children:we.slice(1,-1)},Le);if(we.startsWith("***")&&we.endsWith("***")&&we.length>6)return s.jsx("strong",{className:"font-bold italic",children:bt(we.slice(3,-3))},Le);if(we.startsWith("**")&&we.endsWith("**")&&we.length>4)return s.jsx("strong",{className:"font-bold",children:bt(we.slice(2,-2))},Le);if(we.startsWith("__")&&we.endsWith("__")&&we.length>4)return s.jsx("span",{className:"underline underline-offset-2",children:bt(we.slice(2,-2))},Le);if(we.startsWith("~~")&&we.endsWith("~~")&&we.length>4)return s.jsx("span",{className:"line-through opacity-80",children:bt(we.slice(2,-2))},Le);if(we.startsWith("||")&&we.endsWith("||")&&we.length>4)return s.jsx("span",{className:"bg-secondary text-transparent hover:text-foreground hover:bg-secondary/50 px-1.5 py-0.5 rounded transition-all cursor-pointer select-none border border-border/30",title:"Click to reveal spoiler",children:we.slice(2,-2)},Le);const Xe=we.match(/^<@!?(\d+)>$/);if(Xe){const mn=Xe[1],an=new Map;k&&an.set(k.user_id,"Ticket Author"),I.forEach(_r=>{var Xr;(Xr=_r.author)!=null&&Xr.id&&an.set(_r.author.id,_r.author.globalName||_r.author.username)});const tr=an.get(mn);return s.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded font-semibold text-xs bg-primary/20 text-primary mx-0.5",title:`User ID: ${mn}`,children:["@",tr||"User"]},Le)}const vt=we.match(/^<@&(\d+)>$/);if(vt){const mn=vt[1],an=(jn=G==null?void 0:G.roles)==null?void 0:jn.find(tr=>tr.id===mn);return s.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded font-semibold text-xs bg-amber-500/20 text-amber-400 mx-0.5",children:["@",an?an.name:`Role (${mn})`]},Le)}const gt=we.match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(gt){const mn=gt[1],an=gt[2];return s.jsx("a",{href:an,target:"_blank",rel:"noreferrer",className:"text-primary underline hover:opacity-80 break-all",children:mn},Le)}return/^https?:\/\/[^\s]+$/i.test(we)?/\.(gif|jpe?g|png|webp)(\?[^\s]*)?$/i.test(we)||/cdn\.discordapp\.com\/(emojis|attachments)\//i.test(we)||/images\.discordapp\.net\//i.test(we)||/media\d*\.giphy\.com\//i.test(we)?s.jsx("span",{className:"block my-1",children:s.jsx("img",{src:we,alt:"GIF/Image",className:"max-h-64 rounded-lg border border-border object-contain hover:opacity-95 transition-opacity",loading:"lazy"})},Le):s.jsx("a",{href:we,target:"_blank",rel:"noreferrer",className:"text-primary underline hover:opacity-80 break-all",children:we},Le):we})},Ln=Y=>!Y||Y.length===0?null:s.jsx("div",{className:"space-y-2 mt-1",children:Y.map(te=>{var Xe,vt,gt;const je=((Xe=te.contentType)==null?void 0:Xe.startsWith("image/"))||/\.(png|jpe?g|gif|webp|svg)$/i.test(te.name),we=((vt=te.contentType)==null?void 0:vt.startsWith("video/"))||/\.(mp4|webm|mov|mkv)$/i.test(te.name),Le=((gt=te.contentType)==null?void 0:gt.startsWith("audio/"))||/\.(mp3|wav|ogg|m4a)$/i.test(te.name);return je?s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-black/40",children:s.jsx("a",{href:te.url,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:te.url,alt:te.name,className:"max-h-80 max-w-full object-contain hover:opacity-95 transition-opacity",loading:"lazy"})})},te.id):we?s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-black",children:s.jsx("video",{src:te.url,controls:!0,className:"max-h-80 max-w-full"})},te.id):Le?s.jsx("div",{className:"p-2 border border-border rounded-lg bg-secondary/20",children:s.jsx("audio",{src:te.url,controls:!0,className:"w-full h-8"})},te.id):s.jsxs("div",{className:"p-2.5 rounded-lg border border-border bg-secondary/20 flex items-center justify-between text-xs gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 truncate",children:[s.jsx(xe,{icon:Uy,size:16,className:"text-primary shrink-0"}),s.jsx("span",{className:"truncate font-medium",children:te.name})]}),s.jsx(ue,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 px-2 text-xs",children:s.jsx("a",{href:te.url,target:"_blank",rel:"noreferrer",download:!0,children:"Download"})})]},te.id)})}),Di=Y=>!Y||Y.length===0?null:s.jsx("div",{className:"space-y-3 mt-1.5 w-full",children:Y.map((te,je)=>{var we,Le,Xe,vt;return s.jsxs("div",{className:"rounded-lg border border-border/60 bg-secondary/30 p-3.5 text-xs space-y-2 border-l-4 shadow-sm relative overflow-hidden max-w-xl",style:{borderLeftColor:te.color||"#5865F2"},children:[te.author&&s.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-foreground",children:[te.author.iconURL&&s.jsx("img",{src:te.author.iconURL,alt:"",className:"h-4 w-4 rounded-full"}),s.jsx("span",{children:te.author.name})]}),((we=te.thumbnail)==null?void 0:we.url)&&s.jsx("img",{src:te.thumbnail.url,alt:"",className:"h-12 w-12 rounded object-cover absolute top-3 right-3 border border-border"}),te.title&&s.jsx("h4",{className:"font-bold text-sm text-foreground tracking-tight pr-12",children:bt(te.title)}),te.description&&s.jsx("div",{className:"text-muted-foreground whitespace-pre-wrap leading-relaxed pr-12",children:bt(te.description)}),te.fields&&te.fields.length>0&&s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5 pt-2 border-t border-border/30",children:te.fields.map((gt,jn)=>s.jsxs("div",{className:`space-y-0.5 ${gt.inline?"":"sm:col-span-2"}`,children:[s.jsx("p",{className:"font-semibold text-foreground text-[11px] uppercase tracking-wider",children:gt.name}),s.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:bt(gt.value)})]},jn))}),((Le=te.image)==null?void 0:Le.url)&&s.jsx("div",{className:"rounded-md overflow-hidden border border-border mt-2",children:s.jsx("img",{src:te.image.url,alt:"",className:"max-h-64 w-full object-cover"})}),(te.footer||te.timestamp)&&s.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-border/20 text-[10px] text-muted-foreground",children:[((Xe=te.footer)==null?void 0:Xe.iconURL)&&s.jsx("img",{src:te.footer.iconURL,alt:"",className:"h-3.5 w-3.5 rounded-full"}),((vt=te.footer)==null?void 0:vt.text)&&s.jsx("span",{children:te.footer.text}),te.timestamp&&s.jsxs("span",{children:[new Date(te.timestamp).toLocaleDateString()," ",new Date(te.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]})]},je)})}),Oi=Y=>{if(!Y||Y.length===0)return null;const te=Y.map(je=>({...je,components:(je.components||[]).filter(we=>we.customId||we.url||we.type===2||we.type===3||we.type==="BUTTON"||we.type==="STRING_SELECT")})).filter(je=>je.components&&je.components.length>0);return te.length===0?null:s.jsx("div",{className:"space-y-2 mt-2.5 w-full",children:te.map((je,we)=>{var Le;return s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:(Le=je.components)==null?void 0:Le.map((Xe,vt)=>s.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-secondary/80 text-secondary-foreground text-xs font-semibold border border-border/80 shadow-sm hover:bg-secondary transition-colors cursor-pointer",children:[Xe.emoji&&s.jsx("span",{children:Xe.emoji}),s.jsx("span",{children:Xe.label||Xe.customId||"Button"})]},vt))},we)})})},Li=()=>s.jsx(fc,{className:"flex-1 p-4 sm:p-6",children:s.jsxs("div",{className:"max-w-4xl mx-auto w-full space-y-4",children:[q?s.jsxs("div",{className:"space-y-4 p-4",children:[s.jsx(Ue,{className:"h-10 w-3/4"}),s.jsx(Ue,{className:"h-10 w-1/2 ml-auto"}),s.jsx(Ue,{className:"h-10 w-2/3"})]}):I.length===0?s.jsx("div",{className:"p-12 text-center text-muted-foreground text-sm",children:"No recent messages in this ticket channel."}):I.map(Y=>{var te;return s.jsxs("div",{className:`group flex items-start gap-3 ${Y.author.isDashboard?"flex-row-reverse":""}`,children:[s.jsxs(vs,{className:"h-8 w-8 shrink-0",children:[s.jsx(eo,{src:Y.author.avatar,alt:Y.author.username}),s.jsx(ys,{children:s.jsx(xe,{icon:L8,size:16})})]}),s.jsxs("div",{className:`flex flex-col space-y-1 max-w-[80%] ${Y.author.isDashboard?"items-end":"items-start"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-semibold text-foreground",children:Y.author.globalName||Y.author.username}),Y.author.bot&&s.jsx(Fn,{variant:"secondary",className:"px-1 py-0 text-[10px]",children:"BOT"}),Y.author.isDashboard&&s.jsx(Fn,{variant:"default",className:"px-1 py-0 text-[10px]",children:"STAFF"}),s.jsx("span",{children:er(Y.createdAt)}),s.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-1",children:[s.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:()=>De(Y),title:"Edit Message",children:s.jsx(xe,{icon:D2,size:12})}),s.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-destructive",onClick:()=>La(Y.id),title:"Delete Message",children:s.jsx(xe,{icon:bi,size:12})})]})]}),be===Y.id?s.jsxs("div",{className:"flex items-center gap-2 w-full mt-1",children:[s.jsx(_e,{value:ge,onChange:je=>me(je.target.value),className:"h-8 text-sm",autoFocus:!0}),s.jsx(ue,{size:"sm",className:"h-8 px-2 bg-primary",onClick:()=>lt(Y.id),children:s.jsx(xe,{icon:_8,size:14})}),s.jsx(ue,{size:"sm",variant:"ghost",className:"h-8 px-2",onClick:rt,children:s.jsx(xe,{icon:ba,size:14})})]}):Y.content?s.jsx("div",{className:`rounded-lg px-3.5 py-2.5 text-sm whitespace-pre-wrap ${Y.author.isDashboard?"bg-primary text-primary-foreground":"bg-secondary/40 text-secondary-foreground border border-border/50"}`,style:Y.containerColor||Y.author.bot&&!((te=Y.embeds)!=null&&te.length)?{borderLeftWidth:"4px",borderLeftColor:Y.containerColor||"#5865F2"}:void 0,children:bt(Y.content)}):null,Ln(Y.attachments),Di(Y.embeds),Oi(Y.components)]})]},Y.id)}),s.jsx("div",{ref:ho})]})}),zi=()=>{var Y;return s.jsxs("div",{className:"p-4 border-t border-border bg-secondary/10 flex flex-col gap-2 relative",children:[P.length>0&&s.jsx("div",{className:"max-w-4xl mx-auto w-full flex items-center gap-2 flex-wrap mb-1",children:P.map((te,je)=>s.jsxs("div",{className:"flex items-center gap-2 p-1.5 px-3 rounded-lg border border-border bg-secondary text-xs",children:[te.previewUrl?s.jsx("img",{src:te.previewUrl,alt:"",className:"h-6 w-6 rounded object-cover"}):s.jsx(xe,{icon:Uy,size:14,className:"text-primary"}),s.jsx("span",{className:"font-medium max-w-[120px] truncate",children:te.filename}),s.jsxs("span",{className:"text-muted-foreground text-[10px]",children:[te.sizeMb,"MB"]}),s.jsx("button",{type:"button",onClick:()=>Ar(je),className:"text-muted-foreground hover:text-destructive ml-1",children:s.jsx(xe,{icon:ba,size:12})})]},je))}),D&&s.jsxs("div",{className:"max-w-4xl mx-auto w-full absolute bottom-full mb-2 z-50 bg-popover text-popover-foreground border border-border rounded-xl shadow-xl overflow-hidden max-h-48 overflow-y-auto",children:[s.jsx("div",{className:"p-2 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider border-b",children:"Mentions (@)"}),k&&s.jsxs("button",{type:"button",onClick:()=>It("Ticket Author",k.user_id,!1),className:"w-full text-left p-2 hover:bg-secondary flex items-center justify-between text-xs",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(vs,{className:"h-5 w-5",children:s.jsx(ys,{children:"U"})}),s.jsx("span",{className:"font-medium",children:"Ticket Author"})]}),s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["@",k.user_id]})]}),(Y=G==null?void 0:G.roles)==null?void 0:Y.filter(te=>te.name.toLowerCase().includes(V)).slice(0,5).map(te=>s.jsxs("button",{type:"button",onClick:()=>It(te.name,te.id,!0),className:"w-full text-left p-2 hover:bg-secondary flex items-center justify-between text-xs",children:[s.jsxs("span",{className:"font-medium text-amber-400",children:["@",te.name]}),s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"Role"})]},te.id))]}),s.jsxs("form",{onSubmit:Wt,className:"max-w-4xl mx-auto w-full flex items-center gap-2",children:[s.jsx("input",{type:"file",ref:Kr,multiple:!0,onChange:Oa,className:"hidden",accept:"image/*,video/*,audio/*,.pdf,.zip,.txt,.json"}),s.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{var te;return(te=Kr.current)==null?void 0:te.click()},title:"Attach files or media",className:"h-9 px-2.5",children:s.jsx(xe,{icon:v8,size:16})}),s.jsx(_e,{value:de,onChange:rn,placeholder:"Type a reply... Use @ to tag roles or users",disabled:oe||q,className:"flex-1"}),s.jsx(ue,{type:"submit",size:"sm",disabled:oe||!de.trim()&&!P.length||q,children:oe?s.jsx(xe,{icon:fr,size:16,className:"animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(xe,{icon:R8,size:16,className:"mr-1.5"}),"Send"]})})]})]})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Open Tickets"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage open support tickets & reply live to Discord channels from the web dashboard."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ue,{onClick:()=>Xn(!0),className:"gap-2 bg-primary font-semibold text-xs h-9",children:[s.jsx(xe,{icon:is,size:15})," Open Ticket"]}),s.jsxs(ue,{onClick:()=>void yt(),disabled:c,variant:"outline",size:"sm",children:[s.jsx(xe,{icon:fr,size:16,className:c?"animate-spin mr-2":"mr-2"}),"Refresh"]})]})]}),s.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-3 bg-card/60 p-3.5 rounded-xl border border-border/80 shadow-sm",children:[s.jsxs("div",{className:"relative w-full md:w-80",children:[s.jsx(xe,{icon:vi,size:15,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(_e,{placeholder:"Search tickets by ID, user, subject...",value:N,onChange:Y=>E(Y.target.value),className:"pl-9 text-xs h-9 bg-secondary/30 border-border"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 w-full md:w-auto justify-end",children:[p&&s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Department:"}),s.jsxs(Ca,{value:w,onValueChange:y,children:[s.jsx(Hr,{className:"text-xs h-9 w-[160px] bg-secondary/30 border-border capitalize",children:s.jsx(Sa,{placeholder:"All Departments"})}),s.jsxs(Gr,{children:[s.jsx(Et,{value:"all",children:"All Departments"}),T.map(Y=>s.jsx(Et,{value:Y,className:"capitalize",children:Y},Y))]})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Priority:"}),s.jsxs(Ca,{value:C,onValueChange:S,children:[s.jsx(Hr,{className:"text-xs h-9 w-[140px] bg-secondary/30 border-border capitalize",children:s.jsx(Sa,{placeholder:"All Priorities"})}),s.jsxs(Gr,{children:[s.jsx(Et,{value:"all",children:"All Priorities"}),s.jsx(Et,{value:"low",children:"Low"}),s.jsx(Et,{value:"medium",children:"Medium / Normal"}),s.jsx(Et,{value:"high",children:"High"}),s.jsx(Et,{value:"urgent",children:"Urgent"})]})]})]}),(w!=="all"||C!=="all"||N.trim())&&s.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>{y("all"),S("all"),E("")},className:"h-9 text-xs text-muted-foreground hover:text-foreground px-2",children:"Reset"})]})]}),s.jsx(Je,{className:"border-border bg-card",children:s.jsx(et,{className:"p-0",children:c?s.jsxs("div",{className:"space-y-4 p-6",children:[s.jsx(Ue,{className:"h-12 w-full"}),s.jsx(Ue,{className:"h-12 w-full"}),s.jsx(Ue,{className:"h-12 w-full"})]}):d?s.jsx("div",{className:"p-6",children:s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:d})})}):M.length===0?s.jsxs("div",{className:"p-12 text-center text-muted-foreground space-y-2",children:[s.jsx("p",{children:"No open tickets found matching your filter criteria."}),(w!=="all"||C!=="all"||N.trim())&&s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>{y("all"),S("all"),E("")},className:"text-xs mt-2",children:"Clear Filters"})]}):s.jsx("div",{className:"divide-y divide-border",children:M.map(Y=>s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between p-4 hover:bg-secondary/10 transition-colors gap-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("p",{className:"font-medium text-primary",children:Y.subject||"Untitled Ticket"}),s.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:["#",Y.ticket_id]}),p&&Y.department&&s.jsx(Fn,{variant:"outline",className:"text-xs capitalize",children:Y.department}),s.jsxs(Fn,{variant:Y.priority==="high"?"destructive":Y.priority==="medium"?"secondary":"outline",className:"text-xs capitalize",children:[Y.priority," priority"]})]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["User ID: ",s.jsx("span",{className:"font-mono",children:Y.user_id}),Y.description&&` • ${Y.description}`]})]}),s.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto justify-end",children:[s.jsxs("div",{className:"text-sm text-muted-foreground flex items-center whitespace-nowrap mr-2",children:[s.jsx(xe,{icon:h8,size:14,className:"mr-1.5"}),Jn(Y.created_at)]}),s.jsxs(ue,{variant:"default",size:"sm",onClick:()=>Wr(Y),className:"bg-primary text-primary-foreground hover:bg-primary/90",children:[s.jsx(xe,{icon:g8,size:16,className:"mr-2"}),"Live Chat"]}),s.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>Es(Y),disabled:We===Y.ticket_id,children:[We===Y.ticket_id?s.jsx(xe,{icon:fr,size:14,className:"animate-spin mr-1.5"}):s.jsx(xe,{icon:ba,size:14,className:"mr-1.5"}),"Close"]}),a&&s.jsx(ue,{variant:"secondary",size:"sm",asChild:!0,children:s.jsx("a",{href:`https://discord.com/channels/${a}/${Y.ticket_id}`,target:"_blank",rel:"noreferrer",children:s.jsx(xe,{icon:Nd,size:16})})})]})]},Y.ticket_id))})})}),R&&ne&&s.jsx("div",{className:"fixed inset-0 z-50 bg-black/65 backdrop-blur-sm flex items-center justify-center p-4 sm:p-6 lg:p-8 animate-in fade-in-0",onClick:Y=>{Y.target===Y.currentTarget&&X(!1)},children:s.jsxs("div",{className:"bg-card text-card-foreground border border-border rounded-2xl shadow-2xl flex flex-col w-full max-w-5xl h-[88vh] overflow-hidden animate-in zoom-in-95",children:[s.jsxs("div",{className:"p-4 border-b border-border bg-secondary/20 flex flex-col space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[s.jsx("h2",{className:"text-lg font-bold tracking-tight truncate",children:(k==null?void 0:k.subject)||"Ticket Live Chat"}),s.jsxs(Fn,{variant:"outline",className:"font-mono text-xs shrink-0",children:["#",k==null?void 0:k.ticket_id]}),p&&(k==null?void 0:k.department)&&s.jsx(Fn,{variant:"secondary",className:"text-xs capitalize shrink-0",children:k.department})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[k&&s.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>Es(k),disabled:We===k.ticket_id,className:"h-8 px-2.5 text-xs",children:[We===k.ticket_id?s.jsx(xe,{icon:fr,size:14,className:"animate-spin mr-1.5"}):s.jsx(xe,{icon:ba,size:14,className:"mr-1.5"}),"Close Ticket"]}),s.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>X(!1),className:"h-8 px-3 text-xs flex items-center gap-1.5",children:[s.jsx(xe,{icon:S8,size:14}),s.jsx("span",{children:"Collapse"})]}),s.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>{L(!1),X(!1)},className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:s.jsx(xe,{icon:ba,size:18})})]})]}),(k==null?void 0:k.description)&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]}),Li(),zi()]})}),R&&!ne&&s.jsx(Yj,{open:R,onOpenChange:L,children:s.jsxs(Hg,{side:"right",className:"w-full sm:max-w-xl p-0 flex flex-col h-full bg-card",children:[s.jsxs(Gg,{className:"p-4 border-b border-border space-y-1 bg-secondary/20",children:[s.jsxs("div",{className:"flex items-center justify-between pr-8",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[s.jsx(Vg,{className:"text-base font-bold truncate",children:(k==null?void 0:k.subject)||"Ticket Live Chat"}),s.jsxs(Fn,{variant:"outline",className:"font-mono text-xs shrink-0",children:["#",k==null?void 0:k.ticket_id]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[k&&s.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>Es(k),disabled:We===k.ticket_id,className:"h-7 px-2 text-xs",children:[We===k.ticket_id?s.jsx(xe,{icon:fr,size:13,className:"animate-spin mr-1"}):s.jsx(xe,{icon:ba,size:13,className:"mr-1"}),"Close"]}),s.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>X(!0),className:"h-7 px-2 text-xs flex items-center gap-1",title:"Open in Full View",children:[s.jsx(xe,{icon:C8,size:13}),s.jsx("span",{children:"Full View"})]})]})]}),(k==null?void 0:k.description)&&s.jsx(Fg,{className:"text-xs text-muted-foreground truncate",children:k.description})]}),Li(),zi()]})}),s.jsx(Qs,{open:$,onOpenChange:ie,children:s.jsxs(hs,{className:"sm:max-w-md bg-card border-border rounded-xl",children:[s.jsxs(gs,{children:[s.jsxs(xs,{className:"text-lg font-bold flex items-center gap-2",children:[s.jsx(xe,{icon:ba,className:"text-destructive",size:20}),"Close Ticket #",ye==null?void 0:ye.ticket_id]}),s.jsx(bs,{className:"text-xs text-muted-foreground pt-1",children:"Are you sure you want to close this ticket? A transcript will be created and the channel will be deleted in Discord."})]}),s.jsxs("div",{className:"space-y-2 py-2",children:[s.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Reason for closing (Optional)"}),s.jsx(_e,{value:Be,onChange:Y=>Ke(Y.target.value),placeholder:"e.g. Issue resolved by support team",className:"text-sm"})]}),s.jsxs(Js,{className:"gap-2 sm:gap-0 mt-2",children:[s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>ie(!1),disabled:!!We,children:"Cancel"}),s.jsxs(ue,{variant:"destructive",size:"sm",onClick:qr,disabled:!!We,children:[We?s.jsx(xe,{icon:fr,size:14,className:"animate-spin mr-1.5"}):s.jsx(xe,{icon:ba,size:14,className:"mr-1.5"}),"Confirm Close"]})]})]})}),s.jsx(Qs,{open:vn,onOpenChange:Xn,children:s.jsxs(hs,{className:"sm:max-w-[450px]",children:[s.jsxs(gs,{children:[s.jsxs(xs,{className:"text-base flex items-center gap-2",children:[s.jsx(xe,{icon:is,size:18,className:"text-primary"}),"Open Direct Ticket"]}),s.jsx(bs,{className:"text-xs",children:p?"Select a support department to create a new ticket channel in Discord immediately.":"Create a new ticket channel in Discord immediately."})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[p&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ae,{className:"text-xs font-semibold",children:"Department"}),s.jsxs(Ca,{value:br,onValueChange:yn,children:[s.jsx(Hr,{className:"text-xs border-border bg-secondary/30",children:s.jsx(Sa,{})}),s.jsx(Gr,{children:(b.length>0?b:[{id:"general",name:"General Support",emoji:"🎫"},{id:"purchase",name:"Purchase & Billing Support",emoji:"💳"},{id:"reports",name:"Player Report",emoji:"🚨"},{id:"appeals",name:"Ban Appeals",emoji:"⚖️"}]).map(Y=>s.jsxs(Et,{value:Y.id,children:[Y.emoji?`${Y.emoji} `:"",Y.name]},Y.id))})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ae,{className:"text-xs font-semibold",children:"Ticket Subject / Reason"}),s.jsx(_e,{value:wn,onChange:Y=>Zn(Y.target.value),placeholder:"e.g. Assistance with server permissions",className:"text-xs border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Ae,{className:"text-xs font-semibold",children:"Discord User ID (Optional)"}),s.jsx(_e,{value:Kt,onChange:Y=>po(Y.target.value),placeholder:"e.g. 123456789012345678 (Leave blank for yourself)",className:"text-xs font-mono border-border bg-secondary/30"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"If specified, the ticket channel will be created for this user."})]})]}),s.jsxs(Js,{className:"gap-2 sm:gap-0",children:[s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>Xn(!1),disabled:Pt,className:"text-xs",children:"Cancel"}),s.jsxs(ue,{size:"sm",onClick:Da,disabled:Pt||!wn.trim(),className:"gap-1.5 text-xs bg-primary font-semibold",children:[Pt?s.jsx(xe,{icon:fr,size:14,className:"animate-spin"}):s.jsx(xe,{icon:is,size:14}),Pt?"Opening Ticket...":"Open Ticket"]})]})]})})]})}const SP=["admin","moderator","editor","viewer","custom"];function NP(){return{mode:"add",id:"",username:"",globalName:"",role:"viewer",enabled:!0,permissions:ls("viewer"),yamlOwner:!1}}function EP({permissions:t,onChange:n,disabled:a}){const o=d=>n({...t,...d}),c=[{key:"overview",title:"Dashboard Overview",description:"Access to system metrics, bot health status, and main dashboard stats."},{key:"tickets",title:"Support Tickets",description:"View open support tickets, live web chat, send staff replies, and close tickets."},{key:"transcripts",title:"Ticket Transcripts",description:"Access saved ticket HTML transcripts and configure public transcript options."},{key:"logs",title:"Console Terminal Logs",description:"View real-time bot terminal output, system logs, and runtime error traces."}],l=[["supportbot","Bot config","Main bot token, prefix, channels, categories, and core settings."],["ticket-panel","Ticket panel","Ticket home embed, button labels, dropdown options, and panel styling."],["commands","Commands","Enable/disable slash commands, descriptions, and custom names."],["messages","Messages","Custom bot response messages, welcome embeds, and embed colors."],["supportbot-ai","AI assistant","Configure AI support rules, model API keys, and auto-response channels."]];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"General & Modules Access"}),s.jsx("div",{className:"grid gap-2.5",children:c.map(({key:d,title:m,description:p})=>s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsx(Mt,{checked:t[d]??(d==="tickets"?t.overview:!1),disabled:a,onCheckedChange:g=>o({[d]:g}),className:"shrink-0"})]},d))})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Administration & Settings"}),s.jsxs("div",{className:"grid gap-2.5",children:[s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View system branding, OAuth configurations, and system health details."})]}),s.jsx(Mt,{checked:t.settings.view,disabled:a,onCheckedChange:d=>o({settings:{...t.settings,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (Install Updates)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Perform 1-click bot system updates and trigger bot server restarts."})]}),s.jsx(Mt,{checked:t.settings.update,disabled:a,onCheckedChange:d=>o({settings:{...t.settings,update:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View dashboard staff accounts and permission group listings."})]}),s.jsx(Mt,{checked:t.users.view,disabled:a,onCheckedChange:d=>o({users:{...t.users,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (Manage)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Create, edit, assign, and delete staff accounts and permission groups."})]}),s.jsx(Mt,{checked:t.users.manage,disabled:a,onCheckedChange:d=>o({users:{...t.users,manage:d}}),className:"shrink-0"})]})]})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Configuration Files Access"}),s.jsxs("div",{className:"grid gap-2.5",children:[l.map(([d,m,p])=>{var b;const g=((b=t.configs)==null?void 0:b[d])??{view:!1,edit:!1};return s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"View"}),s.jsx(Mt,{checked:g.view,disabled:a,onCheckedChange:v=>o({configs:{...t.configs,[d]:{...g,view:v}}})})]}),s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"Edit"}),s.jsx(Mt,{checked:g.edit,disabled:a,onCheckedChange:v=>o({configs:{...t.configs,[d]:{...g,edit:v,view:v?!0:g.view}}})})]})]})]},d)}),s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Raw YAML Code Editor"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Access the raw YAML code editor tab to view or edit full raw configuration files."})]}),s.jsx("div",{className:"flex items-center gap-4 shrink-0",children:s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"Access"}),s.jsx(Mt,{checked:t.rawYaml??!1,disabled:a,onCheckedChange:d=>o({rawYaml:d})})]})})]})]})]})]})}function kP(t){return t.permissions.users.manage?"Full + user management":t.permissions.settings.update?"Configs + settings updates":Object.values(t.permissions.configs).some(n=>n.edit)?"Can edit configs":"View only"}function TP(){const{user:t,hasPermission:n}=Yt(),a=n("users.manage"),[o,c]=f.useState([]),[l,d]=f.useState([]),[m,p]=f.useState(!0),[g,b]=f.useState(""),[v,w]=f.useState(null),[y,C]=f.useState(!1),S=f.useCallback(async()=>{p(!0),b("");try{const[R,L]=await Promise.all([Ne.listDashboardUsers(),Ne.listGroups().catch(()=>({data:{groups:[]}}))]);R.data&&c(R.data.users),L.data&&d(L.data.groups)}catch(R){b(R instanceof Error?R.message:"Failed to load users")}finally{p(!1)}},[]);f.useEffect(()=>{S()},[S]);const N=f.useMemo(()=>[...o].sort((R,L)=>R.yamlOwner!==L.yamlOwner?R.yamlOwner?-1:1:(R.username||R.id).localeCompare(L.username||L.id)),[o]);function E(){w(NP())}function T(R){w({mode:"edit",id:R.id,username:R.username||"",globalName:R.globalName||"",role:R.yamlOwner?"owner":R.role,enabled:R.enabled,permissions:R.role==="custom"?R.permissions:ls(R.role),yamlOwner:R.yamlOwner})}function M(R){v&&w({...v,role:R,permissions:ls(R,v.permissions)})}async function k(){if(!(!v||!a)){C(!0),b("");try{v.mode==="add"?await Ne.addDashboardUser({id:v.id.trim(),role:v.role,username:v.username||void 0,globalName:v.globalName||void 0,enabled:v.enabled,permissions:v.role==="custom"?v.permissions:void 0}):await Ne.updateDashboardUser(v.id,{role:v.yamlOwner?void 0:v.role,enabled:v.enabled,username:v.username||void 0,globalName:v.globalName||void 0,permissions:v.role==="custom"?v.permissions:void 0}),w(null),await S()}catch(R){b(R instanceof Error?R.message:"Could not save user")}finally{C(!1)}}}async function _(R){if(a&&window.confirm("Remove this user from the dashboard?")){b("");try{await Ne.removeDashboardUser(R),await S()}catch(L){b(L instanceof Error?L.message:"Could not remove user")}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Users"}),s.jsxs("p",{className:"text-muted-foreground",children:["Control who can sign in and what they can view or edit. Owners in"," ",s.jsx("code",{className:"rounded bg-primary/10 px-1 text-xs text-primary",children:"api.yml"})," ","always have full access."]})]}),a?s.jsxs(ue,{onClick:E,children:[s.jsx(xe,{icon:sg,size:16,className:"mr-2"}),"Add user"]}):null]}),g?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:g})}):null,s.jsx(Je,{className:"border-border bg-card overflow-hidden",children:s.jsx(et,{className:"p-0",children:m?s.jsxs("div",{className:"p-4 space-y-2",children:[s.jsx(Ue,{className:"h-8 w-full rounded-md"}),s.jsx(Ue,{className:"h-8 w-full rounded-md"})]}):N.length===0?s.jsx("div",{className:"p-6 text-center text-xs text-muted-foreground",children:"No users found."}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border/80 bg-secondary/30 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-2.5",children:"User"}),s.jsx("th",{className:"px-4 py-2.5",children:"Group"}),s.jsx("th",{className:"px-4 py-2.5",children:"Access Summary"}),s.jsx("th",{className:"px-4 py-2.5",children:"Status"}),a&&s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-border/40",children:N.map(R=>{const L=l.find(I=>I.id===R.groupId||I.id===R.role),ne=(L==null?void 0:L.color)||"#10B981",X=(L==null?void 0:L.name)||$y[R.yamlOwner?"owner":R.role]||R.role;return s.jsxs("tr",{className:"transition-colors hover:bg-secondary/25",children:[s.jsx("td",{className:"px-4 py-2.5 font-medium whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsxs(vs,{className:"size-7",children:[s.jsx(eo,{src:R.avatar,alt:R.username}),s.jsx(ys,{className:"text-[10px]",children:(R.username||R.id).slice(0,2).toUpperCase()})]}),s.jsxs("div",{className:"min-w-0 leading-tight",children:[s.jsxs("p",{className:"truncate font-semibold text-foreground text-xs",children:[P2(R),R.id===(t==null?void 0:t.id)?s.jsx("span",{className:"text-[11px] text-primary font-normal ml-1",children:"(you)"}):""]}),s.jsx("p",{className:"truncate text-[10px] text-muted-foreground font-mono",children:R.id})]})]})}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full shrink-0 shadow-sm",style:{backgroundColor:ne}}),s.jsx("span",{className:"font-medium text-xs text-foreground",children:X}),R.yamlOwner&&s.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20",children:"Config Owner"})]})}),s.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground max-w-xs truncate",children:kP(R)}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:R.enabled?s.jsx(Fn,{className:"text-[10px] px-2 py-0.5 bg-emerald-500/15 text-emerald-400 hover:bg-emerald-500/15 border-emerald-500/20",children:"Active"}):s.jsx(Fn,{variant:"outline",className:"text-[10px] px-2 py-0.5",children:"Disabled"})}),a&&s.jsx("td",{className:"px-4 py-2.5 text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(ue,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>T(R),children:[s.jsx(xe,{icon:b8,size:13}),"Edit"]}),!R.yamlOwner&&s.jsxs(ue,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-destructive",onClick:()=>_(R.id),children:[s.jsx(xe,{icon:bi,size:13}),"Remove"]})]})})]},R.id)})})]})})})}),s.jsx(Qs,{open:!!v,onOpenChange:R=>!R&&w(null),children:s.jsxs(hs,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[s.jsxs(gs,{children:[s.jsx(xs,{children:(v==null?void 0:v.mode)==="add"?"Add dashboard user":"Edit user"}),s.jsx(bs,{children:v!=null&&v.yamlOwner?"This user is an owner in api.yml. Role and removal are managed in the config file.":P8[(v==null?void 0:v.role)??"viewer"]})]}),v?s.jsxs("div",{className:"space-y-4",children:[v.mode==="add"?s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"discord-id",children:"Discord user ID"}),s.jsx(_e,{id:"discord-id",value:v.id,onChange:R=>w({...v,id:R.target.value}),placeholder:"829112572816130058"})]}):null,s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Display name (optional)"}),s.jsx(_e,{value:v.globalName,onChange:R=>w({...v,globalName:R.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Username (optional)"}),s.jsx(_e,{value:v.username,onChange:R=>w({...v,username:R.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{children:"Permission Group"}),s.jsxs(Ca,{value:v.role,disabled:v.yamlOwner,onValueChange:R=>{const L=l.find(ne=>ne.id===R);L?w({...v,role:R,permissions:L.permissions}):M(R)},children:[s.jsx(Hr,{children:s.jsx(Sa,{})}),s.jsx(Gr,{children:v.yamlOwner?s.jsx(Et,{value:"owner",children:"Owner"}):l.length>0?l.map(R=>s.jsx(Et,{value:R.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-2.5 rounded-full shrink-0",style:{backgroundColor:R.color||"#10B981"}}),s.jsx("span",{children:R.name})]})},R.id)):SP.map(R=>s.jsx(Et,{value:R,children:$y[R]},R))})]})]}),s.jsxs("label",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2",children:[s.jsx("span",{className:"text-sm",children:"Account enabled"}),s.jsx(Mt,{checked:v.enabled,disabled:v.yamlOwner,onCheckedChange:R=>w({...v,enabled:R})})]}),v.role==="custom"&&!v.yamlOwner?s.jsx(EP,{permissions:v.permissions,onChange:R=>w({...v,permissions:R})}):null]}):null,s.jsxs(Js,{children:[s.jsx(ue,{variant:"outline",onClick:()=>w(null),children:"Cancel"}),s.jsx(ue,{disabled:y||!a||(v==null?void 0:v.mode)==="add"&&!/^\d{17,20}$/.test(v.id.trim()),onClick:()=>void k(),children:y?"Saving…":"Save"})]})]})})]})}const MP=[{name:"Emerald",hex:"#10B981"},{name:"Blue",hex:"#3B82F6"},{name:"Purple",hex:"#8B5CF6"},{name:"Amber",hex:"#F59E0B"},{name:"Red",hex:"#EF4444"},{name:"Cyan",hex:"#06B6D4"},{name:"Gray",hex:"#6B7280"}];function RP({permissions:t,onChange:n,disabled:a}){const o=d=>n({...t,...d}),c=[{key:"overview",title:"Dashboard Overview",description:"Access to system metrics, bot health status, and main dashboard stats."},{key:"tickets",title:"Support Tickets",description:"View open support tickets, live web chat, send staff replies, and close tickets."},{key:"transcripts",title:"Ticket Transcripts",description:"Access saved ticket HTML transcripts and configure public transcript options."},{key:"logs",title:"Console Terminal Logs",description:"View real-time bot terminal output, system logs, and runtime error traces."}],l=[["supportbot","Bot config","Main bot token, prefix, channels, categories, and core settings."],["ticket-panel","Ticket panel","Ticket home embed, button labels, dropdown options, and panel styling."],["commands","Commands","Enable/disable slash commands, descriptions, and custom names."],["messages","Messages","Custom bot response messages, welcome embeds, and embed colors."],["supportbot-ai","AI assistant","Configure AI support rules, model API keys, and auto-response channels."]];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"General & Modules Access"}),s.jsx("div",{className:"grid gap-2.5",children:c.map(({key:d,title:m,description:p})=>s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsx(Mt,{checked:t[d]??(d==="tickets"?t.overview:!1),disabled:a,onCheckedChange:g=>o({[d]:g}),className:"shrink-0"})]},d))})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Administration & Settings"}),s.jsxs("div",{className:"grid gap-2.5",children:[s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View system branding, OAuth configurations, and system health details."})]}),s.jsx(Mt,{checked:t.settings.view,disabled:a,onCheckedChange:d=>o({settings:{...t.settings,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (Install Updates)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Perform 1-click bot system updates and trigger bot server restarts."})]}),s.jsx(Mt,{checked:t.settings.update,disabled:a,onCheckedChange:d=>o({settings:{...t.settings,update:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View dashboard staff accounts and permission group listings."})]}),s.jsx(Mt,{checked:t.users.view,disabled:a,onCheckedChange:d=>o({users:{...t.users,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (Manage)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Create, edit, assign, and delete staff accounts and permission groups."})]}),s.jsx(Mt,{checked:t.users.manage,disabled:a,onCheckedChange:d=>o({users:{...t.users,manage:d}}),className:"shrink-0"})]})]})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Configuration Files Access"}),s.jsxs("div",{className:"grid gap-2.5",children:[l.map(([d,m,p])=>{var b;const g=((b=t.configs)==null?void 0:b[d])??{view:!1,edit:!1};return s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"View"}),s.jsx(Mt,{checked:g.view,disabled:a,onCheckedChange:v=>o({configs:{...t.configs,[d]:{...g,view:v}}})})]}),s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"Edit"}),s.jsx(Mt,{checked:g.edit,disabled:a,onCheckedChange:v=>o({configs:{...t.configs,[d]:{...g,edit:v,view:v?!0:g.view}}})})]})]})]},d)}),s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Raw YAML Code Editor"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Access the raw YAML code editor tab to view or edit full raw configuration files."})]}),s.jsx("div",{className:"flex items-center gap-4 shrink-0",children:s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"Access"}),s.jsx(Mt,{checked:t.rawYaml??!1,disabled:a,onCheckedChange:d=>o({rawYaml:d})})]})})]})]})]})]})}function AP(){const{permissions:t,impersonateGroup:n,impersonatedGroup:a,stopImpersonation:o}=Yt(),c=Rn(t,"users.manage"),[l,d]=f.useState([]),[m,p]=f.useState(!0),[g,b]=f.useState(null),[v,w]=f.useState(null),[y,C]=f.useState(!1),[S,N]=f.useState("add"),[E,T]=f.useState(!1),[M,k]=f.useState(""),[_,R]=f.useState(""),[L,ne]=f.useState(""),[X,I]=f.useState("#10B981"),[H,q]=f.useState(""),[ce,de]=f.useState(ls("viewer")),se=async()=>{var G;p(!0),b(null);try{const O=await Ne.listGroups();d(((G=O.data)==null?void 0:G.groups)||[])}catch(O){b(O instanceof Error?O.message:"Failed to load groups")}finally{p(!1)}};f.useEffect(()=>{se()},[]);const P=()=>{N("add"),k(""),R(""),ne(""),I("#10B981"),q(""),de(ls("viewer")),C(!0)},W=G=>{N("edit"),k(G.id),R(G.name),ne(G.description||""),I(G.color||"#10B981"),q(G.discordRoleId||""),de(G.permissions||ls("viewer")),C(!0)},oe=async()=>{if(!_.trim()){b("Group name is required");return}T(!0),b(null);try{S==="add"?(await Ne.createGroup({name:_.trim(),description:L.trim(),color:X,discordRoleId:H.trim()||null,permissions:ce}),w(`Group "${_}" created successfully.`)):(await Ne.updateGroup(M,{name:_.trim(),description:L.trim(),color:X,discordRoleId:H.trim()||null,permissions:ce}),w(`Group "${_}" updated successfully.`)),C(!1),await se()}catch(G){b(G instanceof Error?G.message:"Failed to save group")}finally{T(!1)}},ae=async G=>{if(!G.isSystem&&confirm(`Are you sure you want to delete the group "${G.name}"?`))try{await Ne.deleteGroup(G.id),w(`Group "${G.name}" deleted.`),await se()}catch(O){b(O instanceof Error?O.message:"Failed to delete group")}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Permission Groups"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Create custom permission groups, assign staff members, and optionally sync with Discord Role IDs."})]}),c&&s.jsxs(ue,{onClick:P,className:"shrink-0 gap-2 bg-primary",children:[s.jsx(xe,{icon:sg,size:18}),"Create Group"]})]}),g&&s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:g})}),v&&s.jsx(Ye,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-500",children:s.jsxs(qe,{className:"flex items-center justify-between",children:[s.jsx("span",{children:v}),s.jsx(ue,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>w(null),children:"Dismiss"})]})}),s.jsx(Je,{className:"border-border bg-card overflow-hidden",children:s.jsx(et,{className:"p-0",children:m?s.jsxs("div",{className:"p-4 space-y-2",children:[s.jsx(Ue,{className:"h-8 w-full rounded-md"}),s.jsx(Ue,{className:"h-8 w-full rounded-md"})]}):l.length===0?s.jsx("div",{className:"p-6 text-center text-xs text-muted-foreground",children:'No permission groups found. Click "Create Group" to add one.'}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border/80 bg-secondary/30 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-2.5",children:"Group"}),s.jsx("th",{className:"px-4 py-2.5",children:"Description"}),s.jsx("th",{className:"px-4 py-2.5",children:"Discord Role ID"}),s.jsx("th",{className:"px-4 py-2.5",children:"Enabled Permissions"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-border/40",children:l.map(G=>{var O,D,B,V,Z,be,K;return s.jsxs("tr",{className:"transition-colors hover:bg-secondary/25",children:[s.jsx("td",{className:"px-4 py-2.5 font-medium whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-2.5 rounded-full shrink-0 shadow-sm",style:{backgroundColor:G.color||"#10B981"}}),s.jsx("span",{className:"text-foreground font-semibold text-xs",children:G.name}),G.isSystem&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold px-1.5 py-0.5 rounded-full bg-secondary text-secondary-foreground border border-border/80",children:[s.jsx(xe,{icon:qu,size:10}),"System"]})]})}),s.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground max-w-xs truncate",children:G.description||"—"}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:G.discordRoleId?s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground font-mono bg-secondary/50 px-2 py-0.5 rounded border border-border/50",children:[s.jsx(xe,{icon:qu,size:12,className:"text-primary"}),G.discordRoleId]}):s.jsx("span",{className:"text-xs text-muted-foreground/60",children:"—"})}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsxs("div",{className:"flex flex-wrap gap-1 max-w-md",children:[((O=G.permissions)==null?void 0:O.overview)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20",children:"Overview"}),(((D=G.permissions)==null?void 0:D.tickets)??((B=G.permissions)==null?void 0:B.overview))&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:"Tickets"}),((V=G.permissions)==null?void 0:V.transcripts)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-400 border border-purple-500/20",children:"Transcripts"}),((Z=G.permissions)==null?void 0:Z.logs)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20",children:"Logs"}),((K=(be=G.permissions)==null?void 0:be.users)==null?void 0:K.manage)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20",children:"User Mgmt"})]})}),s.jsx("td",{className:"px-4 py-2.5 text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(ue,{size:"sm",variant:"ghost",className:`h-7 px-2 text-xs gap-1 ${(a==null?void 0:a.id)===G.id?"text-amber-400 font-bold bg-amber-500/15 border border-amber-500/30":"text-amber-400 hover:text-amber-300 hover:bg-amber-500/10"}`,onClick:()=>(a==null?void 0:a.id)===G.id?o():n(G.id),children:[s.jsx(xe,{icon:qu,size:13}),(a==null?void 0:a.id)===G.id?"Active Preview":"View as Group"]}),c&&G.id!=="owner"&&s.jsxs(ue,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>W(G),children:[s.jsx(xe,{icon:D2,size:13}),"Edit"]}),c&&!G.isSystem&&s.jsxs(ue,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-destructive",onClick:()=>ae(G),children:[s.jsx(xe,{icon:bi,size:13}),"Delete"]})]})})]},G.id)})})]})})})}),s.jsx(Qs,{open:y,onOpenChange:C,children:s.jsxs(hs,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(gs,{children:[s.jsx(xs,{children:S==="add"?"Create Permission Group":`Edit Group: ${_}`}),s.jsx(bs,{children:"Configure group metadata, custom color badge, Discord role sync, and permission rules."})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"group-name",children:"Group Name"}),s.jsx(_e,{id:"group-name",placeholder:"e.g. Support Staff",value:_,onChange:G=>R(G.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"group-color",children:"Color Badge"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(tf,{value:X,onChange:I}),s.jsx(_e,{value:X,onChange:G=>I(G.target.value),placeholder:"#10B981",className:"w-28 font-mono text-sm uppercase"}),s.jsx("div",{className:"flex flex-wrap gap-1 ml-auto",children:MP.map(G=>s.jsx("button",{type:"button",className:"size-6 rounded-full border border-white/20 transition-transform hover:scale-110",style:{backgroundColor:G.hex},onClick:()=>I(G.hex),title:G.name},G.hex))})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ae,{htmlFor:"group-desc",children:"Description"}),s.jsx(_e,{id:"group-desc",placeholder:"Brief description of what members in this group can access...",value:L,onChange:G=>ne(G.target.value)})]}),s.jsx(TS,{id:"discord-role-id",label:"Discord Role ID (Optional Auto-Sync)",description:"If provided, Discord users with this Role ID will automatically inherit this group upon login.",kind:"role",value:H,onChange:G=>q(String(G??""))}),s.jsxs("div",{className:"pt-2",children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Group Permission Matrix"}),s.jsx(RP,{permissions:ce,onChange:de})]})]}),s.jsxs(Js,{className:"gap-2 sm:gap-0",children:[s.jsx(ue,{variant:"outline",onClick:()=>C(!1),disabled:E,children:"Cancel"}),s.jsx(ue,{onClick:oe,disabled:E,className:"bg-primary",children:E?"Saving...":S==="add"?"Create Group":"Save Changes"})]})]})})]})}function _P({children:t}){const{isAuthenticated:n,loading:a}=Yt();return a?s.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):n?s.jsx(s.Fragment,{children:t}):s.jsx(ya,{to:"/login",replace:!0})}function DP(){const{complete:t,loading:n}=fS(),a=Kn();return n?s.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):t?a.pathname==="/setup"?s.jsx(ya,{to:"/login",replace:!0}):s.jsxs(Py,{children:[s.jsx(un,{path:"/login",element:s.jsx(vz,{})}),s.jsxs(un,{element:s.jsx(_P,{children:s.jsx(TA,{})}),children:[s.jsx(un,{index:!0,element:s.jsx(Vz,{})}),s.jsx(un,{path:"system",element:s.jsx(ga,{permission:"overview",children:s.jsx(sP,{})})}),s.jsx(un,{path:"settings",element:s.jsx(ga,{permission:"settings.view",children:s.jsx(nP,{})})}),s.jsx(un,{path:"configs",element:s.jsx(gz,{})}),s.jsx(un,{path:"logs",element:s.jsx(ga,{permission:"logs",children:s.jsx(mP,{})})}),s.jsx(un,{path:"tickets",element:s.jsx(ga,{permission:"transcripts",children:s.jsx(CP,{})})}),s.jsx(un,{path:"transcripts",element:s.jsx(ga,{permission:"transcripts",children:s.jsx(jP,{})})}),s.jsx(un,{path:"users",element:s.jsx(ga,{permission:"users.view",children:s.jsx(TP,{})})}),s.jsx(un,{path:"groups",element:s.jsx(ga,{permission:"users.view",children:s.jsx(AP,{})})}),s.jsx(un,{path:"addons",element:s.jsx(ga,{permission:"settings.view",children:s.jsx(Fz,{})})}),s.jsx(un,{path:"addons/builder",element:s.jsx(ga,{permission:"settings.update",children:s.jsx(Yz,{})})})]}),s.jsx(un,{path:"*",element:s.jsx(ya,{to:"/",replace:!0})})]}):s.jsxs(Py,{children:[s.jsx(un,{path:"/setup",element:s.jsx(Lz,{})}),s.jsx(un,{path:"*",element:s.jsx(ya,{to:"/setup",replace:!0})})]})}function OP({...t}){return s.jsx(KO,{theme:"dark",position:"bottom-right",richColors:!0,closeButton:!0,style:{fontFamily:'"Poppins", system-ui, sans-serif'},toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground"}},...t})}Zz();_3.createRoot(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(a8,{children:s.jsx(aC,{children:s.jsx(B8,{children:s.jsx(MA,{children:s.jsxs(U8,{children:[s.jsx(DP,{}),s.jsx(OP,{})]})})})})})}));
|